diff --git a/core/hdd/inc/hdd_config.h b/core/hdd/inc/hdd_config.h index d809711df6b7..d82706a186bf 100644 --- a/core/hdd/inc/hdd_config.h +++ b/core/hdd/inc/hdd_config.h @@ -1215,6 +1215,29 @@ struct dhcp_server { 0, \ "Enable/Disable to disable channels specified") +/* + * + * gSarVersion - Used to specify SAR version + * + * @Min: 1 + * @Max: 2 + * Default: 1 + * + * This ini is used to specify the SAR feature version. + * If value of this ini is set to 2, SAR version 2 will + * be used. + * Usage: External + * + * + */ +#define CFG_SAR_VERSION CFG_INI_UINT( \ + "gSarVersion", \ + 1, \ + 2, \ + 1, \ + CFG_VALUE_OR_DEFAULT, \ + "Specify the SAR version") + #define CFG_HDD_ALL \ CFG_ENABLE_PACKET_LOG_ALL \ CFG_ENABLE_RUNTIME_PM_ALL \ @@ -1250,5 +1273,6 @@ struct dhcp_server { CFG(CFG_PROVISION_INTERFACE_POOL) \ CFG(CFG_TIMER_MULTIPLIER) \ CFG(CFG_HDD_DOT11_MODE) \ - CFG(CFG_ENABLE_DISABLE_CHANNEL) + CFG(CFG_ENABLE_DISABLE_CHANNEL) \ + CFG(CFG_SAR_VERSION) #endif diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 61664965a966..04964a191a78 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -209,6 +209,7 @@ struct hdd_config { uint32_t derived_intf_pool; uint8_t enable_rtt_support; uint32_t cfg_wmi_credit_cnt; + uint32_t sar_version; }; #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 0f0676ff9a45..dcf38f5771f5 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10369,7 +10369,6 @@ hdd_convert_sarv1_to_sarv2(struct hdd_context *hdd_ctx, } #else /* WLAN_FEATURE_SARV1_TO_SARV2 */ - static bool hdd_convert_sarv1_to_sarv2(struct hdd_context *hdd_ctx, struct nlattr *tb[], @@ -10587,7 +10586,8 @@ static int __wlan_hdd_set_sar_power_limits(struct wiphy *wiphy, return -ENOMEM; /* is special SAR V1 => SAR V2 logic enabled and applicable? */ - if (hdd_convert_sarv1_to_sarv2(hdd_ctx, tb, sar_limit_cmd)) + if (hdd_ctx->config->sar_version == 2 && + (hdd_convert_sarv1_to_sarv2(hdd_ctx, tb, sar_limit_cmd))) goto send_sar_limits; /* Vendor command manadates all SAR Specs in single call */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index d6c2ff5d638f..a9e0c906d90a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9424,6 +9424,7 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx) config->is_unit_test_framework_enabled = cfg_get(psoc, CFG_ENABLE_UNIT_TEST_FRAMEWORK); config->disable_channel = cfg_get(psoc, CFG_ENABLE_DISABLE_CHANNEL); + config->sar_version = cfg_get(psoc, CFG_SAR_VERSION); hdd_init_vc_mode_cfg_bitmap(config, psoc); hdd_init_runtime_pm(config, psoc);