aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_ecm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_ecm.c')
-rw-r--r--drivers/usb/gadget/f_ecm.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c
index 4e595324c614..544257a89ed2 100644
--- a/drivers/usb/gadget/f_ecm.c
+++ b/drivers/usb/gadget/f_ecm.c
@@ -113,7 +113,7 @@ static inline unsigned ecm_bitrate(struct usb_gadget *g)
113 113
114/* interface descriptor: */ 114/* interface descriptor: */
115 115
116static struct usb_interface_descriptor ecm_control_intf __initdata = { 116static struct usb_interface_descriptor ecm_control_intf = {
117 .bLength = sizeof ecm_control_intf, 117 .bLength = sizeof ecm_control_intf,
118 .bDescriptorType = USB_DT_INTERFACE, 118 .bDescriptorType = USB_DT_INTERFACE,
119 119
@@ -126,7 +126,7 @@ static struct usb_interface_descriptor ecm_control_intf __initdata = {
126 /* .iInterface = DYNAMIC */ 126 /* .iInterface = DYNAMIC */
127}; 127};
128 128
129static struct usb_cdc_header_desc ecm_header_desc __initdata = { 129static struct usb_cdc_header_desc ecm_header_desc = {
130 .bLength = sizeof ecm_header_desc, 130 .bLength = sizeof ecm_header_desc,
131 .bDescriptorType = USB_DT_CS_INTERFACE, 131 .bDescriptorType = USB_DT_CS_INTERFACE,
132 .bDescriptorSubType = USB_CDC_HEADER_TYPE, 132 .bDescriptorSubType = USB_CDC_HEADER_TYPE,
@@ -134,7 +134,7 @@ static struct usb_cdc_header_desc ecm_header_desc __initdata = {
134 .bcdCDC = cpu_to_le16(0x0110), 134 .bcdCDC = cpu_to_le16(0x0110),
135}; 135};
136 136
137static struct usb_cdc_union_desc ecm_union_desc __initdata = { 137static struct usb_cdc_union_desc ecm_union_desc = {
138 .bLength = sizeof(ecm_union_desc), 138 .bLength = sizeof(ecm_union_desc),
139 .bDescriptorType = USB_DT_CS_INTERFACE, 139 .bDescriptorType = USB_DT_CS_INTERFACE,
140 .bDescriptorSubType = USB_CDC_UNION_TYPE, 140 .bDescriptorSubType = USB_CDC_UNION_TYPE,
@@ -142,7 +142,7 @@ static struct usb_cdc_union_desc ecm_union_desc __initdata = {
142 /* .bSlaveInterface0 = DYNAMIC */ 142 /* .bSlaveInterface0 = DYNAMIC */
143}; 143};
144 144
145static struct usb_cdc_ether_desc ecm_desc __initdata = { 145static struct usb_cdc_ether_desc ecm_desc = {
146 .bLength = sizeof ecm_desc, 146 .bLength = sizeof ecm_desc,
147 .bDescriptorType = USB_DT_CS_INTERFACE, 147 .bDescriptorType = USB_DT_CS_INTERFACE,
148 .bDescriptorSubType = USB_CDC_ETHERNET_TYPE, 148 .bDescriptorSubType = USB_CDC_ETHERNET_TYPE,
@@ -157,7 +157,7 @@ static struct usb_cdc_ether_desc ecm_desc __initdata = {
157 157
158/* the default data interface has no endpoints ... */ 158/* the default data interface has no endpoints ... */
159 159
160static struct usb_interface_descriptor ecm_data_nop_intf __initdata = { 160static struct usb_interface_descriptor ecm_data_nop_intf = {
161 .bLength = sizeof ecm_data_nop_intf, 161 .bLength = sizeof ecm_data_nop_intf,
162 .bDescriptorType = USB_DT_INTERFACE, 162 .bDescriptorType = USB_DT_INTERFACE,
163 163
@@ -172,7 +172,7 @@ static struct usb_interface_descriptor ecm_data_nop_intf __initdata = {
172 172
173/* ... but the "real" data interface has two bulk endpoints */ 173/* ... but the "real" data interface has two bulk endpoints */
174 174
175static struct usb_interface_descriptor ecm_data_intf __initdata = { 175static struct usb_interface_descriptor ecm_data_intf = {
176 .bLength = sizeof ecm_data_intf, 176 .bLength = sizeof ecm_data_intf,
177 .bDescriptorType = USB_DT_INTERFACE, 177 .bDescriptorType = USB_DT_INTERFACE,
178 178
@@ -187,7 +187,7 @@ static struct usb_interface_descriptor ecm_data_intf __initdata = {
187 187
188/* full speed support: */ 188/* full speed support: */
189 189
190static struct usb_endpoint_descriptor fs_ecm_notify_desc __initdata = { 190static struct usb_endpoint_descriptor fs_ecm_notify_desc = {
191 .bLength = USB_DT_ENDPOINT_SIZE, 191 .bLength = USB_DT_ENDPOINT_SIZE,
192 .bDescriptorType = USB_DT_ENDPOINT, 192 .bDescriptorType = USB_DT_ENDPOINT,
193 193
@@ -197,7 +197,7 @@ static struct usb_endpoint_descriptor fs_ecm_notify_desc __initdata = {
197 .bInterval = 1 << LOG2_STATUS_INTERVAL_MSEC, 197 .bInterval = 1 << LOG2_STATUS_INTERVAL_MSEC,
198}; 198};
199 199
200static struct usb_endpoint_descriptor fs_ecm_in_desc __initdata = { 200static struct usb_endpoint_descriptor fs_ecm_in_desc = {
201 .bLength = USB_DT_ENDPOINT_SIZE, 201 .bLength = USB_DT_ENDPOINT_SIZE,
202 .bDescriptorType = USB_DT_ENDPOINT, 202 .bDescriptorType = USB_DT_ENDPOINT,
203 203
@@ -205,7 +205,7 @@ static struct usb_endpoint_descriptor fs_ecm_in_desc __initdata = {
205 .bmAttributes = USB_ENDPOINT_XFER_BULK, 205 .bmAttributes = USB_ENDPOINT_XFER_BULK,
206}; 206};
207 207
208static struct usb_endpoint_descriptor fs_ecm_out_desc __initdata = { 208static struct usb_endpoint_descriptor fs_ecm_out_desc = {
209 .bLength = USB_DT_ENDPOINT_SIZE, 209 .bLength = USB_DT_ENDPOINT_SIZE,
210 .bDescriptorType = USB_DT_ENDPOINT, 210 .bDescriptorType = USB_DT_ENDPOINT,
211 211
@@ -213,7 +213,7 @@ static struct usb_endpoint_descriptor fs_ecm_out_desc __initdata = {
213 .bmAttributes = USB_ENDPOINT_XFER_BULK, 213 .bmAttributes = USB_ENDPOINT_XFER_BULK,
214}; 214};
215 215
216static struct usb_descriptor_header *ecm_fs_function[] __initdata = { 216static struct usb_descriptor_header *ecm_fs_function[] = {
217 /* CDC ECM control descriptors */ 217 /* CDC ECM control descriptors */
218 (struct usb_descriptor_header *) &ecm_control_intf, 218 (struct usb_descriptor_header *) &ecm_control_intf,
219 (struct usb_descriptor_header *) &ecm_header_desc, 219 (struct usb_descriptor_header *) &ecm_header_desc,
@@ -231,7 +231,7 @@ static struct usb_descriptor_header *ecm_fs_function[] __initdata = {
231 231
232/* high speed support: */ 232/* high speed support: */
233 233
234static struct usb_endpoint_descriptor hs_ecm_notify_desc __initdata = { 234static struct usb_endpoint_descriptor hs_ecm_notify_desc = {
235 .bLength = USB_DT_ENDPOINT_SIZE, 235 .bLength = USB_DT_ENDPOINT_SIZE,
236 .bDescriptorType = USB_DT_ENDPOINT, 236 .bDescriptorType = USB_DT_ENDPOINT,
237 237
@@ -240,7 +240,7 @@ static struct usb_endpoint_descriptor hs_ecm_notify_desc __initdata = {
240 .wMaxPacketSize = cpu_to_le16(ECM_STATUS_BYTECOUNT), 240 .wMaxPacketSize = cpu_to_le16(ECM_STATUS_BYTECOUNT),
241 .bInterval = LOG2_STATUS_INTERVAL_MSEC + 4, 241 .bInterval = LOG2_STATUS_INTERVAL_MSEC + 4,
242}; 242};
243static struct usb_endpoint_descriptor hs_ecm_in_desc __initdata = { 243static struct usb_endpoint_descriptor hs_ecm_in_desc = {
244 .bLength = USB_DT_ENDPOINT_SIZE, 244 .bLength = USB_DT_ENDPOINT_SIZE,
245 .bDescriptorType = USB_DT_ENDPOINT, 245 .bDescriptorType = USB_DT_ENDPOINT,
246 246
@@ -249,7 +249,7 @@ static struct usb_endpoint_descriptor hs_ecm_in_desc __initdata = {
249 .wMaxPacketSize = cpu_to_le16(512), 249 .wMaxPacketSize = cpu_to_le16(512),
250}; 250};
251 251
252static struct usb_endpoint_descriptor hs_ecm_out_desc __initdata = { 252static struct usb_endpoint_descriptor hs_ecm_out_desc = {
253 .bLength = USB_DT_ENDPOINT_SIZE, 253 .bLength = USB_DT_ENDPOINT_SIZE,
254 .bDescriptorType = USB_DT_ENDPOINT, 254 .bDescriptorType = USB_DT_ENDPOINT,
255 255
@@ -258,7 +258,7 @@ static struct usb_endpoint_descriptor hs_ecm_out_desc __initdata = {
258 .wMaxPacketSize = cpu_to_le16(512), 258 .wMaxPacketSize = cpu_to_le16(512),
259}; 259};
260 260
261static struct usb_descriptor_header *ecm_hs_function[] __initdata = { 261static struct usb_descriptor_header *ecm_hs_function[] = {
262 /* CDC ECM control descriptors */ 262 /* CDC ECM control descriptors */
263 (struct usb_descriptor_header *) &ecm_control_intf, 263 (struct usb_descriptor_header *) &ecm_control_intf,
264 (struct usb_descriptor_header *) &ecm_header_desc, 264 (struct usb_descriptor_header *) &ecm_header_desc,
@@ -597,7 +597,7 @@ static void ecm_close(struct gether *geth)
597 597
598/* ethernet function driver setup/binding */ 598/* ethernet function driver setup/binding */
599 599
600static int __init 600static int
601ecm_bind(struct usb_configuration *c, struct usb_function *f) 601ecm_bind(struct usb_configuration *c, struct usb_function *f)
602{ 602{
603 struct usb_composite_dev *cdev = c->cdev; 603 struct usb_composite_dev *cdev = c->cdev;
@@ -763,7 +763,8 @@ ecm_unbind(struct usb_configuration *c, struct usb_function *f)
763 * Caller must have called @gether_setup(). Caller is also responsible 763 * Caller must have called @gether_setup(). Caller is also responsible
764 * for calling @gether_cleanup() before module unload. 764 * for calling @gether_cleanup() before module unload.
765 */ 765 */
766int __init ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]) 766int
767ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
767{ 768{
768 struct f_ecm *ecm; 769 struct f_ecm *ecm;
769 int status; 770 int status;