USB: altsetting overrides for usbtest
USB: altsetting overrides for usbtest

The usbtest driver includes some rather simple-minded logic for
selecting an altsetting to test.  It doesn't work well for the g_zero
gadget, because it selects altsetting 0 (which doesn't have
isochronous endpoints) rather than altsetting 1 (which does have them,
if the gadget's hardware supports them).  This prevents usbtest's
isochronous tests (15, 16, 22, and 23) from working with g_zero.

Since g_zero is one of the most common gadget drivers used for USB
testing, usbtest should do a better job of supporting it.  But since
some programs may rely on the current scheme for selecting
altsettings, I didn't want to change it.

Instead, this patch (as1655) adds a module parameter to usbtest, which
can be used to override the default altsetting.  Since usbtest is
never used by normal users (most distributions probably don't even
build it), the new module parameter won't inconvenience anybody.  In
any case, it is entirely optional -- leaving it unset preserves the
existing behavior.

The patch also fixes a related bug in usbtest: After selecting an
altsetting, the driver neglects to store its selection.

Signed-off-by: Alan Stern <75ea6bb7bfc1186f92d26164de5f9268c9a45b59@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs