From 59f6350e8b5994b51ee546f6ea0f36f0782c1fb7 Mon Sep 17 00:00:00 2001 From: Amruta Kulkarni Date: Wed, 27 Nov 2019 16:45:12 -0800 Subject: [PATCH] qcacld-3.0: Enhance logic for dwell time 2g With this change,in concurrent mode (SAP on 5g and peer connected + STA Scan ongoing), active dwell time 2g is not reset to 0. Change-Id: I20ace5561137a0dd8def497e3bbbbcbeede80ea5 CRs-Fixed: 2572918 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 9 ++++++ .../src/wlan_policy_mgr_get_set_utils.c | 28 +++++++++++++++++++ 2 files changed, 37 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 fe10faadc8..3392006141 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 @@ -3184,4 +3184,13 @@ uint32_t policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq_list, uint8_t *vdev_id, enum policy_mgr_con_mode mode); + +/** + * policy_mgr_is_sap_go_on_2g() - check if sap/go is on 2g + * @psoc: PSOC object information + * + * Return: true or false + */ +bool policy_mgr_is_sap_go_on_2g(struct wlan_objmgr_psoc *psoc); + #endif /* __WLAN_POLICY_MGR_API_H */ 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 2746228ba8..45e88a0e7e 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 @@ -4029,3 +4029,31 @@ QDF_STATUS policy_mgr_update_nan_vdev_mac_info(struct wlan_objmgr_psoc *psoc, return status; } + +bool policy_mgr_is_sap_go_on_2g(struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + uint32_t conn_index; + bool ret = false; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return ret; + } + + qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); + for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; + conn_index++) { + if ((pm_conc_connection_list[conn_index].mode == PM_SAP_MODE || + pm_conc_connection_list[conn_index].mode == PM_P2P_GO_MODE) && + pm_conc_connection_list[conn_index].freq <= + WLAN_REG_MAX_24GHZ_CHAN_FREQ && + pm_conc_connection_list[conn_index].in_use) + ret = true; + } + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + + return ret; +} +