]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
USB: hub.c: Add initial_descriptor_timeout module parameter for usbcore
authorJaroslav Kysela <perex@perex.cz>
Fri, 10 Oct 2008 14:24:45 +0000 (16:24 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Oct 2008 21:41:04 +0000 (14:41 -0700)
This patch adds initial_descriptor_timeout module parameter for usbcore.ko
to allow modify initial 64-byte USB_REQ_GET_DESCRIPTOR timeout for
non-standard devices.

For example, the SATA8000 device from DATAST0R Technology Corp
requires about 10 seconds to send reply (probably it waits until
inserted disk is ready for operation).

Also, this patch adds missing usbcore parameters to
Documentation/kernel-parameters.txt.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/kernel-parameters.txt
drivers/usb/core/hub.c

index dd28a0d56981e4e0376fb5010086c817633a6a3b..d4f4875fc7c6d2e463e9c2b6e26d2d278cf1399c 100644 (file)
@@ -2253,6 +2253,25 @@ and is between 256 and 4096 characters. It is defined in the file
                        autosuspended.  Devices for which the delay is set
                        to a negative value won't be autosuspended at all.
 
+       usbcore.usbfs_snoop=
+                       [USB] Set to log all usbfs traffic (default 0 = off).
+
+       usbcore.blinkenlights=
+                       [USB] Set to cycle leds on hubs (default 0 = off).
+
+       usbcore.old_scheme_first=
+                       [USB] Start with the old device initialization
+                       scheme (default 0 = off).
+
+       usbcore.use_both_schemes=
+                       [USB] Try the other device initialization scheme
+                       if the first one fails (default 1 = enabled).
+
+       usbcore.initial_descriptor_timeout=
+                       [USB] Specifies timeout for the initial 64-byte
+                        USB_REQ_GET_DESCRIPTOR request in milliseconds
+                       (default 5000 = 5.0 seconds).
+
        usbhid.mousepoll=
                        [USBHID] The interval which mice are to be polled at.
 
index b97110ca352d32297a6e990aae09157256571862..d73ce262c3651446582b251c887b5f9af787f7ce 100644 (file)
@@ -100,6 +100,15 @@ static int blinkenlights = 0;
 module_param (blinkenlights, bool, S_IRUGO);
 MODULE_PARM_DESC (blinkenlights, "true to cycle leds on hubs");
 
+/*
+ * Device SATA8000 FW1.0 from DATAST0R Technology Corp requires about
+ * 10 seconds to send reply for the initial 64-byte descriptor request.
+ */
+/* define initial 64-byte descriptor request timeout in milliseconds */
+static int initial_descriptor_timeout = USB_CTRL_GET_TIMEOUT;
+module_param(initial_descriptor_timeout, int, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(initial_descriptor_timeout, "initial 64-byte descriptor request timeout in milliseconds (default 5000 - 5.0 seconds)");
+
 /*
  * As of 2.6.10 we introduce a new USB device initialization scheme which
  * closely resembles the way Windows works.  Hopefully it will be compatible
@@ -2538,7 +2547,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
                                        USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
                                        USB_DT_DEVICE << 8, 0,
                                        buf, GET_DESCRIPTOR_BUFSIZE,
-                                       USB_CTRL_GET_TIMEOUT);
+                                       initial_descriptor_timeout);
                                switch (buf->bMaxPacketSize0) {
                                case 8: case 16: case 32: case 64: case 255:
                                        if (buf->bDescriptorType ==