From 11aa98c7bc20f604683b306498e882735b7d7e9c Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Mon, 9 Dec 2019 17:56:08 +0530 Subject: [PATCH] qcacld-3.0: Set acs complete in wlan_hdd_cfg80211_acs_ch_select_evt Currently the acs in progress is not set to 0 when acs policy is 1 and the control returns the best channel in do acs itself, hence it can lead to many unexpected behaviour if set to 1 and acs is complete. For example one case sceanrio is that the driver returned from do acs without clearing the acs in progress flag, and then stop adapter comes to the driver for the same interface, the driver would check that if acs in progress is tru then it would wait for 3 seconds for it to complete. Now since there is no complete to be there as ACS had already been completed, there would be an unnecessary delay for 3 seconds to shutdown SAP which would cause latency. Fix is to set the acs in progress as 0 when the overide happens. Change-Id: I03a80c4d4eeeb41f21e95e37bfbeb94e7ebee51e CRs-Fixed: 2582703 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 +++ core/hdd/src/wlan_hdd_hostapd.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1a1e7a84e486..f3a2f437263d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3296,6 +3296,9 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(struct hdd_adapter *adapter) uint32_t id = QCA_NL80211_VENDOR_SUBCMD_DO_ACS_INDEX; uint32_t len = hdd_get_acs_evt_data_len(); + qdf_atomic_set(&adapter->session.ap.acs_in_progress, 0); + qdf_event_set(&adapter->acs_complete_event); + vendor_event = cfg80211_vendor_event_alloc(hdd_ctx->wiphy, &adapter->wdev, len, id, GFP_KERNEL); diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 1cd19804e141..37d8c5f760a0 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -2580,8 +2580,6 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event, ap_ctx->sap_config.acs_cfg.ch_width = sap_event->sapevt.sap_ch_selected.ch_width; wlan_hdd_cfg80211_acs_ch_select_evt(adapter); - qdf_atomic_set(&adapter->session.ap.acs_in_progress, 0); - qdf_event_set(&adapter->acs_complete_event); return QDF_STATUS_SUCCESS; case eSAP_ECSA_CHANGE_CHAN_IND: