diff options
author | Thomas Pugliese <thomas.pugliese@gmail.com> | 2013-10-23 15:44:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-29 19:44:49 -0400 |
commit | 7b6bc07ab554e929c85d51b3d5b26cf7f12c6a3b (patch) | |
tree | b1d2d392b74d9d0c663ee005b44cc405ffea567f /drivers/usb/wusbcore | |
parent | df101c531eb737915349a1c4b677da7db55eaf69 (diff) |
usb: wusbcore: set the RPIPE wMaxPacketSize value correctly
For isochronous endpoints, set the RPIPE wMaxPacketSize value using
wOverTheAirPacketSize from the endpoint companion descriptor instead of
wMaxPacketSize from the normal endpoint descriptor.
Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/wusbcore')
-rw-r--r-- | drivers/usb/wusbcore/wa-rpipe.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/wusbcore/wa-rpipe.c b/drivers/usb/wusbcore/wa-rpipe.c index 1ed068accb76..b48e74cc54d7 100644 --- a/drivers/usb/wusbcore/wa-rpipe.c +++ b/drivers/usb/wusbcore/wa-rpipe.c | |||
@@ -334,7 +334,10 @@ static int rpipe_aim(struct wa_rpipe *rpipe, struct wahc *wa, | |||
334 | /* FIXME: compute so seg_size > ep->maxpktsize */ | 334 | /* FIXME: compute so seg_size > ep->maxpktsize */ |
335 | rpipe->descr.wBlocks = cpu_to_le16(16); /* given */ | 335 | rpipe->descr.wBlocks = cpu_to_le16(16); /* given */ |
336 | /* ep0 maxpktsize is 0x200 (WUSB1.0[4.8.1]) */ | 336 | /* ep0 maxpktsize is 0x200 (WUSB1.0[4.8.1]) */ |
337 | rpipe->descr.wMaxPacketSize = cpu_to_le16(ep->desc.wMaxPacketSize); | 337 | if (usb_endpoint_xfer_isoc(&ep->desc)) |
338 | rpipe->descr.wMaxPacketSize = epcd->wOverTheAirPacketSize; | ||
339 | else | ||
340 | rpipe->descr.wMaxPacketSize = ep->desc.wMaxPacketSize; | ||
338 | 341 | ||
339 | rpipe->descr.hwa_bMaxBurst = max(min_t(unsigned int, | 342 | rpipe->descr.hwa_bMaxBurst = max(min_t(unsigned int, |
340 | epcd->bMaxBurst, 16U), 1U); | 343 | epcd->bMaxBurst, 16U), 1U); |