1 ;;; -*- asm -*- 2 ;;; 3 ;;; Copyright 2003 Free Software Foundation, Inc. 4 ;;; 5 ;;; This file is part of GNU Radio 6 ;;; 7 ;;; GNU Radio is free software; you can redistribute it and/or modify 8 ;;; it under the terms of the GNU General Public License as published by 9 ;;; the Free Software Foundation; either version 3, or (at your option) 10 ;;; any later version. 11 ;;; 12 ;;; GNU Radio is distributed in the hope that it will be useful, 13 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ;;; GNU General Public License for more details. 16 ;;; 17 ;;; You should have received a copy of the GNU General Public License 18 ;;; along with GNU Radio; see the file COPYING. If not, write to 19 ;;; the Free Software Foundation, Inc., 51 Franklin Street, 20 ;;; Boston, MA 02110-1301, USA. 21 ;;; 22 23 ;;; USB Descriptor table for the USRP 24 ;;; 25 ;;; We're a high-speed only device (480 Mb/sec) with 1 configuration 26 ;;; and 3 interfaces. 27 ;;; 28 ;;; interface 0: command and status (ep0 COMMAND) 29 ;;; interface 1: Transmit path (ep2 OUT BULK) 30 ;;; interface 2: Receive path (ep6 IN BULK) 31 32 .module usb_descriptors 33 00FFFE 34 VID_FREE = 0xfffe ; Free Software Folks 000002 35 PID_USRP = 0x0002 ; USRP 36 37 ;; We distinguish configured from unconfigured USRPs using the Device ID. 38 ;; If the MSB of the DID is 0, the device is unconfigured. 39 ;; The LSB of the DID is reserved for hardware revs. 40 000100 41 DID_USRP = 0x0100 ; Device ID (bcd) 42 43 000001 44 DSCR_DEVICE = 1 ; Descriptor type: Device 000002 45 DSCR_CONFIG = 2 ; Descriptor type: Configuration 000003 46 DSCR_STRING = 3 ; Descriptor type: String 000004 47 DSCR_INTRFC = 4 ; Descriptor type: Interface 000005 48 DSCR_ENDPNT = 5 ; Descriptor type: Endpoint 000006 49 DSCR_DEVQUAL = 6 ; Descriptor type: Device Qualifier 50 000012 51 DSCR_DEVICE_LEN = 18 000009 52 DSCR_CONFIG_LEN = 9 000009 53 DSCR_INTRFC_LEN = 9 000007 54 DSCR_ENDPNT_LEN = 7 00000A 55 DSCR_DEVQUAL_LEN = 10 56 000000 57 ET_CONTROL = 0 ; Endpoint type: Control 000001 58 ET_ISO = 1 ; Endpoint type: Isochronous 000002 59 ET_BULK = 2 ; Endpoint type: Bulk 000003 60 ET_INT = 3 ; Endpoint type: Interrupt 61 62 63 ;; configuration attributes 000040 64 bmSELF_POWERED = 1 << 6 65 66 ;;; -------------------------------------------------------- 67 ;;; external ram data 68 ;;;-------------------------------------------------------- 69 70 .area USBDESCSEG (XDATA) 71 72 ;;; ---------------------------------------------------------------- 73 ;;; descriptors used when operating at high speed (480Mb/sec) 74 ;;; ---------------------------------------------------------------- 75 00E000 76 .even ; descriptors must be 2-byte aligned for SUDPTR{H,L} to work 77 78 ;; The .even directive isn't really honored by the linker. Bummer! 79 ;; (There's no way to specify an alignment requirement for a given area, 80 ;; hence when they're concatenated together, even doesn't work.) 81 ;; 82 ;; We work around this by telling the linker to put USBDESCSEG 83 ;; at 0xE000 absolute. This means that the maximimum length of this 84 ;; segment is 480 bytes, leaving room for the two hash slots 85 ;; at 0xE1EO to 0xE1FF. 86 ;; 87 ;; As of July 7, 2004, this segment is 326 bytes long 88 00E000 89 _high_speed_device_descr:: 00E000 12 90 .db DSCR_DEVICE_LEN 00E001 01 91 .db DSCR_DEVICE 00E002 00 92 .db <0x0200 ; Specification version (LSB) 00E003 02 93 .db >0x0200 ; Specification version (MSB) 00E004 FF 94 .db 0xff ; device class (vendor specific) 00E005 FF 95 .db 0xff ; device subclass (vendor specific) 00E006 FF 96 .db 0xff ; device protocol (vendor specific) 00E007 40 97 .db 64 ; bMaxPacketSize0 for endpoint 0 00E008 FE 98 .db VID_FREE ; idVendor 00E00A 02 100 .db PID_USRP ; idProduct 00E00C 102 _usb_desc_hw_rev_binary_patch_location_0:: 00E00C 00 103 .db DID_USRP ; bcdDevice 00E00E 01 105 .db SI_VENDOR ; iManufacturer (string index) 00E00F 02 106 .db SI_PRODUCT ; iProduct (string index) 00E010 06 107 .db SI_SERIAL ; iSerial number (string index) 00E011 01 108 .db 1 ; bNumConfigurations 109 110 ;;; describes the other speed (12Mb/sec) 00E012 111 .even 00E012 112 _high_speed_devqual_descr:: 00E012 0A 113 .db DSCR_DEVQUAL_LEN 00E013 06 114 .db DSCR_DEVQUAL 00E014 00 115 .db <0x0200 ; bcdUSB (LSB) 00E015 02 116 .db >0x0200 ; bcdUSB (MSB) 00E016 FF 117 .db 0xff ; bDeviceClass 00E017 FF 118 .db 0xff ; bDeviceSubClass 00E018 FF 119 .db 0xff ; bDeviceProtocol 00E019 40 120 .db 64 ; bMaxPacketSize0 00E01A 01 121 .db 1 ; bNumConfigurations (one config at 12Mb/sec) 00E01B 00 122 .db 0 ; bReserved 123 00E01C 124 .even 00E01C 125 _high_speed_config_descr:: 00E01C 09 126 .db DSCR_CONFIG_LEN 00E01D 02 127 .db DSCR_CONFIG 00E01E 32 128 .db <(_high_speed_config_descr_end - _high_speed_config_descr) ; LSB 00E01F 00 129 .db >(_high_speed_config_descr_end - _high_speed_config_descr) ; MSB 00E020 03 130 .db 3 ; bNumInterfaces 00E021 01 131 .db 1 ; bConfigurationValue 00E022 00 132 .db 0 ; iConfiguration 00E023 C0 133 .db 0x80 | bmSELF_POWERED ; bmAttributes 00E024 00 134 .db 0 ; bMaxPower 135 136 ;; interface descriptor 0 (command & status, ep0 COMMAND) 137 00E025 09 138 .db DSCR_INTRFC_LEN 00E026 04 139 .db DSCR_INTRFC 00E027 00 140 .db 0 ; bInterfaceNumber (zero based) 00E028 00 141 .db 0 ; bAlternateSetting 00E029 00 142 .db 0 ; bNumEndpoints 00E02A FF 143 .db 0xff ; bInterfaceClass (vendor specific) 00E02B FF 144 .db 0xff ; bInterfaceSubClass (vendor specific) 00E02C FF 145 .db 0xff ; bInterfaceProtocol (vendor specific) 00E02D 03 146 .db SI_COMMAND_AND_STATUS ; iInterface (description) 147 148 ;; interface descriptor 1 (transmit path, ep2 OUT BULK) 149 00E02E 09 150 .db DSCR_INTRFC_LEN 00E02F 04 151 .db DSCR_INTRFC 00E030 01 152 .db 1 ; bInterfaceNumber (zero based) 00E031 00 153 .db 0 ; bAlternateSetting 00E032 01 154 .db 1 ; bNumEndpoints 00E033 FF 155 .db 0xff ; bInterfaceClass (vendor specific) 00E034 FF 156 .db 0xff ; bInterfaceSubClass (vendor specific) 00E035 FF 157 .db 0xff ; bInterfaceProtocol (vendor specific) 00E036 04 158 .db SI_TX_PATH ; iInterface (description) 159 160 ;; interface 1's end point 161 00E037 07 162 .db DSCR_ENDPNT_LEN 00E038 05 163 .db DSCR_ENDPNT 00E039 02 164 .db 0x02 ; bEndpointAddress (ep 2 OUT) 00E03A 02 165 .db ET_BULK ; bmAttributes 00E03B 00 166 .db <512 ; wMaxPacketSize (LSB) 00E03C 02 167 .db >512 ; wMaxPacketSize (MSB) 00E03D 00 168 .db 0 ; bInterval (iso only) 169 170 ;; interface descriptor 2 (receive path, ep6 IN BULK) 171 00E03E 09 172 .db DSCR_INTRFC_LEN 00E03F 04 173 .db DSCR_INTRFC 00E040 02 174 .db 2 ; bInterfaceNumber (zero based) 00E041 00 175 .db 0 ; bAlternateSetting 00E042 01 176 .db 1 ; bNumEndpoints 00E043 FF 177 .db 0xff ; bInterfaceClass (vendor specific) 00E044 FF 178 .db 0xff ; bInterfaceSubClass (vendor specific) 00E045 FF 179 .db 0xff ; bInterfaceProtocol (vendor specific) 00E046 05 180 .db SI_RX_PATH ; iInterface (description) 181 182 ;; interface 2's end point 183 00E047 07 184 .db DSCR_ENDPNT_LEN 00E048 05 185 .db DSCR_ENDPNT 00E049 86 186 .db 0x86 ; bEndpointAddress (ep 6 IN) 00E04A 02 187 .db ET_BULK ; bmAttributes 00E04B 00 188 .db <512 ; wMaxPacketSize (LSB) 00E04C 02 189 .db >512 ; wMaxPacketSize (MSB) 00E04D 00 190 .db 0 ; bInterval (iso only) 191 00E04E 192 _high_speed_config_descr_end: 193 194 ;;; ---------------------------------------------------------------- 195 ;;; descriptors used when operating at full speed (12Mb/sec) 196 ;;; ---------------------------------------------------------------- 197 00E04E 198 .even 00E04E 199 _full_speed_device_descr:: 00E04E 12 200 .db DSCR_DEVICE_LEN 00E04F 01 201 .db DSCR_DEVICE 00E050 00 202 .db <0x0200 ; Specification version (LSB) 00E051 02 203 .db >0x0200 ; Specification version (MSB) 00E052 FF 204 .db 0xff ; device class (vendor specific) 00E053 FF 205 .db 0xff ; device subclass (vendor specific) 00E054 FF 206 .db 0xff ; device protocol (vendor specific) 00E055 40 207 .db 64 ; bMaxPacketSize0 for endpoint 0 00E056 FE 208 .db VID_FREE ; idVendor 00E058 02 210 .db PID_USRP ; idProduct 00E05A 212 _usb_desc_hw_rev_binary_patch_location_1:: 00E05A 00 213 .db DID_USRP ; bcdDevice 00E05C 01 215 .db SI_VENDOR ; iManufacturer (string index) 00E05D 02 216 .db SI_PRODUCT ; iProduct (string index) 00E05E 00 217 .db SI_NONE ; iSerial number (None) 00E05F 01 218 .db 1 ; bNumConfigurations 219 220 221 ;;; describes the other speed (480Mb/sec) 00E060 222 .even 00E060 223 _full_speed_devqual_descr:: 00E060 0A 224 .db DSCR_DEVQUAL_LEN 00E061 06 225 .db DSCR_DEVQUAL 00E062 00 226 .db <0x0200 ; bcdUSB 00E063 02 227 .db >0x0200 ; bcdUSB 00E064 FF 228 .db 0xff ; bDeviceClass 00E065 FF 229 .db 0xff ; bDeviceSubClass 00E066 FF 230 .db 0xff ; bDeviceProtocol 00E067 40 231 .db 64 ; bMaxPacketSize0 00E068 01 232 .db 1 ; bNumConfigurations (one config at 480Mb/sec) 00E069 00 233 .db 0 ; bReserved 234 00E06A 235 .even 00E06A 236 _full_speed_config_descr:: 00E06A 09 237 .db DSCR_CONFIG_LEN 00E06B 02 238 .db DSCR_CONFIG 00E06C 12 239 .db <(_full_speed_config_descr_end - _full_speed_config_descr) ; LSB 00E06D 00 240 .db >(_full_speed_config_descr_end - _full_speed_config_descr) ; MSB 00E06E 01 241 .db 1 ; bNumInterfaces 00E06F 01 242 .db 1 ; bConfigurationValue 00E070 00 243 .db 0 ; iConfiguration 00E071 C0 244 .db 0x80 | bmSELF_POWERED ; bmAttributes 00E072 00 245 .db 0 ; bMaxPower 246 247 ;; interface descriptor 0 (command & status, ep0 COMMAND) 248 00E073 09 249 .db DSCR_INTRFC_LEN 00E074 04 250 .db DSCR_INTRFC 00E075 00 251 .db 0 ; bInterfaceNumber (zero based) 00E076 00 252 .db 0 ; bAlternateSetting 00E077 00 253 .db 0 ; bNumEndpoints 00E078 FF 254 .db 0xff ; bInterfaceClass (vendor specific) 00E079 FF 255 .db 0xff ; bInterfaceSubClass (vendor specific) 00E07A FF 256 .db 0xff ; bInterfaceProtocol (vendor specific) 00E07B 03 257 .db SI_COMMAND_AND_STATUS ; iInterface (description) 258 00E07C 259 _full_speed_config_descr_end: 260 261 ;;; ---------------------------------------------------------------- 262 ;;; string descriptors 263 ;;; ---------------------------------------------------------------- 264 00E07C 265 _nstring_descriptors:: 00E07C 07 266 .db (_string_descriptors_end - _string_descriptors) / 2 267 00E07D 268 _string_descriptors:: 00E07D 8C E0 269 .db str0 00E07F 92 E0 270 .db str1 00E081 BA E0 271 .db str2 00E083 D0 E0 272 .db str3 00E085 F2 E0 273 .db str4 00E087 0E E1 274 .db str5 00E089 28 E1 275 .db str6 00E08B 276 _string_descriptors_end: 277 000000 278 SI_NONE = 0 279 ;; str0 contains the language ID's. 00E08C 280 .even 00E08C 06 281 str0: .db str0_end - str0 00E08D 03 282 .db DSCR_STRING 00E08E 00 283 .db 0 00E08F 00 284 .db 0 00E090 09 285 .db <0x0409 ; magic code for US English (LSB) 00E091 04 286 .db >0x0409 ; magic code for US English (MSB) 00E092 287 str0_end: 288 000001 289 SI_VENDOR = 1 00E092 290 .even 00E092 28 291 str1: .db str1_end - str1 00E093 03 292 .db DSCR_STRING 00E094 46 00 293 .db 'F, 0 ; 16-bit unicode 00E096 72 00 294 .db 'r, 0 00E098 65 00 295 .db 'e, 0 00E09A 65 00 296 .db 'e, 0 00E09C 20 00 297 .db ' , 0 00E09E 53 00 298 .db 'S, 0 00E0A0 6F 00 299 .db 'o, 0 00E0A2 66 00 300 .db 'f, 0 00E0A4 74 00 301 .db 't, 0 00E0A6 77 00 302 .db 'w, 0 00E0A8 61 00 303 .db 'a, 0 00E0AA 72 00 304 .db 'r, 0 00E0AC 65 00 305 .db 'e, 0 00E0AE 20 00 306 .db ' , 0 00E0B0 46 00 307 .db 'F, 0 00E0B2 6F 00 308 .db 'o, 0 00E0B4 6C 00 309 .db 'l, 0 00E0B6 6B 00 310 .db 'k, 0 00E0B8 73 00 311 .db 's, 0 00E0BA 312 str1_end: 313 000002 314 SI_PRODUCT = 2 00E0BA 315 .even 00E0BA 16 316 str2: .db str2_end - str2 00E0BB 03 317 .db DSCR_STRING 00E0BC 55 00 318 .db 'U, 0 00E0BE 53 00 319 .db 'S, 0 00E0C0 52 00 320 .db 'R, 0 00E0C2 50 00 321 .db 'P, 0 00E0C4 20 00 322 .db ' , 0 00E0C6 52 00 323 .db 'R, 0 00E0C8 65 00 324 .db 'e, 0 00E0CA 76 00 325 .db 'v, 0 00E0CC 20 00 326 .db ' , 0 00E0CE 327 _usb_desc_hw_rev_ascii_patch_location_0:: 00E0CE 3F 00 328 .db '?, 0 00E0D0 329 str2_end: 330 000003 331 SI_COMMAND_AND_STATUS = 3 00E0D0 332 .even 00E0D0 22 333 str3: .db str3_end - str3 00E0D1 03 334 .db DSCR_STRING 00E0D2 43 00 335 .db 'C, 0 00E0D4 6F 00 336 .db 'o, 0 00E0D6 6D 00 337 .db 'm, 0 00E0D8 6D 00 338 .db 'm, 0 00E0DA 61 00 339 .db 'a, 0 00E0DC 6E 00 340 .db 'n, 0 00E0DE 64 00 341 .db 'd, 0 00E0E0 20 00 342 .db ' , 0 00E0E2 26 00 343 .db '&, 0 00E0E4 20 00 344 .db ' , 0 00E0E6 53 00 345 .db 'S, 0 00E0E8 74 00 346 .db 't, 0 00E0EA 61 00 347 .db 'a, 0 00E0EC 74 00 348 .db 't, 0 00E0EE 75 00 349 .db 'u, 0 00E0F0 73 00 350 .db 's, 0 00E0F2 351 str3_end: 352 000004 353 SI_TX_PATH = 4 00E0F2 354 .even 00E0F2 1C 355 str4: .db str4_end - str4 00E0F3 03 356 .db DSCR_STRING 00E0F4 54 00 357 .db 'T, 0 00E0F6 72 00 358 .db 'r, 0 00E0F8 61 00 359 .db 'a, 0 00E0FA 6E 00 360 .db 'n, 0 00E0FC 73 00 361 .db 's, 0 00E0FE 6D 00 362 .db 'm, 0 00E100 69 00 363 .db 'i, 0 00E102 74 00 364 .db 't, 0 00E104 20 00 365 .db ' , 0 00E106 50 00 366 .db 'P, 0 00E108 61 00 367 .db 'a, 0 00E10A 74 00 368 .db 't, 0 00E10C 68 00 369 .db 'h, 0 00E10E 370 str4_end: 371 000005 372 SI_RX_PATH = 5 00E10E 373 .even 00E10E 1A 374 str5: .db str5_end - str5 00E10F 03 375 .db DSCR_STRING 00E110 52 00 376 .db 'R, 0 00E112 65 00 377 .db 'e, 0 00E114 63 00 378 .db 'c, 0 00E116 65 00 379 .db 'e, 0 00E118 69 00 380 .db 'i, 0 00E11A 76 00 381 .db 'v, 0 00E11C 65 00 382 .db 'e, 0 00E11E 20 00 383 .db ' , 0 00E120 50 00 384 .db 'P, 0 00E122 61 00 385 .db 'a, 0 00E124 74 00 386 .db 't, 0 00E126 68 00 387 .db 'h, 0 00E128 388 str5_end: 389 000006 390 SI_SERIAL = 6 00E128 391 .even 00E128 12 392 str6: .db str6_end - str6 00E129 03 393 .db DSCR_STRING 00E12A 394 _usb_desc_serial_number_ascii:: 00E12A 33 00 395 .db '3, 0 00E12C 2E 00 396 .db '., 0 00E12E 31 00 397 .db '1, 0 00E130 34 00 398 .db '4, 0 00E132 31 00 399 .db '1, 0 00E134 35 00 400 .db '5, 0 00E136 39 00 401 .db '9, 0 00E138 33 00 402 .db '3, 0 00E13A 403 str6_end: 404