diff --git a/umac/cp_stats/core/src/wlan_cp_stats_da_api.c b/umac/cp_stats/core/src/wlan_cp_stats_da_api.c deleted file mode 100644 index 71fcbe23e7..0000000000 --- a/umac/cp_stats/core/src/wlan_cp_stats_da_api.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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: wlan_cp_stats_da_api.c - * - * This file provide definitions for cp stats global context initialization - * specific to DA - */ -#include "wlan_cp_stats_defs.h" -#include "wlan_cp_stats_da_api.h" - -QDF_STATUS wlan_cp_stats_ctx_init_da(struct cp_stats_context *csc) -{ - return QDF_STATUS_SUCCESS; -} - -QDF_STATUS wlan_cp_stats_ctx_deinit_da(struct cp_stats_context *ac) -{ - return QDF_STATUS_SUCCESS; -} diff --git a/umac/cp_stats/core/src/wlan_cp_stats_da_api.h b/umac/cp_stats/core/src/wlan_cp_stats_da_api.h deleted file mode 100644 index 67a181466d..0000000000 --- a/umac/cp_stats/core/src/wlan_cp_stats_da_api.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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: wlan_cp_stats_da_api.h - * - * This header file provide declarations for cp stats global context object - * initialization specific to DA - */ -#ifndef __WLAN_CP_STATS_DA_API_H__ -#define __WLAN_CP_STATS_DA_API_H__ - -#ifdef QCA_SUPPORT_CP_STATS -#include -#include "wlan_cp_stats_defs.h" -#include "wlan_cp_stats_da_api.h" - -/** - * wlan_cp_stats_ctx_init_da() - initialize cp stats global context - * @pdev: Pointer to cp stats global context object - * - * Return: QDF_STATUS - Success or Failure - */ -QDF_STATUS wlan_cp_stats_ctx_init_da(struct cp_stats_context *csc); - -/** - * wlan_cp_stats_ctx_deinit_da() - deinitialize cp stats global context - * @pdev: Pointer to cp stats global context object - * - * Return: QDF_STATUS - Success or Failure - */ -QDF_STATUS wlan_cp_stats_ctx_deinit_da(struct cp_stats_context *csc); - -#endif /* QCA_SUPPORT_CP_STATS */ -#endif /* __WLAN_CP_STATS_DA_API_H__ */ diff --git a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c index d8dd04170d..24efc3aeb5 100644 --- a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c +++ b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.c @@ -26,13 +26,8 @@ */ #include "wlan_cp_stats_obj_mgr_handler.h" #include "wlan_cp_stats_defs.h" -#include "wlan_cp_stats_da_api.h" #include "wlan_cp_stats_ol_api.h" - #include "wlan_cp_stats_defs.h" -#include "wlan_cp_stats_ic_ucfg_handler.h" - -#include #include "wlan_cp_stats_utils_api.h" QDF_STATUS diff --git a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.h b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.h index ad050db4f8..0f60f94b94 100644 --- a/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.h +++ b/umac/cp_stats/core/src/wlan_cp_stats_obj_mgr_handler.h @@ -34,6 +34,12 @@ #include #include +#ifdef QCA_SUPPORT_CP_STATS_DA +#include "wlan_cp_stats_da_api.h" +#else +#include "wlan_cp_stats_defs.h" +#endif + /** * wlan_cp_stats_psoc_obj_create_handler() - psoc create notification handler * callback function @@ -122,5 +128,19 @@ QDF_STATUS wlan_cp_stats_peer_obj_create_handler( QDF_STATUS wlan_cp_stats_peer_obj_destroy_handler( struct wlan_objmgr_peer *peer, void *data); +#ifndef QCA_SUPPORT_CP_STATS_DA +static inline +QDF_STATUS wlan_cp_stats_ctx_init_da(struct cp_stats_context *csc) +{ + return QDF_STATUS_SUCCESS; +} + +static inline +QDF_STATUS wlan_cp_stats_ctx_deinit_da(struct cp_stats_context *csc) +{ + return QDF_STATUS_SUCCESS; +} +#endif + #endif /* QCA_SUPPORT_CP_STATS */ #endif /* __WLAN_CP_STATS_OBJ_MGR_HANDLER_H__ */ diff --git a/umac/cp_stats/dispatcher/inc/wlan_cp_stats_ucfg_api.h b/umac/cp_stats/dispatcher/inc/wlan_cp_stats_ucfg_api.h index ea69d7e31e..e09eee3850 100644 --- a/umac/cp_stats/dispatcher/inc/wlan_cp_stats_ucfg_api.h +++ b/umac/cp_stats/dispatcher/inc/wlan_cp_stats_ucfg_api.h @@ -26,6 +26,9 @@ #define __WLAN_CP_STATS_UCFG_API_H__ #ifdef QCA_SUPPORT_CP_STATS +#include +#include "../../core/src/wlan_cp_stats_defs.h" +#include "../../core/src/wlan_cp_stats_cmn_api_i.h" #endif /* QCA_SUPPORT_CP_STATS */ #endif /* __WLAN_CP_STATS_UCFG_API_H__ */ diff --git a/umac/cp_stats/dispatcher/src/wlan_cp_stats_utils_api.c b/umac/cp_stats/dispatcher/src/wlan_cp_stats_utils_api.c index a21ec8038f..c614702ce0 100644 --- a/umac/cp_stats/dispatcher/src/wlan_cp_stats_utils_api.c +++ b/umac/cp_stats/dispatcher/src/wlan_cp_stats_utils_api.c @@ -232,6 +232,25 @@ QDF_STATUS wlan_cp_stats_open(struct wlan_objmgr_psoc *psoc) } QDF_STATUS wlan_cp_stats_close(struct wlan_objmgr_psoc *psoc) +{ + struct cp_stats_context *csc; + + if (!psoc) { + cp_stats_err("PSOC is null!"); + return QDF_STATUS_E_INVAL; + } + csc = + wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_CP_STATS); + if (csc && csc->cp_stats_close) { + csc->cp_stats_close(psoc); + qdf_spinlock_destroy(&csc->csc_lock); + } + + return QDF_STATUS_SUCCESS; +} + +/* WMI registrations stage */ +QDF_STATUS wlan_cp_stats_enable(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status = QDF_STATUS_E_FAILURE; struct cp_stats_context *csc; @@ -247,30 +266,6 @@ QDF_STATUS wlan_cp_stats_close(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_FAILURE; } - if (csc->cp_stats_close) - status = csc->cp_stats_close(psoc); - - qdf_spinlock_destroy(&csc->csc_lock); - return status; -} - -/* WMI registrations stage */ -QDF_STATUS wlan_cp_stats_enable(struct wlan_objmgr_psoc *psoc) -{ - QDF_STATUS status = QDF_STATUS_E_FAILURE; - struct cp_stats_context *csc; - - if (!psoc) { - cp_stats_err("PSOC is null!\n"); - return QDF_STATUS_E_INVAL; - } - csc = - wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_CP_STATS); - if (!csc) { - cp_stats_err("cp_stats_context is null!\n"); - return QDF_STATUS_E_FAILURE; - } - if (csc->cp_stats_enable) status = csc->cp_stats_enable(psoc); @@ -279,7 +274,6 @@ QDF_STATUS wlan_cp_stats_enable(struct wlan_objmgr_psoc *psoc) QDF_STATUS wlan_cp_stats_disable(struct wlan_objmgr_psoc *psoc) { - QDF_STATUS status = QDF_STATUS_E_FAILURE; struct cp_stats_context *csc; if (!psoc) { @@ -288,15 +282,10 @@ QDF_STATUS wlan_cp_stats_disable(struct wlan_objmgr_psoc *psoc) } csc = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_CP_STATS); - if (!csc) { - cp_stats_err("cp_stats_context is null!\n"); - return QDF_STATUS_E_FAILURE; - } + if (csc && csc->cp_stats_disable) + csc->cp_stats_disable(psoc); - if (csc->cp_stats_disable) - status = csc->cp_stats_disable(psoc); - - return status; + return QDF_STATUS_SUCCESS; } QDF_STATUS