From bfb6f202bf2c13b7f6fbfcc8d8321897243f44be Mon Sep 17 00:00:00 2001 From: Bala Venkatesh Date: Mon, 15 Jul 2019 20:04:29 +0530 Subject: [PATCH] qcacld-3.0: Return success status for stop_ap command in case of SSR If stop_ap is given to driver in case of SSR and other FW down cases, because of invalid vdev id and validate context, failure status is given to kernel. In such case beacon interval value is not reset and that will lead to faliure of subsequent set beacon commands. In case of validate context failure, return success to upper layer so that kernel variables like beacon interval can be cleaned up. Change-Id: I03748a87ffcf38a260134a54fe5dce8f77f08739 CRs-Fixed: 2472089 --- core/hdd/src/wlan_hdd_hostapd.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 9880de83784e..5ee2b5962c4e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5701,6 +5701,17 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, hdd_enter(); + ret = wlan_hdd_validate_context(hdd_ctx); + /** + * In case of SSR and other FW down cases, validate context will + * fail. But return success to upper layer so that it can clean up + * kernal variables like beacon interval. If the failure status + * is returned then next set beacon command will fail as beacon + * interval in not reset. + */ + if (ret) + return 0; + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("Command not allowed in FTM mode"); return -EINVAL; @@ -5732,10 +5743,6 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, hdd_debug("Device_mode %s(%d)", qdf_opmode_str(adapter->device_mode), adapter->device_mode); - ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) - return ret; - /* * If a STA connection is in progress in another adapter, disconnect * the STA and complete the SAP operation. STA will reconnect