From b57cdca9762d0e8d4ddefc52561882fff57f4dc1 Mon Sep 17 00:00:00 2001 From: Sravan Goud Date: Mon, 30 Mar 2020 17:30:13 +0530 Subject: [PATCH] qcacld-3.0: Deregister sap clients before stop bss In stop bss write to reo remap control registers happen after pcie power collapse is enabled. As pcie power collapse is enabled sometimes reo remap register write is not going through. For sta + sap concurrency this is resulting in NOC error when other sta interface connecting to AP after stop bss. Disable autonomy or reo remap registers to sw host destination rings happen as part of last sap client deregistration. In this change deregister sap clients before stop bss. Change-Id: Ic84a1d45b5b376ec8ad28a05246efc4252b390ab CRs-fixed: 2643092 --- core/hdd/src/wlan_hdd_cfg80211.c | 13 +++++++------ core/hdd/src/wlan_hdd_cfg80211.h | 2 +- core/hdd/src/wlan_hdd_main.c | 6 ++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index b8e9253cd3..6e83bb959f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -20867,9 +20867,9 @@ fn_end: * wlan_hdd_del_station() - delete station wrapper * @adapter: pointer to the hdd adapter * - * Return: None + * Return: Errno */ -void wlan_hdd_del_station(struct hdd_adapter *adapter) +int wlan_hdd_del_station(struct hdd_adapter *adapter) { struct station_del_parameters del_sta; @@ -20877,13 +20877,14 @@ void wlan_hdd_del_station(struct hdd_adapter *adapter) del_sta.subtype = SIR_MAC_MGMT_DEAUTH >> 4; del_sta.reason_code = eCsrForcedDeauthSta; - wlan_hdd_cfg80211_del_station(adapter->wdev.wiphy, adapter->dev, - &del_sta); + return wlan_hdd_cfg80211_del_station(adapter->wdev.wiphy, + adapter->dev, &del_sta); } #else -void wlan_hdd_del_station(struct hdd_adapter *adapter) +int wlan_hdd_del_station(struct hdd_adapter *adapter) { - wlan_hdd_cfg80211_del_station(adapter->wdev.wiphy, adapter->dev, NULL); + return wlan_hdd_cfg80211_del_station(adapter->wdev.wiphy, + adapter->dev, NULL); } #endif diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 69899d87c2..696f2e110f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -437,7 +437,7 @@ void hdd_select_cbmode(struct hdd_adapter *adapter, uint32_t oper_freq, * Return: true or false based on findings */ bool wlan_hdd_is_ap_supports_immediate_power_save(uint8_t *ies, int length); -void wlan_hdd_del_station(struct hdd_adapter *adapter); +int wlan_hdd_del_station(struct hdd_adapter *adapter); #if defined(USE_CFG80211_DEL_STA_V2) int wlan_hdd_cfg80211_del_station(struct wiphy *wiphy, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 891273b74e..8580df4d11 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6420,8 +6420,10 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, case QDF_SAP_MODE: wlan_hdd_scan_abort(adapter); /* Diassociate with all the peers before stop ap post */ - if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) - wlan_hdd_del_station(adapter); + if (test_bit(SOFTAP_BSS_STARTED, &adapter->event_flags)) { + if (wlan_hdd_del_station(adapter)) + hdd_sap_indicate_disconnect_for_sta(adapter); + } status = wlan_hdd_flush_pmksa_cache(adapter); if (QDF_IS_STATUS_ERROR(status)) hdd_debug("Cannot flush PMKIDCache");