aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_rndis.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_rndis.c')
-rw-r--r--drivers/usb/gadget/f_rndis.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index 56b022150f22..882484a40398 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -122,7 +122,7 @@ static unsigned int bitrate(struct usb_gadget *g)
122 122
123/* interface descriptor: */ 123/* interface descriptor: */
124 124
125static struct usb_interface_descriptor rndis_control_intf __initdata = { 125static struct usb_interface_descriptor rndis_control_intf = {
126 .bLength = sizeof rndis_control_intf, 126 .bLength = sizeof rndis_control_intf,
127 .bDescriptorType = USB_DT_INTERFACE, 127 .bDescriptorType = USB_DT_INTERFACE,
128 128
@@ -135,7 +135,7 @@ static struct usb_interface_descriptor rndis_control_intf __initdata = {
135 /* .iInterface = DYNAMIC */ 135 /* .iInterface = DYNAMIC */
136}; 136};
137 137
138static struct usb_cdc_header_desc header_desc __initdata = { 138static struct usb_cdc_header_desc header_desc = {
139 .bLength = sizeof header_desc, 139 .bLength = sizeof header_desc,
140 .bDescriptorType = USB_DT_CS_INTERFACE, 140 .bDescriptorType = USB_DT_CS_INTERFACE,
141 .bDescriptorSubType = USB_CDC_HEADER_TYPE, 141 .bDescriptorSubType = USB_CDC_HEADER_TYPE,
@@ -143,7 +143,7 @@ static struct usb_cdc_header_desc header_desc __initdata = {
143 .bcdCDC = cpu_to_le16(0x0110), 143 .bcdCDC = cpu_to_le16(0x0110),
144}; 144};
145 145
146static struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor __initdata = { 146static struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor = {
147 .bLength = sizeof call_mgmt_descriptor, 147 .bLength = sizeof call_mgmt_descriptor,
148 .bDescriptorType = USB_DT_CS_INTERFACE, 148 .bDescriptorType = USB_DT_CS_INTERFACE,
149 .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE, 149 .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE,
@@ -152,7 +152,7 @@ static struct usb_cdc_call_mgmt_descriptor call_mgmt_descriptor __initdata = {
152 .bDataInterface = 0x01, 152 .bDataInterface = 0x01,
153}; 153};
154 154
155static struct usb_cdc_acm_descriptor rndis_acm_descriptor __initdata = { 155static struct usb_cdc_acm_descriptor rndis_acm_descriptor = {
156 .bLength = sizeof rndis_acm_descriptor, 156 .bLength = sizeof rndis_acm_descriptor,
157 .bDescriptorType = USB_DT_CS_INTERFACE, 157 .bDescriptorType = USB_DT_CS_INTERFACE,
158 .bDescriptorSubType = USB_CDC_ACM_TYPE, 158 .bDescriptorSubType = USB_CDC_ACM_TYPE,
@@ -160,7 +160,7 @@ static struct usb_cdc_acm_descriptor rndis_acm_descriptor __initdata = {
160 .bmCapabilities = 0x00, 160 .bmCapabilities = 0x00,
161}; 161};
162 162
163static struct usb_cdc_union_desc rndis_union_desc __initdata = { 163static struct usb_cdc_union_desc rndis_union_desc = {
164 .bLength = sizeof(rndis_union_desc), 164 .bLength = sizeof(rndis_union_desc),
165 .bDescriptorType = USB_DT_CS_INTERFACE, 165 .bDescriptorType = USB_DT_CS_INTERFACE,
166 .bDescriptorSubType = USB_CDC_UNION_TYPE, 166 .bDescriptorSubType = USB_CDC_UNION_TYPE,
@@ -170,7 +170,7 @@ static struct usb_cdc_union_desc rndis_union_desc __initdata = {
170 170
171/* the data interface has two bulk endpoints */ 171/* the data interface has two bulk endpoints */
172 172
173static struct usb_interface_descriptor rndis_data_intf __initdata = { 173static struct usb_interface_descriptor rndis_data_intf = {
174 .bLength = sizeof rndis_data_intf, 174 .bLength = sizeof rndis_data_intf,
175 .bDescriptorType = USB_DT_INTERFACE, 175 .bDescriptorType = USB_DT_INTERFACE,
176 176
@@ -198,7 +198,7 @@ rndis_iad_descriptor = {
198 198
199/* full speed support: */ 199/* full speed support: */
200 200
201static struct usb_endpoint_descriptor fs_notify_desc __initdata = { 201static struct usb_endpoint_descriptor fs_notify_desc = {
202 .bLength = USB_DT_ENDPOINT_SIZE, 202 .bLength = USB_DT_ENDPOINT_SIZE,
203 .bDescriptorType = USB_DT_ENDPOINT, 203 .bDescriptorType = USB_DT_ENDPOINT,
204 204
@@ -208,7 +208,7 @@ static struct usb_endpoint_descriptor fs_notify_desc __initdata = {
208 .bInterval = 1 << LOG2_STATUS_INTERVAL_MSEC, 208 .bInterval = 1 << LOG2_STATUS_INTERVAL_MSEC,
209}; 209};
210 210
211static struct usb_endpoint_descriptor fs_in_desc __initdata = { 211static struct usb_endpoint_descriptor fs_in_desc = {
212 .bLength = USB_DT_ENDPOINT_SIZE, 212 .bLength = USB_DT_ENDPOINT_SIZE,
213 .bDescriptorType = USB_DT_ENDPOINT, 213 .bDescriptorType = USB_DT_ENDPOINT,
214 214
@@ -216,7 +216,7 @@ static struct usb_endpoint_descriptor fs_in_desc __initdata = {
216 .bmAttributes = USB_ENDPOINT_XFER_BULK, 216 .bmAttributes = USB_ENDPOINT_XFER_BULK,
217}; 217};
218 218
219static struct usb_endpoint_descriptor fs_out_desc __initdata = { 219static struct usb_endpoint_descriptor fs_out_desc = {
220 .bLength = USB_DT_ENDPOINT_SIZE, 220 .bLength = USB_DT_ENDPOINT_SIZE,
221 .bDescriptorType = USB_DT_ENDPOINT, 221 .bDescriptorType = USB_DT_ENDPOINT,
222 222
@@ -224,7 +224,7 @@ static struct usb_endpoint_descriptor fs_out_desc __initdata = {
224 .bmAttributes = USB_ENDPOINT_XFER_BULK, 224 .bmAttributes = USB_ENDPOINT_XFER_BULK,
225}; 225};
226 226
227static struct usb_descriptor_header *eth_fs_function[] __initdata = { 227static struct usb_descriptor_header *eth_fs_function[] = {
228 (struct usb_descriptor_header *) &rndis_iad_descriptor, 228 (struct usb_descriptor_header *) &rndis_iad_descriptor,
229 /* control interface matches ACM, not Ethernet */ 229 /* control interface matches ACM, not Ethernet */
230 (struct usb_descriptor_header *) &rndis_control_intf, 230 (struct usb_descriptor_header *) &rndis_control_intf,
@@ -242,7 +242,7 @@ static struct usb_descriptor_header *eth_fs_function[] __initdata = {
242 242
243/* high speed support: */ 243/* high speed support: */
244 244
245static struct usb_endpoint_descriptor hs_notify_desc __initdata = { 245static struct usb_endpoint_descriptor hs_notify_desc = {
246 .bLength = USB_DT_ENDPOINT_SIZE, 246 .bLength = USB_DT_ENDPOINT_SIZE,
247 .bDescriptorType = USB_DT_ENDPOINT, 247 .bDescriptorType = USB_DT_ENDPOINT,
248 248
@@ -251,7 +251,7 @@ static struct usb_endpoint_descriptor hs_notify_desc __initdata = {
251 .wMaxPacketSize = cpu_to_le16(STATUS_BYTECOUNT), 251 .wMaxPacketSize = cpu_to_le16(STATUS_BYTECOUNT),
252 .bInterval = LOG2_STATUS_INTERVAL_MSEC + 4, 252 .bInterval = LOG2_STATUS_INTERVAL_MSEC + 4,
253}; 253};
254static struct usb_endpoint_descriptor hs_in_desc __initdata = { 254static struct usb_endpoint_descriptor hs_in_desc = {
255 .bLength = USB_DT_ENDPOINT_SIZE, 255 .bLength = USB_DT_ENDPOINT_SIZE,
256 .bDescriptorType = USB_DT_ENDPOINT, 256 .bDescriptorType = USB_DT_ENDPOINT,
257 257
@@ -260,7 +260,7 @@ static struct usb_endpoint_descriptor hs_in_desc __initdata = {
260 .wMaxPacketSize = cpu_to_le16(512), 260 .wMaxPacketSize = cpu_to_le16(512),
261}; 261};
262 262
263static struct usb_endpoint_descriptor hs_out_desc __initdata = { 263static struct usb_endpoint_descriptor hs_out_desc = {
264 .bLength = USB_DT_ENDPOINT_SIZE, 264 .bLength = USB_DT_ENDPOINT_SIZE,
265 .bDescriptorType = USB_DT_ENDPOINT, 265 .bDescriptorType = USB_DT_ENDPOINT,
266 266
@@ -269,7 +269,7 @@ static struct usb_endpoint_descriptor hs_out_desc __initdata = {
269 .wMaxPacketSize = cpu_to_le16(512), 269 .wMaxPacketSize = cpu_to_le16(512),
270}; 270};
271 271
272static struct usb_descriptor_header *eth_hs_function[] __initdata = { 272static struct usb_descriptor_header *eth_hs_function[] = {
273 (struct usb_descriptor_header *) &rndis_iad_descriptor, 273 (struct usb_descriptor_header *) &rndis_iad_descriptor,
274 /* control interface matches ACM, not Ethernet */ 274 /* control interface matches ACM, not Ethernet */
275 (struct usb_descriptor_header *) &rndis_control_intf, 275 (struct usb_descriptor_header *) &rndis_control_intf,
@@ -594,7 +594,7 @@ static void rndis_close(struct gether *geth)
594 594
595/* ethernet function driver setup/binding */ 595/* ethernet function driver setup/binding */
596 596
597static int __init 597static int
598rndis_bind(struct usb_configuration *c, struct usb_function *f) 598rndis_bind(struct usb_configuration *c, struct usb_function *f)
599{ 599{
600 struct usb_composite_dev *cdev = c->cdev; 600 struct usb_composite_dev *cdev = c->cdev;
@@ -786,7 +786,8 @@ static inline bool can_support_rndis(struct usb_configuration *c)
786 * Caller must have called @gether_setup(). Caller is also responsible 786 * Caller must have called @gether_setup(). Caller is also responsible
787 * for calling @gether_cleanup() before module unload. 787 * for calling @gether_cleanup() before module unload.
788 */ 788 */
789int __init rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]) 789int
790rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
790{ 791{
791 struct f_rndis *rndis; 792 struct f_rndis *rndis;
792 int status; 793 int status;