wmi_unified_ocb_api.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * Copyright (c) 2013-2018 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: Implement API's specific to OCB component.
  21. */
  22. #ifndef _WMI_UNIFIED_DSRC_API_H_
  23. #define _WMI_UNIFIED_DSRC_API_H_
  24. #include <wlan_ocb_public_structs.h>
  25. /**
  26. * wmi_unified_ocb_start_timing_advert() - start sending the timing
  27. * advertisement frames on a channel
  28. * @wmi_handle: pointer to the wmi handle
  29. * @timing_advert: pointer to the timing advertisement struct
  30. *
  31. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  32. */
  33. QDF_STATUS wmi_unified_ocb_start_timing_advert(struct wmi_unified *wmi_handle,
  34. struct ocb_timing_advert_param *timing_advert);
  35. /**
  36. * wmi_unified_ocb_stop_timing_advert() - stop sending the timing
  37. * advertisement frames on a channel
  38. * @wmi_handle: pointer to the wmi handle
  39. * @timing_advert: pointer to the timing advertisement struct
  40. *
  41. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  42. */
  43. QDF_STATUS wmi_unified_ocb_stop_timing_advert(struct wmi_unified *wmi_handle,
  44. struct ocb_timing_advert_param *timing_advert);
  45. /**
  46. * wmi_unified_ocb_set_config() - send the OCB config to the FW
  47. * @wmi_handle: pointer to the wmi handle
  48. * @config: the OCB configuration
  49. *
  50. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
  51. */
  52. QDF_STATUS wmi_unified_ocb_set_config(struct wmi_unified *wmi_handle,
  53. struct ocb_config *config);
  54. /**
  55. * wmi_unified_ocb_get_tsf_timer() - get ocb tsf timer val
  56. * @wmi_handle: pointer to the wmi handle
  57. * @req: request for tsf timer
  58. *
  59. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  60. */
  61. QDF_STATUS wmi_unified_ocb_get_tsf_timer(struct wmi_unified *wmi_handle,
  62. struct ocb_get_tsf_timer_param *req);
  63. /**
  64. * wmi_unified_ocb_set_utc_time_cmd() - set OCB UTC time
  65. * @wmi_handle: pointer to the wmi handle
  66. * @utc: UTC time
  67. *
  68. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  69. */
  70. QDF_STATUS wmi_unified_ocb_set_utc_time_cmd(struct wmi_unified *wmi_handle,
  71. struct ocb_utc_param *utc);
  72. /**
  73. * wmi_unified_dcc_get_stats_cmd() - get the DCC channel stats
  74. * @wmi_handle: pointer to the wmi handle
  75. * @get_stats_param: pointer to the dcc stats
  76. *
  77. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  78. */
  79. QDF_STATUS wmi_unified_dcc_get_stats_cmd(struct wmi_unified *wmi_handle,
  80. struct ocb_dcc_get_stats_param *get_stats_param);
  81. /**
  82. * wmi_unified_dcc_clear_stats() - command to clear the DCC stats
  83. * @wmi_handle: pointer to the wmi handle
  84. * @clear_stats_param: parameters to the command
  85. *
  86. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  87. */
  88. QDF_STATUS wmi_unified_dcc_clear_stats(struct wmi_unified *wmi_handle,
  89. struct ocb_dcc_clear_stats_param *clear_stats_param);
  90. /**
  91. * wmi_unified_dcc_update_ndl() - command to update the NDL data
  92. * @wmi_handle: pointer to the wmi handle
  93. * @update_ndl_param: pointer to the request parameters
  94. *
  95. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failures
  96. */
  97. QDF_STATUS wmi_unified_dcc_update_ndl(struct wmi_unified *wmi_handle,
  98. struct ocb_dcc_update_ndl_param *update_ndl_param);
  99. /**
  100. * wmi_extract_ocb_set_channel_config_resp() - extract status from wmi event
  101. * @wmi_handle: wmi handle
  102. * @evt_buf: pointer to event buffer
  103. * @status: status buffer
  104. *
  105. * Return: QDF_STATUS_SUCCESS on success
  106. */
  107. QDF_STATUS
  108. wmi_extract_ocb_set_channel_config_resp(struct wmi_unified *wmi_handle,
  109. void *evt_buf,
  110. uint32_t *status);
  111. /**
  112. * wmi_extract_ocb_tsf_timer() - extract tsf timer from wmi event
  113. * @wmi_handle: wmi handle
  114. * @evt_buf: pointer to event buffer
  115. * @resp: tsf timer
  116. *
  117. * Return: QDF_STATUS_SUCCESS on success
  118. */
  119. QDF_STATUS wmi_extract_ocb_tsf_timer(struct wmi_unified *wmi_handle,
  120. void *evt_buf,
  121. struct ocb_get_tsf_timer_response *resp);
  122. /**
  123. * wmi_extract_dcc_update_ndl_resp() - extract NDL update from wmi event
  124. * @wmi_handle: wmi handle
  125. * @evt_buf: pointer to event buffer
  126. * @resp: ndl update status
  127. *
  128. * Return: QDF_STATUS_SUCCESS on success
  129. */
  130. QDF_STATUS wmi_extract_dcc_update_ndl_resp(struct wmi_unified *wmi_handle,
  131. void *evt_buf, struct ocb_dcc_update_ndl_response *resp);
  132. /**
  133. * wmi_extract_dcc_stats() - extract DCC stats from wmi event
  134. * @wmi_handle: wmi handle
  135. * @evt_buf: pointer to event buffer
  136. * @response: DCC stats
  137. *
  138. * Since length of the response is variable, response buffer will be allocated.
  139. * The caller must free the response buffer.
  140. *
  141. * Return: QDF_STATUS_SUCCESS on success
  142. */
  143. QDF_STATUS wmi_extract_dcc_stats(struct wmi_unified *wmi_handle,
  144. void *evt_buf,
  145. struct ocb_dcc_get_stats_response **response);
  146. #endif /* _WMI_UNIFIED_DSRC_API_H_ */