From 9e014cf17142aec96c2c4ef40007fb4933bedcd0 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Tue, 11 Dec 2018 09:39:33 +0530 Subject: [PATCH] qcacld-3.0: Add support to enable/disable RTT feature Define a new ini param to provide control over enabling and disabling support for RTT. Change-Id: I4fcc2370f758f80f00aaf04a4f23e24934d92f52 CRs-Fixed: 2364495 --- core/hdd/inc/hdd_config.h | 15 +++++++++++++++ core/hdd/inc/wlan_hdd_cfg.h | 1 + core/hdd/src/wlan_hdd_cfg80211.c | 5 +++-- core/hdd/src/wlan_hdd_main.c | 1 + 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/hdd/inc/hdd_config.h b/core/hdd/inc/hdd_config.h index 2090ac1180c8..a751e7cca6d9 100644 --- a/core/hdd/inc/hdd_config.h +++ b/core/hdd/inc/hdd_config.h @@ -1036,6 +1036,20 @@ enum hdd_wext_control { /* End of action oui inis */ +/* + * gEnableRTTsupport + * + * @Min: 0 - Disabled + * @Max: 1 - Enabled + * @Default: 1 - Enabled + * + * The param is used to enable/disable support for RTT + */ +#define CFG_ENABLE_RTT_SUPPORT CFG_INI_BOOL( \ + "gEnableRTTSupport", \ + 1, \ + "The param is used to enable/disable support for RTT") + #define CFG_HDD_ALL \ CFG_ENABLE_PACKET_LOG_ALL \ CFG_ENABLE_RUNTIME_PM_ALL \ @@ -1058,6 +1072,7 @@ enum hdd_wext_control { CFG(CFG_ENABLE_FW_UART_PRINT) \ CFG(CFG_ENABLE_MAC_PROVISION) \ CFG(CFG_ENABLE_RAMDUMP_COLLECTION) \ + CFG(CFG_ENABLE_RTT_SUPPORT) \ CFG(CFG_INTERFACE_CHANGE_WAIT) \ CFG(CFG_INFORM_BSS_RSSI_RAW) \ CFG(CFG_MULTICAST_HOST_FW_MSGS) \ diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 9b1dc3a7f47e..7878c7d6df6a 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1501,6 +1501,7 @@ struct hdd_config { bool mac_provision; uint32_t provisioned_intf_pool; uint32_t derived_intf_pool; + uint8_t enable_rtt_support; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c922117207fe..1d87d03cda28 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3171,8 +3171,9 @@ __wlan_hdd_cfg80211_get_supported_features(struct wiphy *wiphy, hdd_debug("NAN is supported by firmware"); fset |= WIFI_FEATURE_NAN; } - if (sme_is_feature_supported_by_fw(RTT)) { - hdd_debug("RTT is supported by firmware"); + if (sme_is_feature_supported_by_fw(RTT) && + hdd_ctx->config->enable_rtt_support) { + hdd_debug("RTT is supported by firmware and framework"); fset |= WIFI_FEATURE_D2D_RTT; fset |= WIFI_FEATURE_D2AP_RTT; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8ecf7d30422f..b595f6037e30 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9386,6 +9386,7 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx) cfg_get(psoc, CFG_ACTION_OUI_DISABLE_AGGRESSIVE_TX), ACTION_OUI_MAX_STR_LEN); + config->enable_rtt_support = cfg_get(psoc, CFG_ENABLE_RTT_SUPPORT); hdd_init_vc_mode_cfg_bitmap(config, psoc); hdd_init_runtime_pm(config, psoc);