From 82fb8031d94290ac0870d1b2db691b54ee2f2abb Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Tue, 2 Apr 2019 16:29:30 +0530 Subject: [PATCH] qcacld-3.0: Avoid STA plus STA concurrent connections Add policy manager support to avoid simultaneous connections on STA plus STA concurrent interfaces when WMI_SERVICE_STA_PLUS_STA_SUPPORT is not set. Change-Id: I73e65c56a98908128d56af2f4fba8ced5210fff1 CRs-Fixed: 2427828 --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 11 +++++++ .../src/wlan_policy_mgr_get_set_utils.c | 30 +++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 7dcf9950e5..1716caa948 100644 --- a/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -2794,6 +2794,17 @@ bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, uint8_t channel, uint32_t vdev_id); +/** + * policy_mgr_allow_multiple_sta_connections() - API to get FW support + * @psoc: Pointer to soc + * + * This function checks FW support for simultaneous connections on + * concurrent STA interfaces. + * + * Return: true if supports else false. + */ +bool policy_mgr_allow_multiple_sta_connections(struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_dual_beacon_on_single_mac_scc_capable() - get capability that * whether support dual beacon on same channel on single MAC diff --git a/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index a007f442e3..fa0ac047a3 100644 --- a/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -1981,14 +1981,22 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, } } + count = policy_mgr_mode_specific_connection_count(psoc, PM_STA_MODE, + list); + + /* Check for STA+STA concurrency */ + if (mode == PM_STA_MODE && count && + !policy_mgr_allow_multiple_sta_connections(psoc)) { + policy_mgr_err("No 2nd STA connection, already one STA is connected"); + goto done; + } + /* * Check all IBSS+STA concurrencies * * don't allow IBSS + STA MCC * don't allow IBSS + STA SCC if IBSS is on DFS channel */ - count = policy_mgr_mode_specific_connection_count(psoc, - PM_STA_MODE, list); if ((PM_IBSS_MODE == mode) && (policy_mgr_mode_specific_connection_count(psoc, PM_IBSS_MODE, list)) && count) { @@ -3414,6 +3422,24 @@ bool policy_mgr_allow_sap_go_concurrency(struct wlan_objmgr_psoc *psoc, return true; } +bool policy_mgr_allow_multiple_sta_connections(struct wlan_objmgr_psoc *psoc) +{ + struct wmi_unified *wmi_handle; + + wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); + if (!wmi_handle) { + policy_mgr_debug("Invalid WMI handle"); + return false; + } + + if (wmi_service_enabled(wmi_handle, + wmi_service_sta_plus_sta_support)) + return true; + + policy_mgr_debug("Concurrent STA connections are not supported"); + return false; +} + bool policy_mgr_dual_beacon_on_single_mac_scc_capable( struct wlan_objmgr_psoc *psoc) {