summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2011-10-03 20:32:55 +0000
committerken <ken@FreeBSD.org>2011-10-03 20:32:55 +0000
commit949394e8e0224cfa99b2f84509def2a178ec0cf4 (patch)
tree7b282ccd4d59d892882bbd5ce805d71ea69df7bd /sys/dev
parentad1a755394fe964557e221bb8167258557383a9d (diff)
downloadFreeBSD-src-949394e8e0224cfa99b2f84509def2a178ec0cf4.zip
FreeBSD-src-949394e8e0224cfa99b2f84509def2a178ec0cf4.tar.gz
Add descriptor sense support to CAM, and honor sense residuals properly in
CAM. Desriptor sense is a new sense data format that originated in SPC-3. Among other things, it allows for an 8-byte info field, which is necessary to pass back block numbers larger than 4 bytes. This change adds a number of new functions to scsi_all.c (and therefore libcam) that abstract out most access to sense data. This includes a bump of CAM_VERSION, because the CCB ABI has changed. Userland programs that use the CAM pass(4) driver will need to be recompiled. camcontrol.c: Change uses of scsi_extract_sense() to use scsi_extract_sense_len(). Use scsi_get_sks() instead of accessing sense key specific data directly. scsi_modes: Update the control mode page to the latest version (SPC-4). scsi_cmds.c, scsi_target.c: Change references to struct scsi_sense_data to struct scsi_sense_data_fixed. This should be changed to allow the user to specify fixed or descriptor sense, and then use scsi_set_sense_data() to build the sense data. ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data manually. cam_periph.c: Use scsi_extract_sense_len() instead of using scsi_extract_sense() or accessing sense data directly. cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16. The change of struct scsi_sense_data from 32 to 252 bytes changes the size of struct ccb_scsiio, but not the size of union ccb. So the version must be bumped to prevent structure mis-matches. scsi_all.h: Lots of updated SCSI sense data and other structures. Add function prototypes for the new sense data functions. Take out the inline implementation of scsi_extract_sense(). It is now too large to put in a header file. Add macros to calculate whether fields are present and filled in fixed and descriptor sense data scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry data, and we'll assume a direct access device in that case. Changed the SCSI RESERVED sense key name and description to COMPLETED, as it is now defined in the spec. Change the error recovery action for a number of read errors to prevent lots of retries when the drive has said that the block isn't accessible. This speeds up reconstruction of the block by any RAID software running on top of the drive (e.g. ZFS). In scsi_sense_desc(), allow for invalid sense key numbers. This allows calling this routine without checking the input values first. Change scsi_error_action() to use scsi_extract_sense_len(), and handle things when invalid asc/ascq values are encountered. Add a new routine, scsi_desc_iterate(), that will call the supplied function for every descriptor in descriptor format sense data. Add scsi_set_sense_data(), and scsi_set_sense_data_va(), which build descriptor and fixed format sense data. They currently default to fixed format sense data. Add a number of scsi_get_*() functions, which get different types of sense data fields from either fixed or descriptor format sense data, if the data is present. Add a number of scsi_*_sbuf() functions, which print formatted versions of various sense data fields. These functions work for either fixed or descriptor sense. Add a number of scsi_sense_*_sbuf() functions, which have a standard calling interface and print the indicated field. These functions take descriptors only. Add scsi_sense_desc_sbuf(), which will print a formatted version of the given sense descriptor. Pull out a majority of the scsi_sense_sbuf() function and put it into scsi_sense_only_sbuf(). This allows callers that don't use struct ccb_scsiio to easily utilize the printing routines. Revamp that function to handle descriptor sense and use the new sense fetching and printing routines. Move scsi_extract_sense() into scsi_all.c, and implement it in terms of the new function, scsi_extract_sense_len(). The _len() version takes a length (which should be the sense length - residual) and can indicate which fields are present and valid in the sense data. Add a couple of new scsi_get_*() routines to get the sense key, asc, and ascq only. mly.c: Rename struct scsi_sense_data to struct scsi_sense_data_fixed. sbp_targ.c: Use the new sense fetching routines to get sense data instead of accessing it directly. sbp.c: Change the firewire/SCSI sense data transformation code to use struct scsi_sense_data_fixed instead of struct scsi_sense_data. This should be changed later to use scsi_set_sense_data(). ciss.c: Calculate the sense residual properly. Use scsi_get_sense_key() to fetch the sense key. mps_sas.c, mpt_cam.c: Set the sense residual properly. iir.c: Use scsi_set_sense_data() instead of building sense data by hand. iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data directly. umass.c: Use scsi_set_sense_data() to build sense data. Grab the sense key using scsi_get_sense_key(). Calculate the sense residual properly. isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key values. Calculate and set the sense residual. MFC after: 3 days Sponsored by: Spectra Logic Corporation
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ciss/ciss.c8
-rw-r--r--sys/dev/firewire/sbp.c4
-rw-r--r--sys/dev/firewire/sbp_targ.c91
-rw-r--r--sys/dev/iir/iir.c13
-rw-r--r--sys/dev/iscsi/initiator/iscsi_subr.c7
-rw-r--r--sys/dev/isp/isp_freebsd.h26
-rw-r--r--sys/dev/mly/mly.c8
-rw-r--r--sys/dev/mps/mps_sas.c15
-rw-r--r--sys/dev/mpt/mpt_cam.c15
-rw-r--r--sys/dev/usb/storage/umass.c29
10 files changed, 154 insertions, 62 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index e892e50..016d5f3 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -3249,13 +3249,17 @@ ciss_cam_complete(struct ciss_request *cr)
ce->sense_length, ce->residual_count);
bzero(&csio->sense_data, SSD_FULL_SIZE);
bcopy(&ce->sense_info[0], &csio->sense_data, ce->sense_length);
- csio->sense_len = ce->sense_length;
+ if (csio->sense_len > ce->sense_length)
+ csio->sense_resid = csio->sense_len - ce->sense_length;
+ else
+ csio->sense_resid = 0;
csio->resid = ce->residual_count;
csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID;
#ifdef CISS_DEBUG
{
struct scsi_sense_data *sns = (struct scsi_sense_data *)&ce->sense_info[0];
- debug(0, "sense key %x", sns->flags & SSD_KEY);
+ debug(0, "sense key %x", scsi_get_sense_key(sns, csio->sense_len -
+ csio->sense_resid, /*show_errors*/ 1));
}
#endif
break;
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index 0ac7d14..2387bf9 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -1515,10 +1515,10 @@ static void
sbp_scsi_status(struct sbp_status *sbp_status, struct sbp_ocb *ocb)
{
struct sbp_cmd_status *sbp_cmd_status;
- struct scsi_sense_data *sense;
+ struct scsi_sense_data_fixed *sense;
sbp_cmd_status = (struct sbp_cmd_status *)sbp_status->data;
- sense = &ocb->ccb->csio.sense_data;
+ sense = (struct scsi_sense_data_fixed *)&ocb->ccb->csio.sense_data;
SBP_DEBUG(0)
sbp_print_scsi_cmd(ocb);
diff --git a/sys/dev/firewire/sbp_targ.c b/sys/dev/firewire/sbp_targ.c
index c5b9d23..f04b968 100644
--- a/sys/dev/firewire/sbp_targ.c
+++ b/sys/dev/firewire/sbp_targ.c
@@ -41,6 +41,7 @@
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/malloc.h>
+#include <sys/endian.h>
#if __FreeBSD_version < 500000
#include <sys/devicestat.h>
#endif
@@ -632,6 +633,12 @@ sbp_targ_send_status(struct orb_info *orbi, union ccb *ccb)
{
struct sbp_cmd_status *sbp_cmd_status;
struct scsi_sense_data *sense;
+ int error_code, sense_key, asc, ascq;
+ uint8_t stream_bits;
+ uint8_t sks[3];
+ uint64_t info;
+ int64_t sinfo;
+ int sense_len;
if (debug)
printf("%s: STATUS %d\n", __func__,
@@ -659,35 +666,75 @@ sbp_targ_send_status(struct orb_info *orbi, union ccb *ccb)
#endif
#endif
- if ((sense->error_code & SSD_ERRCODE) == SSD_CURRENT_ERROR)
+ sense_len = ccb->csio.sense_len - ccb->csio.sense_resid;
+ scsi_extract_sense_len(sense, sense_len, &error_code,
+ &sense_key, &asc, &ascq, /*show_errors*/ 0);
+
+ switch (error_code) {
+ case SSD_CURRENT_ERROR:
+ case SSD_DESC_CURRENT_ERROR:
sbp_cmd_status->sfmt = SBP_SFMT_CURR;
- else
+ break;
+ default:
sbp_cmd_status->sfmt = SBP_SFMT_DEFER;
+ break;
+ }
- sbp_cmd_status->valid = (sense->error_code & SSD_ERRCODE_VALID)
- ? 1 : 0;
- sbp_cmd_status->s_key = sense->flags & SSD_KEY;
- sbp_cmd_status->mark = (sense->flags & SSD_FILEMARK)? 1 : 0;
- sbp_cmd_status->eom = (sense->flags & SSD_EOM) ? 1 : 0;
- sbp_cmd_status->ill_len = (sense->flags & SSD_ILI) ? 1 : 0;
+ if (scsi_get_sense_info(sense, sense_len, SSD_DESC_INFO, &info,
+ &sinfo) == 0) {
+ uint32_t info_trunc;
+ sbp_cmd_status->valid = 1;
+ info_trunc = info;
- bcopy(&sense->info[0], &sbp_cmd_status->info, 4);
+ sbp_cmd_status->info = htobe32(info_trunc);
+ } else {
+ sbp_cmd_status->valid = 0;
+ }
- if (sense->extra_len <= 6)
- /* add_sense_code(_qual), info, cmd_spec_info */
- sbp_status->len = 4;
- else
- /* fru, sense_key_spec */
- sbp_status->len = 5;
-
- bcopy(&sense->cmd_spec_info[0], &sbp_cmd_status->cdb, 4);
+ sbp_cmd_status->s_key = sense_key;
+
+ if (scsi_get_stream_info(sense, sense_len, NULL,
+ &stream_bits) == 0) {
+ sbp_cmd_status->mark =
+ (stream_bits & SSD_FILEMARK) ? 1 : 0;
+ sbp_cmd_status->eom =
+ (stream_bits & SSD_EOM) ? 1 : 0;
+ sbp_cmd_status->ill_len =
+ (stream_bits & SSD_ILI) ? 1 : 0;
+ } else {
+ sbp_cmd_status->mark = 0;
+ sbp_cmd_status->eom = 0;
+ sbp_cmd_status->ill_len = 0;
+ }
+
+
+ /* add_sense_code(_qual), info, cmd_spec_info */
+ sbp_status->len = 4;
+
+ if (scsi_get_sense_info(sense, sense_len, SSD_DESC_COMMAND,
+ &info, &sinfo) == 0) {
+ uint32_t cmdspec_trunc;
+
+ cmdspec_trunc = info;
+
+ sbp_cmd_status->cdb = htobe32(cmdspec_trunc);
+ }
- sbp_cmd_status->s_code = sense->add_sense_code;
- sbp_cmd_status->s_qlfr = sense->add_sense_code_qual;
- sbp_cmd_status->fru = sense->fru;
+ sbp_cmd_status->s_code = asc;
+ sbp_cmd_status->s_qlfr = ascq;
- bcopy(&sense->sense_key_spec[0],
- &sbp_cmd_status->s_keydep[0], 3);
+ if (scsi_get_sense_info(sense, sense_len, SSD_DESC_FRU, &info,
+ &sinfo) == 0) {
+ sbp_cmd_status->fru = (uint8_t)info;
+ sbp_status->len = 5;
+ } else {
+ sbp_cmd_status->fru = 0;
+ }
+
+ if (scsi_get_sks(sense, sense_len, sks) == 0) {
+ bcopy(sks, &sbp_cmd_status->s_keydep[0], sizeof(sks));
+ sbp_status->len = 5;
+ }
break;
}
diff --git a/sys/dev/iir/iir.c b/sys/dev/iir/iir.c
index b0915c2..2be7c39 100644
--- a/sys/dev/iir/iir.c
+++ b/sys/dev/iir/iir.c
@@ -1839,13 +1839,20 @@ gdt_sync_event(struct gdt_softc *gdt, int service,
} else {
/* error */
if (gccb->gc_service == GDT_CACHESERVICE) {
+ struct scsi_sense_data *sense;
+
ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID;
ccb->ccb_h.status &= ~CAM_SIM_QUEUED;
ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
bzero(&ccb->csio.sense_data, ccb->csio.sense_len);
- ccb->csio.sense_data.error_code =
- SSD_CURRENT_ERROR | SSD_ERRCODE_VALID;
- ccb->csio.sense_data.flags = SSD_KEY_NOT_READY;
+ sense = &ccb->csio.sense_data;
+ scsi_set_sense_data(sense,
+ /*sense_format*/ SSD_TYPE_NONE,
+ /*current_error*/ 1,
+ /*sense_key*/ SSD_KEY_NOT_READY,
+ /*asc*/ 0x4,
+ /*ascq*/ 0x01,
+ SSD_ELEM_NONE);
gdt->sc_dvr.size = sizeof(gdt->sc_dvr.eu.sync);
gdt->sc_dvr.eu.sync.ionode = gdt->sc_hanum;
diff --git a/sys/dev/iscsi/initiator/iscsi_subr.c b/sys/dev/iscsi/initiator/iscsi_subr.c
index 03d9293..ffe1baa 100644
--- a/sys/dev/iscsi/initiator/iscsi_subr.c
+++ b/sys/dev/iscsi/initiator/iscsi_subr.c
@@ -153,6 +153,7 @@ getSenseData(u_int status, union ccb *ccb, pduq_t *pq)
scsi_rsp_t *cmd = &pp->ipdu.scsi_rsp;
caddr_t bp;
int sense_len, mustfree = 0;
+ int error_code, sense_key, asc, ascq;
bp = mtod(pq->mp, caddr_t);
if((sense_len = scsi_2btoul(bp)) == 0)
@@ -174,10 +175,14 @@ getSenseData(u_int status, union ccb *ccb, pduq_t *pq)
scsi->sense_resid = 0;
if(cmd->flag & (BIT(1)|BIT(2)))
scsi->sense_resid = ntohl(pp->ipdu.scsi_rsp.rcnt);
+
+ scsi_extract_sense_len(sense, scsi->sense_len - scsi->sense_resid,
+ &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1);
+
debug(3, "sense_len=%d rcnt=%d sense_resid=%d dsl=%d error_code=%x flags=%x",
sense_len,
ntohl(pp->ipdu.scsi_rsp.rcnt), scsi->sense_resid,
- pp->ds_len, sense->error_code, sense->flags);
+ pp->ds_len, error_code, sense_key);
if(mustfree)
free(bp, M_ISCSI);
diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h
index 1fb5fc5..9d14039 100644
--- a/sys/dev/isp/isp_freebsd.h
+++ b/sys/dev/isp/isp_freebsd.h
@@ -438,11 +438,19 @@ default: \
#define XS_SNSP(ccb) (&(ccb)->sense_data)
#define XS_SNSLEN(ccb) \
- imin((sizeof((ccb)->sense_data)), ccb->sense_len)
+ imin((sizeof((ccb)->sense_data)), ccb->sense_len - ccb->sense_resid)
-#define XS_SNSKEY(ccb) ((ccb)->sense_data.flags & 0xf)
-#define XS_SNSASC(ccb) ((ccb)->sense_data.add_sense_code)
-#define XS_SNSASCQ(ccb) ((ccb)->sense_data.add_sense_code_qual)
+#define XS_SNSKEY(ccb) (scsi_get_sense_key(&(ccb)->sense_data, \
+ ccb->sense_len - ccb->sense_resid, \
+ /*show_errors*/ 1))
+
+#define XS_SNSASC(ccb) (scsi_get_asc(&(ccb)->sense_data, \
+ ccb->sense_len - ccb->sense_resid, \
+ /*show_errors*/ 1))
+
+#define XS_SNSASCQ(ccb) (scsi_get_ascq(&(ccb)->sense_data, \
+ ccb->sense_len - ccb->sense_resid, \
+ /*show_errors*/ 1))
#define XS_TAG_P(ccb) \
(((ccb)->ccb_h.flags & CAM_TAG_ACTION_VALID) && \
(ccb)->tag_action != CAM_TAG_ACTION_NONE)
@@ -476,9 +484,13 @@ default: \
#define XS_INITERR(ccb) \
XS_SETERR(ccb, CAM_REQ_INPROG), (ccb)->ccb_h.spriv_field0 = 0
-#define XS_SAVE_SENSE(xs, sense_ptr, sense_len) \
- (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \
- memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs), sense_len))
+#define XS_SAVE_SENSE(xs, sense_ptr, slen) do { \
+ (xs)->ccb_h.status |= CAM_AUTOSNS_VALID; \
+ memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs),\
+ slen)); \
+ if (slen < (xs)->sense_len) \
+ (xs)->sense_resid = (xs)->sense_len - slen; \
+ } while (0);
#define XS_SENSE_VALID(xs) (((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0)
diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c
index 90f2819..ee73ae9 100644
--- a/sys/dev/mly/mly.c
+++ b/sys/dev/mly/mly.c
@@ -1294,9 +1294,11 @@ mly_complete_event(struct mly_command *mc)
static void
mly_process_event(struct mly_softc *sc, struct mly_event *me)
{
- struct scsi_sense_data *ssd = (struct scsi_sense_data *)&me->sense[0];
- char *fp, *tp;
- int bus, target, event, class, action;
+ struct scsi_sense_data_fixed *ssd;
+ char *fp, *tp;
+ int bus, target, event, class, action;
+
+ ssd = (struct scsi_sense_data_fixed *)&me->sense[0];
/*
* Errors can be reported using vendor-unique sense data. In this case, the
diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c
index 2aa4773..fb4e224 100644
--- a/sys/dev/mps/mps_sas.c
+++ b/sys/dev/mps/mps_sas.c
@@ -1490,7 +1490,6 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm)
MPI2_SCSI_IO_REPLY *rep;
union ccb *ccb;
struct mpssas_softc *sassc;
- u_int sense_len;
int dir = 0;
mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
@@ -1666,10 +1665,16 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm)
}
if (rep->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) {
- sense_len = MIN(rep->SenseCount,
- sizeof(struct scsi_sense_data));
- if (sense_len < rep->SenseCount)
- ccb->csio.sense_resid = rep->SenseCount - sense_len;
+ int sense_len;
+
+ if (rep->SenseCount < ccb->csio.sense_len)
+ ccb->csio.sense_resid = ccb->csio.sense_len -
+ rep->SenseCount;
+ else
+ ccb->csio.sense_resid = 0;
+
+ sense_len = min(rep->SenseCount, ccb->csio.sense_len -
+ ccb->csio.sense_resid);
bcopy(cm->cm_sense, &ccb->csio.sense_data, sense_len);
ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
}
diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c
index d512458..a3f740a 100644
--- a/sys/dev/mpt/mpt_cam.c
+++ b/sys/dev/mpt/mpt_cam.c
@@ -3167,12 +3167,19 @@ mpt_scsi_reply_frame_handler(struct mpt_softc *mpt, request_t *req,
if ((sstate & MPI_SCSI_STATE_AUTOSENSE_VALID) != 0
&& (ccb->ccb_h.flags & (CAM_SENSE_PHYS | CAM_SENSE_PTR)) == 0) {
+ uint32_t sense_returned;
+
ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
- ccb->csio.sense_resid =
- ccb->csio.sense_len - le32toh(scsi_io_reply->SenseCount);
+
+ sense_returned = le32toh(scsi_io_reply->SenseCount);
+ if (sense_returned < ccb->csio.sense_len)
+ ccb->csio.sense_resid = ccb->csio.sense_len -
+ sense_returned;
+ else
+ ccb->csio.sense_resid = 0;
+
bcopy(req->sense_vbuf, &ccb->csio.sense_data,
- min(ccb->csio.sense_len,
- le32toh(scsi_io_reply->SenseCount)));
+ min(ccb->csio.sense_len, sense_returned));
}
if ((sstate & MPI_SCSI_STATE_QUEUE_TAG_REJECTED) != 0) {
diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c
index 41e98d5..b932cfa 100644
--- a/sys/dev/usb/storage/umass.c
+++ b/sys/dev/usb/storage/umass.c
@@ -2344,14 +2344,14 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
*/
if ((sc->sc_quirks & (NO_INQUIRY_EVPD | NO_INQUIRY)) &&
(sc->sc_transfer.cmd_data[1] & SI_EVPD)) {
- struct scsi_sense_data *sense;
-
- sense = &ccb->csio.sense_data;
- bzero(sense, sizeof(*sense));
- sense->error_code = SSD_CURRENT_ERROR;
- sense->flags = SSD_KEY_ILLEGAL_REQUEST;
- sense->add_sense_code = 0x24;
- sense->extra_len = 10;
+
+ scsi_set_sense_data(&ccb->csio.sense_data,
+ /*sense_format*/ SSD_TYPE_NONE,
+ /*current_error*/ 1,
+ /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST,
+ /*asc*/ 0x24,
+ /*ascq*/ 0x00,
+ /*extra args*/ SSD_ELEM_NONE);
ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR |
CAM_AUTOSNS_VALID;
@@ -2631,12 +2631,17 @@ umass_cam_sense_cb(struct umass_softc *sc, union ccb *ccb, uint32_t residue,
uint8_t status)
{
uint8_t *cmd;
- uint8_t key;
switch (status) {
case STATUS_CMD_OK:
case STATUS_CMD_UNKNOWN:
- case STATUS_CMD_FAILED:
+ case STATUS_CMD_FAILED: {
+ int key, sense_len;
+
+ ccb->csio.sense_resid = residue;
+ sense_len = ccb->csio.sense_len - ccb->csio.sense_resid;
+ key = scsi_get_sense_key(&ccb->csio.sense_data, sense_len,
+ /*show_errors*/ 1);
if (ccb->csio.ccb_h.flags & CAM_CDB_POINTER) {
cmd = (uint8_t *)(ccb->csio.cdb_io.cdb_ptr);
@@ -2644,8 +2649,6 @@ umass_cam_sense_cb(struct umass_softc *sc, union ccb *ccb, uint32_t residue,
cmd = (uint8_t *)(ccb->csio.cdb_io.cdb_bytes);
}
- key = (ccb->csio.sense_data.flags & SSD_KEY);
-
/*
* Getting sense data always succeeds (apart from wire
* failures):
@@ -2704,7 +2707,7 @@ umass_cam_sense_cb(struct umass_softc *sc, union ccb *ccb, uint32_t residue,
}
xpt_done(ccb);
break;
-
+ }
default:
DPRINTF(sc, UDMASS_SCSI, "Autosense failed, "
"status %d\n", status);
OpenPOWER on IntegriCloud