From 23c44b1d6eaa6e2870b2727d3fda160857d2b1f3 Mon Sep 17 00:00:00 2001 From: Dominic Spill Date: Wed, 13 Jul 2016 14:38:34 +0100 Subject: [PATCH] Remove unused USB configuration for CPLD update --- firmware/hackrf_usb/usb_descriptor.c | 97 ++-------------------------- firmware/hackrf_usb/usb_descriptor.h | 2 - firmware/hackrf_usb/usb_device.c | 13 ---- 3 files changed, 4 insertions(+), 108 deletions(-) diff --git a/firmware/hackrf_usb/usb_descriptor.c b/firmware/hackrf_usb/usb_descriptor.c index ff770b24..12d3fcab 100644 --- a/firmware/hackrf_usb/usb_descriptor.c +++ b/firmware/hackrf_usb/usb_descriptor.c @@ -58,7 +58,7 @@ uint8_t usb_descriptor_device[] = { USB_WORD(0x0100), // bcdDevice 0x01, // iManufacturer 0x02, // iProduct - 0x05, // iSerialNumber + 0x04, // iSerialNumber 0x02 // bNumConfigurations }; @@ -70,7 +70,7 @@ uint8_t usb_descriptor_device_qualifier[] = { 0x00, // bDeviceSubClass 0x00, // bDeviceProtocol 64, // bMaxPacketSize0 - 0x02, // bNumOtherSpeedConfigurations + 0x01, // bNumOtherSpeedConfigurations 0x00 // bReserved }; @@ -148,79 +148,6 @@ uint8_t usb_descriptor_configuration_high_speed[] = { 0, // TERMINATOR }; -uint8_t usb_descriptor_configuration_cpld_update_full_speed[] = { - 9, // bLength - USB_DESCRIPTOR_TYPE_CONFIGURATION, // bDescriptorType - USB_WORD(32), // wTotalLength - 0x01, // bNumInterfaces - 0x02, // bConfigurationValue - 0x04, // iConfiguration - 0x80, // bmAttributes: USB-powered - 250, // bMaxPower: 500mA - - 9, // bLength - USB_DESCRIPTOR_TYPE_INTERFACE, // bDescriptorType - 0x00, // bInterfaceNumber - 0x00, // bAlternateSetting - 0x02, // bNumEndpoints - 0xFF, // bInterfaceClass: vendor-specific - 0xFF, // bInterfaceSubClass - 0xFF, // bInterfaceProtocol: vendor-specific - 0x00, // iInterface - - 7, // bLength - USB_DESCRIPTOR_TYPE_ENDPOINT, // bDescriptorType - USB_BULK_IN_EP_ADDR, // bEndpointAddress - 0x02, // bmAttributes: BULK - USB_WORD(USB_MAX_PACKET_BULK_FS), // wMaxPacketSize - 0x00, // bInterval: no NAK - - 7, // bLength - USB_DESCRIPTOR_TYPE_ENDPOINT, // bDescriptorType - USB_BULK_OUT_EP_ADDR, // bEndpointAddress - 0x02, // bmAttributes: BULK - USB_WORD(USB_MAX_PACKET_BULK_FS), // wMaxPacketSize - 0x00, // bInterval: no NAK - - 0, // TERMINATOR -}; - -uint8_t usb_descriptor_configuration_cpld_update_high_speed[] = { - 9, // bLength - USB_DESCRIPTOR_TYPE_CONFIGURATION, // bDescriptorType - USB_WORD(32), // wTotalLength - 0x01, // bNumInterfaces - 0x02, // bConfigurationValue - 0x04, // iConfiguration - 0x80, // bmAttributes: USB-powered - 250, // bMaxPower: 500mA - - 9, // bLength - USB_DESCRIPTOR_TYPE_INTERFACE, // bDescriptorType - 0x00, // bInterfaceNumber - 0x00, // bAlternateSetting - 0x02, // bNumEndpoints - 0xFF, // bInterfaceClass: vendor-specific - 0xFF, // bInterfaceSubClass - 0xFF, // bInterfaceProtocol: vendor-specific - 0x00, // iInterface - - 7, // bLength - USB_DESCRIPTOR_TYPE_ENDPOINT, // bDescriptorType - USB_BULK_IN_EP_ADDR, // bEndpointAddress - 0x02, // bmAttributes: BULK - USB_WORD(USB_MAX_PACKET_BULK_HS), // wMaxPacketSize - 0x00, // bInterval: no NAK - - 7, // bLength - USB_DESCRIPTOR_TYPE_ENDPOINT, // bDescriptorType - USB_BULK_OUT_EP_ADDR, // bEndpointAddress - 0x02, // bmAttributes: BULK - USB_WORD(USB_MAX_PACKET_BULK_HS), // wMaxPacketSize - 0x00, // bInterval: no NAK - - 0, // TERMINATOR -}; uint8_t usb_descriptor_string_languages[] = { 0x04, // bLength @@ -298,7 +225,7 @@ uint8_t usb_descriptor_string_product[] = { #endif }; -uint8_t usb_descriptor_string_config1_description[] = { +uint8_t usb_descriptor_string_config_description[] = { 24, // bLength USB_DESCRIPTOR_TYPE_STRING, // bDescriptorType 'T', 0x00, @@ -314,21 +241,6 @@ uint8_t usb_descriptor_string_config1_description[] = { 'r', 0x00, }; -uint8_t usb_descriptor_string_config2_description[] = { - 24, // bLength - USB_DESCRIPTOR_TYPE_STRING, // bDescriptorType - 'C', 0x00, - 'P', 0x00, - 'L', 0x00, - 'D', 0x00, - ' ', 0x00, - 'u', 0x00, - 'p', 0x00, - 'd', 0x00, - 'a', 0x00, - 't', 0x00, - 'e', 0x00, -}; uint8_t usb_descriptor_string_serial_number[USB_DESCRIPTOR_STRING_SERIAL_BUF_LEN]; @@ -336,8 +248,7 @@ uint8_t* usb_descriptor_strings[] = { usb_descriptor_string_languages, usb_descriptor_string_manufacturer, usb_descriptor_string_product, - usb_descriptor_string_config1_description, - usb_descriptor_string_config2_description, + usb_descriptor_string_config_description, usb_descriptor_string_serial_number, 0, // TERMINATOR }; diff --git a/firmware/hackrf_usb/usb_descriptor.h b/firmware/hackrf_usb/usb_descriptor.h index bffa9bf7..3d496ee0 100644 --- a/firmware/hackrf_usb/usb_descriptor.h +++ b/firmware/hackrf_usb/usb_descriptor.h @@ -25,8 +25,6 @@ extern uint8_t usb_descriptor_device[]; extern uint8_t usb_descriptor_device_qualifier[]; extern uint8_t usb_descriptor_configuration_full_speed[]; extern uint8_t usb_descriptor_configuration_high_speed[]; -extern uint8_t usb_descriptor_configuration_cpld_update_full_speed[]; -extern uint8_t usb_descriptor_configuration_cpld_update_high_speed[]; extern uint8_t usb_descriptor_string_languages[]; extern uint8_t usb_descriptor_string_manufacturer[]; extern uint8_t usb_descriptor_string_product[]; diff --git a/firmware/hackrf_usb/usb_device.c b/firmware/hackrf_usb/usb_device.c index 6df358ed..e7204ad3 100644 --- a/firmware/hackrf_usb/usb_device.c +++ b/firmware/hackrf_usb/usb_device.c @@ -38,23 +38,10 @@ usb_configuration_t usb_configuration_full_speed = { .descriptor = usb_descriptor_configuration_full_speed, }; -usb_configuration_t usb_configuration_cpld_update_full_speed = { - .number = 2, - .speed = USB_SPEED_FULL, - .descriptor = usb_descriptor_configuration_cpld_update_full_speed, -}; - -usb_configuration_t usb_configuration_cpld_update_high_speed = { - .number = 2, - .speed = USB_SPEED_HIGH, - .descriptor = usb_descriptor_configuration_cpld_update_high_speed, -}; usb_configuration_t* usb_configurations[] = { &usb_configuration_high_speed, &usb_configuration_full_speed, - &usb_configuration_cpld_update_full_speed, - &usb_configuration_cpld_update_high_speed, 0, };