diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index 066adc52400f..56bbc7cabd44 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -1182,13 +1182,13 @@ static void mlme_init_he_cap_in_cfg(struct wlan_objmgr_psoc *psoc,
he_caps->dot11_he_cap.rx_full_bw_su_he_mu_non_cmpr_sigb =
cfg_default(CFG_HE_RX_FULL_BW_MU_NON_CMPR_SIGB);
he_caps->dot11_he_cap.rx_he_mcs_map_lt_80 =
- cfg_default(CFG_HE_RX_MCS_MAP_LT_80);
+ cfg_get(psoc, CFG_HE_RX_MCS_MAP_LT_80);
he_caps->dot11_he_cap.tx_he_mcs_map_lt_80 =
- cfg_default(CFG_HE_TX_MCS_MAP_LT_80);
- value = cfg_default(CFG_HE_RX_MCS_MAP_160);
+ cfg_get(psoc, CFG_HE_TX_MCS_MAP_LT_80);
+ value = cfg_get(psoc, CFG_HE_RX_MCS_MAP_160);
qdf_mem_copy(he_caps->dot11_he_cap.rx_he_mcs_map_160, &value,
sizeof(uint16_t));
- value = cfg_default(CFG_HE_TX_MCS_MAP_160);
+ value = cfg_get(psoc, CFG_HE_TX_MCS_MAP_160);
qdf_mem_copy(he_caps->dot11_he_cap.tx_he_mcs_map_160, &value,
sizeof(uint16_t));
value = cfg_default(CFG_HE_RX_MCS_MAP_80_80);
diff --git a/components/mlme/dispatcher/inc/cfg_mlme_he_caps.h b/components/mlme/dispatcher/inc/cfg_mlme_he_caps.h
index 94177c024c13..5182d0de59e1 100644
--- a/components/mlme/dispatcher/inc/cfg_mlme_he_caps.h
+++ b/components/mlme/dispatcher/inc/cfg_mlme_he_caps.h
@@ -492,35 +492,158 @@
0, \
"He Rx Full Bw Mu Non Cmpr Sigb")
-#define CFG_HE_RX_MCS_MAP_LT_80 CFG_UINT( \
+/* 11AX related INI configuration */
+/*
+ *
+ * he_rx_mcs_map_lt_80 - configure Rx HE-MCS Map for ≤ 80 MHz
+ * @Min: 0
+ * @Max: 0xFFFF
+ * @Default: 0xFFFA
+ *
+ * This ini is used to configure Rx HE-MCS Map for ≤ 80 MHz
+ * 0:1 Max HE-MCS For 1 SS
+ * 2:3 Max HE-MCS For 2 SS
+ * 4:5 Max HE-MCS For 3 SS
+ * 6:7 Max HE-MCS For 4 SS
+ * 8:9 Max HE-MCS For 5 SS
+ * 10:11 Max HE-MCS For 6 SS
+ * 12:13 Max HE-MCS For 7 SS
+ * 14:15 Max HE-MCS For 8 SS
+ *
+ * 0 indicates support for HE-MCS 0-7 for n spatial streams
+ * 1 indicates support for HE-MCS 0-9 for n spatial streams
+ * 2 indicates support for HE-MCS 0-11 for n spatial streams
+ * 3 indicates that n spatial streams is not supported for HE PPDUs
+ *
+ * Related: NA
+ *
+ * Supported Feature: 11AX
+ *
+ * Usage: External
+ *
+ *
+ */
+#define CFG_HE_RX_MCS_MAP_LT_80 CFG_INI_UINT( \
"he_rx_mcs_map_lt_80", \
0, \
0xFFFF, \
- 0xFFF0, \
+ 0xFFFA, \
CFG_VALUE_OR_DEFAULT, \
"He Rx Mcs Map Lt 80")
-#define CFG_HE_TX_MCS_MAP_LT_80 CFG_UINT( \
+/* 11AX related INI configuration */
+/*
+ *
+ * he_tx_mcs_map_lt_80 - configure Tx HE-MCS Map for ≤ 80 MHz
+ * @Min: 0
+ * @Max: 0xFFFF
+ * @Default: 0xFFFA
+ *
+ * This ini is used to configure Tx HE-MCS Map for ≤ 80 MHz
+ * 0:1 Max HE-MCS For 1 SS
+ * 2:3 Max HE-MCS For 2 SS
+ * 4:5 Max HE-MCS For 3 SS
+ * 6:7 Max HE-MCS For 4 SS
+ * 8:9 Max HE-MCS For 5 SS
+ * 10:11 Max HE-MCS For 6 SS
+ * 12:13 Max HE-MCS For 7 SS
+ * 14:15 Max HE-MCS For 8 SS
+ *
+ * 0 indicates support for HE-MCS 0-7 for n spatial streams
+ * 1 indicates support for HE-MCS 0-9 for n spatial streams
+ * 2 indicates support for HE-MCS 0-11 for n spatial streams
+ * 3 indicates that n spatial streams is not supported for HE PPDUs
+ *
+ * Related: NA
+ *
+ * Supported Feature: 11AX
+ *
+ * Usage: External
+ *
+ *
+ */
+#define CFG_HE_TX_MCS_MAP_LT_80 CFG_INI_UINT( \
"he_tx_mcs_map_lt_80", \
0, \
0xFFFF, \
- 0xFFF0, \
+ 0xFFFA, \
CFG_VALUE_OR_DEFAULT, \
"He Tx Mcs Map Lt 80")
-
-#define CFG_HE_RX_MCS_MAP_160 CFG_UINT( \
+/* 11AX related INI configuration */
+/*
+ *
+ * he_rx_mcs_map_160 - configure Rx HE-MCS Map for 160 MHz
+ * @Min: 0
+ * @Max: 0xFFFF
+ * @Default: 0xFFFA
+ *
+ * This ini is used to configure Rx HE-MCS Map for 160 MHz
+ * 0:1 Max HE-MCS For 1 SS
+ * 2:3 Max HE-MCS For 2 SS
+ * 4:5 Max HE-MCS For 3 SS
+ * 6:7 Max HE-MCS For 4 SS
+ * 8:9 Max HE-MCS For 5 SS
+ * 10:11 Max HE-MCS For 6 SS
+ * 12:13 Max HE-MCS For 7 SS
+ * 14:15 Max HE-MCS For 8 SS
+ *
+ * 0 indicates support for HE-MCS 0-7 for n spatial streams
+ * 1 indicates support for HE-MCS 0-9 for n spatial streams
+ * 2 indicates support for HE-MCS 0-11 for n spatial streams
+ * 3 indicates that n spatial streams is not supported for HE PPDUs
+ *
+ * Related: NA
+ *
+ * Supported Feature: 11AX
+ *
+ * Usage: External
+ *
+ *
+ */
+#define CFG_HE_RX_MCS_MAP_160 CFG_INI_UINT( \
"he_rx_mcs_map_160", \
0, \
0xFFFF, \
- 0xFFF0, \
+ 0xFFFA, \
CFG_VALUE_OR_DEFAULT, \
"He Rx Mcs Map 160")
-#define CFG_HE_TX_MCS_MAP_160 CFG_UINT( \
+/* 11AX related INI configuration */
+/*
+ *
+ * he_tx_mcs_map_160 - configure Tx HE-MCS Map for 160 MHz
+ * @Min: 0
+ * @Max: 0xFFFF
+ * @Default: 0xFFFA
+ *
+ * This ini is used to configure Tx HE-MCS Map for 160 MHz
+ * 0:1 Max HE-MCS For 1 SS
+ * 2:3 Max HE-MCS For 2 SS
+ * 4:5 Max HE-MCS For 3 SS
+ * 6:7 Max HE-MCS For 4 SS
+ * 8:9 Max HE-MCS For 5 SS
+ * 10:11 Max HE-MCS For 6 SS
+ * 12:13 Max HE-MCS For 7 SS
+ * 14:15 Max HE-MCS For 8 SS
+ *
+ * 0 indicates support for HE-MCS 0-7 for n spatial streams
+ * 1 indicates support for HE-MCS 0-9 for n spatial streams
+ * 2 indicates support for HE-MCS 0-11 for n spatial streams
+ * 3 indicates that n spatial streams is not supported for HE PPDUs
+ *
+ * Related: NA
+ *
+ * Supported Feature: 11AX
+ *
+ * Usage: External
+ *
+ *
+ */
+#define CFG_HE_TX_MCS_MAP_160 CFG_INI_UINT( \
"he_tx_mcs_map_160", \
0, \
0xFFFF, \
- 0xFFF0, \
+ 0xFFFA, \
CFG_VALUE_OR_DEFAULT, \
"He Tx Mcs Map 160")
diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c
index fd112f49cf51..2c5926802a1e 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_api.c
@@ -555,6 +555,32 @@ QDF_STATUS wlan_mlme_cfg_get_enable_ul_ofdm(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
+/* mlme_get_min_rate_cap() - get minimum capability for HE-MCS between
+ * ini value and fw capability.
+ *
+ * Rx HE-MCS Map and Tx HE-MCS Map subfields format where 2-bit indicates
+ * 0 indicates support for HE-MCS 0-7 for n spatial streams
+ * 1 indicates support for HE-MCS 0-9 for n spatial streams
+ * 2 indicates support for HE-MCS 0-11 for n spatial streams
+ * 3 indicates that n spatial streams is not supported for HE PPDUs
+ *
+ */
+static uint16_t mlme_get_min_rate_cap(uint16_t val1, uint16_t val2)
+{
+ uint16_t ret = 0, i;
+
+ for (i = 0; i < 8; i++) {
+ if (((val1 >> (2 * i)) & 0x3) == 0x3 ||
+ ((val2 >> (2 * i)) & 0x3) == 0x3) {
+ ret |= 0x3 << (2 * i);
+ continue;
+ }
+ ret |= QDF_MIN((val1 >> (2 * i)) & 0x3,
+ (val2 >> (2 * i)) & 0x3) << (2 * i);
+ }
+ return ret;
+}
+
QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
struct wma_tgt_cfg *wma_cfg)
{
@@ -802,8 +828,12 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
mlme_obj->cfg.he_caps.dot11_he_cap.rx_full_bw_su_he_mu_non_cmpr_sigb =
he_cap->rx_full_bw_su_he_mu_non_cmpr_sigb;
- tx_mcs_map = he_cap->tx_he_mcs_map_lt_80;
- rx_mcs_map = he_cap->rx_he_mcs_map_lt_80;
+ tx_mcs_map = mlme_get_min_rate_cap(
+ mlme_obj->cfg.he_caps.dot11_he_cap.tx_he_mcs_map_lt_80,
+ he_cap->tx_he_mcs_map_lt_80);
+ rx_mcs_map = mlme_get_min_rate_cap(
+ mlme_obj->cfg.he_caps.dot11_he_cap.rx_he_mcs_map_lt_80,
+ he_cap->rx_he_mcs_map_lt_80);
if (!mlme_obj->cfg.vht_caps.vht_cap_info.enable2x2) {
nss = 2;
tx_mcs_map = HE_SET_MCS_4_NSS(tx_mcs_map, HE_MCS_DISABLE, nss);
@@ -816,8 +846,12 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
if (cfg_in_range(CFG_HE_TX_MCS_MAP_LT_80, tx_mcs_map))
mlme_obj->cfg.he_caps.dot11_he_cap.tx_he_mcs_map_lt_80 =
tx_mcs_map;
- tx_mcs_map = *((uint16_t *)he_cap->tx_he_mcs_map_160);
- rx_mcs_map = *((uint16_t *)he_cap->rx_he_mcs_map_160);
+ tx_mcs_map = mlme_get_min_rate_cap(
+ *((uint16_t *)mlme_obj->cfg.he_caps.dot11_he_cap.tx_he_mcs_map_160),
+ *((uint16_t *)he_cap->tx_he_mcs_map_160));
+ rx_mcs_map = mlme_get_min_rate_cap(
+ *((uint16_t *)mlme_obj->cfg.he_caps.dot11_he_cap.rx_he_mcs_map_160),
+ *((uint16_t *)he_cap->rx_he_mcs_map_160));
if (!mlme_obj->cfg.vht_caps.vht_cap_info.enable2x2) {
nss = 2;