qcacld-3.0: move component 'coex' to qcacld project

'coex' component is MCC specific, move to qcacld project.

CRs-Fixed: 2721758
Change-Id: Ic1769ddf7eab6a6acc96349c020a6f311cda6bff
This commit is contained in:
Yu Wang
2020-06-30 11:06:34 +08:00
committed by snandini
parent 8fbb8508ad
commit 6088e94490
13 changed files with 1056 additions and 8 deletions

View File

@@ -0,0 +1,84 @@
/*
* Copyright (c) 2020, The Linux Foundation. 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 south bound interface definitions
*/
#include <wlan_coex_main.h>
#include <wlan_coex_tgt_api.h>
#include <wlan_lmac_if_def.h>
#include "wlan_objmgr_pdev_obj.h"
static inline struct wlan_lmac_if_coex_tx_ops *
wlan_psoc_get_coex_txops(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->coex_ops;
}
static inline struct wlan_lmac_if_coex_tx_ops *
wlan_vdev_get_coex_txops(struct wlan_objmgr_vdev *vdev)
{
struct wlan_objmgr_psoc *psoc;
psoc = wlan_vdev_get_psoc(vdev);
if (!psoc) {
coex_err("NULL psoc");
return NULL;
}
return wlan_psoc_get_coex_txops(psoc);
}
QDF_STATUS
tgt_send_coex_config(struct wlan_objmgr_vdev *vdev,
struct coex_config_params *param)
{
struct wlan_lmac_if_coex_tx_ops *coex_ops;
struct wlan_objmgr_psoc *psoc;
struct wlan_objmgr_pdev *pdev;
if (!vdev) {
coex_err("NULL vdev");
return QDF_STATUS_E_NULL_VALUE;
}
psoc = wlan_vdev_get_psoc(vdev);
if (!psoc) {
coex_err("NULL psoc");
return QDF_STATUS_E_NULL_VALUE;
}
pdev = wlan_vdev_get_pdev(vdev);
if (!pdev) {
coex_err("NULL pdev");
return QDF_STATUS_E_NULL_VALUE;
}
coex_ops = wlan_psoc_get_coex_txops(psoc);
if (coex_ops && coex_ops->coex_config_send)
return coex_ops->coex_config_send(pdev, param);
return QDF_STATUS_SUCCESS;
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright (c) 2020, The Linux Foundation. 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 north bound interface definitions
*/
#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,
enum coex_config_type type,
update_coex_cb handler)
{
struct coex_psoc_obj *coex_obj;
if (type >= COEX_CONFIG_TYPE_MAX) {
coex_err("invalid coex type: %d", type);
return QDF_STATUS_E_INVAL;
}
coex_obj = wlan_psoc_get_coex_obj(psoc);
if (!coex_obj)
return QDF_STATUS_E_INVAL;
coex_obj->coex_config_updated[type] = handler;
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, &param);
}

View File

@@ -0,0 +1,88 @@
/*
* Copyright (c) 2020, The Linux Foundation. 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: wlan_coex_utils_api.c
*
* This file provides definitions of public APIs exposed to other UMAC
* components.
*/
#include <wlan_coex_main.h>
#include <wlan_objmgr_global_obj.h>
#include <wlan_coex_utils_api.h>
QDF_STATUS wlan_coex_init(void)
{
QDF_STATUS status;
status = wlan_objmgr_register_psoc_create_handler(
WLAN_UMAC_COMP_COEX,
wlan_coex_psoc_created_notification, NULL);
if (QDF_IS_STATUS_ERROR(status)) {
coex_err("Failed to register psoc create handler");
goto fail_create_psoc;
}
status = wlan_objmgr_register_psoc_destroy_handler(
WLAN_UMAC_COMP_COEX,
wlan_coex_psoc_destroyed_notification, NULL);
if (QDF_IS_STATUS_ERROR(status)) {
coex_err("Failed to create psoc delete handler");
goto fail_psoc_destroy;
}
coex_debug("coex psoc create and delete handler registered");
return status;
fail_psoc_destroy:
wlan_objmgr_unregister_psoc_create_handler(
WLAN_UMAC_COMP_COEX,
wlan_coex_psoc_created_notification, NULL);
fail_create_psoc:
return status;
}
QDF_STATUS wlan_coex_deinit(void)
{
QDF_STATUS status;
status = wlan_objmgr_unregister_psoc_destroy_handler(
WLAN_UMAC_COMP_COEX,
wlan_coex_psoc_destroyed_notification, NULL);
if (status != QDF_STATUS_SUCCESS)
coex_err("Failed to unregister psoc delete handler");
status = wlan_objmgr_unregister_psoc_create_handler(
WLAN_UMAC_COMP_COEX,
wlan_coex_psoc_created_notification, NULL);
if (status != QDF_STATUS_SUCCESS)
coex_err("Failed to unregister psoc create handler");
return status;
}
QDF_STATUS
wlan_coex_psoc_open(struct wlan_objmgr_psoc *psoc)
{
return wlan_coex_psoc_init(psoc);
}
QDF_STATUS
wlan_coex_psoc_close(struct wlan_objmgr_psoc *psoc)
{
return wlan_coex_psoc_deinit(psoc);
}