From 4547b89cb662b2d79f09b9d550c4beb16604c33e Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Wed, 20 Nov 2019 15:00:23 +0800 Subject: [PATCH] qcacld-3.0: Fix VHT IE Missing for 2G SAP Use "CDS_BAND_2GHZ" to get 2G vht phy capabilities. Also use "total_mac_phy_cnt" to enumerate mac_phy_cap list to get correct 2G phy caps. Change-Id: Ibced9b07370932b65a35f43aa579b3c28ea6e23b CRs-Fixed: 2568539 --- core/hdd/src/wlan_hdd_main.c | 2 +- core/wma/src/wma_main.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 78123b4e0228..56f41721ab34 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1896,7 +1896,7 @@ static void hdd_update_vhtcap_2g(struct hdd_context *hdd_ctx) if (wmi_service_enabled(wmi_handle, wmi_service_ext_msg)) { status = wma_get_caps_for_phyidx_hwmode(&caps_per_phy, HW_MODE_DBS_NONE, - CDS_BAND_ALL); + CDS_BAND_2GHZ); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Failed to get phy caps"); return; diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 78716dc8a965..83c00efc85bc 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -5947,7 +5947,7 @@ static QDF_STATUS wma_get_phyid_for_given_band( struct target_psoc_info *tgt_hdl, enum cds_band_type band, uint8_t *phyid) { - uint8_t idx, i, num_radios; + uint8_t idx, i, total_mac_phy_cnt; struct wlan_psoc_host_mac_phy_caps *mac_phy_cap; if (!wma_handle) { @@ -5957,10 +5957,10 @@ static QDF_STATUS wma_get_phyid_for_given_band( idx = 0; *phyid = idx; - num_radios = target_psoc_get_num_radios(tgt_hdl); + total_mac_phy_cnt = target_psoc_get_total_mac_phy_cnt(tgt_hdl); mac_phy_cap = target_psoc_get_mac_phy_cap(tgt_hdl); - for (i = 0; i < num_radios; i++) { + for (i = 0; i < total_mac_phy_cnt; i++) { if ((band == CDS_BAND_2GHZ) && (WLAN_2G_CAPABILITY == mac_phy_cap[idx + i].supported_bands)) { *phyid = idx + i; @@ -5973,7 +5973,8 @@ static QDF_STATUS wma_get_phyid_for_given_band( return QDF_STATUS_SUCCESS; } } - WMA_LOGD("Using default single hw mode phyid[%d]", *phyid); + WMA_LOGD("Using default single hw mode phyid[%d] total_mac_phy_cnt %d", + *phyid, total_mac_phy_cnt); return QDF_STATUS_SUCCESS; }