aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 15:20:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 15:20:00 -0500
commit74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (patch)
tree1ce09f285c505a774838a95cff7327a750dc85fc /drivers/usb/misc/usbtest.c
parentb5c78e04dd061b776978dad61dd85357081147b0 (diff)
parent6166805c3de539a41cfcae39026c5bc273d7c6aa (diff)
Merge tag 'usb-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB patches from Greg Kroah-Hartman: "Here's the big USB merge for 3.9-rc1 Nothing major, lots of gadget fixes, and of course, xhci stuff. All of this has been in linux-next for a while, with the exception of the last 3 patches, which were reverts of patches in the tree that caused problems, they went in yesterday." * tag 'usb-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (190 commits) Revert "USB: EHCI: make ehci-vt8500 a separate driver" Revert "USB: EHCI: make ehci-orion a separate driver" Revert "USB: update host controller Kconfig entries" USB: update host controller Kconfig entries USB: EHCI: make ehci-orion a separate driver USB: EHCI: make ehci-vt8500 a separate driver USB: usb-storage: unusual_devs update for Super TOP SATA bridge USB: ehci-omap: Fix autoloading of module USB: ehci-omap: Don't free gpios that we didn't request USB: option: add Huawei "ACM" devices using protocol = vendor USB: serial: fix null-pointer dereferences on disconnect USB: option: add Yota / Megafon M100-1 4g modem drivers/usb: add missing GENERIC_HARDIRQS dependencies USB: storage: properly handle the endian issues of idProduct testusb: remove all mentions of 'usbfs' usb: gadget: imx_udc: make it depend on BROKEN usb: omap_control_usb: fix compile warning ARM: OMAP: USB: Add phy binding information ARM: OMAP2: MUSB: Specify omap4 has mailbox ARM: OMAP: devices: create device for usb part of control module ...
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r--drivers/usb/misc/usbtest.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 268148de9714..8b4ca1cb450a 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -13,6 +13,12 @@
13 13
14/*-------------------------------------------------------------------------*/ 14/*-------------------------------------------------------------------------*/
15 15
16static int override_alt = -1;
17module_param_named(alt, override_alt, int, 0644);
18MODULE_PARM_DESC(alt, ">= 0 to override altsetting selection");
19
20/*-------------------------------------------------------------------------*/
21
16/* FIXME make these public somewhere; usbdevfs.h? */ 22/* FIXME make these public somewhere; usbdevfs.h? */
17struct usbtest_param { 23struct usbtest_param {
18 /* inputs */ 24 /* inputs */
@@ -103,6 +109,10 @@ get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf)
103 iso_in = iso_out = NULL; 109 iso_in = iso_out = NULL;
104 alt = intf->altsetting + tmp; 110 alt = intf->altsetting + tmp;
105 111
112 if (override_alt >= 0 &&
113 override_alt != alt->desc.bAlternateSetting)
114 continue;
115
106 /* take the first altsetting with in-bulk + out-bulk; 116 /* take the first altsetting with in-bulk + out-bulk;
107 * ignore other endpoints and altsettings. 117 * ignore other endpoints and altsettings.
108 */ 118 */
@@ -144,6 +154,7 @@ try_iso:
144 154
145found: 155found:
146 udev = testdev_to_usbdev(dev); 156 udev = testdev_to_usbdev(dev);
157 dev->info->alt = alt->desc.bAlternateSetting;
147 if (alt->desc.bAlternateSetting != 0) { 158 if (alt->desc.bAlternateSetting != 0) {
148 tmp = usb_set_interface(udev, 159 tmp = usb_set_interface(udev,
149 alt->desc.bInterfaceNumber, 160 alt->desc.bInterfaceNumber,
@@ -2280,7 +2291,7 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id)
2280 wtest = " intr-out"; 2291 wtest = " intr-out";
2281 } 2292 }
2282 } else { 2293 } else {
2283 if (info->autoconf) { 2294 if (override_alt >= 0 || info->autoconf) {
2284 int status; 2295 int status;
2285 2296
2286 status = get_endpoints(dev, intf); 2297 status = get_endpoints(dev, intf);