Przeglądaj źródła

qcacld-3.0: Add ini support for SAR version

Currently SAR feature version is decided based on
feature flag WLAN_FEATURE_SARV1_TO_SARV2, if this
flag is enabled SAR version 2 is used.
Add an ini support to specify the SAR version.

Change-Id: Ib3ac8a3e7320d3e7f303ae14828d2b0428ca2993
CRs-fixed:
Ashish Kumar Dhanotiya 6 lat temu
rodzic
commit
9549818d86

+ 25 - 1
core/hdd/inc/hdd_config.h

@@ -1215,6 +1215,29 @@ struct dhcp_server {
 			0, \
 			"Enable/Disable to disable channels specified")
 
+/*
+ * <ini>
+ * 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
+ *
+ * </ini>
+ */
+#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

+ 1 - 0
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))

+ 2 - 2
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 */

+ 1 - 0
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);