From af483f51a810e8eb0f03a070ec701b32aced0d52 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Fri, 19 Jul 2019 09:04:07 +0530 Subject: [PATCH] qcacld-3.0: Update the acs mode in case of concurrency Issue:- Sap does not restart when unsafe channel event comes, due to the acs mode flag not set though acs happened. Scenario:- Turn on STA on channel number 1. Turn on SAP on 2.4ghz band. Make the channel number unsafe. Observation:- Sap fails to restart. Expectation: Sap should restart on some other channel. Fix:- Set the flag before the driver returns the best channel as the STA channel. Change-Id: I2cf2f5d3096da04f3c43969b7405b81c743fe2e2 CRs-Fixed: 2492087 --- core/hdd/src/wlan_hdd_cfg80211.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2e7ac949e2b3..8fadcc774c3d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2840,6 +2840,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, if (!QDF_IS_STATUS_SUCCESS(qdf_status)) hdd_err("get_external_acs_policy failed"); + sap_config->acs_cfg.acs_mode = true; + if (is_external_acs_policy && policy_mgr_is_force_scc(hdd_ctx->psoc) && policy_mgr_get_connection_count(hdd_ctx->psoc)) { @@ -2927,7 +2929,6 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, hdd_debug("%d ", sap_config->acs_cfg.ch_list[i]); } - sap_config->acs_cfg.acs_mode = true; if (test_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags)) { /* ***Note*** Completion variable usage is not allowed * here since ACS scan operation may take max 2.2 sec @@ -3012,14 +3013,19 @@ static int wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, void wlan_hdd_undo_acs(struct hdd_adapter *adapter) { + struct sap_config *sap_cfg; + if (!adapter) return; - if (adapter->session.ap.sap_config.acs_cfg.ch_list) { + + sap_cfg = &adapter->session.ap.sap_config; + if (sap_cfg->acs_cfg.ch_list) { hdd_debug("Clearing ACS cfg channel list"); - qdf_mem_free(adapter->session.ap.sap_config.acs_cfg.ch_list); - adapter->session.ap.sap_config.acs_cfg.ch_list = NULL; + qdf_mem_free(sap_cfg->acs_cfg.ch_list); + sap_cfg->acs_cfg.ch_list = NULL; } - adapter->session.ap.sap_config.acs_cfg.ch_list_count = 0; + sap_cfg->acs_cfg.ch_list_count = 0; + sap_cfg->acs_cfg.acs_mode = false; } /**