summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-07-13 11:46:17 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-07-13 11:46:17 +0000
commit0ef32ae09397882f39ec2793787652e5fa725fb2 (patch)
treece40f3fc9289a93467bdc5a1208faf3075e4e773
parent022f37693c132d00d8620016aa665559d555f6c1 (diff)
Eliminate scsi_link field 'scsi_version' and just use the INQUIRY data
stored in scsi_link. That's where the value came from anyway. Move 'luns' field to where 'scsi_version' used to be to preserve alignment. ok dlg@
-rw-r--r--sys/scsi/scsi_base.c4
-rw-r--r--sys/scsi/scsiconf.c3
-rw-r--r--sys/scsi/scsiconf.h5
-rw-r--r--sys/scsi/sd.c4
4 files changed, 7 insertions, 9 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 520014c9821..5d79b67a37a 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.106 2006/07/11 13:15:30 dlg Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.107 2006/07/13 11:46:16 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -205,7 +205,7 @@ scsi_make_xs(struct scsi_link *sc_link, struct scsi_generic *scsi_cmd,
* than SCSI-2 would not need it, but why risk it? This was the
* old conditional:
*
- * if ((sc_link->scsi_version & SID_ANSII) <= 2)
+ * if ((sc_link->inqdata.version & SID_ANSII) <= 2)
*/
xs->cmd->bytes[0] &= ~SCSI_CMD_LUN_MASK;
xs->cmd->bytes[0] |=
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index b1d5755773a..0431ba61583 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.105 2006/07/11 21:55:46 dlg Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.106 2006/07/13 11:46:16 krw Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -651,7 +651,6 @@ scsi_probedev(struct scsibus_softc *scsi, struct scsi_inquiry_data *inqbuflun0,
*/
if (priority != 0)
sc_link->quirks |= finger->quirks;
- sc_link->scsi_version = inqbuf.version;
/*
* Save INQUIRY.
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index 762392cb82a..270cd900ea9 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.68 2006/07/11 21:55:46 dlg Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.69 2006/07/13 11:46:16 krw Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -159,8 +159,8 @@ struct scsi_device {
* as well.
*/
struct scsi_link {
- u_int8_t scsi_version; /* SCSI-I, SCSI-II, etc. */
u_int8_t scsibus; /* the Nth scsibus */
+ u_int8_t luns;
u_int16_t target; /* targ of this dev */
u_int16_t lun; /* lun of this dev */
u_int16_t openings; /* available operations */
@@ -192,7 +192,6 @@ struct scsi_link {
#define ADEV_NOTUR 0x1000 /* No TEST UNIT READY */
#define ADEV_NODOORLOCK 0x2000 /* can't lock door */
#define SDEV_ONLYBIG 0x4000 /* always use READ_BIG and WRITE_BIG */
- u_char luns;
struct scsi_device *device; /* device entry points etc. */
void *device_softc; /* needed for call to foo_start */
struct scsi_adapter *adapter; /* adapter entry points etc. */
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 34f41f6a2ed..5c7dc68326b 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.107 2006/07/11 21:55:46 dlg Exp $ */
+/* $OpenBSD: sd.c,v 1.108 2006/07/13 11:46:16 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -1460,7 +1460,7 @@ sd_flush(sd, flags)
*
* XXX What about older devices?
*/
- if ((sc_link->scsi_version & SID_ANSII) >= 2 &&
+ if ((sc_link->inqdata.version & SID_ANSII) >= 2 &&
(sc_link->quirks & SDEV_NOSYNCCACHE) == 0) {
bzero(&sync_cmd, sizeof(sync_cmd));
sync_cmd.opcode = SYNCHRONIZE_CACHE;