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

Commit 6c7e30bf authored by bings's avatar bings Committed by nshrivas
Browse files

qcacld-3.0: Add ini to honour NL80211 scan policy flags

Currently dwell time is determined by scan policy flags from kernel.
Sometimes when we suspect the scan result is not full enough, we need
to set dwell time by force through ini.

Add ini to decide whether to honour NL80211 scan policy flags, so that
we can disable dwell time changed by scan policy flag from kernel.

Change-Id: Ia0b9f957a7de901513479522e008e4bcbd6b2c0e
CRs-Fixed: 2428630
parent ec3354d0
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -1454,6 +1454,34 @@ enum hdd_dot11_mode {
#define CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_MAX      (4)
#define CFG_ADAPTIVE_PNOSCAN_DWELL_MODE_DEFAULT  (1)

/*
 * <ini>
 * honour_nl_scan_policy_flags - This ini will decide whether to honour
 * NL80211 scan policy flags
 * @Min: 0
 * @Max: 1
 * @Default: 1
 *
 * This parameter will decide whether to honour scan flags such as
 * NL80211_SCAN_FLAG_HIGH_ACCURACY , NL80211_SCAN_FLAG_LOW_SPAN,
 * NL80211_SCAN_FLAG_LOW_POWER.
 * Acceptable values for this:
 * 0: Config is disabled
 * 1: Config is enabled
 *
 * Related: None
 *
 * Supported Feature: Scan
 *
 * Usage: Internal
 *
 * </ini>
 */
#define CFG_HONOUR_NL_SCAN_POLICY_FLAGS_NAME     "honour_nl_scan_policy_flags"
#define CFG_HONOUR_NL_SCAN_POLICY_FLAGS_MIN      (0)
#define CFG_HONOUR_NL_SCAN_POLICY_FLAGS_MAX      (1)
#define CFG_HONOUR_NL_SCAN_POLICY_FLAGS_DEFAULT  (1)

/*
 * <ini>
 * adaptive_dwell_mode_enabled - Enable adaptive dwell mode
@@ -16110,6 +16138,7 @@ struct hdd_config {
	bool enable_dp_trace;
	uint8_t dp_trace_config[DP_TRACE_CONFIG_STRING_LENGTH];
	bool adaptive_dwell_mode_enabled;
	bool honour_nl_scan_policy_flags;
	enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
	enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc;
	enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
+12 −0
Original line number Diff line number Diff line
@@ -4300,6 +4300,13 @@ struct reg_table_entry g_registry_table[] = {
		CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MIN,
		CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MAX),

	REG_VARIABLE(CFG_HONOUR_NL_SCAN_POLICY_FLAGS_NAME, WLAN_PARAM_Integer,
		     struct hdd_config, honour_nl_scan_policy_flags,
		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
		     CFG_HONOUR_NL_SCAN_POLICY_FLAGS_DEFAULT,
		     CFG_HONOUR_NL_SCAN_POLICY_FLAGS_MIN,
		     CFG_HONOUR_NL_SCAN_POLICY_FLAGS_MAX),

	REG_VARIABLE(CFG_ADAPTIVE_DWELL_MODE_ENABLED_NAME, WLAN_PARAM_Integer,
		struct hdd_config, adaptive_dwell_mode_enabled,
		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -7541,6 +7548,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
	hdd_debug("Name = [%s] Value = [%u]",
		CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_NAME,
		pHddCtx->config->extscan_adaptive_dwell_mode);
	hdd_debug("Name = [%s] Value = [%u]",
		  CFG_HONOUR_NL_SCAN_POLICY_FLAGS_NAME,
		  pHddCtx->config->honour_nl_scan_policy_flags);
	hdd_debug("Name = [%s] Value = [%u]",
		CFG_ADAPTIVE_DWELL_MODE_ENABLED_NAME,
		pHddCtx->config->adaptive_dwell_mode_enabled);
@@ -10422,6 +10432,8 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
			pHddCtx->config->scan_adaptive_dwell_mode;
	smeConfig->csrConfig.scan_adaptive_dwell_mode_nc =
			pHddCtx->config->scan_adaptive_dwell_mode_nc;
	smeConfig->csrConfig.honour_nl_scan_policy_flags =
			pHddCtx->config->honour_nl_scan_policy_flags;
	smeConfig->csrConfig.roamscan_adaptive_dwell_mode =
			pHddCtx->config->roamscan_adaptive_dwell_mode;
	smeConfig->csrConfig.roam_force_rssi_trigger =
+13 −11
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2019 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
@@ -657,17 +657,19 @@ static void hdd_update_dbs_scan_ctrl_ext_flag(hdd_context_t *hdd_ctx,
		goto end;
	}

	if (hdd_ctx->config->honour_nl_scan_policy_flags) {
		if (scan_req->scan_flags & SME_SCAN_FLAG_HIGH_ACCURACY) {
		hdd_debug("DBS disabled due to high accuracy scan request");
			hdd_debug("DBS disabled for high accuracy request");
			goto end;
		}
		if (scan_req->scan_flags & SME_SCAN_FLAG_LOW_POWER ||
		    scan_req->scan_flags & SME_SCAN_FLAG_LOW_SPAN) {
		hdd_debug("DBS enable due to Low span/power request 0x%x",
			hdd_debug("DBS enable for Low span/power request 0x%x",
				  scan_req->scan_flags);
			scan_dbs_policy = SME_SCAN_DBS_POLICY_IGNORE_DUTY;
			goto end;
		}
	}
	if (!(hdd_ctx->is_dbs_scan_duty_cycle_enabled)) {
		scan_dbs_policy = SME_SCAN_DBS_POLICY_IGNORE_DUTY;
		hdd_debug_ratelimited(HDD_DBS_SCAN_DISABLE_RATE_LIMIT,
+1 −0
Original line number Diff line number Diff line
@@ -1386,6 +1386,7 @@ typedef struct tagCsrConfigParam {
	uint32_t edca_bk_aifs;
	uint32_t edca_be_aifs;
	bool enable_fatal_event;
	bool honour_nl_scan_policy_flags;
	enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
	enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc;
	enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
+1 −0
Original line number Diff line number Diff line
@@ -654,6 +654,7 @@ typedef struct tagCsrConfig {
	uint32_t edca_be_aifs;
	bool enable_fatal_event;
	bool vendor_vht_sap;
	bool honour_nl_scan_policy_flags;
	enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
	enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc;
	enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
Loading