summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKapil Gupta <kapgupta@codeaurora.org>2016-04-22 15:35:26 +0530
committerNishank Aggarwal <naggar@codeaurora.org>2016-09-16 21:06:37 +0530
commit0ed58dc6284a3d6591919f1edf4bc644ca8c291a (patch)
tree46c3f0a0d57a7522a835f18b8cea821a62b8b05e
parent0255f8542d735c5feb2ef1d48344485df9919578 (diff)
qcacld-3.0: Create bug report in case of nil scan results
qcacld-2.0 to qcacld-3.0 propagation Host should trigger bug report if HDD has zero scan results to report to cfg80211 layer. Add changes to trigger bug report if HDD has zero scan results. Change-Id: Ibac7fc5abfc860fc8759fe2cd029d19e2d6662a9 CRs-Fixed: 992733
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h9
-rw-r--r--core/hdd/inc/wlan_hdd_main.h1
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c6
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c2
-rw-r--r--core/hdd/src/wlan_hdd_scan.c23
-rw-r--r--core/hdd/src/wlan_hdd_scan.h3
-rw-r--r--core/mac/inc/ani_global.h2
7 files changed, 44 insertions, 2 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 3ef1bda303d8..720361e9568d 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -3104,6 +3104,14 @@ enum dot11p_mode {
#define CFG_ROAM_DENSE_RSSI_THRE_OFFSET_DEFAULT (10)
/*
+ * Create bug report in case of nil scan results
+ */
+#define CFG_CREATE_BUG_REPORT_FOR_SCAN "gbug_report_for_scan_results"
+#define CFG_CREATE_BUG_REPORT_FOR_SCAN_DISABLE (0)
+#define CFG_CREATE_BUG_REPORT_FOR_SCAN_ENABLE (1)
+#define CFG_CREATE_BUG_REPORT_FOR_SCAN_DEFAULT (0)
+
+/*
* Enabling gignore_peer_ht_opmode will enable 11g
* protection only when there is a 11g AP in vicinity.
*/
@@ -4107,6 +4115,7 @@ struct hdd_config {
uint8_t adapt_dwell_lpf_weight;
uint8_t adapt_dwell_passive_mon_intval;
uint8_t adapt_dwell_wifi_act_threshold;
+ bool bug_report_for_no_scan_results;
#ifdef WLAN_FEATURE_NAN_DATAPATH
bool enable_nan_datapath;
uint8_t nan_datapath_ndi_channel;
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index d2cda7cfe414..2e72cb203bd6 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1479,6 +1479,7 @@ struct hdd_context_s {
int radio_index;
qdf_work_t sap_pre_cac_work;
bool hbw_requested;
+ uint32_t last_nil_scan_bug_report_timestamp;
#ifdef WLAN_FEATURE_NAN_DATAPATH
bool nan_datapath_enabled;
#endif
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index f2313ca3351f..c40aff5cfc60 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -3838,6 +3838,12 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_ENABLE_NAN_NDI_CHANNEL_MIN,
CFG_ENABLE_NAN_NDI_CHANNEL_MAX),
#endif
+ REG_VARIABLE(CFG_CREATE_BUG_REPORT_FOR_SCAN, WLAN_PARAM_Integer,
+ struct hdd_config, bug_report_for_no_scan_results,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_CREATE_BUG_REPORT_FOR_SCAN_DEFAULT,
+ CFG_CREATE_BUG_REPORT_FOR_SCAN_DISABLE,
+ CFG_CREATE_BUG_REPORT_FOR_SCAN_ENABLE),
REG_VARIABLE(CFG_ENABLE_DP_TRACE, WLAN_PARAM_Integer,
struct hdd_config, enable_dp_trace,
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index fe99cb75ad26..e25784752e4a 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -10023,7 +10023,7 @@ int wlan_hdd_cfg80211_update_bss(struct wiphy *wiphy,
/* no scan results */
if (NULL == pResult) {
hdd_err("No scan result Status %d", status);
- return status;
+ return -EAGAIN;
}
pScanResult = sme_scan_result_get_first(hHal, pResult);
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index 74a19c16788e..93cbade33aef 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -1123,6 +1123,7 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
bool aborted = false;
hdd_context_t *hddctx = WLAN_HDD_GET_CTX(pAdapter);
int ret = 0;
+ unsigned int current_timestamp, time_elapsed;
uint8_t source;
uint32_t scan_time;
uint32_t size = 0;
@@ -1150,8 +1151,28 @@ static QDF_STATUS hdd_cfg80211_scan_done_callback(tHalHandle halHandle,
ret = wlan_hdd_cfg80211_update_bss((WLAN_HDD_GET_CTX(pAdapter))->wiphy,
pAdapter, scan_time);
- if (0 > ret)
+ if (0 > ret) {
hdd_notice("NO SCAN result");
+ if (hddctx->config->bug_report_for_no_scan_results) {
+ current_timestamp = jiffies_to_msecs(jiffies);
+ time_elapsed = current_timestamp -
+ hddctx->last_nil_scan_bug_report_timestamp;
+
+ /*
+ * check if we have generated bug report in
+ * MIN_TIME_REQUIRED_FOR_NEXT_BUG_REPORT time.
+ */
+ if (time_elapsed >
+ MIN_TIME_REQUIRED_FOR_NEXT_BUG_REPORT) {
+ cds_flush_logs(WLAN_LOG_TYPE_NON_FATAL,
+ WLAN_LOG_INDICATOR_HOST_DRIVER,
+ WLAN_LOG_REASON_NO_SCAN_RESULTS,
+ true, true);
+ hddctx->last_nil_scan_bug_report_timestamp =
+ current_timestamp;
+ }
+ }
+ }
/*
* cfg80211_scan_done informing NL80211 about completion
diff --git a/core/hdd/src/wlan_hdd_scan.h b/core/hdd/src/wlan_hdd_scan.h
index 3f8235dfa73d..2c549859f2d9 100644
--- a/core/hdd/src/wlan_hdd_scan.h
+++ b/core/hdd/src/wlan_hdd_scan.h
@@ -33,6 +33,9 @@
#define MAX_PENDING_LOG 5
+/* (30 Mins) */
+#define MIN_TIME_REQUIRED_FOR_NEXT_BUG_REPORT (30 * 60 * 1000)
+
/*
* enum scan_source - scan request source
*
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index 7258c0df5a6e..8ba2ead694ce 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.h
@@ -168,6 +168,7 @@ enum log_event_indicator {
* @WLAN_LOG_REASON_VOS_MSG_UNDER_RUN: VOS Core runs out of message wrapper
* @WLAN_LOG_REASON_HDD_TIME_OUT: Wait for event Timeout in HDD layer
@WLAN_LOG_REASON_SME_OUT_OF_CMD_BUFL sme out of cmd buffer
+ * @WLAN_LOG_REASON_NO_SCAN_RESULTS: no scan results to report from HDD
* This enum contains the different reason codes for bug report
*/
enum log_event_host_reason_code {
@@ -181,6 +182,7 @@ enum log_event_host_reason_code {
WLAN_LOG_REASON_VOS_MSG_UNDER_RUN,
WLAN_LOG_REASON_HDD_TIME_OUT,
WLAN_LOG_REASON_SME_OUT_OF_CMD_BUF,
+ WLAN_LOG_REASON_NO_SCAN_RESULTS,
};