aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Zimmerman <Paul.Zimmerman@synopsys.com>2012-04-16 17:19:07 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-01 03:12:57 -0400
commit2960d811d562540494c83b96e4ae4b6b11196016 (patch)
tree5e658505c5b833bc976b630a9373742c10cb7add
parentd4f3ef6343463dd129f1b97d9310a9a7ab235e7b (diff)
usb: usbtest: two super speed fixes for usbtest
commit 6a23ccd216b6a8ba2c67a9f9d8969b4431ad2920 upstream. bMaxPacketSize0 field for super speed is a power of 2, not a count. The size itself is always 512. Max packet size for a super speed bulk endpoint is 1024, so allocate the urb size in halt_simple() accordingly. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/misc/usbtest.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index bb10846affc..5707f56d804 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -1023,7 +1023,10 @@ test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param *param)
1023 case 13: /* short read, resembling case 10 */ 1023 case 13: /* short read, resembling case 10 */
1024 req.wValue = cpu_to_le16((USB_DT_CONFIG << 8) | 0); 1024 req.wValue = cpu_to_le16((USB_DT_CONFIG << 8) | 0);
1025 /* last data packet "should" be DATA1, not DATA0 */ 1025 /* last data packet "should" be DATA1, not DATA0 */
1026 len = 1024 - udev->descriptor.bMaxPacketSize0; 1026 if (udev->speed == USB_SPEED_SUPER)
1027 len = 1024 - 512;
1028 else
1029 len = 1024 - udev->descriptor.bMaxPacketSize0;
1027 expected = -EREMOTEIO; 1030 expected = -EREMOTEIO;
1028 break; 1031 break;
1029 case 14: /* short read; try to fill the last packet */ 1032 case 14: /* short read; try to fill the last packet */
@@ -1382,11 +1385,15 @@ static int test_halt(struct usbtest_dev *tdev, int ep, struct urb *urb)
1382 1385
1383static int halt_simple(struct usbtest_dev *dev) 1386static int halt_simple(struct usbtest_dev *dev)
1384{ 1387{
1385 int ep; 1388 int ep;
1386 int retval = 0; 1389 int retval = 0;
1387 struct urb *urb; 1390 struct urb *urb;
1391 struct usb_device *udev = testdev_to_usbdev(dev);
1388 1392
1389 urb = simple_alloc_urb(testdev_to_usbdev(dev), 0, 512); 1393 if (udev->speed == USB_SPEED_SUPER)
1394 urb = simple_alloc_urb(udev, 0, 1024);
1395 else
1396 urb = simple_alloc_urb(udev, 0, 512);
1390 if (urb == NULL) 1397 if (urb == NULL)
1391 return -ENOMEM; 1398 return -ENOMEM;
1392 1399