IMPMTU fixup
authorBill Joy <root@ucbvax.Berkeley.EDU>
Sat, 20 Mar 1982 09:09:02 +0000 (01:09 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Sat, 20 Mar 1982 09:09:02 +0000 (01:09 -0800)
SCCS-vsn: sys/deprecated/netimp/if_imp.h 4.6
SCCS-vsn: sys/vax/if/if_acc.c 4.11
SCCS-vsn: sys/deprecated/netimp/if_imp.c 4.19

usr/src/sys/deprecated/netimp/if_imp.c
usr/src/sys/deprecated/netimp/if_imp.h
usr/src/sys/vax/if/if_acc.c

index 59f5595..223dafd 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_imp.c        4.18    82/03/19        */
+/*     if_imp.c        4.19    82/03/19        */
 
 #include "imp.h"
 #if NIMP > 0
 
 #include "imp.h"
 #if NIMP > 0
@@ -84,7 +84,7 @@ COUNT(IMPATTACH);
        /* UNIT COULD BE AMBIGUOUS */
        ifp->if_unit = ui->ui_unit;
        ifp->if_name = "imp";
        /* UNIT COULD BE AMBIGUOUS */
        ifp->if_unit = ui->ui_unit;
        ifp->if_name = "imp";
-       ifp->if_mtu = IMP_MTU - sizeof (struct imp_leader);
+       ifp->if_mtu = IMPMTU - sizeof(struct imp_leader);
        ifp->if_net = ui->ui_flags;
        /* the host and imp fields will be filled in by the imp */
        ifp->if_addr = if_makeaddr(ifp->if_net, 0);
        ifp->if_net = ui->ui_flags;
        /* the host and imp fields will be filled in by the imp */
        ifp->if_addr = if_makeaddr(ifp->if_net, 0);
@@ -254,7 +254,7 @@ COUNT(IMPINPUT);
                        sc->imp_dropcnt = IMP_DROPCNT;
                }
                if (sc->imp_state != IMPS_INIT || --sc->imp_dropcnt > 0)
                        sc->imp_dropcnt = IMP_DROPCNT;
                }
                if (sc->imp_state != IMPS_INIT || --sc->imp_dropcnt > 0)
-                       goto rawlinkin;
+                       goto drop;
                sc->imp_state = IMPS_UP;
                sin = &sc->imp_if.if_addr;
                sc->imp_if.if_host[0] = sin->s_host = ip->il_host;
                sc->imp_state = IMPS_UP;
                sin = &sc->imp_if.if_addr;
                sc->imp_if.if_host[0] = sin->s_host = ip->il_host;
@@ -263,7 +263,7 @@ COUNT(IMPINPUT);
                        ntohs(ip->il_imp));
                /* restart output in case something was q'd */
                (*sc->imp_cb.ic_start)(sc->imp_if.if_unit);
                        ntohs(ip->il_imp));
                /* restart output in case something was q'd */
                (*sc->imp_cb.ic_start)(sc->imp_if.if_unit);
-               goto rawlinkin;
+               goto drop;
        }
 
        /*
        }
 
        /*
@@ -277,7 +277,7 @@ COUNT(IMPINPUT);
                if (hp && hp->h_rfnm)
                        if (next = hostdeque(hp))
                                (void) impsnd(&sc->imp_if, next);
                if (hp && hp->h_rfnm)
                        if (next = hostdeque(hp))
                                (void) impsnd(&sc->imp_if, next);
-               goto rawlinkin;
+               goto drop;
 
        /*
         * Host or IMP can't be reached.  Flush any packets
 
        /*
         * Host or IMP can't be reached.  Flush any packets
index 73af1df..77b880d 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_imp.h        4.5     82/03/16        */
+/*     if_imp.h        4.6     82/03/19        */
 
 /*
  * Structure of IMP 1822 long leader.
 
 /*
  * Structure of IMP 1822 long leader.
@@ -30,8 +30,8 @@ struct imp_leader {
 };
 
 #define        IMP_DROPCNT     2       /* # of noops from imp to ignore */
 };
 
 #define        IMP_DROPCNT     2       /* # of noops from imp to ignore */
