diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index ad38d76b90b4..09fc850e85c9 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -4991,6 +4991,31 @@ enum hdd_link_speed_rpt_type { #define CFG_ENABLE_MEMORY_DEEP_SLEEP_MAX (1) #define CFG_ENABLE_MEMORY_DEEP_SLEEP_DEFAULT (1) +/* + * + * + * gEnableCckTxFirOverride - Enable/disable CCK TxFIR Override + * @Min: 0 (disabled) + * @Max: 1 (enabled) + * @Default: 0 (disabled) + * + * When operating in an 802.11b mode, this configuration item forces a 2x2 radio + * configuration into 1x for Tx and 2x for Rx (ie 1x2) for regulatory compliance + * reasons. + * + * Related: enable2x2 + * + * Supported Feature: 802.11b, 2x2 + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_CCK_TX_FIR_OVERRIDE_NAME "gEnableCckTxFirOverride" +#define CFG_ENABLE_CCK_TX_FIR_OVERRIDE_MIN (0) +#define CFG_ENABLE_CCK_TX_FIR_OVERRIDE_MAX (1) +#define CFG_ENABLE_CCK_TX_FIR_OVERRIDE_DEFAULT (0) + /* * * gDefaultRateIndex24Ghz -Set the rate index for 24Ghz @@ -10806,6 +10831,7 @@ struct hdd_config { uint8_t apMaxOffloadReorderBuffs; bool advertiseConcurrentOperation; bool enableMemDeepSleep; + bool enable_cck_tx_fir_override; uint32_t defaultRateIndex24Ghz; #ifdef MEMORY_DEBUG diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 58b90a30af17..6585b4517c18 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -2973,6 +2973,13 @@ struct reg_table_entry g_registry_table[] = { CFG_ENABLE_MEMORY_DEEP_SLEEP_MIN, CFG_ENABLE_MEMORY_DEEP_SLEEP_MAX), + REG_VARIABLE(CFG_ENABLE_CCK_TX_FIR_OVERRIDE_NAME, WLAN_PARAM_Integer, + struct hdd_config, enable_cck_tx_fir_override, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_CCK_TX_FIR_OVERRIDE_DEFAULT, + CFG_ENABLE_CCK_TX_FIR_OVERRIDE_MIN, + CFG_ENABLE_CCK_TX_FIR_OVERRIDE_MAX), + REG_VARIABLE(CFG_DEFAULT_RATE_INDEX_24GH, WLAN_PARAM_Integer, struct hdd_config, defaultRateIndex24Ghz, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -5601,6 +5608,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) pHddCtx->config->apMaxOffloadPeers); hdd_info("Name = [gMaxOffloadReorderBuffs] value = [%u] ", pHddCtx->config->apMaxOffloadReorderBuffs); + hdd_info("Name = [%s] Value = [%d]", + CFG_ENABLE_CCK_TX_FIR_OVERRIDE_NAME, + pHddCtx->config->enable_cck_tx_fir_override); hdd_info("Name = [gAllowDFSChannelRoam] Value = [%u] ", pHddCtx->config->allowDFSChannelRoam); hdd_info("Name = [gMaxConcurrentActiveSessions] Value = [%u] ", diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cd59da5ed5d5..18354be274e3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3539,10 +3539,28 @@ int hdd_set_fw_params(hdd_adapter_t *adapter) if (!hdd_ctx) return -EINVAL; - if ((cds_get_conparam() != QDF_GLOBAL_FTM_MODE) && - (!hdd_ctx->config->enable2x2)) { + if (cds_get_conparam() == QDF_GLOBAL_FTM_MODE) { + hdd_debug("FTM Mode is active; nothing to do"); + return 0; + } + + if (hdd_ctx->config->enable2x2) { + hdd_debug("configuring 2x2 mode fw params"); + + ret = wma_cli_set_command(adapter->sessionId, + WMI_PDEV_PARAM_ENABLE_CCK_TXFIR_OVERRIDE, + hdd_ctx->config->enable_cck_tx_fir_override, + PDEV_CMD); + if (ret) { + hdd_err("WMI_PDEV_PARAM_ENABLE_CCK_TXFIR_OVERRIDE set failed %d", + ret); + goto error; + } + } else { #define HDD_DTIM_1CHAIN_RX_ID 0x5 #define HDD_SMPS_PARAM_VALUE_S 29 + hdd_debug("configuring 1x1 mode fw params"); + /* * Disable DTIM 1 chain Rx when in 1x1, * we are passing two value @@ -3580,35 +3598,29 @@ int hdd_set_fw_params(hdd_adapter_t *adapter) } #undef HDD_DTIM_1CHAIN_RX_ID #undef HDD_SMPS_PARAM_VALUE_S - } else { - hdd_debug("FTM Mode or 2x2 mode - Do not set 1x1 params"); } - if (QDF_GLOBAL_FTM_MODE != cds_get_conparam()) { - ret = wma_cli_set_command(adapter->sessionId, - WMI_PDEV_PARAM_HYST_EN, - hdd_ctx->config->enableMemDeepSleep, - PDEV_CMD); + ret = wma_cli_set_command(adapter->sessionId, + WMI_PDEV_PARAM_HYST_EN, + hdd_ctx->config->enableMemDeepSleep, + PDEV_CMD); + if (ret) { + hdd_err("WMI_PDEV_PARAM_HYST_EN set failed %d", ret); + goto error; + } - if (ret) { - hdd_err("WMI_PDEV_PARAM_HYST_EN set failed %d", - ret); - goto error; - } - - ret = wma_cli_set_command(adapter->sessionId, - WMI_VDEV_PARAM_ENABLE_RTSCTS, - hdd_ctx->config->rts_profile, - VDEV_CMD); - if (ret) { - hdd_err("FAILED TO SET RTSCTS Profile ret:%d", ret); - goto error; - } + ret = wma_cli_set_command(adapter->sessionId, + WMI_VDEV_PARAM_ENABLE_RTSCTS, + hdd_ctx->config->rts_profile, + VDEV_CMD); + if (ret) { + hdd_err("FAILED TO SET RTSCTS Profile ret:%d", ret); + goto error; } hdd_set_fw_log_params(hdd_ctx, adapter); - EXIT(); + return 0; error: