From d624f2fab436f9eb84d7e1136b5667cd703041f8 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Sat, 24 Feb 2007 19:51:17 -0800 Subject: [PATCH] [PATCH] usb 2.4: Support high-speed HID 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 --- drivers/usb/hid-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/hid-core.c b/drivers/usb/hid-core.c index 24ff1be5..5948c743 100644 --- a/drivers/usb/hid-core.c +++ b/drivers/usb/hid-core.c @@ -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; } -- 2.11.0