From: Uwe Hermann Date: Sun, 30 Oct 2016 11:12:31 +0000 (+0100) Subject: Use per-device USB serial number strings. X-Git-Tag: sigrok-firmware-fx2lafw-0.1.4~3 X-Git-Url: http://sigrok.org/gitweb/?p=sigrok-firmware-fx2lafw.git;a=commitdiff_plain;h=e59a70a92242d4c0d53ea0b065f61b43c2c43b03 Use per-device USB serial number strings. These are not actual "serial numbers" in the strict sense, i.e. two devices of the same type (e.g. two USBee ZX devices) would have the same string. Using two different actual serial numbers in such a case is not possible since both devices would get the exact same firmware file (uploaded to RAM via USB) and thus the exact same hardcoded "serial number". All devices where fx2lafw is currently used don't have an EEPROM where the firmware (and thus a different serial number) could be stored persistently; it's always re-uploaded to the device's RAM upon connecting the device to USB. However, the USB serial number field is still useful in that we can store a nice device(-type) indicator string there. The benefit is that an lsusb of an fx2lafw (after firmware upload) would yield something specific like "USBee ZX" or "Hantek 6022BE" in addition to the very generic "fx2lafw". --- diff --git a/hw/braintechnology-usb-lps/dscr.a51 b/hw/braintechnology-usb-lps/dscr.a51 index c82804bb..e38eafd2 100644 --- a/hw/braintechnology-usb-lps/dscr.a51 +++ b/hw/braintechnology-usb-lps/dscr.a51 @@ -22,3 +22,6 @@ VID = 0xd016 ; Manufacturer ID (0x16d0) PID = 0x9804 ; Product ID (0x0498) .include "dscr.inc" +string_descriptor_a 3,^"Braintechnology USB-LPS" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/cwav-usbeeax/dscr.a51 b/hw/cwav-usbeeax/dscr.a51 index 335493ff..7959cba6 100644 --- a/hw/cwav-usbeeax/dscr.a51 +++ b/hw/cwav-usbeeax/dscr.a51 @@ -23,3 +23,6 @@ VID = 0xa908 ; Manufacturer ID (0x08a9) PID = 0x1400 ; Product ID (0x0014) .include "dscr.inc" +string_descriptor_a 3,^"CWAV USBee AX" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/cwav-usbeedx/dscr.a51 b/hw/cwav-usbeedx/dscr.a51 index 8586b1fd..c6a04fea 100644 --- a/hw/cwav-usbeedx/dscr.a51 +++ b/hw/cwav-usbeedx/dscr.a51 @@ -22,3 +22,6 @@ VID = 0xa908 ; Manufacturer ID (0x08a9) PID = 0x1500 ; Product ID (0x0015) .include "dscr.inc" +string_descriptor_a 3,^"CWAV USBee DX" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/cwav-usbeesx/dscr.a51 b/hw/cwav-usbeesx/dscr.a51 index 35f93f75..cff9eb93 100644 --- a/hw/cwav-usbeesx/dscr.a51 +++ b/hw/cwav-usbeesx/dscr.a51 @@ -23,3 +23,6 @@ VID = 0xa908 ; Manufacturer ID (0x08a9) PID = 0x0900 ; Product ID (0x0009) .include "dscr.inc" +string_descriptor_a 3,^"CWAV USBee SX" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/cwav-usbeezx/dscr.a51 b/hw/cwav-usbeezx/dscr.a51 index 2cfd73b7..f45f9cdb 100644 --- a/hw/cwav-usbeezx/dscr.a51 +++ b/hw/cwav-usbeezx/dscr.a51 @@ -22,3 +22,6 @@ VID = 0xa908 ; Manufacturer ID (0x08a9) PID = 0x0500 ; Product ID (0x0005) .include "dscr.inc" +string_descriptor_a 3,^"CWAV USBee ZX" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/cypress-fx2/dscr.a51 b/hw/cypress-fx2/dscr.a51 index 310e077f..8243ceee 100644 --- a/hw/cypress-fx2/dscr.a51 +++ b/hw/cypress-fx2/dscr.a51 @@ -23,3 +23,6 @@ VID = 0xb404 ; Manufacturer ID (0x04b4) PID = 0x1386 ; Product ID (0x8613) .include "dscr.inc" +string_descriptor_a 3,^"Cypress FX2" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/hantek-6022be/dscr.a51 b/hw/hantek-6022be/dscr.a51 index 0f32a010..942d3275 100644 --- a/hw/hantek-6022be/dscr.a51 +++ b/hw/hantek-6022be/dscr.a51 @@ -23,3 +23,6 @@ PID = 0x8e60 ; Product ID (0x608e) VER = 0x0100 ; Product "version". 0x0001 == Hantek 6022BE. .include "dscr_hantek_6022be.inc" +string_descriptor_a 3,^"Hantek 6022BE" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/sainsmart-dds120/dscr.a51 b/hw/sainsmart-dds120/dscr.a51 index 3e089c55..79f8e026 100644 --- a/hw/sainsmart-dds120/dscr.a51 +++ b/hw/sainsmart-dds120/dscr.a51 @@ -23,3 +23,6 @@ PID = 0x8e60 ; Product ID (0x608e) VER = 0x0200 ; Product "version". 0x0002 == SainSmart DDS120. .include "dscr_hantek_6022be.inc" +string_descriptor_a 3,^"SainSmart DDS120" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/saleae-logic/dscr.a51 b/hw/saleae-logic/dscr.a51 index 81f37427..aba8cae0 100644 --- a/hw/saleae-logic/dscr.a51 +++ b/hw/saleae-logic/dscr.a51 @@ -23,3 +23,6 @@ VID = 0x2509 ; Manufacturer ID (0x0925) PID = 0x8138 ; Product ID (0x3881) .include "dscr.inc" +string_descriptor_a 3,^"Saleae Logic" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/sigrok-fx2-16ch/dscr.a51 b/hw/sigrok-fx2-16ch/dscr.a51 index d63d08c0..5657bddc 100644 --- a/hw/sigrok-fx2-16ch/dscr.a51 +++ b/hw/sigrok-fx2-16ch/dscr.a51 @@ -22,3 +22,6 @@ VID = 0x501D ; Manufacturer ID (0x1D50) PID = 0x8D60 ; Product ID (0x608D) .include "dscr.inc" +string_descriptor_a 3,^"sigrok FX2 16ch" +_dev_strings_end: + .dw 0x0000 diff --git a/hw/sigrok-fx2-8ch/dscr.a51 b/hw/sigrok-fx2-8ch/dscr.a51 index 4eecd9fe..c9b23ead 100644 --- a/hw/sigrok-fx2-8ch/dscr.a51 +++ b/hw/sigrok-fx2-8ch/dscr.a51 @@ -22,3 +22,6 @@ VID = 0x501D ; Manufacturer ID (0x1D50) PID = 0x8C60 ; Product ID (0x608C) .include "dscr.inc" +string_descriptor_a 3,^"sigrok FX2 8ch" +_dev_strings_end: + .dw 0x0000 diff --git a/include/dscr.inc b/include/dscr.inc index 1d9888a0..9f53fa50 100644 --- a/include/dscr.inc +++ b/include/dscr.inc @@ -60,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: @@ -170,6 +170,3 @@ string_descriptor_lang 0 0x0409 ; Language code 0x0409 (English, US) string_descriptor_a 1,^"sigrok" string_descriptor_a 2,^"fx2lafw" - -_dev_strings_end: - .dw 0x0000 diff --git a/include/dscr_hantek_6022be.inc b/include/dscr_hantek_6022be.inc index 71cdc44d..418c2c75 100644 --- a/include/dscr_hantek_6022be.inc +++ b/include/dscr_hantek_6022be.inc @@ -59,7 +59,7 @@ _dev_dscr: .dw VER ; Product version/type .db 1 ; Manufacturer string index .db 2 ; Product string index - .db 0 ; Serial number string index (none) + .db 3 ; Serial number string index .db 1 ; Number of configurations dev_dscr_end: @@ -353,6 +353,3 @@ string_descriptor_lang 0 0x0409 ; Language code 0x0409 (English, US) string_descriptor_a 1,^"sigrok" string_descriptor_a 2,^"fx2lafw" - -_dev_strings_end: - .dw 0x0000