瀏覽代碼

qcacld-3.0: Fix false alarm scan reject issue

Currently, the scan is rejected if connection is in progress. And
it uses last_scan_reject_timestamp and reset scan_reject_cnt to
avoid scan stuck issue. last_scan_reject_timestamp and
scan_reject_cnt reset when the next scan issues successfully.

If:
1\ Scan happens and connection is in progress. Initialized
   last_scan_reject_timestamp and reset scan_reject_cnt;
2\ Maybe no scan happens for a long time;
3\ scan happens but unfortunately connection is in progress again.

Then false alarm may happen because the time has already expired and
scan_reject_cnt >= 15.

Reset scan reject params if connection is success or it receives
final failure from CSR after trying with all APs.

Change-Id: Icd72d1d2c0adee8bb5b5b9c6537e1c48e37a7121
CRs-Fixed: 2333283
Paul Zhang 6 年之前
父節點
當前提交
cb573e0592
共有 4 個文件被更改,包括 53 次插入9 次删除
  1. 7 0
      core/hdd/src/wlan_hdd_assoc.c
  2. 1 4
      core/hdd/src/wlan_hdd_power.c
  3. 24 4
      core/hdd/src/wlan_hdd_scan.c
  4. 21 1
      core/hdd/src/wlan_hdd_scan.h

+ 7 - 0
core/hdd/src/wlan_hdd_assoc.c

@@ -61,6 +61,7 @@
 #include "wlan_p2p_ucfg_api.h"
 #include "wlan_ipa_ucfg_api.h"
 #include "wlan_hdd_stats.h"
+#include "wlan_hdd_scan.h"
 
 #include "wlan_hdd_nud_tracking.h"
 /* These are needed to recognize WPA and RSN suite types */
@@ -2740,6 +2741,12 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
+	/*
+	 * reset scan reject params if connection is success or we received
+	 * final failure from CSR after trying with all APs.
+	 */
+	hdd_reset_scan_reject_params(hdd_ctx, roamStatus, roamResult);
+
 	/*
 	 * Enable roaming on other STA iface except this one.
 	 * Firmware dosent support connection on one STA iface while

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

@@ -1408,10 +1408,7 @@ QDF_STATUS hdd_wlan_re_init(void)
 	/* Restart all adapters */
 	hdd_start_all_adapters(hdd_ctx);
 
-	hdd_ctx->last_scan_reject_session_id = 0xFF;
-	hdd_ctx->last_scan_reject_reason = 0;
-	hdd_ctx->last_scan_reject_timestamp = 0;
-	hdd_ctx->scan_reject_cnt = 0;
+	hdd_init_scan_reject_params(hdd_ctx);
 
 	hdd_set_roaming_in_progress(false);
 	complete(&adapter->roaming_comp_var);

+ 24 - 4
core/hdd/src/wlan_hdd_scan.c

@@ -322,6 +322,28 @@ void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
 	cds_ssr_unprotect(__func__);
 }
 
+void hdd_init_scan_reject_params(struct hdd_context *hdd_ctx)
+{
+	if (hdd_ctx) {
+		hdd_ctx->last_scan_reject_timestamp = 0;
+		hdd_ctx->last_scan_reject_session_id = 0xFF;
+		hdd_ctx->last_scan_reject_reason = 0;
+		hdd_ctx->scan_reject_cnt = 0;
+	}
+}
+
+void hdd_reset_scan_reject_params(struct hdd_context *hdd_ctx,
+				  eRoamCmdStatus roam_status,
+				  eCsrRoamResult roam_result)
+{
+	if ((roam_status == eCSR_ROAM_ASSOCIATION_FAILURE) ||
+	    (roam_status == eCSR_ROAM_CANCELLED) ||
+	    (roam_result == eCSR_ROAM_RESULT_ASSOCIATED)) {
+		hdd_debug("Reset scan reject params");
+		hdd_init_scan_reject_params(hdd_ctx);
+	}
+}
+
 /*
  * wlan_hdd_update_scan_ies() - API to update the scan IEs of scan request
  * with already stored default scan IEs
@@ -594,10 +616,8 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		}
 		return -EBUSY;
 	}
-	hdd_ctx->last_scan_reject_timestamp = 0;
-	hdd_ctx->last_scan_reject_session_id = 0xFF;
-	hdd_ctx->last_scan_reject_reason = 0;
-	hdd_ctx->scan_reject_cnt = 0;
+
+	hdd_init_scan_reject_params(hdd_ctx);
 
 	/* Check whether SAP scan can be skipped or not */
 	if (adapter->device_mode == QDF_SAP_MODE &&

+ 21 - 1
core/hdd/src/wlan_hdd_scan.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -115,6 +115,26 @@ void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
 				  struct wireless_dev *wdev);
 #endif
 
+/**
+ * hdd_init_scan_reject_params() - init scan reject params
+ * @hdd_ctx: hdd contxt
+ *
+ * Return: None
+ */
+void hdd_init_scan_reject_params(struct hdd_context *hdd_ctx);
+
+/**
+ * hdd_reset_scan_reject_params() - reset scan reject params per roam stats
+ * @hdd_ctx: hdd contxt
+ * @roam_status: roam status
+ * @roam_result: roam result
+ *
+ * Return: None
+ */
+void hdd_reset_scan_reject_params(struct hdd_context *hdd_ctx,
+				  eRoamCmdStatus roam_status,
+				  eCsrRoamResult roam_result);
+
 /**
  * wlan_hdd_cfg80211_scan_block_cb() - scan block work handler
  * @work: Pointer to work