From 2131523a2bb46b96c35c4144b34f23f24477fc52 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Wed, 31 Oct 2018 18:40:44 +0530 Subject: [PATCH] qcacmn: Return success during the sched stop request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In a scenario wherein after the sched_scan_start there is a system recovery and previous pending sched_scan request is lost and during the sched_scan_stop driver is returning error. Because of which __cfg80211_stop_sched_scan will not clear “rdev->sched_scan_req” blocking further sched_scan requests. Return success in the event that the driver does not have any pending sched scan to flush. Change-Id: I6aba88ce033c59ebae54ca792e241a17b649ad73 CRs-Fixed: 2340653 --- os_if/linux/scan/src/wlan_cfg80211_scan.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/os_if/linux/scan/src/wlan_cfg80211_scan.c b/os_if/linux/scan/src/wlan_cfg80211_scan.c index 68ae50cf0fa2..8adf7850ebc9 100644 --- a/os_if/linux/scan/src/wlan_cfg80211_scan.c +++ b/os_if/linux/scan/src/wlan_cfg80211_scan.c @@ -587,27 +587,31 @@ error: int wlan_cfg80211_sched_scan_stop(struct wlan_objmgr_pdev *pdev, struct net_device *dev) { - int ret = 0; QDF_STATUS status; struct wlan_objmgr_vdev *vdev; vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(pdev, dev->dev_addr, WLAN_OSIF_ID); if (!vdev) { + /* + * cfg80211 expects sched_scan_stop command to always succeed. + * There can be recovery or any other error in the driver between the + * sched_scan_start and sched_scan_stop commands. If driver does + * not return success in this case there is a possibility of further + * sched_scan_start request might not be received again. + */ cfg80211_err("vdev object is NULL"); - return -EIO; + return 0; } status = ucfg_scan_pno_stop(vdev); - if (QDF_IS_STATUS_ERROR(status)) { + if (QDF_IS_STATUS_ERROR(status)) cfg80211_err("Failed to disabled PNO"); - ret = -EINVAL; - } else { + else cfg80211_info("PNO scan disabled"); - } wlan_objmgr_vdev_release_ref(vdev, WLAN_OSIF_ID); - return ret; + return 0; } #endif /*FEATURE_WLAN_SCAN_PNO */