ChangeSet 1.823.3.5, 2002/11/11 13:13:45-08:00, mdharm-usb@one-eyed-alien.net [PATCH] usb storage: remove unneeded workaround for START_STOP This patch removes the special-case code for START_STOP. It can be safely removed now because the higher SCSI layers won't send this command unless the device indicates that it needs it to allow media access. diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c --- a/drivers/usb/storage/usb.c Thu Nov 14 14:12:58 2002 +++ b/drivers/usb/storage/usb.c Thu Nov 14 14:12:58 2002 @@ -437,41 +437,6 @@ us->srb->result = GOOD << 1; } - /* Most USB devices can't handle START_STOP. But we - * need something for media-change, so we'll use TUR - * instead. - * - * We specifically allow this command through if either: - * (a) it's a load/eject command (cmnd[4] & 2) - * (b) it's a multi-target unit (i.e. legacy SCSI adaptor) - */ - else if (us->srb->cmnd[0] == START_STOP && - !(us->srb->cmnd[4] & 2) && - !(us->flags & US_FL_SCM_MULT_TARG)) { - unsigned char saved_cdb[16]; /* largest SCSI-III cmd */ - __u8 old_cmd_len; - - US_DEBUGP("Converting START_STOP to TUR\n"); - - /* save old command */ - memcpy(saved_cdb, us->srb->cmnd, us->srb->cmd_len); - old_cmd_len = us->srb->cmd_len; - - /* set up new command -- preserve LUN */ - us->srb->cmd_len = 6; - memset(us->srb->cmnd, 0, us->srb->cmd_len); - us->srb->cmnd[0] = TEST_UNIT_READY; - us->srb->cmnd[1] = saved_cdb[1] & 0xE0; - - /* do command */ - US_DEBUG(usb_stor_show_command(us->srb)); - us->proto_handler(us->srb, us); - - /* restore original command */ - us->srb->cmd_len = old_cmd_len; - memcpy(us->srb->cmnd, saved_cdb, us->srb->cmd_len); - } - /* we've got a command, let's do it! */ else { US_DEBUG(usb_stor_show_command(us->srb));