]> 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/shaggy...
[linux-2.6-omap-h63xx.git] / drivers / net / usb / cdc_ether.c
index 5a21f06bf8a54fab20e2bb70dd0f599b4be910c2..a42acc3cc60983233b2a57d92512abcc9918fa60 100644 (file)
@@ -91,6 +91,22 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
                                "CDC descriptors on config\n");
        }
 
+       /* Maybe CDC descriptors are after the endpoint?  This bug has
+        * been seen on some 2Wire Inc RNDIS-ish products.
+        */
+       if (len == 0) {
+               struct usb_host_endpoint        *hep;
+
+               hep = intf->cur_altsetting->endpoint;
+               if (hep) {
+                       buf = hep->extra;
+                       len = hep->extralen;
+               }
+               if (len)
+                       dev_dbg(&intf->dev,
+                               "CDC descriptors on endpoint\n");
+       }
+
        /* this assumes that if there's a non-RNDIS vendor variant
         * of cdc-acm, it'll fail RNDIS requests cleanly.
         */
@@ -128,14 +144,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;
                                }
                        }