xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_nan_api.h (revision 6d768494e5ce14eb1603a695c86739d12ecc6ec2)
1 
2 /*
3  * Copyright (c) 2013-2020 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_handle: 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(wmi_unified_t wmi_handle,
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_handle: 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(wmi_unified_t wmi_handle,
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_handle: 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(wmi_unified_t wmi_handle,
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_nan_msg - api to extract ndp dmesg buffer to print logs
116  * @data: event buffer
117  * @msg: buffer to populate
118  *
119  * Return: status of operation
120  */
121 QDF_STATUS wmi_extract_nan_msg(wmi_unified_t wmi_handle, uint8_t *data,
122 			       struct nan_dump_msg *msg);
123 
124 /**
125  * wmi_extract_ndp_confirm - api to extract ndp confim struct from even buffer
126  * @wmi_hdl: wmi handle
127  * @data: event buffer
128  * @ev: buffer to populate
129  *
130  * Return: status of operation
131  */
132 QDF_STATUS wmi_extract_ndp_confirm(wmi_unified_t wmi_handle, uint8_t *data,
133 				   struct nan_datapath_confirm_event *ev);
134 
135 /**
136  * wmi_extract_ndp_responder_rsp - api to extract responder rsp from even buffer
137  * @wmi_hdl: wmi handle
138  * @data: event buffer
139  * @rsp: buffer to populate
140  *
141  * Return: status of operation
142  */
143 QDF_STATUS
144 wmi_extract_ndp_responder_rsp(wmi_unified_t wmi_handle, uint8_t *data,
145 			      struct nan_datapath_responder_rsp *rsp);
146 
147 /**
148  * wmi_extract_ndp_end_rsp - api to extract ndp end rsp from even buffer
149  * @wmi_hdl: wmi handle
150  * @data: event buffer
151  * @rsp: buffer to populate
152  *
153  * Return: status of operation
154  */
155 QDF_STATUS wmi_extract_ndp_end_rsp(wmi_unified_t wmi_handle, uint8_t *data,
156 				   struct nan_datapath_end_rsp_event *rsp);
157 
158 /**
159  * wmi_extract_ndp_end_ind - api to extract ndp end indication from even buffer
160  * @wmi_hdl: wmi handle
161  * @data: event buffer
162  * @ind: buffer to populate
163  *
164  * Return: status of operation
165  */
166 QDF_STATUS
167 wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
168 			struct nan_datapath_end_indication_event **ind);
169 
170 /**
171  * wmi_extract_ndp_sch_update - api to extract ndp sch update from event buffer
172  * @wmi_hdl: wmi handle
173  * @data: event buffer
174  * @ind: buffer to populate
175  *
176  * Return: status of operation
177  */
178 QDF_STATUS
179 wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
180 			   struct nan_datapath_sch_update_event *ind);
181 
182 /**
183  * wmi_extract_nan_event_rsp - api to extract nan event into event parameters
184  * @wmi_hdl: wmi handle
185  * @wvt_buf: pointer to the event buffer
186  * @temp_evt_params: Pointer to a temporary parameters structure to populate
187  * @nan_msg_buf: Pointer to the NAN Message buffer encapsulated in the event
188  *
189  * Return: status of operation
190  */
191 QDF_STATUS wmi_extract_nan_event_rsp(wmi_unified_t wmi_handle, void *evt_buf,
192 				     struct nan_event_params *temp_evt_params,
193 				     uint8_t **nan_msg_buf);
194 
195 /**
196  * wmi_extract_ndp_host_event - api to extract ndp event from event buffer
197  * @wmi_hdl: wmi handle
198  * @data: event buffer
199  * @evt: event buffer to populate
200  *
201  * Return: status of operation
202  */
203 QDF_STATUS wmi_extract_ndp_host_event(wmi_unified_t wmi_handle, uint8_t *data,
204 				      struct nan_datapath_host_event *evt);
205 #endif /* _WMI_UNIFIED_NAN_API_H_ */
206