summaryrefslogtreecommitdiff
path: root/packages/linux/linux-2.6.18/usb-file-storage-align-all-descriptors-on-a-word-boundary.patch
blob: 10778d59037a65843d08100bac9169cead4ebf8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
From nobody Mon Sep 17 00:00:00 2001
From: Håvard Skinnemoen <hskinnemoen@atmel.com>
Date: Tue Feb 28 08:51:18 2006 +0100
Subject: [PATCH] USB File Storage: Align all descriptors on a word boundary

Seems like gcc has problems with packed structs, so we'll just align
them explicitly.

---

 drivers/usb/gadget/file_storage.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Index: linux-2.6.18-avr32/drivers/usb/gadget/file_storage.c
===================================================================
--- linux-2.6.18-avr32.orig/drivers/usb/gadget/file_storage.c	2006-09-11 14:36:02.000000000 +0200
+++ linux-2.6.18-avr32/drivers/usb/gadget/file_storage.c	2006-09-12 10:16:30.000000000 +0200
@@ -853,7 +853,7 @@ static void inline put_be32(u8 *buf, u32
 #define	CONFIG_VALUE		1
 
 static struct usb_device_descriptor
-device_desc = {
+device_desc __attribute__((aligned(2))) = {
 	.bLength =		sizeof device_desc,
 	.bDescriptorType =	USB_DT_DEVICE,
 
@@ -872,7 +872,7 @@ device_desc = {
 };
 
 static struct usb_config_descriptor
-config_desc = {
+config_desc __attribute__((aligned(2))) = {
 	.bLength =		sizeof config_desc,
 	.bDescriptorType =	USB_DT_CONFIG,
 
@@ -895,7 +895,7 @@ otg_desc = {
 /* There is only one interface. */
 
 static struct usb_interface_descriptor
-intf_desc = {
+intf_desc __attribute__((aligned(2))) = {
 	.bLength =		sizeof intf_desc,
 	.bDescriptorType =	USB_DT_INTERFACE,
 
@@ -910,7 +910,7 @@ intf_desc = {
  * and interrupt-in. */
 
 static struct usb_endpoint_descriptor
-fs_bulk_in_desc = {
+fs_bulk_in_desc __attribute__((aligned(2))) = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
 	.bDescriptorType =	USB_DT_ENDPOINT,
 
@@ -920,7 +920,7 @@ fs_bulk_in_desc = {
 };
 
 static struct usb_endpoint_descriptor
-fs_bulk_out_desc = {
+fs_bulk_out_desc __attribute__((aligned(2))) = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
 	.bDescriptorType =	USB_DT_ENDPOINT,
 
@@ -930,7 +930,7 @@ fs_bulk_out_desc = {
 };
 
 static struct usb_endpoint_descriptor
-fs_intr_in_desc = {
+fs_intr_in_desc __attribute__((aligned(2))) = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
 	.bDescriptorType =	USB_DT_ENDPOINT,
 
@@ -962,7 +962,7 @@ static const struct usb_descriptor_heade
  * for the config descriptor.
  */
 static struct usb_qualifier_descriptor
-dev_qualifier = {
+dev_qualifier __attribute__((aligned(2))) = {
 	.bLength =		sizeof dev_qualifier,
 	.bDescriptorType =	USB_DT_DEVICE_QUALIFIER,
 
@@ -973,7 +973,7 @@ dev_qualifier = {
 };
 
 static struct usb_endpoint_descriptor
-hs_bulk_in_desc = {
+hs_bulk_in_desc __attribute__((aligned(2))) = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
 	.bDescriptorType =	USB_DT_ENDPOINT,
 
@@ -983,7 +983,7 @@ hs_bulk_in_desc = {
 };
 
 static struct usb_endpoint_descriptor
-hs_bulk_out_desc = {
+hs_bulk_out_desc __attribute__((aligned(2))) = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
 	.bDescriptorType =	USB_DT_ENDPOINT,
 
@@ -994,7 +994,7 @@ hs_bulk_out_desc = {
 };
 
 static struct usb_endpoint_descriptor
-hs_intr_in_desc = {
+hs_intr_in_desc __attribute__((aligned(2))) = {
 	.bLength =		USB_DT_ENDPOINT_SIZE,
 	.bDescriptorType =	USB_DT_ENDPOINT,