]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - include/dscr.inc
Use per-device USB serial number strings.
[sigrok-firmware-fx2lafw.git] / include / dscr.inc
index 5d0f0597514f74f4c37ae54c9bcc4c284babb7be..9f53fa502091ab5e620810f9bf68ee752503274f 100644 (file)
@@ -19,6 +19,8 @@
 ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ;;
 
+.include "common.inc"
+
 .module DEV_DSCR
 
 ; Descriptor types
@@ -58,7 +60,7 @@ _dev_dscr:
        .dw     0x0100                  ; Product version (0.01)
        .db     1                       ; Manufacturer string index
        .db     2                       ; Product string index
-       .db     0                       ; Serial number string index (none)
+       .db     3                       ; Serial number string index (none)
        .db     1                       ; Number of configurations
 dev_dscr_end:
 
@@ -111,7 +113,7 @@ highspd_dscr_end:
        .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
        .db     0x00                    ; Max. packet size, LSB (512 bytes)
        .db     0x02                    ; Max. packet size, MSB (512 bytes)
-       .db     0x00                    ; Polling interval
+       .db     0x00                    ; Polling interval (ignored for bulk)
 
 highspd_dscr_realend:
 
@@ -151,7 +153,7 @@ fullspd_dscr_end:
        .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
        .db     0x40                    ; Max. packet size, LSB (64 bytes)
        .db     0x00                    ; Max. packet size, MSB (64 bytes)
-       .db     0x00                    ; Polling interval
+       .db     0x00                    ; Polling interval (ignored for bulk)
 
 fullspd_dscr_realend:
 
@@ -164,48 +166,7 @@ fullspd_dscr_realend:
 _dev_strings:
 
 ; See http://www.usb.org/developers/docs/USB_LANGIDs.pdf for the full list.
-_string0:
-       .db     string0end - _string0
-       .db     DSCR_STRING_TYPE
-       .db     0x09, 0x04              ; Language code 0x0409 (English, US)
-string0end:
-
-_string1:
-       .db     string1end - _string1
-       .db     DSCR_STRING_TYPE
-       .ascii  's'
-       .db     0
-       .ascii  'i'
-       .db     0
-       .ascii  'g'
-       .db     0
-       .ascii  'r'
-       .db     0
-       .ascii  'o'
-       .db     0
-       .ascii  'k'
-       .db     0
-string1end:
-
-_string2:
-       .db     string2end - _string2
-       .db     DSCR_STRING_TYPE
-       .ascii  'f'
-       .db     0
-       .ascii  'x'
-       .db     0
-       .ascii  '2'
-       .db     0
-       .ascii  'l'
-       .db     0
-       .ascii  'a'
-       .db     0
-       .ascii  'f'
-       .db     0
-       .ascii  'w'
-       .db     0
-string2end:
-
-_dev_strings_end:
-       .dw 0x0000
+string_descriptor_lang 0 0x0409 ; Language code 0x0409 (English, US)
 
+string_descriptor_a 1,^"sigrok"
+string_descriptor_a 2,^"fx2lafw"