diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-08-18 20:45:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-16 12:24:47 -0400 |
commit | 33376c1c043c05077b4ac79c33804266f6c45e49 (patch) | |
tree | 95d28177840c3eb1d650d7351319be2f4e141c5b /drivers/usb/gadget/f_subset.c | |
parent | 8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c (diff) |
usb gadget: link fixes for network gadget
Change how the Ethernet/RNDIS gadget driver builds: don't
use separate compilation, since it works poorly when key
parts are library code (with init sections etc). Instead
be as close as we can to "gcc --combine ...".
This is a bit more complicated than most of the others
because it had to resolve a few symbol collisions.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/f_subset.c')
-rw-r--r-- | drivers/usb/gadget/f_subset.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c index acb8d233aa1d..fe1832875771 100644 --- a/drivers/usb/gadget/f_subset.c +++ b/drivers/usb/gadget/f_subset.c | |||
@@ -103,8 +103,8 @@ static struct usb_interface_descriptor subset_data_intf __initdata = { | |||
103 | /* .iInterface = DYNAMIC */ | 103 | /* .iInterface = DYNAMIC */ |
104 | }; | 104 | }; |
105 | 105 | ||
106 | static struct usb_cdc_header_desc header_desc __initdata = { | 106 | static struct usb_cdc_header_desc mdlm_header_desc __initdata = { |
107 | .bLength = sizeof header_desc, | 107 | .bLength = sizeof mdlm_header_desc, |
108 | .bDescriptorType = USB_DT_CS_INTERFACE, | 108 | .bDescriptorType = USB_DT_CS_INTERFACE, |
109 | .bDescriptorSubType = USB_CDC_HEADER_TYPE, | 109 | .bDescriptorSubType = USB_CDC_HEADER_TYPE, |
110 | 110 | ||
@@ -152,7 +152,7 @@ static struct usb_cdc_ether_desc ether_desc __initdata = { | |||
152 | 152 | ||
153 | /* full speed support: */ | 153 | /* full speed support: */ |
154 | 154 | ||
155 | static struct usb_endpoint_descriptor fs_in_desc __initdata = { | 155 | static struct usb_endpoint_descriptor fs_subset_in_desc __initdata = { |
156 | .bLength = USB_DT_ENDPOINT_SIZE, | 156 | .bLength = USB_DT_ENDPOINT_SIZE, |
157 | .bDescriptorType = USB_DT_ENDPOINT, | 157 | .bDescriptorType = USB_DT_ENDPOINT, |
158 | 158 | ||
@@ -160,7 +160,7 @@ static struct usb_endpoint_descriptor fs_in_desc __initdata = { | |||
160 | .bmAttributes = USB_ENDPOINT_XFER_BULK, | 160 | .bmAttributes = USB_ENDPOINT_XFER_BULK, |
161 | }; | 161 | }; |
162 | 162 | ||
163 | static struct usb_endpoint_descriptor fs_out_desc __initdata = { | 163 | static struct usb_endpoint_descriptor fs_subset_out_desc __initdata = { |
164 | .bLength = USB_DT_ENDPOINT_SIZE, | 164 | .bLength = USB_DT_ENDPOINT_SIZE, |
165 | .bDescriptorType = USB_DT_ENDPOINT, | 165 | .bDescriptorType = USB_DT_ENDPOINT, |
166 | 166 | ||
@@ -170,18 +170,18 @@ static struct usb_endpoint_descriptor fs_out_desc __initdata = { | |||
170 | 170 | ||
171 | static struct usb_descriptor_header *fs_eth_function[] __initdata = { | 171 | static struct usb_descriptor_header *fs_eth_function[] __initdata = { |
172 | (struct usb_descriptor_header *) &subset_data_intf, | 172 | (struct usb_descriptor_header *) &subset_data_intf, |
173 | (struct usb_descriptor_header *) &header_desc, | 173 | (struct usb_descriptor_header *) &mdlm_header_desc, |
174 | (struct usb_descriptor_header *) &mdlm_desc, | 174 | (struct usb_descriptor_header *) &mdlm_desc, |
175 | (struct usb_descriptor_header *) &mdlm_detail_desc, | 175 | (struct usb_descriptor_header *) &mdlm_detail_desc, |
176 | (struct usb_descriptor_header *) ðer_desc, | 176 | (struct usb_descriptor_header *) ðer_desc, |
177 | (struct usb_descriptor_header *) &fs_in_desc, | 177 | (struct usb_descriptor_header *) &fs_subset_in_desc, |
178 | (struct usb_descriptor_header *) &fs_out_desc, | 178 | (struct usb_descriptor_header *) &fs_subset_out_desc, |
179 | NULL, | 179 | NULL, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | /* high speed support: */ | 182 | /* high speed support: */ |
183 | 183 | ||
184 | static struct usb_endpoint_descriptor hs_in_desc __initdata = { | 184 | static struct usb_endpoint_descriptor hs_subset_in_desc __initdata = { |
185 | .bLength = USB_DT_ENDPOINT_SIZE, | 185 | .bLength = USB_DT_ENDPOINT_SIZE, |
186 | .bDescriptorType = USB_DT_ENDPOINT, | 186 | .bDescriptorType = USB_DT_ENDPOINT, |
187 | 187 | ||
@@ -189,7 +189,7 @@ static struct usb_endpoint_descriptor hs_in_desc __initdata = { | |||
189 | .wMaxPacketSize = __constant_cpu_to_le16(512), | 189 | .wMaxPacketSize = __constant_cpu_to_le16(512), |
190 | }; | 190 | }; |
191 | 191 | ||
192 | static struct usb_endpoint_descriptor hs_out_desc __initdata = { | 192 | static struct usb_endpoint_descriptor hs_subset_out_desc __initdata = { |
193 | .bLength = USB_DT_ENDPOINT_SIZE, | 193 | .bLength = USB_DT_ENDPOINT_SIZE, |
194 | .bDescriptorType = USB_DT_ENDPOINT, | 194 | .bDescriptorType = USB_DT_ENDPOINT, |
195 | 195 | ||
@@ -199,12 +199,12 @@ static struct usb_endpoint_descriptor hs_out_desc __initdata = { | |||
199 | 199 | ||
200 | static struct usb_descriptor_header *hs_eth_function[] __initdata = { | 200 | static struct usb_descriptor_header *hs_eth_function[] __initdata = { |
201 | (struct usb_descriptor_header *) &subset_data_intf, | 201 | (struct usb_descriptor_header *) &subset_data_intf, |
202 | (struct usb_descriptor_header *) &header_desc, | 202 | (struct usb_descriptor_header *) &mdlm_header_desc, |
203 | (struct usb_descriptor_header *) &mdlm_desc, | 203 | (struct usb_descriptor_header *) &mdlm_desc, |
204 | (struct usb_descriptor_header *) &mdlm_detail_desc, | 204 | (struct usb_descriptor_header *) &mdlm_detail_desc, |
205 | (struct usb_descriptor_header *) ðer_desc, | 205 | (struct usb_descriptor_header *) ðer_desc, |
206 | (struct usb_descriptor_header *) &hs_in_desc, | 206 | (struct usb_descriptor_header *) &hs_subset_in_desc, |
207 | (struct usb_descriptor_header *) &hs_out_desc, | 207 | (struct usb_descriptor_header *) &hs_subset_out_desc, |
208 | NULL, | 208 | NULL, |
209 | }; | 209 | }; |
210 | 210 | ||
@@ -281,13 +281,13 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) | |||
281 | status = -ENODEV; | 281 | status = -ENODEV; |
282 | 282 | ||
283 | /* allocate instance-specific endpoints */ | 283 | /* allocate instance-specific endpoints */ |
284 | ep = usb_ep_autoconfig(cdev->gadget, &fs_in_desc); | 284 | ep = usb_ep_autoconfig(cdev->gadget, &fs_subset_in_desc); |
285 | if (!ep) | 285 | if (!ep) |
286 | goto fail; | 286 | goto fail; |
287 | geth->port.in_ep = ep; | 287 | geth->port.in_ep = ep; |
288 | ep->driver_data = cdev; /* claim */ | 288 | ep->driver_data = cdev; /* claim */ |
289 | 289 | ||
290 | ep = usb_ep_autoconfig(cdev->gadget, &fs_out_desc); | 290 | ep = usb_ep_autoconfig(cdev->gadget, &fs_subset_out_desc); |
291 | if (!ep) | 291 | if (!ep) |
292 | goto fail; | 292 | goto fail; |
293 | geth->port.out_ep = ep; | 293 | geth->port.out_ep = ep; |
@@ -297,9 +297,9 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) | |||
297 | f->descriptors = usb_copy_descriptors(fs_eth_function); | 297 | f->descriptors = usb_copy_descriptors(fs_eth_function); |
298 | 298 | ||
299 | geth->fs.in = usb_find_endpoint(fs_eth_function, | 299 | geth->fs.in = usb_find_endpoint(fs_eth_function, |
300 | f->descriptors, &fs_in_desc); | 300 | f->descriptors, &fs_subset_in_desc); |
301 | geth->fs.out = usb_find_endpoint(fs_eth_function, | 301 | geth->fs.out = usb_find_endpoint(fs_eth_function, |
302 | f->descriptors, &fs_out_desc); | 302 | f->descriptors, &fs_subset_out_desc); |
303 | 303 | ||
304 | 304 | ||
305 | /* support all relevant hardware speeds... we expect that when | 305 | /* support all relevant hardware speeds... we expect that when |
@@ -307,18 +307,18 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) | |||
307 | * both speeds | 307 | * both speeds |
308 | */ | 308 | */ |
309 | if (gadget_is_dualspeed(c->cdev->gadget)) { | 309 | if (gadget_is_dualspeed(c->cdev->gadget)) { |
310 | hs_in_desc.bEndpointAddress = | 310 | hs_subset_in_desc.bEndpointAddress = |
311 | fs_in_desc.bEndpointAddress; | 311 | fs_subset_in_desc.bEndpointAddress; |
312 | hs_out_desc.bEndpointAddress = | 312 | hs_subset_out_desc.bEndpointAddress = |
313 | fs_out_desc.bEndpointAddress; | 313 | fs_subset_out_desc.bEndpointAddress; |
314 | 314 | ||
315 | /* copy descriptors, and track endpoint copies */ | 315 | /* copy descriptors, and track endpoint copies */ |
316 | f->hs_descriptors = usb_copy_descriptors(hs_eth_function); | 316 | f->hs_descriptors = usb_copy_descriptors(hs_eth_function); |
317 | 317 | ||
318 | geth->hs.in = usb_find_endpoint(hs_eth_function, | 318 | geth->hs.in = usb_find_endpoint(hs_eth_function, |
319 | f->hs_descriptors, &hs_in_desc); | 319 | f->hs_descriptors, &hs_subset_in_desc); |
320 | geth->hs.out = usb_find_endpoint(hs_eth_function, | 320 | geth->hs.out = usb_find_endpoint(hs_eth_function, |
321 | f->hs_descriptors, &hs_out_desc); | 321 | f->hs_descriptors, &hs_subset_out_desc); |
322 | } | 322 | } |
323 | 323 | ||
324 | /* NOTE: all that is done without knowing or caring about | 324 | /* NOTE: all that is done without knowing or caring about |