This adds the US_FL_GO_SLOW flag. This flag is for devices that need a 110 usec delay during high-speed transfers. This seems to be limited to USB-to-IDE chips. Unusual_dev entries for affected devices are included.
This has been thrown around in the usb-storage list for a while now, and I believe everyone is happy with it.
Greg, please apply.
Signed-off-by: Phil Dibowitz <[EMAIL PROTECTED]>
-- Phil Dibowitz [EMAIL PROTECTED] Freeware and Technical Pages Insanity Palace of Metallica http://www.phildev.net/ http://www.ipom.com/
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759
[DESC] Added US_FL_GO_SLOW flag [EDESC]
This adds the US_FL_GO_SLOW flag. This flag is for devices that need a 100 usec delay during high-speed transfers. This seems to be limited to USB-to-IDE chips. Unusual_dev entries for affected devices are included. Greg, please apply. Signed-off-by: Phil Dibowitz <[EMAIL PROTECTED]> --- diff -puN drivers/usb/storage/transport.c~add_slow_flag drivers/usb/storage/transport.c --- linux-2.6.11-rc4/drivers/usb/storage/transport.c~add_slow_flag 2005-02-13 16:57:48.000000000 -0800 +++ linux-2.6.11-rc4-phil/drivers/usb/storage/transport.c 2005-02-17 11:36:34.000000000 -0800 @@ -991,10 +991,10 @@ int usb_stor_Bulk_transport(struct scsi_ /* DATA STAGE */ /* send/receive data payload, if there is any */ - /* Genesys Logic interface chips need a 100us delay between the + /* Some USB-IDE converter chips need a 100us delay between the * command phase and the data phase. Some devices need a little * more than that, probably because of clock rate inaccuracies. */ - if (le16_to_cpu(us->pusb_dev->descriptor.idVendor) == USB_VENDOR_ID_GENESYS) + if (unlikely(us->flags & US_FL_GO_SLOW)) udelay(110); if (transfer_length) { diff -puN drivers/usb/storage/usb.h~add_slow_flag drivers/usb/storage/usb.h --- linux-2.6.11-rc4/drivers/usb/storage/usb.h~add_slow_flag 2005-02-13 16:57:48.000000000 -0800 +++ linux-2.6.11-rc4-phil/drivers/usb/storage/usb.h 2005-02-13 17:00:06.000000000 -0800 @@ -75,6 +75,7 @@ struct us_unusual_dev { #define US_FL_FIX_CAPACITY 0x00000080 /* READ CAPACITY response too big */ #define US_FL_IGNORE_RESIDUE 0x00000100 /* reported residue is wrong */ #define US_FL_BULK32 0x00000200 /* Uses 32-byte CBW length */ +#define US_FL_GO_SLOW 0x00000400 /* Can't really handle high speed */ /* Dynamic flag definitions: used in set_bit() etc. */ #define US_FLIDX_URB_ACTIVE 18 /* 0x00040000 current_urb is in use */ diff -puN drivers/usb/storage/unusual_devs.h~add_slow_flag drivers/usb/storage/unusual_devs.h --- linux-2.6.11-rc4/drivers/usb/storage/unusual_devs.h~add_slow_flag 2005-02-13 16:57:48.000000000 -0800 +++ linux-2.6.11-rc4-phil/drivers/usb/storage/unusual_devs.h 2005-02-16 09:41:11.000000000 -0800 @@ -512,6 +512,25 @@ UNUSUAL_DEV( 0x05dc, 0xb002, 0x0000, 0x US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY ), +/* The following two entries are for a Genesys USB to IDE + * converter chip, but it changes its ProductId depending + * on whether or not a disk or an optical device is enclosed + * They were originally reported by Alexander Oltu + * <[EMAIL PROTECTED]> and Peter Marks <[EMAIL PROTECTED]> + * respectively. + */ +UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff, + "Genesys Logic", + "USB to IDE Optical", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_GO_SLOW ), + +UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff, + "Genesys Logic", + "USB to IDE Disk", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_GO_SLOW ), + /* Reported by Hanno Boeck <[EMAIL PROTECTED]> * Taken from the Lycoris Kernel */ UNUSUAL_DEV( 0x0636, 0x0003, 0x0000, 0x9999, @@ -540,19 +559,19 @@ UNUSUAL_DEV( 0x066f, 0x8000, 0x0001, 0x0 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY ), -/* Reported by Alex Butcher <[EMAIL PROTECTED]> */ -UNUSUAL_DEV( 0x067b, 0x3507, 0x0001, 0x0001, +/* Reported by Richard -=[]=- <[EMAIL PROTECTED]> */ +UNUSUAL_DEV( 0x067b, 0x2507, 0x0100, 0x0100, "Prolific Technology Inc.", - "ATAPI-6 Bridge Controller", + "Mass Storage Device", US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_FIX_CAPACITY ), + US_FL_FIX_CAPACITY | US_FL_GO_SLOW ), /* Reported by Alex Butcher <[EMAIL PROTECTED]> */ UNUSUAL_DEV( 0x067b, 0x3507, 0x0001, 0x0001, "Prolific Technology Inc.", "ATAPI-6 Bridge Controller", US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_FIX_CAPACITY ), + US_FL_FIX_CAPACITY | US_FL_GO_SLOW ), /* Submitted by Benny Sjostrand <[EMAIL PROTECTED]> */ UNUSUAL_DEV( 0x0686, 0x4011, 0x0001, 0x0001, @@ -917,6 +936,13 @@ UNUSUAL_DEV( 0x1370, 0x6828, 0x0110, 0x US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_IGNORE_RESIDUE ), +/* Reported by Radovan Garabik <[EMAIL PROTECTED]> */ +UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, + "MPIO", + "HS200", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_GO_SLOW ), + #ifdef CONFIG_USB_STORAGE_SDDR55 UNUSUAL_DEV( 0x55aa, 0xa103, 0x0000, 0x9999, "Sandisk", diff -puN drivers/usb/storage/usb.c~add_slow_flag drivers/usb/storage/usb.c --- linux-2.6.11-rc4/drivers/usb/storage/usb.c~add_slow_flag 2005-02-16 23:17:55.000000000 -0800 +++ linux-2.6.11-rc4-phil/drivers/usb/storage/usb.c 2005-02-17 11:36:48.000000000 -0800 @@ -483,6 +483,13 @@ static void get_device_info(struct us_da unusual_dev->useTransport; us->flags = unusual_dev->flags; + /* + * This flag is only needed when we're in high-speed, so let's + * disable it if we're in full-speed + */ + if (dev->speed != USB_SPEED_HIGH) + us->flags &= ~US_FL_GO_SLOW; + /* Log a message if a non-generic unusual_dev entry contains an * unnecessary subclass or protocol override. This may stimulate * reports from users that will help us remove unneeded entries _
signature.asc
Description: OpenPGP digital signature