summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormjacob <mjacob@cvs.openbsd.org>1999-12-16 05:17:37 +0000
committermjacob <mjacob@cvs.openbsd.org>1999-12-16 05:17:37 +0000
commit836c080f01e3cdcce0aafb1741f5904d166eb710 (patch)
tree3ddab370b8787454d8b0be7a05f00bf40eea1f53
parenta6364db84d243a698c27f99054be362165406107 (diff)
Split SDEV_NOSYNCWIDE into SDEV_NOSYNC and SDEV_NOWIDE (as is done
in NetBSD). Look at Inquiry data during probing to further set quirks based upon device capabilities. Thanks to Todd.Miller@courtesan.com for doing the grunt work and encouraging this to get done fully.
-rw-r--r--sys/scsi/scsiconf.c28
-rw-r--r--sys/scsi/scsiconf.h32
2 files changed, 40 insertions, 20 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index f2e32ba5f52..24ff595926f 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.47 1999/12/11 21:04:26 csapuntz Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.48 1999/12/16 05:17:36 mjacob Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -367,6 +367,8 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
"JVC ", "R2626 ", "1.55"}, SDEV_NOLUNS},
{{T_CDROM, T_REMOV,
"CyberDrv", "", ""}, SDEV_NOLUNS},
+ {{T_CDROM, T_REMOV,
+ "PLEXTOR", "CD-ROM PX-40TS", "1.01"}, SDEV_NOSYNC},
{{T_OPTICAL, T_REMOV,
"EPSON ", "OMD-5010 ", "3.08"}, SDEV_NOLUNS},
@@ -480,7 +482,7 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
{{T_SEQUENTIAL, T_REMOV,
"SONY ", "SDT-2000 ", "2.09"}, SDEV_NOLUNS},
{{T_SEQUENTIAL, T_REMOV,
- "SONY ", "SDT-5000 ", "3."}, SDEV_NOSYNCWIDE},
+ "SONY ", "SDT-5000 ", "3."}, SDEV_NOSYNC|SDEV_NOWIDE},
{{T_SEQUENTIAL, T_REMOV,
"SONY ", "SDT-5200 ", "3."}, SDEV_NOLUNS},
{{T_SEQUENTIAL, T_REMOV,
@@ -498,11 +500,11 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
{{T_SEQUENTIAL, T_REMOV,
"WANGTEK ", "5150ES SCSI", ""}, SDEV_NOLUNS},
{{T_SEQUENTIAL, T_REMOV,
- "WangDAT ", "Model 1300 ", "02.4"}, SDEV_NOSYNCWIDE},
+ "WangDAT ", "Model 1300 ", "02.4"}, SDEV_NOSYNC|SDEV_NOWIDE},
{{T_SEQUENTIAL, T_REMOV,
- "WangDAT ", "Model 2600 ", "01.7"}, SDEV_NOSYNCWIDE},
+ "WangDAT ", "Model 2600 ", "01.7"}, SDEV_NOSYNC|SDEV_NOWIDE},
{{T_SEQUENTIAL, T_REMOV,
- "WangDAT ", "Model 3200 ", "02.2"}, SDEV_NOSYNCWIDE},
+ "WangDAT ", "Model 3200 ", "02.2"}, SDEV_NOSYNC|SDEV_NOWIDE},
{{T_SCANNER, T_FIXED,
"RICOH ", "IS60 ", "1R08"}, SDEV_NOLUNS},
@@ -731,6 +733,22 @@ scsi_probedev(scsi, target, lun)
(caddr_t)scsi_quirk_patterns,
sizeof(scsi_quirk_patterns)/sizeof(scsi_quirk_patterns[0]),
sizeof(scsi_quirk_patterns[0]), &priority);
+
+ /*
+ * Based upon the inquiry flags we got back, and if we're
+ * at SCSI-2 or better, set some limiting quirks.
+ */
+ if ((inqbuf.version & SID_ANSII) >= 2) {
+ if ((inqbuf.flags & SID_CmdQue) == 0)
+ sc_link->quirks |= SDEV_NOTAGS;
+ if ((inqbuf.flags & SID_Sync) == 0)
+ sc_link->quirks |= SDEV_NOSYNC;
+ if ((inqbuf.flags & SID_WBus16) == 0)
+ sc_link->quirks |= SDEV_NOWIDE;
+ }
+ /*
+ * Now apply any quirks from the table.
+ */
if (priority != 0)
sc_link->quirks |= finger->quirks;
if ((inqbuf.version & SID_ANSII) == 0 &&
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index 1b3b94b218b..04a6f2e20d2 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.20 1999/11/22 12:55:16 mjacob Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.21 1999/12/16 05:17:36 mjacob Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -158,22 +158,24 @@ struct scsi_link {
#define SDEV_WAITING 0x0004 /* a process is waiting for this */
#define SDEV_OPEN 0x0008 /* at least 1 open session */
#define SDEV_DBX 0x00f0 /* debuging flags (scsi_debug.h) */
-#define SDEV_EJECTING 0x0100 /* eject on device close */
-#define SDEV_ATAPI 0x0200 /* device is ATAPI */
+#define SDEV_EJECTING 0x0100 /* eject on device close */
+#define SDEV_ATAPI 0x0200 /* device is ATAPI */
+#define SDEV_2NDBUS 0x0400 /* device is a 'second' bus device */
u_int16_t quirks; /* per-device oddities */
#define SDEV_AUTOSAVE 0x0001 /* do implicit SAVEDATAPOINTER on disconnect */
-#define SDEV_NOSYNCWIDE 0x0002 /* does not grok SDTR or WDTR */
-#define SDEV_NOLUNS 0x0004 /* does not grok LUNs */
-#define SDEV_FORCELUNS 0x0008 /* prehistoric drive/ctlr groks LUNs */
-#define SDEV_NOMODESENSE 0x0010 /* removable media/optical drives */
-#define SDEV_NOSTARTUNIT 0x0020 /* do not issue start unit requests in sd.c */
-#define SDEV_NOTAGS 0x0040 /* lies about having tagged queueing */
-#define ADEV_NOSENSE 0x0080 /* No request sense - ATAPI */
-#define ADEV_LITTLETOC 0x0100 /* little-endian TOC - ATAPI */
-#define ADEV_NOCAPACITY 0x0200
-#define ADEV_NOTUR 0x0400
-#define ADEV_NODOORLOCK 0x0800
-#define SDEV_NOSYNCCACHE 0x1000 /* no SYNCHRONIZE_CACHE */
+#define SDEV_NOSYNC 0x0002 /* does not grok SDTR */
+#define SDEV_NOWIDE 0x0004 /* does not grok WDTR */
+#define SDEV_NOTAGS 0x0008 /* lies about having tagged queueing */
+#define SDEV_NOLUNS 0x0010 /* does not grok LUNs */
+#define SDEV_FORCELUNS 0x0020 /* prehistoric drive/ctlr groks LUNs */
+#define SDEV_NOMODESENSE 0x0040 /* removable media/optical drives */
+#define SDEV_NOSTARTUNIT 0x0080 /* do not issue start unit requests in sd.c */
+#define SDEV_NOSYNCCACHE 0x0100 /* no SYNCHRONIZE_CACHE */
+#define ADEV_NOSENSE 0x0200 /* No request sense - ATAPI */
+#define ADEV_LITTLETOC 0x0400 /* little-endian TOC - ATAPI */
+#define ADEV_NOCAPACITY 0x0800
+#define ADEV_NOTUR 0x1000
+#define ADEV_NODOORLOCK 0x2000
u_int8_t inquiry_flags; /* copy of flags from probe INQUIRY */
struct scsi_device *device; /* device entry points etc. */
void *device_softc; /* needed for call to foo_start */