wmi_unified_nan_api.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * Copyright (c) 2013-2020 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 NAN component.
  21. */
  22. #ifndef _WMI_UNIFIED_NAN_API_H_
  23. #define _WMI_UNIFIED_NAN_API_H_
  24. #include <nan_public_structs.h>
  25. /**
  26. * wmi_unified_nan_req_cmd() - to send nan request to target
  27. * @wmi_handle: wmi handle
  28. * @nan_req: request data which will be non-null
  29. *
  30. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  31. */
  32. QDF_STATUS wmi_unified_nan_req_cmd(wmi_unified_t wmi_handle,
  33. struct nan_msg_params *nan_req);
  34. /**
  35. * wmi_unified_nan_disable_req_cmd() - to send nan disable request to target
  36. * @wmi_handle: wmi handle
  37. * @nan_req: pointer to NAN Disable request structure
  38. *
  39. * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
  40. */
  41. QDF_STATUS wmi_unified_nan_disable_req_cmd(wmi_unified_t wmi_handle,
  42. struct nan_disable_req *nan_req);
  43. /**
  44. * wmi_unified_ndp_initiator_req_cmd_send - api to send initiator request to FW
  45. * @wmi_handle: wmi handle
  46. * @req: pointer to request buffer
  47. *
  48. * Return: status of operation
  49. */
  50. QDF_STATUS
  51. wmi_unified_ndp_initiator_req_cmd_send(wmi_unified_t wmi_handle,
  52. struct nan_datapath_initiator_req *req);
  53. /**
  54. * wmi_unified_ndp_responder_req_cmd_send - api to send responder request to FW
  55. * @wmi_handle: wmi handle
  56. * @req: pointer to request buffer
  57. *
  58. * Return: status of operation
  59. */
  60. QDF_STATUS
  61. wmi_unified_ndp_responder_req_cmd_send(wmi_unified_t wmi_handle,
  62. struct nan_datapath_responder_req *req);
  63. /**
  64. * wmi_unified_ndp_end_req_cmd_send - api to send end request to FW
  65. * @wmi_handle: wmi handle
  66. * @req: pointer to request buffer
  67. *
  68. * Return: status of operation
  69. */
  70. QDF_STATUS wmi_unified_ndp_end_req_cmd_send(wmi_unified_t wmi_handle,
  71. struct nan_datapath_end_req *req);
  72. /**
  73. * wmi_unified_terminate_all_ndps_req_cmd - api to request Firmware for
  74. * termination of all NDP's associated with the given vdev id.
  75. * @wmi_handle: wmi handle
  76. * @vdev_id: vdev id
  77. *
  78. * Return: status of operation
  79. */
  80. QDF_STATUS wmi_unified_terminate_all_ndps_req_cmd(wmi_unified_t wmi_handle,
  81. uint32_t vdev_id);
  82. /**
  83. * wmi_extract_ndp_initiator_rsp - api to extract initiator rsp from even buffer
  84. * @wmi_handle: wmi handle
  85. * @data: event buffer
  86. * @rsp: buffer to populate
  87. *
  88. * Return: status of operation
  89. */
  90. QDF_STATUS
  91. wmi_extract_ndp_initiator_rsp(wmi_unified_t wmi_handle, uint8_t *data,
  92. struct nan_datapath_initiator_rsp *rsp);
  93. /**
  94. * wmi_extract_ndp_ind - api to extract ndp indication struct from even buffer
  95. * @wmi_handle: wmi handle
  96. * @data: event buffer
  97. * @ind: buffer to populate
  98. *
  99. * Return: status of operation
  100. */
  101. QDF_STATUS wmi_extract_ndp_ind(wmi_unified_t wmi_handle, uint8_t *data,
  102. struct nan_datapath_indication_event *ind);
  103. /**
  104. * wmi_extract_nan_msg - api to extract ndp dmesg buffer to print logs
  105. * @wmi_handle: wmi handle
  106. * @data: event buffer
  107. * @msg: buffer to populate
  108. *
  109. * Return: status of operation
  110. */
  111. QDF_STATUS wmi_extract_nan_msg(wmi_unified_t wmi_handle, uint8_t *data,
  112. struct nan_dump_msg *msg);
  113. /**
  114. * wmi_extract_ndp_confirm - api to extract ndp confim struct from even buffer
  115. * @wmi_handle: wmi handle
  116. * @data: event buffer
  117. * @ev: buffer to populate
  118. *
  119. * Return: status of operation
  120. */
  121. QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
  122. struct nan_datapath_confirm_event *ev);
  123. /**
  124. * wmi_extract_ndp_responder_rsp - api to extract responder rsp from even buffer
  125. * @wmi_handle: wmi handle
  126. * @data: event buffer
  127. * @rsp: buffer to populate
  128. *
  129. * Return: status of operation
  130. */
  131. QDF_STATUS
  132. wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle, uint8_t *data,
  133. struct nan_datapath_responder_rsp *rsp);
  134. /**
  135. * wmi_extract_ndp_end_rsp - api to extract ndp end rsp from even buffer
  136. * @wmi_handle: wmi handle
  137. * @data: event buffer
  138. * @rsp: buffer to populate
  139. *
  140. * Return: status of operation
  141. */
  142. QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
  143. struct nan_datapath_end_rsp_event *rsp);
  144. /**
  145. * wmi_extract_ndp_end_ind - api to extract ndp end indication from even buffer
  146. * @wmi_handle: wmi handle
  147. * @data: event buffer
  148. * @ind: buffer to populate
  149. *
  150. * Return: status of operation
  151. */
  152. QDF_STATUS
  153. wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
  154. struct nan_datapath_end_indication_event **ind);
  155. /**
  156. * wmi_extract_ndp_sch_update - api to extract ndp sch update from event buffer
  157. * @wmi_handle: wmi handle
  158. * @data: event buffer
  159. * @ind: buffer to populate
  160. *
  161. * Return: status of operation
  162. */
  163. QDF_STATUS
  164. wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
  165. struct nan_datapath_sch_update_event *ind);
  166. /**
  167. * wmi_extract_nan_event_rsp - api to extract nan event into event parameters
  168. * @wmi_handle: wmi handle
  169. * @evt_buf: pointer to the event buffer
  170. * @temp_evt_params: Pointer to a temporary parameters structure to populate
  171. * @nan_msg_buf: Pointer to the NAN Message buffer encapsulated in the event
  172. *
  173. * Return: status of operation
  174. */
  175. QDF_STATUS wmi_extract_nan_event_rsp(wmi_unified_t wmi_handle, void *evt_buf,
  176. struct nan_event_params *temp_evt_params,
  177. uint8_t **nan_msg_buf);
  178. /**
  179. * wmi_extract_ndp_host_event - api to extract ndp event from event buffer
  180. * @wmi_handle: wmi handle
  181. * @data: event buffer
  182. * @evt: event buffer to populate
  183. *
  184. * Return: status of operation
  185. */
  186. QDF_STATUS wmi_extract_ndp_host_event(wmi_unified_t wmi_handle, uint8_t *data,
  187. struct nan_datapath_host_event *evt);
  188. #endif /* _WMI_UNIFIED_NAN_API_H_ */