On Thu, 19 Feb 2004, Gregory Soyez wrote:

> Hi all,
> 
> I'm playing with an EZ_USB controller configured as an HID. According to the 
> hid documentation, this seems correctly configured but when I plug it into my 
> linux box (kernel 2.6.3) I receive the message
> "invalid descriptor of length 1"
> 
> I have browsed the kernel sources to see where this comes from and it appears 
> that usb_get_configuration (drivers/usb/core/config.c) get the following 
> descriptors:
> - a config descriptor
> - an interface descriptor
> - a HID descriptor
> - 2 endpoints
> - another hid-specific stuff
> However, that last descriptor does not start with its size and type (as far as 
> I have properly understood, this is contained in the hid descriptor) which 
> makes usb_parse_configuration to crash !
> 
> Is this a kernel bug or have I missed sth ???
> 
> TIA
> Gregor

It's not a kernel bug.  Every descriptor must start with its size and 
type, even if that information is also contained somewhere else.  That's 
the only way to guarantee that hosts unfamiliar with the meaning of the 
descriptor can skip over it.

And by the way, I trust that usb_parse_configuration simply returns an 
error code, and doesn't crash!

Alan Stern



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to