diff --git a/target_if/core/src/target_if_main.c b/target_if/core/src/target_if_main.c index 0f34cebce70c..7d54f6911aa5 100644 --- a/target_if/core/src/target_if_main.c +++ b/target_if/core/src/target_if_main.c @@ -74,6 +74,8 @@ #endif #include "qdf_module.h" +#include + static struct target_if_ctx *g_target_if_ctx; struct target_if_ctx *target_if_get_ctx() @@ -361,6 +363,12 @@ static void target_if_target_tx_ops_register( ucfg_get_tgt_revision; } +static QDF_STATUS +target_if_cp_stats_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops) +{ + return target_if_cp_stats_register_tx_ops(tx_ops); +} + static void target_if_ftm_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops) { @@ -403,6 +411,8 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) target_if_ftm_tx_ops_register(tx_ops); + target_if_cp_stats_tx_ops_register(tx_ops); + /* Converged UMAC components to register their TX-ops here */ return QDF_STATUS_SUCCESS; } diff --git a/target_if/cp_stats/inc/target_if_cp_stats.h b/target_if/cp_stats/inc/target_if_cp_stats.h new file mode 100644 index 000000000000..92d9ef0035f2 --- /dev/null +++ b/target_if/cp_stats/inc/target_if_cp_stats.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018 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: target_if_cp_stats.h + * + * This header file provide declarations required for Rx and Tx events from + * firmware + */ + +#ifndef __TARGET_IF_CP_STATS_H__ +#define __TARGET_IF_CP_STATS_H__ + +#include + +#ifdef QCA_SUPPORT_CP_STATS +#include + +/** + * target_if_cp_stats_register_tx_ops() - define cp_stats lmac tx ops functions + * @tx_ops: pointer to lmac tx ops + * + * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error + */ +QDF_STATUS +target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops); +#else +static inline QDF_STATUS +target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) +{ + return QDF_STATUS_SUCCESS; +} +#endif /* QCA_SUPPORT_CP_STATS */ + +#endif /* __TARGET_IF_CP_STATS_H__ */ diff --git a/target_if/cp_stats/src/target_if_cp_stats.c b/target_if/cp_stats/src/target_if_cp_stats.c new file mode 100644 index 000000000000..910a337adedb --- /dev/null +++ b/target_if/cp_stats/src/target_if_cp_stats.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2018 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: target_if_cp_stats.c + * + * This file provide definition for APIs registered through lmac Tx Ops + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static QDF_STATUS +target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc) +{ + if (!psoc) { + cp_stats_err("PSOC is NULL!"); + return QDF_STATUS_E_INVAL; + } + + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS +target_if_cp_stats_unregister_event_handler(struct wlan_objmgr_psoc *psoc) +{ + if (!psoc) { + cp_stats_err("PSOC is NULL!"); + return QDF_STATUS_E_INVAL; + } + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) +{ + struct wlan_lmac_if_cp_stats_tx_ops *cp_stats_tx_ops; + + if (!tx_ops) { + cp_stats_err("lmac tx ops is NULL!"); + return QDF_STATUS_E_INVAL; + } + + cp_stats_tx_ops->cp_stats_attach = + target_if_cp_stats_register_event_handler; + cp_stats_tx_ops->cp_stats_detach = + target_if_cp_stats_unregister_event_handler; + + return QDF_STATUS_SUCCESS; +}