qcacmn: implement interfaces for configuring BT coex chain mode
Add interfaces for get/set BT coex chain mode. CRs-Fixed: 2565088 Change-Id: If74dcba4ad3b69caa895264eaff64ef06b3b0714
This commit is contained in:
@@ -36,10 +36,12 @@
|
||||
|
||||
/**
|
||||
* struct coex_psoc_obj - coex object definition
|
||||
* @btc_chain_mode: BT Coex chain mode.
|
||||
* @coex_config_updated: callback functions for each config type, which will
|
||||
* be called when config is updated.
|
||||
*/
|
||||
struct coex_psoc_obj {
|
||||
uint8_t btc_chain_mode;
|
||||
update_coex_cb coex_config_updated[COEX_CONFIG_TYPE_MAX];
|
||||
};
|
||||
|
||||
@@ -132,5 +134,27 @@ QDF_STATUS wlan_coex_psoc_created_notification(struct wlan_objmgr_psoc *psoc,
|
||||
*/
|
||||
QDF_STATUS wlan_coex_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg_list);
|
||||
|
||||
/**
|
||||
* wlan_coex_psoc_set_btc_chain_mode() - private API to set BT coex chain mode
|
||||
* for psoc
|
||||
* @psoc: pointer to psoc object
|
||||
* @val: BT coex chain mode
|
||||
*
|
||||
* Return : status of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val);
|
||||
|
||||
/**
|
||||
* wlan_coex_psoc_get_btc_chain_mode() - private API to get BT coex chain mode
|
||||
* from psoc
|
||||
* @psoc: pointer to psoc object
|
||||
* @val: pointer to BT coex chain mode
|
||||
*
|
||||
* Return : status of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val);
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -71,6 +71,13 @@ QDF_STATUS wlan_coex_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc,
|
||||
QDF_STATUS
|
||||
wlan_coex_psoc_init(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct coex_psoc_obj *coex_obj;
|
||||
|
||||
coex_obj = wlan_psoc_get_coex_obj(psoc);
|
||||
if (!coex_obj)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
coex_obj->btc_chain_mode = WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -124,3 +131,35 @@ wlan_coex_config_updated(struct wlan_objmgr_vdev *vdev, uint8_t type)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val)
|
||||
{
|
||||
struct coex_psoc_obj *coex_obj;
|
||||
|
||||
coex_obj = wlan_psoc_get_coex_obj(psoc);
|
||||
if (!coex_obj)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
coex_obj->btc_chain_mode = val;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val)
|
||||
{
|
||||
struct coex_psoc_obj *coex_obj;
|
||||
|
||||
if (!val) {
|
||||
coex_err("invalid param for getting btc chain mode");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
coex_obj = wlan_psoc_get_coex_obj(psoc);
|
||||
if (!coex_obj)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
*val = coex_obj->btc_chain_mode;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -24,6 +24,11 @@
|
||||
#include "qdf_status.h"
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include "qca_vendor.h"
|
||||
|
||||
#define WLAN_COEX_BTC_CHAIN_MODE_SHARED QCA_BTC_CHAIN_SHARED
|
||||
#define WLAN_COEX_BTC_CHAIN_MODE_SEPARATED QCA_BTC_CHAIN_SEPARATED
|
||||
#define WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED 0xFF
|
||||
|
||||
/**
|
||||
* enum coex_config_type - coex config type definitions
|
||||
@@ -58,6 +63,36 @@ QDF_STATUS
|
||||
ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
|
||||
enum coex_config_type type,
|
||||
update_coex_cb handler);
|
||||
|
||||
/**
|
||||
* ucfg_coex_psoc_set_btc_chain_mode() - API to set BT coex chain mode for psoc
|
||||
* @psoc: pointer to psoc object
|
||||
* @val: BT coex chain mode
|
||||
*
|
||||
* Return : status of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val);
|
||||
|
||||
/**
|
||||
* ucfg_coex_psoc_get_btc_chain_mode() - API to get BT coex chain mode from psoc
|
||||
* @psoc: pointer to psoc object
|
||||
* @val: pointer to BT coex chain mode
|
||||
*
|
||||
* Return : status of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val);
|
||||
|
||||
/**
|
||||
* ucfg_coex_send_btc_chain_mode() - API to send BT coex config to target if
|
||||
* @vdev: pointer to vdev object
|
||||
* @mode: BT coex chain mode
|
||||
*
|
||||
* Return: status of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode);
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
|
||||
@@ -66,5 +101,20 @@ ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val)
|
||||
{
|
||||
if (val)
|
||||
*val = WLAN_COEX_BTC_CHAIN_MODE_UNSETTLED;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <wlan_coex_main.h>
|
||||
#include <wlan_coex_ucfg_api.h>
|
||||
#include "wmi_unified.h"
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
|
||||
@@ -41,3 +42,33 @@ ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val)
|
||||
{
|
||||
return wlan_coex_psoc_set_btc_chain_mode(psoc, val);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val)
|
||||
{
|
||||
return wlan_coex_psoc_get_btc_chain_mode(psoc, val);
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode)
|
||||
{
|
||||
struct coex_config_params param = {0};
|
||||
|
||||
if (mode != WLAN_COEX_BTC_CHAIN_MODE_SHARED &&
|
||||
mode != WLAN_COEX_BTC_CHAIN_MODE_SEPARATED)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
param.vdev_id = wlan_vdev_get_id(vdev);
|
||||
param.config_type = WMI_COEX_CONFIG_BTCOEX_SEPARATE_CHAIN_MODE;
|
||||
param.config_arg1 = mode;
|
||||
|
||||
coex_debug("send btc chain mode %d for vdev %d", mode, param.vdev_id);
|
||||
|
||||
return wlan_coex_config_send(vdev, ¶m);
|
||||
}
|
||||
|
Reference in New Issue
Block a user