compaq changes
authorBill Joy <bill@ucbvax.Berkeley.EDU>
Fri, 9 Nov 1990 12:10:23 +0000 (04:10 -0800)
committerBill Joy <bill@ucbvax.Berkeley.EDU>
Fri, 9 Nov 1990 12:10:23 +0000 (04:10 -0800)
SCCS-vsn: sys/i386/isa/wd.c 5.5

usr/src/sys/i386/isa/wd.c

index a4aeefc..9a3450e 100644 (file)
@@ -7,7 +7,7 @@
  *
  * %sccs.include.386.c%
  *
  *
  * %sccs.include.386.c%
  *
- *     @(#)wd.c        5.4 (Berkeley) %G%
+ *     @(#)wd.c        5.5 (Berkeley) %G%
  */
 
 #include "wd.h"
  */
 
 #include "wd.h"
@@ -360,7 +360,7 @@ loop:
 
        /* Set up the SDH register (select drive).     */
        outb(wdc+wd_sdh, WDSD_IBM | (unit<<4) | (head & 0xf));
 
        /* Set up the SDH register (select drive).     */
        outb(wdc+wd_sdh, WDSD_IBM | (unit<<4) | (head & 0xf));
-       while ((inb(wdc+wd_altsts) & WDCS_READY) == 0) ;
+       while ((inb(wdc+wd_status) & WDCS_READY) == 0) ;
 
        /*if (bp->b_flags & B_FORMAT)
                wr(wdc+wd_command, WDCC_FORMAT);
 
        /*if (bp->b_flags & B_FORMAT)
                wr(wdc+wd_command, WDCC_FORMAT);
@@ -377,7 +377,7 @@ loop:
        if (bp->b_flags & B_READ) return;
 
        /* Ready to send data?  */
        if (bp->b_flags & B_READ) return;
 
        /* Ready to send data?  */
-       while ((inb(wdc+wd_altsts) & WDCS_DRQ) == 0)
+       while ((inb(wdc+wd_status) & WDCS_DRQ) == 0)
                nulldev();              /* So compiler won't optimize out */
 
        /* ASSUMES CONTIGUOUS MEMORY */
                nulldev();              /* So compiler won't optimize out */
 
        /* ASSUMES CONTIGUOUS MEMORY */
@@ -430,6 +430,8 @@ static wd_haderror;
        }
        if (status & (WDCS_ERR | WDCS_ECCCOR)) {
                wd_errstat = inb(wdc+wd_error);         /* save error status */
        }
        if (status & (WDCS_ERR | WDCS_ECCCOR)) {
                wd_errstat = inb(wdc+wd_error);         /* save error status */
+outb(wdc+wd_command, WDCC_RESTORE);
+while (inb(wdc+wd_status)&WDCS_BUSY);
 #ifdef WDDEBUG
                printf("status %x error %x\n", status, wd_errstat);
 #endif
 #ifdef WDDEBUG
                printf("status %x error %x\n", status, wd_errstat);
 #endif
@@ -666,7 +668,7 @@ wdcontrol(bp)
                return(0);
 
        case RECAL:
                return(0);
 
        case RECAL:
-               if ((stat = inb(wdc+wd_altsts)) & WDCS_ERR) {
+               if ((stat = inb(wdc+wd_status)) & WDCS_ERR) {
                        printf("wd%d: recal", du->dk_unit);
                        if (unit == 0) {
                                printf(": status %b error %b\n",
                        printf("wd%d: recal", du->dk_unit);
                        if (unit == 0) {
                                printf(": status %b error %b\n",