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