summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-05-30 22:44:00 +0000
committermjacob <mjacob@FreeBSD.org>2006-05-30 22:44:00 +0000
commite96ef6e51ce2eada4161f8c46c031c67179ff703 (patch)
tree6614eeb1f8a49a4cf6688996794e5850d915ecb8 /sys/cam
parenteea2675a247d9a55896fed839fb54dcc07966c7c (diff)
downloadFreeBSD-src-e96ef6e51ce2eada4161f8c46c031c67179ff703.zip
FreeBSD-src-e96ef6e51ce2eada4161f8c46c031c67179ff703.tar.gz
Handle some of the inquiry flags that have come into
usage as of SPC2r20. Specifically, handle the BQueue flag which will indicate that a device supports the Basic Queueing model (no Head of Queue or Ordered tags). When this flag is set, SID_CmdQueue is clear. This has causes FreeBSD to assume that the device did not support tagged operations. MFC after: 1 month
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c9
-rw-r--r--sys/cam/scsi/scsi_all.h14
2 files changed, 17 insertions, 6 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 1c90c6f..4591b07 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -3502,8 +3502,7 @@ xpt_action(union ccb *start_ccb)
if ((crs->release_flags & RELSIM_ADJUST_OPENINGS) != 0) {
- if ((dev->inq_data.flags & SID_CmdQue) != 0) {
-
+ if (INQ_DATA_TQ_ENABLED(&dev->inq_data)) {
/* Don't ever go below one opening */
if (crs->openings > 0) {
xpt_dev_ccbq_resize(crs->ccb_h.path,
@@ -5991,7 +5990,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
#ifdef CAM_NEW_TRAN_CODE
xpt_devise_transport(path);
#endif /* CAM_NEW_TRAN_CODE */
- if ((inq_buf->flags & SID_CmdQue) != 0)
+ if (INQ_DATA_TQ_ENABLED(inq_buf))
softc->action = PROBE_MODE_SENSE;
else
softc->action = PROBE_SERIAL_NUM;
@@ -6416,7 +6415,7 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
/* SCSI specific sanity checking */
if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0
- || (inq_data->flags & SID_CmdQue) == 0
+ || (INQ_DATA_TQ_ENABLED(inq_data)) == 0
|| (device->queue_flags & SCP_QUEUE_DQUE) != 0
|| (device->quirk->mintags == 0)) {
/*
@@ -6712,7 +6711,7 @@ xpt_set_transfer_settings(struct ccb_trans_settings *cts, struct cam_ed *device,
}
if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0
- || (inq_data->flags & SID_CmdQue) == 0
+ || (INQ_DATA_TQ_ENABLED(inq_data)) == 0
|| (device->queue_flags & SCP_QUEUE_DQUE) != 0
|| (device->quirk->mintags == 0)) {
/*
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index 02cfd18..33b26de 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -599,7 +599,19 @@ struct scsi_inquiry_data
#define SID_AENC 0x80
#define SID_TrmIOP 0x40
u_int8_t additional_length;
- u_int8_t reserved[2];
+ u_int8_t reserved;
+ u_int8_t spc2_flags;
+#define SPC2_SID_MChngr 0x08
+#define SPC2_SID_MultiP 0x10
+#define SPC2_SID_EncServ 0x40
+#define SPC2_SID_BQueue 0x80
+
+#define INQ_DATA_TQ_ENABLED(iqd) \
+ ((SID_ANSI_REV(iqd) < SCSI_REV_SPC2)? ((iqd)->flags & SID_CmdQue) : \
+ (((iqd)->flags & SID_CmdQue) && !((iqd)->spc2_flags & SPC2_SID_BQueue)) || \
+ (!((iqd)->flags & SID_CmdQue) && ((iqd)->spc2_flags & SPC2_SID_BQueue)))
+
+
u_int8_t flags;
#define SID_SftRe 0x01
#define SID_CmdQue 0x02
OpenPOWER on IntegriCloud