Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151174364
D49465.id152564.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D49465.id152564.diff
View Options
diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c
--- a/sys/dev/usb/storage/umass.c
+++ b/sys/dev/usb/storage/umass.c
@@ -489,6 +489,7 @@
uint8_t);
static void umass_cam_quirk_cb(struct umass_softc *, union ccb *, uint32_t,
uint8_t);
+static void umass_cam_illegal_request(union ccb *ccb);
static uint8_t umass_scsi_transform(struct umass_softc *, uint8_t *, uint8_t);
static uint8_t umass_rbc_transform(struct umass_softc *, uint8_t *, uint8_t);
static uint8_t umass_ufi_transform(struct umass_softc *, uint8_t *, uint8_t);
@@ -2262,20 +2263,7 @@
*/
if ((sc->sc_quirks & (NO_INQUIRY_EVPD | NO_INQUIRY)) &&
(sc->sc_transfer.cmd_data[1] & SI_EVPD)) {
- scsi_set_sense_data(&ccb->csio.sense_data,
- /*sense_format*/ SSD_TYPE_NONE,
- /*current_error*/ 1,
- /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST,
- /*asc*/ 0x24, /* 24h/00h INVALID FIELD IN CDB */
- /*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 |
- CAM_DEV_QFRZN;
- xpt_freeze_devq(ccb->ccb_h.path, 1);
- xpt_done(ccb);
+ umass_cam_illegal_request(ccb);
goto done;
}
/*
@@ -2463,6 +2451,29 @@
usbd_transfer_poll(sc->sc_xfer, UMASS_T_MAX);
}
+/* umass_cam_illegal_request
+ * Complete the command as an illegal command with invalid field
+ */
+
+static void
+umass_cam_illegal_request(union ccb *ccb)
+{
+ scsi_set_sense_data(&ccb->csio.sense_data,
+ /*sense_format*/ SSD_TYPE_NONE,
+ /*current_error*/ 1,
+ /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST,
+ /*asc*/ 0x24, /* 24h/00h INVALID FIELD IN CDB */
+ /*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 |
+ CAM_DEV_QFRZN;
+ xpt_freeze_devq(ccb->ccb_h.path, 1);
+ xpt_done(ccb);
+}
+
/* umass_cam_cb
* finalise a completed CAM command
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 2:35 PM (10 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31037393
Default Alt Text
D49465.id152564.diff (2 KB)
Attached To
Mode
D49465: umass: Move illegal opcode return to a function
Attached
Detach File
Event Timeline
Log In to Comment