Prashanth Acharya wrote:
OOPS!! I am working on a system that will go into mass production. So my
modem should be able to work "out of the box" with all MSFT windows,
Linux2.4, Linux 2.6 etc etc. So this solution is not quite feasible :(  . It
would be really ugly to say that this modem will work with MSFT, Linux2.4
"out of the box" and it will not do so with 2.6. and that one has to do XYZ
to get the modem to work.

Well, see if the attached patch resolves the issue for you. It just teaches the existing heuristic to avoid RNDIS too, given the choice. Does it work for you?

- Dave


Modifies "choose configuration" heuristic to recognize the other case
that 2.4 handled:  RNDIS, a MSFT protocol sometimes used as the first
configuration on cable modems.  CDC Ethernet is open, and preferred.

--- 1.156/drivers/usb/core/usb.c        Mon Feb  9 19:55:34 2004
+++ edited/drivers/usb/core/usb.c       Sun Feb 15 10:08:29 2004
@@ -1061,12 +1061,19 @@
        config = dev->config[0].desc.bConfigurationValue;
        if (dev->descriptor.bNumConfigurations != 1) {
                for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
+                       struct usb_interface_descriptor *desc;
+
                        /* heuristic:  Linux is more likely to have class
                         * drivers, so avoid vendor-specific interfaces.
                         */
-                       if (dev->config[i].interface[0]->altsetting
-                                               ->desc.bInterfaceClass
-                                       == USB_CLASS_VENDOR_SPEC)
+                       desc = &dev->config[i].interface[0]
+                                       ->altsetting->desc;
+                       if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
+                               continue;
+                       /* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */
+                       if (desc->bInterfaceClass == USB_CLASS_COMM
+                                       && desc->bInterfaceSubClass == 2
+                                       && desc->bInterfaceProtocol == 0xff)
                                continue;
                        config = dev->config[i].desc.bConfigurationValue;
                        break;

Reply via email to