xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_host_stats.h (revision 8ddef7dd9a290d4a9b1efd5d3efacf51d78a1a0d)
1 /*
2  * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * @file cdp_txrx_host_stats.h
21  * @brief Define the host data path stats API functions
22  * called by the host control SW and the OS interface module
23  */
24 #ifndef _CDP_TXRX_HOST_STATS_H_
25 #define _CDP_TXRX_HOST_STATS_H_
26 #include "cdp_txrx_handle.h"
27 /**
28  * cdp_host_stats_get: cdp call to get host stats
29  * @soc: SOC handle
30  * @req: Requirement type
31  *
32  * return: 0 for Success, Failure returns error message
33  */
34 static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
35 		struct cdp_vdev *vdev,
36 		struct ol_txrx_stats_req *req)
37 {
38 	if (!soc || !soc->ops) {
39 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
40 				"%s: Invalid Instance", __func__);
41 		QDF_BUG(0);
42 		return 0;
43 	}
44 
45 	if (!soc->ops->host_stats_ops ||
46 	    !soc->ops->host_stats_ops->txrx_host_stats_get)
47 		return 0;
48 
49 	return soc->ops->host_stats_ops->txrx_host_stats_get(vdev, req);
50 }
51 
52 /**
53  * cdp_host_stats_get_ratekbps: cdp call to get rate in kbps
54  * @soc: SOC handle
55  * @preamb: Preamble
56  * @mcs: Modulation and Coding scheme index
57  * @htflag: Flag to identify HT or VHT
58  * @gintval: Gaurd Interval value
59  *
60  * return: 0 for Failure, Returns rate on Success
61  */
62 static inline int cdp_host_stats_get_ratekbps(ol_txrx_soc_handle soc,
63 					      int preamb, int mcs,
64 					      int htflag, int gintval)
65 {
66 	if (!soc || !soc->ops) {
67 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
68 			  "%s: Invalid Instance", __func__);
69 		QDF_BUG(0);
70 		return 0;
71 	}
72 
73 	if (!soc->ops->host_stats_ops ||
74 	    !soc->ops->host_stats_ops->txrx_get_ratekbps)
75 		return 0;
76 
77 	return soc->ops->host_stats_ops->txrx_get_ratekbps(preamb,
78 							   mcs, htflag,
79 							   gintval);
80 }
81 
82 /**
83  * cdp_host_stats_clr: cdp call to clear host stats
84  * @vdev: vdev handle
85  *
86  * return: void
87  */
88 static inline void
89 cdp_host_stats_clr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
90 {
91 	if (!soc || !soc->ops) {
92 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
93 				"%s: Invalid Instance", __func__);
94 		QDF_BUG(0);
95 		return;
96 	}
97 
98 	if (!soc->ops->host_stats_ops ||
99 	    !soc->ops->host_stats_ops->txrx_host_stats_clr)
100 		return;
101 
102 	soc->ops->host_stats_ops->txrx_host_stats_clr(vdev);
103 }
104 
105 static inline void
106 cdp_host_ce_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
107 {
108 	if (!soc || !soc->ops) {
109 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
110 				"%s: Invalid Instance", __func__);
111 		QDF_BUG(0);
112 		return;
113 	}
114 
115 	if (!soc->ops->host_stats_ops ||
116 	    !soc->ops->host_stats_ops->txrx_host_ce_stats)
117 		return;
118 
119 	soc->ops->host_stats_ops->txrx_host_ce_stats(vdev);
120 }
121 
122 static inline int cdp_stats_publish
123 	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
124 	struct ol_txrx_stats *buf)
125 {
126 	if (!soc || !soc->ops) {
127 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
128 				"%s: Invalid Instance", __func__);
129 		QDF_BUG(0);
130 		return 0;
131 	}
132 
133 	if (!soc->ops->host_stats_ops ||
134 	    !soc->ops->host_stats_ops->txrx_stats_publish)
135 		return 0;
136 
137 	return soc->ops->host_stats_ops->txrx_stats_publish(pdev, buf);
138 }
139 
140 /**
141  * @brief Enable enhanced stats functionality.
142  *
143  * @param pdev - the physical device object
144  * @return - void
145  */
146 static inline void
147 cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
148 {
149 	if (!soc || !soc->ops) {
150 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
151 				"%s: Invalid Instance", __func__);
152 		QDF_BUG(0);
153 		return;
154 	}
155 
156 	if (!soc->ops->host_stats_ops ||
157 	    !soc->ops->host_stats_ops->txrx_enable_enhanced_stats)
158 		return;
159 
160 	soc->ops->host_stats_ops->txrx_enable_enhanced_stats
161 			(pdev);
162 }
163 
164 /**
165  * @brief Disable enhanced stats functionality.
166  *
167  * @param pdev - the physical device object
168  * @return - void
169  */
170 static inline void
171 cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
172 {
173 	if (!soc || !soc->ops) {
174 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
175 				"%s: Invalid Instance", __func__);
176 		QDF_BUG(0);
177 		return;
178 	}
179 
180 	if (!soc->ops->host_stats_ops ||
181 	    !soc->ops->host_stats_ops->txrx_disable_enhanced_stats)
182 		return;
183 
184 	soc->ops->host_stats_ops->txrx_disable_enhanced_stats
185 			(pdev);
186 }
187 
188 /**
189  * @brief Get the desired stats from the message.
190  *
191  * @param pdev - the physical device object
192  * @param stats_base - stats buffer received from FW
193  * @param type - stats type.
194  * @return - pointer to requested stat identified by type
195  */
196 static inline uint32_t *cdp_get_stats_base
197 	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
198 	uint32_t *stats_base, uint32_t msg_len, uint8_t type)
199 {
200 	if (!soc || !soc->ops) {
201 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
202 				"%s: Invalid Instance", __func__);
203 		QDF_BUG(0);
204 		return 0;
205 	}
206 
207 	if (!soc->ops->host_stats_ops ||
208 	    !soc->ops->host_stats_ops->txrx_get_stats_base)
209 		return 0;
210 
211 	return (uint32_t *)soc->ops->host_stats_ops->txrx_get_stats_base
212 			(pdev, stats_base, msg_len, type);
213 }
214 
215 static inline void
216 cdp_tx_print_tso_stats(ol_txrx_soc_handle soc,
217 	struct cdp_vdev *vdev)
218 {
219 	if (!soc || !soc->ops) {
220 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
221 				"%s: Invalid Instance", __func__);
222 		QDF_BUG(0);
223 		return;
224 	}
225 
226 	if (!soc->ops->host_stats_ops ||
227 	    !soc->ops->host_stats_ops->tx_print_tso_stats)
228 		return;
229 
230 	soc->ops->host_stats_ops->tx_print_tso_stats(vdev);
231 }
232 
233 static inline void
234 cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
235 {
236 	if (!soc || !soc->ops) {
237 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
238 				"%s: Invalid Instance", __func__);
239 		QDF_BUG(0);
240 		return;
241 	}
242 
243 	if (!soc->ops->host_stats_ops ||
244 	    !soc->ops->host_stats_ops->tx_rst_tso_stats)
245 		return;
246 
247 	soc->ops->host_stats_ops->tx_rst_tso_stats(vdev);
248 }
249 
250 static inline void
251 cdp_tx_print_sg_stats(ol_txrx_soc_handle soc,
252 	struct cdp_vdev *vdev)
253 {
254 	if (!soc || !soc->ops) {
255 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
256 				"%s: Invalid Instance", __func__);
257 		QDF_BUG(0);
258 		return;
259 	}
260 
261 	if (!soc->ops->host_stats_ops ||
262 	    !soc->ops->host_stats_ops->tx_print_sg_stats)
263 		return;
264 
265 	soc->ops->host_stats_ops->tx_print_sg_stats(vdev);
266 }
267 
268 static inline void
269 cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
270 {
271 	if (!soc || !soc->ops) {
272 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
273 				"%s: Invalid Instance", __func__);
274 		QDF_BUG(0);
275 		return;
276 	}
277 
278 	if (!soc->ops->host_stats_ops ||
279 	    !soc->ops->host_stats_ops->tx_rst_sg_stats)
280 		return;
281 
282 	soc->ops->host_stats_ops->tx_rst_sg_stats(vdev);
283 }
284 
285 static inline void
286 cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc,
287 	struct cdp_vdev *vdev)
288 {
289 	if (!soc || !soc->ops) {
290 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
291 				"%s: Invalid Instance", __func__);
292 		QDF_BUG(0);
293 		return;
294 	}
295 
296 	if (!soc->ops->host_stats_ops ||
297 	    !soc->ops->host_stats_ops->print_rx_cksum_stats)
298 		return;
299 
300 	soc->ops->host_stats_ops->print_rx_cksum_stats(vdev);
301 }
302 
303 static inline void
304 cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
305 {
306 	if (!soc || !soc->ops) {
307 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
308 				"%s: Invalid Instance", __func__);
309 		QDF_BUG(0);
310 		return;
311 	}
312 
313 	if (!soc->ops->host_stats_ops ||
314 	    !soc->ops->host_stats_ops->rst_rx_cksum_stats)
315 		return;
316 
317 	soc->ops->host_stats_ops->rst_rx_cksum_stats(vdev);
318 }
319 
320 static inline A_STATUS
321 cdp_host_me_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
322 {
323 	if (!soc || !soc->ops) {
324 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
325 				"%s: Invalid Instance", __func__);
326 		QDF_BUG(0);
327 		return 0;
328 	}
329 
330 	if (!soc->ops->host_stats_ops ||
331 	    !soc->ops->host_stats_ops->txrx_host_me_stats)
332 		return 0;
333 
334 	return soc->ops->host_stats_ops->txrx_host_me_stats(vdev);
335 }
336 
337 /**
338  * cdp_per_peer_stats(): function to print per peer REO Queue stats
339  * @soc: soc handle
340  * @pdev: physical device
341  * @addr: peer address
342  *
343  * return: status
344  */
345 static inline void cdp_per_peer_stats(ol_txrx_soc_handle soc,
346 				      struct cdp_pdev *pdev, char *addr)
347 {
348 	if (!soc || !soc->ops) {
349 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
350 			  "%s: Invalid Instance", __func__);
351 		QDF_BUG(0);
352 		return;
353 	}
354 
355 	if (!soc->ops->host_stats_ops ||
356 	    !soc->ops->host_stats_ops->txrx_per_peer_stats)
357 		return;
358 
359 	soc->ops->host_stats_ops->txrx_per_peer_stats(pdev, addr);
360 }
361 
362 static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
363 	struct cdp_vdev *vdev,
364 	struct ol_txrx_stats_req *req)
365 {
366 	if (!soc || !soc->ops) {
367 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
368 				"%s: Invalid Instance", __func__);
369 		QDF_BUG(0);
370 		return 0;
371 	}
372 
373 	if (!soc->ops->host_stats_ops ||
374 	    !soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats)
375 		return 0;
376 
377 	return soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats
378 			(vdev, req);
379 }
380 
381 static inline void
382 cdp_print_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
383 {
384 	if (!soc || !soc->ops) {
385 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
386 				"%s: Invalid Instance", __func__);
387 		QDF_BUG(0);
388 		return;
389 	}
390 
391 	if (!soc->ops->host_stats_ops ||
392 	    !soc->ops->host_stats_ops->print_lro_stats)
393 		return;
394 
395 	soc->ops->host_stats_ops->print_lro_stats(vdev);
396 }
397 
398 static inline void
399 cdp_reset_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
400 {
401 	if (!soc || !soc->ops) {
402 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
403 				"%s: Invalid Instance", __func__);
404 		QDF_BUG(0);
405 		return;
406 	}
407 
408 	if (!soc->ops->host_stats_ops ||
409 	    !soc->ops->host_stats_ops->reset_lro_stats)
410 		return;
411 
412 	soc->ops->host_stats_ops->reset_lro_stats(vdev);
413 }
414 
415 static inline void cdp_get_dp_fw_peer_stats(ol_txrx_soc_handle soc,
416 		struct cdp_pdev *pdev, uint8_t *mac, uint32_t caps,
417 		uint32_t copy_stats)
418 {
419 	if (!soc || !soc->ops) {
420 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
421 				"%s: Invalid Instance", __func__);
422 		QDF_BUG(0);
423 		return;
424 	}
425 
426 	if (!soc->ops->host_stats_ops ||
427 	    !soc->ops->host_stats_ops->get_fw_peer_stats)
428 		return;
429 
430 	soc->ops->host_stats_ops->get_fw_peer_stats
431 			(pdev, mac, caps, copy_stats);
432 }
433 
434 static inline void cdp_get_dp_htt_stats(ol_txrx_soc_handle soc,
435 					struct cdp_pdev *pdev,
436 					void *data, uint32_t data_len)
437 {
438 	if (soc && soc->ops && soc->ops->host_stats_ops &&
439 		soc->ops->host_stats_ops->get_htt_stats)
440 		return soc->ops->host_stats_ops->get_htt_stats
441 			(pdev, data, data_len);
442 	return;
443 }
444 
445 /**
446  * @brief Update pdev host stats received from firmware
447  * (wmi_host_pdev_stats and wmi_host_pdev_ext_stats) into dp
448  *
449  * @param pdev - the physical device object
450  * @param data - pdev stats
451  * @return - void
452  */
453 static inline void
454 cdp_update_pdev_host_stats(ol_txrx_soc_handle soc,
455 			   struct cdp_pdev *pdev,
456 			   void *data,
457 			   uint16_t stats_id)
458 {
459 	if (soc && soc->ops && soc->ops->host_stats_ops &&
460 	    soc->ops->host_stats_ops->txrx_update_pdev_stats)
461 		return soc->ops->host_stats_ops->txrx_update_pdev_stats
462 			(pdev, data, stats_id);
463 }
464 
465 /**
466  * @brief Call to get peer stats
467  *
468  * @param peer - dp peer object
469  * @return - struct cdp_peer_stats
470  */
471 static inline struct cdp_peer_stats *
472 cdp_host_get_peer_stats(ol_txrx_soc_handle soc, struct cdp_peer *peer)
473 {
474 	if (!soc || !soc->ops) {
475 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
476 			  "%s: Invalid Instance", __func__);
477 		QDF_BUG(0);
478 		return NULL;
479 	}
480 
481 	if (!soc->ops->host_stats_ops ||
482 	    !soc->ops->host_stats_ops->txrx_get_peer_stats)
483 		return NULL;
484 
485 	return soc->ops->host_stats_ops->txrx_get_peer_stats(peer);
486 }
487 
488 /**
489  * @brief Call to reset ald stats
490  *
491  * @param peer - dp peer object
492  * @return - void
493  */
494 static inline void
495 cdp_host_reset_peer_ald_stats(ol_txrx_soc_handle soc,
496 			      struct cdp_peer *peer)
497 {
498 	if (!soc || !soc->ops) {
499 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
500 			  "%s: Invalid Instance", __func__);
501 		QDF_BUG(0);
502 		return;
503 	}
504 
505 	if (!soc->ops->host_stats_ops ||
506 	    !soc->ops->host_stats_ops->txrx_reset_peer_ald_stats)
507 		return;
508 
509 	return soc->ops->host_stats_ops->txrx_reset_peer_ald_stats(peer);
510 }
511 
512 /**
513  * @brief Call to reset peer stats
514  *
515  * @param peer - dp peer object
516  * @return - void
517  */
518 static inline void
519 cdp_host_reset_peer_stats(ol_txrx_soc_handle soc,
520 			  struct cdp_peer *peer)
521 {
522 	if (!soc || !soc->ops) {
523 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
524 			  "%s: Invalid Instance", __func__);
525 		QDF_BUG(0);
526 		return;
527 	}
528 
529 	if (!soc->ops->host_stats_ops ||
530 	    !soc->ops->host_stats_ops->txrx_reset_peer_stats)
531 		return;
532 
533 	return soc->ops->host_stats_ops->txrx_reset_peer_stats(peer);
534 }
535 
536 /**
537  * @brief Call to get vdev stats
538  *
539  * @param vdev - dp vdev object
540  * @param buf - buffer
541  * @return - int
542  */
543 static inline int
544 cdp_host_get_vdev_stats(ol_txrx_soc_handle soc,
545 			struct cdp_vdev *vdev,
546 			struct cdp_vdev_stats *buf,
547 			bool is_aggregate)
548 {
549 	if (!soc || !soc->ops) {
550 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
551 			  "%s: Invalid Instance", __func__);
552 		QDF_BUG(0);
553 		return 0;
554 	}
555 
556 	if (!soc->ops->host_stats_ops ||
557 	    !soc->ops->host_stats_ops->txrx_get_vdev_stats)
558 		return 0;
559 
560 	return soc->ops->host_stats_ops->txrx_get_vdev_stats(vdev,
561 							     buf,
562 							     is_aggregate);
563 }
564 
565 /**
566  * @brief Call to update vdev stats received from firmware
567  * (wmi_host_vdev_stats and wmi_host_vdev_extd_stats) into dp
568  *
569  * @param data - stats data to be updated
570  * @param size - size of stats data
571  * @param stats_id - stats id
572  * @return - int
573  */
574 static inline int
575 cdp_update_host_vdev_stats(ol_txrx_soc_handle soc,
576 			   void *data,
577 			   uint32_t size,
578 			   uint32_t stats_id)
579 {
580 	if (!soc || !soc->ops) {
581 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
582 			  "%s: Invalid Instance", __func__);
583 		QDF_BUG(0);
584 		return 0;
585 	}
586 
587 	if (!soc->ops->host_stats_ops ||
588 	    !soc->ops->host_stats_ops->txrx_process_wmi_host_vdev_stats)
589 		return 0;
590 
591 	return soc->ops->host_stats_ops->txrx_process_wmi_host_vdev_stats
592 								(soc,
593 								 data,
594 								 size,
595 								 stats_id);
596 }
597 
598 /**
599  * @brief Call to get vdev extd stats
600  *
601  * @param vdev - dp vdev object
602  * @param buf - buffer
603  * @return - int
604  */
605 static inline int
606 cdp_get_vdev_extd_stats(ol_txrx_soc_handle soc,
607 			struct cdp_vdev *vdev,
608 			void *buf)
609 {
610 	if (!soc || !soc->ops) {
611 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
612 			  "%s: Invalid Instance", __func__);
613 		QDF_BUG(0);
614 		return 0;
615 	}
616 
617 	if (!soc->ops->host_stats_ops ||
618 	    !soc->ops->host_stats_ops->txrx_get_vdev_extd_stats)
619 		return 0;
620 
621 	return soc->ops->host_stats_ops->txrx_get_vdev_extd_stats(vdev, buf);
622 }
623 
624 /**
625  * @brief Call to get cdp_pdev_stats
626  *
627  * @param pdev - dp pdev object
628  * @return - cdp_pdev_stats
629  */
630 static inline struct cdp_pdev_stats*
631 cdp_host_get_pdev_stats(ol_txrx_soc_handle soc,
632 			struct cdp_pdev *pdev)
633 {
634 	if (!soc || !soc->ops) {
635 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
636 			  "%s: Invalid Instance", __func__);
637 		QDF_BUG(0);
638 		return 0;
639 	}
640 
641 	if (!soc->ops->host_stats_ops ||
642 	    !soc->ops->host_stats_ops->txrx_get_pdev_stats)
643 		return 0;
644 
645 	return soc->ops->host_stats_ops->txrx_get_pdev_stats(pdev);
646 }
647 
648 /**
649  * @brief Call to get radio stats
650  *
651  * @param pdev - dp pdev object
652  * @param scn_stats_user - stats buffer
653  * @return - int
654  */
655 static inline int
656 cdp_host_get_radio_stats(ol_txrx_soc_handle soc,
657 			 struct cdp_pdev *pdev,
658 			 void *buf)
659 {
660 	if (!soc || !soc->ops) {
661 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
662 			  "%s: Invalid Instance", __func__);
663 		QDF_BUG(0);
664 		return 0;
665 	}
666 
667 	if (!soc->ops->host_stats_ops ||
668 	    !soc->ops->host_stats_ops->txrx_get_radio_stats)
669 		return 0;
670 
671 	return soc->ops->host_stats_ops->txrx_get_radio_stats(pdev,
672 							      buf);
673 }
674 
675 /**
676  * @brief Parse the stats header and get the payload from the message.
677  *
678  * @param pdev - the physical device object
679  * @param msg_word - stats buffer received from FW
680  * @param msg_len - length of the message
681  * @param type - place holder for parsed message type
682  * @param status - place holder for parsed message status
683  * @return - pointer to received stat payload
684  */
685 
686 #if defined(QCA_SUPPORT_SON) || defined(ENHANCED_STATS)
687 uint32_t *ol_txrx_get_en_stats_base(struct cdp_pdev *pdev, uint32_t *msg_word,
688     uint32_t msg_len, enum htt_cmn_t2h_en_stats_type *type,  enum htt_cmn_t2h_en_stats_status *status);
689 #endif
690 #endif /* _CDP_TXRX_HOST_STATS_H_ */
691