tong changda wrote:
How to debug such kind of problem?
In this case, the RNDIS spec says the device descriptor
needs to say it's a communications class device. So the
attached patch should make that part work much better.
This is almost a PXA-specific issue, since it's the most
widely used chip in the "gadget" stack that can't support
CDC Ethernet.
I really like it when the debug info someone provides is
so precise at pinpointing a problem. Thanks!
- Dave
--------msg1- usbview ----------
Device Descriptor: bcdUSB: 0x0200
bDeviceClass: 0xFF
bDeviceSubClass: 0x00
bDeviceProtocol: 0x00
bMaxPacketSize0: 0x10 (16)
idVendor: 0x0525 (Netchip Technology Inc.)
idProduct: 0xA4A2
bcdDevice: 0x0203
iManufacturer: 0x01
iProduct: 0x02
iSerialNumber: 0x00
bNumConfigurations: 0x02
ConnectionStatus: DeviceConnected
Current Config Value: 0x00
Likely fixing those IDs will make Windows put it into
the RNDIS configuration, Value 0x02, and then put it
into RNDIS_DATA_INITIALIZED state below.
Device Bus Speed: Full
Device Address: 0x00
Open Pipes: 0
----msg2-----
Config Nr. 0
used : y
state : RNDIS_UNINITIALIZED
medium : 0x00000000
speed : 0
cable : disconnected
vendor ID : 0x00000000
vendor : Linux 2.6.5/pxa2xx_udc
--- 1.44/drivers/usb/gadget/ether.c Mon May 17 23:03:16 2004
+++ edited/drivers/usb/gadget/ether.c Sat May 29 11:01:44 2004
@@ -2305,17 +2305,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
@@ -2329,6 +2318,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 */