From 79fe8101900ff0551fec6176487be2de0962c00c Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Mon, 25 Feb 2019 15:16:33 +0530 Subject: [PATCH] qcacld-3.0: Check for STA+GO restart only if SAP is active In function policy_mgr_is_restart_sap_allowed, STA+SAP concurrency is decided based on return status of policy_mgr_get_concurrency_mode. It can happen, SAP adapter is opened. But hostapd_open and start_ap is not done. Then, this api will return SAP bit true even even though SAP is not active. So, explicitly check if the SAP is active by checking the SAP connection count along with the concurrency mode. This can result in GO channel override with STA channel. Hence check the sap and go mode connection count along with the concurrency mode. Change-Id: I672d503f34734d7e16175fedc685d2838e77d8f7 CRs-Fixed: 2405189 --- .../policy_mgr/src/wlan_policy_mgr_action.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index 47b0d6de58..a1937d747b 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1238,15 +1238,21 @@ static bool policy_mgr_is_restart_sap_allowed( { uint32_t sta_ap_bit_mask = QDF_STA_MASK | QDF_SAP_MASK; uint32_t sta_go_bit_mask = QDF_STA_MASK | QDF_P2P_GO_MASK; + uint32_t ap_present, go_present; + + ap_present = policy_mgr_mode_specific_connection_count( + psoc, PM_SAP_MODE, NULL); + go_present = policy_mgr_mode_specific_connection_count( + psoc, PM_P2P_GO_MODE, NULL); if ((mcc_to_scc_switch == QDF_MCC_TO_SCC_SWITCH_DISABLE) || !policy_mgr_concurrent_open_sessions_running(psoc) || - !(((policy_mgr_get_concurrency_mode(psoc) & sta_ap_bit_mask) - == sta_ap_bit_mask) || + !((ap_present && ((policy_mgr_get_concurrency_mode(psoc) & + sta_ap_bit_mask) == sta_ap_bit_mask)) || ((mcc_to_scc_switch == - QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) && - ((policy_mgr_get_concurrency_mode(psoc) & sta_go_bit_mask) - == sta_go_bit_mask)))) { + QDF_MCC_TO_SCC_SWITCH_FORCE_PREFERRED_WITHOUT_DISCONNECTION) + && go_present && ((policy_mgr_get_concurrency_mode(psoc) & + sta_go_bit_mask) == sta_go_bit_mask)))) { policy_mgr_debug("MCC switch disabled or not concurrent STA/SAP, STA/GO"); return false; }