OSDN Git Service

[PATCH] usb 2.4: Support high-speed HID
authorPete Zaitcev <zaitcev@redhat.com>
Sun, 25 Feb 2007 03:51:17 +0000 (19:51 -0800)
committerWilly Tarreau <w@1wt.eu>
Sun, 25 Feb 2007 06:16:42 +0000 (07:16 +0100)
Fix high-speed HID. According to Stuart:

 The problem is that the usbhid driver (in hid-core.c) is _not_ modifying
 the  interrupt URB interval for high speed devices before calling
 FILL_INT_URB, which causes the interval to be too low, and the ehci
 driver won't schedule the URB.

 Specifically this was seen with a new USB 2.0 Avocent KVM dongle.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
drivers/usb/hid-core.c

index 24ff1be..5948c74 100644 (file)
@@ -1329,7 +1329,7 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
        for (n = 0; n < interface->bNumEndpoints; n++) {
 
                struct usb_endpoint_descriptor *endpoint = &interface->endpoint[n];
-               int pipe, maxp;
+               int pipe, maxp, interval;
 
                if ((endpoint->bmAttributes & 3) != 3)          /* Not an interrupt endpoint */
                        continue;
@@ -1339,8 +1339,11 @@ static struct hid_device *usb_hid_configure(struct usb_device *dev, int ifnum)
 
                pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
                maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+               interval = endpoint->bInterval;
+               if (dev->speed == USB_SPEED_HIGH)
+                       interval = 1 << (interval - 1);
 
-               FILL_INT_URB(&hid->urb, dev, pipe, hid->buffer, maxp > 32 ? 32 : maxp, hid_irq, hid, endpoint->bInterval);
+               FILL_INT_URB(&hid->urb, dev, pipe, hid->buffer, maxp > 32 ? 32 : maxp, hid_irq, hid, interval);
 
                break;
        }