cdp_txrx_stats.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2016-2017,2019,2021 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. * DOC: cdp_txrx_stats.h
  21. * Define the host data path statistics API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_STATS_H_
  25. #define _CDP_TXRX_STATS_H_
  26. #include <cdp_txrx_ops.h>
  27. #include <cdp_txrx_cmn.h>
  28. static inline QDF_STATUS
  29. cdp_clear_stats(ol_txrx_soc_handle soc, uint8_t pdev_id, uint8_t bitmap)
  30. {
  31. if (!soc || !soc->ops) {
  32. dp_cdp_debug("Invalid Instance");
  33. QDF_BUG(0);
  34. return QDF_STATUS_E_INVAL;
  35. }
  36. if (!soc->ops->mob_stats_ops ||
  37. !soc->ops->mob_stats_ops->clear_stats)
  38. return QDF_STATUS_E_INVAL;
  39. return soc->ops->mob_stats_ops->clear_stats(soc, pdev_id, bitmap);
  40. }
  41. static inline int
  42. cdp_stats(ol_txrx_soc_handle soc, uint8_t vdev_id, char *buffer,
  43. unsigned int buf_len)
  44. {
  45. if (!soc || !soc->ops) {
  46. dp_cdp_debug("Invalid Instance");
  47. QDF_BUG(0);
  48. return 0;
  49. }
  50. if (!soc->ops->mob_stats_ops ||
  51. !soc->ops->mob_stats_ops->stats)
  52. return 0;
  53. return soc->ops->mob_stats_ops->stats(vdev_id, buffer, buf_len);
  54. }
  55. #endif /* _CDP_TXRX_STATS_H_ */