From 34fe0b641bf1173a8a242e0b4fb5dc4eb274b8f5 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Wed, 13 Nov 2019 11:08:26 +0530 Subject: [PATCH] qcacld-3.0: Enable the DBS ini if DBS is mandatory The driver does not check the device DBS capability and the DBS ini compatibility( ch select policy) If the DBS ini channel_select_logic_conc is disabled and HW mandates DBS capability then overide the ini to always keep it enable. Change-Id: I629fd8661f70b64808a55c4c9bdafa9608787b09 CRs-Fixed: 2551648 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 12 ++++++++++++ .../policy_mgr/inc/wlan_policy_mgr_cfg.h | 15 +++++++++------ .../src/wlan_policy_mgr_get_set_utils.c | 17 ++++++++++++++++- core/wma/src/wma_main.c | 6 ++++-- 4 files changed, 41 insertions(+), 9 deletions(-) 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 a28e33af55c5..15d11d0586ca 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 @@ -330,6 +330,18 @@ QDF_STATUS policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, uint32_t *chnl_select_plcy); +/** + * policy_mgr_set_ch_select_plcy() - to set channel selection policy + * @psoc: pointer to psoc + * @ch_select_policy: value to be set + * + * This API is used to set the ch selection policy. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_set_ch_select_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t ch_select_policy); + /** * policy_mgr_get_mcc_adaptive_sch() - to get mcc adaptive scheduler * @psoc: pointer to psoc diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h index 801c9ebd0813..69d46e2b28a6 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h @@ -98,6 +98,9 @@ 1, 4, 3, \ CFG_VALUE_OR_DEFAULT, \ "Config max num allowed connections") + +#define POLICY_MGR_CH_SELECT_POLICY_DEF 0x00000003 + /* * * channel_select_logic_conc - Set channel selection logic @@ -121,12 +124,12 @@ * */ #define CFG_CHNL_SELECT_LOGIC_CONC CFG_INI_UINT(\ - "channel_select_logic_conc",\ - 0x00000000, \ - 0xFFFFFFFF, \ - 0x00000003, \ - CFG_VALUE_OR_DEFAULT, \ - "Set channel selection policy for various concurrency") + "channel_select_logic_conc",\ + 0x00000000, \ + 0xFFFFFFFF, \ + POLICY_MGR_CH_SELECT_POLICY_DEF, \ + CFG_VALUE_OR_DEFAULT, \ + "Set channel selection policy for various concurrency") /* * * dbs_selection_policy - Configure dbs selection policy. 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 e8bc517adf90..d272b22a96fc 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 @@ -311,7 +311,7 @@ QDF_STATUS policy_mgr_get_conc_rule2(struct wlan_objmgr_psoc *psoc, } QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, - uint32_t *chnl_select_plcy) + uint32_t *chnl_select_plcy) { struct policy_mgr_psoc_priv_obj *pm_ctx; @@ -325,6 +325,21 @@ QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_set_ch_select_plcy(struct wlan_objmgr_psoc *psoc, + uint32_t ch_select_policy) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + pm_ctx->cfg.chnl_select_plcy = ch_select_policy; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, uint8_t *enable_mcc_adaptive_sch) { diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 4b65cddc7fd2..4c999487fed8 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -6732,10 +6732,12 @@ int wma_rx_service_ready_ext_event(void *handle, uint8_t *event, WMA_LOGD("WMA --> WMI_INIT_CMDID"); if (wma_is_dbs_mandatory(wma_handle->psoc, tgt_hdl) && - (policy_mgr_is_dual_mac_disabled_in_ini(wma_handle->psoc))) + (policy_mgr_is_dual_mac_disabled_in_ini(wma_handle->psoc))) { policy_mgr_set_dual_mac_feature(wma_handle->psoc, ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN); - + policy_mgr_set_ch_select_plcy(wma_handle->psoc, + POLICY_MGR_CH_SELECT_POLICY_DEF); + } wma_init_scan_fw_mode_config(wma_handle->psoc, conc_scan_config_bits, fw_config_bits);