1*5113495bSYour Name /*
2*5113495bSYour Name * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
3*5113495bSYour Name * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name *
5*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for any
6*5113495bSYour Name * purpose with or without fee is hereby granted, provided that the above
7*5113495bSYour Name * copyright notice and this permission notice appear in all copies.
8*5113495bSYour Name *
9*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*5113495bSYour Name * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*5113495bSYour Name * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*5113495bSYour Name * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*5113495bSYour Name * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*5113495bSYour Name * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*5113495bSYour Name * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*5113495bSYour Name */
17*5113495bSYour Name /**
18*5113495bSYour Name * DOC: Implement API's specific to cp stats component.
19*5113495bSYour Name */
20*5113495bSYour Name
21*5113495bSYour Name #include "wmi_unified_priv.h"
22*5113495bSYour Name #include "wmi_unified_param.h"
23*5113495bSYour Name #include "wmi_unified_mc_cp_stats_api.h"
24*5113495bSYour Name
25*5113495bSYour Name QDF_STATUS
wmi_extract_per_chain_rssi_stats(wmi_unified_t wmi_handle,void * evt_buf,uint32_t index,struct wmi_host_per_chain_rssi_stats * rssi_stats)26*5113495bSYour Name wmi_extract_per_chain_rssi_stats(wmi_unified_t wmi_handle, void *evt_buf,
27*5113495bSYour Name uint32_t index,
28*5113495bSYour Name struct wmi_host_per_chain_rssi_stats *rssi_stats)
29*5113495bSYour Name {
30*5113495bSYour Name if (wmi_handle->ops->extract_per_chain_rssi_stats)
31*5113495bSYour Name return wmi_handle->ops->extract_per_chain_rssi_stats(wmi_handle,
32*5113495bSYour Name evt_buf, index, rssi_stats);
33*5113495bSYour Name
34*5113495bSYour Name return QDF_STATUS_E_FAILURE;
35*5113495bSYour Name }
36*5113495bSYour Name
37*5113495bSYour Name QDF_STATUS
wmi_extract_peer_adv_stats(wmi_unified_t wmi_handle,void * evt_buf,struct wmi_host_peer_adv_stats * peer_adv_stats)38*5113495bSYour Name wmi_extract_peer_adv_stats(wmi_unified_t wmi_handle, void *evt_buf,
39*5113495bSYour Name struct wmi_host_peer_adv_stats *peer_adv_stats)
40*5113495bSYour Name {
41*5113495bSYour Name if (wmi_handle->ops->extract_peer_adv_stats)
42*5113495bSYour Name return wmi_handle->ops->extract_peer_adv_stats(wmi_handle,
43*5113495bSYour Name evt_buf, peer_adv_stats);
44*5113495bSYour Name
45*5113495bSYour Name return QDF_STATUS_E_FAILURE;
46*5113495bSYour Name }
47*5113495bSYour Name
48*5113495bSYour Name #ifdef WLAN_FEATURE_MIB_STATS
wmi_extract_mib_stats(wmi_unified_t wmi_handle,void * evt_buf,struct mib_stats_metrics * mib_stats)49*5113495bSYour Name QDF_STATUS wmi_extract_mib_stats(wmi_unified_t wmi_handle, void *evt_buf,
50*5113495bSYour Name struct mib_stats_metrics *mib_stats)
51*5113495bSYour Name {
52*5113495bSYour Name if (wmi_handle->ops->extract_mib_stats)
53*5113495bSYour Name return wmi_handle->ops->extract_mib_stats(wmi_handle,
54*5113495bSYour Name evt_buf,
55*5113495bSYour Name mib_stats);
56*5113495bSYour Name
57*5113495bSYour Name return QDF_STATUS_E_FAILURE;
58*5113495bSYour Name }
59*5113495bSYour Name #endif
60*5113495bSYour Name
61*5113495bSYour Name QDF_STATUS
wmi_unified_peer_stats_request_send(wmi_unified_t wmi_handle,struct peer_stats_request_params * param)62*5113495bSYour Name wmi_unified_peer_stats_request_send(wmi_unified_t wmi_handle,
63*5113495bSYour Name struct peer_stats_request_params *param)
64*5113495bSYour Name {
65*5113495bSYour Name if (wmi_handle->ops->send_request_peer_stats_info_cmd)
66*5113495bSYour Name return wmi_handle->ops->send_request_peer_stats_info_cmd(
67*5113495bSYour Name wmi_handle, param);
68*5113495bSYour Name
69*5113495bSYour Name return QDF_STATUS_E_FAILURE;
70*5113495bSYour Name }
71*5113495bSYour Name
72*5113495bSYour Name QDF_STATUS
wmi_extract_peer_stats_param(wmi_unified_t wmi_handle,void * evt_buf,wmi_host_stats_event * stats_param)73*5113495bSYour Name wmi_extract_peer_stats_param(wmi_unified_t wmi_handle, void *evt_buf,
74*5113495bSYour Name wmi_host_stats_event *stats_param)
75*5113495bSYour Name {
76*5113495bSYour Name if (wmi_handle->ops->extract_peer_stats_count)
77*5113495bSYour Name return wmi_handle->ops->extract_peer_stats_count(wmi_handle,
78*5113495bSYour Name evt_buf, stats_param);
79*5113495bSYour Name
80*5113495bSYour Name return QDF_STATUS_E_FAILURE;
81*5113495bSYour Name }
82*5113495bSYour Name
83*5113495bSYour Name QDF_STATUS
wmi_extract_peer_tx_pkt_per_mcs(wmi_unified_t wmi_handle,void * evt_buf,uint32_t index,wmi_host_peer_stats_info * peer_stats_info)84*5113495bSYour Name wmi_extract_peer_tx_pkt_per_mcs(wmi_unified_t wmi_handle, void *evt_buf,
85*5113495bSYour Name uint32_t index,
86*5113495bSYour Name wmi_host_peer_stats_info *peer_stats_info)
87*5113495bSYour Name {
88*5113495bSYour Name if (wmi_handle->ops->extract_peer_tx_pkt_per_mcs)
89*5113495bSYour Name return wmi_handle->ops->extract_peer_tx_pkt_per_mcs(wmi_handle,
90*5113495bSYour Name evt_buf, index, peer_stats_info);
91*5113495bSYour Name
92*5113495bSYour Name return QDF_STATUS_E_FAILURE;
93*5113495bSYour Name }
94*5113495bSYour Name
95*5113495bSYour Name QDF_STATUS
wmi_extract_peer_rx_pkt_per_mcs(wmi_unified_t wmi_handle,void * evt_buf,uint32_t index,wmi_host_peer_stats_info * peer_stats_info)96*5113495bSYour Name wmi_extract_peer_rx_pkt_per_mcs(wmi_unified_t wmi_handle, void *evt_buf,
97*5113495bSYour Name uint32_t index,
98*5113495bSYour Name wmi_host_peer_stats_info *peer_stats_info)
99*5113495bSYour Name {
100*5113495bSYour Name if (wmi_handle->ops->extract_peer_rx_pkt_per_mcs)
101*5113495bSYour Name return wmi_handle->ops->extract_peer_rx_pkt_per_mcs(wmi_handle,
102*5113495bSYour Name evt_buf, index, peer_stats_info);
103*5113495bSYour Name
104*5113495bSYour Name return QDF_STATUS_E_FAILURE;
105*5113495bSYour Name }
106*5113495bSYour Name
107*5113495bSYour Name QDF_STATUS
wmi_extract_peer_stats_info(wmi_unified_t wmi_handle,void * evt_buf,uint32_t index,wmi_host_peer_stats_info * peer_stats_info)108*5113495bSYour Name wmi_extract_peer_stats_info(wmi_unified_t wmi_handle, void *evt_buf,
109*5113495bSYour Name uint32_t index,
110*5113495bSYour Name wmi_host_peer_stats_info *peer_stats_info)
111*5113495bSYour Name {
112*5113495bSYour Name if (wmi_handle->ops->extract_peer_stats_info)
113*5113495bSYour Name return wmi_handle->ops->extract_peer_stats_info(wmi_handle,
114*5113495bSYour Name evt_buf, index, peer_stats_info);
115*5113495bSYour Name
116*5113495bSYour Name return QDF_STATUS_E_FAILURE;
117*5113495bSYour Name }
118*5113495bSYour Name
119*5113495bSYour Name #ifdef WLAN_FEATURE_BIG_DATA_STATS
120*5113495bSYour Name QDF_STATUS
wmi_extract_big_data_stats_param(wmi_unified_t wmi_handle,void * evt_buf,struct big_data_stats_event * stats_param)121*5113495bSYour Name wmi_extract_big_data_stats_param(wmi_unified_t wmi_handle, void *evt_buf,
122*5113495bSYour Name struct big_data_stats_event *stats_param)
123*5113495bSYour Name {
124*5113495bSYour Name if (wmi_handle->ops->extract_big_data_stats)
125*5113495bSYour Name return wmi_handle->ops->extract_big_data_stats(wmi_handle,
126*5113495bSYour Name evt_buf, stats_param);
127*5113495bSYour Name
128*5113495bSYour Name return QDF_STATUS_E_FAILURE;
129*5113495bSYour Name }
130*5113495bSYour Name #endif
131