create netif directory
[unix-history] / usr / src / sys / vax / if / if_en.c
index 821cbb8..6299fcb 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_en.c 4.65    82/06/13        */
+/*     if_en.c 4.71    82/10/24        */
 
 #include "en.h"
 
 
 #include "en.h"
 
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/buf.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
-#include "../h/ubareg.h"
-#include "../h/ubavar.h"
-#include "../h/enreg.h"
-#include "../h/cpu.h"
-#include "../h/mtpr.h"
 #include "../h/vmmac.h"
 #include "../h/vmmac.h"
-#include "../net/in.h"
-#include "../net/in_systm.h"
+#include <errno.h>
+
 #include "../net/if.h"
 #include "../net/if.h"
-#include "../net/if_en.h"
-#include "../net/if_uba.h"
-#include "../net/ip.h"
-#include "../net/ip_var.h"
-#include "../net/pup.h"
+#include "../net/netisr.h"
 #include "../net/route.h"
 #include "../net/route.h"
-#include <errno.h>
+#include "../netinet/in.h"
+#include "../netinet/in_systm.h"
+#include "../netinet/ip.h"
+#include "../netinet/ip_var.h"
+#include "../netpup/pup.h"
+
+#include "../vax/cpu.h"
+#include "../vax/mtpr.h"
+#include "../vaxif/if_en.h"
+#include "../vaxif/if_enreg.h"
+#include "../vaxif/if_uba.h"
+#include "../vaxuba/ubareg.h"
+#include "../vaxuba/ubavar.h"
 
 #define        ENMTU   (1024+512)
 #define        ENMRU   (1024+512+16)           /* 16 is enough to receive trailer */
 
 #define        ENMTU   (1024+512)
 #define        ENMRU   (1024+512+16)           /* 16 is enough to receive trailer */
@@ -74,7 +77,6 @@ enprobe(reg)
        register int br, cvec;          /* r11, r10 value-result */
        register struct endevice *addr = (struct endevice *)reg;
 
        register int br, cvec;          /* r11, r10 value-result */
        register struct endevice *addr = (struct endevice *)reg;
 
-COUNT(ENPROBE);
 #ifdef lint
        br = 0; cvec = br; br = cvec;
        enrint(0); enxint(0); encollide(0);
 #ifdef lint
        br = 0; cvec = br; br = cvec;
        enrint(0); enxint(0); encollide(0);
@@ -101,7 +103,6 @@ enattach(ui)
 {
        register struct en_softc *es = &en_softc[ui->ui_unit];
        register struct sockaddr_in *sin;
 {
        register struct en_softc *es = &en_softc[ui->ui_unit];
        register struct sockaddr_in *sin;
-COUNT(ENATTACH);
 
        es->es_if.if_unit = ui->ui_unit;
        es->es_if.if_name = "en";
 
        es->es_if.if_unit = ui->ui_unit;
        es->es_if.if_name = "en";
@@ -131,7 +132,6 @@ enreset(unit, uban)
        int unit, uban;
 {
        register struct uba_device *ui;
        int unit, uban;
 {
        register struct uba_device *ui;
-COUNT(ENRESET);
 
        if (unit >= NEN || (ui = eninfo[unit]) == 0 || ui->ui_alive == 0 ||
            ui->ui_ubanum != uban)
 
        if (unit >= NEN || (ui = eninfo[unit]) == 0 || ui->ui_alive == 0 ||
            ui->ui_ubanum != uban)
@@ -197,7 +197,6 @@ enstart(dev)
        register struct endevice *addr;
        struct mbuf *m;
        int dest;
        register struct endevice *addr;
        struct mbuf *m;
        int dest;
-COUNT(ENSTART);
 
        if (es->es_oactive)
                goto restart;
 
        if (es->es_oactive)
                goto restart;
@@ -254,14 +253,11 @@ enxint(unit)
        register struct uba_device *ui = eninfo[unit];
        register struct en_softc *es = &en_softc[unit];
        register struct endevice *addr = (struct endevice *)ui->ui_addr;
        register struct uba_device *ui = eninfo[unit];
        register struct en_softc *es = &en_softc[unit];
        register struct endevice *addr = (struct endevice *)ui->ui_addr;
-COUNT(ENXINT);
 
        if (es->es_oactive == 0)
                return;
        if (es->es_mask && (addr->en_ostat&EN_OERROR)) {
                es->es_if.if_oerrors++;
 
        if (es->es_oactive == 0)
                return;
        if (es->es_mask && (addr->en_ostat&EN_OERROR)) {
                es->es_if.if_oerrors++;
-               if (es->es_if.if_oerrors % 100 == 0)
-                       printf("en%d: += 100 output errors\n", unit);
                endocoll(unit);
                return;
        }
                endocoll(unit);
                return;
        }
@@ -289,7 +285,6 @@ encollide(unit)
        int unit;
 {
        struct en_softc *es = &en_softc[unit];
        int unit;
 {
        struct en_softc *es = &en_softc[unit];
-COUNT(ENCOLLIDE);
 
        es->es_if.if_collisions++;
        if (es->es_oactive == 0)
 
        es->es_if.if_collisions++;
        if (es->es_oactive == 0)
@@ -340,10 +335,9 @@ enrint(unit)
        struct endevice *addr = (struct endevice *)eninfo[unit]->ui_addr;
        register struct en_header *en;
        struct mbuf *m;
        struct endevice *addr = (struct endevice *)eninfo[unit]->ui_addr;
        register struct en_header *en;
        struct mbuf *m;
-       int len, plen; short resid;
+       int len; short resid;
        register struct ifqueue *inq;
        int off;
        register struct ifqueue *inq;
        int off;
-COUNT(ENRINT);
 
        es->es_if.if_ipackets++;
 
 
        es->es_if.if_ipackets++;
 
@@ -354,8 +348,6 @@ COUNT(ENRINT);
                UBAPURGE(es->es_ifuba.ifu_uba, es->es_ifuba.ifu_r.ifrw_bdp);
        if (addr->en_istat&EN_IERROR) {
                es->es_if.if_ierrors++;
                UBAPURGE(es->es_ifuba.ifu_uba, es->es_ifuba.ifu_r.ifrw_bdp);
        if (addr->en_istat&EN_IERROR) {
                es->es_if.if_ierrors++;
-               if (es->es_if.if_ierrors % 100 == 0)
-                       printf("en%d: += 100 input errors\n", unit);
                goto setup;
        }
 
                goto setup;
        }
 
@@ -458,7 +450,6 @@ enoutput(ifp, m0, dst)
        register struct en_header *en;
        register int off;
 
        register struct en_header *en;
        register int off;
 
-COUNT(ENOUTPUT);
        switch (dst->sa_family) {
 
 #ifdef INET
        switch (dst->sa_family) {
 
 #ifdef INET