Greg, this is a patch for 2.5/6 -- please apply.  The description follows
in the forwarded message.

Matt

----- Forwarded message from Alan Stern <[EMAIL PROTECTED]> -----

Date: Fri, 24 Oct 2003 15:14:21 -0400 (EDT)
From: Alan Stern <[EMAIL PROTECTED]>
Subject: PATCH: (as118) Command failure codes for sddr09 driver
To: Matthew Dharm <[EMAIL PROTECTED]>
cc: USB Storage List <[EMAIL PROTECTED]>
X-Spam-Status: No, hits=-5.0 required=5.0 tests=UNIFIED_PATCH version=2.11

Matt:

This patch updates the sdd09 subdriver to make it return Command Failure 
with appropriate sense data (rather than Tranport Error) when:

        a MODE-SENSE command requests an unsupported page;

        a CDB includes an unrecognized command code.

This should help prevent confusion and excessive retrying by the SCSI 
drivers.

Alan Stern


===== sddr09.c 1.30 vs edited =====
--- 1.30/drivers/usb/storage/sddr09.c   Wed Sep  3 11:47:23 2003
+++ edited/drivers/usb/storage/sddr09.c Fri Oct 24 14:49:23 2003
@@ -1496,7 +1496,9 @@
                        return USB_STOR_TRANSPORT_GOOD;
                }
 
-               return USB_STOR_TRANSPORT_ERROR;
+               sensekey = 0x05;        /* illegal request */
+               sensecode = 0x24;       /* invalid field in CDB */
+               return USB_STOR_TRANSPORT_FAILED;
        }
 
        if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) {
@@ -1542,8 +1544,10 @@
 
        if (srb->cmnd[0] != TEST_UNIT_READY &&
            srb->cmnd[0] != REQUEST_SENSE) {
+               sensekey = 0x05;        /* illegal request */
+               sensecode = 0x20;       /* invalid command */
                havefakesense = 1;
-               return USB_STOR_TRANSPORT_ERROR;
+               return USB_STOR_TRANSPORT_FAILED;
        }
 
        for (; srb->cmd_len<12; srb->cmd_len++)

----- End forwarded message -----

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

You were using cheat codes too.  You guys suck.
                                        -- Greg to General Studebaker
User Friendly, 12/16/1997

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to