Skip to content

Commit 943a0e9

Browse files
committed
eep6174: add CTL dumping support
Add support for Conformance Test Limit (CTL) data dumping. QCA6174 utilizes the same CTL storage scheme as AR93xx and QCA988x, just at another offsets. So reuse existing dumping routine. Capability flags location is still unknown so dump both 2GHz and 5GHz bands since we have no option to check for really supported bands.
1 parent ee16510 commit 943a0e9

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

eep_6174.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,28 @@ static void eep_6174_dump_base_header(struct atheepmgr *aem)
9999

100100
static void eep_6174_dump_power_info(struct atheepmgr *aem)
101101
{
102+
#define PR_CTL(__pref, __band, __is_2g) \
103+
do { \
104+
EEP_PRINT_SUBSECT_NAME(__pref " CTL data"); \
105+
ar9300_dump_ctl(eep->ctlIndex ## __band, \
106+
(uint8_t *)eep->ctlFreqBin ## __band, \
107+
(uint8_t *)eep->ctlData ## __band, \
108+
QCA6174_NUM_ ## __band ## _CTLS, \
109+
QCA6174_NUM_ ## __band ## _BAND_EDGES, \
110+
__is_2g); \
111+
} while (0);
112+
102113
const struct eep_6174_priv *emp = aem->eepmap_priv;
103114
const struct qca6174_eeprom *eep = &emp->eep;
104115

105116
EEP_PRINT_SECT_NAME("EEPROM Power Info");
117+
118+
if (1) /* TODO: 2GHz support test */
119+
PR_CTL("2 GHz", 2G, 1);
120+
if (1) /* TODO: 5GHz support test */
121+
PR_CTL("5 GHz", 5G, 0);
122+
123+
#undef PR_CTL
106124
}
107125

108126
const struct eepmap eepmap_6174 = {

eep_6174.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919

2020
#define QCA6174_CUSTOMER_DATA_SIZE 20
2121

22+
#define QCA6174_NUM_2G_CTLS 18
23+
#define QCA6174_NUM_2G_BAND_EDGES 4
24+
#define QCA6174_NUM_5G_CTLS 18
25+
#define QCA6174_NUM_5G_BAND_EDGES 8
26+
2227
struct qca6174_base_eep_hdr {
2328
uint16_t length;
2429
uint16_t checksum;
@@ -32,7 +37,21 @@ struct qca6174_base_eep_hdr {
3237
struct qca6174_eeprom {
3338
struct qca6174_base_eep_hdr baseEepHeader;
3439

35-
uint8_t __unkn_0040[8060]; /* to match structure size to the EEPROM data size */
40+
uint8_t __unkn_0040[2008];
41+
42+
uint8_t ctlIndex2G[QCA6174_NUM_2G_CTLS];
43+
uint8_t __pad_082a[2];
44+
uint8_t ctlFreqBin2G[QCA6174_NUM_2G_CTLS][QCA6174_NUM_2G_BAND_EDGES];
45+
uint8_t ctlData2G[QCA6174_NUM_2G_CTLS][QCA6174_NUM_2G_BAND_EDGES];
46+
47+
uint8_t __unkn_08bc[3766];
48+
49+
uint8_t ctlIndex5G[QCA6174_NUM_5G_CTLS];
50+
uint8_t __pad_1784[4];
51+
uint8_t ctlFreqBin5G[QCA6174_NUM_5G_CTLS][QCA6174_NUM_5G_BAND_EDGES];
52+
uint8_t ctlData5G[QCA6174_NUM_5G_CTLS][QCA6174_NUM_5G_BAND_EDGES];
53+
54+
uint8_t __unkn_18a8[1812]; /* to match structure size to the EEPROM data size */
3655
} __attribute__ ((packed));
3756

3857
/* Structure size watchdog */

0 commit comments

Comments
 (0)