diff options
| author | Alan Stern <stern@rowland.harvard.edu> | 2007-02-26 14:56:14 -0500 | 
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-03-09 19:52:23 -0800 | 
| commit | 97b9eb91dc131a10342da1f604e5bd8b1316abdb (patch) | |
| tree | d960cf039c29b8c6c7603801db8c6966486bcca7 /drivers/usb/core/message.c | |
| parent | 14360ab76ae81012ef09cce37a587e95ab2e1d86 (diff) | |
USB: set the correct interval for interrupt URBs
This patch (as862) fixes a couple of bugs in the way usbcore handles
intervals for interrupt URBs.  usb_interrupt_msg (and usb_bulk_msg for
backward compatibility) don't set the interval correctly for
high-speed devices.  proc_do_submiturb() doesn't set it correctly when
a bulk URB is submitted to an interrupt endpoint.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/message.c')
| -rw-r--r-- | drivers/usb/core/message.c | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 2f17468b5c1..217a3d6d0a0 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -221,10 +221,15 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,  	if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==  			USB_ENDPOINT_XFER_INT) { +		int interval; + +		if (usb_dev->speed == USB_SPEED_HIGH) +			interval = 1 << min(15, ep->desc.bInterval - 1); +		else +			interval = ep->desc.bInterval;  		pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30);  		usb_fill_int_urb(urb, usb_dev, pipe, data, len, -				usb_api_blocking_completion, NULL, -				ep->desc.bInterval); +				usb_api_blocking_completion, NULL, interval);  	} else  		usb_fill_bulk_urb(urb, usb_dev, pipe, data, len,  				usb_api_blocking_completion, NULL); | 
