From f8a5a403013e23ef209184d06eac0146933e52b1 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Mon, 3 Mar 2008 17:59:58 +0000 Subject: 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 --- firmware/usbstack/usb_core.c | 81 +------------------------------------------- 1 file changed, 1 insertion(+), 80 deletions(-) (limited to 'firmware/usbstack/usb_core.c') 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 @@ #include "usb_serial.h" #endif -#if defined(USB_BENCHMARK) -#include "usb_benchmark.h" -#endif - /* TODO: Move this target-specific stuff somewhere else (serial number reading) */ #ifdef HAVE_AS3514 @@ -103,7 +99,7 @@ struct usb_interface_descriptor __attribute__((aligned(2))) charging_interface_d .bInterfaceClass = USB_CLASS_VENDOR_SPEC, .bInterfaceSubClass = 0, .bInterfaceProtocol = 0, - .iInterface = 5 + .iInterface = 4 }; #endif @@ -177,41 +173,6 @@ struct usb_endpoint_descriptor __attribute__((aligned(2))) serial_ep_out_descrip }; #endif -#ifdef USB_BENCHMARK -/* bulk test interface */ -struct usb_interface_descriptor __attribute__((aligned(2))) benchmark_interface_descriptor = -{ - .bLength = sizeof(struct usb_interface_descriptor), - .bDescriptorType = USB_DT_INTERFACE, - .bInterfaceNumber = 0, - .bAlternateSetting = 0, - .bNumEndpoints = 2, - .bInterfaceClass = USB_CLASS_VENDOR_SPEC, - .bInterfaceSubClass = 255, - .bInterfaceProtocol = 255, - .iInterface = 4 -}; - -struct usb_endpoint_descriptor __attribute__((aligned(2))) benchmark_ep_in_descriptor = -{ - .bLength = sizeof(struct usb_endpoint_descriptor), - .bDescriptorType = USB_DT_ENDPOINT, - .bEndpointAddress = EP_BENCHMARK | USB_DIR_OUT, - .bmAttributes = USB_ENDPOINT_XFER_BULK, - .wMaxPacketSize = 16, - .bInterval = 0 -}; -struct usb_endpoint_descriptor benchmark_ep_out_descriptor = -{ - .bLength = sizeof(struct usb_endpoint_descriptor), - .bDescriptorType = USB_DT_ENDPOINT, - .bEndpointAddress = EP_BENCHMARK | USB_DIR_IN, - .bmAttributes = USB_ENDPOINT_XFER_BULK, - .wMaxPacketSize = 16, - .bInterval = 0 -}; -#endif - static const struct usb_qualifier_descriptor __attribute__((aligned(2))) qualifier_descriptor = { .bLength = sizeof(struct usb_qualifier_descriptor), @@ -257,13 +218,6 @@ static struct usb_string_descriptor __attribute__((aligned(2))) lang_descriptor {0x0409} /* LANGID US English */ }; -static struct usb_string_descriptor __attribute__((aligned(2))) usb_string_usb_benchmark = -{ - 40, - USB_DT_STRING, - {'B','u','l','k',' ','t','e','s','t',' ','i','n','t','e','r','f','a','c','e'} -}; - static struct usb_string_descriptor __attribute__((aligned(2))) usb_string_charging_only = { 28, @@ -277,7 +231,6 @@ static struct usb_string_descriptor* usb_strings[] = &usb_string_iManufacturer, &usb_string_iProduct, &usb_string_iSerial, - &usb_string_usb_benchmark, &usb_string_charging_only }; @@ -293,9 +246,6 @@ bool usb_core_serial_enabled = false; #ifdef USB_CHARGING_ONLY static bool usb_core_charging_enabled = false; #endif -#if defined(USB_BENCHMARK) -static bool usb_core_benchmark_enabled = false; -#endif static void usb_core_control_request_handler(struct usb_ctrlrequest* req); static int ack_control(struct usb_ctrlrequest* req); @@ -399,10 +349,6 @@ void usb_core_init(void) usb_serial_init(); #endif -#ifdef USB_BENCHMARK - if(usb_core_benchmark_enabled) - usb_benchmark_init(); -#endif initialized = true; usb_state = DEFAULT; logf("usb_core_init() finished"); @@ -439,11 +385,6 @@ void usb_core_handle_transfer_completion(struct usb_transfer_completion_event_da usb_serial_transfer_complete(event->in,event->status,event->length); break; #endif -#ifdef USB_BENCHMARK - case EP_BENCHMARK: - usb_benchmark_transfer_complete(event->in); - break; -#endif #ifdef USB_CHARGING_ONLY case EP_CHARGING_ONLY: break; @@ -482,13 +423,6 @@ static void usb_core_control_request_handler(struct usb_ctrlrequest* req) #endif } -#ifdef USB_BENCHMARK - if ((req->bRequestType & 0x60) == USB_TYPE_VENDOR) { - usb_benchmark_control_request(req); - return; - } -#endif - switch (req->bRequest) { case USB_REQ_SET_CONFIGURATION: logf("usb_core: SET_CONFIG"); @@ -661,19 +595,6 @@ static void usb_core_control_request_handler(struct usb_ctrlrequest* req) size += sizeof(struct usb_endpoint_descriptor); } #endif -#ifdef USB_BENCHMARK - if(usb_core_benchmark_enabled){ - benchmark_ep_in_descriptor.wMaxPacketSize=max_packet_size; - benchmark_ep_out_descriptor.wMaxPacketSize=max_packet_size; - - memcpy(&response_data[size],&benchmark_interface_descriptor,sizeof(struct usb_interface_descriptor)); - size += sizeof(struct usb_interface_descriptor); - memcpy(&response_data[size],&benchmark_ep_in_descriptor,sizeof(struct usb_endpoint_descriptor)); - size += sizeof(struct usb_endpoint_descriptor); - memcpy(&response_data[size],&benchmark_ep_out_descriptor,sizeof(struct usb_endpoint_descriptor)); - size += sizeof(struct usb_endpoint_descriptor); - } -#endif #ifdef USB_CHARGING_ONLY if(usb_core_charging_enabled && interface_number == 0){ charging_interface_descriptor.bInterfaceNumber=interface_number; -- cgit v1.2.3