summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadma, Santhosh Kumar <skpadma@codeaurora.org>2017-01-05 19:39:06 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-01-16 16:40:16 -0800
commit6f6a4768927637f65a1e1f0a94aebc47b7a6bcee (patch)
tree6051a15229f0110af11ef93285779a77c816d940
parentdafdb00900e054962524692ba17a1e18dbb9f93b (diff)
qcacld-3.0: Send scan results to kernel as and when driver receives
Currently scan results are first cached in SME and then they are updated to kernel using results in SME cache. This may result in updation of stale entries to kernel. Fix this by sending scan results to kernel as and when driver receives them. Also, add changes to send ext scan results to kernel. Change-Id: I18f4b36cf3a9fc2e191352c868f69d797eb0a786 CRs-Fixed: 1098411
-rw-r--r--core/hdd/inc/wlan_hdd_main.h1
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c1
-rw-r--r--core/hdd/src/wlan_hdd_scan.c22
-rw-r--r--core/mac/src/pe/lim/lim_process_message_queue.c30
-rw-r--r--core/sme/src/csr/csr_api_scan.c14
5 files changed, 56 insertions, 12 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 371cf5155b64..241b9fd82527 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1600,6 +1600,7 @@ struct hdd_context_s {
uint8_t last_scan_reject_session_id;
scan_reject_states last_scan_reject_reason;
unsigned long last_scan_reject_timestamp;
+ uint8_t beacon_probe_rsp_cnt_per_scan;
};
/*---------------------------------------------------------------------------
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index c16547cfbae2..cedfc74a0dff 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11279,6 +11279,7 @@ struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
bss_status =
cfg80211_inform_bss_frame(wiphy, chan, mgmt, frame_len, rssi,
GFP_KERNEL);
+ pHddCtx->beacon_probe_rsp_cnt_per_scan++;
qdf_mem_free(mgmt);
return bss_status;
}
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index 358c4bdd7877..dda89ddd31cb 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -1211,9 +1211,15 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
goto allow_suspend;
}
- ret = wlan_hdd_cfg80211_update_bss((WLAN_HDD_GET_CTX(pAdapter))->wiphy,
- pAdapter, scan_time);
- if (0 > ret) {
+ /*
+ * cfg80211_scan_done informing NL80211 about completion
+ * of scanning
+ */
+ if (status == eCSR_SCAN_ABORT || status == eCSR_SCAN_FAILURE) {
+ aborted = true;
+ }
+
+ if (!aborted && !hddctx->beacon_probe_rsp_cnt_per_scan) {
hdd_notice("NO SCAN result");
if (hddctx->config->bug_report_for_no_scan_results) {
current_timestamp = jiffies_to_msecs(jiffies);
@@ -1235,14 +1241,7 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
}
}
}
-
- /*
- * cfg80211_scan_done informing NL80211 about completion
- * of scanning
- */
- if (status == eCSR_SCAN_ABORT || status == eCSR_SCAN_FAILURE) {
- aborted = true;
- }
+ hddctx->beacon_probe_rsp_cnt_per_scan = 0;
if (!wlan_hdd_is_scan_pending(pAdapter)) {
/* Scan is no longer pending */
@@ -1889,6 +1888,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
wlan_hdd_scan_request_enqueue(pAdapter, request, source,
scan_req.scan_id, scan_req.timestamp);
pAdapter->scan_info.mScanPending = true;
+ pHddCtx->beacon_probe_rsp_cnt_per_scan = 0;
free_mem:
if (scan_req.SSIDs.SSIDList)
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 7ac76884164c..53922c9dc126 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -509,6 +509,8 @@ __lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
uint8_t *body;
tSirMsgQ mmh_msg;
tpSirMacMgmtHdr hdr;
+ uint32_t frame_len;
+ tSirBssDescription *bssdescr;
result = qdf_mem_malloc(sizeof(*result) + ie_len);
if (NULL == result) {
@@ -542,6 +544,32 @@ __lim_ext_scan_forward_bcn_probe_rsp(tpAniSirGlobal pmac, uint8_t *rx_pkt_info,
qdf_mem_copy((uint8_t *) &result->ap.ieData,
body + SIR_MAC_B_PR_SSID_OFFSET, ie_len);
+
+ frame_len = sizeof(*bssdescr) + ie_len - sizeof(bssdescr->ieFields[1]);
+ bssdescr = (tSirBssDescription *) qdf_mem_malloc(frame_len);
+
+ if (NULL == bssdescr) {
+ lim_log(pmac, LOGE,
+ FL("qdf_mem_malloc(length=%d) failed"), frame_len);
+ return;
+ }
+
+ qdf_mem_zero(bssdescr, frame_len);
+
+ lim_collect_bss_description(pmac, bssdescr, frame, rx_pkt_info, false);
+ /*
+ * Send the beacon to CSR with registered callback routine.
+ * scan_id and flags parameters are currently unused and set to 0.
+ * EXT scan results will also be added to scan cache in SME
+ */
+ if (pmac->lim.add_bssdescr_callback) {
+ (pmac->lim.add_bssdescr_callback) (pmac, bssdescr, 0, 0);
+ } else {
+ lim_log(pmac, LOGE,
+ FL("No CSR callback routine to send beacon/probe response"));
+ }
+ qdf_mem_free(bssdescr);
+
mmh_msg.type = msg_type;
mmh_msg.bodyptr = result;
mmh_msg.bodyval = 0;
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index b9e2c52d5ba8..d814999c4493 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -4662,6 +4662,7 @@ QDF_STATUS csr_scan_process_single_bssdescr(tpAniSirGlobal mac_ctx,
uint8_t *chanlist = NULL;
uint8_t cnt_channels = 0;
uint32_t len = sizeof(mac_ctx->roam.validChannelList);
+ tCsrRoamInfo *roam_info;
sms_log(mac_ctx, LOG4, "CSR: Processing single bssdescr");
if (QDF_IS_STATUS_SUCCESS(
@@ -4679,6 +4680,19 @@ QDF_STATUS csr_scan_process_single_bssdescr(tpAniSirGlobal mac_ctx,
if (csr_scan_validate_scan_result(mac_ctx, chanlist,
cnt_channels, bssdescr, &ies)) {
+ roam_info = qdf_mem_malloc(sizeof(*roam_info));
+ if (roam_info) {
+ qdf_mem_zero(roam_info, sizeof(*roam_info));
+ roam_info->pBssDesc = bssdescr;
+
+ csr_roam_call_callback(mac_ctx, 0, roam_info, 0,
+ eCSR_ROAM_UPDATE_SCAN_RESULT,
+ eCSR_ROAM_RESULT_NONE);
+ qdf_mem_free(roam_info);
+ } else {
+ sms_log(mac_ctx, LOG1, "qdf_mem_malloc failed");
+ }
+
csr_scan_remove_dup_bss_description_from_interim_list
(mac_ctx, bssdescr, ies);
csr_scan_save_bss_description_to_interim_list