diff -urNp linux-1250/drivers/usb/storage/unusual_devs.h linux-1260/drivers/usb/storage/unusual_devs.h --- linux-1250/drivers/usb/storage/unusual_devs.h +++ linux-1260/drivers/usb/storage/unusual_devs.h @@ -434,7 +434,7 @@ UNUSUAL_DEV( 0x0781, 0x0002, 0x0009, 0x "Sandisk", "ImageMate SDDR-31", US_SC_SCSI, US_PR_BULK, NULL, - US_FL_IGNORE_SER ), + US_FL_IGNORE_SER | US_FL_START_CHECK ), UNUSUAL_DEV( 0x0781, 0x0100, 0x0100, 0x0100, "Sandisk", diff -urNp linux-1250/drivers/usb/storage/usb.c linux-1260/drivers/usb/storage/usb.c --- linux-1250/drivers/usb/storage/usb.c +++ linux-1260/drivers/usb/storage/usb.c @@ -442,6 +442,20 @@ static int usb_stor_control_thread(void US_DEBUGP("Faking INQUIRY command\n"); fill_inquiry_response(us, data_ptr, 36); us->srb->result = GOOD << 1; + } else if ((us->srb->cmnd[0] == START_STOP) && + (us->flags & US_FL_START_CHECK)) { + unsigned char saved_cdb[6]; + + /* Handle those devices which fake + * START_STOP on us, this confuses + * the hell out of media check code. */ + US_DEBUGP("Convering START_STOP command\n"); + memcpy(saved_cdb, us->srb->cmnd, 6); + memset(us->srb->cmnd, 0, 6); + us->srb->cmnd[0] = TEST_UNIT_READY; + US_DEBUG(usb_stor_show_command(us->srb)); + us->proto_handler(us->srb, us); + memcpy(us->srb->cmnd, saved_cdb, 6); } else { /* we've got a command, let's do it! */ US_DEBUG(usb_stor_show_command(us->srb)); diff -urNp linux-1250/drivers/usb/storage/usb.h linux-1260/drivers/usb/storage/usb.h --- linux-1250/drivers/usb/storage/usb.h +++ linux-1260/drivers/usb/storage/usb.h @@ -99,6 +99,7 @@ struct us_unusual_dev { #define US_FL_SINGLE_LUN 0x00000001 /* allow access to only LUN 0 */ #define US_FL_MODE_XLATE 0x00000002 /* translate _6 to _10 commands for Win/MacOS compatibility */ +#define US_FL_START_CHECK 0x00000008 /* START_STOP => TEST UNIT READY */ #define US_FL_IGNORE_SER 0x00000010 /* Ignore the serial number given */ #define US_FL_SCM_MULT_TARG 0x00000020 /* supports multiple targets */ #define US_FL_FIX_INQUIRY 0x00000040 /* INQUIRY response needs fixing */