diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2008-03-03 17:59:58 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2008-03-03 17:59:58 +0000 |
commit | f8a5a403013e23ef209184d06eac0146933e52b1 (patch) | |
tree | 61dc618e09723b54c8beaf70f3f5d7bbcb94facb /firmware/usbstack/usb_core.c | |
parent | c270b7a28983bd2b39c7449473a52725009c668c (diff) | |
download | rockbox-f8a5a403013e23ef209184d06eac0146933e52b1.tar.gz rockbox-f8a5a403013e23ef209184d06eac0146933e52b1.zip |
remove usb_benchmark. Its usefulness is extremely limited, and the usb stack around it is moving fast, so it's likely to suffer from bit rot very soon.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16500 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usbstack/usb_core.c')
-rw-r--r-- | firmware/usbstack/usb_core.c | 81 |
1 files changed, 1 insertions, 80 deletions
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c index 64690a1d32..a46310b4cb 100644 --- a/firmware/usbstack/usb_core.c +++ b/firmware/usbstack/usb_core.c | |||
@@ -36,10 +36,6 @@ | |||
36 | #include "usb_serial.h" | 36 | #include "usb_serial.h" |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #if defined(USB_BENCHMARK) | ||
40 | #include "usb_benchmark.h" | ||
41 | #endif | ||
42 | |||
43 | /* TODO: Move this target-specific stuff somewhere else (serial number reading) */ | 39 | /* TODO: Move this target-specific stuff somewhere else (serial number reading) */ |
44 | 40 | ||
45 | #ifdef HAVE_AS3514 | 41 | #ifdef HAVE_AS3514 |
@@ -103,7 +99,7 @@ struct usb_interface_descriptor __attribute__((aligned(2))) charging_interface_d | |||
103 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | 99 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, |
104 | .bInterfaceSubClass = 0, | 100 | .bInterfaceSubClass = 0, |
105 | .bInterfaceProtocol = 0, | 101 | .bInterfaceProtocol = 0, |
106 | .iInterface = 5 | 102 | .iInterface = 4 |
107 | }; | 103 | }; |
108 | #endif | 104 | #endif |
109 | 105 | ||
@@ -177,41 +173,6 @@ struct usb_endpoint_descriptor __attribute__((aligned(2))) serial_ep_out_descrip | |||
177 | }; | 173 | }; |
178 | #endif | 174 | #endif |
179 | 175 | ||
180 | #ifdef USB_BENCHMARK | ||
181 | /* bulk test interface */ | ||
182 | struct usb_interface_descriptor __attribute__((aligned(2))) benchmark_interface_descriptor = | ||
183 | { | ||
184 | .bLength = sizeof(struct usb_interface_descriptor), | ||
185 | .bDescriptorType = USB_DT_INTERFACE, | ||
186 | .bInterfaceNumber = 0, | ||
187 | .bAlternateSetting = 0, | ||
188 | .bNumEndpoints = 2, | ||
189 | .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | ||
190 | .bInterfaceSubClass = 255, | ||
191 | .bInterfaceProtocol = 255, | ||
192 | .iInterface = 4 | ||
193 | }; | ||
194 | |||
195 | struct usb_endpoint_descriptor __attribute__((aligned(2))) benchmark_ep_in_descriptor = | ||
196 | { | ||
197 | .bLength = sizeof(struct usb_endpoint_descriptor), | ||
198 | .bDescriptorType = USB_DT_ENDPOINT, | ||
199 | .bEndpointAddress = EP_BENCHMARK | USB_DIR_OUT, | ||
200 | .bmAttributes = USB_ENDPOINT_XFER_BULK, | ||
201 | .wMaxPacketSize = 16, | ||
202 | .bInterval = 0 | ||
203 | }; | ||
204 | struct usb_endpoint_descriptor benchmark_ep_out_descriptor = | ||
205 | { | ||
206 | .bLength = sizeof(struct usb_endpoint_descriptor), | ||
207 | .bDescriptorType = USB_DT_ENDPOINT, | ||
208 | .bEndpointAddress = EP_BENCHMARK | USB_DIR_IN, | ||
209 | .bmAttributes = USB_ENDPOINT_XFER_BULK, | ||
210 | .wMaxPacketSize = 16, | ||
211 | .bInterval = 0 | ||
212 | }; | ||
213 | #endif | ||
214 | |||
215 | static const struct usb_qualifier_descriptor __attribute__((aligned(2))) qualifier_descriptor = | 176 | static const struct usb_qualifier_descriptor __attribute__((aligned(2))) qualifier_descriptor = |
216 | { | 177 | { |
217 | .bLength = sizeof(struct usb_qualifier_descriptor), | 178 | .bLength = sizeof(struct usb_qualifier_descriptor), |
@@ -257,13 +218,6 @@ static struct usb_string_descriptor __attribute__((aligned(2))) lang_descriptor | |||
257 | {0x0409} /* LANGID US English */ | 218 | {0x0409} /* LANGID US English */ |
258 | }; | 219 | }; |
259 | 220 | ||
260 | static struct usb_string_descriptor __attribute__((aligned(2))) usb_string_usb_benchmark = | ||
261 | { | ||
262 | 40, | ||
263 | USB_DT_STRING, | ||
264 | {'B','u','l','k',' ','t','e','s','t',' ','i','n','t','e','r','f','a','c','e'} | ||
265 | }; | ||
266 | |||
267 | static struct usb_string_descriptor __attribute__((aligned(2))) usb_string_charging_only = | 221 | static struct usb_string_descriptor __attribute__((aligned(2))) usb_string_charging_only = |
268 | { | 222 | { |
269 | 28, | 223 | 28, |
@@ -277,7 +231,6 @@ static struct usb_string_descriptor* usb_strings[] = | |||
277 | &usb_string_iManufacturer, | 231 | &usb_string_iManufacturer, |
278 | &usb_string_iProduct, | 232 | &usb_string_iProduct, |
279 | &usb_string_iSerial, | 233 | &usb_string_iSerial, |
280 | &usb_string_usb_benchmark, | ||
281 | &usb_string_charging_only | 234 | &usb_string_charging_only |
282 | }; | 235 | }; |
283 | 236 | ||
@@ -293,9 +246,6 @@ bool usb_core_serial_enabled = false; | |||
293 | #ifdef USB_CHARGING_ONLY | 246 | #ifdef USB_CHARGING_ONLY |
294 | static bool usb_core_charging_enabled = false; | 247 | static bool usb_core_charging_enabled = false; |
295 | #endif | 248 | #endif |
296 | #if defined(USB_BENCHMARK) | ||
297 | static bool usb_core_benchmark_enabled = false; | ||
298 | #endif | ||
299 | 249 | ||
300 | static void usb_core_control_request_handler(struct usb_ctrlrequest* req); | 250 | static void usb_core_control_request_handler(struct usb_ctrlrequest* req); |
301 | static int ack_control(struct usb_ctrlrequest* req); | 251 | static int ack_control(struct usb_ctrlrequest* req); |
@@ -399,10 +349,6 @@ void usb_core_init(void) | |||
399 | usb_serial_init(); | 349 | usb_serial_init(); |
400 | #endif | 350 | #endif |
401 | 351 | ||
402 | #ifdef USB_BENCHMARK | ||
403 | if(usb_core_benchmark_enabled) | ||
404 | usb_benchmark_init(); | ||
405 | #endif | ||
406 | initialized = true; | 352 | initialized = true; |
407 | usb_state = DEFAULT; | 353 | usb_state = DEFAULT; |
408 | logf("usb_core_init() finished"); | 354 | logf("usb_core_init() finished"); |
@@ -439,11 +385,6 @@ void usb_core_handle_transfer_completion(struct usb_transfer_completion_event_da | |||
439 | usb_serial_transfer_complete(event->in,event->status,event->length); | 385 | usb_serial_transfer_complete(event->in,event->status,event->length); |
440 | break; | 386 | break; |
441 | #endif | 387 | #endif |
442 | #ifdef USB_BENCHMARK | ||
443 | case EP_BENCHMARK: | ||
444 | usb_benchmark_transfer_complete(event->in); | ||
445 | break; | ||
446 | #endif | ||
447 | #ifdef USB_CHARGING_ONLY | 388 | #ifdef USB_CHARGING_ONLY |
448 | case EP_CHARGING_ONLY: | 389 | case EP_CHARGING_ONLY: |
449 | break; | 390 | break; |
@@ -482,13 +423,6 @@ static void usb_core_control_request_handler(struct usb_ctrlrequest* req) | |||
482 | #endif | 423 | #endif |
483 | } | 424 | } |
484 | 425 | ||
485 | #ifdef USB_BENCHMARK | ||
486 | if ((req->bRequestType & 0x60) == USB_TYPE_VENDOR) { | ||
487 | usb_benchmark_control_request(req); | ||
488 | return; | ||
489 | } | ||
490 | #endif | ||
491 | |||
492 | switch (req->bRequest) { | 426 | switch (req->bRequest) { |
493 | case USB_REQ_SET_CONFIGURATION: | 427 | case USB_REQ_SET_CONFIGURATION: |
494 | logf("usb_core: SET_CONFIG"); | 428 | logf("usb_core: SET_CONFIG"); |
@@ -661,19 +595,6 @@ static void usb_core_control_request_handler(struct usb_ctrlrequest* req) | |||
661 | size += sizeof(struct usb_endpoint_descriptor); | 595 | size += sizeof(struct usb_endpoint_descriptor); |
662 | } | 596 | } |
663 | #endif | 597 | #endif |
664 | #ifdef USB_BENCHMARK | ||
665 | if(usb_core_benchmark_enabled){ | ||
666 | benchmark_ep_in_descriptor.wMaxPacketSize=max_packet_size; | ||
667 | benchmark_ep_out_descriptor.wMaxPacketSize=max_packet_size; | ||
668 | |||
669 | memcpy(&response_data[size],&benchmark_interface_descriptor,sizeof(struct usb_interface_descriptor)); | ||
670 | size += sizeof(struct usb_interface_descriptor); | ||
671 | memcpy(&response_data[size],&benchmark_ep_in_descriptor,sizeof(struct usb_endpoint_descriptor)); | ||
672 | size += sizeof(struct usb_endpoint_descriptor); | ||
673 | memcpy(&response_data[size],&benchmark_ep_out_descriptor,sizeof(struct usb_endpoint_descriptor)); | ||
674 | size += sizeof(struct usb_endpoint_descriptor); | ||
675 | } | ||
676 | #endif | ||
677 | #ifdef USB_CHARGING_ONLY | 598 | #ifdef USB_CHARGING_ONLY |
678 | if(usb_core_charging_enabled && interface_number == 0){ | 599 | if(usb_core_charging_enabled && interface_number == 0){ |
679 | charging_interface_descriptor.bInterfaceNumber=interface_number; | 600 | charging_interface_descriptor.bInterfaceNumber=interface_number; |