ChangeSet 1.1867.3.50, 2004/09/21 15:57:33-07:00, [EMAIL PROTECTED]

[PATCH] USB: host side fixes for pxa2xx/ethernet/rndis gadgets, like gumstix

This fixes an interop glitch with PXA gadgets; please merge.


This resolves an issue that's more or less specific to hosts trying to
talk pxa255 based Linux devices using the Ethernet/RNDIS gadget driver.

  - Teaches "usbnet" about the product ID used by pxa255 based devices
    when they enable RNDIS, since it won't be using CDC Ethernet.

  - Forces usbcore config selection code to use non-RNDIS configurations,
    even when their class is vendor-specific (as in the pxa255 case).

This makes gumstix devices, for example, talk with Linux 2.6.9 hosts
AND with Windows ... previously only one would work.

From: Craig Hughes <[EMAIL PROTECTED]>
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/core/hub.c   |   12 ++++++++++--
 drivers/usb/net/usbnet.c |   13 ++++++++++++-
 2 files changed, 22 insertions(+), 3 deletions(-)


diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c    2004-10-19 08:10:13 -07:00
+++ b/drivers/usb/core/hub.c    2004-10-19 08:10:13 -07:00
@@ -1045,11 +1045,19 @@
                                        ->altsetting->desc;
                        if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
                                continue;
-                       /* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */
+                       /* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS.
+                        * MSFT needs this to be the first config; never use
+                        * it as the default unless Linux has host-side RNDIS.
+                        * A second config would ideally be CDC-Ethernet, but
+                        * may instead be the "vendor specific" CDC subset
+                        * long used by ARM Linux for sa1100 or pxa255.
+                        */
                        if (desc->bInterfaceClass == USB_CLASS_COMM
                                        && desc->bInterfaceSubClass == 2
-                                       && desc->bInterfaceProtocol == 0xff)
+                                       && desc->bInterfaceProtocol == 0xff) {
+                               c = udev->config[1].desc.bConfigurationValue;
                                continue;
+                       }
                        c = udev->config[i].desc.bConfigurationValue;
                        break;
                }
diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
--- a/drivers/usb/net/usbnet.c  2004-10-19 08:10:13 -07:00
+++ b/drivers/usb/net/usbnet.c  2004-10-19 08:10:13 -07:00
@@ -3308,11 +3308,18 @@
  *
  * PXA25x or PXA210 ...  these use a "usb-eth" driver much like
  * the sa1100 one, but hardware uses different endpoint numbers.
+ *
+ * Or the Linux "Ethernet" gadget on hardware that can't talk
+ * CDC Ethernet (e.g., no altsettings), in either of two modes:
+ *  - acting just like the old "usb-eth" firmware, though
+ *    the implementation is different 
+ *  - supporting RNDIS as the first/default configuration for
+ *    MS-Windows interop; Linux needs to use the other config
  */
 {
        // 1183 = 0x049F, both used as hex values?
        // Compaq "Itsy" vendor/product id
-       USB_DEVICE (0x049F, 0x505A),
+       USB_DEVICE (0x049F, 0x505A),    // usb-eth, or compatible
        .driver_info =  (unsigned long) &linuxdev_info,
 }, {
        USB_DEVICE (0x0E7E, 0x1001),    // G.Mate "Yopy"
@@ -3320,6 +3327,10 @@
 }, {
        USB_DEVICE (0x8086, 0x07d3),    // "blob" bootloader
        .driver_info =  (unsigned long) &blob_info,
+}, {
+       // Linux Ethernet/RNDIS gadget on pxa210/25x/26x
+       USB_DEVICE_VER (0x0525, 0xa4a2, 0x0203, 0x0203),
+       .driver_info =  (unsigned long) &linuxdev_info,
 }, 
 #endif
 



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to