-/* don't use 1019 here, 'cuz odd numbers and word counts are confusing */
-#define        IMP_MTU         (sizeof (struct imp_leader) + 1018) 
+/* insure things are even... */
+#define        IMPMTU          ((8159 / NBBY) & ~01)
 
 /*
  * IMP-host flags
 
 /*
  * IMP-host flags
index 7fb32e3..5344700 100644 (file)
@@ -1,4 +1,4 @@
-/*     if_acc.c        4.10    82/03/19        */
+/*     if_acc.c        4.11    82/03/19        */
 
 #include "acc.h"
 #ifdef NACC > 0
 
 #include "acc.h"
 #ifdef NACC > 0
@@ -163,7 +163,7 @@ COUNT(ACCINIT);
         * would asssume we handle it on input and output.
         */
        if (if_ubainit(&sc->acc_ifuba, ui->ui_ubanum, 0,
         * would asssume we handle it on input and output.
         */
        if (if_ubainit(&sc->acc_ifuba, ui->ui_ubanum, 0,
-            (int)btoc(IMP_MTU)) == 0) {
+            (int)btoc(IMPMTU)) == 0) {
                printf("acc%d: can't initialize\n", unit);
                goto down;
        }
                printf("acc%d: can't initialize\n", unit);
                goto down;
        }
@@ -200,12 +200,12 @@ COUNT(ACCINIT);
         * Put up a read.  We can't restart any outstanding writes
         * until we're back in synch with the IMP (i.e. we've flushed
         * the NOOPs it throws at us).
         * Put up a read.  We can't restart any outstanding writes
         * until we're back in synch with the IMP (i.e. we've flushed
         * the NOOPs it throws at us).
-        * Note: IMP_MTU includes the leader.
+        * Note: IMPMTU includes the leader.
         */
        x = spl5();
        info = sc->acc_ifuba.ifu_r.ifrw_info;
        addr->iba = (u_short)info;
         */
        x = spl5();
        info = sc->acc_ifuba.ifu_r.ifrw_info;
        addr->iba = (u_short)info;
-       addr->iwc = -(IMP_MTU >> 1);
+       addr->iwc = -(IMPMTU >> 1);
 #ifdef LOOPBACK
        addr->ocsr |= OUT_BBACK;
 #endif
 #ifdef LOOPBACK
        addr->ocsr |= OUT_BBACK;
 #endif
@@ -325,8 +325,8 @@ COUNT(ACCRINT);
                        sc->acc_flush = 0;
                goto setup;
        }
                        sc->acc_flush = 0;
                goto setup;
        }
-       len = IMP_MTU + (addr->iwc << 1);
-       if (len < 0 || len > IMP_MTU) {
+       len = IMPMTU + (addr->iwc << 1);
+       if (len < 0 || len > IMPMTU) {
                printf("acc%d: bad length=%d\n", len);
                sc->acc_if->if_ierrors++;
                goto setup;
                printf("acc%d: bad length=%d\n", len);
                sc->acc_if->if_ierrors++;
                goto setup;
@@ -359,7 +359,7 @@ setup:
         */
        info = sc->acc_ifuba.ifu_r.ifrw_info;
        addr->iba = (u_short)info;
         */
        info = sc->acc_ifuba.ifu_r.ifrw_info;
        addr->iba = (u_short)info;
-       addr->iwc = -(IMP_MTU >> 1);
+       addr->iwc = -(IMPMTU >> 1);
        addr->icsr =
                IN_MRDY | ACC_IE | IN_WEN | ((info & 0x30000) >> 12) | ACC_GO;
 }
        addr->icsr =
                IN_MRDY | ACC_IE | IN_WEN | ((info & 0x30000) >> 12) | ACC_GO;
 }