1*5113495bSYour Name /*
2*5113495bSYour Name * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
3*5113495bSYour Name *
4*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for
5*5113495bSYour Name * any purpose with or without fee is hereby granted, provided that the
6*5113495bSYour Name * above copyright notice and this permission notice appear in all
7*5113495bSYour Name * copies.
8*5113495bSYour Name *
9*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10*5113495bSYour Name * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11*5113495bSYour Name * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12*5113495bSYour Name * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13*5113495bSYour Name * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14*5113495bSYour Name * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15*5113495bSYour Name * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16*5113495bSYour Name * PERFORMANCE OF THIS SOFTWARE.
17*5113495bSYour Name */
18*5113495bSYour Name
19*5113495bSYour Name /**
20*5113495bSYour Name * DOC: qdf_net_stats_public API
21*5113495bSYour Name * This file defines the net dev stats abstraction.
22*5113495bSYour Name */
23*5113495bSYour Name
24*5113495bSYour Name #if !defined(__QDF_NET_STATS_H)
25*5113495bSYour Name #define __QDF_NET_STATS_H
26*5113495bSYour Name
27*5113495bSYour Name #include <qdf_types.h>
28*5113495bSYour Name #include <i_qdf_net_stats.h>
29*5113495bSYour Name #include <qdf_net_types.h>
30*5113495bSYour Name
31*5113495bSYour Name /**
32*5113495bSYour Name * qdf_net_stats_add_rx_pkts() - Add RX pkts in n/w stats
33*5113495bSYour Name * @stats: Network stats instance
34*5113495bSYour Name * @value: Value to be added
35*5113495bSYour Name *
36*5113495bSYour Name * Return: None.
37*5113495bSYour Name */
38*5113495bSYour Name static inline
qdf_net_stats_add_rx_pkts(qdf_net_dev_stats * stats,uint32_t value)39*5113495bSYour Name void qdf_net_stats_add_rx_pkts(qdf_net_dev_stats *stats, uint32_t value)
40*5113495bSYour Name {
41*5113495bSYour Name __qdf_net_stats_add_rx_pkts(stats, value);
42*5113495bSYour Name }
43*5113495bSYour Name
44*5113495bSYour Name /**
45*5113495bSYour Name * qdf_net_stats_get_rx_pkts() - Get RX pkts in net stats
46*5113495bSYour Name * @stats: Network stats instance
47*5113495bSYour Name *
48*5113495bSYour Name * Return: Rx packets received on N/W interface
49*5113495bSYour Name */
50*5113495bSYour Name static inline
qdf_net_stats_get_rx_pkts(qdf_net_dev_stats * stats)51*5113495bSYour Name unsigned long qdf_net_stats_get_rx_pkts(qdf_net_dev_stats *stats)
52*5113495bSYour Name {
53*5113495bSYour Name return __qdf_net_stats_get_rx_pkts(stats);
54*5113495bSYour Name }
55*5113495bSYour Name
56*5113495bSYour Name /**
57*5113495bSYour Name * qdf_net_stats_add_rx_bytes() - Add RX bytes in n/w stats
58*5113495bSYour Name * @stats: Network stats instance
59*5113495bSYour Name * @value: Value to be added
60*5113495bSYour Name *
61*5113495bSYour Name * Return: None.
62*5113495bSYour Name */
63*5113495bSYour Name static inline
qdf_net_stats_add_rx_bytes(qdf_net_dev_stats * stats,uint32_t value)64*5113495bSYour Name void qdf_net_stats_add_rx_bytes(qdf_net_dev_stats *stats, uint32_t value)
65*5113495bSYour Name {
66*5113495bSYour Name __qdf_net_stats_add_rx_bytes(stats, value);
67*5113495bSYour Name }
68*5113495bSYour Name
69*5113495bSYour Name /**
70*5113495bSYour Name * qdf_net_stats_get_rx_bytes() - Get RX bytes in net stats
71*5113495bSYour Name * @stats: Network stats instance
72*5113495bSYour Name *
73*5113495bSYour Name * Return: Rx bytes received on N/W interface
74*5113495bSYour Name */
75*5113495bSYour Name static inline
qdf_net_stats_get_rx_bytes(qdf_net_dev_stats * stats)76*5113495bSYour Name unsigned long qdf_net_stats_get_rx_bytes(qdf_net_dev_stats *stats)
77*5113495bSYour Name {
78*5113495bSYour Name return __qdf_net_stats_get_rx_bytes(stats);
79*5113495bSYour Name }
80*5113495bSYour Name
81*5113495bSYour Name /**
82*5113495bSYour Name * qdf_net_stats_inc_rx_errors() - inc RX errors n/w stats
83*5113495bSYour Name * @stats: Network stats instance
84*5113495bSYour Name *
85*5113495bSYour Name * Return: None.
86*5113495bSYour Name */
87*5113495bSYour Name static inline
qdf_net_stats_inc_rx_errors(qdf_net_dev_stats * stats)88*5113495bSYour Name void qdf_net_stats_inc_rx_errors(qdf_net_dev_stats *stats)
89*5113495bSYour Name {
90*5113495bSYour Name __qdf_net_stats_inc_rx_errors(stats);
91*5113495bSYour Name }
92*5113495bSYour Name
93*5113495bSYour Name /**
94*5113495bSYour Name * qdf_net_stats_get_rx_errors() - Get RX errors in net stats
95*5113495bSYour Name * @stats: Network stats instance
96*5113495bSYour Name *
97*5113495bSYour Name * Return: Rx packet errors on N/W interface
98*5113495bSYour Name */
99*5113495bSYour Name static inline
qdf_net_stats_get_rx_errors(qdf_net_dev_stats * stats)100*5113495bSYour Name unsigned long qdf_net_stats_get_rx_errors(qdf_net_dev_stats *stats)
101*5113495bSYour Name {
102*5113495bSYour Name return __qdf_net_stats_get_rx_errors(stats);
103*5113495bSYour Name }
104*5113495bSYour Name
105*5113495bSYour Name /**
106*5113495bSYour Name * qdf_net_stats_inc_rx_dropped() - inc RX dropped n/w stats
107*5113495bSYour Name * @stats: Network stats instance
108*5113495bSYour Name *
109*5113495bSYour Name * Return: None.
110*5113495bSYour Name */
111*5113495bSYour Name static inline
qdf_net_stats_inc_rx_dropped(qdf_net_dev_stats * stats)112*5113495bSYour Name void qdf_net_stats_inc_rx_dropped(qdf_net_dev_stats *stats)
113*5113495bSYour Name {
114*5113495bSYour Name __qdf_net_stats_inc_rx_dropped(stats);
115*5113495bSYour Name }
116*5113495bSYour Name
117*5113495bSYour Name /**
118*5113495bSYour Name * qdf_net_stats_get_rx_dropped() - Get RX dropped in net stats
119*5113495bSYour Name * @stats: Network stats instance
120*5113495bSYour Name *
121*5113495bSYour Name * Return: Rx packet dropped on N/W interface
122*5113495bSYour Name */
123*5113495bSYour Name static inline
qdf_net_stats_get_rx_dropped(qdf_net_dev_stats * stats)124*5113495bSYour Name unsigned long qdf_net_stats_get_rx_dropped(qdf_net_dev_stats *stats)
125*5113495bSYour Name {
126*5113495bSYour Name return __qdf_net_stats_get_rx_dropped(stats);
127*5113495bSYour Name }
128*5113495bSYour Name
129*5113495bSYour Name /**
130*5113495bSYour Name * qdf_net_stats_add_tx_pkts() - Add Tx packets in n/w stats
131*5113495bSYour Name * @stats: Network stats instance
132*5113495bSYour Name * @value: Value to be added
133*5113495bSYour Name *
134*5113495bSYour Name * Return: None.
135*5113495bSYour Name */
136*5113495bSYour Name static inline
qdf_net_stats_add_tx_pkts(qdf_net_dev_stats * stats,uint32_t value)137*5113495bSYour Name void qdf_net_stats_add_tx_pkts(qdf_net_dev_stats *stats, uint32_t value)
138*5113495bSYour Name {
139*5113495bSYour Name __qdf_net_stats_add_tx_pkts(stats, value);
140*5113495bSYour Name }
141*5113495bSYour Name
142*5113495bSYour Name /**
143*5113495bSYour Name * qdf_net_stats_get_tx_pkts() - Get Tx packets in net stats
144*5113495bSYour Name * @stats: Network stats instance
145*5113495bSYour Name *
146*5113495bSYour Name * Return: Tx packets transmitted on N/W interface
147*5113495bSYour Name */
148*5113495bSYour Name static inline
qdf_net_stats_get_tx_pkts(qdf_net_dev_stats * stats)149*5113495bSYour Name unsigned long qdf_net_stats_get_tx_pkts(qdf_net_dev_stats *stats)
150*5113495bSYour Name {
151*5113495bSYour Name return __qdf_net_stats_get_tx_pkts(stats);
152*5113495bSYour Name }
153*5113495bSYour Name
154*5113495bSYour Name /**
155*5113495bSYour Name * qdf_net_stats_add_tx_bytes() - Add Tx bytes in n/w stats
156*5113495bSYour Name * @stats: Network stats instance
157*5113495bSYour Name * @value: Value to be added
158*5113495bSYour Name *
159*5113495bSYour Name * Return: None.
160*5113495bSYour Name */
161*5113495bSYour Name static inline
qdf_net_stats_add_tx_bytes(qdf_net_dev_stats * stats,uint32_t value)162*5113495bSYour Name void qdf_net_stats_add_tx_bytes(qdf_net_dev_stats *stats, uint32_t value)
163*5113495bSYour Name {
164*5113495bSYour Name __qdf_net_stats_add_tx_bytes(stats, value);
165*5113495bSYour Name }
166*5113495bSYour Name
167*5113495bSYour Name /**
168*5113495bSYour Name * qdf_net_stats_get_tx_bytes() - Get Tx bytes in net stats
169*5113495bSYour Name * @stats: Network stats instance
170*5113495bSYour Name *
171*5113495bSYour Name * Return: Tx bytes transmitted on N/W interface
172*5113495bSYour Name */
173*5113495bSYour Name static inline
qdf_net_stats_get_tx_bytes(qdf_net_dev_stats * stats)174*5113495bSYour Name unsigned long qdf_net_stats_get_tx_bytes(qdf_net_dev_stats *stats)
175*5113495bSYour Name {
176*5113495bSYour Name return __qdf_net_stats_get_tx_bytes(stats);
177*5113495bSYour Name }
178*5113495bSYour Name
179*5113495bSYour Name /**
180*5113495bSYour Name * qdf_net_stats_inc_tx_errors() - inc Tx errors n/w stats
181*5113495bSYour Name * @stats: Network stats instance
182*5113495bSYour Name *
183*5113495bSYour Name * Return: None.
184*5113495bSYour Name */
185*5113495bSYour Name static inline
qdf_net_stats_inc_tx_errors(qdf_net_dev_stats * stats)186*5113495bSYour Name void qdf_net_stats_inc_tx_errors(qdf_net_dev_stats *stats)
187*5113495bSYour Name {
188*5113495bSYour Name __qdf_net_stats_inc_tx_errors(stats);
189*5113495bSYour Name }
190*5113495bSYour Name
191*5113495bSYour Name /**
192*5113495bSYour Name * qdf_net_stats_get_tx_errors() - Get Tx errors in net stats
193*5113495bSYour Name * @stats: Network stats instance
194*5113495bSYour Name *
195*5113495bSYour Name * Return: Tx errors on N/W interface
196*5113495bSYour Name */
197*5113495bSYour Name static inline
qdf_net_stats_get_tx_errors(qdf_net_dev_stats * stats)198*5113495bSYour Name unsigned long qdf_net_stats_get_tx_errors(qdf_net_dev_stats *stats)
199*5113495bSYour Name {
200*5113495bSYour Name return __qdf_net_stats_get_tx_errors(stats);
201*5113495bSYour Name }
202*5113495bSYour Name
203*5113495bSYour Name /**
204*5113495bSYour Name * qdf_net_stats_inc_tx_dropped() - inc Tx dropped n/w stats
205*5113495bSYour Name * @stats: Network stats instance
206*5113495bSYour Name *
207*5113495bSYour Name * Return: None.
208*5113495bSYour Name */
209*5113495bSYour Name static inline
qdf_net_stats_inc_tx_dropped(qdf_net_dev_stats * stats)210*5113495bSYour Name void qdf_net_stats_inc_tx_dropped(qdf_net_dev_stats *stats)
211*5113495bSYour Name {
212*5113495bSYour Name __qdf_net_stats_inc_tx_dropped(stats);
213*5113495bSYour Name }
214*5113495bSYour Name
215*5113495bSYour Name /**
216*5113495bSYour Name * qdf_net_stats_get_tx_dropped() - Get Tx dropped in net stats
217*5113495bSYour Name * @stats: Network stats instance
218*5113495bSYour Name *
219*5113495bSYour Name * Return: Tx dropped on N/W interface
220*5113495bSYour Name */
221*5113495bSYour Name static inline
qdf_net_stats_get_tx_dropped(qdf_net_dev_stats * stats)222*5113495bSYour Name unsigned long qdf_net_stats_get_tx_dropped(qdf_net_dev_stats *stats)
223*5113495bSYour Name {
224*5113495bSYour Name return __qdf_net_stats_get_tx_dropped(stats);
225*5113495bSYour Name }
226*5113495bSYour Name #endif /*__QDF_NET_STATS_H*/
227