summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVencislav Atanasov <user890104@freemyipod.org>2024-06-23 05:24:04 +0300
committerVencislav Atanasov <user890104@freemyipod.org>2024-06-23 05:24:04 +0300
commit9fda39d1ad2302a17349c01b5104900468baac31 (patch)
treea181c54d9d424d6ee714df7e40ac1fefe63f9055
parenta1c526f35fa6b6063bb3dd34a8392ad163d8a99e (diff)
downloadrockbox-9fda39d1ad2302a17349c01b5104900468baac31.tar.gz
rockbox-9fda39d1ad2302a17349c01b5104900468baac31.zip
Prevent using PP-based iPods' set_serial_descriptor on S5L87xx-based ones
On PortalPlayer iPods, it looks like the serial number is available in a specific memory location. When adding support for Samsung S5L87xx-based iPods, this algorithm has not been limited to PP-only, so it sets the serial number USB descriptor to random memory data. With this change, it will use the ATA HDD serial number on iPod 6G. On Nano 2G it won't provide a serial number at all. Change-Id: I53d48915d629dbd87b2dbbcba5f228ca5949fa9b
-rw-r--r--firmware/usbstack/usb_core.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index 9fe8b3e603..d37604f492 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -50,21 +50,17 @@
50 50
51/* TODO: Move target-specific stuff somewhere else (serial number reading) */ 51/* TODO: Move target-specific stuff somewhere else (serial number reading) */
52 52
53#ifdef HAVE_AS3514 53#if defined(IPOD_ARCH) && defined(CPU_PP)
54// no need to include anything
55#elif defined(HAVE_AS3514)
54#include "ascodec.h" 56#include "ascodec.h"
55#include "as3514.h" 57#include "as3514.h"
56#endif 58#elif (CONFIG_CPU == IMX233) && IMX233_SUBTARGET >= 3700
57
58#if !defined(HAVE_AS3514) && !defined(IPOD_ARCH) && (CONFIG_STORAGE & STORAGE_ATA)
59#include "ata.h"
60#endif
61
62#if (CONFIG_CPU == IMX233)
63#include "ocotp-imx233.h" 59#include "ocotp-imx233.h"
64#endif 60#elif defined(SANSA_CONNECT)
65
66#ifdef SANSA_CONNECT
67#include "cryptomem-sansaconnect.h" 61#include "cryptomem-sansaconnect.h"
62#elif (CONFIG_STORAGE & STORAGE_ATA)
63#include "ata.h"
68#endif 64#endif
69 65
70#ifndef USB_MAX_CURRENT 66#ifndef USB_MAX_CURRENT
@@ -287,7 +283,7 @@ static unsigned char response_data[256] USB_DEVBSS_ATTR;
287 283
288static const short hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', 284static const short hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
289 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; 285 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
290#ifdef IPOD_ARCH 286#if defined(IPOD_ARCH) && defined(CPU_PP)
291static void set_serial_descriptor(void) 287static void set_serial_descriptor(void)
292{ 288{
293#ifdef IPOD_VIDEO 289#ifdef IPOD_VIDEO