From b83227ed06e71baa792bebdbc8f77b8c4c3a11c6 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 30 Nov 2020 15:31:42 +0800 Subject: [PATCH] qcacld-3.0: Fix SAP moved to unsafe channel At present when user trigger SAP move to unsafe channel, driver doesn't reject the request since "strict = false" and unsafe checking is skipped. Fix by check SAP channel switch target channel safe or unsafe with API policy_mgr_is_sap_freq_allowed before perform channel switch. Change-Id: I2950fb31346df8705c8fc608fd79e1a44f4d4947 CRs-Fixed: 2826619 --- .../policy_mgr/src/wlan_policy_mgr_get_set_utils.c | 4 +++- core/sap/src/sap_module.c | 3 +-- 2 files changed, 4 insertions(+), 3 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 8bfc359859bf..8ebf4abd19c0 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 @@ -4323,7 +4323,9 @@ bool policy_mgr_is_sta_sap_scc(struct wlan_objmgr_psoc *psoc, conn_index++) { if (pm_conc_connection_list[conn_index].in_use && (pm_conc_connection_list[conn_index].mode == - PM_STA_MODE) && (sap_freq == + PM_STA_MODE || + pm_conc_connection_list[conn_index].mode == + PM_P2P_CLIENT_MODE) && (sap_freq == pm_conc_connection_list[conn_index].freq)) { is_scc = true; break; diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index f54fbbd8c20f..d8efc645146c 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1378,8 +1378,7 @@ QDF_STATUS wlansap_set_channel_change_with_csa(struct sap_context *sap_ctx, } mac_handle = MAC_HANDLE(mac); - if (strict && !policy_mgr_is_safe_channel( - mac->psoc, target_chan_freq)) { + if (!policy_mgr_is_sap_freq_allowed(mac->psoc, target_chan_freq)) { sap_err("%u is unsafe channel freq", target_chan_freq); return QDF_STATUS_E_FAULT; }