Commit 0405e99d authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: usbcore, avoid RNDIS configs

[USB] usbcore avoids RNDIS configuration.

Modifies the "choose a configuration" heuristic to recognize the other
case that 2.4 handled:  RNDIS, a MSFT protocol that's sometimes used as
the first/default configuration (as specified by MSFT) on cable modems.
CDC Ethernet is vendor-neutral, and preferred (except by MSFT).

The initial version didn't catch RNDIS because it cloaks its ethernet
links as a kind of CDC ACM (modem) device.
parent e863e027
......@@ -1152,12 +1152,19 @@ int usb_new_device(struct usb_device *dev)
config = dev->config[0].desc.bConfigurationValue;
if (dev->descriptor.bNumConfigurations != 1) {
for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
struct usb_interface_descriptor *desc;
/* heuristic: Linux is more likely to have class
* drivers, so avoid vendor-specific interfaces.
*/
if (dev->config[i].interface[0]->altsetting
->desc.bInterfaceClass
== USB_CLASS_VENDOR_SPEC)
desc = &dev->config[i].interface[0]
->altsetting->desc;
if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
continue;
/* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */
if (desc->bInterfaceClass == USB_CLASS_COMM
&& desc->bInterfaceSubClass == 2
&& desc->bInterfaceProtocol == 0xff)
continue;
config = dev->config[i].desc.bConfigurationValue;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment