summaryrefslogtreecommitdiff
path: root/sys/scsi/sd.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-07-29 02:40:47 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-07-29 02:40:47 +0000
commitad1b802e5366534f81aff919556dd650f2d7b064 (patch)
tree16ec93049f30612b85d48caa5f75dd601406f2be /sys/scsi/sd.c
parent35ed541750254d73c3c88cfdf6c1f9b0c6653f49 (diff)
The version field of scsi_inquiry_data is not a simple numeric value
that specifies the version of SCSI being supported. Even the ANSI part that we use is complex. 4 means 2, 5 means 3 and 6 means 4. Translate and use the value correctly. Fixes SCSI5 and SCSI6 in dmesg. And properly protects SCSI2 devices from getting SCSI3 commands. "seems like an elegant solution to me" millert@ ok dlg@ marco@
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r--sys/scsi/sd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 5c4cb6e789d..b8839fc426a 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.109 2006/07/23 02:50:20 dlg Exp $ */
+/* $OpenBSD: sd.c,v 1.110 2006/07/29 02:40:46 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -199,7 +199,7 @@ sdattach(parent, self, aux)
* Note if this device is ancient. This is used in sdminphys().
*/
if (!(sc_link->flags & SDEV_ATAPI) &&
- (sa->sa_inqbuf->version & SID_ANSII) == 0)
+ SCSISPC(sa->sa_inqbuf->version) == 0)
sd->flags |= SDF_ANCIENT;
/*
@@ -1451,7 +1451,7 @@ sd_flush(sd, flags)
*
* XXX What about older devices?
*/
- if ((sc_link->inqdata.version & SID_ANSII) >= 2 &&
+ if (SCSISPC(sc_link->inqdata.version) >= 2 &&
(sc_link->quirks & SDEV_NOSYNCCACHE) == 0) {
bzero(&sync_cmd, sizeof(sync_cmd));
sync_cmd.opcode = SYNCHRONIZE_CACHE;