From 41d24a72736ae448385d6bd5c374df0d42647cb5 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Wed, 6 May 2020 15:20:23 +0800 Subject: [PATCH] qcacld-3.0: modify BTC mode according to BTC chain mode BTC mode should be set according to BTC chain mode, which can be updated dynamically during runtime. Change-Id: Ifc95d3340ab19e217bd55a0ca5ce69988650f9e0 CRs-Fixed: 2666550 --- core/hdd/src/wlan_hdd_main.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 34e6aecd74..3a6ddc1a47 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -187,6 +187,7 @@ #include "wlan_hdd_debugfs_mibstat.h" #include #include "wlan_global_lmac_if_api.h" +#include "wlan_coex_ucfg_api.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -5621,6 +5622,7 @@ static int hdd_send_coex_config_params(struct hdd_context *hdd_ctx, struct coex_config_params coex_cfg_params = {0}; struct wlan_fwol_coex_config config = {0}; struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; + uint8_t btc_chain_mode; QDF_STATUS status; if (!hdd_ctx) { @@ -5667,8 +5669,26 @@ static int hdd_send_coex_config_params(struct hdd_context *hdd_ctx, } coex_cfg_params.config_type = WMI_COEX_CONFIG_BTC_MODE; - coex_cfg_params.config_arg1 = config.btc_mode; + /* Modify BTC_MODE according to BTC_CHAIN_MODE */ + status = ucfg_coex_psoc_get_btc_chain_mode(psoc, &btc_chain_mode); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Failed to get btc chain mode"); + btc_chain_mode = WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED; + } + switch (btc_chain_mode) { + case WLAN_COEX_BTC_CHAIN_MODE_SHARED: + coex_cfg_params.config_arg1 = 0; + break; + case WLAN_COEX_BTC_CHAIN_MODE_SEPARATED: + coex_cfg_params.config_arg1 = 2; + break; + default: + coex_cfg_params.config_arg1 = config.btc_mode; + } + hdd_debug("Configured BTC mode is %d, BTC chain mode is 0x%x, set BTC mode to %d", + config.btc_mode, btc_chain_mode, + coex_cfg_params.config_arg1); status = sme_send_coex_config_cmd(&coex_cfg_params); if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Failed to send coex BTC mode");