summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/atapi.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-01-27 16:45:23 +0000
committermsmith <msmith@FreeBSD.org>1998-01-27 16:45:23 +0000
commit3e3506a667ca4ce723231d410251c5b60d25ea9b (patch)
treea1d2c35426379c907653762a889a7b79aed40a3f /sys/i386/isa/atapi.c
parent1fb3fbf76236cf062ff695faf9b1837b10634d95 (diff)
downloadFreeBSD-src-3e3506a667ca4ce723231d410251c5b60d25ea9b.zip
FreeBSD-src-3e3506a667ca4ce723231d410251c5b60d25ea9b.tar.gz
Check the status port after waiting for DRQ; some drives seem to be very
slow coming off the bus (eg. Iomega's ATAPI Zip). Failure to do this results in a false probe of an ATAPI device with garbage data.
Diffstat (limited to 'sys/i386/isa/atapi.c')
-rw-r--r--sys/i386/isa/atapi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/i386/isa/atapi.c b/sys/i386/isa/atapi.c
index 56fbbfb..09439cb 100644
--- a/sys/i386/isa/atapi.c
+++ b/sys/i386/isa/atapi.c
@@ -422,6 +422,15 @@ static struct atapi_params *atapi_probe (int port, int unit)
return (0);
}
+ /* check that DRQ isn't a fake */
+ if (inb (port + AR_STATUS) == 0xff) {
+ print (("atapiX.%d at 0x%x: no device\n", unit, port));
+ if (unit == 1)
+ /* Select unit 0. */
+ outb (port + AR_DRIVE, ARD_DRIVE0);
+ return (0);
+ }
+
/* Obtain parameters. */
insw (port + AR_DATA, tb, sizeof(tb) / sizeof(short));
OpenPOWER on IntegriCloud