On Friday 06 January 2006 2:18 pm, Alan Stern wrote:
> 
> I don't know why struct usb_device_descriptor is packed.  In fact, most of
> the structures defined in usb_ch9.h are packed for no apparent reason.  

To ensure not just that the protocol formats are strictly adhered to,
but that it's obvious there's something special about those things.

We don't want people putting Linux-specific things into those structs
for example, any more than Linux-specific things go into TCP headers.


> Maybe it's so you can dereference descriptors embedded in the 
> rawdescriptors array; those definitely are _not_ aligned.

That too; ISTR that GCC handles unaligned accesses correctly for
things declared "packed".  On x86 it doesn't matter of course.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to