RE: USB driver

From: Dunlap, Randy (randy.dunlap@intel.com)
Date: Tue Apr 11 2000 - 10:03:05 EST


Hi,

When usb_new_device() is called, the maxpacketsize for the
default control pipe is not known, so it's not safe to read more
than 8 bytes of the device descriptor. Since bMaxPacketSize0
(max packet size for the default control pipe) is in this first
8 bytes, the code can read this byte and use it for future
reads of the control pipe. You can follow the code and see
that a few lines later it calls usb_get_device_descriptor().
This reads the entire descriptor.

This shouldn't cause any problem(s) with the device you
are working with if it's built properly. If you see problems,
it could be a USB device silicon or firmware problem.

For future linux-usb discussions, please use the
linux-usb@suse.com mailing list.

~Randy

> -----Original Message-----
> From: Karel Srsen [mailto:Karel.Srsen@asicentrum.cz]
>
> Hello,
> is there somebody who understands linux USB driver ?
> I have one question:
> there is following piece of code in drivers/usb/usb.c (2.3.50 kernel):
>
> int usb_new_device(struct usb_device *dev)
> {
> ...
> ...
> err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
> &dev->descriptor, 8);
> if (err < 8) {
> ...
> ...
> }
>
> that's nice but in fact USB device descriptor's length is not 8 bytes
> but 18 (0x12). Does it means that driver reads only leading 8 bytes
> instead of whole descriptor ? I thing it's wrong, isn't ? Can it cause
> any error ?
>
> I haven't subscribed this mailing list. If you decide to answer, send
> reply to Karel.Srsen@asicentrum.cz please.
>
> Karel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:16 EST