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

- Dave


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]>

--- 1.145/drivers/usb/core/hub.c	Fri Sep 10 17:57:52 2004
+++ edited/drivers/usb/core/hub.c	Thu Sep 16 09:10:36 2004
@@ -1062,11 +1062,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;
 		}
--- 1.108/drivers/usb/net/usbnet.c	Mon Aug 23 17:21:19 2004
+++ edited/drivers/usb/net/usbnet.c	Thu Sep 16 08:44:34 2004
@@ -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
 

Reply via email to