Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354714
b: refs/heads/master
c: d0b4652
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jan 31, 2013
1 parent 84ba52e commit eb0736c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b8bc3aad0deabf3bc50cd2fe29bce29be5681fe
refs/heads/master: d0b4652f80c3276a57ede3b6b6d8159fa26c091f
13 changes: 12 additions & 1 deletion trunk/drivers/usb/misc/usbtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
#include <linux/usb.h>


/*-------------------------------------------------------------------------*/

static int override_alt = -1;
module_param_named(alt, override_alt, int, 0644);
MODULE_PARM_DESC(alt, ">= 0 to override altsetting selection");

/*-------------------------------------------------------------------------*/

/* FIXME make these public somewhere; usbdevfs.h? */
Expand Down Expand Up @@ -103,6 +109,10 @@ get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf)
iso_in = iso_out = NULL;
alt = intf->altsetting + tmp;

if (override_alt >= 0 &&
override_alt != alt->desc.bAlternateSetting)
continue;

/* take the first altsetting with in-bulk + out-bulk;
* ignore other endpoints and altsettings.
*/
Expand Down Expand Up @@ -144,6 +154,7 @@ get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf)

found:
udev = testdev_to_usbdev(dev);
dev->info->alt = alt->desc.bAlternateSetting;
if (alt->desc.bAlternateSetting != 0) {
tmp = usb_set_interface(udev,
alt->desc.bInterfaceNumber,
Expand Down Expand Up @@ -2280,7 +2291,7 @@ usbtest_probe(struct usb_interface *intf, const struct usb_device_id *id)
wtest = " intr-out";
}
} else {
if (info->autoconf) {
if (override_alt >= 0 || info->autoconf) {
int status;

status = get_endpoints(dev, intf);
Expand Down

0 comments on commit eb0736c

Please sign in to comment.