Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=300871cd963e24a68aaa9b762f4a10403697d9be
Commit:     300871cd963e24a68aaa9b762f4a10403697d9be
Parent:     87d093e25d73249ae92b28ae88db92eaea7df70f
Author:     Laurent Pinchart <[EMAIL PROTECTED]>
AuthorDate: Tue Jun 12 21:47:17 2007 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:37 2007 -0700

    USB: Fix up full-speed bInterval values in high-speed interrupt descriptor
    
    Many device manufacturers are using full-speed bInterval values in 
high-speed
    interrupt endpoint descriptors. If the bInterval value is greater than 16,
    assume the device uses full-speed descriptors and fix the value accordingly.
    
    Signed-off-by: Laurent Pinchart <[EMAIL PROTECTED]>
    Acked-by: Alan Stern <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/config.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 9152e12..5e113db 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -85,15 +85,21 @@ static int usb_parse_endpoint(struct device *ddev, int 
cfgno, int inum,
        memcpy(&endpoint->desc, d, n);
        INIT_LIST_HEAD(&endpoint->urb_list);
 
-       /* If the bInterval value is outside the legal range,
-        * set it to a default value: 32 ms */
+       /* Fix up bInterval values outside the legal range. Use 32 ms if no
+        * proper value can be guessed. */
        i = 0;          /* i = min, j = max, n = default */
        j = 255;
        if (usb_endpoint_xfer_int(d)) {
                i = 1;
                switch (to_usb_device(ddev)->speed) {
                case USB_SPEED_HIGH:
-                       n = 9;          /* 32 ms = 2^(9-1) uframes */
+                       /* Many device manufacturers are using full-speed
+                        * bInterval values in high-speed interrupt endpoint
+                        * descriptors. Try to fix those and fall back to a
+                        * 32 ms default value otherwise. */
+                       n = fls(d->bInterval*8);
+                       if (n == 0)
+                               n = 9;  /* 32 ms = 2^(9-1) uframes */
                        j = 16;
                        break;
                default:                /* USB_SPEED_FULL or _LOW */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to