Explorar o código

qcacmn: Add support for lower span active and passive dwell time

Add LOW_SPAN_ACTIVE_DWELL_TIME and LOW_SPAN_PASSIVE_DWELL_TIME
macro support to keep all 2.4g/5g active/passive dwell time
same for low span scan mode.
Disable adaptive dwell to firmware so that firmware cannot
modify dwell time.

Change-Id: Iff05dd7b37a40226c61b28a1e59ea8aa8c57cb52
CRs-Fixed: 3076163
Jyoti Kumari %!s(int64=3) %!d(string=hai) anos
pai
achega
9f3995df8f

+ 2 - 2
os_if/linux/scan/src/wlan_cfg80211_scan.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -1520,8 +1521,7 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev,
 		if (req->scan_req.scan_policy_high_accuracy)
 			req->scan_req.adaptive_dwell_time_mode =
 						SCAN_DWELL_MODE_STATIC;
-		if (req->scan_req.scan_policy_low_power ||
-		    req->scan_req.scan_policy_low_span)
+		if (req->scan_req.scan_policy_low_power)
 			req->scan_req.adaptive_dwell_time_mode =
 						SCAN_DWELL_MODE_AGGRESSIVE;
 	}

+ 35 - 0
umac/scan/core/src/wlan_scan_manager.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -944,6 +945,38 @@ scm_update_channel_list(struct scan_start_request *req,
 	scm_scan_chlist_concurrency_modify(req->vdev, req);
 }
 
+/**
+ * scm_req_update_dwell_time_as_per_scan_mode() - update scan req params
+ * dwell time as per scan mode.
+ * @req: scan request
+ *
+ * Return: void
+ */
+static void
+scm_req_update_dwell_time_as_per_scan_mode(
+				struct wlan_objmgr_vdev *vdev,
+				struct scan_start_request *req)
+{
+	struct wlan_objmgr_psoc *psoc;
+
+	psoc = wlan_vdev_get_psoc(vdev);
+
+	if (req->scan_req.scan_policy_low_span &&
+	    wlan_scan_cfg_honour_nl_scan_policy_flags(psoc)) {
+		req->scan_req.adaptive_dwell_time_mode =
+					SCAN_DWELL_MODE_STATIC;
+		req->scan_req.dwell_time_active =
+				QDF_MIN(req->scan_req.dwell_time_active,
+					LOW_SPAN_ACTIVE_DWELL_TIME);
+		req->scan_req.dwell_time_active_2g =
+				QDF_MIN(req->scan_req.dwell_time_active_2g,
+					LOW_SPAN_ACTIVE_DWELL_TIME);
+		req->scan_req.dwell_time_passive =
+				QDF_MIN(req->scan_req.dwell_time_passive,
+					LOW_SPAN_PASSIVE_DWELL_TIME);
+	}
+}
+
 /**
  * scm_scan_req_update_params() - update scan req params depending on modes
  * and scan type.
@@ -1051,6 +1084,8 @@ scm_scan_req_update_params(struct wlan_objmgr_vdev *vdev,
 	if (req->scan_req.scan_type == SCAN_TYPE_RRM)
 		req->scan_req.scan_ctrl_flags_ext |= SCAN_FLAG_EXT_RRM_SCAN_IND;
 
+	scm_req_update_dwell_time_as_per_scan_mode(vdev, req);
+
 	scm_debug("scan_ctrl_flags_ext %0x", req->scan_req.scan_ctrl_flags_ext);
 	/*
 	 * Set wide band flag if enabled. This will cause

+ 10 - 0
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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 +116,15 @@ typedef uint32_t wlan_scan_id;
 #define ELEM_ID_LIST_LEN_POS 3
 #define ELEM_ID_LIST_POS 4
 
+/* Active dwell time in low span scan mode(NL80211_SCAN_FLAG_LOW_SPAN)
+ * in msec
+ */
+#define LOW_SPAN_ACTIVE_DWELL_TIME 40
+/* passive dwell time in low span scan mode (NL80211_SCAN_FLAG_LOW_SPAN)
+ * in msec
+ */
+#define LOW_SPAN_PASSIVE_DWELL_TIME 110
+
 /* forward declaration */
 struct wlan_objmgr_vdev;
 struct wlan_objmgr_pdev;