diff options
author | wpaul <wpaul@FreeBSD.org> | 1996-08-12 00:53:02 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1996-08-12 00:53:02 +0000 |
commit | c8f56afb629104ce460c52fb523995a57b9938be (patch) | |
tree | e0c7da069551258f35ea7aa4cc567c9257cf8451 /sys | |
parent | 6f7ebd36bf8479d18d03719ac960bb1ddc268d2c (diff) | |
download | FreeBSD-src-c8f56afb629104ce460c52fb523995a57b9938be.zip FreeBSD-src-c8f56afb629104ce460c52fb523995a57b9938be.tar.gz |
Apply my small patch to make detection of ATAPI CD-ROMs happen a
little more reliably. So far I've received a couple of positive
responses and no objections to these changes.
There are two one-line changes:
- In wdprobe(), when testing the error status of drives, don't
unconditionally decide that there is no controller present if we
read back a value of 0x81 (drive 0 okay, drive 1 failed) twice
in a row. This may be caused by having an ATAPI CD-ROM jumpered
as a master on the controller with no slave.
- In wdgetctlr(), when checking for a status of WDCS_READY, check the
value twice. The first time may be bogus. This stops a phantom wd2
device from being detected when an ATAPI CD-ROM is attached to the
secondary controller alone as a slave. (This can cause installation to
fail when sysinstall attempts to open the phantom device and wedges the
system as a result. This has bitten me a couple of times on some
Gateway 2000 machines.)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/isa/wd.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index 81d5384..1175a31 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.112 1996/07/23 21:51:46 phk Exp $ + * $Id: wd.c,v 1.113 1996/07/27 19:01:10 dyson Exp $ */ /* TODO: @@ -410,8 +410,12 @@ reset_ok: /* Get status for drive 1 */ du->dk_error = inb(du->dk_port + wd_error); /* printf("Error (drv 1) : %x\n", du->dk_error); */ - - if(du->dk_error != 0x01) + /* + * Sometimes (apparently mostly with ATAPI + * drives involved) 0x81 really means 0x81 + * (drive 0 OK, drive 1 failed). + */ + if(du->dk_error != 0x01 && du->dk_error != 0x81) goto nodevice; } else /* drive 0 fail */ goto nodevice; @@ -1520,6 +1524,10 @@ again: return (1); outb(du->dk_port + wd_sdh, WDSD_IBM | (du->dk_unit << 4)); DELAY(5000); /* usually unnecessary; drive select is fast */ + /* + * Do this twice: may get a false WDCS_READY the first time. + */ + inb(du->dk_port + wd_status); if ((inb(du->dk_port + wd_status) & (WDCS_BUSY | WDCS_READY)) != WDCS_READY || wdcommand(du, 0, 0, 0, 0, WDCC_RESTORE | WD_STEP) != 0 |