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 22:52:23 -0500 |
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, | |||
221 | 221 | ||
222 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 222 | if ((ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
223 | USB_ENDPOINT_XFER_INT) { | 223 | USB_ENDPOINT_XFER_INT) { |
224 | int interval; | ||
225 | |||
226 | if (usb_dev->speed == USB_SPEED_HIGH) | ||
227 | interval = 1 << min(15, ep->desc.bInterval - 1); | ||
228 | else | ||
229 | interval = ep->desc.bInterval; | ||
224 | pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); | 230 | pipe = (pipe & ~(3 << 30)) | (PIPE_INTERRUPT << 30); |
225 | usb_fill_int_urb(urb, usb_dev, pipe, data, len, | 231 | usb_fill_int_urb(urb, usb_dev, pipe, data, len, |
226 | usb_api_blocking_completion, NULL, | 232 | usb_api_blocking_completion, NULL, interval); |
227 | ep->desc.bInterval); | ||
228 | } else | 233 | } else |
229 | usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, | 234 | usb_fill_bulk_urb(urb, usb_dev, pipe, data, len, |
230 | usb_api_blocking_completion, NULL); | 235 | usb_api_blocking_completion, NULL); |