diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 6722a67e85..d029249a90 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/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) +/* + * + * 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 + * + * + */ +#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)) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 9fbba15d06..2a7ed8dca3 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/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), }; /** diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fb4debbe7a..1e762f9b35 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/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,