xref: /wlan-driver/qca-wifi-host-cmn/umac/cp_stats/core/src/wlan_cp_stats_comp_handler.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: wlan_cp_stats_comp_handler.h
22  *
23  * This header file API declarations required to attach/detach and
24  * enable/disable other UMAC component specific control plane statistics
25  * to cp stats component object
26  */
27 
28 #ifndef __WLAN_CP_STATS_COMP_HANDLER_H__
29 #define __WLAN_CP_STATS_COMP_HANDLER_H__
30 
31 #ifdef QCA_SUPPORT_CP_STATS
32 #include "wlan_cp_stats_defs.h"
33 
34 /**
35  * wlan_cp_stats_comp_obj_config() - attach/detach component specific stats
36  * callback function
37  * @obj_type: common object type
38  * @cfg_state: config state either to attach of detach
39  * @comp_id: cpstats component id
40  * @cmn_obj: pointer to common object
41  * @comp_priv_obj: pointer to component specific cp stats object
42  *
43  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
44  */
45 QDF_STATUS wlan_cp_stats_comp_obj_config(
46 		enum wlan_objmgr_obj_type obj_type,
47 		enum wlan_cp_stats_cfg_state cfg_state,
48 		enum wlan_cp_stats_comp_id comp_id,
49 		void *cmn_obj,
50 		void *comp_priv_obj);
51 
52 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
53 /**
54  * wlan_cp_stats_twt_get_session_evt_handler() - twt get sessions evt handler
55  * @psoc: pointer to psoc object
56  * @twt_params: twt params
57  *
58  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
59  */
60 QDF_STATUS
61 wlan_cp_stats_twt_get_session_evt_handler(
62 				struct wlan_objmgr_psoc *psoc,
63 				struct twt_session_stats_info *twt_params);
64 #else
65 static inline QDF_STATUS
wlan_cp_stats_twt_get_session_evt_handler(struct wlan_objmgr_psoc * psoc,struct twt_session_stats_info * twt_params)66 wlan_cp_stats_twt_get_session_evt_handler(
67 				struct wlan_objmgr_psoc *psoc,
68 				struct twt_session_stats_info *twt_params)
69 {
70 	return QDF_STATUS_E_NOSUPPORT;
71 }
72 #endif
73 
74 #endif /* QCA_SUPPORT_CP_STATS */
75 #endif /* __WLAN_CP_STATS_COMP_HANDLER_H__ */
76