From 878422fc9da72e3a004d1082ac77c0b01d51a8f0 Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Thu, 23 Mar 2017 11:34:02 -0700 Subject: [PATCH] qcacmn: Update legacy fixes in new policy manager component Update legacy fixes in new policy manager component: 1. Avoid race condition to get pcl while stopping P2P GO 2. Add 160/80+80 MHz support for STA mode 3. Fix SBS is set to true by policy manager in SCC mode Change-Id: I161ebe382915a6d9eefd6b4e3e2158ff14ad02c1 CRs-Fixed: 2009818 --- src/wlan_policy_mgr_core.c | 43 ++++------------------------- src/wlan_policy_mgr_get_set_utils.c | 24 +++------------- src/wlan_policy_mgr_i.h | 1 - 3 files changed, 9 insertions(+), 59 deletions(-) diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index 56929c602a09..526b8093a90c 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -570,6 +570,11 @@ void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc, bool found = false; struct policy_mgr_psoc_priv_obj *pm_ctx; + if (!info) { + policy_mgr_err("Invalid connection info"); + return; + } + qdf_mem_zero(info, sizeof(*info)); pm_ctx = policy_mgr_get_context(psoc); if (!pm_ctx) { policy_mgr_err("Invalid Context"); @@ -2142,44 +2147,6 @@ bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, return status; } -/** - * policy_mgr_vht160_conn_exist() - to check if we have a connection - * already using vht160 or vht80+80 - * - * This routine will check if vht160 connection already exist or - * no. If it exist then this routine will return true. - * - * Return: true if vht160 connection exist else false - */ -bool policy_mgr_vht160_conn_exist(struct wlan_objmgr_psoc *psoc) -{ - uint32_t conn_index; - bool status = false; - struct policy_mgr_psoc_priv_obj *pm_ctx; - - pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) { - policy_mgr_err("Invalid Context"); - return status; - } - - 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].in_use && - ((pm_conc_connection_list[conn_index].bw == - HW_MODE_80_PLUS_80_MHZ) || - (pm_conc_connection_list[conn_index].bw == - HW_MODE_160_MHZ))) { - status = true; - break; - } - } - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); - - return status; -} - /** * policy_mgr_is_5g_channel_allowed() - check if 5g channel is allowed * @channel: channel number which needs to be validated diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index a881839e85b8..38d55f000669 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -563,17 +563,15 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) return false; } - policy_mgr_notice("SBS service bit map: %d", - pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - /* The agreement with FW is that: To know if the target is SBS * capable, SBS needs to be supported both in the HW mode list * and DBS needs to be supported in the service ready event */ if (!(pm_ctx->wma_cbacks.wma_is_service_enabled( - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) + WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) { + policy_mgr_err("SBS cannot be supported since DBS is disabled"); return false; + } for (i = 0; i < pm_ctx->num_dbs_hw_modes; i++) { param = pm_ctx->hw_mode.hw_mode_list[i]; @@ -588,7 +586,7 @@ bool policy_mgr_is_hw_sbs_capable(struct wlan_objmgr_psoc *psoc) if (found) return true; - return true; + return false; } QDF_STATUS policy_mgr_get_dbs_hw_modes(struct wlan_objmgr_psoc *psoc, @@ -1600,20 +1598,6 @@ bool policy_mgr_allow_concurrency(struct wlan_objmgr_psoc *psoc, qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } - /* don't allow concurrency on vht160 or vht 80+80 */ - if (num_connections && - ((bw == HW_MODE_80_PLUS_80_MHZ) || - (bw == HW_MODE_160_MHZ))) { - policy_mgr_err("No VHT160, we have one connection already"); - goto done; - } - - if (policy_mgr_vht160_conn_exist(psoc)) { - policy_mgr_err("VHT160/80+80 connection exists, no concurrency"); - goto done; - } - - status = true; done: diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 7bd3f6dedb0c..67e69f072bfe 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -389,7 +389,6 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc, uint8_t channel); bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t num_connections); -bool policy_mgr_vht160_conn_exist(struct wlan_objmgr_psoc *psoc); bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t *list, enum policy_mgr_con_mode mode);