|
@@ -28,6 +28,7 @@
|
|
|
#include "wma_internal.h"
|
|
|
#include "wlan_crypto_global_api.h"
|
|
|
#include "wlan_utility.h"
|
|
|
+#include "wlan_policy_mgr_ucfg.h"
|
|
|
|
|
|
QDF_STATUS wlan_mlme_get_cfg_str(uint8_t *dst, struct mlme_cfg_str *cfg_str,
|
|
|
qdf_size_t *len)
|
|
@@ -875,11 +876,57 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
{
|
|
|
int ret_val;
|
|
|
uint8_t ch_msk_val;
|
|
|
+ struct wma_caps_per_phy non_dbs_phy_cap;
|
|
|
struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc);
|
|
|
+ QDF_STATUS status;
|
|
|
+ bool enable2x2, as_enabled, enable_bt_chain_sep;
|
|
|
+ uint8_t dual_mac_feature;
|
|
|
+ bool hw_dbs_2x2_cap, mrc_disabled_2g_rx, mrc_disabled_2g_tx;
|
|
|
+ bool mrc_disabled_5g_rx, mrc_disabled_5g_tx;
|
|
|
|
|
|
if (!mlme_obj)
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
|
|
|
+ status = wma_get_caps_for_phyidx_hwmode(&non_dbs_phy_cap,
|
|
|
+ HW_MODE_DBS_NONE,
|
|
|
+ CDS_BAND_ALL);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ mlme_legacy_err("couldn't get phy caps. skip chain mask programming");
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (non_dbs_phy_cap.tx_chain_mask_2G < 3 ||
|
|
|
+ non_dbs_phy_cap.rx_chain_mask_2G < 3 ||
|
|
|
+ non_dbs_phy_cap.tx_chain_mask_5G < 3 ||
|
|
|
+ non_dbs_phy_cap.rx_chain_mask_5G < 3) {
|
|
|
+ mlme_legacy_debug("firmware not capable. skip chain mask programming");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ enable2x2 = mlme_obj->cfg.vht_caps.vht_cap_info.enable2x2;
|
|
|
+ enable_bt_chain_sep =
|
|
|
+ mlme_obj->cfg.chainmask_cfg.enable_bt_chain_separation;
|
|
|
+ as_enabled = mlme_obj->cfg.gen.as_enabled;
|
|
|
+ ucfg_policy_mgr_get_dual_mac_feature(psoc, &dual_mac_feature);
|
|
|
+
|
|
|
+ hw_dbs_2x2_cap = policy_mgr_is_hw_dbs_2x2_capable(psoc);
|
|
|
+ mrc_disabled_2g_rx =
|
|
|
+ mlme_obj->cfg.nss_chains_ini_cfg.disable_rx_mrc[NSS_CHAINS_BAND_2GHZ];
|
|
|
+ mrc_disabled_2g_tx =
|
|
|
+ mlme_obj->cfg.nss_chains_ini_cfg.disable_tx_mrc[NSS_CHAINS_BAND_2GHZ];
|
|
|
+ mrc_disabled_5g_rx =
|
|
|
+ mlme_obj->cfg.nss_chains_ini_cfg.disable_rx_mrc[NSS_CHAINS_BAND_5GHZ];
|
|
|
+ mrc_disabled_5g_tx =
|
|
|
+ mlme_obj->cfg.nss_chains_ini_cfg.disable_tx_mrc[NSS_CHAINS_BAND_5GHZ];
|
|
|
+
|
|
|
+ mlme_legacy_debug("enable2x2 %d enable_bt_chain_sep %d dual mac feature %d antenna sharing %d HW 2x2 cap %d",
|
|
|
+ enable2x2, enable_bt_chain_sep, dual_mac_feature,
|
|
|
+ as_enabled, hw_dbs_2x2_cap);
|
|
|
+
|
|
|
+ mlme_legacy_debug("MRC values TX:- 2g %d 5g %d RX:- 2g %d 5g %d",
|
|
|
+ mrc_disabled_2g_tx, mrc_disabled_5g_tx,
|
|
|
+ mrc_disabled_2g_rx, mrc_disabled_5g_rx);
|
|
|
+
|
|
|
mlme_legacy_debug("txchainmask1x1: %d rxchainmask1x1: %d",
|
|
|
mlme_obj->cfg.chainmask_cfg.txchainmask1x1,
|
|
|
mlme_obj->cfg.chainmask_cfg.rxchainmask1x1);
|
|
@@ -890,6 +937,12 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g,
|
|
|
mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g);
|
|
|
|
|
|
+ if (enable2x2 || !enable_bt_chain_sep || as_enabled ||
|
|
|
+ (!hw_dbs_2x2_cap && dual_mac_feature != DISABLE_DBS_CXN_AND_SCAN)) {
|
|
|
+ mlme_legacy_err("Cannot configure chainmask to FW");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
if (mlme_obj->cfg.chainmask_cfg.txchainmask1x1) {
|
|
|
ch_msk_val = mlme_obj->cfg.chainmask_cfg.txchainmask1x1;
|
|
|
ret_val = wma_cli_set_command(session_id,
|
|
@@ -914,7 +967,8 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|
|
|
- if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g) {
|
|
|
+ if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g &&
|
|
|
+ mrc_disabled_2g_tx) {
|
|
|
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,
|
|
@@ -923,7 +977,8 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g) {
|
|
|
+ if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g &&
|
|
|
+ mrc_disabled_2g_rx) {
|
|
|
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,
|
|
@@ -932,7 +987,8 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g) {
|
|
|
+ if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g &&
|
|
|
+ mrc_disabled_5g_tx) {
|
|
|
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,
|
|
@@ -941,7 +997,8 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
|
|
|
return QDF_STATUS_E_FAILURE;
|
|
|
}
|
|
|
|
|
|
- if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g) {
|
|
|
+ if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g &&
|
|
|
+ mrc_disabled_5g_rx) {
|
|
|
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,
|