X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fnet%2Fusb%2Fcdc_ether.c;h=0e061dfea78d15226e65da13e5aa1f764c09bd30;hb=2b12a4c524812fb3f6ee590a02e65b95c8c32229;hp=675ac99a79c6174bfd3f87f8b2b27f23e29417bf;hpb=55663219378eecd6fccb319be27ce6737a535e4c;p=linux-2.6 diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 675ac99a79..0e061dfea7 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c @@ -31,8 +31,7 @@ #include #include #include - -#include "usbnet.h" +#include #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; @@ -144,14 +152,14 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) * modem interface from an RNDIS non-modem. */ if (rndis) { - struct usb_cdc_acm_descriptor *d; + struct usb_cdc_acm_descriptor *acm; - d = (void *) buf; - if (d->bmCapabilities) { + acm = (void *) buf; + if (acm->bmCapabilities) { dev_dbg(&intf->dev, "ACM capabilities %02x, " "not really RNDIS?\n", - d->bmCapabilities); + acm->bmCapabilities); goto bad_desc; } } @@ -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); - /*------------------------------------------------------------------------- * * Communications Device Class, Ethernet Control model