usb: wusbcore: set the RPIPE wMaxPacketSize value correctly
authorThomas Pugliese <thomas.pugliese@gmail.com>
Wed, 23 Oct 2013 19:44:26 +0000 (14:44 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Oct 2013 23:44:49 +0000 (16:44 -0700)
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>
drivers/usb/wusbcore/wa-rpipe.c

index 1ed068accb76d41d8b06fe95d9d9fa55d1fe5b19..b48e74cc54d71b92e1ef9c0b918ea5cd9404c1e9 100644 (file)
@@ -334,7 +334,10 @@ static int rpipe_aim(struct wa_rpipe *rpipe, struct wahc *wa,
        /* FIXME: compute so seg_size > ep->maxpktsize */
        rpipe->descr.wBlocks = cpu_to_le16(16);         /* given */
        /* ep0 maxpktsize is 0x200 (WUSB1.0[4.8.1]) */
-       rpipe->descr.wMaxPacketSize = cpu_to_le16(ep->desc.wMaxPacketSize);
+       if (usb_endpoint_xfer_isoc(&ep->desc))
+               rpipe->descr.wMaxPacketSize = epcd->wOverTheAirPacketSize;
+       else
+               rpipe->descr.wMaxPacketSize = ep->desc.wMaxPacketSize;
 
        rpipe->descr.hwa_bMaxBurst = max(min_t(unsigned int,
                                epcd->bMaxBurst, 16U), 1U);