summaryrefslogtreecommitdiff
path: root/sys/dev/atapiscsi/atapiscsi.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1999-07-23 16:23:40 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1999-07-23 16:23:40 +0000
commit49c81bf3bdf5ea11119d742a5fb37ee2548fee7a (patch)
tree5c31252aae1eabf846559addb8527fc80c526095 /sys/dev/atapiscsi/atapiscsi.c
parent6661c3efe534f9f7857f49c3d130ee2f18119cd7 (diff)
Don't even try wdc_get_params on a drive that didn't show up as ATAPI
during probe. This has a slight chance of breaking the detection of some ATAPI devices (which don't show during initial probe). Thanks to deraadt for pointing this out.
Diffstat (limited to 'sys/dev/atapiscsi/atapiscsi.c')
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index a2ff393184f..26729d95d18 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.6 1999/07/23 04:24:31 csapuntz Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.7 1999/07/23 16:23:39 csapuntz Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -203,9 +203,11 @@ atapiscsi_attach(parent, self, aux)
as->sc_wdc->channels[as->sc_channel]->ch_as = as;
for (drive = 0; drive < 2 ; drive++ ) {
- if (wdc_atapi_get_params(as, drive,
- SCSI_POLL|SCSI_NOSLEEP, id) == COMPLETE) {
- struct ata_drive_datas *drvp = &as->sc_drvs[drive];
+ struct ata_drive_datas *drvp = &as->sc_drvs[drive];
+
+ if ((drvp->drive_flags & DRIVE_ATAPI) &&
+ (wdc_atapi_get_params(as, drive,
+ SCSI_POLL|SCSI_NOSLEEP, id) == COMPLETE)) {
as->valid[drive] = 1;