]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB Storage: datafab fix and unusual devices
authorAndries E. Brouwer <andries.brouwer@cwi.nl>
Tue, 30 Mar 2004 06:11:00 +0000 (22:11 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 30 Mar 2004 06:11:00 +0000 (22:11 -0800)
datafab.c has an often-seen bug: the SCSI READ_CAPACITY command
does not need the number of sectors but the last sector.

I just tried the CF and SM parts of a 5-in-1 card reader.
The CF part works with US_PR_DATAFAB when the bug mentioned is fixed.
The SM part works with US_PR_SDDR55.
(Revision Number is 17.08 - that in case the 0000-ffff
should prove to be too optimistic.)

We still must discuss what setup to use for readers like this -
I have several of them - that require different drivers for
different LUNs. As it is now one has to compile usb-storage
twice, once with CONFIG_USB_STORAGE_DATAFAB defined and once
without, and remove one usb-storage.ko and insert the other
to go from CF to SM. (And that hangs with 2.6.4 so a reboot
is required..)

drivers/usb/storage/datafab.c
drivers/usb/storage/unusual_devs.h

index 2798bc4796faf03874b533b0d6ba14ec70ef8bdc..832894dea74c898d474b79cae638e7cbc03a8488 100644 (file)
@@ -539,8 +539,8 @@ int datafab_transport(Scsi_Cmnd * srb, struct us_data *us)
                          info->sectors, info->ssize);
 
                // build the reply
-               //
-               ((u32 *) ptr)[0] = cpu_to_be32(info->sectors);
+               // we need the last sector, not the number of sectors
+               ((u32 *) ptr)[0] = cpu_to_be32(info->sectors - 1);
                ((u32 *) ptr)[1] = cpu_to_be32(info->ssize);
                usb_stor_set_xfer_buf(ptr, 8, srb);
 
index 6fd124eb37f1145c51f69db617c4eafb0bb5bae4..ecb36906eb80abb651781220ee9e7f0ec63bada2 100644 (file)
@@ -720,6 +720,21 @@ UNUSUAL_DEV(  0x0bf6, 0xa001, 0x0100, 0x0110,
                0 ),
 #endif
 
+#ifdef CONFIG_USB_STORAGE_DATAFAB
+UNUSUAL_DEV( 0x0c0b, 0xa109, 0x0000, 0xffff,
+              "Acomdata",
+              "CF",
+              US_SC_SCSI, US_PR_DATAFAB, NULL,
+              US_FL_SINGLE_LUN ),
+#endif
+#ifdef CONFIG_USB_STORAGE_SDDR55
+UNUSUAL_DEV( 0x0c0b, 0xa109, 0x0000, 0xffff,
+              "Acomdata",
+              "SM",
+              US_SC_SCSI, US_PR_SDDR55, NULL,
+              US_FL_SINGLE_LUN ),
+#endif
+
 /* Submitted by Joris Struyve <joris@struyve.be> */
 UNUSUAL_DEV( 0x0d96, 0x410a, 0x0001, 0xffff,
                "Medion",