1 From d83ceadbcef3426b566bdd6dea16043bfaa12a75 Mon Sep 17 00:00:00 2001
2 From: Thomas Pugliese <thomas.pugliese@gmail.com>
3 Date: Wed, 23 Oct 2013 14:44:26 -0500
4 Subject: usb: wusbcore: set the RPIPE wMaxPacketSize value correctly
6 From: Thomas Pugliese <thomas.pugliese@gmail.com>
8 commit 7b6bc07ab554e929c85d51b3d5b26cf7f12c6a3b upstream.
10 For isochronous endpoints, set the RPIPE wMaxPacketSize value using
11 wOverTheAirPacketSize from the endpoint companion descriptor instead of
12 wMaxPacketSize from the normal endpoint descriptor.
14 Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
15 [bwh: Backported to 3.2: adjust context]
16 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17 Cc: Yang Yingliang <yangyingliang@huawei.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 drivers/usb/wusbcore/wa-rpipe.c | 5 ++++-
22 1 file changed, 4 insertions(+), 1 deletion(-)
24 --- a/drivers/usb/wusbcore/wa-rpipe.c
25 +++ b/drivers/usb/wusbcore/wa-rpipe.c
26 @@ -332,7 +332,10 @@ static int rpipe_aim(struct wa_rpipe *rp
27 /* FIXME: compute so seg_size > ep->maxpktsize */
28 rpipe->descr.wBlocks = cpu_to_le16(16); /* given */
29 /* ep0 maxpktsize is 0x200 (WUSB1.0[4.8.1]) */
30 - rpipe->descr.wMaxPacketSize = cpu_to_le16(ep->desc.wMaxPacketSize);
31 + if (usb_endpoint_xfer_isoc(&ep->desc))
32 + rpipe->descr.wMaxPacketSize = epcd->wOverTheAirPacketSize;
34 + rpipe->descr.wMaxPacketSize = ep->desc.wMaxPacketSize;
35 rpipe->descr.bHSHubAddress = 0; /* reserved: zero */
36 rpipe->descr.bHSHubPort = wusb_port_no_to_idx(urb->dev->portnum);
37 /* FIXME: use maximum speed as supported or recommended by device */