Kaynağa Gözat

qcacld-3.0: Use scan reject count along with time to detect scan failure

qcacld-2.0 to qcacld-3.0 propagation

If scan is scheduled after long interval there is a chance that driver
is busy with same reason. i.e if scan is scheduled after 5 min there is
a chance that driver is busy in reassoc both time but this will give false
alarm that driver is stuck.

To reduce this condition include number of scan failures as well
along with time interval.

Change-Id: I6fdd0813541aa5d3d069fe8bf3934cfa47425550
CRs-Fixed: 2064605
Abhishek Singh 7 yıl önce
ebeveyn
işleme
001306866e

+ 2 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -288,6 +288,7 @@
 #define HDD_SESSION_ID_INVALID    0xFF
 
 #define SCAN_REJECT_THRESHOLD_TIME 300000 /* Time is in msec, equal to 5 mins */
+#define SCAN_REJECT_THRESHOLD 15
 
 /* Default Psoc id */
 #define DEFAULT_PSOC_ID 1
@@ -1621,6 +1622,7 @@ struct hdd_context_s {
 	uint8_t last_scan_reject_session_id;
 	enum scan_reject_states last_scan_reject_reason;
 	unsigned long last_scan_reject_timestamp;
+	uint8_t scan_reject_cnt;
 	bool dfs_cac_offload;
 	bool reg_offload;
 #ifdef FEATURE_WLAN_CH_AVOID

+ 1 - 0
core/hdd/src/wlan_hdd_power.c

@@ -1406,6 +1406,7 @@ QDF_STATUS hdd_wlan_re_init(void)
 	pHddCtx->last_scan_reject_session_id = 0xFF;
 	pHddCtx->last_scan_reject_reason = 0;
 	pHddCtx->last_scan_reject_timestamp = 0;
+	pHddCtx->scan_reject_cnt = 0;
 
 	hdd_set_roaming_in_progress(false);
 	complete(&pAdapter->roaming_comp_var);

+ 9 - 3
core/hdd/src/wlan_hdd_scan.c

@@ -925,14 +925,19 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 			pHddCtx->last_scan_reject_timestamp =
 				jiffies_to_msecs(jiffies) +
 				SCAN_REJECT_THRESHOLD_TIME;
+			pHddCtx->scan_reject_cnt = 0;
 		} else {
-			hdd_debug("curr_session id %d curr_reason %d threshold time has elapsed? %d",
-				curr_session_id, curr_reason,
+			pHddCtx->scan_reject_cnt++;
+			hdd_debug("curr_session id %d curr_reason %d count %d threshold time has elapsed? %d",
+				curr_session_id, curr_reason, pHddCtx->scan_reject_cnt,
 				qdf_system_time_after(jiffies_to_msecs(jiffies),
 				pHddCtx->last_scan_reject_timestamp));
-			if (qdf_system_time_after(jiffies_to_msecs(jiffies),
+			if ((pHddCtx->scan_reject_cnt >=
+			   SCAN_REJECT_THRESHOLD) &&
+			   qdf_system_time_after(jiffies_to_msecs(jiffies),
 			   pHddCtx->last_scan_reject_timestamp)) {
 				pHddCtx->last_scan_reject_timestamp = 0;
+				pHddCtx->scan_reject_cnt = 0;
 				if (pHddCtx->config->enable_fatal_event) {
 					cds_flush_logs(WLAN_LOG_TYPE_FATAL,
 					   WLAN_LOG_INDICATOR_HOST_DRIVER,
@@ -954,6 +959,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 	pHddCtx->last_scan_reject_timestamp = 0;
 	pHddCtx->last_scan_reject_session_id = 0xFF;
 	pHddCtx->last_scan_reject_reason = 0;
+	pHddCtx->scan_reject_cnt = 0;
 
 	/* Check whether SAP scan can be skipped or not */
 	if (pAdapter->device_mode == QDF_SAP_MODE &&