qcacld-3.0: Add infra to support DBAM feature
Add infra to support Dedicated Bluetooth Antenna Mode (DBAM) feature. It is used to switch between dedicated antenna for BT and shared antenna for WLAN and BT. Change-Id: I20b08a2fd446da4e3c17813aa64e368750286114 CRs-Fixed: 3239896
This commit is contained in:
parent
49308343ab
commit
2d9a20e46f
5
Kbuild
5
Kbuild
@ -4497,6 +4497,11 @@ endif
|
||||
#Flags to enable/disable Dynamic WLAN interface control feature
|
||||
cppflags-$(CONFIG_CNSS_HW_SECURE_DISABLE) += -DFEATURE_CNSS_HW_SECURE_DISABLE
|
||||
|
||||
#DBAM feature needs COEX feature to be enabled
|
||||
ifeq ($(CONFIG_FEATURE_COEX), y)
|
||||
cppflags-$(CONFIG_WLAN_FEATURE_COEX_DBAM) += -DWLAN_FEATURE_DBAM_CONFIG
|
||||
endif
|
||||
|
||||
KBUILD_CPPFLAGS += $(cppflags-y)
|
||||
|
||||
# Currently, for versions of gcc which support it, the kernel Makefile
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -34,15 +35,31 @@
|
||||
#define coex_debug(params...) \
|
||||
QDF_TRACE_DEBUG(QDF_MODULE_ID_COEX, params)
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
/**
|
||||
* struct wlan_coex_callback - coex dbam callback structure
|
||||
* @set_dbam_config_cb: callback for set_dbam_config
|
||||
* @set_dbam_config_ctx: context for set_dbam_config callback
|
||||
*/
|
||||
struct wlan_coex_callback {
|
||||
void (*set_dbam_config_cb)(void *ctx, enum coex_dbam_comp_status *rsp);
|
||||
void *set_dbam_config_ctx;
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @cb: structure to dbam callback
|
||||
*/
|
||||
struct coex_psoc_obj {
|
||||
uint8_t btc_chain_mode;
|
||||
update_coex_cb coex_config_updated[COEX_CONFIG_TYPE_MAX];
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
struct wlan_coex_callback cb;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@ -157,4 +174,64 @@ wlan_coex_psoc_set_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t val);
|
||||
QDF_STATUS
|
||||
wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val);
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
/**
|
||||
* wlan_dbam_config_send() - private API to send dbam config
|
||||
* @vdev: pointer to vdev object
|
||||
* @param: parameters of dbam config
|
||||
*
|
||||
* Return: QDF_STATUS of operation
|
||||
*/
|
||||
QDF_STATUS wlan_dbam_config_send(struct wlan_objmgr_vdev *vdev,
|
||||
struct coex_dbam_config_params *param);
|
||||
|
||||
static inline struct wlan_lmac_if_dbam_rx_ops *
|
||||
wlan_psoc_get_dbam_rx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_rx_ops *rx_ops;
|
||||
|
||||
rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
|
||||
if (!rx_ops) {
|
||||
coex_err("rx_ops is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &rx_ops->dbam_rx_ops;
|
||||
}
|
||||
|
||||
static inline struct wlan_lmac_if_dbam_tx_ops *
|
||||
wlan_psoc_get_dbam_tx_ops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_tx_ops *tx_ops;
|
||||
|
||||
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
|
||||
if (!tx_ops) {
|
||||
coex_err("tx_ops is NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &tx_ops->dbam_tx_ops;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_dbam_attach() - Attach dbam handler
|
||||
* @psoc: psoc pointer
|
||||
*
|
||||
* This function gets called to register dbam FW events handler
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_dbam_attach(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wlan_dbam_detach() - Detach dbam handler
|
||||
* @psoc: psoc pointer
|
||||
*
|
||||
* This function gets called to unregister dbam FW events handler
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_dbam_detach(struct wlan_objmgr_psoc *psoc);
|
||||
#endif /* WLAN_FEATURE_DBAM_CONFIG */
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -158,3 +159,63 @@ wlan_coex_psoc_get_btc_chain_mode(struct wlan_objmgr_psoc *psoc, uint8_t *val)
|
||||
*val = coex_obj->btc_chain_mode;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
QDF_STATUS wlan_dbam_config_send(struct wlan_objmgr_vdev *vdev,
|
||||
struct coex_dbam_config_params *param)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
status = tgt_send_dbam_config(vdev, param);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
coex_err("failed to send dbam config");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_dbam_attach(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_dbam_tx_ops *dbam_tx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
coex_err("psoc is Null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
dbam_tx_ops = wlan_psoc_get_dbam_tx_ops(psoc);
|
||||
if (!dbam_tx_ops) {
|
||||
coex_err("dbam_tx_ops is Null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (!dbam_tx_ops->dbam_event_attach) {
|
||||
coex_err("dbam_event_attach function is Null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
return dbam_tx_ops->dbam_event_attach(psoc);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_dbam_detach(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_dbam_tx_ops *dbam_tx_ops;
|
||||
|
||||
if (!psoc) {
|
||||
coex_err("psoc is Null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
dbam_tx_ops = wlan_psoc_get_dbam_tx_ops(psoc);
|
||||
if (!dbam_tx_ops) {
|
||||
coex_err("dbam_tx_ops is Null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (!dbam_tx_ops->dbam_event_detach) {
|
||||
coex_err("dbam_event_detach function is Null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
return dbam_tx_ops->dbam_event_detach(psoc);
|
||||
}
|
||||
#endif
|
||||
|
71
components/coex/dispatcher/inc/wlan_coex_public_structs.h
Normal file
71
components/coex/dispatcher/inc/wlan_coex_public_structs.h
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* DOC: contains coex public structure definitions
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_COEX_PUBLIC_STRUCTS_H_
|
||||
#define _WLAN_COEX_PUBLIC_STRUCTS_H_
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
#define WLAN_SET_DBAM_CONFIG_TIMEOUT 5000
|
||||
|
||||
/**
|
||||
* enum coex_dbam_config_mode - dbam config mode
|
||||
* @COEX_DBAM_DISABLE: Disable DBAM
|
||||
* @COEX_DBAM_ENABLE: ENABLE DBAM opportunistically when internal
|
||||
* conditions are met.
|
||||
* @COEX_DBAM_FORCE_ENABLE: Enable DBAM forcefully
|
||||
*/
|
||||
enum coex_dbam_config_mode {
|
||||
COEX_DBAM_DISABLE = 0,
|
||||
COEX_DBAM_ENABLE = 1,
|
||||
COEX_DBAM_FORCE_ENABLE = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum coex_dbam_comp_status - dbam config response
|
||||
* @COEX_DBAM_COMP_SUCCESS: FW enabled/disabled DBAM mode succssfully
|
||||
* @COEX_DBAM_COMP_NOT_SUPPORT: DBAM mode is not supported
|
||||
* @COEX_DBAM_COMP_FAIL: FW failed to enable/disable DBAM mode
|
||||
*/
|
||||
enum coex_dbam_comp_status {
|
||||
COEX_DBAM_COMP_SUCCESS = 0,
|
||||
COEX_DBAM_COMP_NOT_SUPPORT = 1,
|
||||
COEX_DBAM_COMP_FAIL = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct coex_dbam_config_params - Coex DBAM config command params
|
||||
* @vdev_id: Virtual device identifier
|
||||
* @dbam_mode: DBAM configuration mode - coex_dbam_config_mode enum
|
||||
*/
|
||||
struct coex_dbam_config_params {
|
||||
uint32_t vdev_id;
|
||||
enum coex_dbam_config_mode dbam_mode;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct coex_dbam_config_resp - Coex DBAM config response
|
||||
* @dbam_resp: DBAM config request response - coex_dbam_comp_status enum
|
||||
*/
|
||||
struct coex_dbam_config_resp {
|
||||
enum coex_dbam_comp_status dbam_resp;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -21,6 +22,10 @@
|
||||
#ifndef _WLAN_COEX_TGT_API_H_
|
||||
#define _WLAN_COEX_TGT_API_H_
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
#include "wlan_coex_public_structs.h"
|
||||
#endif
|
||||
|
||||
#ifdef FEATURE_COEX
|
||||
struct coex_config_params;
|
||||
|
||||
@ -35,4 +40,17 @@ QDF_STATUS
|
||||
tgt_send_coex_config(struct wlan_objmgr_vdev *vdev,
|
||||
struct coex_config_params *param);
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
/**
|
||||
* tgt_send_dbam_config() - invoke target_if send dbam config
|
||||
* @vdev: vdev object
|
||||
* @param: dbam config parameters
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
tgt_send_dbam_config(struct wlan_objmgr_vdev *vdev,
|
||||
struct coex_dbam_config_params *param);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -25,6 +26,7 @@
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <wlan_objmgr_psoc_obj.h>
|
||||
#include "qca_vendor.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
|
||||
@ -117,4 +119,27 @@ ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
/**
|
||||
* ucfg_coex_send_dbam_config() - API to send dbam config to target if
|
||||
* @vdev: pointer to vdev object
|
||||
* @param: DBAM config mode params
|
||||
* @clbk: dbam config response callback
|
||||
* @context: request manager context
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_coex_send_dbam_config(struct wlan_objmgr_vdev *vdev,
|
||||
struct coex_dbam_config_params *param,
|
||||
void (*clbk)(void *ctx,
|
||||
enum coex_dbam_comp_status *rsp),
|
||||
void *context);
|
||||
#else
|
||||
static inline QDF_STATUS
|
||||
ucfg_coex_send_dbam_config(void)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -60,4 +61,28 @@ wlan_coex_psoc_open(struct wlan_objmgr_psoc *psoc);
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_coex_psoc_close(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
/**
|
||||
* wlan_dbam_psoc_enable() - API to enable coex dbam psoc component
|
||||
* @psoc: pointer to psoc
|
||||
*
|
||||
* This API is invoked from dispatcher psoc enable.
|
||||
* This API will register dbam WMI event handlers.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS wlan_dbam_psoc_enable(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* wlan_dbam_psoc_disable() - API to disable coex dbam psoc component
|
||||
* @psoc: pointer to psoc
|
||||
*
|
||||
* This API is invoked from dispatcher psoc disable.
|
||||
* This API will unregister dbam WMI event handlers.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS wlan_dbam_psoc_disable(struct wlan_objmgr_psoc *psoc);
|
||||
#endif /* WLAN_FEATURE_DBAM_CONFIG */
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -82,3 +83,25 @@ tgt_send_coex_config(struct wlan_objmgr_vdev *vdev,
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
QDF_STATUS
|
||||
tgt_send_dbam_config(struct wlan_objmgr_vdev *vdev,
|
||||
struct coex_dbam_config_params *param)
|
||||
{
|
||||
struct wlan_lmac_if_dbam_tx_ops *dbam_tx_ops;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
coex_err("NULL psoc");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
dbam_tx_ops = wlan_psoc_get_dbam_tx_ops(psoc);
|
||||
if (dbam_tx_ops && dbam_tx_ops->set_dbam_config)
|
||||
return dbam_tx_ops->set_dbam_config(psoc, param);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -21,6 +22,7 @@
|
||||
#include <wlan_coex_main.h>
|
||||
#include <wlan_coex_ucfg_api.h>
|
||||
#include "wmi_unified.h"
|
||||
#include "wlan_coex_public_structs.h"
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_coex_register_cfg_updated_handler(struct wlan_objmgr_psoc *psoc,
|
||||
@ -72,3 +74,43 @@ ucfg_coex_send_btc_chain_mode(struct wlan_objmgr_vdev *vdev, uint8_t mode)
|
||||
|
||||
return wlan_coex_config_send(vdev, ¶m);
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
QDF_STATUS
|
||||
ucfg_coex_send_dbam_config(struct wlan_objmgr_vdev *vdev,
|
||||
struct coex_dbam_config_params *param,
|
||||
void (*clbk)(void *ctx,
|
||||
enum coex_dbam_comp_status *rsp),
|
||||
void *context)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct coex_psoc_obj *coex_obj;
|
||||
struct wlan_coex_callback *cbk;
|
||||
|
||||
if (!vdev) {
|
||||
coex_err("Null vdev");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
coex_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
coex_obj = wlan_psoc_get_coex_obj(psoc);
|
||||
if (!coex_obj) {
|
||||
coex_err("failed to get coex_obj");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
cbk = &coex_obj->cb;
|
||||
cbk->set_dbam_config_cb = clbk;
|
||||
cbk->set_dbam_config_ctx = context;
|
||||
|
||||
coex_debug("send dbam config mode %d for vdev_id %d",
|
||||
param->dbam_mode, param->vdev_id);
|
||||
|
||||
return wlan_dbam_config_send(vdev, param);
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -133,3 +134,15 @@ wlan_coex_psoc_close(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return wlan_coex_psoc_deinit(psoc);
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
QDF_STATUS wlan_dbam_psoc_enable(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return wlan_dbam_attach(psoc);
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_dbam_psoc_disable(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return wlan_dbam_detach(psoc);
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -21,6 +22,7 @@
|
||||
#define __TARGET_IF_COEX_H__
|
||||
|
||||
#include <target_if.h>
|
||||
#include "wlan_coex_public_structs.h"
|
||||
|
||||
/**
|
||||
* target_if_coex_register_tx_ops() - Register coex target_if tx ops
|
||||
@ -30,4 +32,26 @@
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_coex_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
/**
|
||||
* target_if_dbam_register_tx_ops() - Register dbam target_if tx ops
|
||||
* @tx_ops: pointer to target if tx ops
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_dbam_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
|
||||
|
||||
/**
|
||||
* target_if_dbam_process_event() - dbam response function handler
|
||||
* @psoc: pointer to psoc
|
||||
* @resp: response received from FW to dbam config command
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS
|
||||
target_if_dbam_process_event(struct wlan_objmgr_psoc *psoc,
|
||||
enum coex_dbam_comp_status resp);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -19,6 +20,7 @@
|
||||
*/
|
||||
#include <wlan_coex_main.h>
|
||||
#include <target_if_coex.h>
|
||||
#include "wlan_coex_public_structs.h"
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_coex_config_send(struct wlan_objmgr_pdev *pdev,
|
||||
@ -50,3 +52,176 @@ target_if_coex_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
QDF_STATUS
|
||||
target_if_dbam_process_event(struct wlan_objmgr_psoc *psoc,
|
||||
enum coex_dbam_comp_status resp)
|
||||
{
|
||||
struct coex_psoc_obj *coex_obj;
|
||||
struct wlan_coex_callback *cb;
|
||||
|
||||
if (!psoc) {
|
||||
coex_err("psoc is null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
coex_obj = wlan_psoc_get_coex_obj(psoc);
|
||||
if (!coex_obj) {
|
||||
coex_err("failed to get coex_obj");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
cb = &coex_obj->cb;
|
||||
if (cb->set_dbam_config_cb)
|
||||
cb->set_dbam_config_cb(cb->set_dbam_config_ctx, &resp);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dbam_response_event_handler() - function to handle dbam response
|
||||
* event from firmware.
|
||||
* @scn: scn handle
|
||||
* @data: data buffer foe the event
|
||||
* @data_len: data length
|
||||
*
|
||||
* Return: 0 on success, and error code on failure
|
||||
*/
|
||||
static int target_if_dbam_response_event_handler(ol_scn_t scn,
|
||||
uint8_t *data,
|
||||
uint32_t len)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
wmi_unified_t wmi_handle;
|
||||
struct wlan_lmac_if_dbam_rx_ops *rx_ops;
|
||||
struct coex_dbam_config_resp resp = {0};
|
||||
|
||||
target_if_debug("scn:%pK, data:%pK, datalen:%d", scn, data, len);
|
||||
if (!scn || !data) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, data);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is Null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rx_ops = wlan_psoc_get_dbam_rx_ops(psoc);
|
||||
if (!rx_ops || !rx_ops->dbam_resp_event) {
|
||||
target_if_err("callback not registered");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wmi_extract_dbam_config_response(wmi_handle, data, &resp);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to extract dbam config response");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = rx_ops->dbam_resp_event(psoc, resp.dbam_resp);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("process dbam response event failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_dbam_config_send() - Send WMI command for DBAM configuration
|
||||
* @psoc: psoc pointer
|
||||
* @param: dbam config parameters
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
target_if_dbam_config_send(struct wlan_objmgr_psoc *psoc,
|
||||
struct coex_dbam_config_params *param)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid WMI handle");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
status = wmi_unified_send_dbam_config_cmd(wmi_handle, param);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_err("Failed to send DBAM config %d", status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_dbam_register_event_handler(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid WMI handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler(wmi_handle,
|
||||
wmi_coex_dbam_complete_event_id,
|
||||
target_if_dbam_response_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_err("Failed to register dbam complete event cb");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static QDF_STATUS
|
||||
target_if_dbam_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
|
||||
if (!wmi_handle) {
|
||||
target_if_err("Invalid WMI handle");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_coex_dbam_complete_event_id);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_dbam_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
{
|
||||
struct wlan_lmac_if_dbam_tx_ops *dbam_tx_ops;
|
||||
|
||||
if (!tx_ops) {
|
||||
target_if_err("target if tx ops is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
dbam_tx_ops = &tx_ops->dbam_tx_ops;
|
||||
if (!dbam_tx_ops) {
|
||||
target_if_err("target if dbam ops is NULL!");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
dbam_tx_ops->set_dbam_config = target_if_dbam_config_send;
|
||||
dbam_tx_ops->dbam_event_attach = target_if_dbam_register_event_handler;
|
||||
dbam_tx_ops->dbam_event_detach =
|
||||
target_if_dbam_unregister_event_handler;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
@ -26,3 +26,8 @@ CONFIG_WLAN_DP_DISABLE_TCL_STATUS_SRNG := y
|
||||
CONFIG_GET_DRIVER_MODE := y
|
||||
|
||||
CONFIG_QCA_SUPPORT_TX_MIN_RATES_FOR_SPECIAL_FRAMES := y
|
||||
|
||||
#Enable DBAM feature
|
||||
ifeq ($(CONFIG_FEATURE_COEX), y)
|
||||
CONFIG_WLAN_FEATURE_COEX_DBAM := y
|
||||
endif
|
||||
|
@ -101,7 +101,6 @@
|
||||
#include <cdp_txrx_cmn.h>
|
||||
#include <cdp_txrx_misc.h>
|
||||
#include <cdp_txrx_ctrl.h>
|
||||
#include <qca_vendor.h>
|
||||
#include "wlan_pmo_ucfg_api.h"
|
||||
#include "os_if_wifi_pos.h"
|
||||
#include "wlan_utility.h"
|
||||
@ -186,6 +185,8 @@
|
||||
#include "wlan_cfg80211_wifi_pos.h"
|
||||
#include "wlan_osif_features.h"
|
||||
#include "wlan_hdd_wifi_pos_pasn.h"
|
||||
#include "wlan_coex_ucfg_api.h"
|
||||
#include "wlan_coex_public_structs.h"
|
||||
|
||||
#define g_mode_rates_size (12)
|
||||
#define a_mode_rates_size (8)
|
||||
@ -7522,6 +7523,7 @@ const struct nla_policy wlan_hdd_wifi_config_policy[
|
||||
.type = NLA_U8 },
|
||||
[QCA_WLAN_VENDOR_ATTR_CONFIG_FT_OVER_DS] = {.type = NLA_U8 },
|
||||
[QCA_WLAN_VENDOR_ATTR_CONFIG_ARP_NS_OFFLOAD] = {.type = NLA_U8 },
|
||||
[QCA_WLAN_VENDOR_ATTR_CONFIG_DBAM] = {.type = NLA_U8 },
|
||||
};
|
||||
|
||||
static const struct nla_policy
|
||||
@ -9884,6 +9886,159 @@ static int hdd_set_arp_ns_offload(struct hdd_adapter *adapter,
|
||||
#undef DYNAMIC_ARP_NS_DISABLE
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
|
||||
static int
|
||||
hdd_convert_qca_dbam_config_mode(enum qca_dbam_config qca_dbam,
|
||||
enum coex_dbam_config_mode *coex_dbam)
|
||||
{
|
||||
switch (qca_dbam) {
|
||||
case QCA_DBAM_DISABLE:
|
||||
*coex_dbam = COEX_DBAM_DISABLE;
|
||||
break;
|
||||
case QCA_DBAM_ENABLE:
|
||||
*coex_dbam = COEX_DBAM_ENABLE;
|
||||
break;
|
||||
case QCA_DBAM_FORCE_ENABLE:
|
||||
*coex_dbam = COEX_DBAM_FORCE_ENABLE;
|
||||
break;
|
||||
default:
|
||||
hdd_err("Invalid dbam config mode %d", qca_dbam);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
hdd_convert_dbam_comp_status(enum coex_dbam_comp_status dbam_resp)
|
||||
{
|
||||
switch (dbam_resp) {
|
||||
case COEX_DBAM_COMP_SUCCESS:
|
||||
return 0;
|
||||
case COEX_DBAM_COMP_NOT_SUPPORT:
|
||||
return -ENOTSUPP;
|
||||
case COEX_DBAM_COMP_FAIL:
|
||||
return -EINVAL;
|
||||
default:
|
||||
hdd_err("Invalid dbam config resp received from FW");
|
||||
break;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_dbam_config_resp_cb() - DBAM config response callback
|
||||
* @context: request manager context
|
||||
* @fw_resp: pointer to dbam config fw response
|
||||
*
|
||||
* Return: 0 on success, negative errno on failure
|
||||
*/
|
||||
static void
|
||||
hdd_dbam_config_resp_cb(void *context,
|
||||
enum coex_dbam_comp_status *resp)
|
||||
{
|
||||
struct osif_request *request;
|
||||
struct coex_dbam_config_resp *priv;
|
||||
|
||||
request = osif_request_get(context);
|
||||
if (!request) {
|
||||
osif_err("Obsolete request");
|
||||
return;
|
||||
}
|
||||
|
||||
priv = osif_request_priv(request);
|
||||
priv->dbam_resp = *resp;
|
||||
|
||||
osif_request_complete(request);
|
||||
osif_request_put(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_set_dbam_config() - enable/disable DBAM config
|
||||
* @adapter: hdd adapter
|
||||
* @attr: pointer to nla attr
|
||||
*
|
||||
* Return: 0 on success, negative errno on failure
|
||||
*/
|
||||
static int hdd_set_dbam_config(struct hdd_adapter *adapter,
|
||||
const struct nlattr *attr)
|
||||
{
|
||||
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
int errno;
|
||||
QDF_STATUS status;
|
||||
enum qca_dbam_config dbam_config;
|
||||
enum coex_dbam_config_mode dbam_mode;
|
||||
enum coex_dbam_comp_status dbam_resp;
|
||||
struct coex_dbam_config_params dbam_params = {0};
|
||||
void *cookie;
|
||||
struct osif_request *request;
|
||||
struct coex_dbam_config_resp *priv;
|
||||
static const struct osif_request_params params = {
|
||||
.priv_size = sizeof(*priv),
|
||||
.timeout_ms = WLAN_SET_DBAM_CONFIG_TIMEOUT,
|
||||
};
|
||||
|
||||
errno = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (errno)
|
||||
return -EINVAL;
|
||||
|
||||
if (hdd_ctx->num_rf_chains < 2) {
|
||||
hdd_debug("Num of chains [%u] < 2, DBAM config is not allowed",
|
||||
hdd_ctx->num_rf_chains);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dbam_config = nla_get_u8(attr);
|
||||
errno = hdd_convert_qca_dbam_config_mode(dbam_config, &dbam_mode);
|
||||
if (errno)
|
||||
return errno;
|
||||
|
||||
request = osif_request_alloc(¶ms);
|
||||
if (!request) {
|
||||
osif_err("Request allocation failure");
|
||||
return -ENOMEM;
|
||||
}
|
||||
cookie = osif_request_cookie(request);
|
||||
|
||||
dbam_params.vdev_id = adapter->vdev_id;
|
||||
dbam_params.dbam_mode = dbam_mode;
|
||||
|
||||
vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_ID);
|
||||
if (!vdev) {
|
||||
hdd_err("vdev is NULL");
|
||||
errno = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
status = ucfg_coex_send_dbam_config(vdev, &dbam_params,
|
||||
hdd_dbam_config_resp_cb, cookie);
|
||||
|
||||
hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID);
|
||||
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
hdd_err("Unable to set dbam config to [%u]", dbam_mode);
|
||||
errno = qdf_status_to_os_return(status);
|
||||
goto err;
|
||||
}
|
||||
|
||||
errno = osif_request_wait_for_response(request);
|
||||
if (errno) {
|
||||
osif_err("DBAM config operation timed out");
|
||||
goto err;
|
||||
}
|
||||
|
||||
priv = osif_request_priv(request);
|
||||
dbam_resp = priv->dbam_resp;
|
||||
errno = hdd_convert_dbam_comp_status(dbam_resp);
|
||||
err:
|
||||
osif_request_put(request);
|
||||
return errno;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* typedef independent_setter_fn - independent attribute handler
|
||||
* @adapter: The adapter being configured
|
||||
@ -10002,6 +10157,10 @@ static const struct independent_setters independent_setters[] = {
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_ARP_NS_OFFLOAD,
|
||||
hdd_set_arp_ns_offload},
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_DBAM_CONFIG
|
||||
{QCA_WLAN_VENDOR_ATTR_CONFIG_DBAM,
|
||||
hdd_set_dbam_config},
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef WLAN_FEATURE_ELNA
|
||||
@ -21504,7 +21663,7 @@ QDF_STATUS hdd_softap_deauth_current_sta(struct hdd_adapter *adapter,
|
||||
qdf_status = hdd_softap_sta_deauth(adapter, param);
|
||||
|
||||
if (QDF_IS_STATUS_SUCCESS(qdf_status)) {
|
||||
if(qdf_is_macaddr_broadcast(&sta_info->sta_mac)) {
|
||||
if (qdf_is_macaddr_broadcast(&sta_info->sta_mac)) {
|
||||
hdd_for_each_sta_ref_safe(
|
||||
adapter->sta_info_list,
|
||||
sta_info, tmp,
|
||||
|
Loading…
Reference in New Issue
Block a user