From 6ee1ab4a9058bf52eec5fa8b6cc63adee8fe8487 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Wed, 19 Jun 2019 14:00:30 +0530 Subject: [PATCH] qcacld-3.0: Allow DBS scan if enabled in ini Currently the driver checks that DBS for connection is allowed or not, and on that basis rejects the scan, but it may happen that FW supports DBS, and DBS for scan is enabled in the ini, but the DBS for connection is disabled. In that case the diver opts for non-dbs scan. Fix is to allow DBS scan in case of DBS scan enabled in ini. Change-Id: I9feccdb434787f9ae1b87397b9c7a25cb2e40705 CRs-Fixed: 2473835 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 9 +++++ .../src/wlan_policy_mgr_get_set_utils.c | 33 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 4c6e08fd8eaf..086844e24a86 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -2072,6 +2072,15 @@ bool policy_mgr_is_dbs_enable(struct wlan_objmgr_psoc *psoc); */ bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_is_dbs_scan_allowed() - Check if DBS scan is allowed or not + * @psoc: PSOC object information + * Checks if the DBS scan can be performed or not + * + * Return: true if DBS scan is allowed. + */ +bool policy_mgr_is_dbs_scan_allowed(struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_is_hw_sbs_capable() - Check if HW is SBS capable * @psoc: PSOC object information 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 f247b02da665..84ddd53b6250 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 @@ -852,6 +852,39 @@ static bool policy_mgr_find_if_hwlist_has_sbs(struct wlan_objmgr_psoc *psoc) return false; } +bool policy_mgr_is_dbs_scan_allowed(struct wlan_objmgr_psoc *psoc) +{ + uint8_t dbs_type = DISABLE_DBS_CXN_AND_SCAN; + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return false; + } + + if (!policy_mgr_find_if_fw_supports_dbs(psoc) || + !policy_mgr_find_if_hwlist_has_dbs(psoc)) { + policy_mgr_debug("HW mode list has no DBS"); + return false; + } + + policy_mgr_get_dual_mac_feature(psoc, &dbs_type); + /* + * If DBS support for scan is disabled through INI then DBS is not + * supported for scan. + * + * For DBS scan check the INI value explicitly + */ + switch (dbs_type) { + case DISABLE_DBS_CXN_AND_SCAN: + case ENABLE_DBS_CXN_AND_DISABLE_DBS_SCAN: + return false; + default: + return true; + } +} + bool policy_mgr_is_hw_dbs_capable(struct wlan_objmgr_psoc *psoc) { if (!policy_mgr_is_dbs_enable(psoc)) {