wmi_unified_nan_api.h 6.2 KB

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