diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h
index 1c1f856224..54af017660 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h
@@ -57,4 +57,59 @@ QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc,
*/
QDF_STATUS wlan_mlme_get_ignore_peer_ht_mode(struct wlan_objmgr_psoc *psoc,
bool *value);
+/**
+ * wlan_mlme_get_tx_chainmask_cck() - Get the tx_chainmask_cfg value
+ *
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+QDF_STATUS wlan_mlme_get_tx_chainmask_cck(struct wlan_objmgr_psoc *psoc,
+ bool *value);
+
+/**
+ * wlan_mlme_get_tx_chainmask_1ss() - Get the tx_chainmask_1ss value
+ *
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+QDF_STATUS wlan_mlme_get_tx_chainmask_1ss(struct wlan_objmgr_psoc *psoc,
+ uint8_t *value);
+
+/**
+ * wlan_mlme_get_num_11b_tx_chains() - Get the number of 11b only tx chains
+ *
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+QDF_STATUS wlan_mlme_get_num_11b_tx_chains(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value);
+
+/**
+ * wlan_mlme_get_num_11ag_tx_chains() - get the total number of 11a/g tx chains
+ *
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+QDF_STATUS wlan_mlme_get_num_11ag_tx_chains(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value);
+
+/**
+ * wlan_mlme_configure_chain_mask() - configure chainmask parameters
+ *
+ * @psoc: pointer to psoc object
+ * @session_id: vdev_id
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
+ uint8_t session_id);
+
#endif /* _WLAN_MLME_API_H_ */
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
index 598525c877..d939eddfb2 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -117,4 +117,65 @@ QDF_STATUS ucfg_mlme_get_ignore_peer_ht_mode(struct wlan_objmgr_psoc *psoc,
{
return wlan_mlme_get_ignore_peer_ht_mode(psoc, value);
}
+
+/**
+ * ucfg_mlme_get_tx_chainmask_1ss() - Get the tx_chainmask_1ss value
+ *
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+static inline
+QDF_STATUS ucfg_mlme_get_tx_chainmask_1ss(struct wlan_objmgr_psoc *psoc,
+ uint8_t *value)
+{
+ return wlan_mlme_get_tx_chainmask_1ss(psoc, value);
+}
+
+/**
+ * ucfg_mlme_get_num_11b_tx_chains() - Get the number of 11b only tx chains
+ *
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+static inline
+QDF_STATUS ucfg_mlme_get_num_11b_tx_chains(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value)
+{
+ return wlan_mlme_get_num_11b_tx_chains(psoc, value);
+}
+
+/**
+ * ucfg_mlme_get_num_11ag_tx_chains() - get the total number of 11a/g tx chains
+ *
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+static inline
+QDF_STATUS ucfg_mlme_get_num_11ag_tx_chains(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value)
+{
+ return wlan_mlme_get_num_11ag_tx_chains(psoc, value);
+}
+
+/**
+ * ucfg_mlme_configure_chain_mask() - configure chainmask parameters
+ *
+ * @psoc: pointer to psoc object
+ * @session_id: vdev_id
+ *
+ * Return: QDF_STATUS_FAILURE or QDF_STATUS_SUCCESS
+ */
+static inline
+QDF_STATUS ucfg_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
+ uint8_t session_id)
+{
+ return wlan_mlme_configure_chain_mask(psoc, session_id);
+}
+
#endif /* _WLAN_MLME_UCFG_API_H_ */
diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c
index 7630cb3829..71adf76b4d 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_api.c
@@ -22,6 +22,8 @@
#include "cfg_ucfg_api.h"
#include "wlan_mlme_main.h"
#include "wlan_mlme_ucfg_api.h"
+#include "wma_types.h"
+#include "wmi_unified.h"
QDF_STATUS wlan_mlme_get_ht_cap_info(struct wlan_objmgr_psoc *psoc,
struct mlme_ht_capabilities_info
@@ -70,3 +72,144 @@ QDF_STATUS wlan_mlme_get_ignore_peer_ht_mode(struct wlan_objmgr_psoc *psoc,
*value = mlme_obj->cfg.sap_protection_cfg.ignore_peer_ht_mode;
return QDF_STATUS_SUCCESS;
}
+
+QDF_STATUS wlan_mlme_get_tx_chainmask_cck(struct wlan_objmgr_psoc *psoc,
+ bool *value)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc);
+
+ if (!mlme_obj) {
+ mlme_err("Failed to get MLME Obj");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ *value = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_cck;
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS wlan_mlme_get_tx_chainmask_1ss(struct wlan_objmgr_psoc *psoc,
+ uint8_t *value)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc);
+
+ if (!mlme_obj) {
+ mlme_err("Failed to get MLME Obj");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ *value = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_1ss;
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS wlan_mlme_get_num_11b_tx_chains(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc);
+
+ if (!mlme_obj) {
+ mlme_err("Failed to get MLME Obj");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ *value = mlme_obj->cfg.chainmask_cfg.num_11b_tx_chains;
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS wlan_mlme_get_num_11ag_tx_chains(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value)
+{
+ struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc);
+
+ if (!mlme_obj) {
+ mlme_err("Failed to get MLME Obj");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ *value = mlme_obj->cfg.chainmask_cfg.num_11ag_tx_chains;
+ return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
+ uint8_t session_id)
+{
+ int ret_val;
+ uint8_t ch_msk_val;
+ struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc);
+
+ if (!mlme_obj) {
+ mlme_err("Failed to get MLME Obj");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ mlme_debug("txchainmask1x1: %d rxchainmask1x1: %d",
+ mlme_obj->cfg.chainmask_cfg.txchainmask1x1,
+ mlme_obj->cfg.chainmask_cfg.rxchainmask1x1);
+ mlme_debug("tx_chain_mask_2g: %d, rx_chain_mask_2g: %d",
+ mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g,
+ mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g);
+ mlme_debug("tx_chain_mask_5g: %d, rx_chain_mask_5g: %d",
+ mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g,
+ mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g);
+
+ if (mlme_obj->cfg.chainmask_cfg.txchainmask1x1) {
+ ch_msk_val = mlme_obj->cfg.chainmask_cfg.txchainmask1x1;
+ ret_val = wma_cli_set_command(session_id,
+ WMI_PDEV_PARAM_TX_CHAIN_MASK,
+ ch_msk_val, PDEV_CMD);
+ if (ret_val)
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (mlme_obj->cfg.chainmask_cfg.rxchainmask1x1) {
+ ch_msk_val = mlme_obj->cfg.chainmask_cfg.rxchainmask1x1;
+ ret_val = wma_cli_set_command(session_id,
+ WMI_PDEV_PARAM_RX_CHAIN_MASK,
+ ch_msk_val, PDEV_CMD);
+ if (ret_val)
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (mlme_obj->cfg.chainmask_cfg.txchainmask1x1 ||
+ mlme_obj->cfg.chainmask_cfg.rxchainmask1x1) {
+ mlme_debug("band agnostic tx/rx chain mask set. skip per band chain mask");
+ return QDF_STATUS_SUCCESS;
+ }
+
+ if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g) {
+ ch_msk_val = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g;
+ ret_val = wma_cli_set_command(session_id,
+ WMI_PDEV_PARAM_TX_CHAIN_MASK_2G,
+ ch_msk_val, PDEV_CMD);
+ if (0 != ret_val)
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g) {
+ ch_msk_val = mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g;
+ ret_val = wma_cli_set_command(session_id,
+ WMI_PDEV_PARAM_RX_CHAIN_MASK_2G,
+ ch_msk_val, PDEV_CMD);
+ if (0 != ret_val)
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g) {
+ ch_msk_val = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g;
+ ret_val = wma_cli_set_command(session_id,
+ WMI_PDEV_PARAM_TX_CHAIN_MASK_5G,
+ ch_msk_val, PDEV_CMD);
+ if (0 != ret_val)
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g) {
+ ch_msk_val = mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g;
+ ret_val = wma_cli_set_command(session_id,
+ WMI_PDEV_PARAM_RX_CHAIN_MASK_5G,
+ ch_msk_val, PDEV_CMD);
+ if (0 != ret_val)
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ return QDF_STATUS_SUCCESS;
+}
diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h
index 7066c3bc31..25a21c41c2 100644
--- a/core/cds/inc/cds_config.h
+++ b/core/cds/inc/cds_config.h
@@ -154,7 +154,6 @@ struct cds_config_info {
bool is_lpass_enabled;
#endif
bool apf_packet_filter_enable;
- bool tx_chain_mask_cck;
uint16_t self_gen_frm_pwr;
enum cfg_sub_20_channel_width sub_20_channel_width;
bool flow_steering_enabled;
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 7156095b78..08925691e9 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -1725,52 +1725,6 @@ enum hdd_dot11_mode {
#define CFG_FORCE_1X1_MAX (1)
#define CFG_FORCE_1X1_DEFAULT (1)
-/*
- *
- * g11bNumTxChains - Number of Tx Chanins in 11b mode
- * @Min: 0
- * @Max: 2
- * @Default: 0
- *
- * Number of Tx Chanins in 11b mode
- *
- *
- * Related: None
- *
- * Supported Feature: connection
- *
- * Usage: External
- *
- *
- */
-#define CFG_11B_NUM_TX_CHAIN_NAME "g11bNumTxChains"
-#define CFG_11B_NUM_TX_CHAIN_MIN (0)
-#define CFG_11B_NUM_TX_CHAIN_MAX (2)
-#define CFG_11B_NUM_TX_CHAIN_DEFAULT (0)
-
-/*
- *
- * g11agNumTxChains - Number of Tx Chanins in 11ag mode
- * @Min: 0
- * @Max: 2
- * @Default: 0
- *
- * Number of Tx Chanins in 11ag mode
- *
- *
- * Related: None
- *
- * Supported Feature: connection
- *
- * Usage: External
- *
- *
- */
-#define CFG_11AG_NUM_TX_CHAIN_NAME "g11agNumTxChains"
-#define CFG_11AG_NUM_TX_CHAIN_MIN (0)
-#define CFG_11AG_NUM_TX_CHAIN_MAX (2)
-#define CFG_11AG_NUM_TX_CHAIN_DEFAULT (0)
-
/*
*
* gEnableFastRoamInConcurrency - Enable LFR roaming on STA during concurrency
@@ -5081,64 +5035,6 @@ enum hdd_link_speed_rpt_type {
#define CFG_VHT_ENABLE_GID_FEATURE_MAX (1)
#define CFG_VHT_ENABLE_GID_FEATURE_DEFAULT (0)
-/*
- *
- * gSetTxChainmask1x1 - Sets Transmit chain mask.
- * @Min: 1
- * @Max: 3
- * @Default: 0
- *
- * This ini Sets Transmit chain mask.
- *
- * If gEnable2x2 is disabled, gSetTxChainmask1x1 and gSetRxChainmask1x1 values
- * are taken into account. If chainmask value exceeds the maximum number of
- * chains supported by target, the max number of chains is used. By default,
- * chain0 is selected for both Tx and Rx.
- * gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
- * gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
- * gSetTxChainmask1x1=3 or gSetRxChainmask1x1=3 to select both chains.
- *
- * Supported Feature: 11AC
- *
- * Usage: External
- *
- *
- */
-
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK "gSetTxChainmask1x1"
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MIN (0)
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MAX (3)
-#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK_DEFAULT (0)
-
-/*
- *
- * gSetRxChainmask1x1 - Sets Receive chain mask.
- * @Min: 1
- * @Max: 3
- * @Default: 0
- *
- * This ini is used to set Receive chain mask.
- *
- * If gEnable2x2 is disabled, gSetTxChainmask1x1 and gSetRxChainmask1x1 values
- * are taken into account. If chainmask value exceeds the maximum number of
- * chains supported by target, the max number of chains is used. By default,
- * chain0 is selected for both Tx and Rx.
- * gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0.
- * gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1.
- * gSetTxChainmask1x1=3 or gSetRxChainmask1x1=3 to select both chains.
- *
- * Supported Feature: 11AC
- *
- * Usage: External
- *
- *
- */
-
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK "gSetRxChainmask1x1"
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MIN (0)
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MAX (3)
-#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK_DEFAULT (0)
-
/*
*
* gEnableAMPDUPS - Enable the AMPDUPS
@@ -7884,53 +7780,6 @@ enum hdd_link_speed_rpt_type {
#define CFG_APF_PACKET_FILTER_OFFLOAD_MAX (1)
#define CFG_APF_PACKET_FILTER_OFFLOAD_DEFAULT (1)
-/*
- *
- * gCckChainMaskEnable - Used to enable/disable Cck ChainMask
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to set default Cck ChainMask
- * 0: disable the cck tx chain mask (default)
- * 1: enable the cck tx chain mask
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- *
- */
-
-#define CFG_TX_CHAIN_MASK_CCK "gCckChainMaskEnable"
-#define CFG_TX_CHAIN_MASK_CCK_MIN (0)
-#define CFG_TX_CHAIN_MASK_CCK_MAX (1)
-#define CFG_TX_CHAIN_MASK_CCK_DEFAULT (0)
-/*
- *
- * gTxChainMask1ss - Enables/disables tx chain Mask1ss
- * @Min: 0
- * @Max: 3
- * @Default: 1
- *
- * This ini is used to set default tx chain Mask1ss
- *
- * Related: None
- *
- * Supported Feature: STA
- *
- * Usage: Internal/External
- *
- *
- */
-
-#define CFG_TX_CHAIN_MASK_1SS "gTxChainMask1ss"
-#define CFG_TX_CHAIN_MASK_1SS_MIN (0)
-#define CFG_TX_CHAIN_MASK_1SS_MAX (3)
-#define CFG_TX_CHAIN_MASK_1SS_DEFAULT (1)
-
/*
*
* gEnableSmartChainmask - Enable Smart Chainmask
@@ -12940,129 +12789,6 @@ enum hdd_external_acs_policy {
#define CFG_ENABLE_ESP_FEATURE_MAX (1)
#define CFG_ENABLE_ESP_FEATURE_DEFAULT (0)
-/*
- *
- * tx_chain_mask_2g - tx chain mask for 2g
- * @Min: 0
- * @Max: 3
- * @Default: 0
- *
- * This ini will set tx chain mask for 2g. To use the ini, make sure:
- * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
- * gDualMacFeatureDisable = 1
- * gEnable2x2 = 0
- *
- * tx_chain_mask_2g=0 : don't care
- * tx_chain_mask_2g=1 : for 2g tx use chain 0
- * tx_chain_mask_2g=2 : for 2g tx use chain 1
- * tx_chain_mask_2g=3 : for 2g tx can use either chain
- *
- * Related: None
- *
- * Supported Feature: All profiles
- *
- * Usage: External
- *
- *
- */
-#define CFG_TX_CHAIN_MASK_2G_NAME "tx_chain_mask_2g"
-#define CFG_TX_CHAIN_MASK_2G_MIN (0)
-#define CFG_TX_CHAIN_MASK_2G_MAX (3)
-#define CFG_TX_CHAIN_MASK_2G_DEFAULT (0)
-
-
-/*
- *
- * tx_chain_mask_5g - tx chain mask for 5g
- * @Min: 0
- * @Max: 3
- * @Default: 0
- *
- * This ini will set tx chain mask for 5g. To use the ini, make sure:
- * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
- * gDualMacFeatureDisable = 1
- * gEnable2x2 = 0
- *
- * tx_chain_mask_5g=0 : don't care
- * tx_chain_mask_5g=1 : for 5g tx use chain 0
- * tx_chain_mask_5g=2 : for 5g tx use chain 1
- * tx_chain_mask_5g=3 : for 5g tx can use either chain
- *
- * Related: None
- *
- * Supported Feature: All profiles
- *
- * Usage: External
- *
- *
- */
-#define CFG_TX_CHAIN_MASK_5G_NAME "tx_chain_mask_5g"
-#define CFG_TX_CHAIN_MASK_5G_MIN (0)
-#define CFG_TX_CHAIN_MASK_5G_MAX (3)
-#define CFG_TX_CHAIN_MASK_5G_DEFAULT (0)
-
-
-/*
- *
- * rx_chain_mask_2g - rx chain mask for 2g
- * @Min: 0
- * @Max: 3
- * @Default: 0
- *
- * This ini will set rx chain mask for 2g. To use the ini, make sure:
- * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
- * gDualMacFeatureDisable = 1
- * gEnable2x2 = 0
- *
- * rx_chain_mask_2g=0 : don't care
- * rx_chain_mask_2g=1 : for 2g rx use chain 0
- * rx_chain_mask_2g=2 : for 2g rx use chain 1
- * rx_chain_mask_2g=3 : for 2g rx can use either chain
- *
- * Related: None
- *
- * Supported Feature: All profiles
- *
- * Usage: External
- *
- *
- */
-#define CFG_RX_CHAIN_MASK_2G_NAME "rx_chain_mask_2g"
-#define CFG_RX_CHAIN_MASK_2G_MIN (0)
-#define CFG_RX_CHAIN_MASK_2G_MAX (3)
-#define CFG_RX_CHAIN_MASK_2G_DEFAULT (0)
-
-
-/*
- *
- * rx_chain_mask_5g - rx chain mask for 5g
- * @Min: 0
- * @Max: 3
- * @Default: 0
- *
- * This ini will set rx chain mask for 5g. To use the ini, make sure:
- * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0,
- * gDualMacFeatureDisable = 1
- * gEnable2x2 = 0
- *
- * rx_chain_mask_5g=0 : don't care
- * rx_chain_mask_5g=1 : for 5g rx use chain 0
- * rx_chain_mask_5g=2 : for 5g rx use chain 1
- * rx_chain_mask_5g=3 : for 5g rx can use either chain
- *
- * Related: None
- *
- * Supported Feature: All profiles
- *
- * Usage: External
- *
- *
- */
-#define CFG_RX_CHAIN_MASK_5G_NAME "rx_chain_mask_5g"
-#define CFG_RX_CHAIN_MASK_5G_MIN (0)
-#define CFG_RX_CHAIN_MASK_5G_MAX (3)
-#define CFG_RX_CHAIN_MASK_5G_DEFAULT (0)
-
/*
*
* btm_offload_config - Configure BTM
@@ -14240,8 +13966,6 @@ struct hdd_config {
bool enable2x2;
uint32_t vdev_type_nss_2g;
uint32_t vdev_type_nss_5g;
- uint8_t txchainmask1x1;
- uint8_t rxchainmask1x1;
bool enableMuBformee;
bool enableVhtpAid;
bool enableVhtGid;
@@ -14496,8 +14220,6 @@ struct hdd_config {
uint8_t dbs_scan_selection[CFG_DBS_SCAN_PARAM_LENGTH];
uint32_t sta_sap_scc_on_dfs_chan;
uint32_t sta_sap_scc_on_lte_coex_chan;
- bool tx_chain_mask_cck;
- uint8_t tx_chain_mask_1ss;
bool smart_chainmask_enabled;
bool alternative_chainmask_enabled;
uint16_t self_gen_frm_pwr;
@@ -14675,8 +14397,6 @@ struct hdd_config {
uint8_t enable_rts_sifsbursting;
uint8_t max_mpdus_inampdu;
enum pmo_auto_pwr_detect_failure_mode auto_pwr_save_fail_mode;
- uint16_t num_11b_tx_chains;
- uint16_t num_11ag_tx_chains;
uint8_t ito_repeat_count;
/* LCA(Last connected AP) disallow configs */
uint32_t disallow_duration;
@@ -14761,10 +14481,6 @@ struct hdd_config {
bool probe_req_deferral_enabled;
bool fils_discovery_sap_enabled;
bool esp_for_roam_enabled;
- uint8_t tx_chain_mask_2g;
- uint8_t rx_chain_mask_2g;
- uint8_t tx_chain_mask_5g;
- uint8_t rx_chain_mask_5g;
uint32_t btm_offload_config;
#ifdef WLAN_FEATURE_SAE
bool is_sae_enabled;
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index ff16aa2e61..c94d51dbde 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -2014,20 +2014,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_VHT_ENABLE_GID_FEATURE_MIN,
CFG_VHT_ENABLE_GID_FEATURE_MAX),
- REG_VARIABLE(CFG_VHT_ENABLE_1x1_TX_CHAINMASK, WLAN_PARAM_Integer,
- struct hdd_config, txchainmask1x1,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_VHT_ENABLE_1x1_TX_CHAINMASK_DEFAULT,
- CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MIN,
- CFG_VHT_ENABLE_1x1_TX_CHAINMASK_MAX),
-
- REG_VARIABLE(CFG_VHT_ENABLE_1x1_RX_CHAINMASK, WLAN_PARAM_Integer,
- struct hdd_config, rxchainmask1x1,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_VHT_ENABLE_1x1_RX_CHAINMASK_DEFAULT,
- CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MIN,
- CFG_VHT_ENABLE_1x1_RX_CHAINMASK_MAX),
-
REG_VARIABLE(CFG_ENABLE_AMPDUPS_FEATURE, WLAN_PARAM_Integer,
struct hdd_config, enableAmpduPs,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -3427,21 +3413,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_MIN,
CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_MAX),
#endif
-
- REG_VARIABLE(CFG_TX_CHAIN_MASK_CCK, WLAN_PARAM_Integer,
- struct hdd_config, tx_chain_mask_cck,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_TX_CHAIN_MASK_CCK_DEFAULT,
- CFG_TX_CHAIN_MASK_CCK_MIN,
- CFG_TX_CHAIN_MASK_CCK_MAX),
-
- REG_VARIABLE(CFG_TX_CHAIN_MASK_1SS, WLAN_PARAM_Integer,
- struct hdd_config, tx_chain_mask_1ss,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_TX_CHAIN_MASK_1SS_DEFAULT,
- CFG_TX_CHAIN_MASK_1SS_MIN,
- CFG_TX_CHAIN_MASK_1SS_MAX),
-
REG_VARIABLE(CFG_ENABLE_SMART_CHAINMASK_NAME, WLAN_PARAM_Integer,
struct hdd_config, smart_chainmask_enabled,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -4437,20 +4408,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_AUTO_DETECT_POWER_FAIL_MODE_MIN,
CFG_AUTO_DETECT_POWER_FAIL_MODE_MAX),
- REG_VARIABLE(CFG_11B_NUM_TX_CHAIN_NAME, WLAN_PARAM_Integer,
- struct hdd_config, num_11b_tx_chains,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_11B_NUM_TX_CHAIN_DEFAULT,
- CFG_11B_NUM_TX_CHAIN_MIN,
- CFG_11B_NUM_TX_CHAIN_MAX),
-
- REG_VARIABLE(CFG_11AG_NUM_TX_CHAIN_NAME, WLAN_PARAM_Integer,
- struct hdd_config, num_11ag_tx_chains,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_11AG_NUM_TX_CHAIN_DEFAULT,
- CFG_11AG_NUM_TX_CHAIN_MIN,
- CFG_11AG_NUM_TX_CHAIN_MAX),
-
REG_VARIABLE(CFG_ITO_REPEAT_COUNT_NAME, WLAN_PARAM_Integer,
struct hdd_config, ito_repeat_count,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -5033,34 +4990,6 @@ struct reg_table_entry g_registry_table[] = {
CFG_ENABLE_ESP_FEATURE_MIN,
CFG_ENABLE_ESP_FEATURE_MAX),
- REG_VARIABLE(CFG_TX_CHAIN_MASK_2G_NAME, WLAN_PARAM_Integer,
- struct hdd_config, tx_chain_mask_2g,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_TX_CHAIN_MASK_2G_DEFAULT,
- CFG_TX_CHAIN_MASK_2G_MIN,
- CFG_TX_CHAIN_MASK_2G_MAX),
-
- REG_VARIABLE(CFG_RX_CHAIN_MASK_2G_NAME, WLAN_PARAM_Integer,
- struct hdd_config, rx_chain_mask_2g,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_RX_CHAIN_MASK_2G_DEFAULT,
- CFG_RX_CHAIN_MASK_2G_MIN,
- CFG_RX_CHAIN_MASK_2G_MAX),
-
- REG_VARIABLE(CFG_TX_CHAIN_MASK_5G_NAME, WLAN_PARAM_Integer,
- struct hdd_config, tx_chain_mask_5g,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_TX_CHAIN_MASK_5G_DEFAULT,
- CFG_TX_CHAIN_MASK_5G_MIN,
- CFG_TX_CHAIN_MASK_5G_MAX),
-
- REG_VARIABLE(CFG_RX_CHAIN_MASK_5G_NAME, WLAN_PARAM_Integer,
- struct hdd_config, rx_chain_mask_5g,
- VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
- CFG_RX_CHAIN_MASK_5G_DEFAULT,
- CFG_RX_CHAIN_MASK_5G_MIN,
- CFG_RX_CHAIN_MASK_5G_MAX),
-
REG_VARIABLE(CFG_BTM_ENABLE_NAME, WLAN_PARAM_HexInteger,
struct hdd_config, btm_offload_config,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -7620,10 +7549,7 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
smeConfig->csrConfig.is_force_1x1 =
hdd_ctx->config->is_force_1x1;
- smeConfig->csrConfig.num_11b_tx_chains =
- hdd_ctx->config->num_11b_tx_chains;
- smeConfig->csrConfig.num_11ag_tx_chains =
- hdd_ctx->config->num_11ag_tx_chains;
+
val = (pConfig->oce_probe_req_rate_enabled *
WMI_VDEV_OCE_PROBE_REQUEST_RATE_FEATURE_BITMAP) +
(pConfig->oce_probe_resp_rate_enabled *
@@ -7664,6 +7590,7 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
status = sme_update_config(mac_handle, smeConfig);
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("sme_update_config() failure: %d", status);
+
error:
qdf_mem_free(smeConfig);
return status;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 4907ff8c76..e50323de80 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -4463,22 +4463,13 @@ static void hdd_set_fw_log_params(struct hdd_context *hdd_ctx,
*/
static int hdd_configure_chain_mask(struct hdd_adapter *adapter)
{
- int ret_val;
QDF_STATUS status;
struct wma_caps_per_phy non_dbs_phy_cap;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
- hdd_debug("enable2x2: %d, lte_coex: %d, ChainMask1x1: tx: %d rx: %d",
+ hdd_debug("enable2x2: %d, lte_coex: %d, disable_DBS: %d",
hdd_ctx->config->enable2x2, hdd_ctx->lte_coex_ant_share,
- hdd_ctx->config->txchainmask1x1,
- hdd_ctx->config->rxchainmask1x1);
- hdd_debug("disable_DBS: %d, tx_chain_mask_2g: %d, rx_chain_mask_2g: %d",
- hdd_ctx->config->dual_mac_feature_disable,
- hdd_ctx->config->tx_chain_mask_2g,
- hdd_ctx->config->rx_chain_mask_2g);
- hdd_debug("tx_chain_mask_5g: %d, rx_chain_mask_5g: %d",
- hdd_ctx->config->tx_chain_mask_5g,
- hdd_ctx->config->rx_chain_mask_5g);
+ hdd_ctx->config->dual_mac_feature_disable);
hdd_debug("enable_bt_chain_separation %d",
hdd_ctx->config->enable_bt_chain_separation);
@@ -4516,66 +4507,15 @@ static int hdd_configure_chain_mask(struct hdd_adapter *adapter)
return 0;
}
- if (hdd_ctx->config->txchainmask1x1) {
- ret_val = sme_cli_set_command(adapter->session_id,
- WMI_PDEV_PARAM_TX_CHAIN_MASK,
- hdd_ctx->config->txchainmask1x1,
- PDEV_CMD);
- if (ret_val)
- goto error;
- }
-
- if (hdd_ctx->config->rxchainmask1x1) {
- ret_val = sme_cli_set_command(adapter->session_id,
- WMI_PDEV_PARAM_RX_CHAIN_MASK,
- hdd_ctx->config->rxchainmask1x1,
- PDEV_CMD);
- if (ret_val)
- goto error;
- }
-
- if (hdd_ctx->config->txchainmask1x1 ||
- hdd_ctx->config->rxchainmask1x1) {
- hdd_debug("band agnostic tx/rx chain mask set. skip per band chain mask");
- return 0;
- }
-
- if (hdd_ctx->config->tx_chain_mask_2g) {
- ret_val = sme_cli_set_command(adapter->session_id,
- WMI_PDEV_PARAM_TX_CHAIN_MASK_2G,
- hdd_ctx->config->tx_chain_mask_2g, PDEV_CMD);
- if (0 != ret_val)
- goto error;
- }
-
- if (hdd_ctx->config->rx_chain_mask_2g) {
- ret_val = sme_cli_set_command(adapter->session_id,
- WMI_PDEV_PARAM_RX_CHAIN_MASK_2G,
- hdd_ctx->config->rx_chain_mask_2g, PDEV_CMD);
- if (0 != ret_val)
- goto error;
- }
-
- if (hdd_ctx->config->tx_chain_mask_5g) {
- ret_val = sme_cli_set_command(adapter->session_id,
- WMI_PDEV_PARAM_TX_CHAIN_MASK_5G,
- hdd_ctx->config->tx_chain_mask_5g, PDEV_CMD);
- if (0 != ret_val)
- goto error;
- }
-
- if (hdd_ctx->config->rx_chain_mask_5g) {
- ret_val = sme_cli_set_command(adapter->session_id,
- WMI_PDEV_PARAM_RX_CHAIN_MASK_5G,
- hdd_ctx->config->rx_chain_mask_5g, PDEV_CMD);
- if (0 != ret_val)
- goto error;
- }
+ status = ucfg_mlme_configure_chain_mask(hdd_ctx->hdd_psoc,
+ adapter->session_id);
+ if (status != QDF_STATUS_SUCCESS)
+ goto error;
return 0;
error:
- hdd_err("WMI PDEV set param failed %d", ret_val);
+ hdd_err("WMI PDEV set param failed");
return -EINVAL;
}
@@ -9576,7 +9516,6 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx)
hdd_ctx->config->ce_classify_enabled;
cds_cfg->apf_packet_filter_enable =
hdd_ctx->config->apf_packet_filter_enable;
- cds_cfg->tx_chain_mask_cck = hdd_ctx->config->tx_chain_mask_cck;
cds_cfg->self_gen_frm_pwr = hdd_ctx->config->self_gen_frm_pwr;
cds_cfg->max_station = hdd_ctx->config->maxNumberOfPeers;
cds_cfg->sub_20_channel_width = WLAN_SUB_20_CH_WIDTH_NONE;
@@ -10116,6 +10055,7 @@ static int hdd_set_ani_enabled(struct hdd_context *hdd_ctx)
static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx)
{
int ret;
+ uint8_t val = 0;
QDF_STATUS status;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
@@ -10151,8 +10091,13 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx)
goto out;
}
- ret = sme_cli_set_command(0, WMI_PDEV_PARAM_TX_CHAIN_MASK_1SS,
- hdd_ctx->config->tx_chain_mask_1ss,
+ status = ucfg_mlme_get_tx_chainmask_1ss(hdd_ctx->hdd_psoc, &val);
+ if (QDF_STATUS_SUCCESS != status) {
+ hdd_err("Get tx_chainmask_1ss from mlme failed");
+ ret = qdf_status_to_os_return(status);
+ goto out;
+ }
+ ret = sme_cli_set_command(0, WMI_PDEV_PARAM_TX_CHAIN_MASK_1SS, val,
PDEV_CMD);
if (0 != ret) {
hdd_err("WMI_PDEV_PARAM_TX_CHAIN_MASK_1SS failed %d", ret);
@@ -10736,8 +10681,8 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx)
int set_value;
mac_handle_t mac_handle;
uint32_t num_abg_tx_chains = 0;
- uint32_t num_11b_tx_chains = 0;
- uint32_t num_11ag_tx_chains = 0;
+ uint16_t num_11b_tx_chains = 0;
+ uint16_t num_11ag_tx_chains = 0;
struct policy_mgr_dp_cbacks dp_cbs = {0};
mac_handle = hdd_ctx->mac_handle;
@@ -10771,8 +10716,20 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx)
set_value, PDEV_CMD);
}
- num_11b_tx_chains = hdd_ctx->config->num_11b_tx_chains;
- num_11ag_tx_chains = hdd_ctx->config->num_11ag_tx_chains;
+ status = ucfg_mlme_get_num_11b_tx_chains(hdd_ctx->hdd_psoc,
+ &num_11b_tx_chains);
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("Failed to get num_11b_tx_chains");
+ goto out;
+ }
+
+ status = ucfg_mlme_get_num_11ag_tx_chains(hdd_ctx->hdd_psoc,
+ &num_11ag_tx_chains);
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("Failed to get num_11ag_tx_chains");
+ goto out;
+ }
+
if (!hdd_ctx->config->enable2x2) {
if (num_11b_tx_chains > 1)
num_11b_tx_chains = 1;
diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h
index 9096183564..e47563225e 100644
--- a/core/sme/inc/csr_api.h
+++ b/core/sme/inc/csr_api.h
@@ -1278,8 +1278,6 @@ typedef struct tagCsrConfigParam {
uint8_t fils_max_chan_guard_time;
uint16_t pkt_err_disconn_th;
bool is_force_1x1;
- uint16_t num_11b_tx_chains;
- uint16_t num_11ag_tx_chains;
uint32_t disallow_duration;
uint32_t rssi_channel_penalization;
uint32_t num_disallowed_aps;
diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h
index c61111e378..cf91d7bd8c 100644
--- a/core/sme/inc/csr_internal.h
+++ b/core/sme/inc/csr_internal.h
@@ -583,8 +583,6 @@ struct csr_config {
uint8_t fils_max_chan_guard_time;
uint16_t pkt_err_disconn_th;
bool is_force_1x1;
- uint16_t num_11b_tx_chains;
- uint16_t num_11ag_tx_chains;
uint32_t disallow_duration;
uint32_t rssi_channel_penalization;
uint32_t num_disallowed_aps;
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 3382dc3b3f..c58d04b799 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -90,6 +90,7 @@
#include "service_ready_param.h"
#include "wlan_cp_stats_mc_ucfg_api.h"
#include "cfg_nan_api.h"
+#include "wlan_mlme_api.h"
#define WMA_LOG_COMPLETION_TIMER 3000 /* 3 seconds */
#define WMI_TLV_HEADROOM 128
@@ -3102,6 +3103,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
struct policy_mgr_wma_cbacks wma_cbacks;
struct target_psoc_info *tgt_psoc_info;
int i;
+ bool val = 0;
void *cds_context;
target_resource_config *wlan_res_cfg;
@@ -3245,7 +3247,13 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
wma_set_default_tgt_config(wma_handle, wlan_res_cfg, cds_cfg);
- wma_handle->tx_chain_mask_cck = cds_cfg->tx_chain_mask_cck;
+ qdf_status = wlan_mlme_get_tx_chainmask_cck(psoc, &val);
+ if (qdf_status != QDF_STATUS_SUCCESS) {
+ WMA_LOGE("%s: Failed to get tx_chainmask_cck", __func__);
+ qdf_status = QDF_STATUS_E_FAILURE;
+ goto err_wma_handle;
+ }
+ wma_handle->tx_chain_mask_cck = val;
wma_handle->self_gen_frm_pwr = cds_cfg->self_gen_frm_pwr;
cds_cfg->max_bssid = WMA_MAX_SUPPORTED_BSS;