qcacld-3.0: Add fixed FDD mode to btc_chain_mode

Previously when chains of BT and WLAN 2.4 GHz are separated,
hybrid mode will be used for BTC. Now adding fixed FDD mode
to fulfill different BTC scenarios.

Change-Id: I3a4d6919319f0f66e6b816566f24f4ac11b2c669
CRs-Fixed: 3244045
This commit is contained in:
Xiaoning Ma
2022-07-14 21:19:32 +08:00
committed by Madan Koyyalamudi
parent 1c9910e1b5
commit a7fcc140bb
11 changed files with 96 additions and 44 deletions

View File

@@ -55,7 +55,7 @@ struct wlan_coex_callback {
* @cb: structure to dbam callback * @cb: structure to dbam callback
*/ */
struct coex_psoc_obj { struct coex_psoc_obj {
uint8_t btc_chain_mode; enum coex_btc_chain_mode btc_chain_mode;
update_coex_cb coex_config_updated[COEX_CONFIG_TYPE_MAX]; update_coex_cb coex_config_updated[COEX_CONFIG_TYPE_MAX];
#ifdef WLAN_FEATURE_DBAM_CONFIG #ifdef WLAN_FEATURE_DBAM_CONFIG
struct wlan_coex_callback cb; struct wlan_coex_callback cb;
@@ -161,7 +161,8 @@ QDF_STATUS wlan_coex_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc,
* Return : status of operation * Return : status of operation
*/ */
QDF_STATUS QDF_STATUS
wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val); wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode val);
/** /**
* wlan_coex_psoc_get_btc_chain_mode() - private API to get BT coex chain mode * wlan_coex_psoc_get_btc_chain_mode() - private API to get BT coex chain mode
@@ -172,7 +173,8 @@ wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val);
* Return : status of operation * Return : status of operation
*/ */
QDF_STATUS QDF_STATUS
wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val); wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode *val);
#endif #endif
#ifdef WLAN_FEATURE_DBAM_CONFIG #ifdef WLAN_FEATURE_DBAM_CONFIG

View File

