From ae52c982e40972255f7154fa0938563129323cfd Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Thu, 4 Oct 2018 01:35:18 +0530 Subject: [PATCH] qcacld-3.0: Fix bss scoring params Currently the driver calculates the nss score based upon the max capability of the AP, and not the hw_mde config which would be there after connection for example, the driver calculates the score for a 2x2 11n AP, and 1x1 VHT (11ac) AP, it connects to the 11n AP in 1x1 mode, if a concurrent connection is present, which affects throughput Fix is to check whether the current AP channel results in DBS or not, if yes then change the NSS to 1 instead of 2 Change-Id: I902393be5ea9cf88def9da6b3458bb6048655ce7 CRs-Fixed: 2288362 --- core/hdd/src/wlan_hdd_main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8f824e55f625..cfd1e3ad7c5a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -14034,6 +14034,8 @@ hdd_update_score_config(struct scoring_config *score_config, struct hdd_config *cfg) { struct hdd_context *hdd_ctx; + bool enable2x2 = false; + QDF_STATUS status; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { @@ -14045,7 +14047,15 @@ hdd_update_score_config(struct scoring_config *score_config, score_config->cb_mode_24G = cfg->nChannelBondingMode24GHz; score_config->cb_mode_5G = cfg->nChannelBondingMode5GHz; - score_config->nss = cfg->enable2x2 ? 2 : 1; + + status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &enable2x2); + if (!QDF_IS_STATUS_SUCCESS(status)) + hdd_err("unable to get enable2x2"); + + score_config->vdev_nss_24g = + enable2x2 ? CFG_STA_NSS(cfg->vdev_type_nss_2g) : 1; + score_config->vdev_nss_5g = + enable2x2 ? CFG_STA_NSS(cfg->vdev_type_nss_5g) : 1; if (cfg->dot11Mode == eHDD_DOT11_MODE_AUTO || cfg->dot11Mode == eHDD_DOT11_MODE_11ax ||