new format of error prints; no more FLAKEY UP resets
[unix-history] / usr / src / sys / vax / uba / dh.c
index 0c30da6..ae319be 100644 (file)
@@ -1,4 +1,4 @@
-/*     dh.c    4.24    81/02/26        */
+/*     dh.c    4.27    81/03/06        */
 
 #include "dh.h"
 #if NDH > 0
 
 #include "dh.h"
 #if NDH > 0
@@ -6,6 +6,7 @@
 /*
  * DH-11/DM-11 driver
  */
 /*
  * DH-11/DM-11 driver
  */
+#include "bk.h"
 #include "../h/param.h"
 #include "../h/conf.h"
 #include "../h/dir.h"
 #include "../h/param.h"
 #include "../h/conf.h"
 #include "../h/dir.h"
@@ -244,7 +245,7 @@ dhopen(dev, flag)
                /* 512+ is a kludge to try to get around a hardware problem */
                dh_ubinfo[ui->ui_ubanum] =
                    uballoc(ui->ui_ubanum, (caddr_t)cfree,
                /* 512+ is a kludge to try to get around a hardware problem */
                dh_ubinfo[ui->ui_ubanum] =
                    uballoc(ui->ui_ubanum, (caddr_t)cfree,
-                       512+NCLIST*sizeof(struct cblock), 0);
+                       512+nclist*sizeof(struct cblock), 0);
                cbase[ui->ui_ubanum] = dh_ubinfo[ui->ui_ubanum]&0x3ffff;
        }
        if ((dhact&(1<<dh)) == 0) {
                cbase[ui->ui_ubanum] = dh_ubinfo[ui->ui_ubanum]&0x3ffff;
        }
        if ((dhact&(1<<dh)) == 0) {
@@ -321,6 +322,7 @@ dhrint(dh)
        register struct dhdevice *addr;
        register struct tty *tp0;
        register struct uba_dinfo *ui;
        register struct dhdevice *addr;
        register struct tty *tp0;
        register struct uba_dinfo *ui;
+       int overrun = 0;
 
        ui = dhinfo[dh];
        if (ui == 0 || ui->ui_alive == 0)
 
        ui = dhinfo[dh];
        if (ui == 0 || ui->ui_alive == 0)
@@ -341,8 +343,10 @@ dhrint(dh)
                        if ((tp->t_flags&(EVENP|ODDP))==EVENP
                         || (tp->t_flags&(EVENP|ODDP))==ODDP )
                                continue;
                        if ((tp->t_flags&(EVENP|ODDP))==EVENP
                         || (tp->t_flags&(EVENP|ODDP))==ODDP )
                                continue;
-               if (c & DH_DO)
-                       printf("O");
+               if ((c & DH_DO) && overrun == 0) {
+                       printf("dh%d: silo overflow\n", dh);
+                       overrun = 1;
+               }
                if (c & DH_FE)
                        /*
                         * At framing error (break) generate
                if (c & DH_FE)
                        /*
                         * At framing error (break) generate
@@ -353,10 +357,12 @@ dhrint(dh)
                                c = 0;
                        else
                                c = tun.t_intrc;
                                c = 0;
                        else
                                c = tun.t_intrc;
+#if NBK > 0
                if (tp->t_line == NETLDISC) {
                        c &= 0177;
                        BKINPUT(c, tp);
                } else
                if (tp->t_line == NETLDISC) {
                        c &= 0177;
                        BKINPUT(c, tp);
                } else
+#endif
                        (*linesw[tp->t_line].l_rint)(c, tp);
        }
 }
                        (*linesw[tp->t_line].l_rint)(c, tp);
        }
 }
@@ -455,7 +461,7 @@ dhxint(dh)
        addr = (struct dhdevice *)ui->ui_addr;
        if (addr->un.dhcsr & DH_NXM) {
                addr->un.dhcsr |= DH_CNI;
        addr = (struct dhdevice *)ui->ui_addr;
        if (addr->un.dhcsr & DH_NXM) {
                addr->un.dhcsr |= DH_CNI;
-               printf("dh%d NXM\n", dh);
+               printf("dh%d: NXM\n", dh);
        }
        sbar = &dhsar[dh];
        bar = *sbar & ~addr->dhbar;
        }
        sbar = &dhsar[dh];
        bar = *sbar & ~addr->dhbar;
@@ -606,16 +612,16 @@ dhreset(uban)
 
        if (dh_ubinfo[uban] == 0)
                return;
 
        if (dh_ubinfo[uban] == 0)
                return;
-       printf(" dh");
        ubarelse(uban, &dh_ubinfo[uban]);
        dh_ubinfo[uban] = uballoc(uban, (caddr_t)cfree,
        ubarelse(uban, &dh_ubinfo[uban]);
        dh_ubinfo[uban] = uballoc(uban, (caddr_t)cfree,
-           512+NCLIST*sizeof (struct cblock), 0);
+           512+nclist*sizeof (struct cblock), 0);
        cbase[uban] = dh_ubinfo[uban]&0x3ffff;
        dh = 0;
        for (dh = 0; dh < NDH; dh++) {
                ui = dhinfo[dh];
                if (ui == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban)
                        continue;
        cbase[uban] = dh_ubinfo[uban]&0x3ffff;
        dh = 0;
        for (dh = 0; dh < NDH; dh++) {
                ui = dhinfo[dh];
                if (ui == 0 || ui->ui_alive == 0 || ui->ui_ubanum != uban)
                        continue;
+               printf(" dh%d", dh);
                ((struct dhdevice *)ui->ui_addr)->un.dhcsr |= DH_IE;
                ((struct dhdevice *)ui->ui_addr)->dhsilo = 16;
                unit = dh * 16;
                ((struct dhdevice *)ui->ui_addr)->un.dhcsr |= DH_IE;
                ((struct dhdevice *)ui->ui_addr)->dhsilo = 16;
                unit = dh * 16;