summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Rawat <naveenrawat@codeaurora.org>2018-03-13 13:58:18 -0700
committernshrivas <nshrivas@codeaurora.org>2018-03-29 19:54:31 -0700
commit096f34d9b3e5976b503643a05734e2ef71274c8d (patch)
tree2b428ef50398b480b098834972aa350b334b6d40
parentd082d261fd36244a35fbcc691e0aa49cfbc2eae4 (diff)
qcacld-3.0: Add ini param to control RTT mac randomization
Add change to allow randomizing mac address used in STA mode RTT ranging using ini param control. Change-Id: Ief3814ef758476d2617d8176daade2128c2b250a CRs-Fixed: 2205953
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h17
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c8
-rw-r--r--core/hdd/src/wlan_hdd_main.c11
3 files changed, 36 insertions, 0 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 0ad278688da4..686ee38666d1 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -14324,6 +14324,22 @@ enum hw_filter_mode {
#define CFG_TX_SCH_DELAY_MAX (1)
#define CFG_TX_SCH_DELAY_DEFAULT (1)
+/*
+ * <ini>
+ * enable_rtt_mac_randomization - Enable/Disable rtt mac randomization
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_ENABLE_RTT_MAC_RANDOMIZATION_NAME "enable_rtt_mac_randomization"
+#define CFG_ENABLE_RTT_MAC_RANDOMIZATION_MIN (0)
+#define CFG_ENABLE_RTT_MAC_RANDOMIZATION_MAX (1)
+#define CFG_ENABLE_RTT_MAC_RANDOMIZATION_DEFAULT (0)
+
/*---------------------------------------------------------------------------
Type declarations
-------------------------------------------------------------------------*/
@@ -15233,6 +15249,7 @@ struct hdd_config {
#ifdef WLAN_FEATURE_SAE
bool is_sae_enabled;
#endif
+ bool enable_rtt_mac_randomization;
};
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index ee280f2ece63..30c2d8588019 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -5554,6 +5554,14 @@ struct reg_table_entry g_registry_table[] = {
CFG_IS_SAE_ENABLED_MIN,
CFG_IS_SAE_ENABLED_MAX),
#endif
+
+ REG_VARIABLE(CFG_ENABLE_RTT_MAC_RANDOMIZATION_NAME,
+ WLAN_PARAM_Integer,
+ struct hdd_config, enable_rtt_mac_randomization,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_ENABLE_RTT_MAC_RANDOMIZATION_DEFAULT,
+ CFG_ENABLE_RTT_MAC_RANDOMIZATION_MIN,
+ CFG_ENABLE_RTT_MAC_RANDOMIZATION_MAX),
};
/**
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index bcb928b57869..07d62236be0a 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -3293,6 +3293,17 @@ QDF_STATUS hdd_init_station_mode(hdd_adapter_t *adapter)
}
}
+ if (adapter->device_mode == QDF_STA_MODE) {
+ hdd_debug("setting RTT mac randomization param: %d",
+ hdd_ctx->config->enable_rtt_mac_randomization);
+ ret_val = sme_cli_set_command(adapter->sessionId,
+ WMI_VDEV_PARAM_ENABLE_DISABLE_RTT_INITIATOR_RANDOM_MAC,
+ hdd_ctx->config->enable_rtt_mac_randomization,
+ VDEV_CMD);
+ if (0 != ret_val)
+ hdd_err("RTT mac randomization param set failed %d",
+ ret_val);
+ }
/*
* 1) When DBS hwmode is disabled from INI then send HT/VHT IE as per
* non-dbs hw mode, so that there is no limitation applied for 2G/5G.