From feb24397f192859f9a84868bd6a0a13f5de9d46b Mon Sep 17 00:00:00 2001 From: Min Liu Date: Thu, 19 Nov 2020 17:35:13 +0800 Subject: [PATCH] qcacld-3.0: Get dynamic nss configuration for STA For STA, get dynamic nss configuration if it is supported by FW. Change-Id: Ie1fce5896e473e361672f7e021d3acf6653cb964 CRs-Fixed: 2822062 --- core/hdd/src/wlan_hdd_cfg.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 9cb255e6703b..0f4f272c1478 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -1257,19 +1257,32 @@ QDF_STATUS hdd_get_nss(struct hdd_adapter *adapter, uint8_t *nss) { struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); bool bval; - QDF_STATUS status; + QDF_STATUS status = QDF_STATUS_SUCCESS; - status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &bval); - if (!QDF_IS_STATUS_SUCCESS(status)) { - hdd_err("unable to get vht_enable2x2"); - return status; + /* + * If FW is supporting the dynamic nss update, this command is meant to + * be per vdev, so get nss in the ini params of that particular vdev + * otherwise get it from the global param enable2x2 + */ + if (hdd_ctx->dynamic_nss_chains_support) { + uint8_t nss_2g, nss_5g; + + sme_get_vdev_type_nss(adapter->device_mode, &nss_2g, &nss_5g); + /* Different settings in 2G and 5G is not supported */ + *nss = nss_2g; + } else { + status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &bval); + if (!QDF_IS_STATUS_SUCCESS(status)) { + hdd_err("unable to get vht_enable2x2"); + return status; + } + + *nss = (bval) ? 2 : 1; + if (!policy_mgr_is_hw_dbs_2x2_capable(hdd_ctx->psoc) && + policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc)) + *nss = *nss - 1; } - *nss = (bval) ? 2 : 1; - if (!policy_mgr_is_hw_dbs_2x2_capable(hdd_ctx->psoc) && - policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc)) - *nss = *nss - 1; - return status; }