Sfoglia il codice sorgente

qcacld-3.0: Add gEnableANI INI item

Per OEM request an INI item is needed to enable/disable the Adaptive
Noise Immunity feature, so add support for gEnableANI.

Change-Id: Ie6867c0024a716bf65dca1eeab8dd2b58141eff7
CRs-Fixed: 2028697
Jeff Johnson 8 anni fa
parent
commit
12a744bad0
3 ha cambiato i file con 49 aggiunte e 0 eliminazioni
  1. 23 0
      core/hdd/inc/wlan_hdd_cfg.h
  2. 7 0
      core/hdd/src/wlan_hdd_cfg.c
  3. 19 0
      core/hdd/src/wlan_hdd_main.c

+ 23 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -9415,6 +9415,28 @@ enum l1ss_sleep_allowed {
 #define CFG_L1SS_SLEEP_ALLOWED_MAX     (L1SS_SLEEP_ALLOWED_ALWAYS)
 #define CFG_L1SS_SLEEP_ALLOWED_DEFAULT (L1SS_SLEEP_ALLOWED_STA_CONNECTED)
 
+/*
+ * <ini>
+ * gEnableANI - Enable Adaptive Noise Immunity
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to enable or disable Adaptive Noise Immunity.
+ *
+ * Related: None
+ *
+ * Supported Feature: ANI
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_ENABLE_ANI_NAME              "gEnableANI"
+#define CFG_ENABLE_ANI_MIN               (0)
+#define CFG_ENABLE_ANI_MAX               (1)
+#define CFG_ENABLE_ANI_DEFAULT           (1)
+
 /*
  * Type declarations
  */
@@ -10131,6 +10153,7 @@ struct hdd_config {
 #endif
 	enum l1ss_sleep_allowed l1ss_sleep_allowed;
 	uint32_t arp_ac_category;
+	bool ani_enabled;
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

+ 7 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -4294,6 +4294,13 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		CFG_ARP_AC_CATEGORY_DEFAULT,
 		CFG_ARP_AC_CATEGORY_MIN,
 		CFG_ARP_AC_CATEGORY_MAX),
+
+	REG_VARIABLE(CFG_ENABLE_ANI_NAME, WLAN_PARAM_Integer,
+		     struct hdd_config, ani_enabled,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_ENABLE_ANI_DEFAULT,
+		     CFG_ENABLE_ANI_MIN,
+		     CFG_ENABLE_ANI_MAX),
 };
 
 /**

+ 19 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8274,6 +8274,21 @@ static int hdd_set_alternative_chainmask_enabled(hdd_context_t *hdd_ctx)
 	return ret;
 }
 
+static int hdd_set_ani_enabled(hdd_context_t *hdd_ctx)
+{
+	int vdev_id = 0;
+	int param_id = WMI_PDEV_PARAM_ANI_ENABLE;
+	int value = hdd_ctx->config->ani_enabled;
+	int vpdev = PDEV_CMD;
+	int ret;
+
+	ret = wma_cli_set_command(vdev_id, param_id, value, vpdev);
+	if (ret)
+		hdd_err("WMI_PDEV_PARAM_ANI_ENABLE failed %d", ret);
+
+	return ret;
+}
+
 /**
  * hdd_pre_enable_configure() - Configurations prior to cds_enable
  * @hdd_ctx:	HDD context
@@ -8335,6 +8350,10 @@ static int hdd_pre_enable_configure(hdd_context_t *hdd_ctx)
 	if (ret)
 		goto out;
 
+	ret = hdd_set_ani_enabled(hdd_ctx);
+	if (ret)
+		goto out;
+
 	hdd_program_country_code(hdd_ctx);
 
 	ret = wma_cli_set_command(0, WMI_PDEV_PARAM_ARP_AC_OVERRIDE,