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.

Greg, please apply.

Matt

# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.649   -> 1.650  
#       drivers/usb/storage/usb.c       1.55    -> 1.56   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/11/10      [EMAIL PROTECTED]       1.650
# Remove all special-case handling of the START_STOP command.  We can do
# this now because sd.c has been modified (by me) to not issue START_STOP
# unless the device indicates that it needs an initializing command.
# 
# START_STOP was, formerly, used to test for media change.  TEST_UNIT_READY
# is now used for that purpose.
# --------------------------------------------
#
diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Sun Nov 10 18:02:19 2002
+++ b/drivers/usb/storage/usb.c Sun Nov 10 18:02:19 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));
-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

A:  The most ironic oxymoron wins ...
DP: "Microsoft Works"
A:  Uh, okay, you win.
                                        -- A.J. & Dust Puppy
User Friendly, 1/18/1998

Attachment: msg09331/pgp00000.pgp
Description: PGP signature

Reply via email to