From 5639d1455702c6c65e7b765dcd756fa2a6289cd6 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Mon, 11 Jan 2021 11:14:55 +0530 Subject: [PATCH] qcacld-3.0: Allow/reject WAPI concurrency based on firmware support Currently, host driver rejects any concurrent session with other security modes(e.g. NAN) when WAPI is present. This is due to a limitation on older platforms. But newer platforms(e.g. Lithium architecture) support WAPI+other security modes concurrently. Firmware advertises service capability WAPI_CONCURRENCY_SUPPORTED if it supports other security modes when WAPI is active. Get the capability and accept/reject concurrent sessions. Change-Id: I0e004e1220afd9c42869589364606c9f729798f7 CRs-Fixed: 2844799 --- .../src/wlan_policy_mgr_get_set_utils.c | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) 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 21ae1d7f6f0a..5ecafa307ba4 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 @@ -2226,26 +2226,40 @@ static bool policy_mgr_is_sub_20_mhz_enabled(struct wlan_objmgr_psoc *psoc) } /** - * policy_mgr_check_privacy_for_new_conn() - Check privacy mode concurrency + * policy_mgr_allow_wapi_concurrency() - Check if WAPI concurrency is allowed * @pm_ctx: policy_mgr_psoc_priv_obj policy mgr context * * This routine is called to check vdev security mode allowed in concurrency. * At present, WAPI security mode is not allowed to run concurrency with any - * other vdev. + * other vdev if the hardware doesn't support WAPI concurrency. * * Return: true - allow */ -static bool policy_mgr_check_privacy_for_new_conn( - struct policy_mgr_psoc_priv_obj *pm_ctx) +static bool +policy_mgr_allow_wapi_concurrency(struct policy_mgr_psoc_priv_obj *pm_ctx) { struct wlan_objmgr_pdev *pdev = pm_ctx->pdev; + struct wmi_unified *wmi_handle; + struct wlan_objmgr_psoc *psoc; if (!pdev) { policy_mgr_debug("pdev is Null"); - return true; + return false; } - if (mlme_is_wapi_sta_active(pdev) && + psoc = wlan_pdev_get_psoc(pdev); + if (!psoc) + return false; + + 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_wapi_concurrency_supported) && + mlme_is_wapi_sta_active(pdev) && policy_mgr_get_connection_count(pm_ctx->psoc) > 0) return false; @@ -2547,7 +2561,7 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc, qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); } - if (!policy_mgr_check_privacy_for_new_conn(pm_ctx)) { + if (!policy_mgr_allow_wapi_concurrency(pm_ctx)) { policy_mgr_rl_debug("Don't allow new conn when wapi security conn existing"); goto done; }