ChangeSet 1.1722.83.5, 2004/06/02 13:25:08-07:00, david-b@pacbell.net

[PATCH] USB: pxa/rndis device descriptor

This fixes a problem that all pxa2xx_udc g_ether devices
would run into.  They'd give the wrong descriptors, like:

> --------msg1- usbview ----------
> Device Descriptor: bcdUSB:             0x0200
> bDeviceClass:         0xFF
> bDeviceSubClass:      0x00
> bDeviceProtocol:      0x00
> bMaxPacketSize0:      0x10 (16)

Windows doesn't like RNDIS-supporting devices to point
out that they're really vendor-specific.  So this patch
makes sure they don't.

Signed-off-by: David Brownell <dbrownelL@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/usb/gadget/ether.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)


diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
--- a/drivers/usb/gadget/ether.c	Fri Jun 18 11:06:58 2004
+++ b/drivers/usb/gadget/ether.c	Fri Jun 18 11:06:58 2004
@@ -2302,17 +2302,6 @@
 		UTS_SYSNAME " " UTS_RELEASE "/%s",
 		gadget->name);
 
-	/* CDC subset ... recognized by Linux since 2.4.10, but Windows
-	 * drivers aren't widely available.
-	 */
-	if (!cdc) {
-		device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
-		device_desc.idVendor =
-			__constant_cpu_to_le16(SIMPLE_VENDOR_NUM);
-		device_desc.idProduct =
-			__constant_cpu_to_le16(SIMPLE_PRODUCT_NUM);
-	}
-
 	/* If there's an RNDIS configuration, that's what Windows wants to
 	 * be using ... so use these product IDs here and in the "linux.inf"
 	 * needed to install MSFT drivers.  Current Linux kernels will use
@@ -2326,6 +2315,16 @@
 			__constant_cpu_to_le16(RNDIS_PRODUCT_NUM);
 		snprintf (product_desc, sizeof product_desc,
 			"RNDIS/%s", driver_desc);
+
+	/* CDC subset ... recognized by Linux since 2.4.10, but Windows
+	 * drivers aren't widely available.
+	 */
+	} else if (!cdc) {
+		device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
+		device_desc.idVendor =
+			__constant_cpu_to_le16(SIMPLE_VENDOR_NUM);
+		device_desc.idProduct =
+			__constant_cpu_to_le16(SIMPLE_PRODUCT_NUM);
 	}
 
 	/* support optional vendor/distro customization */