@@ -129,7 +129,8 @@ wlan_coex_config_updated(struct wlan_objmgr_vdev *vdev, uint8_t type)
} }
QDF_STATUS QDF_STATUS
wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val) wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode val)
{ {
struct coex_psoc_obj *coex_obj; struct coex_psoc_obj *coex_obj;
@@ -143,7 +144,8 @@ wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val)
} }
QDF_STATUS QDF_STATUS
wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val) wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode *val)
{ {
struct coex_psoc_obj *coex_obj; struct coex_psoc_obj *coex_obj;

View File

@@ -25,12 +25,23 @@
#include "qdf_status.h" #include "qdf_status.h"
#include <wlan_objmgr_vdev_obj.h> #include <wlan_objmgr_vdev_obj.h>
#include <wlan_objmgr_psoc_obj.h> #include <wlan_objmgr_psoc_obj.h>
#include "qca_vendor.h"
#include "wlan_coex_public_structs.h" #include "wlan_coex_public_structs.h"
#define WLAN_COEX_BTC_CHAIN_MODE_SHARED QCA_BTC_CHAIN_SHARED /**
#define WLAN_COEX_BTC_CHAIN_MODE_SEPARATED QCA_BTC_CHAIN_SEPARATED * enum coex_btc_chain_mode - btc chain mode definitions
#define WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED 0xFF * @WLAN_COEX_BTC_CHAIN_MODE_SHARED: chains of BT and WLAN 2.4 GHz are shared.
* @WLAN_COEX_BTC_CHAIN_MODE_FDD: chains of BT and WLAN 2.4 GHz are
* separated, FDD mode.
* @WLAN_COEX_BTC_CHAIN_MODE_HYBRID: chains of BT and WLAN 2.4 GHz are
* separated, hybrid mode.
* @WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED: chain mode is not set.
*/
enum coex_btc_chain_mode {
WLAN_COEX_BTC_CHAIN_MODE_SHARED = 0,
WLAN_COEX_BTC_CHAIN_MODE_FDD,
WLAN_COEX_BTC_CHAIN_MODE_HYBRID,
WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED = 0xFF,
};
/** /**
* enum coex_config_type - coex config type definitions * enum coex_config_type - coex config type definitions
@@ -74,7 +85,8 @@ ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
* Return : status of operation * Return : status of operation
*/ */
QDF_STATUS QDF_STATUS
ucfg_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val); ucfg_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode val);
/** /**
* ucfg_coex_psoc_get_btc_chain_mode() - API to get BT coex chain mode from psoc * ucfg_coex_psoc_get_btc_chain_mode() - API to get BT coex chain mode from psoc
@@ -84,7 +96,8 @@ ucfg_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val);
* Return : status of operation * Return : status of operation
*/ */
QDF_STATUS QDF_STATUS
ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val); ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode *val);
/** /**
* ucfg_coex_send_btc_chain_mode() - API to send BT coex config to target if * ucfg_coex_send_btc_chain_mode() - API to send BT coex config to target if
@@ -94,7 +107,8 @@ ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val);
* Return: status of operation * Return: status of operation
*/ */
QDF_STATUS QDF_STATUS
ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode); ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev,
enum coex_btc_chain_mode mode);
#else #else
static inline QDF_STATUS static inline QDF_STATUS
ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc, ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
@@ -105,7 +119,8 @@ ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
} }
static inline QDF_STATUS static inline QDF_STATUS
ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val) ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode *val)
{ {
if (val) if (val)
*val = WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED; *val = WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED;
@@ -114,7 +129,8 @@ ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val)
} }
static inline QDF_STATUS static inline QDF_STATUS
ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode) ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev,
enum coex_btc_chain_mode mode)
{ {
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

View File

@@ -46,24 +46,26 @@ ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
} }
QDF_STATUS QDF_STATUS
ucfg_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val) ucfg_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode val)
{ {
return wlan_coex_psoc_set_btc_chain_mode(psoc, val); return wlan_coex_psoc_set_btc_chain_mode(psoc, val);
} }
QDF_STATUS QDF_STATUS
ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val) ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc,
enum coex_btc_chain_mode *val)
{ {
return wlan_coex_psoc_get_btc_chain_mode(psoc, val); return wlan_coex_psoc_get_btc_chain_mode(psoc, val);
} }
QDF_STATUS QDF_STATUS
ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode) ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev,
enum coex_btc_chain_mode mode)
{ {
struct coex_config_params param = {0}; struct coex_config_params param = {0};
if (mode != WLAN_COEX_BTC_CHAIN_MODE_SHARED && if (mode > WLAN_COEX_BTC_CHAIN_MODE_HYBRID)
mode != WLAN_COEX_BTC_CHAIN_MODE_SEPARATED)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
param.vdev_id = wlan_vdev_get_id(vdev); param.vdev_id = wlan_vdev_get_id(vdev);

View File

@@ -90,7 +90,7 @@ QDF_STATUS wlan_coex_deinit(void)
static void static void
wlan_coex_set_btc_chain_mode_with_ini(struct wlan_objmgr_psoc *psoc) wlan_coex_set_btc_chain_mode_with_ini(struct wlan_objmgr_psoc *psoc)
{ {
uint8_t btc_chain_mode; enum coex_btc_chain_mode btc_chain_mode;
QDF_STATUS status; QDF_STATUS status;
status = wlan_coex_psoc_get_btc_chain_mode(psoc, &btc_chain_mode); status = wlan_coex_psoc_get_btc_chain_mode(psoc, &btc_chain_mode);
@@ -101,8 +101,7 @@ wlan_coex_set_btc_chain_mode_with_ini(struct wlan_objmgr_psoc *psoc)
if (btc_chain_mode == WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED) { if (btc_chain_mode == WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED) {
btc_chain_mode = cfg_get(psoc, CFG_SET_INIT_CHAIN_MODE_FOR_BTC); btc_chain_mode = cfg_get(psoc, CFG_SET_INIT_CHAIN_MODE_FOR_BTC);
if (btc_chain_mode != WLAN_COEX_BTC_CHAIN_MODE_SHARED && if (btc_chain_mode > WLAN_COEX_BTC_CHAIN_MODE_HYBRID &&
btc_chain_mode != WLAN_COEX_BTC_CHAIN_MODE_SEPARATED &&
btc_chain_mode != WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED) { btc_chain_mode != WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED) {
coex_err("invalid ini config %d for btc chain mode", coex_err("invalid ini config %d for btc chain mode",
btc_chain_mode); btc_chain_mode);

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2012 - 2021 The Linux Foundation. All rights reserved. * Copyright (c) 2012 - 2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -349,7 +350,10 @@
* only below values can be set: * only below values can be set:
* 0 - init WLAN 2.4G to support 2x2. * 0 - init WLAN 2.4G to support 2x2.
* It means chains of BT and WLAN 2.4G are shared, or BT is OFF. * It means chains of BT and WLAN 2.4G are shared, or BT is OFF.
* 1 - init WLAN 2.4G as 1x1, chains of BT and WLAN 2.4G are separated. * 1 - init WLAN 2.4G as 1x1, chains of BT and WLAN 2.4G are separated,
* fixed FDD.
* 2 - init WLAN 2.4G as 1x1, chains of BT and WLAN 2.4G are separated,
* hybrid mode
* 0xFF - no need to send init chain mode for BTC to firmware. * 0xFF - no need to send init chain mode for BTC to firmware.
* *
* Supported Feature: init chain mode for BTC * Supported Feature: init chain mode for BTC

View File

@@ -35,7 +35,8 @@ wlan_hdd_btc_chain_mode_handler(struct wlan_objmgr_vdev *vdev)
QDF_STATUS status; QDF_STATUS status;
struct hdd_adapter *adapter; struct hdd_adapter *adapter;
mac_handle_t mac_handle; mac_handle_t mac_handle;
uint8_t nss, mode, band; uint8_t nss, band;
enum coex_btc_chain_mode mode;
uint8_t vdev_id; uint8_t vdev_id;
uint32_t freq; uint32_t freq;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
@@ -73,7 +74,8 @@ wlan_hdd_btc_chain_mode_handler(struct wlan_objmgr_vdev *vdev)
return -EINVAL; return -EINVAL;
} }
nss = ((mode == QCA_BTC_CHAIN_SEPARATED) ? 1 : 2); nss = ((mode == WLAN_COEX_BTC_CHAIN_MODE_FDD ||
mode == WLAN_COEX_BTC_CHAIN_MODE_HYBRID) ? 1 : 2);
hdd_debug("update nss to %d for vdev %d, device mode %d", hdd_debug("update nss to %d for vdev %d, device mode %d",
nss, adapter->vdev_id, adapter->device_mode); nss, adapter->vdev_id, adapter->device_mode);

View File

@@ -6859,7 +6859,7 @@ static int hdd_send_coex_config_params(struct hdd_context *hdd_ctx,
struct coex_config_params coex_cfg_params = {0}; struct coex_config_params coex_cfg_params = {0};
struct wlan_fwol_coex_config config = {0}; struct wlan_fwol_coex_config config = {0};
struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc; struct wlan_objmgr_psoc *psoc = hdd_ctx->psoc;
uint8_t btc_chain_mode; enum coex_btc_chain_mode btc_chain_mode;
QDF_STATUS status; QDF_STATUS status;
if (!adapter) { if (!adapter) {
@@ -6908,16 +6908,12 @@ static int hdd_send_coex_config_params(struct hdd_context *hdd_ctx,
hdd_err("Failed to get btc chain mode"); hdd_err("Failed to get btc chain mode");
btc_chain_mode = WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED; btc_chain_mode = WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED;
} }
switch (btc_chain_mode) {
case WLAN_COEX_BTC_CHAIN_MODE_SHARED: if (btc_chain_mode <= WLAN_COEX_BTC_CHAIN_MODE_HYBRID)
coex_cfg_params.config_arg1 = 0; coex_cfg_params.config_arg1 = btc_chain_mode;
break; else
case WLAN_COEX_BTC_CHAIN_MODE_SEPARATED:
coex_cfg_params.config_arg1 = 2;
break;
default:
coex_cfg_params.config_arg1 = config.btc_mode; 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", hdd_debug("Configured BTC mode is %d, BTC chain mode is 0x%x, set BTC mode to %d",
config.btc_mode, btc_chain_mode, config.btc_mode, btc_chain_mode,
coex_cfg_params.config_arg1); coex_cfg_params.config_arg1);

View File

@@ -4085,8 +4085,9 @@ sme_fill_nss_chain_params(struct mac_context *mac_ctx,
enum nss_chains_band_info band, enum nss_chains_band_info band,
uint8_t rf_chains_supported) uint8_t rf_chains_supported)
{ {
uint8_t nss_chain_shift, btc_chain_mode; uint8_t nss_chain_shift;
uint8_t max_supported_nss; uint8_t max_supported_nss;
enum coex_btc_chain_mode btc_chain_mode;
struct wlan_mlme_nss_chains *nss_chains_ini_cfg = struct wlan_mlme_nss_chains *nss_chains_ini_cfg =
&mac_ctx->mlme_cfg->nss_chains_ini_cfg; &mac_ctx->mlme_cfg->nss_chains_ini_cfg;
QDF_STATUS status; QDF_STATUS status;
@@ -4111,7 +4112,8 @@ sme_fill_nss_chain_params(struct mac_context *mac_ctx,
} }
if (band == NSS_CHAINS_BAND_2GHZ && if (band == NSS_CHAINS_BAND_2GHZ &&
btc_chain_mode == QCA_BTC_CHAIN_SEPARATED) (btc_chain_mode == WLAN_COEX_BTC_CHAIN_MODE_FDD ||
btc_chain_mode == WLAN_COEX_BTC_CHAIN_MODE_HYBRID))
max_supported_nss = NSS_1x1_MODE; max_supported_nss = NSS_1x1_MODE;
/* If the fw doesn't support two chains, num rf chains can max be 1 */ /* If the fw doesn't support two chains, num rf chains can max be 1 */

View File

@@ -3135,7 +3135,7 @@ QDF_STATUS wma_vdev_pre_start(uint8_t vdev_id, bool restart)
struct wlan_objmgr_vdev *vdev; struct wlan_objmgr_vdev *vdev;
struct wlan_channel *des_chan; struct wlan_channel *des_chan;
QDF_STATUS status; QDF_STATUS status;
uint8_t btc_chain_mode; enum coex_btc_chain_mode btc_chain_mode;
struct wlan_mlme_qos *qos_aggr; struct wlan_mlme_qos *qos_aggr;
uint8_t amsdu_val; uint8_t amsdu_val;

View File

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2020, The Linux Foundation. All rights reserved. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -31,12 +32,28 @@ btc_chain_mode_policy[QCA_VENDOR_ATTR_BTC_CHAIN_MODE_MAX + 1] = {
[QCA_VENDOR_ATTR_BTC_CHAIN_MODE_RESTART] = {.type = NLA_FLAG}, [QCA_VENDOR_ATTR_BTC_CHAIN_MODE_RESTART] = {.type = NLA_FLAG},
}; };
static enum coex_btc_chain_mode
__wlan_cfg80211_coex_map_btc_chain_mode(enum qca_btc_chain_mode mode)
{
switch (mode) {
case QCA_BTC_CHAIN_SHARED:
return WLAN_COEX_BTC_CHAIN_MODE_SHARED;
case QCA_BTC_CHAIN_SEPARATED_HYBRID:
return WLAN_COEX_BTC_CHAIN_MODE_HYBRID;
case QCA_BTC_CHAIN_SEPARATED_FDD:
return WLAN_COEX_BTC_CHAIN_MODE_FDD;
default:
return WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED;
}
}
static int static int
__wlan_cfg80211_coex_set_btc_chain_mode(struct wlan_objmgr_vdev *vdev, __wlan_cfg80211_coex_set_btc_chain_mode(struct wlan_objmgr_vdev *vdev,
uint8_t mode, bool do_restart) enum coex_btc_chain_mode mode,
bool do_restart)
{ {
QDF_STATUS status; QDF_STATUS status;
uint8_t cur_mode; enum coex_btc_chain_mode cur_mode;
int err; int err;
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct wlan_objmgr_vdev *vdev_tmp; struct wlan_objmgr_vdev *vdev_tmp;
@@ -107,6 +124,7 @@ int wlan_cfg80211_coex_set_btc_chain_mode(struct wlan_objmgr_vdev *vdev,
{ {
struct nlattr *tb[QCA_VENDOR_ATTR_BTC_CHAIN_MODE_MAX + 1]; struct nlattr *tb[QCA_VENDOR_ATTR_BTC_CHAIN_MODE_MAX + 1];
uint32_t mode; uint32_t mode;
enum coex_btc_chain_mode chain_mode;
bool restart; bool restart;
if (wlan_cfg80211_nla_parse(tb, QCA_VENDOR_ATTR_BTC_CHAIN_MODE_MAX, if (wlan_cfg80211_nla_parse(tb, QCA_VENDOR_ATTR_BTC_CHAIN_MODE_MAX,
@@ -121,15 +139,24 @@ int wlan_cfg80211_coex_set_btc_chain_mode(struct wlan_objmgr_vdev *vdev,
} }
mode = nla_get_u32(tb[QCA_VENDOR_ATTR_BTC_CHAIN_MODE]); mode = nla_get_u32(tb[QCA_VENDOR_ATTR_BTC_CHAIN_MODE]);
if (mode < QCA_BTC_CHAIN_SHARED || mode > QCA_BTC_CHAIN_SEPARATED) { if (mode > QCA_BTC_CHAIN_SEPARATED_FDD) {
coex_err("Invalid btc chain mode %d", mode); coex_err("Invalid btc chain mode %d", mode);
return -EINVAL; return -EINVAL;
} }
restart = nla_get_flag(tb[QCA_VENDOR_ATTR_BTC_CHAIN_MODE_RESTART]); restart = nla_get_flag(tb[QCA_VENDOR_ATTR_BTC_CHAIN_MODE_RESTART]);
coex_debug("vdev_id %u mode %u restart %u", /* map to internal mode definitions */
wlan_vdev_get_id(vdev), mode, restart); chain_mode = __wlan_cfg80211_coex_map_btc_chain_mode(mode);
if (chain_mode == WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED) {
coex_err("Invalid wlan btc chain mode %d", chain_mode);
return -EINVAL;
}
return __wlan_cfg80211_coex_set_btc_chain_mode(vdev, mode, restart); coex_debug("vdev_id %u mode %u restart %u",
wlan_vdev_get_id(vdev), chain_mode, restart);
return __wlan_cfg80211_coex_set_btc_chain_mode(vdev,
chain_mode,
restart);
} }