Quando ho iniziato a dedicarmi allo sviluppo/studio del firmware di questo router ancora non erano stati rilasciati i sorgenti GPL da parte della Telsey (e neanche i sorgenti GPL ASUS). Pertanto i miei sforzi si concentrarono sull'analisi delle differenze rilevabili dallo studio dei sorgenti allora disponibili. In particolare, per quanto riguarda sorgenti basati su kernel della serie 2.6:
Tali firmware presentano notevoli differenze rispetto ai sorgenti utilizzati da Telecom per produrre il firmware allegato normalmente a questa tipologia di router. Alcune di queste differenze sono di poco conto (problemi di compilazione o header mancanti), altre volte le mancanze sono di natura più strutturale, dovute alle piccole differenze progettuali tra l'hardware utilizzato come riferimento e il nostro router (Es: La memoria flash). Fino a quando sono facilmente reperibili le informazioni per sopperire a tali mancanze (Es: datasheet), è relativamente semplice proseguire con il lavoro. Qualora tali informazioni non siano disponibili si rende necessario agire a basso livello, andando ad studiare laddovè queste informazioni sono presenti, sebbene in forma non molto intelligibile, ovverosia il kernel binario originale Telecom.
Quasi tutte le informazioni presenti in questa pagina sono state riportate in formato elettronico a partire dai miei appunti personali cartacei pertanto con ogni probabilità ci saranno almeno 2 o 3 mila errori di ricopiatura dei dati… Abbiate pazienza :)
Oggetto del nostro studio sarà il file boardparms.c (e il relativo include boardparms.h) nella versione più recente a nostra disposizione presente nel firmware USR910x_3.04L.01_consumer.0110. Tale file contiene praticamente tutte le informazioni circa la caratterizzazione hardware del router.
In particolare possiamo notare che in esso viene definita la struttura boardparameters:
typedef struct boardparameters { char szBoardId[BP_BOARD_ID_LEN]; /* board id string */ ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS]; VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP]; unsigned short usSdramSize; /* SDRAM size and type */ unsigned short usPsiSize; /* persistent storage in K bytes */ unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */ unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */ unsigned short usGpioPressAndHoldReset; /* GPIO pin or not defined */ unsigned short usGpioPcmciaReset; /* GPIO pin or not defined */ unsigned short usGpioUartRts; /* GPIO pin or not defined */ unsigned short usGpioUartCts; /* GPIO pin or not defined */ unsigned short usGpioLedAdsl; /* GPIO pin or not defined */ unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */ unsigned short usGpioLedWireless; /* GPIO pin or not defined */ unsigned short usGpioLedUsb; /* GPIO pin or not defined */ unsigned short usGpioLedHpna; /* GPIO pin or not defined */ unsigned short usGpioLedWanData; /* GPIO pin or not defined */ unsigned short usGpioLedPpp; /* GPIO pin or not defined */ unsigned short usGpioLedPppFail; /* GPIO pin or not defined */ unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */ unsigned short usGpioLedBlAlarm; /* GPIO pin or not defined */ unsigned short usGpioLedBlResetCfg; /* GPIO pin or not defined */ unsigned short usGpioLedBlStop; /* GPIO pin or not defined */ unsigned short usExtIntrWireless; /* ext intr or not defined */ unsigned short usExtIntrAdslDyingGasp; /* ext intr or not defined */ unsigned short usExtIntrHpna; /* ext intr or not defined */ unsigned short usCsHpna; /* chip select not defined */ unsigned short usAntInUseWireless; /* antenna in use or not defined */ unsigned short usGpioSesBtnWireless; /* GPIO pin or not defined */ unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */ unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */ } BOARD_PARAMETERS, *PBOARD_PARAMETERS;
seguita immediatamente da quelle che sono le definizioni per i vari hardware supportati dai sorgenti in studio:
#if defined(_BCM96338_) || defined(CONFIG_BCM96338) static BOARD_PARAMETERS g_bcm96338sv = { "96338SV", /* szBoardId */ {{BP_ENET_INTERNAL_PHY, /* ucPhyType */ 0x01, /* ucPhyAddress */ BP_NOT_DEFINED, /* usGpioPhySpiSck */ BP_NOT_DEFINED, /* usGpioPhySpiSs */ BP_NOT_DEFINED, /* usGpioPhySpiMosi */ BP_NOT_DEFINED, /* usGpioPhySpiMiso */ BP_NOT_DEFINED, /* usGpioPhyReset */ 0x01, /* numSwitchPorts */ BP_ENET_CONFIG_MDIO, /* usConfigType */ BP_NOT_DEFINED}, /* usReverseMii */ {BP_ENET_NO_PHY}}, /* ucPhyType */ BP_MEMORY_16MB_1_CHIP, /* usSdramSize */ BP_PSI_DEFAULT_SIZE, /* usPsiSize */ BP_NOT_DEFINED, /* usGpioRj11InnerPair */ BP_NOT_DEFINED, /* usGpioRj11OuterPair */ BP_NOT_DEFINED, /* usGpioPressAndHoldReset */ BP_NOT_DEFINED, /* usGpioVoipReset */ BP_NOT_DEFINED, /* usGpioVoipIntr */ BP_NOT_DEFINED, /* usGpioPcmciaReset */ BP_NOT_DEFINED, /* usGpioUartRts */ BP_NOT_DEFINED, /* usGpioUartCts */ BP_NOT_DEFINED, /* usGpioLedAdsl */ BP_NOT_DEFINED, /* usGpioLedAdslFail */ BP_NOT_DEFINED, /* usGpioLedWireless */ BP_NOT_DEFINED, /* usGpioLedUsb */ BP_NOT_DEFINED, /* usGpioLedHpna */ BP_NOT_DEFINED, /* usGpioLedWanData */ BP_NOT_DEFINED, /* usGpioLedPpp */ BP_NOT_DEFINED, /* usGpioLedPppFail */ BP_NOT_DEFINED, /* usGpioLedVoip */ BP_NOT_DEFINED, /* usGpioLedBlPowerOn */ BP_NOT_DEFINED, /* usGpioLedBlAlarm */ BP_NOT_DEFINED, /* usGpioLedBlResetCfg */ BP_NOT_DEFINED, /* usGpioLedBlStop */ BP_NOT_DEFINED, /* usExtIntrWireless */ BP_NOT_DEFINED, /* usExtIntrAdslDyingGasp */ BP_NOT_DEFINED, /* usExtIntrVoip */ BP_NOT_DEFINED, /* usExtIntrHpna */ BP_NOT_DEFINED, /* usCsHpna */ BP_NOT_DEFINED /* usCsVoip */ }; static BOARD_PARAMETERS g_bcm96338l2m8m = { "96338L-2M-8M", /* szBoardId */
Dai sorgenti in studio possiamo in definitiva ricavare le definizioni per le seguenti tipologie di hardware: 96338SV, 96338L-2M-8M, 96345R, 96345GW2, 96345GW, 96335R, 96345R0, 96345RS, 96348R, 96348LV, 96348GW, 96348GW-10, 96348GW-11, 96348SV.
Ovviamente mancano le uniche definizioni che realmente interesserebbero il nostro studio: MAGIC e/o MAGIC1. Dovremo quindi andarcele a ricavare direttamente dal kernel precompilato Telecom.
Tale kernel può essere estratto dal firmware presente normalmente nel router seguendo le operazioni descritte qui e, per poter essere analizzato deve essere decompresso.
Supponiamo a questo punto di disporre del kernel originale Telecom decompresso, che chiameremo da qui in avanti vmlinux.telecom.
Cerchiamo le porzioni di codice/dati che ci interessano all'interno del kernel. Per perseguire tale scopo utilizzamo un editor esadecimale, e ricerchiamo la stringa MAGIC1 (case sensitive). Verremo trasportati alla locazione dove è stato collegato il file boardparams.c compilato da Telecom.
0017:fed0 80 18 ff 80 80 18 fe dc 00 00 00 00 4d 41 47 49 ..ÿ...þÜ....MAGI 0017:fee0 43 31 00 00 00 00 00 00 00 00 00 00 01 01 ff ff C1............ÿÿ 0017:fef0 ff ff ff ff ff ff ff ff 00 01 00 00 ff ff 00 00 ÿÿÿÿÿÿÿÿ....ÿÿ.. 0017:ff00 03 00 ff ff ff ff ff ff ff ff 80 18 00 03 00 03 ..ÿÿÿÿÿÿÿÿ...... 0017:ff10 00 01 00 02 01 00 00 02 00 19 00 22 80 16 00 02 ...........".... 0017:ff20 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 18 ................ 0017:ff30 ff ff ff ff ff ff ff ff ff ff ff ff 80 05 ff ff ÿÿÿÿÿÿÿÿÿÿÿÿ..ÿÿ 0017:ff40 80 1c ff ff 80 1d 80 23 80 04 ff ff ff ff ff ff ..ÿÿ...#..ÿÿÿÿÿÿ 0017:ff50 80 02 80 03 80 17 80 00 ff ff ff ff 80 01 ff ff ........ÿÿÿÿ..ÿÿ 0017:ff60 ff f0 ff ff ff ff 00 03 ff ff ff ff ff ff ff ff ÿðÿÿÿÿ..ÿÿÿÿÿÿÿÿ 0017:ff70 80 06 80 07 00 04 00 01 00 01 00 00 30 00 00 00 ............0... 0017:ff80 4d 41 47 49 43 00 00 00 00 00 00 00 00 00 00 00 MAGIC........... 0017:ff90 01 01 ff ff ff ff ff ff ff ff ff ff 00 01 00 00 ..ÿÿÿÿÿÿÿÿÿÿ.... 0017:ffa0 ff ff 00 00 02 00 ff ff ff ff ff ff ff ff 80 18 ÿÿ....ÿÿÿÿÿÿÿÿ.. 0017:ffb0 00 01 00 00 ff ff 00 00 01 00 00 02 00 19 00 22 ....ÿÿ........." 0017:ffc0 80 16 00 02 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0017:ffd0 00 05 00 18 ff ff ff ff ff ff ff ff ff ff ff ff ....ÿÿÿÿÿÿÿÿÿÿÿÿ 0017:ffe0 80 05 ff ff 00 1d 00 1c 80 1e 80 23 80 04 ff ff ..ÿÿ.......#..ÿÿ 0017:fff0 ff ff ff ff 80 02 80 03 80 17 80 00 ff ff ff ff ÿÿÿÿ........ÿÿÿÿ 0018:0000 80 01 ff ff ff f0 ff ff ff ff 00 03 ff ff ff ff ..ÿÿÿðÿÿÿÿ..ÿÿÿÿ 0018:0010 ff ff ff ff 80 06 80 07 00 04 00 01 00 01 00 00 ÿÿÿÿ............ 0018:0020 30 00 00 00 43 50 56 41 34 00 00 00 00 00 00 00 0...CPVA4....... 0018:0030 00 00 00 00 01 01 ff ff ff ff ff ff ff ff ff ff ......ÿÿÿÿÿÿÿÿÿÿ 0018:0040 00 01 00 00 ff ff 00 00 03 00 ff ff ff ff ff ff ....ÿÿ....ÿÿÿÿÿÿ 0018:0050 ff ff 80 03 00 03 00 03 00 01 00 03 01 00 00 02 ÿÿ.............. 0018:0060 00 04 00 22 ff ff 00 02 00 00 00 00 00 00 00 00 ..."ÿÿ.......... 0018:0070 00 00 00 00 00 05 00 18 ff ff ff ff 00 21 ff ff ........ÿÿÿÿ.!ÿÿ 0018:0080 ff ff ff ff 80 05 ff ff ff ff ff ff ff ff ff ff ÿÿÿÿ..ÿÿÿÿÿÿÿÿÿÿ 0018:0090 ff ff 80 05 ff ff ff ff ff ff ff ff ff ff ff ff ÿÿ..ÿÿÿÿÿÿÿÿÿÿÿÿ 0018:00a0 ff ff ff ff 80 05 ff ff ff f0 ff ff ff ff 00 03 ÿÿÿÿ..ÿÿÿðÿÿÿÿ.. 0018:00b0 ff ff ff ff ff ff 00 02 80 00 80 01 ff ff ff ff ÿÿÿÿÿÿ......ÿÿÿÿ 0018:00c0 ff ff 00 00 1e 00 00 00 39 36 33 34 38 47 57 2d ÿÿ......96348GW- 0018:00d0 31 30 00 00 00 00 00 00 01 01 ff ff ff ff ff ff 10........ÿÿÿÿÿÿ 0018:00e0 ff ff ff ff 00 01 00 00 ff ff 00 00 03 00 ff ff ÿÿÿÿ....ÿÿ....ÿÿ 0018:00f0 ff ff ff ff ff ff ff ff 00 03 00 04 00 01 00 02 ÿÿÿÿÿÿÿÿ........ 0018:0100 01 00 00 02 00 06 00 22 ff ff 00 02 00 00 00 00 ......."ÿÿ...... 0018:0110 00 00 00 00 00 00 00 00 00 05 00 18 ff ff ff ff ............ÿÿÿÿ 0018:0120 80 21 ff ff ff ff ff ff ff ff 80 02 ff ff ff ff .!ÿÿÿÿÿÿÿÿ..ÿÿÿÿ 0018:0130 ff ff ff ff ff ff 80 03 80 03 80 04 ff ff ff ff ÿÿÿÿÿÿ......ÿÿÿÿ 0018:0140 ff ff 80 00 ff ff 80 03 80 01 ff ff ff f0 ff ff ÿÿ..ÿÿ....ÿÿÿðÿÿ 0018:0150 ff ff 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ÿÿ..ÿÿÿÿÿÿÿÿÿÿÿÿ 0018:0160 ff ff ff ff ff ff 00 00 00 00 00 00 39 36 33 34 ÿÿÿÿÿÿ......9634 0018:0170 38 57 32 00 00 00 00 00 00 00 00 00 01 01 ff ff 8W2...........ÿÿ 0018:0180 ff ff ff ff ff ff ff ff 00 01 00 00 ff ff 00 00 ÿÿÿÿÿÿÿÿ....ÿÿ.. 0018:0190 03 00 ff ff ff ff ff ff ff ff ff ff 00 03 00 03 ..ÿÿÿÿÿÿÿÿÿÿ.... 0018:01a0 00 01 00 00 01 00 00 02 00 06 00 22 ff ff 00 02 ..........."ÿÿ.. 0018:01b0 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 18 ................ 0018:01c0 ff ff ff ff 80 21 ff ff ff ff ff ff ff ff 80 02 ÿÿÿÿ.!ÿÿÿÿÿÿÿÿ.. 0018:01d0 ff ff ff ff ff ff 80 03 80 03 80 04 80 00 ff ff ÿÿÿÿÿÿ........ÿÿ 0018:01e0 80 03 80 01 ff ff ff f0 ff ff ff ff 00 01 00 23 ....ÿÿÿðÿÿÿÿ...# 0018:01f0 00 03 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ..ÿÿ............ 0018:0200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0018:0210 39 36 33 34 38 47 57 00 00 00 00 00 00 00 00 00 96348GW......... 0018:0220 01 01 ff ff ff ff ff ff ff ff ff ff 00 01 00 00 ..ÿÿÿÿÿÿÿÿÿÿ.... 0018:0230 ff ff 00 00 03 00 ff ff ff ff ff ff ff ff ff ff ÿÿ....ÿÿÿÿÿÿÿÿÿÿ 0018:0240 00 03 00 03 00 01 00 02 01 00 00 02 00 06 00 22 ..............." 0018:0250 ff ff 00 02 00 00 00 00 00 00 00 00 00 00 00 00 ÿÿ.............. 0018:0260 00 05 00 18 ff ff ff ff 80 21 ff ff ff ff ff ff ....ÿÿÿÿ.!ÿÿÿÿÿÿ 0018:0270 ff ff 80 02 ff ff ff ff ff ff ff ff ff ff 80 03 ÿÿ..ÿÿÿÿÿÿÿÿÿÿ.. 0018:0280 80 03 80 04 ff ff ff ff ff ff 80 00 ff ff 80 03 ....ÿÿÿÿÿÿ..ÿÿ.. 0018:0290 80 01 ff ff ff f0 ff ff ff ff 00 00 00 23 00 03 ..ÿÿÿðÿÿÿÿ...#.. 0018:02a0 ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.. 0018:02b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0018:02c0 00 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 00 ................
Dal blocco di codice sopra evidenziato è possibile vedere che sono presenti le definizioni per le seguenti piattaforme hardware: MAGIC1, MAGIC, CPVA4, 96348GW-10, 96348W2, 96348GW. Questo ci conferma inoltre che, con ogni probabilità il kernel fornito da Telecom è stato originariamente sviluppato dalla Telsey in quanto in esso è presente la definizione per CPVA4 che risulta essere un'altro degli apparati commercilizzati da Telsey, di cui Telsey NON distribuisce i sorgenti violando così ancora in modo palese la licenza GPL :(
Tralasciano le disquisizioni sulla poca serietà delle aziende che succhiano dal mondo dell'open source ignorandone bellamente le regole, passiamo alla parte che più interessa a noi… ovverosia l'analisi dei dati che ci siamo appena ricavati, concentrandoci particolarmente sulla definizione del MAGIC.
Come visto nelle sezioni precedenti la definizione dei parametri di una piattaforma incomincia con una stringa, di lunghezza BP_BOARD_ID_LEN=16 bytes
typedef struct boardparameters { char szBoardId[BP_BOARD_ID_LEN]; /* board id string */
ed è contenuta in una struttura di 132 bytes (16 char di board id string + una struttura di BP_MAX_ENET_MACS=2 * sizeof(ETHERNET_MAC_INFO=18) bytes + una struttura di BP_MAX_VOIP_DSP=2 * sizeof(VOIP_DSP_INFO=12) + 28 unsigned short).
A questo punto nascono i primi problemi… infatti ci accorgiamo con orrore che il blocco binario estratto dal kernel telecom è di ben 164 byte. Ovviamente la struttura utilizzata nei sorgenti Telecom è diversa da quella che stiamo studiando noi :( e con ogni probabilità proviene da un albero dei sorgenti più recente :(
Ciò comporta che dovremo estendere la struttura che stiamo utilizzando per allocare i 32 byte in più. In questo modo i nostri sorgenti ricompilati potranno funzionare senza troppi problemi (Ma non utilizzeranno pero' mai le informazioni contenute in quei 32 byte…), e senza troppi problemi potremo utilizzare anche moduli precompilati per il kernel Telecom (Nel caso facessero accesso alla struttura dati compilata nel kernel accederebbero senza problemi alle informazioni originali, essendo il tipo di accesso alla struttura di tipo posizionale base+offset… L'unica cosa importante è trovare l'offset giusto in cui “incastonare” questi 32 byte di informazioni…).
Per scoprire quali informazioni sono state aggiunte ci faremo aiutare dalla definizione di un architettura presente in entrambe le nostre fonti di dato: 96348GW-10
Questo è il 96348GW-10 secondo USR910x_3.04L.01_consumer.0110:
static BOARD_PARAMETERS g_bcm96348gw_10 = { "96348GW-10", /* szBoardId */ {{BP_ENET_INTERNAL_PHY, /* ucPhyType */ 0x01, /* ucPhyAddress */ BP_NOT_DEFINED, /* usGpioPhySpiSck */ BP_NOT_DEFINED, /* usGpioPhySpiSs */ BP_NOT_DEFINED, /* usGpioPhySpiMosi */ BP_NOT_DEFINED, /* usGpioPhySpiMiso */ BP_NOT_DEFINED, /* usGpioPhyReset */ 0x01, /* numSwitchPorts */ BP_ENET_CONFIG_MDIO, /* usConfigType */ BP_NOT_DEFINED}, /* usReverseMii */ {BP_ENET_EXTERNAL_SWITCH, /* ucPhyType */ 0x00, /* ucPhyAddress */ BP_NOT_DEFINED, /* usGpioPhySpiSck */ BP_NOT_DEFINED, /* usGpioPhySpiSs */ BP_NOT_DEFINED, /* usGpioPhySpiMosi */ BP_NOT_DEFINED, /* usGpioPhySpiMiso */ BP_NOT_DEFINED, /* usGpioPhyReset */ 0x03, /* numSwitchPorts */ BP_ENET_CONFIG_SPI_SSB_1, /* usConfigType */ BP_ENET_REVERSE_MII}}, /* usReverseMii */ {{BP_VOIP_DSP, /* ucDspType */ 0x00, /* ucDspAddress */ BP_EXT_INTR_2, /* usExtIntrVoip */ BP_GPIO_6_AH, /* usGpioVoipReset */ BP_GPIO_34_AH, /* usGpioVoipIntr */ BP_NOT_DEFINED, /* usGpioLedVoip */ BP_CS_2}, /* usCsVoip */ {BP_VOIP_NO_DSP}}, /* ucDspType */ BP_MEMORY_16MB_2_CHIP, /* usSdramSize */ BP_PSI_DEFAULT_SIZE, /* usPsiSize */ BP_NOT_DEFINED, /* usGpioRj11InnerPair */ BP_NOT_DEFINED, /* usGpioRj11OuterPair */ BP_GPIO_33_AL, /* usGpioPressAndHoldReset */ BP_NOT_DEFINED, /* usGpioPcmciaReset */ BP_NOT_DEFINED, /* usGpioUartRts */ BP_NOT_DEFINED, /* usGpioUartCts */ BP_NOT_DEFINED, /* usGpioLedAdsl */ BP_GPIO_2_AL, /* usGpioLedAdslFail */ BP_NOT_DEFINED, /* usGpioLedWireless */ BP_NOT_DEFINED, /* usGpioLedUsb */ BP_NOT_DEFINED, /* usGpioLedHpna */ BP_GPIO_3_AL, /* usGpioLedWanData */ BP_GPIO_3_AL, /* usGpioLedPpp */ BP_GPIO_4_AL, /* usGpioLedPppFail */ BP_GPIO_0_AL, /* usGpioLedBlPowerOn */ BP_NOT_DEFINED, /* usGpioLedBlAlarm */ BP_GPIO_3_AL, /* usGpioLedBlResetCfg */ BP_GPIO_1_AL, /* usGpioLedBlStop */ BP_NOT_DEFINED, /* usExtIntrWireless */ BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */ BP_NOT_DEFINED, /* usExtIntrHpna */ BP_NOT_DEFINED, /* usCsHpna */ BP_WLAN_ANT_MAIN, /* usAntInUseWireless */ BP_NOT_DEFINED, /* usGpioSesBtnWireless */ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ BP_NOT_DEFINED /* usGpioLedSesWireless */ };
Questo invece è la definizione relativa allo stesso hardware (96348GW-10) presente nel kernel Telecom:
0000:0000 39 36 33 34 38 47 57 2d 31 30 00 00 00 00 00 00 96348GW-10...... 0000:0010 01 01 ff ff ff ff ff ff ff ff ff ff 00 01 00 00 ..ÿÿÿÿÿÿÿÿÿÿ.... 0000:0020 ff ff 00 00 03 00 ff ff ff ff ff ff ff ff ff ff ÿÿ....ÿÿÿÿÿÿÿÿÿÿ 0000:0030 00 03 00 04 00 01 00 02 01 00 00 02 00 06 00 22 ..............." 0000:0040 ff ff 00 02 00 00 00 00 00 00 00 00 00 00 00 00 ÿÿ.............. 0000:0050 00 05 00 18 ff ff ff ff 80 21 ff ff ff ff ff ff ....ÿÿÿÿ.!ÿÿÿÿÿÿ 0000:0060 ff ff 80 02 ff ff ff ff ff ff ff ff ff ff 80 03 ÿÿ..ÿÿÿÿÿÿÿÿÿÿ.. 0000:0070 80 03 80 04 ff ff ff ff ff ff 80 00 ff ff 80 03 ....ÿÿÿÿÿÿ..ÿÿ.. 0000:0080 80 01 ff ff ff f0 ff ff ff ff 00 00 ff ff ff ff ..ÿÿÿðÿÿÿÿ..ÿÿÿÿ 0000:0090 ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.. 0000:00a0 00 00 00 00 ....
Adesso guardiamole in parallelo:
offset | descrizione | typedef struct boardparameters | USR910x_3.04L.01_consumer.0110 | Kernel Telecom | offset |
---|---|---|---|---|---|
0 | board id string | char szBoardId[BP_BOARD_ID_LEN]; | 96348GW-10 | 96348GW-10 | 0 |
Information about an Ethernet MAC. 1) | ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS] | ||||
15 | BP_ENET_xxx | unsigned char ucPhyType; | BP_ENET_INTERNAL_PHY | 0x01 | 15 |
16 | 0 to 31 | unsigned char ucPhyAddress; | 0x01 | 0x01 | 16 |
18 | GPIO pin or not defined | unsigned short usGpioPhySpiSck; | BP_NOT_DEFINED | 0xFFFF | 18 |
20 | GPIO pin or not defined | unsigned short usGpioPhySpiSs; | BP_NOT_DEFINED | 0xFFFF | 20 |
22 | GPIO pin or not defined | unsigned short usGpioPhySpiMosi; | BP_NOT_DEFINED | 0xFFFF | 22 |
24 | GPIO pin or not defined | unsigned short usGpioPhySpiMiso; | BP_NOT_DEFINED | 0xFFFF | 24 |
26 | GPIO pin or not defined (96348LV) | unsigned short usGpioPhyReset; | BP_NOT_DEFINED | 0xFFFF | 26 |
28 | Number of PHY ports | unsigned short numSwitchPorts; | 0x01 | 0x0001 | 28 |
30 | Configuration type | unsigned short usConfigType; | BP_ENET_CONFIG_MDIO | 0x0000 | 30 |
32 | Reverse MII | unsigned short usReverseMii; | BP_NOT_DEFINED | 0xFFFF | 32 |
UNKNOWN TELECOM | 0x0000 | 34 | |||
Information about an Ethernet MAC. 2) | ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS] | ||||
34 | BP_ENET_xxx | unsigned char ucPhyType; | BP_ENET_EXTERNAL_SWITCH | 0x03 | 36 |
35 | 0 to 31 | unsigned char ucPhyAddress; | 0x00 | 0x00 | 37 |
36 | GPIO pin or not defined | unsigned short usGpioPhySpiSck; | BP_NOT_DEFINED | 0xFFFF | 38 |
38 | GPIO pin or not defined | unsigned short usGpioPhySpiSs; | BP_NOT_DEFINED | 0xFFFF | 40 |
40 | GPIO pin or not defined | unsigned short usGpioPhySpiMosi; | BP_NOT_DEFINED | 0xFFFF | 42 |
42 | GPIO pin or not defined | unsigned short usGpioPhySpiMiso; | BP_NOT_DEFINED | 0xFFFF | 44 |
44 | GPIO pin or not defined (96348LV) | unsigned short usGpioPhyReset; | BP_NOT_DEFINED | 0xFFFF | 46 |
46 | Number of PHY ports | unsigned short numSwitchPorts; | 0x03 | 0x0003 | 48 |
48 | Configuration type | unsigned short usConfigType; | BP_ENET_CONFIG_SPI_SSB_1 | 0x0004 | 50 |
50 | Reverse MII | unsigned short usReverseMii; | BP_ENET_REVERSE_MII | 0x0001 | 52 |
UNKNOWN TELECOM | 0x0002 | 54 | |||
Information about VoIP DSPs. 3) | VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP] | ||||
52 | unsigned char ucDspType; | BP_VOIP_DSP | 0x01 | 56 | |
53 | unsigned char ucDspAddress; | 0x00 | 0x00 | 57 | |
54 | unsigned short usExtIntrVoip; | BP_EXT_INTR_2 | 0x0002 | 58 | |
56 | unsigned short usGpioVoipReset; | BP_GPIO_6_AH | 0x0006 | 60 | |
58 | unsigned short usGpioVoipIntr; | BP_GPIO_34_AH | 0x0022 | 62 | |
60 | unsigned short usGpioLedVoip; | BP_NOT_DEFINED | 0xFFFF | 64 | |
62 | unsigned short usCsVoip; | BP_CS_2 | 0x0002 | 66 | |
Information about VoIP DSPs. 4) | VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP] | ||||
64 | unsigned char ucDspType; | BP_VOIP_NO_DSP | 0x00 | 68 | |
65 | unsigned char ucDspAddress; | 0x00 | 69 | ||
66 | unsigned short usExtIntrVoip; | 0x0000 | 70 | ||
68 | unsigned short usGpioVoipReset; | 0x0000 | 72 | ||
70 | unsigned short usGpioVoipIntr; | 0x0000 | 74 | ||
72 | unsigned short usGpioLedVoip; | 0x0000 | 76 | ||
74 | unsigned short usCsVoip; | 0x0000 | 78 | ||
76 | SDRAM size and type | unsigned short usSdramSize; | BP_MEMORY_16MB_2_CHIP | 0x0005 | 80 |
78 | persistent storage in K bytes | unsigned short usPsiSize; | BP_PSI_DEFAULT_SIZE | 0x0018 | 82 |
80 | GPIO pin or not defined | unsigned short usGpioRj11InnerPair; | BP_NOT_DEFINED | 0xFFFF | 84 |
82 | GPIO pin or not defined | unsigned short usGpioRj11OuterPair; | BP_NOT_DEFINED | 0xFFFF | 86 |
84 | GPIO pin or not defined | unsigned short usGpioPressAndHoldReset; | BP_GPIO_33_AL | 0x8021 | 88 |
86 | GPIO pin or not defined | unsigned short usGpioPcmciaReset; | BP_NOT_DEFINED | 0xFFFF | 90 |
88 | GPIO pin or not defined | unsigned short usGpioUartRts; | BP_NOT_DEFINED | 0xFFFF | 92 |
90 | GPIO pin or not defined | unsigned short usGpioUartCts; | BP_NOT_DEFINED | 0xFFFF | 94 |
92 | GPIO pin or not defined | unsigned short usGpioLedAdsl; | BP_NOT_DEFINED | 0xFFFF | 96 |
94 | GPIO pin or not defined | unsigned short usGpioLedAdslFail; | BP_GPIO_2_AL | 0x8002 | 98 |
96 | GPIO pin or not defined | unsigned short usGpioLedWireless; | BP_NOT_DEFINED | 0xFFFF | 100 |
98 | GPIO pin or not defined | unsigned short usGpioLedUsb; | BP_NOT_DEFINED | 0xFFFF | 102 |
100 | GPIO pin or not defined | unsigned short usGpioLedHpna; | BP_NOT_DEFINED | 0xFFFF | 104 |
UNKNOWN TELECOM | 0xFFFF | 106 | |||
UNKNOWN TELECOM | 0xFFFF | 108 | |||
102 | GPIO pin or not defined | unsigned short usGpioLedWanData; | BP_GPIO_3_AL | 0x8003 | 110 |
104 | GPIO pin or not defined | unsigned short usGpioLedPpp; | BP_GPIO_3_AL | 0x8003 | 112 |
106 | GPIO pin or not defined | unsigned short usGpioLedPppFail; | BP_GPIO_4_AL | 0x8004 | 114 |
UNKNOWN TELECOM | 0xFFFF | 116 | |||
UNKNOWN TELECOM | 0xFFFF | 118 | |||
UNKNOWN TELECOM | 0xFFFF | 120 | |||
108 | GPIO pin or not defined | unsigned short usGpioLedBlPowerOn; | BP_GPIO_0_AL | 0x8000 | 122 |
110 | GPIO pin or not defined | unsigned short usGpioLedBlAlarm; | BP_NOT_DEFINED | 0xFFFF | 124 |
112 | GPIO pin or not defined | unsigned short usGpioLedBlResetCfg; | BP_GPIO_3_AL | 0x8003 | 126 |
114 | GPIO pin or not defined | unsigned short usGpioLedBlStop; | BP_GPIO_1_AL | 0x8001 | 128 |
116 | ext intr or not defined | unsigned short usExtIntrWireless; | BP_NOT_DEFINED | 0xFFFF | 130 |
118 | ext intr or not defined | unsigned short usExtIntrAdslDyingGasp; | BP_HW_DEFINED | 0xFFF0 | 132 |
120 | ext intr or not defined | unsigned short usExtIntrHpna; | BP_NOT_DEFINED | 0xFFFF | 134 |
122 | chip select not defined | unsigned short usCsHpna; | BP_NOT_DEFINED | 0xFFFF | 136 |
124 | antenna in use or not defined | unsigned short usAntInUseWireless; | BP_WLAN_ANT_MAIN | 0x0000 | 138 |
126 | GPIO pin or not defined | unsigned short usGpioSesBtnWireless; | BP_NOT_DEFINED | 0xFFFF | 140 |
128 | ext intr or not defined | unsigned short usExtIntrSesBtnWireless; | BP_NOT_DEFINED | 0xFFFF | 142 |
130 | GPIO pin or not defined | unsigned short usGpioLedSesWireless; | BP_NOT_DEFINED | 0xFFFF | 144 |
UNKNOWN TELECOM | 0xFFFF | 146 | |||
UNKNOWN TELECOM | 0xFFFF | 148 | |||
UNKNOWN TELECOM | 0xFFFF | 150 | |||
UNKNOWN TELECOM | 0xFFFF | 152 | |||
UNKNOWN TELECOM | 0xFFFF | 154 | |||
UNKNOWN TELECOM | 0xFFFF | 156 | |||
UNKNOWN TELECOM | 0x0000 | 158 | |||
UNKNOWN TELECOM | 0x0000 | 160 | |||
UNKNOWN TELECOM | 0x0000 | 162 |
Possiamo quindi estrapolare le seguenti differenze certe (perchè delimitate ad entrambi gli estremi da valori ben noti):
32 | Reverse MII | usReverseMii; | BP_NOT_DEFINED | 0xFFFF | 32 |
UNKNOWN TELECOM | 0x0000 | 34 | |||
Information about an Ethernet MAC. 5) | ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS] | ||||
34 | BP_ENET_xxx | unsigned char ucPhyType; | BP_ENET_EXTERNAL_SWITCH | 0x03 | 36 |
50 | Reverse MII | usReverseMii; | BP_ENET_REVERSE_MII | 0x0001 | 52 |
UNKNOWN TELECOM | 0x0002 | 54 | |||
Information about VoIP DSPs. 6) | VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP] | ||||
52 | unsigned char ucDspType; | BP_VOIP_DSP | 0x01 | 56 |
106 | GPIO pin or not defined | unsigned short usGpioLedPppFail; | BP_GPIO_4_AL | 0x8004 | 114 |
UNKNOWN TELECOM | 0xFFFF | 116 | |||
UNKNOWN TELECOM | 0xFFFF | 118 | |||
UNKNOWN TELECOM | 0xFFFF | 120 | |||
108 | GPIO pin or not defined | unsigned short usGpioLedBlPowerOn; | BP_GPIO_0_AL | 0x8000 | 122 |
Mentre un certo margine di incertezza rimane per queste differenze:
94 | GPIO pin or not defined | unsigned short usGpioLedAdslFail; | BP_GPIO_2_AL | 0x8002 | 98 |
96 | GPIO pin or not defined | unsigned short usGpioLedWireless; | BP_NOT_DEFINED | 0xFFFF | 100 |
98 | GPIO pin or not defined | unsigned short usGpioLedUsb; | BP_NOT_DEFINED | 0xFFFF | 102 |
100 | GPIO pin or not defined | unsigned short usGpioLedHpna; | BP_NOT_DEFINED | 0xFFFF | 104 |
UNKNOWN TELECOM | 0xFFFF | 106 | |||
UNKNOWN TELECOM | 0xFFFF | 108 | |||
102 | GPIO pin or not defined | unsigned short usGpioLedWanData; | BP_GPIO_3_AL | 0x8003 | 110 |
124 | antenna in use or not defined | unsigned short usAntInUseWireless; | BP_WLAN_ANT_MAIN | 0x0000 | 138 |
126 | GPIO pin or not defined | unsigned short usGpioSesBtnWireless; | BP_NOT_DEFINED | 0xFFFF | 140 |
128 | ext intr or not defined | unsigned short usExtIntrSesBtnWireless; | BP_NOT_DEFINED | 0xFFFF | 142 |
130 | GPIO pin or not defined | unsigned short usGpioLedSesWireless; | BP_NOT_DEFINED | 0xFFFF | 144 |
UNKNOWN TELECOM | 0xFFFF | 146 | |||
UNKNOWN TELECOM | 0xFFFF | 148 | |||
UNKNOWN TELECOM | 0xFFFF | 150 | |||
UNKNOWN TELECOM | 0xFFFF | 152 | |||
UNKNOWN TELECOM | 0xFFFF | 154 | |||
UNKNOWN TELECOM | 0xFFFF | 156 | |||
UNKNOWN TELECOM | 0x0000 | 158 | |||
UNKNOWN TELECOM | 0x0000 | 160 | |||
UNKNOWN TELECOM | 0x0000 | 162 |
Infatti a titolo di esempio la prima potrebbe essere anche così indicata:
94 | GPIO pin or not defined | unsigned short usGpioLedAdslFail; | BP_GPIO_2_AL | 0x8002 | 98 |
UNKNOWN TELECOM | 0xFFFF | 100 | |||
UNKNOWN TELECOM | 0xFFFF | 102 | |||
96 | GPIO pin or not defined | unsigned short usGpioLedWireless; | BP_NOT_DEFINED | 0xFFFF | 104 |
98 | GPIO pin or not defined | unsigned short usGpioLedUsb; | BP_NOT_DEFINED | 0xFFFF | 106 |
100 | GPIO pin or not defined | unsigned short usGpioLedHpna; | BP_NOT_DEFINED | 0xFFFF | 108 |
102 | GPIO pin or not defined | unsigned short usGpioLedWanData; | BP_GPIO_3_AL | 0x8003 | 110 |
o così:
94 | GPIO pin or not defined | unsigned short usGpioLedAdslFail; | BP_GPIO_2_AL | 0x8002 | 98 |
96 | GPIO pin or not defined | unsigned short usGpioLedWireless; | BP_NOT_DEFINED | 0xFFFF | 100 |
UNKNOWN TELECOM | 0xFFFF | 102 | |||
UNKNOWN TELECOM | 0xFFFF | 104 | |||
98 | GPIO pin or not defined | unsigned short usGpioLedUsb; | BP_NOT_DEFINED | 0xFFFF | 106 |
100 | GPIO pin or not defined | unsigned short usGpioLedHpna; | BP_NOT_DEFINED | 0xFFFF | 108 |
102 | GPIO pin or not defined | unsigned short usGpioLedWanData; | BP_GPIO_3_AL | 0x8003 | 110 |
Questo perchè i valori in più sono annegati all'interno di altri dati aventi lo stesso valore, e quindi appaiono indistinguibili. C'è da dire che questo non comporterà problemi per quanto riguarda l'esecuzione del codice (Al binario eseguibile poco importa che il dato di tipo unsigned short definito all'offset 100 fosse chiamato usGpioLedUsb piuttosto che usGpioLedHpna all'intenro dei sorgenti, quello che importa è il valore assunto da tale variabili. Fino a quando tale valore non varia tra di esse le potremo considerare intercambiabili).
Tale incertezza potrebbe anche essere risolta effettuando l'analisi comparativa tra altre definizioni note e comuni (Ad es: 96348GW). Prima di procedere in tal senso è conveniente verificare quali sono i valori assunti dalla definizione della piattaforma MAGIC nel binario Telecom. Nel caso essi risultassero ininfluenti potremmo evitare di compiere questo lavoro.
Costruiamo ora una tabella simile alla precedente, ma procedendo al contrario… partendo cioè dai valori binari presenti nel kernel precompilato cerchiamo di ricostruirci la definizione della struttura boardparameters per le piattaforme MAGIC e MAGIC1 (In tabella sono stati evidenziati i valori delle piattaforme MAGIC e MAGIC1 che differiscono dai valori ritrovati per la piattaforma 96348GW-10).
offset | typedef struct boardparameters | Kernel Telecom MAGIC | MAGIC | Kernel Telecom MAGIC1 | MAGIC1 |
---|---|---|---|---|---|
0 | szBoardId[BP_BOARD_ID_LEN]; | MAGIC | MAGIC | MAGIC1 | MAGIC1 |
15 | ucPhyType; | 0x01 | BP_ENET_INTERNAL_PHY | 0x01 | BP_ENET_INTERNAL_PHY |
16 | ucPhyAddress; | 0x01 | 0x01 | 0x01 | 0x01 |
18 | usGpioPhySpiSck; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
20 | usGpioPhySpiSs; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
22 | usGpioPhySpiMosi; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
24 | usGpioPhySpiMiso; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
26 | usGpioPhyReset; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
28 | numSwitchPorts; | 0x0001 | 0x01 | 0x0001 | 0x01 |
30 | usConfigType; | 0x0000 | BP_ENET_CONFIG_MDIO | 0x0000 | BP_ENET_CONFIG_MDIO |
32 | usReverseMii; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
34 | UNKNOWN TELECOM | 0x0000 | 0x00 | 0x0000 | 0x00 |
36 | ucPhyType; | 0x02 | BP_ENET_EXTERNAL_PHY | 0x03 | BP_ENET_EXTERNAL_SWITCH |
37 | ucPhyAddress; | 0x00 | 0x00 | 0x00 | 0x00 |
38 | usGpioPhySpiSck; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
40 | usGpioPhySpiSs; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
42 | usGpioPhySpiMosi; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
44 | usGpioPhySpiMiso; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
46 | usGpioPhyReset; | 0x8018 | BP_GPIO_24_AL | 0x8018 | BP_GPIO_24_AL |
48 | numSwitchPorts; | 0x01 | 0x0001 | 0x03 | 0x0003 |
50 | usConfigType; | 0x0000 | BP_ENET_CONFIG_MDIO7)) | 0x0003 | BP_ENET_CONFIG_SPI_SSB_08) |
52 | usReverseMii; | 0xFFFF | BP_NOT_DEFINED | 0x0001 | BP_ENET_REVERSE_MII |
54 | UNKNOWN TELECOM | 0x0000 | 0x00 | 0x0002 | 0x02 |
56 | ucDspType; | 0x01 | BP_VOIP_DSP | 0x01 | BP_VOIP_DSP |
57 | ucDspAddress; | 0x00 | 0x00 | 0x00 | 0x00 |
58 | usExtIntrVoip; | 0x0002 | BP_EXT_INTR_2 | 0x0002 | BP_EXT_INTR_2 |
60 | usGpioVoipReset; | 0x0019 | BP_GPIO_25_AH | 0x0019 | BP_GPIO_25_AH |
62 | usGpioVoipIntr; | 0x0022 | BP_GPIO_34_AH | 0x0022 | BP_GPIO_34_AH |
64 | usGpioLedVoip; | 0x8016 | BP_GPIO_22_AL | 0x8016 | BP_GPIO_22_AL |
66 | usCsVoip; | 0x0002 | BP_CS_2 | 0x0002 | BP_CS_2 |
68 | ucDspType; | 0x00 | BP_VOIP_NO_DSP | 0x00 | BP_VOIP_NO_DSP |
69 | ucDspAddress; | 0x00 | 0x00 | ||
70 | usExtIntrVoip; | 0x00 | 0x00 | ||
72 | usGpioVoipReset; | 0x00 | 0x00 | ||
74 | usGpioVoipIntr; | 0x00 | 0x00 | ||
76 | usGpioLedVoip; | 0x00 | 0x00 | ||
78 | usCsVoip; | 0x00 | 0x00 | ||
80 | usSdramSize; | 0x0005 | BP_MEMORY_16MB_2_CHIP | 0x0005 | BP_MEMORY_16MB_2_CHIP |
82 | usPsiSize; | 0x0018 | BP_PSI_DEFAULT_SIZE | 0x0018 | BP_PSI_DEFAULT_SIZE |
84 | usGpioRj11InnerPair; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
86 | usGpioRj11OuterPair; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
88 | usGpioPressAndHoldReset; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
90 | usGpioPcmciaReset; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
92 | usGpioUartRts; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
94 | usGpioUartCts; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
96 | usGpioLedAdsl; | 0x8005 | BP_GPIO_5_AL | 0x8005 | BP_GPIO_5_AL |
98 | usGpioLedAdslFail; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
100 | usGpioLedWireless; | 0x001D | BP_GPIO_29_AH | 0x801C | BP_GPIO_28_AL |
102 | usGpioLedUsb; | 0x001C | BP_GPIO_28_AH | 0xFFFF | BP_NOT_DEFINED |
104 | usGpioLedHpna; | 0x801E | BP_GPIO_30_AL | 0x801D | BP_GPIO_29_AL |
106 | UNKNOWN TELECOM | 0x8023 | BP_GPIO_35_AL | 0x8023 | BP_GPIO_35_AL |
108 | UNKNOWN TELECOM | 0x8004 | BP_GPIO_4_AL | 0x8004 | BP_GPIO_4_AL |
110 | usGpioLedWanData; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
112 | usGpioLedPpp; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
114 | usGpioLedPppFail; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
116 | UNKNOWN TELECOM | 0x8002 | BP_GPIO_2_AL | 0x8002 | BP_GPIO_2_AL |
118 | UNKNOWN TELECOM | 0x8003 | BP_GPIO_3_AL | 0x8003 | BP_GPIO_3_AL |
120 | UNKNOWN TELECOM | 0x8017 | BP_GPIO_23_AL | 0x8017 | BP_GPIO_23_AL |
122 | usGpioLedBlPowerOn; | 0x8000 | BP_GPIO_0_AL | 0x8000 | BP_GPIO_0_AL |
124 | usGpioLedBlAlarm; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
126 | usGpioLedBlResetCfg; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
128 | usGpioLedBlStop; | 0x8001 | BP_GPIO_1_AL | 0x8001 | BP_GPIO_1_AL |
130 | usExtIntrWireless; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
132 | usExtIntrAdslDyingGasp; | 0xFFF0 | BP_HW_DEFINED | 0xFFF0 | BP_HW_DEFINED |
134 | usExtIntrHpna; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
136 | usCsHpna; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
138 | usAntInUseWireless; | 0x0003 | BP_WLAN_ANT_BOTH | 0x0003 | BP_WLAN_ANT_BOTH |
140 | usGpioSesBtnWireless; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
142 | usExtIntrSesBtnWireless; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
144 | usGpioLedSesWireless; | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
146 | UNKNOWN TELECOM | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
148 | UNKNOWN TELECOM | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
150 | UNKNOWN TELECOM | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
152 | UNKNOWN TELECOM | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
154 | UNKNOWN TELECOM | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
156 | UNKNOWN TELECOM | 0xFFFF | BP_NOT_DEFINED | 0xFFFF | BP_NOT_DEFINED |
158 | UNKNOWN TELECOM | 0x0000 | ?????????????? | 0x0000 | ?????????????? |
160 | UNKNOWN TELECOM | 0x0000 | ?????????????? | 0x0000 | ?????????????? |
162 | UNKNOWN TELECOM | 0x0000 | ?????????????? | 0x0000 | ?????????????? |
Verifichiamo adesso i valori che potevano presentare problemi perchè non univocamente assegnati dall'analisi delle differenze del 96348GW-10. L'unico blocco il cui margine di incertezza potrebbe provocare problemi è:
100 | usGpioLedWireless; | 0x001D | BP_GPIO_29_AH | 0x801C | BP_GPIO_28_AL |
102 | usGpioLedUsb; | 0x001C | BP_GPIO_28_AH | 0xFFFF | BP_NOT_DEFINED |
104 | usGpioLedHpna; | 0x801D | BP_GPIO_29_AL | 0x801E | BP_GPIO_30_AL |
106 | UNKNOWN TELECOM | 0x8023 | BP_GPIO_35_AL | 0x8023 | BP_GPIO_35_AL |
108 | UNKNOWN TELECOM | 0x8004 | BP_GPIO_4_AL | 0x8004 | BP_GPIO_4_AL |
Infatti in tale blocco sono variati tutti i valori da BP_NOT_DEFINED verso un ben preciso pin di GPIO.
Questi sono a rigore gli scenari possibili:
100 | usGpioLedWireless; | usGpioLedWireless; | usGpioLedWireless; | UNKNOWN TELECOM | usGpioLedWireless; |
102 | usGpioLedUsb; | usGpioLedUsb; | UNKNOWN TELECOM | usGpioLedWireless; | usGpioLedUsb; |
104 | usGpioLedHpna; | UNKNOWN TELECOM | usGpioLedUsb; | usGpioLedUsb; | UNKNOWN TELECOM |
106 | UNKNOWN TELECOM | usGpioLedHpna; | usGpioLedHpna; | usGpioLedHpna; | UNKNOWN TELECOM |
108 | UNKNOWN TELECOM | UNKNOWN TELECOM | UNKNOWN TELECOM | UNKNOWN TELECOM | usGpioLedHpna; |
100 | usGpioLedWireless; | usGpioLedWireless; | UNKNOWN TELECOM | UNKNOWN TELECOM | UNKNOWN TELECOM |
102 | UNKNOWN TELECOM | UNKNOWN TELECOM | usGpioLedWireless; | usGpioLedWireless; | UNKNOWN TELECOM |
104 | usGpioLedUsb; | UNKNOWN TELECOM | usGpioLedUsb; | UNKNOWN TELECOM | usGpioLedWireless; |
106 | UNKNOWN TELECOM | usGpioLedUsb; | UNKNOWN TELECOM | usGpioLedUsb; | usGpioLedUsb; |
108 | usGpioLedHpna; | usGpioLedHpna; | usGpioLedHpna; | usGpioLedHpna; | usGpioLedHpna; |
Utilizzando le argomentazioni testè affrontate è possibile sintetizzare un file di specifica per la piattaforma MAGIC (ed eventualmente MAGIC1). Tale file conterrà la nuova definizione della struttura boardparameters:
typedef struct boardparameters { char szBoardId[BP_BOARD_ID_LEN]; /* board id string */ ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS]; VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP]; unsigned short usSdramSize; /* SDRAM size and type */ unsigned short usPsiSize; /* persistent storage in K bytes */ unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */ unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */ unsigned short usGpioPressAndHoldReset; /* GPIO pin or not defined */ unsigned short usGpioPcmciaReset; /* GPIO pin or not defined */ unsigned short usGpioUartRts; /* GPIO pin or not defined */ unsigned short usGpioUartCts; /* GPIO pin or not defined */ unsigned short usGpioLedAdsl; /* GPIO pin or not defined */ unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */ unsigned short usGpioLedWireless; /* GPIO pin or not defined */ unsigned short usGpioLedUsb; /* GPIO pin or not defined */ unsigned short usGpioLedHpna; /* GPIO pin or not defined */ #ifdef UNKNOWN_TELECOM unsigned short usGpioUnknownTelecom1; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom2; /* Padding for compatibility with precompiled telecom modules */ #endif unsigned short usGpioLedWanData; /* GPIO pin or not defined */ unsigned short usGpioLedPpp; /* GPIO pin or not defined */ unsigned short usGpioLedPppFail; /* GPIO pin or not defined */ #ifdef UNKNOWN_TELECOM unsigned short usGpioUnknownTelecom4; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom5; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom6; /* Padding for compatibility with precompiled telecom modules */ #endif unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */ unsigned short usGpioLedBlAlarm; /* GPIO pin or not defined */ unsigned short usGpioLedBlResetCfg; /* GPIO pin or not defined */ unsigned short usGpioLedBlStop; /* GPIO pin or not defined */ unsigned short usExtIntrWireless; /* ext intr or not defined */ unsigned short usExtIntrAdslDyingGasp; /* ext intr or not defined */ unsigned short usExtIntrHpna; /* ext intr or not defined */ unsigned short usCsHpna; /* chip select not defined */ unsigned short usAntInUseWireless; /* antenna in use or not defined */ unsigned short usGpioSesBtnWireless; /* GPIO pin or not defined */ unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */ unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */ #ifdef UNKNOWN_TELECOM unsigned short usGpioUnknownTelecom7; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom8; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom9; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom10; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom11; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom12; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom13; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom14; /* Padding for compatibility with precompiled telecom modules */ unsigned short usGpioUnknownTelecom15; /* Padding for compatibility with precompiled telecom modules */ #endif } BOARD_PARAMETERS, *PBOARD_PARAMETERS;
e la relativa istanza:
static BOARD_PARAMETERS g_bcmmagic = { "MAGIC", /* szBoardId */ {{BP_ENET_INTERNAL_PHY, /* ucPhyType */ 0x01, /* ucPhyAddress */ BP_NOT_DEFINED, /* usGpioPhySpiSck */ BP_NOT_DEFINED, /* usGpioPhySpiSs */ BP_NOT_DEFINED, /* usGpioPhySpiMosi */ BP_NOT_DEFINED, /* usGpioPhySpiMiso */ BP_NOT_DEFINED, /* usGpioPhyReset */ 0x01, /* numSwitchPorts */ BP_ENET_CONFIG_MDIO, /* usConfigType */ BP_NOT_DEFINED /* usReverseMii */ #ifdef UNKNOWN_TELECOM ,BP_NOT_DEFINED #endif }, {BP_ENET_EXTERNAL_PHY, /* ucPhyType */ 0x00, /* ucPhyAddress */ BP_NOT_DEFINED, /* usGpioPhySpiSck */ BP_NOT_DEFINED, /* usGpioPhySpiSs */ BP_NOT_DEFINED, /* usGpioPhySpiMosi */ BP_NOT_DEFINED, /* usGpioPhySpiMiso */ BP_GPIO_24_AL, /* usGpioPhyReset */ 0x01, /* numSwitchPorts */ BP_ENET_CONFIG_MDIO, /* usConfigType */ BP_NOT_DEFINED /* usReverseMii */ #ifdef UNKNOWN_TELECOM ,BP_NOT_DEFINED #endif }}, {{BP_VOIP_DSP, /* ucDspType */ 0x00, /* ucDspAddress */ BP_EXT_INTR_2, /* usExtIntrVoip */ BP_GPIO_25_AH, /* usGpioVoipReset */ BP_GPIO_34_AH, /* usGpioVoipIntr */ BP_GPIO_22_AL, /* usGpioLedVoip */ BP_CS_2}, /* usCsVoip */ {BP_VOIP_NO_DSP}}, /* ucDspType */ BP_MEMORY_16MB_2_CHIP, /* usSdramSize */ BP_PSI_DEFAULT_SIZE, /* usPsiSize */ BP_NOT_DEFINED, /* usGpioRj11InnerPair */ BP_NOT_DEFINED, /* usGpioRj11OuterPair */ BP_NOT_DEFINED, /* usGpioPressAndHoldReset */ BP_NOT_DEFINED, /* usGpioPcmciaReset */ BP_NOT_DEFINED, /* usGpioUartRts */ BP_NOT_DEFINED, /* usGpioUartCts */ BP_GPIO_5_AL, /* usGpioLedAdsl */ BP_NOT_DEFINED, /* usGpioLedAdslFail */ BP_GPIO_29_AH, /* usGpioLedWireless */ BP_GPIO_28_AH, /* usGpioLedUsb */ BP_GPIO_30_AL, /* usGpioLedHpna */ #ifdef UNKNOWN_TELECOM BP_GPIO_35_AL, BP_GPIO_4_AL, #endif BP_NOT_DEFINED, /* usGpioLedWanData */ BP_NOT_DEFINED, /* usGpioLedPpp */ BP_NOT_DEFINED, /* usGpioLedPppFail */ #ifdef UNKNOWN_TELECOM BP_GPIO_2_AL, BP_GPIO_3_AL, BP_GPIO_23_AL, #endif BP_GPIO_0_AL, /* usGpioLedBlPowerOn */ BP_NOT_DEFINED, /* usGpioLedBlAlarm */ BP_NOT_DEFINED, /* usGpioLedBlResetCfg */ BP_GPIO_1_AL, /* usGpioLedBlStop */ BP_NOT_DEFINED, /* usExtIntrWireless */ BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */ BP_NOT_DEFINED, /* usExtIntrHpna */ BP_NOT_DEFINED, /* usCsHpna */ BP_WLAN_ANT_BOTH, /* usAntInUseWireless */ BP_NOT_DEFINED, /* usGpioSesBtnWireless */ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ BP_NOT_DEFINED /* usGpioLedSesWireless */ #ifdef UNKNOWN_TELECOM ,BP_NOT_DEFINED, BP_GPIO_6_AL, BP_GPIO_7_AL, BP_GPIO_4_AH, BP_GPIO_1_AH, BP_GPIO_1_AH, BP_GPIO_0_AH, 0x3000, BP_GPIO_0_AH #endif }; static PBOARD_PARAMETERS g_BoardParms[] = {&g_bcmmagic, 0};
Ovviamente tale definizione è creata su basi totalmente speculative, non avendo provato nel dettaglio quale tra le combinazioni reali di segnali indicate nel paragrafo precedente sia quella valida.
Fortunatamente Telsey ha ora rilasciato i sorgenti (o quanto meno quelli che loro spacciano per i sorgenti di compilazione del Telsey… ma che sono talmente ben strutturati da non compilare neppure !!!9)) e quindi noi possiamo utilizzare la definizione presente in tali sorgenti per svelare l'arcano :)
Ecco al definizione di BOARD_PARAMETERS presente nei sorgenti GPL rilasciati da Telsey:
typedef struct boardparameters { char szBoardId[BP_BOARD_ID_LEN]; /* board id string */ ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS]; VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP]; unsigned short usSdramSize; /* SDRAM size and type */ unsigned short usPsiSize; /* persistent storage in K bytes */ unsigned short usGpioRj11InnerPair; /* GPIO pin or not defined */ unsigned short usGpioRj11OuterPair; /* GPIO pin or not defined */ unsigned short usGpioPressAndHoldReset; /* GPIO pin or not defined */ unsigned short usGpioPcmciaReset; /* GPIO pin or not defined */ unsigned short usGpioUartRts; /* GPIO pin or not defined */ unsigned short usGpioUartCts; /* GPIO pin or not defined */ unsigned short usGpioLedAdsl; /* GPIO pin or not defined */ unsigned short usGpioLedAdslFail; /* GPIO pin or not defined */ unsigned short usGpioLedWirelessOn; /* GPIO pin or not defined */ unsigned short usGpioLedWirelessOff; /* GPIO pin or not defined */ unsigned short usGpioLedWirelessFail; /* GPIO pin or not defined */ unsigned short usGpioLedUsb; /* GPIO pin or not defined */ unsigned short usGpioLedHpna; /* GPIO pin or not defined */ unsigned short usGpioLedWanData; /* GPIO pin or not defined */ unsigned short usGpioLedPpp; /* GPIO pin or not defined */ unsigned short usGpioLedPppFail; /* GPIO pin or not defined */ unsigned short usGpioLedService; /* GPIO pin or not defined */ unsigned short usGpioLedServiceFail; /* GPIO pin or not defined */ unsigned short usGpioLedVoipFail; /* GPIO pin or not defined */ unsigned short usGpioLedBlPowerOn; /* GPIO pin or not defined */ unsigned short usGpioLedBlAlarm; /* GPIO pin or not defined */ unsigned short usGpioLedBlResetCfg; /* GPIO pin or not defined */ unsigned short usGpioLedBlStop; /* GPIO pin or not defined */ unsigned short usExtIntrWireless; /* ext intr or not defined */ unsigned short usExtIntrAdslDyingGasp; /* ext intr or not defined */ unsigned short usExtIntrHpna; /* ext intr or not defined */ unsigned short usCsHpna; /* chip select not not defined */ unsigned short usAntInUseWireless; /* antenna in use or not defined */ unsigned short usGpioSesBtnWireless; /* GPIO pin or not defined */ unsigned short usExtIntrSesBtnWireless; /* ext intr or not defined */ unsigned short usGpioLedSesWireless; /* GPIO pin or not defined */ unsigned short usGpioLedPhone1; /* GPIO pin or not defined */ unsigned short usGpioLedPhone2; /* GPIO pin or not defined */ unsigned short usExtIntrSmc; /* ext intr or not defined */ unsigned short usCsSmc; /* chip select not not defined */ unsigned short usExtIntrCnfButton; /* ext intr or not defined */ unsigned short usOptTranscvReset; /* GPIO pin or not defined */ unsigned short usResetSpiFlash; /* GPIO pin or not defined */ unsigned short usSpiSwitchEnable; /* GPIO pin or not defined */ unsigned short usSpiSSEE; /* GPIO pin or not defined */ unsigned short usSpiSwitchEnable1; /* GPIO pin or not defined */ unsigned short usGPIO31; /* GPIO pin or not defined */ unsigned short usGpioRestoreBtn; /* ext intr or not defined */ unsigned int hwVersMask; /* GPIO pin mask for hardware version (must be 32 bits)*/ } BOARD_PARAMETERS, *PBOARD_PARAMETERS;
Anche qui non possiamo dire di essere fortunatissimi… Il kernel che abbiamo decompilato non è l'ultima versione rilasciata da Telecom, e probabilmente era compilato a partire da un SDK broadcom più vecchio di quello che stiamo analizzando ora. Infatti la sizeof(BOARD_PARAMETERS) è 170 byte
Rispetto al sorgente che abbiamo analizzato in precedenza sono state aggiunte le seguenti definizioni:
unsigned short usGpioLedWirelessOn; /* GPIO pin or not defined - Era usGpioLedWireless */ unsigned short usGpioLedWirelessOff; /* GPIO pin or not defined */ unsigned short usGpioLedWirelessFail; /* GPIO pin or not defined */
unsigned short usGpioLedService; /* GPIO pin or not defined */ unsigned short usGpioLedServiceFail; /* GPIO pin or not defined */ unsigned short usGpioLedVoipFail; /* GPIO pin or not defined */
unsigned short usGpioLedPhone1; /* GPIO pin or not defined */ unsigned short usGpioLedPhone2; /* GPIO pin or not defined */ unsigned short usExtIntrSmc; /* ext intr or not defined */ unsigned short usCsSmc; /* chip select not not defined */ unsigned short usExtIntrCnfButton; /* ext intr or not defined */ unsigned short usOptTranscvReset; /* GPIO pin or not defined */ unsigned short usResetSpiFlash; /* GPIO pin or not defined */ unsigned short usSpiSwitchEnable; /* GPIO pin or not defined */ unsigned short usSpiSSEE; /* GPIO pin or not defined */ unsigned short usSpiSwitchEnable1; /* GPIO pin or not defined */ unsigned short usGPIO31; /* GPIO pin or not defined */ unsigned short usGpioRestoreBtn; /* ext intr or not defined */ unsigned int hwVersMask; /* GPIO pin mask for hardware version (must be 32 bits)*/
Queste invece la nuova struttura di ETHERNET_MAC_INFO:
typedef struct EthernetMacInfo { unsigned char ucPhyType; /* BP_ENET_xxx */ unsigned char ucPhyAddress; /* 0 to 31 */ unsigned short usGpioPhySpiSck; /* GPIO pin or not defined */ unsigned short usGpioPhySpiSs; /* GPIO pin or not defined */ unsigned short usGpioPhySpiMosi; /* GPIO pin or not defined */ unsigned short usGpioPhySpiMiso; /* GPIO pin or not defined */ unsigned short usGpioPhyReset; /* GPIO pin or not defined (96348LV) */ unsigned short numSwitchPorts; /* Number of PHY ports */ unsigned short uplinkIndex; /* index of uplink port in switch */ unsigned short usConfigType; /* Configuration type */ unsigned short usReverseMii; /* Reverse MII */ unsigned short usSwitchType; } ETHERNET_MAC_INFO, *PETHERNET_MAC_INFO;
a cui sono stati aggiunti i campi:
unsigned short uplinkIndex; /* index of uplink port in switch */
e
unsigned short usSwitchType;
Non si rilevano variazioni invece per la struttura VOIP_DSP_INFO. Ecco infine la definizione della piattaforma MAGIC come indicata nei sorgenti Telsey:
static BOARD_PARAMETERS g_magic = { "MAGIC", /* szBoardId */ {{BP_ENET_INTERNAL_PHY, /* ucPhyType */ 0x01, /* ucPhyAddress */ BP_NOT_DEFINED, /* usGpioPhySpiSck */ BP_NOT_DEFINED, /* usGpioPhySpiSs */ BP_NOT_DEFINED, /* usGpioPhySpiMosi */ BP_NOT_DEFINED, /* usGpioPhySpiMiso */ BP_NOT_DEFINED, /* usGpioPhyReset */ 0x01, /* numSwitchPorts */ BP_NOT_DEFINED, /* uplinkIndex */ BP_ENET_CONFIG_MDIO, /* usConfigType */ BP_NOT_DEFINED, /* usReverseMii */ BP_NO_SWITCH}, /* usSwitchType */ {BP_ENET_EXTERNAL_PHY, /* ucPhyType */ 0x00, /* ucPhyAddress */ BP_NOT_DEFINED, /* usGpioPhySpiSck */ BP_NOT_DEFINED, /* usGpioPhySpiSs */ BP_NOT_DEFINED, /* usGpioPhySpiMosi */ BP_NOT_DEFINED, /* usGpioPhySpiMiso */ BP_GPIO_24_AL, /* usGpioPhyReset */ 0x01, /* numSwitchPorts */ BP_NOT_DEFINED, /* uplinkIndex */ BP_ENET_CONFIG_MDIO, /* usConfigType */ BP_NOT_DEFINED, /* usReverseMii */ BP_NO_SWITCH}}, /* usSwitchType */ {{BP_VOIP_DSP, /* ucDspType */ 0x00, /* ucDspAddress */ BP_EXT_INTR_2, /* usExtIntrVoip */ BP_GPIO_25_AH, /* usGpioVoipReset */ BP_GPIO_34_AH, /* usGpioVoipIntr */ BP_GPIO_22_AL, /* usGpioLedVoip */ BP_CS_2}, /* usCsVoip */ {BP_VOIP_NO_DSP}}, /* ucDspType */ BP_MEMORY_16MB_2_CHIP, /* usSdramSize */ BP_PSI_DEFAULT_SIZE, /* usPsiSize */ BP_NOT_DEFINED, /* usGpioRj11InnerPair */ BP_NOT_DEFINED, /* usGpioRj11OuterPair */ BP_NOT_DEFINED, /* usGpioPressAndHoldReset */ BP_NOT_DEFINED, /* usGpioPcmciaReset */ BP_NOT_DEFINED, /* usGpioUartRts */ BP_NOT_DEFINED, /* usGpioUartCts */ BP_GPIO_5_AL, /* usGpioLedAdsl */ BP_NOT_DEFINED, /* usGpioLedAdslFail */ BP_GPIO_29_AH, /* usGpioLedWirelessOn 28 */ BP_GPIO_28_AH, /* usGpioLedWirelessOff 29*/ BP_GPIO_30_AL, /* usGpioLedWirelessFail */ BP_GPIO_35_AL, /* usGpioLedUsb */ BP_GPIO_4_AL, /* usGpioLedHpna */ BP_NOT_DEFINED, /* usGpioLedWanData */ BP_NOT_DEFINED, /* usGpioLedPpp */ BP_NOT_DEFINED, /* usGpioLedPppFail */ BP_GPIO_2_AL, /* usGpioLedService */ BP_GPIO_3_AL, /* usGpioLedServiceFail */ BP_GPIO_23_AL, /* usGpioLedVoipFail */ BP_GPIO_0_AL, /* usGpioLedBlPowerOn */ BP_NOT_DEFINED, /* usGpioLedBlAlarm */ BP_NOT_DEFINED, /* usGpioLedBlResetCfg */ BP_GPIO_1_AL, /* usGpioLedBlStop */ BP_NOT_DEFINED, /* usExtIntrWireless */ BP_HW_DEFINED, /* usExtIntrAdslDyingGasp */ BP_NOT_DEFINED, /* usExtIntrHpna */ BP_NOT_DEFINED, /* usCsHpna */ BP_WLAN_ANT_BOTH, /* usAntInUseWireless */ BP_NOT_DEFINED, /* usGpioSesBtnWireless */ BP_NOT_DEFINED, /* usExtIntrSesBtnWireless */ BP_NOT_DEFINED, /* usGpioLedSesWireless */ BP_GPIO_6_AL, /* usGpioLedPhone1 */ BP_GPIO_7_AL, /* usGpioLedPhone2 */ BP_NOT_DEFINED, /* usExtIntrSmc */ BP_CS_1, /* usCsSmc */ BP_EXT_INTR_1, /* usExtIntrCnfButton */ BP_NOT_DEFINED, /* usOptTranscvReset */ BP_NOT_DEFINED, /* usResetSpiFlash */ BP_NOT_DEFINED, /* usSpiSwitchEnable */ BP_NOT_DEFINED, /* usSpiSSEE */ BP_NOT_DEFINED, /* usSpiSwitchEnable1 */ BP_NOT_DEFINED, /* usGPIO31 */ BP_NOT_DEFINED, /* usGpioRestoreBtn */ MAGIC_MASK /* hwVersMask */ };
Confrontiamola con la definizione ricavata nei paragrafi precedenti, tenendo conto delle variazioni nella struttura che occorrono a causa del disallineamento degli ambienti di SDK broadcom:
descrizione | typedef struct boardparameters | Janniz | Telsey | |
---|---|---|---|---|
board id string | char szBoardId[BP_BOARD_ID_LEN]; | MAGIC | MAGIC | |
Information about an Ethernet MAC. 10) | ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS] | |||
BP_ENET_xxx | unsigned char ucPhyType; | BP_ENET_INTERNAL_PHY | BP_ENET_INTERNAL_PHY | |
0 to 31 | unsigned char ucPhyAddress; | 0x01 | 0x01 | |
GPIO pin or not defined | unsigned short usGpioPhySpiSck; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPhySpiSs; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPhySpiMosi; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPhySpiMiso; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined (96348LV) | unsigned short usGpioPhyReset; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
Number of PHY ports | unsigned short numSwitchPorts; | 0x01 | 0x01 | |
index of uplink port in switch | unsigned short uplinkIndex; | BP_NOT_DEFINED | ||
Configuration type | unsigned short usConfigType; | BP_ENET_CONFIG_MDIO | BP_ENET_CONFIG_MDIO | |
Reverse MII | unsigned short usReverseMii; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
SwitchType11) | unsigned short usSwitchType; | 0x0000 | BP_NO_SWITCH | |
Information about an Ethernet MAC. 12) | ETHERNET_MAC_INFO EnetMacInfos[BP_MAX_ENET_MACS] | |||
BP_ENET_xxx | unsigned char ucPhyType; | BP_ENET_EXTERNAL_PHY | BP_ENET_EXTERNAL_PHY | |
0 to 31 | unsigned char ucPhyAddress; | 0x00 | 0x00 | |
GPIO pin or not defined | unsigned short usGpioPhySpiSck; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPhySpiSs; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPhySpiMosi; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPhySpiMiso; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined (96348LV) | unsigned short usGpioPhyReset; | BP_GPIO_24_AL | BP_GPIO_24_AL | |
Number of PHY ports | unsigned short numSwitchPorts; | 0x01 | 0x01 | |
index of uplink port in switch | unsigned short uplinkIndex; | BP_NOT_DEFINED | ||
Configuration type | unsigned short usConfigType; | BP_ENET_CONFIG_MDIO | BP_ENET_CONFIG_MDIO | |
Reverse MII | unsigned short usReverseMii; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
SwitchType13) | unsigned short usSwitchType; | 0x0000 | BP_NO_SWITCH | |
Information about VoIP DSPs. 14) | VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP] | |||
unsigned char ucDspType; | BP_VOIP_DSP | BP_VOIP_DSP | ||
unsigned char ucDspAddress; | 0x00 | 0x00 | ||
unsigned short usExtIntrVoip; | BP_EXT_INTR_2 | BP_EXT_INTR_2 | ||
unsigned short usGpioVoipReset; | BP_GPIO_25_AH | BP_GPIO_25_AH | ||
unsigned short usGpioVoipIntr; | BP_GPIO_34_AH | BP_GPIO_34_AH | ||
unsigned short usGpioLedVoip; | BP_GPIO_22_AL | BP_GPIO_22_AL | ||
unsigned short usCsVoip; | BP_CS_2 | BP_CS_2 | ||
Information about VoIP DSPs. 15) | VOIP_DSP_INFO VoIPDspInfo[BP_MAX_VOIP_DSP] | |||
unsigned char ucDspType; | BP_VOIP_NO_DSP | BP_VOIP_NO_DSP | ||
unsigned char ucDspAddress; | 0x00 | 0x00 | ||
unsigned short usExtIntrVoip; | 0x00 | 0x00 | ||
unsigned short usGpioVoipReset; | 0x00 | 0x00 | ||
unsigned short usGpioVoipIntr; | 0x00 | 0x00 | ||
unsigned short usGpioLedVoip; | 0x00 | 0x00 | ||
unsigned short usCsVoip; | 0x00 | 0x00 | ||
SDRAM size and type | unsigned short usSdramSize; | BP_MEMORY_16MB_2_CHIP | BP_MEMORY_16MB_2_CHIP | |
persistent storage in K bytes | unsigned short usPsiSize; | BP_PSI_DEFAULT_SIZE | BP_PSI_DEFAULT_SIZE | |
GPIO pin or not defined | unsigned short usGpioRj11InnerPair; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioRj11OuterPair; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPressAndHoldReset; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioPcmciaReset; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioUartRts; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioUartCts; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioLedAdsl; | BP_GPIO_5_AL | BP_GPIO_5_AL | |
GPIO pin or not defined | unsigned short usGpioLedAdslFail; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioLedWirelessOn;16) | BP_GPIO_29_AH | BP_GPIO_29_AH | |
GPIO pin or not defined17) | unsigned short usGpioLedWirelessOff; | BP_GPIO_28_AH | BP_GPIO_28_AH | |
GPIO pin or not defined18) | unsigned short usGpioLedWirelessFail; | BP_GPIO_30_AL | BP_GPIO_30_AL | |
GPIO pin or not defined | unsigned short usGpioLedUsb; | BP_GPIO_35_AL | BP_GPIO_35_AL | |
GPIO pin or not defined | unsigned short usGpioLedHpna; | BP_GPIO_4_AL | BP_GPIO_4_AL | |
GPIO pin or not defined | unsigned short usGpioLedWanData; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioLedPpp; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioLedPppFail; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined19) | unsigned short usGpioLedService; | BP_GPIO_2_AL | BP_GPIO_2_AL | |
GPIO pin or not defined20) | unsigned short usGpioLedServiceFail; | BP_GPIO_3_AL | BP_GPIO_3_AL | |
GPIO pin or not defined21) | unsigned short usGpioLedVoipFail; | BP_GPIO_23_AL | BP_GPIO_23_AL | |
GPIO pin or not defined | unsigned short usGpioLedBlPowerOn; | BP_GPIO_0_AL | BP_GPIO_0_AL | |
GPIO pin or not defined | unsigned short usGpioLedBlAlarm; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioLedBlResetCfg; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioLedBlStop; | BP_GPIO_1_AL | BP_GPIO_1_AL | |
ext intr or not defined | unsigned short usExtIntrWireless; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
ext intr or not defined | unsigned short usExtIntrAdslDyingGasp; | BP_HW_DEFINED | BP_HW_DEFINED | |
ext intr or not defined | unsigned short usExtIntrHpna; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
chip select not defined | unsigned short usCsHpna; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
antenna in use or not defined | unsigned short usAntInUseWireless; | BP_WLAN_ANT_BOTH | BP_WLAN_ANT_BOTH | |
GPIO pin or not defined | unsigned short usGpioSesBtnWireless; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
ext intr or not defined | unsigned short usExtIntrSesBtnWireless; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
GPIO pin or not defined | unsigned short usGpioLedSesWireless; | BP_NOT_DEFINED | BP_NOT_DEFINED | |
UNKNOWN TELECOM | BP_NOT_DEFINED | |||
GPIO pin or not defined22) | unsigned short usGpioLedPhone1; | BP_GPIO_6_AL | BP_GPIO_6_AL | |
GPIO pin or not defined23) | unsigned short usGpioLedPhone2; | BP_GPIO_7_AL | BP_GPIO_7_AL | |
GPIO pin or not defined24) | unsigned short usExtIntrSmc; | 0x0004 | BP_NOT_DEFINED | |
GPIO pin or not defined25) | unsigned short usCsSmc; | 0x0001 | BP_CS_1 | |
GPIO pin or not defined26) | unsigned short usExtIntrCnfButton; | 0x0001 | BP_EXT_INTR_1 | |
UNKNOWN TELECOM | 0x0000 | |||
GPIO pin or not defined | unsigned short usOptTranscvReset; | BP_NOT_DEFINED | ||
GPIO pin or not defined | unsigned short usResetSpiFlash; | BP_NOT_DEFINED | ||
GPIO pin or not defined | unsigned short usSpiSwitchEnable; | BP_NOT_DEFINED | ||
GPIO pin or not defined | unsigned short usSpiSSEE; | BP_NOT_DEFINED | ||
GPIO pin or not defined | unsigned short usSpiSwitchEnable1; | BP_NOT_DEFINED | ||
GPIO pin or not defined | unsigned short usGPIO31; | BP_NOT_DEFINED | ||
GPIO pin or not defined | unsigned short usGpioRestoreBtn; | BP_NOT_DEFINED | ||
GPIO pin mask for hardware version (must be 32 bits)27) | unsigned int hwVersMask; | 0x30000000 | MAGIC_MASK |
Quest'ultimo confronto ci fornisce alcune informazioni che vale la pena annotare: