summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitesh Shah <niteshs@codeaurora.org>2017-01-04 16:53:45 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-01-09 04:09:15 -0800
commitcc70b6bb16eefa5d8c678ae0b34e9f61d749811c (patch)
tree68b5a5eb44991832087124a513f80ff5a54b2db9
parent00fba7844cf6c53428abda25e8e707b9a41e5f43 (diff)
qcacld-3.0: Generate bug report if scan rejected by driver
qcacld-2.0 to qcacld-3.0 propagation Driver will not allow scan if connection is in progress. Add driver changes to generate bug report and trigger SSR if current session id, rejected reason matches with last rejected sesssion id, reason and time delta between current time and last rejected timestamp is greater than 5 mins Change-Id: Ic64a6fd443104b291b5b7f6cda3bfbe8273c671a CRs-Fixed: 1081489
-rw-r--r--core/cds/inc/cds_concurrency.h5
-rw-r--r--core/cds/src/cds_concurrency.c22
-rw-r--r--core/hdd/inc/wlan_hdd_main.h20
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c2
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c4
-rw-r--r--core/hdd/src/wlan_hdd_main.c1
-rw-r--r--core/hdd/src/wlan_hdd_p2p.c2
-rw-r--r--core/hdd/src/wlan_hdd_power.c4
-rw-r--r--core/hdd/src/wlan_hdd_scan.c35
-rw-r--r--core/mac/inc/ani_global.h4
10 files changed, 89 insertions, 10 deletions
diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h
index 9786e1b57384..f14239863d33 100644
--- a/core/cds/inc/cds_concurrency.h
+++ b/core/cds/inc/cds_concurrency.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.
*
@@ -600,7 +600,8 @@ struct cds_conc_connection_info {
bool in_use;
};
-bool cds_is_connection_in_progress(void);
+bool cds_is_connection_in_progress(uint8_t *session_id,
+ scan_reject_states *reason);
void cds_dump_concurrency_info(void);
#ifdef FEATURE_WLAN_TDLS
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index d45464c7686a..9b6b580e2900 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -2686,13 +2686,15 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id,
/**
* cds_is_connection_in_progress() - check if connection is in progress
- * @hdd_ctx - HDD context
+ * @session_id: session id
+ * @reason: scan reject reason
*
* Go through each adapter and check if Connection is in progress
*
* Return: true if connection is in progress else false
*/
-bool cds_is_connection_in_progress(void)
+bool cds_is_connection_in_progress(uint8_t *session_id,
+ scan_reject_states *reason)
{
hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL;
hdd_station_ctx_t *hdd_sta_ctx = NULL;
@@ -2730,6 +2732,10 @@ bool cds_is_connection_in_progress(void)
cds_err("%p(%d) Connection is in progress",
WLAN_HDD_GET_STATION_CTX_PTR(adapter),
adapter->sessionId);
+ if (session_id && reason) {
+ *session_id = adapter->sessionId;
+ *reason = eHDD_CONNECTION_IN_PROGRESS;
+ }
return true;
}
if ((QDF_STA_MODE == adapter->device_mode) &&
@@ -2739,6 +2745,10 @@ bool cds_is_connection_in_progress(void)
cds_err("%p(%d) Reassociation in progress",
WLAN_HDD_GET_STATION_CTX_PTR(adapter),
adapter->sessionId);
+ if (session_id && reason) {
+ *session_id = adapter->sessionId;
+ *reason = eHDD_REASSOC_IN_PROGRESS;
+ }
return true;
}
if ((QDF_STA_MODE == adapter->device_mode) ||
@@ -2755,6 +2765,10 @@ bool cds_is_connection_in_progress(void)
cds_err("client " MAC_ADDRESS_STR
" is in middle of WPS/EAPOL exchange.",
MAC_ADDR_ARRAY(sta_mac));
+ if (session_id && reason) {
+ *session_id = adapter->sessionId;
+ *reason = eHDD_EAPOL_IN_PROGRESS;
+ }
return true;
}
} else if ((QDF_SAP_MODE == adapter->device_mode) ||
@@ -2772,6 +2786,10 @@ bool cds_is_connection_in_progress(void)
cds_err("client " MAC_ADDRESS_STR
" of SAP/GO is in middle of WPS/EAPOL exchange",
MAC_ADDR_ARRAY(sta_mac));
+ if (session_id && reason) {
+ *session_id = adapter->sessionId;
+ *reason = eHDD_SAP_EAPOL_IN_PROGRESS;
+ }
return true;
}
if (hdd_ctx->connection_in_progress) {
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 5dcb9b4def5d..2387be03a9fc 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -265,6 +265,23 @@
/* session ID invalid */
#define HDD_SESSION_ID_INVALID 0xFF
+#define SCAN_REJECT_THRESHOLD_TIME 300000 /* Time is in msec, equal to 5 mins */
+
+/*
+ * @eHDD_SCAN_REJECT_DEFAULT: default value
+ * @eHDD_CONNECTION_IN_PROGRESS: connection is in progress
+ * @eHDD_REASSOC_IN_PROGRESS: reassociation is in progress
+ * @eHDD_EAPOL_IN_PROGRESS: STA/P2P-CLI is in middle of EAPOL/WPS exchange
+ * @eHDD_SAP_EAPOL_IN_PROGRESS: SAP/P2P-GO is in middle of EAPOL/WPS exchange
+ */
+typedef enum {
+ eHDD_SCAN_REJECT_DEFAULT = 0,
+ eHDD_CONNECTION_IN_PROGRESS,
+ eHDD_REASSOC_IN_PROGRESS,
+ eHDD_EAPOL_IN_PROGRESS,
+ eHDD_SAP_EAPOL_IN_PROGRESS,
+} scan_reject_states;
+
/*
* Generic asynchronous request/response support
*
@@ -1578,6 +1595,9 @@ struct hdd_context_s {
qdf_mc_timer_t tdls_source_timer;
qdf_atomic_t disable_lro_in_concurrency;
bool fw_mem_dump_enabled;
+ uint8_t last_scan_reject_session_id;
+ scan_reject_states last_scan_reject_reason;
+ unsigned long last_scan_reject_timestamp;
};
/*---------------------------------------------------------------------------
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 1f34e4cce4f7..fd7bffb53e75 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -11936,7 +11936,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
return -EINVAL;
}
- if (true == cds_is_connection_in_progress()) {
+ if (true == cds_is_connection_in_progress(NULL, NULL)) {
hdd_err("Connection refused: conn in progress");
return -EINVAL;
}
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 2d683980b4b9..943b87a0ae0d 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -7196,7 +7196,7 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
ENTER();
- if (!update_beacon && cds_is_connection_in_progress()) {
+ if (!update_beacon && cds_is_connection_in_progress(NULL, NULL)) {
hdd_err("Can't start BSS: connection is in progress");
return -EINVAL;
}
@@ -8049,7 +8049,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
pAdapter->device_mode, cds_is_sub_20_mhz_enabled());
- if (cds_is_connection_in_progress()) {
+ if (cds_is_connection_in_progress(NULL, NULL)) {
hdd_err("Can't start BSS: connection is in progress");
return -EBUSY;
}
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 0f28ef84f2fc..294c6b87f8e3 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -6590,6 +6590,7 @@ static hdd_context_t *hdd_context_create(struct device *dev)
hdd_ctx->pcds_context = p_cds_context;
hdd_ctx->parent_dev = dev;
+ hdd_ctx->last_scan_reject_session_id = 0xFF;
hdd_ctx->config = qdf_mem_malloc(sizeof(struct hdd_config));
if (hdd_ctx->config == NULL) {
diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c
index 30b0180f8398..ec210d725b12 100644
--- a/core/hdd/src/wlan_hdd_p2p.c
+++ b/core/hdd/src/wlan_hdd_p2p.c
@@ -841,7 +841,7 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy,
ret = wlan_hdd_validate_context(pHddCtx);
if (0 != ret)
return ret;
- if (cds_is_connection_in_progress()) {
+ if (cds_is_connection_in_progress(NULL, NULL)) {
hdd_err("Connection is in progress");
isBusy = true;
}
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c
index 296187326003..22cf3ba32f67 100644
--- a/core/hdd/src/wlan_hdd_power.c
+++ b/core/hdd/src/wlan_hdd_power.c
@@ -1584,6 +1584,10 @@ QDF_STATUS hdd_wlan_re_init(void)
/* Restart all adapters */
hdd_start_all_adapters(pHddCtx);
+ pHddCtx->last_scan_reject_session_id = 0xFF;
+ pHddCtx->last_scan_reject_reason = 0;
+ pHddCtx->last_scan_reject_timestamp = 0;
+
pHddCtx->hdd_mcastbcast_filter_set = false;
pHddCtx->btCoexModeSet = false;
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index 669be098caec..c271194691a8 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -1485,6 +1485,8 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
uint16_t con_dfs_ch;
uint8_t num_chan = 0;
bool is_p2p_scan = false;
+ uint8_t curr_session_id;
+ scan_reject_states curr_reason;
ENTER();
@@ -1589,10 +1591,41 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
#endif
/* Check if scan is allowed at this point of time */
- if (cds_is_connection_in_progress()) {
+ if (cds_is_connection_in_progress(&curr_session_id, &curr_reason)) {
hdd_err("Scan not allowed");
+ if (pHddCtx->last_scan_reject_session_id != curr_session_id ||
+ pHddCtx->last_scan_reject_reason != curr_reason ||
+ !pHddCtx->last_scan_reject_timestamp) {
+ pHddCtx->last_scan_reject_session_id = curr_session_id;
+ pHddCtx->last_scan_reject_reason = curr_reason;
+ pHddCtx->last_scan_reject_timestamp =
+ jiffies_to_msecs(jiffies);
+ } else {
+ hdd_err("curr_session id %d curr_reason %d time delta %lu",
+ curr_session_id, curr_reason,
+ (jiffies_to_msecs(jiffies) -
+ pHddCtx->last_scan_reject_timestamp));
+ if ((jiffies_to_msecs(jiffies) -
+ pHddCtx->last_scan_reject_timestamp) >=
+ SCAN_REJECT_THRESHOLD_TIME) {
+ pHddCtx->last_scan_reject_timestamp = 0;
+ if (pHddCtx->config->enable_fatal_event) {
+ cds_flush_logs(WLAN_LOG_TYPE_FATAL,
+ WLAN_LOG_INDICATOR_HOST_DRIVER,
+ WLAN_LOG_REASON_SCAN_NOT_ALLOWED,
+ false, true);
+ } else {
+ hdd_err("Triggering SSR due to scan stuck");
+ cds_trigger_recovery(false);
+ }
+ }
+ }
return -EBUSY;
}
+ pHddCtx->last_scan_reject_timestamp = 0;
+ pHddCtx->last_scan_reject_session_id = 0xFF;
+ pHddCtx->last_scan_reject_reason = 0;
+
/* Check whether SAP scan can be skipped or not */
if (pAdapter->device_mode == QDF_SAP_MODE &&
wlan_hdd_sap_skip_scan_check(pHddCtx, request)) {
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index b6b0c248d33a..0b03f4ed6951 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.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.
*
@@ -170,6 +170,7 @@ enum log_event_indicator {
@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
+ * @WLAN_LOG_REASON_SCAN_NOT_ALLOWED: scan not allowed due to connection states
*/
enum log_event_host_reason_code {
WLAN_LOG_REASON_CODE_UNUSED,
@@ -183,6 +184,7 @@ enum log_event_host_reason_code {
WLAN_LOG_REASON_HDD_TIME_OUT,
WLAN_LOG_REASON_SME_OUT_OF_CMD_BUF,
WLAN_LOG_REASON_NO_SCAN_RESULTS,
+ WLAN_LOG_REASON_SCAN_NOT_ALLOWED,
};