.emulated = TRUE
};
+/* For a device that is "Not Ready" */
unsigned char usb_stor_sense_notready[18] = {
[0] = 0x70, /* current error */
[2] = 0x02, /* not ready */
[13] = 0x03 /* manual intervention */
};
+/* To Report "Illegal Request: Invalid Field in CDB */
+unsigned char usb_stor_sense_invalidCDB[18] = {
+ [0] = 0x70, /* current error */
+ [2] = ILLEGAL_REQUEST, /* Illegal Request = 0x05 */
+ [7] = 0x0a, /* additional length */
+ [12] = 0x24 /* Invalid Field in CDB */
+};
+
#define USB_STOR_SCSI_SENSE_HDRSZ 4
#define USB_STOR_SCSI_SENSE_10_HDRSZ 8
#include "hosts.h"
extern unsigned char usb_stor_sense_notready[18];
+extern unsigned char usb_stor_sense_invalidCDB[18];
extern Scsi_Host_Template usb_stor_host_template;
extern int usb_stor_scsiSense10to6(Scsi_Cmnd*);
extern int usb_stor_scsiSense6to10(Scsi_Cmnd*);
us->srb->result = GOOD << 1;
}
+ /* handle requests for EVPD, which most USB devices do
+ * not support */
+ else if((us->srb->cmnd[0] == INQUIRY) &&
+ (us->srb->cmnd[1] & 0x1)) {
+ US_DEBUGP("Faking INQUIRY command for EVPD\n");
+ memcpy(us->srb->sense_buffer,
+ usb_stor_sense_invalidCDB,
+ sizeof(usb_stor_sense_invalidCDB));
+ us->srb->result = CHECK_CONDITION << 1;
+ }
+
/* our device has gone - pretend not ready */
else if (!(us->flags & US_FL_DEV_ATTACHED)) {
US_DEBUGP("Request is for removed device\n");