fix to reeves fix of dgo handling (reset b_active to 1)
[unix-history] / usr / src / sys / vax / uba / up.c
index a196036..44e1bdb 100644 (file)
@@ -1,4 +1,4 @@
-/*     up.c    4.50    82/05/19        */
+/*     up.c    4.53    82/05/27        */
 
 #include "up.h"
 #if NSC > 0
 
 #include "up.h"
 #if NSC > 0
@@ -72,7 +72,7 @@ struct        size
 #else
        213760, 155,
 #endif
 #else
        213760, 155,
 #endif
-}, am_sizes[8] = {
+}, upam_sizes[8] = {
        15884,  0,              /* A=cyl 0 thru 31 */
        33440,  32,             /* B=cyl 32 thru 97 */
        524288, 0,              /* C=cyl 0 thru 1023 */
        15884,  0,              /* A=cyl 0 thru 31 */
        33440,  32,             /* B=cyl 32 thru 97 */
        524288, 0,              /* C=cyl 0 thru 1023 */
@@ -115,7 +115,7 @@ struct      upst {
        32,     19,     32*19,  823,    up_sizes,       /* 9300/cdc */
 /* 9300 actually has 815 cylinders... */
        32,     10,     32*10,  823,    fj_sizes,       /* fujitsu 160m */
        32,     19,     32*19,  823,    up_sizes,       /* 9300/cdc */
 /* 9300 actually has 815 cylinders... */
        32,     10,     32*10,  823,    fj_sizes,       /* fujitsu 160m */
-       32,     16,     32*16,  1024,   am_sizes,       /* ampex capricorn */
+       32,     16,     32*16,  1024,   upam_sizes,     /* ampex capricorn */
 };
 
 u_char up_offset[16] = {
 };
 
 u_char up_offset[16] = {
@@ -465,7 +465,7 @@ updgo(um)
 {
        register struct updevice *upaddr = (struct updevice *)um->um_addr;
 
 {
        register struct updevice *upaddr = (struct updevice *)um->um_addr;
 
-       um->um_tab.b_active++;  /* should now be 2 */
+       um->um_tab.b_active = 2;        /* should now be 2 */
        upaddr->upba = um->um_ubinfo;
        upaddr->upcs1 = um->um_cmd|((um->um_ubinfo>>8)&0x300);
 }
        upaddr->upba = um->um_ubinfo;
        upaddr->upcs1 = um->um_cmd|((um->um_ubinfo>>8)&0x300);
 }
@@ -497,6 +497,7 @@ upintr(sc21)
                        upaddr->upcs1 = UP_TRE;
                goto doattn;
        }
                        upaddr->upcs1 = UP_TRE;
                goto doattn;
        }
+       um->um_tab.b_active = 1;
        /*
         * Get device and block structures, and a pointer
         * to the uba_device for the drive.  Select the drive.
        /*
         * Get device and block structures, and a pointer
         * to the uba_device for the drive.  Select the drive.
@@ -743,7 +744,6 @@ upecc(ui)
                i++;
                bit -= 8;
        }
                i++;
                bit -= 8;
        }
-       um->um_tab.b_active = 2;        /* Either complete or continuing... */
        if (up->upwc == 0)
                return (0);
        /*
        if (up->upwc == 0)
                return (0);
        /*
@@ -771,6 +771,7 @@ upecc(ui)
        up->upba = ubaddr;
        cmd = (ubaddr >> 8) & 0x300;
        cmd |= UP_IE|UP_GO|UP_RCOM;
        up->upba = ubaddr;
        cmd = (ubaddr >> 8) & 0x300;
        cmd |= UP_IE|UP_GO|UP_RCOM;
+       um->um_tab.b_active = 2;        /* continuing transfer ... */
        up->upcs1 = cmd;
 #endif
        return (1);
        up->upcs1 = cmd;
 #endif
        return (1);
@@ -887,7 +888,7 @@ updump(dev)
                DELAY(25);
                if (++retry > 527)
                        break;
                DELAY(25);
                if (++retry > 527)
                        break;
-       } while ((upaddr->upds & UPDS_RDY) == 0) {
+       } while ((upaddr->upds & UP_RDY) == 0);
        if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY)
                return (EFAULT);
        start = 0;
        if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY)
                return (EFAULT);
        start = 0;
@@ -924,7 +925,7 @@ updump(dev)
                                break;
                } while ((upaddr->upcs1 & UP_RDY) == 0);
                if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) {
                                break;
                } while ((upaddr->upcs1 & UP_RDY) == 0);
                if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) {
-                       printf("up%d: not ready", dkunit(bp));
+                       printf("up%d: not ready", unit);
                        if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) {
                                printf("\n");
                                return (EIO);
                        if ((upaddr->upds & UPDS_DREADY) != UPDS_DREADY) {
                                printf("\n");
                                return (EIO);