From 0047bcc4fe1dd41eb97c9f94cea45f02b36152a9 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Wed, 18 Nov 2020 14:53:40 +0530 Subject: [PATCH] qcacld-3.0: Use correct API for DBS capability Currently the driver uses the API policy_mgr_is_dbs_enable to check whether the DBS is enable or not which does not check the service capability of DBS, and thus would return true if ini and FW HW modes contain DBS. In this case if STA is on 5ghz and SAP comes on 2.4ghz then force SCC would not happen as the driver would consider the HW to be DBS capable which actually is not, and thus the overall concurrency would be MCC which is not favourable. Fix is to use policy_mgr_is_hw_dbs_capable API instead of DBS enable API which checks for the service bit also, so that the driver forces SAP to STA's channel. Change-Id: I9319293ecfb54fe3e1ad0eaff15542c671514bf4 CRs-Fixed: 2820377 --- .../policy_mgr/src/wlan_policy_mgr_get_set_utils.c | 6 ++++-- core/sme/src/csr/csr_util.c | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index 030dc0845b..db9b6621ee 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -4456,8 +4456,10 @@ bool policy_mgr_is_restart_sap_required(struct wlan_objmgr_psoc *psoc, connection[i].in_use && (connection[i].mode == PM_STA_MODE || connection[i].mode == PM_P2P_CLIENT_MODE); - is_same_mac = connection[i].mac == mac && - connection[i].freq != freq; + + is_same_mac = connection[i].freq != freq && + (connection[i].mac == mac || + !policy_mgr_is_hw_dbs_capable(psoc)); if (is_sta_p2p_cli && is_same_mac) { restart_required = true; diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 5e6d31886e..e00c48d106 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1077,7 +1077,7 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx, sme_debug("intf_ch:%d sap_ch:%d cc_switch_mode:%d, dbs:%d", intf_ch_freq, sap_ch_freq, cc_switch_mode, - policy_mgr_is_dbs_enable(mac_ctx->psoc)); + policy_mgr_is_hw_dbs_capable(mac_ctx->psoc)); if (intf_ch_freq && sap_ch_freq != intf_ch_freq && !policy_mgr_is_force_scc(mac_ctx->psoc)) { @@ -1102,7 +1102,7 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx, sap_ch_freq <= wlan_reg_ch_to_freq(CHAN_ENUM_2484)) || (intf_ch_freq > wlan_reg_ch_to_freq(CHAN_ENUM_2484) && sap_ch_freq > wlan_reg_ch_to_freq(CHAN_ENUM_2484)))) { - if (policy_mgr_is_dbs_enable(mac_ctx->psoc) || + if (policy_mgr_is_hw_dbs_capable(mac_ctx->psoc) || cc_switch_mode == QDF_MCC_TO_SCC_WITH_PREFERRED_BAND) intf_ch_freq = 0; @@ -1167,7 +1167,6 @@ uint8_t csr_get_connected_infra(struct mac_context *mac_ctx) return connected_session; } - bool csr_is_concurrent_session_running(struct mac_context *mac) { uint32_t sessionId, noOfCocurrentSession = 0;