CDC ECM with multiple slave interfaces

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

 



Hello,

I am working on a device which provide a CDC ECM interface.
When I connect it to an Ubuntu 8.04 desktop using 2.6.27-14 kernel, the interface does not go up and I get the following error :
   kernel: [33329.037807] usb 1-4.1: bad CDC descriptors
I found that my device send a CDC UNION descriptor with multiple slave interfaces.

After some check I found the definition of the structure in the kernel (include/linux/usb/cdc.h) :
   /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */
   struct usb_cdc_union_desc {
           __u8    bLength;
           __u8    bDescriptorType;
           __u8    bDescriptorSubType;

           __u8    bMasterInterface0;
           __u8    bSlaveInterface0;
           /* ... and there could be other slave interfaces */
   } __attribute__ ((packed));

But in function usbnet_generic_cdc_bind() (in file drivers/net/usb/cdc_ether.c line 173), the check for the CDC UNION descriptor is done on the exact size of the structure:
   if (info->u->bLength != sizeof *info->u)

This works only if there is one single slave interface (so the bLength is equal to the structure length).

Shouldn't it be : if (info->u->bLength < sizeof *info->u) ?


Regards

Fred

--
-----------------------------------------------
It is not by improving the oil lamp that one invents the electric bulb!
-----------------------------------------------
Danis Frederic                   Access Company
Software engineer
Mail : mailto:frederic.danis@xxxxxxxxxxxxxxxxxx
-----------------------------------------------

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