diff options
Diffstat (limited to 'firmware/usbstack')
-rw-r--r-- | firmware/usbstack/usb_core.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c index 3d187c8cab..b291dc7655 100644 --- a/firmware/usbstack/usb_core.c +++ b/firmware/usbstack/usb_core.c | |||
@@ -62,6 +62,10 @@ | |||
62 | #include "ocotp-imx233.h" | 62 | #include "ocotp-imx233.h" |
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | #ifdef SANSA_CONNECT | ||
66 | #include "cryptomem-sansaconnect.h" | ||
67 | #endif | ||
68 | |||
65 | #ifndef USB_MAX_CURRENT | 69 | #ifndef USB_MAX_CURRENT |
66 | #define USB_MAX_CURRENT 500 | 70 | #define USB_MAX_CURRENT 500 |
67 | #endif | 71 | #endif |
@@ -327,6 +331,22 @@ static void set_serial_descriptor(void) | |||
327 | } | 331 | } |
328 | usb_string_iSerial.bLength = 2 + 2 * (1 + IMX233_NUM_OCOTP_OPS * 8); | 332 | usb_string_iSerial.bLength = 2 + 2 * (1 + IMX233_NUM_OCOTP_OPS * 8); |
329 | } | 333 | } |
334 | #elif defined(SANSA_CONNECT) | ||
335 | static void set_serial_descriptor(void) | ||
336 | { | ||
337 | char deviceid[32]; | ||
338 | short* p = &usb_string_iSerial.wString[1]; | ||
339 | int i; | ||
340 | |||
341 | if(!cryptomem_read_deviceid(deviceid)) { | ||
342 | for(i = 0; i < 32; i++) { | ||
343 | *p++ = deviceid[i]; | ||
344 | } | ||
345 | usb_string_iSerial.bLength = 2 + 2 * (1 + 32); | ||
346 | } else { | ||
347 | device_descriptor.iSerialNumber = 0; | ||
348 | } | ||
349 | } | ||
330 | #elif (CONFIG_STORAGE & STORAGE_ATA) | 350 | #elif (CONFIG_STORAGE & STORAGE_ATA) |
331 | /* If we don't know the device serial number, use the one | 351 | /* If we don't know the device serial number, use the one |
332 | * from the disk */ | 352 | * from the disk */ |