summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r--sys/cam/scsi/scsi_all.c32
-rw-r--r--sys/cam/scsi/scsi_all.h13
-rw-r--r--sys/cam/scsi/scsi_cd.c3
-rw-r--r--sys/cam/scsi/scsi_ch.c3
-rw-r--r--sys/cam/scsi/scsi_da.c3
-rw-r--r--sys/cam/scsi/scsi_pt.c3
-rw-r--r--sys/cam/scsi/scsi_sa.c3
-rw-r--r--sys/cam/scsi/scsi_xpt.c11
8 files changed, 61 insertions, 10 deletions
diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c
index 8f27fd9..a54c03b 100644
--- a/sys/cam/scsi/scsi_all.c
+++ b/sys/cam/scsi/scsi_all.c
@@ -8418,6 +8418,38 @@ scsi_security_protocol_out(struct ccb_scsiio *csio, uint32_t retries,
timeout);
}
+void
+scsi_report_supported_opcodes(struct ccb_scsiio *csio, uint32_t retries,
+ void (*cbfcnp)(struct cam_periph *, union ccb *),
+ uint8_t tag_action, int options, int req_opcode,
+ int req_service_action, uint8_t *data_ptr,
+ uint32_t dxfer_len, int sense_len, int timeout)
+{
+ struct scsi_report_supported_opcodes *scsi_cmd;
+
+ scsi_cmd = (struct scsi_report_supported_opcodes *)
+ &csio->cdb_io.cdb_bytes;
+ bzero(scsi_cmd, sizeof(*scsi_cmd));
+
+ scsi_cmd->opcode = MAINTENANCE_IN;
+ scsi_cmd->service_action = REPORT_SUPPORTED_OPERATION_CODES;
+ scsi_cmd->options = options;
+ scsi_cmd->requested_opcode = req_opcode;
+ scsi_ulto2b(req_service_action, scsi_cmd->requested_service_action);
+ scsi_ulto4b(dxfer_len, scsi_cmd->length);
+
+ cam_fill_csio(csio,
+ retries,
+ cbfcnp,
+ /*flags*/CAM_DIR_IN,
+ tag_action,
+ data_ptr,
+ dxfer_len,
+ sense_len,
+ sizeof(*scsi_cmd),
+ timeout);
+}
+
/*
* Try make as good a match as possible with
* available sub drivers
diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h
index e446f6c..253e28e 100644
--- a/sys/cam/scsi/scsi_all.h
+++ b/sys/cam/scsi/scsi_all.h
@@ -1457,6 +1457,11 @@ struct scsi_report_supported_opcodes_one
uint8_t reserved;
uint8_t support;
#define RSO_ONE_CTDP 0x80
+#define RSO_ONE_SUP_MASK 0x07
+#define RSO_ONE_SUP_UNAVAIL 0x00
+#define RSO_ONE_SUP_NOT_SUP 0x01
+#define RSO_ONE_SUP_AVAIL 0x03
+#define RSO_ONE_SUP_VENDOR 0x05
uint8_t cdb_length[2];
uint8_t cdb_usage[];
};
@@ -3967,6 +3972,14 @@ void scsi_persistent_reserve_out(struct ccb_scsiio *csio, uint32_t retries,
uint32_t dxfer_len, int sense_len,
int timeout);
+void scsi_report_supported_opcodes(struct ccb_scsiio *csio, uint32_t retries,
+ void (*cbfcnp)(struct cam_periph *,
+ union ccb *),
+ uint8_t tag_action, int options,
+ int req_opcode, int req_service_action,
+ uint8_t *data_ptr, uint32_t dxfer_len,
+ int sense_len, int timeout);
+
int scsi_inquiry_match(caddr_t inqbuffer, caddr_t table_entry);
int scsi_static_inquiry_match(caddr_t inqbuffer,
caddr_t table_entry);
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index f252b86..1dc5f80 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -389,7 +389,8 @@ cdasync(void *callback_arg, u_int32_t code,
if (cgd->protocol != PROTO_SCSI)
break;
-
+ if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_CDROM
&& SID_TYPE(&cgd->inq_data) != T_WORM)
break;
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index b83bc53..38acb01 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -337,7 +337,8 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
if (cgd->protocol != PROTO_SCSI)
break;
-
+ if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED)
+ break;
if (SID_TYPE(&cgd->inq_data)!= T_CHANGER)
break;
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 74dd3b9..3ebbb71 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -1663,7 +1663,8 @@ daasync(void *callback_arg, u_int32_t code,
if (cgd->protocol != PROTO_SCSI)
break;
-
+ if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_DIRECT
&& SID_TYPE(&cgd->inq_data) != T_RBC
&& SID_TYPE(&cgd->inq_data) != T_OPTICAL)
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index f34748c..15240da 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -366,7 +366,8 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
if (cgd->protocol != PROTO_SCSI)
break;
-
+ if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_PROCESSOR)
break;
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 5826caa..6110b3d 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -2255,7 +2255,8 @@ saasync(void *callback_arg, u_int32_t code,
if (cgd->protocol != PROTO_SCSI)
break;
-
+ if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED)
+ break;
if (SID_TYPE(&cgd->inq_data) != T_SEQUENTIAL)
break;
diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c
index 0f44cf5..7cffd67 100644
--- a/sys/cam/scsi/scsi_xpt.c
+++ b/sys/cam/scsi/scsi_xpt.c
@@ -1123,6 +1123,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
{
probe_softc *softc;
struct cam_path *path;
+ struct scsi_inquiry_data *inq_buf;
u_int32_t priority;
CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n"));
@@ -1162,7 +1163,6 @@ out:
case PROBE_FULL_INQUIRY:
{
if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) {
- struct scsi_inquiry_data *inq_buf;
u_int8_t periph_qual;
path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID;
@@ -1171,7 +1171,8 @@ out:
periph_qual = SID_QUAL(inq_buf);
- if (periph_qual == SID_QUAL_LU_CONNECTED) {
+ if (periph_qual == SID_QUAL_LU_CONNECTED ||
+ periph_qual == SID_QUAL_LU_OFFLINE) {
u_int8_t len;
/*
@@ -1347,10 +1348,10 @@ out:
probe_purge_old(path, lp, softc->flags);
lp = NULL;
}
+ inq_buf = &path->device->inq_data;
if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID &&
- SID_QUAL(&path->device->inq_data) == SID_QUAL_LU_CONNECTED) {
- struct scsi_inquiry_data *inq_buf;
- inq_buf = &path->device->inq_data;
+ (SID_QUAL(inq_buf) == SID_QUAL_LU_CONNECTED ||
+ SID_QUAL(inq_buf) == SID_QUAL_LU_OFFLINE)) {
if (INQ_DATA_TQ_ENABLED(inq_buf))
PROBE_SET_ACTION(softc, PROBE_MODE_SENSE);
else
OpenPOWER on IntegriCloud