cdp_txrx_stats.h 1.8 KB

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