summaryrefslogtreecommitdiffstats
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2019-09-01 15:03:32 +0000
committerkrw <krw@openbsd.org>2019-09-01 15:03:32 +0000
commit7b732f28632c630022dc013e20af7e571bbc4c23 (patch)
treea6a27ca1c9eec8f88c7b3f49ba0d26cad4e1dcae /sys/scsi/scsi_base.c
parentMake it clearer where message "spurious interrupt" comes from. (diff)
downloadwireguard-openbsd-7b732f28632c630022dc013e20af7e571bbc4c23.tar.xz
wireguard-openbsd-7b732f28632c630022dc013e20af7e571bbc4c23.zip
Adopt the SCSI versioning #define's from FreeBSD. Eliminate the
now unneeded version_to_spc() mapping array, a duplicate #define and a couple of magic numbers. Toss in some comments for future generations of spelunkers. Makes it possible to check for specific SPC versions when new features or eliminated features require such a check. No intentional functional change.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 7a79c956a8b..22a29278843 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.228 2019/08/28 15:17:23 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.229 2019/09/01 15:03:32 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -1105,19 +1105,15 @@ scsi_do_mode_sense(struct scsi_link *link, int page,
}
/*
- * Try 10 byte mode sense request. Don't bother with SMS_DBD or
- * SMS_LLBAA. Bail out if the returned information is less than
- * a big header in size (6 additional bytes).
+ * non-ATAPI, non-USB devices that don't support SCSI-2 commands are done.
*/
if ((link->flags & (SDEV_ATAPI | SDEV_UMASS)) == 0 &&
- !SCSI2(link->inqdata.version)) {
- /*
- * The 10 byte MODE_SENSE request appeared with SCSI-2,
- * so don't bother trying it on SCSI-[01] devices, they are
- * not supposed to understand it.
- */
+ SID_ANSII_REV(&link->inqdata) < SCSI_REV_2)
return (0);
- }
+
+ /*
+ * Try 10 byte mode sense request.
+ */
error = scsi_mode_sense_big(link, 0, page, &buf->hdr_big,
sizeof(*buf), flags, 20000);
if (error != 0)