summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-10-08 01:50:49 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-10-08 01:50:49 +0000
commit7e1a4e8de5263ffbecebd9dd292fa6991bcf1a7b (patch)
tree49b07786294ba137a01763fc1883eb4928ddc79a
parentc8df2c18c3cfe119097f876dc7c0851722649261 (diff)
Add a new quirk type, SDEV_NOCDB6, some USB devices like ATAPI
do not support 6 byte CDBs. This quirk is used for OLYMPUS USB cameras. Loosely based on code in FreeBSD. ok costa@
-rw-r--r--sys/scsi/scsiconf.c4
-rw-r--r--sys/scsi/scsiconf.h3
-rw-r--r--sys/scsi/sd.c3
3 files changed, 7 insertions, 3 deletions
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index db77b96a8b4..9bb01414c0f 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.61 2001/08/26 22:35:03 millert Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.62 2001/10/08 01:50:48 drahn Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -481,6 +481,8 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
"MST ", "SnapLink ", ""}, SDEV_NOLUNS},
{{T_DIRECT, T_FIXED,
"NEC ", "D3847 ", "0307"}, SDEV_NOLUNS},
+ {{T_DIRECT, T_REMOV,
+ "OLYMPUS ", "C-", ""}, SDEV_NOCDB6|SDEV_NOSYNCCACHE},
{{T_DIRECT, T_FIXED,
"QUANTUM ", "ELS85S ", ""}, SDEV_AUTOSAVE},
{{T_DIRECT, T_FIXED,
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index 323e57efb0a..02312728ac4 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.29 2001/08/25 19:29:16 fgsch Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.30 2001/10/08 01:50:48 drahn Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -185,6 +185,7 @@ struct scsi_link {
#define ADEV_NOCAPACITY 0x0800
#define ADEV_NOTUR 0x1000
#define ADEV_NODOORLOCK 0x2000
+#define SDEV_NOCDB6 0x4000 /* does not support 6 byte CDB */
u_int8_t inquiry_flags; /* copy of flags from probe INQUIRY */
u_int8_t inquiry_flags2; /* copy of flags2 from probe INQUIRY */
struct scsi_device *device; /* device entry points etc. */
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index e87094b8eb4..4f06ff72bb2 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.50 2001/08/26 00:45:08 fgsch Exp $ */
+/* $OpenBSD: sd.c,v 1.51 2001/10/08 01:50:48 drahn Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -688,6 +688,7 @@ sdstart(v)
* fit in a "small" cdb, use it.
*/
if (!(sc_link->flags & SDEV_ATAPI) &&
+ !(sc_link->quirks & SDEV_NOCDB6) &&
((blkno & 0x1fffff) == blkno) &&
((nblks & 0xff) == nblks)) {
/*