From a89e25da8a96e80f9fb172b18a3f617240a80439 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 24 Feb 2017 12:25:07 -0800 Subject: [PATCH] qcacld-3.0: Add support for new chainmask controls Firmware has implemented two new chanimask control parameters: WMI_PDEV_PARAM_SMART_CHAINMASK_SCHEME WMI_PDEV_PARAM_ALTERNATIVE_CHAINMASK_SCHEME Add two new INI parameters to control the values of these firmware parameters. Change-Id: Iafe8d38684c5f2ab3f4150eee722461ec21e3e21 CRs-Fixed: 2011634 --- core/hdd/inc/wlan_hdd_cfg.h | 49 ++++++++++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 14 +++++++++++ core/hdd/src/wlan_hdd_main.c | 39 ++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index f8c95dd12687..ce57606864cc 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -7101,6 +7101,53 @@ typedef enum { #define CFG_TX_CHAIN_MASK_1SS_MAX (3) #define CFG_TX_CHAIN_MASK_1SS_DEFAULT (1) +/* + * + * gEnableSmartChainmask - Enable Smart Chainmask + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable the Smart Chainmask feature via + * the WMI_PDEV_PARAM_SMART_CHAINMASK_SCHEME firmware parameter. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_SMART_CHAINMASK_NAME "gEnableSmartChainmask" +#define CFG_ENABLE_SMART_CHAINMASK_MIN (0) +#define CFG_ENABLE_SMART_CHAINMASK_MAX (1) +#define CFG_ENABLE_SMART_CHAINMASK_DEFAULT (0) + +/* + * + * gEnableAlternativeChainmask - Enable Co-Ex Alternative Chainmask + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable the Co-ex Alternative Chainmask + * feature via the WMI_PDEV_PARAM_ALTERNATIVE_CHAINMASK_SCHEME + * firmware parameter. + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_COEX_ALT_CHAINMASK_NAME "gEnableAlternativeChainmask" +#define CFG_ENABLE_COEX_ALT_CHAINMASK_MIN (0) +#define CFG_ENABLE_COEX_ALT_CHAINMASK_MAX (1) +#define CFG_ENABLE_COEX_ALT_CHAINMASK_DEFAULT (0) + /* * set the self gen power value from * 0 to 0xffff @@ -9351,6 +9398,8 @@ struct hdd_config { uint32_t dual_mac_feature_disable; bool tx_chain_mask_cck; uint8_t tx_chain_mask_1ss; + bool smart_chainmask_enabled; + bool alternative_chainmask_enabled; uint16_t self_gen_frm_pwr; #ifdef FEATURE_WLAN_SCAN_PNO bool pno_channel_prediction; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 619daf756808..d2e669b88bbc 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3679,6 +3679,20 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_TX_CHAIN_MASK_1SS_MIN, CFG_TX_CHAIN_MASK_1SS_MAX), + REG_VARIABLE(CFG_ENABLE_SMART_CHAINMASK_NAME, WLAN_PARAM_Integer, + struct hdd_config, smart_chainmask_enabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_SMART_CHAINMASK_DEFAULT, + CFG_ENABLE_SMART_CHAINMASK_MIN, + CFG_ENABLE_SMART_CHAINMASK_MAX), + + REG_VARIABLE(CFG_ENABLE_COEX_ALT_CHAINMASK_NAME, WLAN_PARAM_Integer, + struct hdd_config, alternative_chainmask_enabled, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_COEX_ALT_CHAINMASK_DEFAULT, + CFG_ENABLE_COEX_ALT_CHAINMASK_MIN, + CFG_ENABLE_COEX_ALT_CHAINMASK_MAX), + REG_VARIABLE(CFG_SELF_GEN_FRM_PWR, WLAN_PARAM_Integer, struct hdd_config, self_gen_frm_pwr, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index acd9105fd882..595768407ab4 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7907,6 +7907,37 @@ static void hdd_tsf_init(hdd_context_t *hdd_ctx) } #endif +static int hdd_set_smart_chainmask_enabled(hdd_context_t *hdd_ctx) +{ + int vdev_id = 0; + int param_id = WMI_PDEV_PARAM_SMART_CHAINMASK_SCHEME; + int value = hdd_ctx->config->smart_chainmask_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_SMART_CHAINMASK_SCHEME failed %d", ret); + + return ret; +} + +static int hdd_set_alternative_chainmask_enabled(hdd_context_t *hdd_ctx) +{ + int vdev_id = 0; + int param_id = WMI_PDEV_PARAM_ALTERNATIVE_CHAINMASK_SCHEME; + int value = hdd_ctx->config->alternative_chainmask_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_ALTERNATIVE_CHAINMASK_SCHEME failed %d", + ret); + + return ret; +} + /** * hdd_pre_enable_configure() - Configurations prior to cds_enable * @hdd_ctx: HDD context @@ -7953,6 +7984,14 @@ static int hdd_pre_enable_configure(hdd_context_t *hdd_ctx) goto out; } + ret = hdd_set_smart_chainmask_enabled(hdd_ctx); + if (ret) + goto out; + + ret = hdd_set_alternative_chainmask_enabled(hdd_ctx); + if (ret) + goto out; + hdd_program_country_code(hdd_ctx); status = hdd_set_sme_chan_list(hdd_ctx);