diff --git a/ath10k-4.13/core.c b/ath10k-4.13/core.c index e296146..e8f781e 100644 --- a/ath10k-4.13/core.c +++ b/ath10k-4.13/core.c @@ -2874,15 +2874,29 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, ath10k_wmi_pdev_set_fwtest(ar, 20, ar->eeprom_overrides.rc_txbf_probe); - for (i = 0; ieeprom_configAddrs); i += 2) { + for (i = 0; ieeprom_configAddrs); ) { if (ar->eeprom_configAddrs[i]) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: 0x%08x 0x%08x\n", - i, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1]); + #define CONFIG_ADDR_MODE_SHIFT 20 + int mode = (ar->eeprom_configAddrs[i] >> CONFIG_ADDR_MODE_SHIFT) & 0x3; + int count = 1; // one setting applied to both 2G and 5G + int q; + + if (mode == 2) // 2G, 5G value tuple + count = 2; + else if (mode == 3) // 2G_VHT20, 2G_VHT40, 5G_VHT20, 5G_VHT40, 5G_VHT80 + count = 4; + ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: mode: %d count: %d 0x%08x 0x%08x 0x%08x\n", + i, mode, count, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1], + (count >= 2) ? ar->eeprom_configAddrs[i+2] : 0); ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_A, ar->eeprom_configAddrs[i]); - ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_V, - ar->eeprom_configAddrs[i+1]); + for (q = 0; qeeprom_configAddrs[i + q + 1]); + } + + i += (count + 1); } else { break; diff --git a/ath10k-4.13/wmi.h b/ath10k-4.13/wmi.h index 4a7f3fb..654db6b 100644 --- a/ath10k-4.13/wmi.h +++ b/ath10k-4.13/wmi.h @@ -6839,8 +6839,13 @@ struct wmi_pdev_set_special_cmd { * (see 'peers' debugfs for peer id listing) * val = peer_id << 16 | ant-mask-value */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. + * The mode should normally be OR'd in to the address. + */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. Multiple values may + * be appended if the mode supports it. + */ +#define SET_SPECIAL_ID_PEER_STATS_PN 0x16 /* Report PN in peer-stats object */ /* Requires specially compiled firmware (-T option) to have any useful effect. */ #define SET_SPECIAL_ID_TX_DBG 0x99 /* 0x1 == enable, 0x2 == pkt-dbg, 0x0 == disable (default). */ diff --git a/ath10k-4.16/core.c b/ath10k-4.16/core.c index e900d74..1990c7a 100644 --- a/ath10k-4.16/core.c +++ b/ath10k-4.16/core.c @@ -3053,15 +3053,29 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, ath10k_wmi_pdev_set_fwtest(ar, 20, ar->eeprom_overrides.rc_txbf_probe); - for (i = 0; ieeprom_configAddrs); i += 2) { + for (i = 0; ieeprom_configAddrs); ) { if (ar->eeprom_configAddrs[i]) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: 0x%08x 0x%08x\n", - i, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1]); + #define CONFIG_ADDR_MODE_SHIFT 20 + int mode = (ar->eeprom_configAddrs[i] >> CONFIG_ADDR_MODE_SHIFT) & 0x3; + int count = 1; // one setting applied to both 2G and 5G + int q; + + if (mode == 2) // 2G, 5G value tuple + count = 2; + else if (mode == 3) // 2G_VHT20, 2G_VHT40, 5G_VHT20, 5G_VHT40, 5G_VHT80 + count = 4; + ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: mode: %d count: %d 0x%08x 0x%08x 0x%08x\n", + i, mode, count, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1], + (count >= 2) ? ar->eeprom_configAddrs[i+2] : 0); ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_A, ar->eeprom_configAddrs[i]); - ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_V, - ar->eeprom_configAddrs[i+1]); + for (q = 0; qeeprom_configAddrs[i + q + 1]); + } + + i += (count + 1); } else { break; diff --git a/ath10k-4.16/wmi.h b/ath10k-4.16/wmi.h index 1d57f7a..cd319ea 100644 --- a/ath10k-4.16/wmi.h +++ b/ath10k-4.16/wmi.h @@ -7049,8 +7049,12 @@ struct wmi_pdev_set_special_cmd { * (see 'peers' debugfs for peer id listing) * val = peer_id << 16 | ant-mask-value */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. + * The mode should normally be OR'd in to the address. + */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. Multiple values may + * be appended if the mode supports it. + */ #define SET_SPECIAL_ID_PEER_STATS_PN 0x16 /* Report PN in peer-stats object */ /* Requires specially compiled firmware (-T option) to have any useful effect. */ diff --git a/ath10k-4.19/core.c b/ath10k-4.19/core.c index d5142ac..aa86b33 100644 --- a/ath10k-4.19/core.c +++ b/ath10k-4.19/core.c @@ -3128,15 +3128,29 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, ath10k_wmi_pdev_set_fwtest(ar, 20, ar->eeprom_overrides.rc_txbf_probe); - for (i = 0; ieeprom_configAddrs); i += 2) { + for (i = 0; ieeprom_configAddrs); ) { if (ar->eeprom_configAddrs[i]) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: 0x%08x 0x%08x\n", - i, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1]); + #define CONFIG_ADDR_MODE_SHIFT 20 + int mode = (ar->eeprom_configAddrs[i] >> CONFIG_ADDR_MODE_SHIFT) & 0x3; + int count = 1; // one setting applied to both 2G and 5G + int q; + + if (mode == 2) // 2G, 5G value tuple + count = 2; + else if (mode == 3) // 2G_VHT20, 2G_VHT40, 5G_VHT20, 5G_VHT40, 5G_VHT80 + count = 4; + ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: mode: %d count: %d 0x%08x 0x%08x 0x%08x\n", + i, mode, count, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1], + (count >= 2) ? ar->eeprom_configAddrs[i+2] : 0); ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_A, ar->eeprom_configAddrs[i]); - ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_V, - ar->eeprom_configAddrs[i+1]); + for (q = 0; qeeprom_configAddrs[i + q + 1]); + } + + i += (count + 1); } else { break; diff --git a/ath10k-4.19/wmi.h b/ath10k-4.19/wmi.h index e4761c8..1ca8546 100644 --- a/ath10k-4.19/wmi.h +++ b/ath10k-4.19/wmi.h @@ -7199,8 +7199,12 @@ struct wmi_pdev_set_special_cmd { * (see 'peers' debugfs for peer id listing) * val = peer_id << 16 | ant-mask-value */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. + * The mode should normally be OR'd in to the address. + */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. Multiple values may + * be appended if the mode supports it. + */ #define SET_SPECIAL_ID_PEER_STATS_PN 0x16 /* Report PN in peer-stats object */ /* Requires specially compiled firmware (-T option) to have any useful effect. */ diff --git a/ath10k-4.20/core.c b/ath10k-4.20/core.c index df89859..6b70c21 100644 --- a/ath10k-4.20/core.c +++ b/ath10k-4.20/core.c @@ -3388,15 +3388,29 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, ath10k_wmi_pdev_set_fwtest(ar, 20, ar->eeprom_overrides.rc_txbf_probe); - for (i = 0; ieeprom_configAddrs); i += 2) { + for (i = 0; ieeprom_configAddrs); ) { if (ar->eeprom_configAddrs[i]) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: 0x%08x 0x%08x\n", - i, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1]); + #define CONFIG_ADDR_MODE_SHIFT 20 + int mode = (ar->eeprom_configAddrs[i] >> CONFIG_ADDR_MODE_SHIFT) & 0x3; + int count = 1; // one setting applied to both 2G and 5G + int q; + + if (mode == 2) // 2G, 5G value tuple + count = 2; + else if (mode == 3) // 2G_VHT20, 2G_VHT40, 5G_VHT20, 5G_VHT40, 5G_VHT80 + count = 4; + ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: mode: %d count: %d 0x%08x 0x%08x 0x%08x\n", + i, mode, count, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1], + (count >= 2) ? ar->eeprom_configAddrs[i+2] : 0); ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_A, ar->eeprom_configAddrs[i]); - ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_V, - ar->eeprom_configAddrs[i+1]); + for (q = 0; qeeprom_configAddrs[i + q + 1]); + } + + i += (count + 1); } else { break; diff --git a/ath10k-4.20/wmi.h b/ath10k-4.20/wmi.h index 0b351af..9c0493b 100644 --- a/ath10k-4.20/wmi.h +++ b/ath10k-4.20/wmi.h @@ -7239,8 +7239,12 @@ struct wmi_pdev_set_special_cmd { * (see 'peers' debugfs for peer id listing) * val = peer_id << 16 | ant-mask-value */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. + * The mode should normally be OR'd in to the address. + */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. Multiple values may + * be appended if the mode supports it. + */ #define SET_SPECIAL_ID_PEER_STATS_PN 0x16 /* Report PN in peer-stats object */ /* Requires specially compiled firmware (-T option) to have any useful effect. */ diff --git a/ath10k-4.9/core.c b/ath10k-4.9/core.c index cedfd2a..7b0b212 100644 --- a/ath10k-4.9/core.c +++ b/ath10k-4.9/core.c @@ -2737,15 +2737,29 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, ath10k_wmi_pdev_set_fwtest(ar, 20, ar->eeprom_overrides.rc_txbf_probe); - for (i = 0; ieeprom_configAddrs); i += 2) { + for (i = 0; ieeprom_configAddrs); ) { if (ar->eeprom_configAddrs[i]) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: 0x%08x 0x%08x\n", - i, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1]); + #define CONFIG_ADDR_MODE_SHIFT 20 + int mode = (ar->eeprom_configAddrs[i] >> CONFIG_ADDR_MODE_SHIFT) & 0x3; + int count = 1; // one setting applied to both 2G and 5G + int q; + + if (mode == 2) // 2G, 5G value tuple + count = 2; + else if (mode == 3) // 2G_VHT20, 2G_VHT40, 5G_VHT20, 5G_VHT40, 5G_VHT80 + count = 4; + ath10k_dbg(ar, ATH10K_DBG_BOOT, "Applying eeprom configAddr[%i]: mode: %d count: %d 0x%08x 0x%08x 0x%08x\n", + i, mode, count, ar->eeprom_configAddrs[i], ar->eeprom_configAddrs[i+1], + (count >= 2) ? ar->eeprom_configAddrs[i+2] : 0); ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_A, ar->eeprom_configAddrs[i]); - ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_EEPROM_CFG_ADDR_V, - ar->eeprom_configAddrs[i+1]); + for (q = 0; qeeprom_configAddrs[i + q + 1]); + } + + i += (count + 1); } else { break; diff --git a/ath10k-4.9/wmi.h b/ath10k-4.9/wmi.h index c9c2a46..6b3780b 100644 --- a/ath10k-4.9/wmi.h +++ b/ath10k-4.9/wmi.h @@ -6792,8 +6792,13 @@ struct wmi_pdev_set_special_cmd { * (see 'peers' debugfs for peer id listing) * val = peer_id << 16 | ant-mask-value */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. */ -#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_A 0x14 /* Append an address to the configAddr in the eeprom. + * The mode should normally be OR'd in to the address. + */ +#define SET_SPECIAL_ID_EEPROM_CFG_ADDR_V 0x15 /* Append an value to the configAddr in the eeprom. Multiple values may + * be appended if the mode supports it. + */ +#define SET_SPECIAL_ID_PEER_STATS_PN 0x16 /* Report PN in peer-stats object */ /* Requires specially compiled firmware (-T option) to have any useful effect. */ #define SET_SPECIAL_ID_TX_DBG 0x99 /* 0x1 == enable, 0x2 == pkt-dbg, 0x0 == disable (default). */