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 000000 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 000000 89 _high_speed_device_descr:: 000000 12 90 .db DSCR_DEVICE_LEN 000001 01 91 .db DSCR_DEVICE 000002 00 92 .db <0x0200 ; Specification version (LSB) 000003 02 93 .db >0x0200 ; Specification version (MSB) 000004 FF 94 .db 0xff ; device class (vendor specific) 000005 FF 95 .db 0xff ; device subclass (vendor specific) 000006 FF 96 .db 0xff ; device protocol (vendor specific) 000007 40 97 .db 64 ; bMaxPacketSize0 for endpoint 0 000008 FE 98 .db VID_FREE ; idVendor 00000A 02 100 .db PID_USRP ; idProduct 00000C 102 _usb_desc_hw_rev_binary_patch_location_0:: 00000C 00 103 .db DID_USRP ; bcdDevice 00000E 01 105 .db SI_VENDOR ; iManufacturer (string index) 00000F 02 106 .db SI_PRODUCT ; iProduct (string index) 000010 06 107 .db SI_SERIAL ; iSerial number (string index) 000011 01 108 .db 1 ; bNumConfigurations 109 110 ;;; describes the other speed (12Mb/sec) 000012 111 .even 000012 112 _high_speed_devqual_descr:: 000012 0A 113 .db DSCR_DEVQUAL_LEN 000013 06 114 .db DSCR_DEVQUAL 000014 00 115 .db <0x0200 ; bcdUSB (LSB) 000015 02 116 .db >0x0200 ; bcdUSB (MSB) 000016 FF 117 .db 0xff ; bDeviceClass 000017 FF 118 .db 0xff ; bDeviceSubClass 000018 FF 119 .db 0xff ; bDeviceProtocol 000019 40 120 .db 64 ; bMaxPacketSize0 00001A 01 121 .db 1 ; bNumConfigurations (one config at 12Mb/sec) 00001B 00 122 .db 0 ; bReserved 123 00001C 124 .even 00001C 125 _high_speed_config_descr:: 00001C 09 126 .db DSCR_CONFIG_LEN 00001D 02 127 .db DSCR_CONFIG 00001E 32 128 .db <(_high_speed_config_descr_end - _high_speed_config_descr) ; LSB 00001F 00 129 .db >(_high_speed_config_descr_end - _high_speed_config_descr) ; MSB 000020 03 130 .db 3 ; bNumInterfaces 000021 01 131 .db 1 ; bConfigurationValue 000022 00 132 .db 0 ; iConfiguration 000023 C0 133 .db 0x80 | bmSELF_POWERED ; bmAttributes 000024 00 134 .db 0 ; bMaxPower 135 136 ;; interface descriptor 0 (command & status, ep0 COMMAND) 137 000025 09 138 .db DSCR_INTRFC_LEN 000026 04 139 .db DSCR_INTRFC 000027 00 140 .db 0 ; bInterfaceNumber (zero based) 000028 00 141 .db 0 ; bAlternateSetting 000029 00 142 .db 0 ; bNumEndpoints 00002A FF 143 .db 0xff ; bInterfaceClass (vendor specific) 00002B FF 144 .db 0xff ; bInterfaceSubClass (vendor specific) 00002C FF 145 .db 0xff ; bInterfaceProtocol (vendor specific) 00002D 03 146 .db SI_COMMAND_AND_STATUS ; iInterface (description) 147 148 ;; interface descriptor 1 (transmit path, ep2 OUT BULK) 149 00002E 09 150 .db DSCR_INTRFC_LEN 00002F 04 151 .db DSCR_INTRFC 000030 01 152 .db 1 ; bInterfaceNumber (zero based) 000031 00 153 .db 0 ; bAlternateSetting 000032 01 154 .db 1 ; bNumEndpoints 000033 FF 155 .db 0xff ; bInterfaceClass (vendor specific) 000034 FF 156 .db 0xff ; bInterfaceSubClass (vendor specific) 000035 FF 157 .db 0xff ; bInterfaceProtocol (vendor specific) 000036 04 158 .db SI_TX_PATH ; iInterface (description) 159 160 ;; interface 1's end point 161 000037 07 162 .db DSCR_ENDPNT_LEN 000038 05 163 .db DSCR_ENDPNT 000039 02 164 .db 0x02 ; bEndpointAddress (ep 2 OUT) 00003A 02 165 .db ET_BULK ; bmAttributes 00003B 00 166 .db <512 ; wMaxPacketSize (LSB) 00003C 02 167 .db >512 ; wMaxPacketSize (MSB) 00003D 00 168 .db 0 ; bInterval (iso only) 169 170 ;; interface descriptor 2 (receive path, ep6 IN BULK) 171 00003E 09 172 .db DSCR_INTRFC_LEN 00003F 04 173 .db DSCR_INTRFC 000040 02 174 .db 2 ; bInterfaceNumber (zero based) 000041 00 175 .db 0 ; bAlternateSetting 000042 01 176 .db 1 ; bNumEndpoints 000043 FF 177 .db 0xff ; bInterfaceClass (vendor specific) 000044 FF 178 .db 0xff ; bInterfaceSubClass (vendor specific) 000045 FF 179 .db 0xff ; bInterfaceProtocol (vendor specific) 000046 05 180 .db SI_RX_PATH ; iInterface (description) 181 182 ;; interface 2's end point 183 000047 07 184 .db DSCR_ENDPNT_LEN 000048 05 185 .db DSCR_ENDPNT 000049 86 186 .db 0x86 ; bEndpointAddress (ep 6 IN) 00004A 02 187 .db ET_BULK ; bmAttributes 00004B 00 188 .db <512 ; wMaxPacketSize (LSB) 00004C 02 189 .db >512 ; wMaxPacketSize (MSB) 00004D 00 190 .db 0 ; bInterval (iso only) 191 00004E 192 _high_speed_config_descr_end: 193 194 ;;; ---------------------------------------------------------------- 195 ;;; descriptors used when operating at full speed (12Mb/sec) 196 ;;; ---------------------------------------------------------------- 197 00004E 198 .even 00004E 199 _full_speed_device_descr:: 00004E 12 200 .db DSCR_DEVICE_LEN 00004F 01 201 .db DSCR_DEVICE 000050 00 202 .db <0x0200 ; Specification version (LSB) 000051 02 203 .db >0x0200 ; Specification version (MSB) 000052 FF 204 .db 0xff ; device class (vendor specific) 000053 FF 205 .db 0xff ; device subclass (vendor specific) 000054 FF 206 .db 0xff ; device protocol (vendor specific) 000055 40 207 .db 64 ; bMaxPacketSize0 for endpoint 0 000056 FE 208 .db VID_FREE ; idVendor 000058 02 210 .db PID_USRP ; idProduct 00005A 212 _usb_desc_hw_rev_binary_patch_location_1:: 00005A 00 213 .db DID_USRP ; bcdDevice 00005C 01 215 .db SI_VENDOR ; iManufacturer (string index) 00005D 02 216 .db SI_PRODUCT ; iProduct (string index) 00005E 00 217 .db SI_NONE ; iSerial number (None) 00005F 01 218 .db 1 ; bNumConfigurations 219 220 221 ;;; describes the other speed (480Mb/sec) 000060 222 .even 000060 223 _full_speed_devqual_descr:: 000060 0A 224 .db DSCR_DEVQUAL_LEN 000061 06 225 .db DSCR_DEVQUAL 000062 00 226 .db <0x0200 ; bcdUSB 000063 02 227 .db >0x0200 ; bcdUSB 000064 FF 228 .db 0xff ; bDeviceClass 000065 FF 229 .db 0xff ; bDeviceSubClass 000066 FF 230 .db 0xff ; bDeviceProtocol 000067 40 231 .db 64 ; bMaxPacketSize0 000068 01 232 .db 1 ; bNumConfigurations (one config at 480Mb/sec) 000069 00 233 .db 0 ; bReserved 234 00006A 235 .even 00006A 236 _full_speed_config_descr:: 00006A 09 237 .db DSCR_CONFIG_LEN 00006B 02 238 .db DSCR_CONFIG 00006C 12 239 .db <(_full_speed_config_descr_end - _full_speed_config_descr) ; LSB 00006D 00 240 .db >(_full_speed_config_descr_end - _full_speed_config_descr) ; MSB 00006E 01 241 .db 1 ; bNumInterfaces 00006F 01 242 .db 1 ; bConfigurationValue 000070 00 243 .db 0 ; iConfiguration 000071 C0 244 .db 0x80 | bmSELF_POWERED ; bmAttributes 000072 00 245 .db 0 ; bMaxPower 246 247 ;; interface descriptor 0 (command & status, ep0 COMMAND) 248 000073 09 249 .db DSCR_INTRFC_LEN 000074 04 250 .db DSCR_INTRFC 000075 00 251 .db 0 ; bInterfaceNumber (zero based) 000076 00 252 .db 0 ; bAlternateSetting 000077 00 253 .db 0 ; bNumEndpoints 000078 FF 254 .db 0xff ; bInterfaceClass (vendor specific) 000079 FF 255 .db 0xff ; bInterfaceSubClass (vendor specific) 00007A FF 256 .db 0xff ; bInterfaceProtocol (vendor specific) 00007B 03 257 .db SI_COMMAND_AND_STATUS ; iInterface (description) 258 00007C 259 _full_speed_config_descr_end: 260 261 ;;; ---------------------------------------------------------------- 262 ;;; string descriptors 263 ;;; ---------------------------------------------------------------- 264 00007C 265 _nstring_descriptors:: 00007C 07 266 .db (_string_descriptors_end - _string_descriptors) / 2 267 00007D 268 _string_descriptors:: 00007Dr8Cs00 269 .db str0 00007Fr92s00 270 .db str1 000081rBAs00 271 .db str2 000083rD0s00 272 .db str3 000085rF2s00 273 .db str4 000087r0Es01 274 .db str5 000089r28s01 275 .db str6 00008B 276 _string_descriptors_end: 277 000000 278 SI_NONE = 0 279 ;; str0 contains the language ID's. 00008C 280 .even 00008C 06 281 str0: .db str0_end - str0 00008D 03 282 .db DSCR_STRING 00008E 00 283 .db 0 00008F 00 284 .db 0 000090 09 285 .db <0x0409 ; magic code for US English (LSB) 000091 04 286 .db >0x0409 ; magic code for US English (MSB) 000092 287 str0_end: 288 000001 289 SI_VENDOR = 1 000092 290 .even 000092 28 291 str1: .db str1_end - str1 000093 03 292 .db DSCR_STRING 000094 46 00 293 .db 'F, 0 ; 16-bit unicode 000096 72 00 294 .db 'r, 0 000098 65 00 295 .db 'e, 0 00009A 65 00 296 .db 'e, 0 00009C 20 00 297 .db ' , 0 00009E 53 00 298 .db 'S, 0 0000A0 6F 00 299 .db 'o, 0 0000A2 66 00 300 .db 'f, 0 0000A4 74 00 301 .db 't, 0 0000A6 77 00 302 .db 'w, 0 0000A8 61 00 303 .db 'a, 0 0000AA 72 00 304 .db 'r, 0 0000AC 65 00 305 .db 'e, 0 0000AE 20 00 306 .db ' , 0 0000B0 46 00 307 .db 'F, 0 0000B2 6F 00 308 .db 'o, 0 0000B4 6C 00 309 .db 'l, 0 0000B6 6B 00 310 .db 'k, 0 0000B8 73 00 311 .db 's, 0 0000BA 312 str1_end: 313 000002 314 SI_PRODUCT = 2 0000BA 315 .even 0000BA 16 316 str2: .db str2_end - str2 0000BB 03 317 .db DSCR_STRING 0000BC 55 00 318 .db 'U, 0 0000BE 53 00 319 .db 'S, 0 0000C0 52 00 320 .db 'R, 0 0000C2 50 00 321 .db 'P, 0 0000C4 20 00 322 .db ' , 0 0000C6 52 00 323 .db 'R, 0 0000C8 65 00 324 .db 'e, 0 0000CA 76 00 325 .db 'v, 0 0000CC 20 00 326 .db ' , 0 0000CE 327 _usb_desc_hw_rev_ascii_patch_location_0:: 0000CE 3F 00 328 .db '?, 0 0000D0 329 str2_end: 330 000003 331 SI_COMMAND_AND_STATUS = 3 0000D0 332 .even 0000D0 22 333 str3: .db str3_end - str3 0000D1 03 334 .db DSCR_STRING 0000D2 43 00 335 .db 'C, 0 0000D4 6F 00 336 .db 'o, 0 0000D6 6D 00 337 .db 'm, 0 0000D8 6D 00 338 .db 'm, 0 0000DA 61 00 339 .db 'a, 0 0000DC 6E 00 340 .db 'n, 0 0000DE 64 00 341 .db 'd, 0 0000E0 20 00 342 .db ' , 0 0000E2 26 00 343 .db '&, 0 0000E4 20 00 344 .db ' , 0 0000E6 53 00 345 .db 'S, 0 0000E8 74 00 346 .db 't, 0 0000EA 61 00 347 .db 'a, 0 0000EC 74 00 348 .db 't, 0 0000EE 75 00 349 .db 'u, 0 0000F0 73 00 350 .db 's, 0 0000F2 351 str3_end: 352 000004 353 SI_TX_PATH = 4 0000F2 354 .even 0000F2 1C 355 str4: .db str4_end - str4 0000F3 03 356 .db DSCR_STRING 0000F4 54 00 357 .db 'T, 0 0000F6 72 00 358 .db 'r, 0 0000F8 61 00 359 .db 'a, 0 0000FA 6E 00 360 .db 'n, 0 0000FC 73 00 361 .db 's, 0 0000FE 6D 00 362 .db 'm, 0 000100 69 00 363 .db 'i, 0 000102 74 00 364 .db 't, 0 000104 20 00 365 .db ' , 0 000106 50 00 366 .db 'P, 0 000108 61 00 367 .db 'a, 0 00010A 74 00 368 .db 't, 0 00010C 68 00 369 .db 'h, 0 00010E 370 str4_end: 371 000005 372 SI_RX_PATH = 5 00010E 373 .even 00010E 1A 374 str5: .db str5_end - str5 00010F 03 375 .db DSCR_STRING 000110 52 00 376 .db 'R, 0 000112 65 00 377 .db 'e, 0 000114 63 00 378 .db 'c, 0 000116 65 00 379 .db 'e, 0 000118 69 00 380 .db 'i, 0 00011A 76 00 381 .db 'v, 0 00011C 65 00 382 .db 'e, 0 00011E 20 00 383 .db ' , 0 000120 50 00 384 .db 'P, 0 000122 61 00 385 .db 'a, 0 000124 74 00 386 .db 't, 0 000126 68 00 387 .db 'h, 0 000128 388 str5_end: 389 000006 390 SI_SERIAL = 6 000128 391 .even 000128 12 392 str6: .db str6_end - str6 000129 03 393 .db DSCR_STRING 00012A 394 _usb_desc_serial_number_ascii:: 00012A 33 00 395 .db '3, 0 00012C 2E 00 396 .db '., 0 00012E 31 00 397 .db '1, 0 000130 34 00 398 .db '4, 0 000132 31 00 399 .db '1, 0 000134 35 00 400 .db '5, 0 000136 39 00 401 .db '9, 0 000138 33 00 402 .db '3, 0 00013A 403 str6_end: 404