From: Phil Dibowitz <[EMAIL PROTECTED]>

This patch adds a US_FL_MAX_SECTORS_64 and removes the Genesys special-cases
for this that were in scsiglue.c. It also adds the flag to other devices
reported to need it.

Signed-off-by: Phil Dibowitz <[EMAIL PROTECTED]>
Signed-off-by: Matthew Dharm <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/storage/scsiglue.c     |   12 +++++-------
 drivers/usb/storage/unusual_devs.h |   16 ++++++++++++++--
 drivers/usb/storage/usb.h          |    4 ----
 include/linux/usb_usual.h          |    2 ++
 4 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 5715291..a4b7df9 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -112,13 +112,11 @@ static int slave_configure(struct scsi_d
        if (sdev->scsi_level < SCSI_2)
                sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2;
 
-       /* According to the technical support people at Genesys Logic,
-        * devices using their chips have problems transferring more than
-        * 32 KB at a time.  In practice people have found that 64 KB
-        * works okay and that's what Windows does.  But we'll be
-        * conservative; people can always use the sysfs interface to
-        * increase max_sectors. */
-       if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == 
USB_VENDOR_ID_GENESYS &&
+       /* Many devices have trouble transfering more than 32KB at a time,
+        * while others have trouble with more than 64K. At this time we
+        * are limiting both to 32K (64 sectores).
+        */
+       if ((us->flags & US_FL_MAX_SECTORS_64) &&
                        sdev->request_queue->max_sectors > 64)
                blk_queue_max_sectors(sdev->request_queue, 64);
 
diff --git a/drivers/usb/storage/unusual_devs.h 
b/drivers/usb/storage/unusual_devs.h
index c880065..b6a0eb8 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -715,18 +715,22 @@ UNUSUAL_DEV(  0x05dc, 0xb002, 0x0000, 0x
  * They were originally reported by Alexander Oltu
  * <[EMAIL PROTECTED]> and Peter Marks <[EMAIL PROTECTED]>
  * respectively.
+ *
+ * US_FL_GO_SLOW and US_FL_MAX_SECTORS_64 added by Phil Dibowitz
+ * <[EMAIL PROTECTED]> as these flags were made and hard-coded
+ * special-cases were pulled from scsiglue.c.
  */
 UNUSUAL_DEV(  0x05e3, 0x0701, 0x0000, 0xffff,
                "Genesys Logic",
                "USB to IDE Optical",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
-               US_FL_GO_SLOW ),
+               US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
 
 UNUSUAL_DEV(  0x05e3, 0x0702, 0x0000, 0xffff,
                "Genesys Logic",
                "USB to IDE Disk",
                US_SC_DEVICE, US_PR_DEVICE, NULL,
-               US_FL_GO_SLOW ),
+               US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
 
 /* Reported by Hanno Boeck <[EMAIL PROTECTED]>
  * Taken from the Lycoris Kernel */
@@ -1203,6 +1207,14 @@ UNUSUAL_DEV(  0x0ea0, 0x6828, 0x0110, 0x
                US_SC_DEVICE, US_PR_DEVICE, NULL,
                US_FL_IGNORE_RESIDUE ),
 
+/* Reported by Benjamin Schiller <[EMAIL PROTECTED]>
+ * It is also sold by Easylite as DJ 20 */
+UNUSUAL_DEV(  0x0ed1, 0x7636, 0x0103, 0x0103,
+               "Typhoon",
+               "My DJ 1820",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_IGNORE_RESIDUE | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64),
+
 /* Reported by Michael Stattmann <[EMAIL PROTECTED]> */
 UNUSUAL_DEV(  0x0fce, 0xd008, 0x0000, 0x0000,
                "Sony Ericsson",
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 5284abe..21f3ddb 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -176,8 +176,4 @@ extern void fill_inquiry_response(struct
 #define scsi_unlock(host)      spin_unlock_irq(host->host_lock)
 #define scsi_lock(host)                spin_lock_irq(host->host_lock)
 
-
-/* Vendor ID list for devices that require special handling */
-#define USB_VENDOR_ID_GENESYS          0x05e3  /* Genesys Logic */
-
 #endif
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 608487a..f38f43f 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -43,6 +43,8 @@ #define US_DO_ALL_FLAGS                                       
        \
                /* Need delay after Command phase */            \
        US_FLAG(NO_WP_DETECT,   0x00000200)                     \
                /* Don't check for write-protect */             \
+       US_FLAG(MAX_SECTORS_64, 0x00000400)                     \
+               /* Sets max_sectors to 64    */
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };
-- 
1.4.1



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to