On Sat, 27 Dec 2003, Ashley Reed wrote: > If I just commented out "header->bDescriptorType == USB_DT_DEVICE", then > it would fail with the warning "invalid descriptor of length 1". That's > why I removed the check for the descriptor being less than 2 bytes. I > don't know anything about the USB protocol. I just removed some stuff > to make it work for me.
It certainly sounds like your device puts some extra garbage in its descriptors. > I find it kind of interesting that there were no warnings for the game > pad when using it on either a 2.4.23 or a 2.6.0-test5 kernel if the > device is sending an invalid descriptor. The description of the patch > that made the game pad not work says that it only moves all of the > descriptor length and type checking to one place. I would argue that it > does more than move code since it causes my device to stop working. It's true; that patch added a little extra error checking in addition to moving code around. > Anyway, I'm just trying to inform the developers that there might be > something wrong with the descriptor length and type checking code. Of > course, like you said, maybe this device doesn't conform to the USB > specs. The best way to tell would be to dump the contents of the configuration descriptor. Not that this would help you in any way... Try this patch. Instead of returning an error when it encounters one of these unexpected descriptor types, it will merely log a warning and skip any remaining descriptors (that's if I didn't make any mistakes -- I haven't tested it myself). Maybe this will be enough to get your device to work again. Alan Stern --- 2.6/drivers/usb/core/config.c.orig Fri Dec 19 10:55:07 2003 +++ 2.6/drivers/usb/core/config.c Sun Dec 28 11:28:47 2003 @@ -271,7 +271,9 @@ } else if ((header->bDescriptorType == USB_DT_DEVICE || header->bDescriptorType == USB_DT_CONFIG) && j) { warn("unexpected descriptor type 0x%X", header->bDescriptorType); - return -EINVAL; + warn("skipping rest of the config descriptor"); + size = buffer2 - buffer; + break; } j = 1; ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel