Hello,

My question is regarding 2.4.20 kernel , but as I looked of 2.6 kernel code , it's
seems also relevant.


the descriptor struct size is 18 bytes (it is the descriptor member is usb_device struct (struct usb_device_descriptor) ;

I see tha in usb.c , in usb_new_device() , there's a call to

usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8)

(Note : the last paramter, 8 , means that we read only 8 bytes instead of 18 , the real size)
and afterwards


dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0;
dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0;

err = usb_get_device_descriptor(dev);

Why is the first call with 8 bytes, than setting of epmaxpacketin [0]/epmaxpacketout [0] ,
and then again a call to usb_get_device_descriptor() , wheras this second call in fact calls
usb_get_descriptor() with size 18 ?


What is wrong with reading 18 bytes , the full structure, at first try ?

I saw some posting in this forum (from quite a long time ago); They say there that you should not
try to read length higher than length in fact (like 128); I agree; But why not to read tha actual length , 18?


regards
Sting

_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to