summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-07-01 19:32:56 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-07-01 19:32:56 +0000
commitdb37077b60e531f9d01b7194b0a9fbc6b37938e5 (patch)
tree445143669f1c7d048d6e82ecb53e44a7a52a9d09 /sys/scsi
parent1c28cdc0bc6920d381d530f8a60531acafebdfa4 (diff)
Do not try to send a 10 byte MODE_SENSE request to non-ATAPI non-UMASS
devices which advertize themselves as non-SCSI2-aware, since this command appeared in the SCSI-2 specification. This makes the Insite Floptical work when connected to a controller which correctly handles spontaneous deselection (which happens when a non-zero lun on said floptical device is addressed), such an esp(4) but not wdsc(4). This is step one of getting Floptical devices working on SGI systems. feedback and ok krw@
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/scsi_base.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 8364b8dde86..110443fdb3f 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.200 2011/06/15 01:10:05 dlg Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.201 2012/07/01 19:32:55 miod Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -1201,6 +1201,15 @@ scsi_do_mode_sense(struct scsi_link *sc_link, int page,
* SMS_LLBAA. Bail out if the returned information is less than
* a big header in size (6 additional bytes).
*/
+ if ((sc_link->flags & (SDEV_ATAPI | SDEV_UMASS)) == 0 &&
+ SCSISPC(sc_link->inqdata.version) < 2) {
+ /*
+ * The 10 byte MODE_SENSE request appeared with SCSI-2,
+ * so don't bother trying it on SCSI-1 devices, they are
+ * not supposed to understand it.
+ */
+ return (0);
+ }
error = scsi_mode_sense_big(sc_link, 0, page, &buf->hdr_big,
sizeof(*buf), flags, 20000);
if (error != 0)