fixes to ecc code
authorBill Joy <root@ucbvax.Berkeley.EDU>
Tue, 15 Jun 1982 13:42:51 +0000 (05:42 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Tue, 15 Jun 1982 13:42:51 +0000 (05:42 -0800)
SCCS-vsn: sys/vax/uba/rk.c 4.41
SCCS-vsn: sys/vax/uba/up.c 4.55

usr/src/sys/vax/uba/rk.c
usr/src/sys/vax/uba/up.c

index 697148c..8be4a13 100644 (file)
@@ -1,5 +1,6 @@
 #define        RKDEBUG
 #define        RKDEBUG
-/*     rk.c    4.40    82/06/05        */
+#define RKBDEBUG
+/*     rk.c    4.41    82/06/14        */
 
 #include "rk.h"
 #if NHK > 0
 
 #include "rk.h"
 #if NHK > 0
@@ -418,8 +419,13 @@ hard:
                                else
 #endif
                                        goto hard;
                                else
 #endif
                                        goto hard;
-                       } else
-                               um->um_tab.b_active = 0;
+                       } else {
+                               if ((er & (RKER_DCK|RKER_ECH)) == RKER_DCK) {
+                                       if (rkecc(ui, ECC))
+                                               return;
+                               } else
+                                       um->um_tab.b_active = 0;
+                       }
                        if (cs2&RKCS2_MDS) {
                                rkaddr->rkcs2 = RKCS2_SCLR;
                                goto retry;
                        if (cs2&RKCS2_MDS) {
                                rkaddr->rkcs2 = RKCS2_SCLR;
                                goto retry;
@@ -428,9 +434,6 @@ hard:
                        if (ds&RKDS_DROT || er&(RKER_OPI|RKER_SKI|RKER_UNS) ||
                            (um->um_tab.b_errcnt&07) == 4)
                                recal = 1;
                        if (ds&RKDS_DROT || er&(RKER_OPI|RKER_SKI|RKER_UNS) ||
                            (um->um_tab.b_errcnt&07) == 4)
                                recal = 1;
-                       if ((er & (RKER_DCK|RKER_ECH)) == RKER_DCK)
-                               if (rkecc(ui, ECC))
-                                       return;
                        rkaddr->rkcs1 = RK_CCLR;
                        rkaddr->rkcs2 = ui->ui_slave;
                        rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO;
                        rkaddr->rkcs1 = RK_CCLR;
                        rkaddr->rkcs2 = ui->ui_slave;
                        rkaddr->rkcs1 = rktypes[ui->ui_type]|RK_DCLR|RK_GO;
@@ -584,8 +587,10 @@ rkecc(ui, flag)
                        i++;
                        bit -= 8;
                }
                        i++;
                        bit -= 8;
                }
-               if (rk->rkwc == 0)
+               if (rk->rkwc == 0) {
+                       um->um_tab.b_active = 0;
                        return (0);
                        return (0);
+               }
                npf++;
                reg++;
                break;
                npf++;
                reg++;
                break;
@@ -620,8 +625,10 @@ rkecc(ui, flag)
 #endif
                bp->b_flags &= ~B_BAD;
                rk->rkwc = -((bp->b_bcount - (int)ptob(npf)) / sizeof (short));
 #endif
                bp->b_flags &= ~B_BAD;
                rk->rkwc = -((bp->b_bcount - (int)ptob(npf)) / sizeof (short));
-               if (rk->rkwc == 0)
-                       return(0);
+               if (rk->rkwc == 0) {
+                       um->um_tab.b_active = 0;
+                       return (0);
+               }
                break;
 #endif
        }
                break;
 #endif
        }
index e967468..d7e54ea 100644 (file)
@@ -1,4 +1,4 @@
-/*     up.c    4.54    82/06/05        */
+/*     up.c    4.55    82/06/14        */
 
 #include "up.h"
 #if NSC > 0
 
 #include "up.h"
 #if NSC > 0
@@ -545,10 +545,11 @@ upintr(sc21)
                         * by returning if necessary.
                         * Otherwise fall through and retry the transfer
                         */
                         * by returning if necessary.
                         * Otherwise fall through and retry the transfer
                         */
-                       um->um_tab.b_active = 0;         /* force retry */
-                       if ((upaddr->uper1&(UPER1_DCK|UPER1_ECH))==UPER1_DCK)
+                       if ((upaddr->uper1&(UPER1_DCK|UPER1_ECH))==UPER1_DCK) {
                                if (upecc(ui))
                                        return;
                                if (upecc(ui))
                                        return;
+                       } else
+                               um->um_tab.b_active = 0; /* force retry */
                }
                /*
                 * Clear drive error and, every eight attempts,
                }
                /*
                 * Clear drive error and, every eight attempts,
@@ -745,8 +746,10 @@ upecc(ui)
                i++;
                bit -= 8;
        }
                i++;
                bit -= 8;
        }
-       if (up->upwc == 0)
+       if (up->upwc == 0) {
+               um->um_tab.b_active = 0;
                return (0);
                return (0);
+       }
        /*
         * Have to continue the transfer... clear the drive,
         * and compute the position where the transfer is to continue.
        /*
         * Have to continue the transfer... clear the drive,
         * and compute the position where the transfer is to continue.