diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:23:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:23:21 -0500 |
commit | c96e2c92072d3e78954c961f53d8c7352f7abbd7 (patch) | |
tree | d844f26f926ff40e98e9eae0e11fd71acad81df4 /drivers/usb/core/generic.c | |
parent | f2aca47dc3c2d0c2d5dbd972558557e74232bbce (diff) | |
parent | 64358164f5bfe5e11d4040c1eb674c29e1436ce5 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (70 commits)
USB: remove duplicate device id from zc0301
USB: remove duplicate device id from usb_storage
USB: remove duplicate device id from keyspan
USB: remove duplicate device id from ftdi_sio
USB: remove duplicate device id from visor
USB: a bit more coding style cleanup
usbcore: trivial whitespace fixes
usb-storage: use first bulk endpoints, not last
EHCI: fix interrupt-driven remote wakeup
USB: switch ehci-hcd to new polling scheme
USB: autosuspend for usb printer driver
USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products
USB: Sierra Wireless auto set D0
USB: usb ethernet gadget recognizes HUSB2DEV
USB: list atmel husb2_udc gadget controller
USB: gadgetfs AIO tweaks
USB: gadgetfs behaves better on userspace init bug
USB: gadgetfs race fix
USB: gadgetfs simplifications
USB: gadgetfs cleanups
...
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; |