]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/usb/cdc_ether.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[linux-2.6-omap-h63xx.git] / drivers / net / usb / cdc_ether.c
index a42acc3cc60983233b2a57d92512abcc9918fa60..0e061dfea78d15226e65da13e5aa1f764c09bd30 100644 (file)
@@ -31,8 +31,7 @@
 #include <linux/mii.h>
 #include <linux/usb.h>
 #include <linux/usb/cdc.h>
-
-#include "usbnet.h"
+#include <linux/usb/usbnet.h>
 
 
 #if defined(CONFIG_USB_NET_RNDIS_HOST) || defined(CONFIG_USB_NET_RNDIS_HOST_MODULE)
@@ -51,10 +50,18 @@ static int is_activesync(struct usb_interface_descriptor *desc)
                && desc->bInterfaceProtocol == 1;
 }
 
+static int is_wireless_rndis(struct usb_interface_descriptor *desc)
+{
+       return desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER
+               && desc->bInterfaceSubClass == 1
+               && desc->bInterfaceProtocol == 3;
+}
+
 #else
 
 #define is_rndis(desc)         0
 #define is_activesync(desc)    0
+#define is_wireless_rndis(desc)        0
 
 #endif
 
@@ -111,7 +118,8 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
         * of cdc-acm, it'll fail RNDIS requests cleanly.
         */
        rndis = is_rndis(&intf->cur_altsetting->desc)
-               || is_activesync(&intf->cur_altsetting->desc);
+               || is_activesync(&intf->cur_altsetting->desc)
+               || is_wireless_rndis(&intf->cur_altsetting->desc);
 
        memset(info, 0, sizeof *info);
        info->control = intf;
@@ -228,15 +236,16 @@ next_desc:
                buf += buf [0];
        }
 
-       /* Microsoft ActiveSync based RNDIS devices lack the CDC descriptors,
-        * so we'll hard-wire the interfaces and not check for descriptors.
+       /* Microsoft ActiveSync based and some regular RNDIS devices lack the
+        * CDC descriptors, so we'll hard-wire the interfaces and not check
+        * for descriptors.
         */
-       if (is_activesync(&intf->cur_altsetting->desc) && !info->u) {
+       if (rndis && !info->u) {
                info->control = usb_ifnum_to_if(dev->udev, 0);
                info->data = usb_ifnum_to_if(dev->udev, 1);
                if (!info->control || !info->data) {
                        dev_dbg(&intf->dev,
-                               "activesync: master #0/%p slave #1/%p\n",
+                               "rndis: master #0/%p slave #1/%p\n",
                                info->control,
                                info->data);
                        goto bad_desc;
@@ -316,7 +325,6 @@ void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
 }
 EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
 
-\f
 /*-------------------------------------------------------------------------
  *
  * Communications Device Class, Ethernet Control model