This patch changes some error checking so that some bogus devices (like the
Fuji Finepix 1400) will work.

This is basically relaxing a test on a field that the spec says "should
always be zero" 

Greg, please apply.

Matt

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/02/21 23:50:19-08:00 [EMAIL PROTECTED] 
#   Fix for bogus devices like the Fuji Finepix1400
# 
# drivers/usb/storage/transport.c
#   2004/02/21 23:50:03-08:00 [EMAIL PROTECTED] +8 -4
#   Fix for bogus devices like the Fuji Finepix1400
# 
diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c   Sun Feb 22 00:21:51 2004
+++ b/drivers/usb/storage/transport.c   Sun Feb 22 00:21:51 2004
@@ -809,15 +809,19 @@
        }
 
        /* If not UFI, we interpret the data as a result code 
-        * The first byte should always be a 0x0
-        * The second byte & 0x0F should be 0x0 for good, otherwise error 
+        * The first byte should always be a 0x0.
+        *
+        * Some bogus devices don't follow that rule.  They stuff the ASC
+        * into the first byte -- so if it's non-zero, call it a failure.
         */
        if (us->iobuf[0]) {
-               US_DEBUGP("CBI IRQ data showed reserved bType %d\n",
+               US_DEBUGP("CBI IRQ data showed reserved bType 0x%x\n",
                                us->iobuf[0]);
-               return USB_STOR_TRANSPORT_ERROR;
+               goto Failed;
+
        }
 
+       /* The second byte & 0x0F should be 0x0 for good, otherwise error */
        switch (us->iobuf[1] & 0x0F) {
                case 0x00: 
                        return USB_STOR_TRANSPORT_GOOD;

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

It's not that hard.  No matter what the problem is, tell the customer 
to reinstall Windows.
                                        -- Nurse
User Friendly, 3/22/1998

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to