aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2013-10-28 11:31:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-29 19:48:53 -0400
commit9d3bd7684645834ede59d285af1d70ccabee9bf3 (patch)
tree48f3d444a5ca3df91d3171209a0767a843a77d1c /drivers/usb/misc
parent488c9cd34b56a696765739c7d31dc06620305d8e (diff)
usb: usbtest: support bos descriptor test for usb 3.0
In Test 9 of usbtest module, it is used for performing chapter 9 tests N times. This patch adds to support getting bos descriptor test scenario for USB 3.0. Signed-off-by: Huang Rui <ray.huang@amd.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/usbtest.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 1fdd88f382cc..e7235d5cce85 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -689,6 +689,19 @@ static int ch9_postconfig(struct usbtest_dev *dev)
689 return (retval < 0) ? retval : -EDOM; 689 return (retval < 0) ? retval : -EDOM;
690 } 690 }
691 691
692 /*
693 * there's always [9.4.3] a bos device descriptor [9.6.2] in USB
694 * 3.0 spec
695 */
696 if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0300) {
697 retval = usb_get_descriptor(udev, USB_DT_BOS, 0, dev->buf,
698 sizeof(*udev->bos->desc));
699 if (retval != sizeof(*udev->bos->desc)) {
700 dev_err(&iface->dev, "bos descriptor --> %d\n", retval);
701 return (retval < 0) ? retval : -EDOM;
702 }
703 }
704
692 /* there's always [9.4.3] at least one config descriptor [9.6.3] */ 705 /* there's always [9.4.3] at least one config descriptor [9.6.3] */
693 for (i = 0; i < udev->descriptor.bNumConfigurations; i++) { 706 for (i = 0; i < udev->descriptor.bNumConfigurations; i++) {
694 retval = usb_get_descriptor(udev, USB_DT_CONFIG, i, 707 retval = usb_get_descriptor(udev, USB_DT_CONFIG, i,