1 2 /* 3 * Copyright (c) 2013-2019 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_unified_terminate_all_ndps_req_cmd - api to request Firmware for 82 * termination of all NDP's associated with the given vdev id. 83 * @wmi_handle: wmi handle 84 * @vdev_id: vdev id 85 * 86 * Return: status of operation 87 */ 88 QDF_STATUS wmi_unified_terminate_all_ndps_req_cmd(wmi_unified_t wmi_handle, 89 uint32_t vdev_id); 90 91 /** 92 * wmi_extract_ndp_initiator_rsp - api to extract initiator rsp from even buffer 93 * @wmi_hdl: wmi handle 94 * @data: event buffer 95 * @rsp: buffer to populate 96 * 97 * Return: status of operation 98 */ 99 QDF_STATUS 100 wmi_extract_ndp_initiator_rsp(wmi_unified_t wmi_handle, uint8_t *data, 101 struct nan_datapath_initiator_rsp *rsp); 102 103 /** 104 * wmi_extract_ndp_ind - api to extract ndp indication struct from even buffer 105 * @wmi_hdl: wmi handle 106 * @data: event buffer 107 * @ind: buffer to populate 108 * 109 * Return: status of operation 110 */ 111 QDF_STATUS wmi_extract_ndp_ind(wmi_unified_t wmi_handle, uint8_t *data, 112 struct nan_datapath_indication_event *ind); 113 114 /** 115 * wmi_extract_ndp_confirm - api to extract ndp confim struct from even buffer 116 * @wmi_hdl: wmi handle 117 * @data: event buffer 118 * @ev: buffer to populate 119 * 120 * Return: status of operation 121 */ 122 QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data, 123 struct nan_datapath_confirm_event *ev); 124 125 /** 126 * wmi_extract_ndp_responder_rsp - api to extract responder rsp from even buffer 127 * @wmi_hdl: wmi handle 128 * @data: event buffer 129 * @rsp: buffer to populate 130 * 131 * Return: status of operation 132 */ 133 QDF_STATUS 134 wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle, uint8_t *data, 135 struct nan_datapath_responder_rsp *rsp); 136 137 /** 138 * wmi_extract_ndp_end_rsp - api to extract ndp end rsp from even buffer 139 * @wmi_hdl: wmi handle 140 * @data: event buffer 141 * @rsp: buffer to populate 142 * 143 * Return: status of operation 144 */ 145 QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data, 146 struct nan_datapath_end_rsp_event *rsp); 147 148 /** 149 * wmi_extract_ndp_end_ind - api to extract ndp end indication from even buffer 150 * @wmi_hdl: wmi handle 151 * @data: event buffer 152 * @ind: buffer to populate 153 * 154 * Return: status of operation 155 */ 156 QDF_STATUS 157 wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data, 158 struct nan_datapath_end_indication_event **ind); 159 160 /** 161 * wmi_extract_ndp_sch_update - api to extract ndp sch update from event buffer 162 * @wmi_hdl: wmi handle 163 * @data: event buffer 164 * @ind: buffer to populate 165 * 166 * Return: status of operation 167 */ 168 QDF_STATUS 169 wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data, 170 struct nan_datapath_sch_update_event *ind); 171 172 /** 173 * wmi_extract_nan_event_rsp - api to extract nan event into event parameters 174 * @wmi_hdl: wmi handle 175 * @wvt_buf: pointer to the event buffer 176 * @temp_evt_params: Pointer to a temporary parameters structure to populate 177 * @nan_msg_buf: Pointer to the NAN Message buffer encapsulated in the event 178 * 179 * Return: status of operation 180 */ 181 QDF_STATUS wmi_extract_nan_event_rsp(wmi_unified_t wmi_handle, void *evt_buf, 182 struct nan_event_params *temp_evt_params, 183 uint8_t **nan_msg_buf); 184 185 /** 186 * wmi_extract_ndp_host_event - api to extract ndp event from event buffer 187 * @wmi_hdl: wmi handle 188 * @data: event buffer 189 * @evt: event buffer to populate 190 * 191 * Return: status of operation 192 */ 193 QDF_STATUS wmi_extract_ndp_host_event(wmi_unified_t wmi_handle, uint8_t *data, 194 struct nan_datapath_host_event *evt); 195 #endif /* _WMI_UNIFIED_NAN_API_H_ */ 196