xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_cp_stats_api.h (revision d0c05845839e5f2ba5a8dcebe0cd3e4cd4e8dfcf)
1 /*
2  * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 /**
18  * DOC: Implement API's specific to cp stats component.
19  */
20 
21 #ifndef _WMI_UNIFIED_CP_STATS_API_H_
22 #define _WMI_UNIFIED_CP_STATS_API_H_
23 
24 #ifdef QCA_SUPPORT_MC_CP_STATS
25 #include <wmi_unified_mc_cp_stats_api.h>
26 #endif
27 
28 #ifdef WLAN_SUPPORT_INFRA_CTRL_PATH_STATS
29 /**
30  * wmi_unified_infra_cp_stats_request_send() - WMI request infra_cp_stats
31  * function
32  * @wmi_handle: wmi handle
33  * @param: pointer to hold infra_cp_stats request parameters
34  *
35  * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error
36  *         codes on failure
37  */
38 QDF_STATUS
39 wmi_unified_infra_cp_stats_request_send(
40 				wmi_unified_t wmi_handle,
41 				struct infra_cp_stats_cmd_info *param);
42 
43 /**
44  * wmi_unified_extract_infra_cp_stats() - extract various infra cp statistics
45  * @wmi_handle: wmi handle
46  * @evt_buf: event buffer
47  * @evt_buf_len: length of event buffer
48  * @params: pointer to store the extracted event info
49  *
50  * This function extracts the infra cp statistics from the event
51  *
52  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
53  */
54 QDF_STATUS
55 wmi_unified_extract_infra_cp_stats(wmi_unified_t wmi_handle,
56 				   void *evt_buf, uint32_t evt_buf_len,
57 				   struct infra_cp_stats_event *params);
58 
59 QDF_STATUS wmi_stats_handler(void *buff, int32_t len,
60 			     struct infra_cp_stats_event *params);
61 
62 QDF_STATUS
63 extract_infra_cp_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
64 			   uint32_t evt_buf_len,
65 			   struct infra_cp_stats_event *params);
66 #endif /* WLAN_SUPPORT_INFRA_CTRL_PATH_STATS */
67 
68 /**
69  * wmi_unified_stats_request_send() - WMI request stats function
70  * @wmi_handle: handle to WMI
71  * @macaddr: MAC address
72  * @param: pointer to hold stats request parameter
73  *
74  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
75  */
76 QDF_STATUS wmi_unified_stats_request_send(wmi_unified_t wmi_handle,
77 					  uint8_t macaddr[QDF_MAC_ADDR_SIZE],
78 					  struct stats_request_params *param);
79 
80 #ifdef WLAN_FEATURE_BIG_DATA_STATS
81 /**
82  * wmi_unified_big_data_stats_request_send() - WMI request big data stats
83  * function
84  * @wmi_handle: handle to WMI
85  * @param: pointer to hold stats request parameter
86  *
87  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
88  */
89 QDF_STATUS
90 wmi_unified_big_data_stats_request_send(wmi_unified_t wmi_handle,
91 					struct stats_request_params *param);
92 #endif
93 
94 /**
95  * wmi_extract_stats_param() - extract all stats count from event
96  * @wmi_handle: wmi handle
97  * @evt_buf: pointer to event buffer
98  * @stats_param: Pointer to hold stats count
99  *
100  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
101  */
102 QDF_STATUS
103 wmi_extract_stats_param(wmi_unified_t wmi_handle, void *evt_buf,
104 			wmi_host_stats_event *stats_param);
105 
106 /**
107  * wmi_extract_pdev_stats() - extract pdev stats from event
108  * @wmi_handle: wmi handle
109  * @evt_buf: pointer to event buffer
110  * @index: Index into pdev stats
111  * @pdev_stats: Pointer to hold pdev stats
112  *
113  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
114  */
115 QDF_STATUS
116 wmi_extract_pdev_stats(wmi_unified_t wmi_handle, void *evt_buf,
117 		       uint32_t index, wmi_host_pdev_stats *pdev_stats);
118 
119 /**
120  * wmi_extract_vdev_stats() - extract vdev stats from event
121  * @wmi_handle: wmi handle
122  * @evt_buf: pointer to event buffer
123  * @index: Index into vdev stats
124  * @vdev_stats: Pointer to hold vdev stats
125  *
126  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
127  */
128 QDF_STATUS
129 wmi_extract_vdev_stats(wmi_unified_t wmi_handle, void *evt_buf,
130 		       uint32_t index, wmi_host_vdev_stats *vdev_stats);
131 
132 /**
133  * wmi_extract_peer_stats() - extract peer stats from event
134  * @wmi_handle: wmi handle
135  * @evt_buf: pointer to event buffer
136  * @index: Index into peer stats
137  * @peer_stats: Pointer to hold peer stats
138  *
139  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
140  */
141 QDF_STATUS
142 wmi_extract_peer_stats(wmi_unified_t wmi_handle, void *evt_buf,
143 		       uint32_t index, wmi_host_peer_stats *peer_stats);
144 
145 /**
146  * wmi_extract_peer_extd_stats() - extract extended peer stats from event
147  * @wmi_handle: wmi handle
148  * @evt_buf: pointer to event buffer
149  * @index: Index into extended peer stats
150  * @peer_extd_stats: Pointer to hold extended peer stats
151  *
152  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
153  */
154 QDF_STATUS
155 wmi_extract_peer_extd_stats(wmi_unified_t wmi_handle, void *evt_buf,
156 			    uint32_t index,
157 			    wmi_host_peer_extd_stats *peer_extd_stats);
158 
159 #ifdef WLAN_FEATURE_SON
160 /**
161  * wmi_extract_inst_rssi_stats_resp() - extract inst rssi stats from event
162  * @wmi_handle: wmi handle
163  * @evt_buf: pointer to event buffer
164  * @inst_rssi_resp: pointer to hold inst rssi stats
165  *
166  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
167  */
168 QDF_STATUS
169 wmi_extract_inst_rssi_stats_resp(wmi_unified_t wmi_handle, void *evt_buf,
170 			struct wmi_host_inst_rssi_stats_resp *inst_rssi_resp);
171 #endif
172 #endif /* _WMI_UNIFIED_CP_STATS_API_H_ */
173