Re: pxa27x_udc, linux host rndis/cdc problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/19/09 09:24, Uli Luckas wrote:
> . . .
>
> Another striking difference is, that with the 2.6.21.7 gadget driver, Configuration #1 (CDC Subset/SAFE) got chosen. Investigating why this is so, I found commit 0391c828ce75cc71ae301946699a6f2d515fd99d "usb ethernet gadget: use composite gadget framework" changed bDeviceClass from 2 (Communications) to 255 (Vendor Specific Class) for devices which can't support ecm.
>
> . . .
>   

I've noticed this, too, and solved the problem with the patch at the
bottom of this email.

While this patch works with a Windows RNDIS host, it does not with a
Linux RNDIS host.  Here is the host dmesg output:

usb 1-2.7: new full speed USB device using ehci_hcd and address 44
usb 1-2.7: configuration #1 chosen from 2 choices
usb 1-2.7: unsupported MDLM descriptors
usb 1-2.7: New USB device found, idVendor=0525, idProduct=a4a2
usb 1-2.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2.7: Product: RNDIS/Ethernet Gadget
usb 1-2.7: Manufacturer: Linux 2.6.28-sdg with pxa27x_udc

The "unsupported MDLM descriptors" is the key, I think.  I believe it's
saying the Linux RNDIS drivers are looking for the full CDC Ethernet
descriptors, but the pxa27x_udc doesn't support them.

So pxa27x_ucd + RNDIS works with Windows XP (not sure about other
versions), but it doesn't with the recent Linux kernels.  Perhaps the
Linux RNDIS host drivers are too strict?   I don't know the specs, so I
couldn't say.

Aric.

------------------------------

Author: Aric Blumer <aric@xxxxxxxxxxxxxx>
Date:   Wed Mar 4 11:32:53 2009 -0500

    When a gadget does not support ECM, the bDeviceClass is changed to 0xff
    (USB_CLASS_VENDOR_SPEC).  This is broken for RNDIS, so if RNDIS is
enabled, the
    bDeviceClass needs to be set back to 0x02 (USB_CLASS_COMM).

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 37252d0..1d7b6fc 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -302,6 +302,7 @@ static int __init eth_bind(struct usb_composite_dev
*cdev)
                /* RNDIS plus ECM-or-Subset */
                device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM),
                device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM),
+               device_desc.bDeviceClass = USB_CLASS_COMM;
                device_desc.bNumConfigurations = 2;
        }

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux