add idc and remove massbus drivers for 730 (need space)
[unix-history] / usr / src / sys / vax / stand / ht.c
index 1a494e3..728b053 100644 (file)
@@ -1,4 +1,4 @@
-/*     ht.c    4.5     81/03/22        */
+/*     ht.c    4.7     82/03/07        */
 
 /*
  * TM03/TU?? tape driver
 
 /*
  * TM03/TU?? tape driver
@@ -9,6 +9,7 @@
 #include "../h/inode.h"
 #include "../h/pte.h"
 #include "../h/mbareg.h"
 #include "../h/inode.h"
 #include "../h/pte.h"
 #include "../h/mbareg.h"
+#include "../h/fs.h"
 #include "saio.h"
 #include "savax.h"
 
 #include "saio.h"
 #include "savax.h"
 
@@ -54,6 +55,7 @@ htstrategy(io, func)
        int func;
 {
        register int den, errcnt, ds;
        int func;
 {
        register int den, errcnt, ds;
+       int er;
        short fc;
        register struct htdevice *htaddr =
            (struct htdevice *)mbadrv(io->i_unit);
        short fc;
        register struct htdevice *htaddr =
            (struct htdevice *)mbadrv(io->i_unit);
@@ -76,22 +78,25 @@ retry:
                htaddr->htcs1 = func|HT_GO;
        htquiet(htaddr);
        ds = htaddr->htds;
                htaddr->htcs1 = func|HT_GO;
        htquiet(htaddr);
        ds = htaddr->htds;
+       er = htaddr->hter;
        if (ds & HTDS_TM) {
                htaddr->htcs1 = HT_DCLR|HT_GO;
                return (0);
        }
        if (ds & HTDS_ERR) {
        if (ds & HTDS_TM) {
                htaddr->htcs1 = HT_DCLR|HT_GO;
                return (0);
        }
        if (ds & HTDS_ERR) {
-               printf("ht error: ds=%b, er=%b\n",
-                   MASKREG(htaddr->htds), HTDS_BITS,
-                   MASKREG(htaddr->hter), HTER_BITS);
                htaddr->htcs1 = HT_DCLR|HT_GO;
                htaddr->htcs1 = HT_DCLR|HT_GO;
-               if (errcnt == 10) {
-                       printf("ht: unrecovered error\n");
-                       return (-1);
+               if ((er & HTER_CORCRC) == 0) {
+                       printf("ht error: ds=%b, er=%b\n",
+                           MASKREG(ds), HTDS_BITS,
+                           MASKREG(er), HTER_BITS);
+                       if (errcnt == 10) {
+                               printf("ht: unrecovered error\n");
+                               return (-1);
+                       }
+                       errcnt++;
+                       htstrategy(io, HT_SREV);
+                       goto retry;
                }
                }
-               errcnt++;
-               htstrategy(io, HT_SREV);
-               goto retry;
        }
        if (errcnt)
                printf("ht: recovered by retry\n");
        }
        if (errcnt)
                printf("ht: recovered by retry\n");
@@ -108,3 +113,5 @@ htquiet(htaddr)
                s = htaddr->htds;
        while ((s & HTDS_DRY) == 0);
 }
                s = htaddr->htds;
        while ((s & HTDS_DRY) == 0);
 }
+
+