File: 0082-Remove-unused-USB-configuration-for-CPLD-update.patch

package info (click to toggle)
hackrf 2015.07.2-11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 69,764 kB
  • ctags: 9,327
  • sloc: ansic: 13,907; python: 696; vhdl: 218; sh: 32; makefile: 15
file content (198 lines) | stat: -rw-r--r-- 6,557 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
From 23c44b1d6eaa6e2870b2727d3fda160857d2b1f3 Mon Sep 17 00:00:00 2001
From: Dominic Spill <dominicgs@gmail.com>
Date: Wed, 13 Jul 2016 14:38:34 +0100
Subject: [PATCH 082/111] 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 ff770b2..12d3fca 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 bffa9bf..3d496ee 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 6df358e..e7204ad 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,
 };
 
-- 
2.1.4