diff options
Diffstat (limited to 'drivers/usb/core/generic.c')
-rw-r--r-- | drivers/usb/core/generic.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c index ebb20ff7ac58..b531a4fd30c2 100644 --- a/drivers/usb/core/generic.c +++ b/drivers/usb/core/generic.c | |||
@@ -25,6 +25,20 @@ static inline const char *plural(int n) | |||
25 | return (n == 1 ? "" : "s"); | 25 | return (n == 1 ? "" : "s"); |
26 | } | 26 | } |
27 | 27 | ||
28 | static int is_rndis(struct usb_interface_descriptor *desc) | ||
29 | { | ||
30 | return desc->bInterfaceClass == USB_CLASS_COMM | ||
31 | && desc->bInterfaceSubClass == 2 | ||
32 | && desc->bInterfaceProtocol == 0xff; | ||
33 | } | ||
34 | |||
35 | static int is_activesync(struct usb_interface_descriptor *desc) | ||
36 | { | ||
37 | return desc->bInterfaceClass == USB_CLASS_MISC | ||
38 | && desc->bInterfaceSubClass == 1 | ||
39 | && desc->bInterfaceProtocol == 1; | ||
40 | } | ||
41 | |||
28 | static int choose_configuration(struct usb_device *udev) | 42 | static int choose_configuration(struct usb_device *udev) |
29 | { | 43 | { |
30 | int i; | 44 | int i; |
@@ -87,14 +101,12 @@ static int choose_configuration(struct usb_device *udev) | |||
87 | continue; | 101 | continue; |
88 | } | 102 | } |
89 | 103 | ||
90 | /* If the first config's first interface is COMM/2/0xff | 104 | /* When the first config's first interface is one of Microsoft's |
91 | * (MSFT RNDIS), rule it out unless Linux has host-side | 105 | * pet nonstandard Ethernet-over-USB protocols, ignore it unless |
92 | * RNDIS support. */ | 106 | * this kernel has enabled the necessary host side driver. |
93 | if (i == 0 && desc | 107 | */ |
94 | && desc->bInterfaceClass == USB_CLASS_COMM | 108 | if (i == 0 && desc && (is_rndis(desc) || is_activesync(desc))) { |
95 | && desc->bInterfaceSubClass == 2 | 109 | #if !defined(CONFIG_USB_NET_RNDIS_HOST) && !defined(CONFIG_USB_NET_RNDIS_HOST_MODULE) |
96 | && desc->bInterfaceProtocol == 0xff) { | ||
97 | #ifndef CONFIG_USB_NET_RNDIS_HOST | ||
98 | continue; | 110 | continue; |
99 | #else | 111 | #else |
100 | best = c; | 112 | best = c; |