SCCS-vsn: sys/i386/isa/wd.c 5.5
*
* %sccs.include.386.c%
*
*
* %sccs.include.386.c%
*
- * @(#)wd.c 5.4 (Berkeley) %G%
+ * @(#)wd.c 5.5 (Berkeley) %G%
/* 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);
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 */
}
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
- 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",