qcacmn: Initial version of coex component

Add initial set of coex files, implement the basic functions.
Coex component is used to process coex related configurations.

CRs-Fixed: 2565088
Change-Id: I8b9600809691b808f97c621cb329a6ab9941814c
This commit is contained in:
Yu Wang
2019-12-18 09:08:09 +08:00
committed by nshrivas
parent e7f177ac80
commit 1cd103900e
14 changed files with 833 additions and 5 deletions

View File

@@ -0,0 +1,33 @@
/*
* 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 target if declarations
*/
#ifndef __TARGET_IF_COEX_H__
#define __TARGET_IF_COEX_H__
#include <target_if.h>
/**
* target_if_coex_register_tx_ops() - Register coex 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_coex_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
#endif

View File

@@ -0,0 +1,52 @@
/*
* 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 target if functions
*/
#include <wlan_coex_main.h>
#include <target_if_coex.h>
static QDF_STATUS
target_if_coex_config_send(struct wlan_objmgr_pdev *pdev,
struct coex_config_params *param)
{
wmi_unified_t pdev_wmi_handle;
pdev_wmi_handle = GET_WMI_HDL_FROM_PDEV(pdev);
if (!pdev_wmi_handle) {
coex_err("Invalid PDEV WMI handle");
return QDF_STATUS_E_FAILURE;
}
return wmi_unified_send_coex_config_cmd(pdev_wmi_handle, param);
}
QDF_STATUS
target_if_coex_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
{
struct wlan_lmac_if_coex_tx_ops *coex_ops;
if (!tx_ops) {
coex_err("target if tx ops is NULL!");
return QDF_STATUS_E_INVAL;
}
coex_ops = &tx_ops->coex_ops;
coex_ops->coex_config_send = target_if_coex_config_send;
return QDF_STATUS_SUCCESS;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@@ -80,6 +80,10 @@
#endif
#include <target_if_vdev_mgr_tx_ops.h>
#ifdef FEATURE_COEX
#include <target_if_coex.h>
#endif
static struct target_if_ctx *g_target_if_ctx;
struct target_if_ctx *target_if_get_ctx()
@@ -338,6 +342,20 @@ static inline void target_if_crypto_tx_ops_register(
}
#endif
#ifdef FEATURE_COEX
static QDF_STATUS
target_if_coex_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops)
{
return target_if_coex_register_tx_ops(tx_ops);
}
#else
static inline QDF_STATUS
target_if_coex_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops)
{
return QDF_STATUS_SUCCESS;
}
#endif
static void target_if_target_tx_ops_register(
struct wlan_lmac_if_tx_ops *tx_ops)
{
@@ -441,6 +459,8 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
target_if_vdev_mgr_tx_ops_register(tx_ops);
target_if_coex_tx_ops_register(tx_ops);
/* Converged UMAC components to register their TX-ops here */
return QDF_STATUS_SUCCESS;
}