Am Freitag, 6. Januar 2006 19:38 schrieb Russell King: > On Fri, Jan 06, 2006 at 07:15:43PM +0100, Oliver Neukum wrote: > > Hi, > > > > is there any architecture for which packed is required in structures like > > this: > > > > /* All standard descriptors have these 2 fields at the beginning */ > > struct usb_descriptor_header { > > __u8 bLength; > > __u8 bDescriptorType; > > }; > > sizeof(struct usb_descriptor_header) will be 4 on ARM. If this > concerns you, you need to pack the structure thusly: > > struct usb_descriptor_header { > __u8 bLength; > __u8 bDescriptorType; > } __attribute__((packed));
I had feared so. The usb include files are incorrect for arm in this case. Did I overdo it? Regards Oliver --- a/include/linux/usb_ch9.h 2006-01-03 04:21:10.000000000 +0100 +++ b/include/linux/usb_ch9.h 2006-01-06 19:51:24.000000000 +0100 @@ -359,7 +359,7 @@ /* bulk endpoints with 8 byte maxpacket */ __u8 bDebugInEndpoint; __u8 bDebugOutEndpoint; -}; +} __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ @@ -388,7 +388,7 @@ __le16 wTotalLength; __u8 bNumEncryptionTypes; -}; +} __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ @@ -402,7 +402,7 @@ __u8 tTKID[3]; __u8 bReserved; __u8 bKeyData[0]; -}; +} __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ @@ -418,7 +418,7 @@ #define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ __u8 bEncryptionValue; /* use in SET_ENCRYPTION */ __u8 bAuthKeyIndex; -}; +} __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ @@ -430,7 +430,7 @@ __le16 wTotalLength; __u8 bNumDeviceCaps; -}; +} __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ @@ -439,7 +439,7 @@ __u8 bLength; __u8 bDescriptorType; __u8 bDevCapabilityType; -}; +} __attribute__ ((packed)); #define USB_CAP_TYPE_WIRELESS_USB 1 @@ -467,7 +467,7 @@ __u8 bmFFITXPowerInfo; /* FFI power levels */ __le16 bmBandGroup; __u8 bReserved; -}; +} __attribute__ ((packed)); /*-------------------------------------------------------------------------*/ ------------------------------------------------------- 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