summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVidyullatha, Kanchanapally <vidyullatha@codeaurora.org>2016-05-11 20:38:37 +0530
committerVishwajith Upendra <vishwaji@codeaurora.org>2016-06-24 14:30:50 -0700
commit528789e7acbddc893fde606c8b183c57f52671ad (patch)
tree48a406e3c0f989278cd9efa9aac816db1722515e
parent666bf8591bef38e2930236766b5e0042bb2f82a5 (diff)
qcacld-3.0: Implement cfg80211 abort scan API
qcacld-2.0 to qcacld-3.0 propagation There is no support for cfg80211 abort scan API, so implement the cfg80211 abort scan API. Change-Id: I4632c1b4770e6b2f301d67f37005585aef401ab6 CRs-Fixed: 930870
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c4
-rw-r--r--core/hdd/src/wlan_hdd_scan.c57
-rw-r--r--core/hdd/src/wlan_hdd_scan.h8
3 files changed, 67 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 366687c04621..5f695e28a98a 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -12361,4 +12361,8 @@ static struct cfg80211_ops wlan_hdd_cfg80211_ops = {
.channel_switch = wlan_hdd_cfg80211_channel_switch,
#endif
.set_monitor_channel = wlan_hdd_cfg80211_set_mon_ch,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || \
+ defined(CFG80211_ABORT_SCAN)
+ .abort_scan = wlan_hdd_cfg80211_abort_scan,
+#endif
};
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index 7e3acd7d3e84..484a78c562b6 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -1923,13 +1923,13 @@ int wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
return ret;
}
+
/**
* wlan_hdd_scan_abort() - abort ongoing scan
* @pAdapter: Pointer to interface adapter
*
* Return: 0 for success, non zero for failure
*/
-#ifdef FEATURE_WLAN_SCAN_PNO
int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter)
{
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
@@ -1955,6 +1955,7 @@ int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter)
return 0;
}
+#ifdef FEATURE_WLAN_SCAN_PNO
/**
* hdd_sched_scan_callback - scheduled scan callback
* @callbackContext: Callback context
@@ -2439,6 +2440,60 @@ int wlan_hdd_cfg80211_sched_scan_stop(struct wiphy *wiphy,
}
#endif /*FEATURE_WLAN_SCAN_PNO */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || \
+ defined(CFG80211_ABORT_SCAN)
+/**
+ * __wlan_hdd_cfg80211_abort_scan() - cfg80211 abort scan api
+ * @wiphy: Pointer to wiphy
+ * @wdev: Pointer to wireless device structure
+ *
+ * This function is used to abort an ongoing scan
+ *
+ * Return: None
+ */
+static void __wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
+ struct wireless_dev *wdev)
+{
+ struct net_device *dev = wdev->netdev;
+ hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
+ int ret;
+
+ ENTER_DEV(dev);
+
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
+ hdd_err("Command not allowed in FTM mode");
+ return;
+ }
+
+ ret = wlan_hdd_validate_context(hdd_ctx);
+ if (!ret)
+ return;
+
+ wlan_hdd_scan_abort(adapter);
+
+ EXIT();
+}
+
+/**
+ * wlan_hdd_cfg80211_abort_scan - cfg80211 abort scan api
+ * @wiphy: Pointer to wiphy
+ * @wdev: Pointer to wireless device structure
+ *
+ * Wrapper to __wlan_hdd_cfg80211_abort_scan() -
+ * function is used to abort an ongoing scan
+ *
+ * Return: None
+ */
+void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
+ struct wireless_dev *wdev)
+{
+ cds_ssr_protect(__func__);
+ __wlan_hdd_cfg80211_abort_scan(wiphy, wdev);
+ cds_ssr_unprotect(__func__);
+}
+#endif
+
/**
* hdd_cleanup_scan_queue() - remove entries in scan queue
*
diff --git a/core/hdd/src/wlan_hdd_scan.h b/core/hdd/src/wlan_hdd_scan.h
index 50a6a8ddf273..3f8235dfa73d 100644
--- a/core/hdd/src/wlan_hdd_scan.h
+++ b/core/hdd/src/wlan_hdd_scan.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -71,5 +71,11 @@ int wlan_hdd_cfg80211_vendor_scan(struct wiphy *wiphy,
int data_len);
void hdd_cleanup_scan_queue(hdd_context_t *hdd_ctx);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || \
+ defined(CFG80211_ABORT_SCAN)
+void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
+ struct wireless_dev *wdev);
+#endif
#endif /* end #if !defined(WLAN_HDD_SCAN_H) */