wmi_unified_cp_stats_api.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: Implement API's specific to cp stats component.
  18. */
  19. #ifndef _WMI_UNIFIED_CP_STATS_API_H_
  20. #define _WMI_UNIFIED_CP_STATS_API_H_
  21. #ifdef QCA_SUPPORT_MC_CP_STATS
  22. #include <wmi_unified_mc_cp_stats_api.h>
  23. #endif
  24. #ifdef WLAN_SUPPORT_INFRA_CTRL_PATH_STATS
  25. /**
  26. * wmi_unified_infra_cp_stats_request_send() - WMI request infra_cp_stats
  27. * function
  28. * @wmi_handle: wmi handle
  29. * @param: pointer to hold infra_cp_stats request parameters
  30. *
  31. * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error
  32. * codes on failure
  33. */
  34. QDF_STATUS
  35. wmi_unified_infra_cp_stats_request_send(
  36. wmi_unified_t wmi_handle,
  37. struct infra_cp_stats_cmd_info *param);
  38. /**
  39. * wmi_unified_extract_infra_cp_stats() - extract various infra cp statistics
  40. * @wmi_handle: wmi handle
  41. * @evt_buf: event buffer
  42. * @evt_buf_len: length of event buffer
  43. * @params: pointer to store the extracted event info
  44. *
  45. * This function extracts the infra cp statistics from the event
  46. *
  47. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  48. */
  49. QDF_STATUS
  50. wmi_unified_extract_infra_cp_stats(wmi_unified_t wmi_handle,
  51. void *evt_buf, uint32_t evt_buf_len,
  52. struct infra_cp_stats_event *params);
  53. QDF_STATUS wmi_stats_handler(void *buff, int32_t len,
  54. struct infra_cp_stats_event *params);
  55. QDF_STATUS
  56. extract_infra_cp_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
  57. uint32_t evt_buf_len,
  58. struct infra_cp_stats_event *params);
  59. #endif /* WLAN_SUPPORT_INFRA_CTRL_PATH_STATS */
  60. /**
  61. * wmi_unified_stats_request_send() - WMI request stats function
  62. * @wmi_handle: handle to WMI
  63. * @macaddr: MAC address
  64. * @param: pointer to hold stats request parameter
  65. *
  66. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  67. */
  68. QDF_STATUS wmi_unified_stats_request_send(wmi_unified_t wmi_handle,
  69. uint8_t macaddr[QDF_MAC_ADDR_SIZE],
  70. struct stats_request_params *param);
  71. /**
  72. * wmi_extract_stats_param() - extract all stats count from event
  73. * @wmi_handle: wmi handle
  74. * @evt_buf: pointer to event buffer
  75. * @stats_param: Pointer to hold stats count
  76. *
  77. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  78. */
  79. QDF_STATUS
  80. wmi_extract_stats_param(wmi_unified_t wmi_handle, void *evt_buf,
  81. wmi_host_stats_event *stats_param);
  82. /**
  83. * wmi_extract_pdev_stats() - extract pdev stats from event
  84. * @wmi_handle: wmi handle
  85. * @evt_buf: pointer to event buffer
  86. * @index: Index into pdev stats
  87. * @pdev_stats: Pointer to hold pdev stats
  88. *
  89. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  90. */
  91. QDF_STATUS
  92. wmi_extract_pdev_stats(wmi_unified_t wmi_handle, void *evt_buf,
  93. uint32_t index, wmi_host_pdev_stats *pdev_stats);
  94. /**
  95. * wmi_extract_vdev_stats() - extract vdev stats from event
  96. * @wmi_handle: wmi handle
  97. * @evt_buf: pointer to event buffer
  98. * @index: Index into vdev stats
  99. * @vdev_stats: Pointer to hold vdev stats
  100. *
  101. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  102. */
  103. QDF_STATUS
  104. wmi_extract_vdev_stats(wmi_unified_t wmi_handle, void *evt_buf,
  105. uint32_t index, wmi_host_vdev_stats *vdev_stats);
  106. /**
  107. * wmi_extract_peer_stats() - extract peer stats from event
  108. * @wmi_handle: wmi handle
  109. * @evt_buf: pointer to event buffer
  110. * @index: Index into peer stats
  111. * @peer_stats: Pointer to hold peer stats
  112. *
  113. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  114. */
  115. QDF_STATUS
  116. wmi_extract_peer_stats(wmi_unified_t wmi_handle, void *evt_buf,
  117. uint32_t index, wmi_host_peer_stats *peer_stats);
  118. /**
  119. * wmi_extract_peer_extd_stats() - extract extended peer stats from event
  120. * @wmi_handle: wmi handle
  121. * @evt_buf: pointer to event buffer
  122. * @index: Index into extended peer stats
  123. * @peer_extd_stats: Pointer to hold extended peer stats
  124. *
  125. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  126. */
  127. QDF_STATUS
  128. wmi_extract_peer_extd_stats(wmi_unified_t wmi_handle, void *evt_buf,
  129. uint32_t index,
  130. wmi_host_peer_extd_stats *peer_extd_stats);
  131. #endif /* _WMI_UNIFIED_CP_STATS_API_H_ */