summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/inc/wlan_hdd_tdls.h9
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.h4
-rw-r--r--core/hdd/src/wlan_hdd_scan.c28
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c18
4 files changed, 48 insertions, 11 deletions
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h
index 1d589cf5b3a6..b2ec5d91f1a6 100644
--- a/core/hdd/inc/wlan_hdd_tdls.h
+++ b/core/hdd/inc/wlan_hdd_tdls.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -138,14 +138,16 @@ typedef struct {
* @magic: magic
* @attempt: attempt
* @reject: reject
+ * @source: scan request source(NL/Vendor scan)
* @tdls_scan_work: delayed tdls scan work
*/
typedef struct {
struct wiphy *wiphy;
struct cfg80211_scan_request *scan_request;
- int magic;
+ uint32_t magic;
int attempt;
int reject;
+ uint8_t source;
struct delayed_work tdls_scan_work;
} tdls_scan_context_t;
@@ -584,7 +586,8 @@ int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
struct cfg80211_scan_request *request);
int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
- struct cfg80211_scan_request *request);
+ struct cfg80211_scan_request *request,
+ uint8_t source);
void wlan_hdd_tdls_scan_done_callback(hdd_adapter_t *pAdapter);
diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h
index 79c4b563449b..8d936c8a1ef5 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.h
+++ b/core/hdd/src/wlan_hdd_cfg80211.h
@@ -3316,6 +3316,10 @@ void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
#endif
hdd_context_t *hdd_cfg80211_wiphy_alloc(int priv_size);
+int wlan_hdd_cfg80211_tdls_scan(struct wiphy *wiphy,
+ struct cfg80211_scan_request *request,
+ uint8_t source);
+
int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
struct cfg80211_scan_request *request);
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index c84f407f06b2..669be098caec 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -1575,7 +1575,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
* (return -EBUSY)
*/
status = wlan_hdd_tdls_scan_callback(pAdapter, wiphy,
- request);
+ request, source);
if (status <= 0) {
if (!status)
hdd_err("TDLS in progress.scan rejected %d",
@@ -1884,6 +1884,30 @@ int wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
}
/**
+ * wlan_hdd_cfg80211_tdls_scan() - API to process cfg80211 scan request
+ * @wiphy: Pointer to wiphy
+ * @request: Pointer to scan request
+ * @source: scan request source(NL/Vendor scan)
+ *
+ * This API responds to scan trigger and update cfg80211 scan database
+ * later, scan dump command can be used to recieve scan results. This
+ * function gets called when tdls module queues the scan request.
+ *
+ * Return: 0 for success, non zero for failure.
+ */
+int wlan_hdd_cfg80211_tdls_scan(struct wiphy *wiphy,
+ struct cfg80211_scan_request *request,
+ uint8_t source)
+{
+ int ret;
+ cds_ssr_protect(__func__);
+ ret = __wlan_hdd_cfg80211_scan(wiphy,
+ request, source);
+ cds_ssr_unprotect(__func__);
+ return ret;
+}
+
+/**
* wlan_hdd_get_rates() -API to get the rates from scan request
* @wiphy: Pointer to wiphy
* @band: Band
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index a2881f72ed8c..f6d147999462 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -490,8 +490,8 @@ static void wlan_hdd_tdls_schedule_scan(struct work_struct *work)
scan_ctx->attempt++;
- wlan_hdd_cfg80211_scan(scan_ctx->wiphy,
- scan_ctx->scan_request);
+ wlan_hdd_cfg80211_tdls_scan(scan_ctx->wiphy,
+ scan_ctx->scan_request, scan_ctx->source);
}
/**
@@ -637,6 +637,7 @@ void hdd_tdls_context_init(hdd_context_t *hdd_ctx)
hdd_ctx->tdls_scan_ctxt.magic = 0;
hdd_ctx->tdls_scan_ctxt.attempt = 0;
hdd_ctx->tdls_scan_ctxt.reject = 0;
+ hdd_ctx->tdls_scan_ctxt.source = 0;
hdd_ctx->tdls_scan_ctxt.scan_request = NULL;
hdd_ctx->tdls_external_peer_count = 0;
hdd_ctx->set_state_info.set_state_cnt = 0;
@@ -2714,18 +2715,20 @@ int wlan_hdd_tdls_copy_scan_context(hdd_context_t *pHddCtx,
* @dev: net device
* @request: scan request
* @delay: delay value to pass to the work scheduling
+ * @source: scan request source(NL/Vendor scan)
*
* Return: Void
*/
static void wlan_hdd_tdls_scan_init_work(hdd_context_t *pHddCtx,
struct wiphy *wiphy,
struct cfg80211_scan_request *request,
- unsigned long delay)
+ unsigned long delay, uint8_t source)
{
if (TDLS_CTX_MAGIC != pHddCtx->tdls_scan_ctxt.magic) {
wlan_hdd_tdls_copy_scan_context(pHddCtx, wiphy, request);
pHddCtx->tdls_scan_ctxt.attempt = 0;
pHddCtx->tdls_scan_ctxt.magic = TDLS_CTX_MAGIC;
+ pHddCtx->tdls_scan_ctxt.source = source;
}
schedule_delayed_work(&pHddCtx->tdls_scan_ctxt.tdls_scan_work, delay);
}
@@ -2742,7 +2745,8 @@ static void wlan_hdd_tdls_scan_init_work(hdd_context_t *pHddCtx,
* 1 = caller can continue to scan
*/
int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
- struct cfg80211_scan_request *request)
+ struct cfg80211_scan_request *request,
+ uint8_t source)
{
hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
u16 connectedTdlsPeers;
@@ -2795,7 +2799,8 @@ int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
wlan_hdd_tdls_scan_init_work(pHddCtx, wiphy,
request,
- msecs_to_jiffies(delay));
+ msecs_to_jiffies(delay),
+ source);
/* scan should not continue */
return 0;
}
@@ -2891,7 +2896,8 @@ int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy,
wlan_hdd_tdls_scan_init_work(pHddCtx, wiphy,
request,
- msecs_to_jiffies(delay));
+ msecs_to_jiffies(delay),
+ source);
/* scan should not continue */
return 0;
}