Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 528e81a1 authored by Sheenam Monga's avatar Sheenam Monga Committed by Madan Koyyalamudi
Browse files

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
parent 7700a154
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1535,8 +1535,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;
	}
+36 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2021-2022 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
@@ -945,6 +946,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,9 @@ 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);

	/*
	 * Set wide band flag if enabled. This will cause
	 * phymode TLV being sent to FW.
+9 −0
Original line number Diff line number Diff line
@@ -61,6 +61,15 @@ typedef uint32_t wlan_scan_id;

#define TBTT_INFO_COUNT 16

/* 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;