1 /*
2  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 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_cfg80211_ic_cp_stats.h
22  *
23  * This Header file provide declaration for cfg80211 command handler API
24  * registered cp stats and specific with ic
25  */
26 
27 #ifndef __WLAN_CFG80211_IC_CP_STATS_H__
28 #define __WLAN_CFG80211_IC_CP_STATS_H__
29 
30 #ifdef QCA_SUPPORT_CP_STATS
31 #include <wlan_objmgr_cmn.h>
32 #include <wlan_cp_stats_ic_defs.h>
33 #ifdef WLAN_ATF_ENABLE
34 #include <wlan_cp_stats_ic_atf_defs.h>
35 #endif
36 #include <wlan_cp_stats_ic_dcs_defs.h>
37 
38 /**
39  * wlan_cfg80211_get_peer_cp_stats() - API to get peer stats object
40  * @peer_obj: peer object as input
41  * @peer_cp_stats: peer stats object to populate
42  *
43  * Return: 0 on success, negative value on failure
44  */
45 int wlan_cfg80211_get_peer_cp_stats(struct wlan_objmgr_peer *peer_obj,
46 				    struct peer_ic_cp_stats *peer_cp_stats);
47 
48 /**
49  * wlan_cfg80211_get_vdev_cp_stats() - API to get vdev stats object
50  * @vdev_obj: vdev object as input
51  * @vdev_cp_stats: vdev stats object to populate
52  *
53  * Return: 0 on success, negative value on failure
54  */
55 int wlan_cfg80211_get_vdev_cp_stats(struct wlan_objmgr_vdev *vdev_obj,
56 				    struct vdev_ic_cp_stats *vdev_cp_stats);
57 
58 /**
59  * wlan_cfg80211_get_pdev_cp_stats() - API to get pdev cp stats object
60  * @pdev_obj: pdev object as input
61  * @pdev_cp_stats: pdev cp stats object to populate
62  *
63  * Return: 0 on success, negative value on failure
64  */
65 int wlan_cfg80211_get_pdev_cp_stats(struct wlan_objmgr_pdev *pdev_obj,
66 				    struct pdev_ic_cp_stats *pdev_cp_stats);
67 
68 #ifdef WLAN_ATF_ENABLE
69 /**
70  * wlan_cfg80211_get_atf_peer_cp_stats() - API to get ATF peer stats object
71  * @peer_obj: peer object as input
72  * @atf_cp_stats: atf peer cp stats object to populate
73  *
74  * Return: 0 on success, negative value on failure
75  */
76 int
77 wlan_cfg80211_get_atf_peer_cp_stats(struct wlan_objmgr_peer *peer_obj,
78 				    struct atf_peer_cp_stats *atf_cp_stats);
79 
80 /**
81  * wlan_cfg80211_get_atf_peer_cp_stats_from_mac() - API to get ATF peer
82  * stats object from peer mac address
83  * @vdev_obj: vdev object as input
84  * @mac: peer mac address as input
85  * @atf_cp_stats: atf peer cp stats object to populate
86  *
87  * API used from ucfg layer to get ATF peer cp stats object when only peer
88  * mac address is available
89  *
90  * Return: 0 on success, negative value on failure
91  */
92 int wlan_cfg80211_get_atf_peer_cp_stats_from_mac(
93 		struct wlan_objmgr_vdev *vdev_obj,
94 		uint8_t *mac,
95 		struct atf_peer_cp_stats *atf_cp_stats);
96 #endif /* WLAN_ATF_ENABLE */
97 
98 /**
99  * wlan_cfg80211_get_dcs_pdev_cp_stats() - API to get DCS chan stats
100  * @pdev_obj: pdev object as input
101  * @dcs_chan_stats: DCS pdev stats object to populate
102  *
103  * Return: 0 on success, negative value on failure
104  */
105 int wlan_cfg80211_get_dcs_pdev_cp_stats(
106 		struct wlan_objmgr_pdev *pdev_obj,
107 		struct pdev_dcs_chan_stats *dcs_chan_stats);
108 
109 #endif /* QCA_SUPPORT_CP_STATS */
110 #endif /* __WLAN_CFG80211_IC_CP_STATS_H__ */
111