Re: usb 2.4: Support high-speed HID

Willy Tarreau <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Sat, Feb 24, 2007 at 07:51:17PM -0800, Pete Zaitcev wrote:
> 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 <[email protected]>
> 
> --- linux-2.4.33/drivers/usb/hid-core.c	2005-04-03 18:42:19.000000000 -0700
> +++ linux-2.4.33-highhid/drivers/usb/hid-core.c	2007-02-22 11:19:05.000000000 -0800
> @@ -1329,7 +1329,7 @@ static struct hid_device *usb_hid_config
>  	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_config
>  
>  		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;
>  	}

Applied to both 2.4.35-pre and 2.4.34-stable.
Thanks Pete !

Willy


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.