1 /*
2  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 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 TWT component.
21  */
22 
23 #include "wmi_unified_priv.h"
24 #include "wmi_unified_twt_api.h"
25 
26 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
27 #include <wlan_twt_public_structs.h>
28 
29 QDF_STATUS
wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,struct twt_enable_param * params)30 wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,
31 			   struct twt_enable_param *params)
32 {
33 	if (wmi_handle->ops->send_twt_enable_cmd)
34 		return wmi_handle->ops->send_twt_enable_cmd(
35 				wmi_handle, params);
36 
37 	return QDF_STATUS_E_FAILURE;
38 }
39 
40 QDF_STATUS
wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,struct twt_disable_param * params)41 wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,
42 			    struct twt_disable_param *params)
43 {
44 	if (wmi_handle->ops->send_twt_disable_cmd)
45 		return wmi_handle->ops->send_twt_disable_cmd(
46 				wmi_handle, params);
47 
48 	return QDF_STATUS_E_FAILURE;
49 }
50 
51 QDF_STATUS
wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,struct twt_add_dialog_param * params)52 wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,
53 			       struct twt_add_dialog_param *params)
54 {
55 	if (wmi_handle->ops->send_twt_add_dialog_cmd)
56 		return wmi_handle->ops->send_twt_add_dialog_cmd(
57 				wmi_handle, params);
58 
59 	return QDF_STATUS_E_FAILURE;
60 }
61 
62 QDF_STATUS
wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,struct twt_del_dialog_param * params)63 wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,
64 			       struct twt_del_dialog_param *params)
65 {
66 	if (wmi_handle->ops->send_twt_del_dialog_cmd)
67 		return wmi_handle->ops->send_twt_del_dialog_cmd(
68 				wmi_handle, params);
69 
70 	return QDF_STATUS_E_FAILURE;
71 }
72 
73 QDF_STATUS
wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,struct twt_pause_dialog_cmd_param * params)74 wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,
75 				 struct twt_pause_dialog_cmd_param *params)
76 {
77 	if (wmi_handle->ops->send_twt_pause_dialog_cmd)
78 		return wmi_handle->ops->send_twt_pause_dialog_cmd(
79 				wmi_handle, params);
80 
81 	return QDF_STATUS_E_FAILURE;
82 }
83 
84 QDF_STATUS
wmi_unified_twt_nudge_dialog_cmd(wmi_unified_t wmi_handle,struct twt_nudge_dialog_cmd_param * params)85 wmi_unified_twt_nudge_dialog_cmd(wmi_unified_t wmi_handle,
86 				 struct twt_nudge_dialog_cmd_param *params)
87 {
88 	if (wmi_handle->ops->send_twt_nudge_dialog_cmd)
89 		return wmi_handle->ops->send_twt_nudge_dialog_cmd(
90 				wmi_handle, params);
91 
92 	return QDF_STATUS_E_FAILURE;
93 }
94 
wmi_unified_twt_resume_dialog_cmd(wmi_unified_t wmi_handle,struct twt_resume_dialog_cmd_param * params)95 QDF_STATUS wmi_unified_twt_resume_dialog_cmd(
96 			wmi_unified_t wmi_handle,
97 			struct twt_resume_dialog_cmd_param *params)
98 {
99 	if (wmi_handle->ops->send_twt_resume_dialog_cmd)
100 		return wmi_handle->ops->send_twt_resume_dialog_cmd(
101 				wmi_handle, params);
102 
103 	return QDF_STATUS_E_FAILURE;
104 }
105 
106 #ifdef WLAN_SUPPORT_BCAST_TWT
wmi_unified_twt_btwt_invite_sta_cmd(wmi_unified_t wmi_handle,struct twt_btwt_invite_sta_cmd_param * params)107 QDF_STATUS wmi_unified_twt_btwt_invite_sta_cmd(
108 			wmi_unified_t wmi_handle,
109 			struct twt_btwt_invite_sta_cmd_param *params)
110 {
111 	if (wmi_handle->ops->send_twt_btwt_invite_sta_cmd)
112 		return wmi_handle->ops->send_twt_btwt_invite_sta_cmd(
113 				wmi_handle, params);
114 
115 	return QDF_STATUS_E_FAILURE;
116 }
117 
wmi_unified_twt_btwt_remove_sta_cmd(wmi_unified_t wmi_handle,struct twt_btwt_remove_sta_cmd_param * params)118 QDF_STATUS wmi_unified_twt_btwt_remove_sta_cmd(
119 			wmi_unified_t wmi_handle,
120 			struct twt_btwt_remove_sta_cmd_param *params)
121 {
122 	if (wmi_handle->ops->send_twt_btwt_remove_sta_cmd)
123 		return wmi_handle->ops->send_twt_btwt_remove_sta_cmd(
124 				wmi_handle, params);
125 
126 	return QDF_STATUS_E_FAILURE;
127 }
128 #endif
129 
wmi_extract_twt_enable_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_enable_complete_event_param * params)130 QDF_STATUS wmi_extract_twt_enable_comp_event(
131 			wmi_unified_t wmi_handle,
132 			uint8_t *evt_buf,
133 			struct twt_enable_complete_event_param *params)
134 {
135 	if (wmi_handle->ops->extract_twt_enable_comp_event)
136 		return wmi_handle->ops->extract_twt_enable_comp_event(
137 				wmi_handle, evt_buf, params);
138 
139 	return QDF_STATUS_E_FAILURE;
140 }
141 
wmi_extract_twt_disable_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_disable_complete_event_param * params)142 QDF_STATUS wmi_extract_twt_disable_comp_event(
143 			wmi_unified_t wmi_handle,
144 			uint8_t *evt_buf,
145 			struct twt_disable_complete_event_param *params)
146 {
147 	if (wmi_handle->ops->extract_twt_disable_comp_event)
148 		return wmi_handle->ops->extract_twt_disable_comp_event(
149 				wmi_handle, evt_buf, params);
150 
151 	return QDF_STATUS_E_FAILURE;
152 }
153 
wmi_extract_twt_add_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_add_dialog_complete_event_param * params)154 QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
155 			wmi_unified_t wmi_handle,
156 			uint8_t *evt_buf,
157 			struct twt_add_dialog_complete_event_param *params)
158 {
159 	if (wmi_handle->ops->extract_twt_add_dialog_comp_event)
160 		return wmi_handle->ops->extract_twt_add_dialog_comp_event(
161 				wmi_handle, evt_buf, params);
162 
163 	return QDF_STATUS_E_FAILURE;
164 }
165 
wmi_extract_twt_add_dialog_comp_additional_params(wmi_unified_t wmi_handle,uint8_t * evt_buf,uint32_t evt_buf_len,uint32_t idx,struct twt_add_dialog_additional_params * additional_params)166 QDF_STATUS wmi_extract_twt_add_dialog_comp_additional_params(
167 		wmi_unified_t wmi_handle, uint8_t *evt_buf,
168 		uint32_t evt_buf_len, uint32_t idx,
169 		struct twt_add_dialog_additional_params *additional_params)
170 {
171 	if (wmi_handle->ops->extract_twt_add_dialog_comp_additional_params)
172 		return wmi_handle->ops->
173 			extract_twt_add_dialog_comp_additional_params(
174 			wmi_handle, evt_buf, evt_buf_len, idx,
175 			additional_params);
176 
177 	return QDF_STATUS_E_FAILURE;
178 }
179 
wmi_extract_twt_del_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_del_dialog_complete_event_param * params)180 QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
181 		wmi_unified_t wmi_handle,
182 		uint8_t *evt_buf,
183 		struct twt_del_dialog_complete_event_param *params)
184 {
185 	if (wmi_handle->ops->extract_twt_del_dialog_comp_event)
186 		return wmi_handle->ops->extract_twt_del_dialog_comp_event(
187 				wmi_handle, evt_buf, params);
188 
189 	return QDF_STATUS_E_FAILURE;
190 }
191 
wmi_extract_twt_pause_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_pause_dialog_complete_event_param * params)192 QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(
193 		wmi_unified_t wmi_handle,
194 		uint8_t *evt_buf,
195 		struct twt_pause_dialog_complete_event_param *params)
196 {
197 	if (wmi_handle->ops->extract_twt_pause_dialog_comp_event)
198 		return wmi_handle->ops->extract_twt_pause_dialog_comp_event(
199 				wmi_handle, evt_buf, params);
200 
201 	return QDF_STATUS_E_FAILURE;
202 }
203 
wmi_extract_twt_nudge_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_nudge_dialog_complete_event_param * params)204 QDF_STATUS wmi_extract_twt_nudge_dialog_comp_event(
205 		wmi_unified_t wmi_handle,
206 		uint8_t *evt_buf,
207 		struct twt_nudge_dialog_complete_event_param *params)
208 {
209 	if (wmi_handle->ops->extract_twt_nudge_dialog_comp_event)
210 		return wmi_handle->ops->extract_twt_nudge_dialog_comp_event(
211 				wmi_handle, evt_buf, params);
212 
213 	return QDF_STATUS_E_FAILURE;
214 }
215 
wmi_extract_twt_resume_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_resume_dialog_complete_event_param * params)216 QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(
217 		wmi_unified_t wmi_handle,
218 		uint8_t *evt_buf,
219 		struct twt_resume_dialog_complete_event_param *params)
220 {
221 	if (wmi_handle->ops->extract_twt_resume_dialog_comp_event)
222 		return wmi_handle->ops->extract_twt_resume_dialog_comp_event(
223 				wmi_handle, evt_buf, params);
224 
225 	return QDF_STATUS_E_FAILURE;
226 }
227 
wmi_extract_twt_notify_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_notify_event_param * params)228 QDF_STATUS wmi_extract_twt_notify_event(
229 		wmi_unified_t wmi_handle,
230 		uint8_t *evt_buf,
231 		struct twt_notify_event_param *params)
232 {
233 	if (wmi_handle->ops->extract_twt_notify_event)
234 		return wmi_handle->ops->extract_twt_notify_event(wmi_handle,
235 								 evt_buf,
236 								 params);
237 
238 	return QDF_STATUS_E_FAILURE;
239 }
240 
241 #ifdef WLAN_SUPPORT_BCAST_TWT
wmi_extract_twt_btwt_invite_sta_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_btwt_invite_sta_complete_event_param * params)242 QDF_STATUS wmi_extract_twt_btwt_invite_sta_comp_event(
243 		wmi_unified_t wmi_handle,
244 		uint8_t *evt_buf,
245 		struct twt_btwt_invite_sta_complete_event_param *params)
246 {
247 	if (wmi_handle->ops->extract_twt_btwt_invite_sta_comp_event)
248 		return wmi_handle->ops->extract_twt_btwt_invite_sta_comp_event(
249 				wmi_handle, evt_buf, params);
250 
251 	return QDF_STATUS_E_FAILURE;
252 }
253 
wmi_extract_twt_btwt_remove_sta_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_btwt_remove_sta_complete_event_param * params)254 QDF_STATUS wmi_extract_twt_btwt_remove_sta_comp_event(
255 		wmi_unified_t wmi_handle,
256 		uint8_t *evt_buf,
257 		struct twt_btwt_remove_sta_complete_event_param *params)
258 {
259 	if (wmi_handle->ops->extract_twt_btwt_remove_sta_comp_event)
260 		return wmi_handle->ops->extract_twt_btwt_remove_sta_comp_event(
261 				wmi_handle, evt_buf, params);
262 
263 	return QDF_STATUS_E_FAILURE;
264 }
265 #endif
266 
wmi_extract_twt_session_stats_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_session_stats_event_param * params)267 QDF_STATUS wmi_extract_twt_session_stats_event(
268 		wmi_unified_t wmi_handle,
269 		uint8_t *evt_buf,
270 		struct twt_session_stats_event_param *params)
271 {
272 	if (wmi_handle->ops->extract_twt_session_stats_event)
273 		return wmi_handle->ops->extract_twt_session_stats_event(
274 				wmi_handle, evt_buf, params);
275 
276 	return QDF_STATUS_E_FAILURE;
277 }
278 
wmi_extract_twt_session_stats_data(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_session_stats_event_param * params,struct twt_session_stats_info * session,uint32_t idx)279 QDF_STATUS wmi_extract_twt_session_stats_data(
280 		wmi_unified_t wmi_handle,
281 		uint8_t *evt_buf,
282 		struct twt_session_stats_event_param *params,
283 		struct twt_session_stats_info *session,
284 		uint32_t idx)
285 {
286 	if (wmi_handle->ops->extract_twt_session_stats_data)
287 		return wmi_handle->ops->extract_twt_session_stats_data(
288 				wmi_handle, evt_buf, params, session, idx);
289 
290 	return QDF_STATUS_E_FAILURE;
291 }
292 
wmi_extract_twt_cap_service_ready_ext2(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_cap_bitmap_params * params)293 QDF_STATUS wmi_extract_twt_cap_service_ready_ext2(
294 		wmi_unified_t wmi_handle,
295 		uint8_t *evt_buf,
296 		struct wmi_twt_cap_bitmap_params *params)
297 {
298 	if (wmi_handle->ops->extract_twt_cap_service_ready_ext2)
299 		return wmi_handle->ops->extract_twt_cap_service_ready_ext2(
300 				wmi_handle, evt_buf, params);
301 
302 	return QDF_STATUS_E_FAILURE;
303 }
304 
wmi_extract_twt_ack_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct twt_ack_complete_event_param * params)305 QDF_STATUS wmi_extract_twt_ack_comp_event(
306 		wmi_unified_t wmi_handle,
307 		uint8_t *evt_buf,
308 		struct twt_ack_complete_event_param *params)
309 {
310 	if (wmi_handle->ops->extract_twt_ack_comp_event)
311 		return wmi_handle->ops->extract_twt_ack_comp_event(
312 				wmi_handle, evt_buf, params);
313 
314 	return QDF_STATUS_E_FAILURE;
315 }
316 #elif WLAN_SUPPORT_TWT
317 QDF_STATUS
wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,struct wmi_twt_enable_param * params)318 wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,
319 			   struct wmi_twt_enable_param *params)
320 {
321 	if (wmi_handle->ops->send_twt_enable_cmd)
322 		return wmi_handle->ops->send_twt_enable_cmd(
323 				wmi_handle, params);
324 
325 	return QDF_STATUS_E_FAILURE;
326 }
327 
328 QDF_STATUS
wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,struct wmi_twt_disable_param * params)329 wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,
330 			    struct wmi_twt_disable_param *params)
331 {
332 	if (wmi_handle->ops->send_twt_disable_cmd)
333 		return wmi_handle->ops->send_twt_disable_cmd(
334 				wmi_handle, params);
335 
336 	return QDF_STATUS_E_FAILURE;
337 }
338 
339 QDF_STATUS
wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,struct wmi_twt_add_dialog_param * params)340 wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,
341 			       struct wmi_twt_add_dialog_param *params)
342 {
343 	if (wmi_handle->ops->send_twt_add_dialog_cmd)
344 		return wmi_handle->ops->send_twt_add_dialog_cmd(
345 				wmi_handle, params);
346 
347 	return QDF_STATUS_E_FAILURE;
348 }
349 
350 QDF_STATUS
wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,struct wmi_twt_del_dialog_param * params)351 wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,
352 			       struct wmi_twt_del_dialog_param *params)
353 {
354 	if (wmi_handle->ops->send_twt_del_dialog_cmd)
355 		return wmi_handle->ops->send_twt_del_dialog_cmd(
356 				wmi_handle, params);
357 
358 	return QDF_STATUS_E_FAILURE;
359 }
360 
361 QDF_STATUS
wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,struct wmi_twt_pause_dialog_cmd_param * params)362 wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,
363 				 struct wmi_twt_pause_dialog_cmd_param *params)
364 {
365 	if (wmi_handle->ops->send_twt_pause_dialog_cmd)
366 		return wmi_handle->ops->send_twt_pause_dialog_cmd(
367 				wmi_handle, params);
368 
369 	return QDF_STATUS_E_FAILURE;
370 }
371 
372 QDF_STATUS
wmi_unified_twt_nudge_dialog_cmd(wmi_unified_t wmi_handle,struct wmi_twt_nudge_dialog_cmd_param * params)373 wmi_unified_twt_nudge_dialog_cmd(wmi_unified_t wmi_handle,
374 				 struct wmi_twt_nudge_dialog_cmd_param *params)
375 {
376 	if (wmi_handle->ops->send_twt_nudge_dialog_cmd)
377 		return wmi_handle->ops->send_twt_nudge_dialog_cmd(
378 				wmi_handle, params);
379 
380 	return QDF_STATUS_E_FAILURE;
381 }
382 
wmi_unified_twt_resume_dialog_cmd(wmi_unified_t wmi_handle,struct wmi_twt_resume_dialog_cmd_param * params)383 QDF_STATUS wmi_unified_twt_resume_dialog_cmd(
384 			wmi_unified_t wmi_handle,
385 			struct wmi_twt_resume_dialog_cmd_param *params)
386 {
387 	if (wmi_handle->ops->send_twt_resume_dialog_cmd)
388 		return wmi_handle->ops->send_twt_resume_dialog_cmd(
389 				wmi_handle, params);
390 
391 	return QDF_STATUS_E_FAILURE;
392 }
393 
394 #ifdef WLAN_SUPPORT_BCAST_TWT
wmi_unified_twt_btwt_invite_sta_cmd(wmi_unified_t wmi_handle,struct wmi_twt_btwt_invite_sta_cmd_param * params)395 QDF_STATUS wmi_unified_twt_btwt_invite_sta_cmd(
396 			wmi_unified_t wmi_handle,
397 			struct wmi_twt_btwt_invite_sta_cmd_param *params)
398 {
399 	if (wmi_handle->ops->send_twt_btwt_invite_sta_cmd)
400 		return wmi_handle->ops->send_twt_btwt_invite_sta_cmd(
401 				wmi_handle, params);
402 
403 	return QDF_STATUS_E_FAILURE;
404 }
405 
wmi_unified_twt_btwt_remove_sta_cmd(wmi_unified_t wmi_handle,struct wmi_twt_btwt_remove_sta_cmd_param * params)406 QDF_STATUS wmi_unified_twt_btwt_remove_sta_cmd(
407 			wmi_unified_t wmi_handle,
408 			struct wmi_twt_btwt_remove_sta_cmd_param *params)
409 {
410 	if (wmi_handle->ops->send_twt_btwt_remove_sta_cmd)
411 		return wmi_handle->ops->send_twt_btwt_remove_sta_cmd(
412 				wmi_handle, params);
413 
414 	return QDF_STATUS_E_FAILURE;
415 }
416 #endif
417 
wmi_extract_twt_enable_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_enable_complete_event_param * params)418 QDF_STATUS wmi_extract_twt_enable_comp_event(
419 			wmi_unified_t wmi_handle,
420 			uint8_t *evt_buf,
421 			struct wmi_twt_enable_complete_event_param *params)
422 {
423 	if (wmi_handle->ops->extract_twt_enable_comp_event)
424 		return wmi_handle->ops->extract_twt_enable_comp_event(
425 				wmi_handle, evt_buf, params);
426 
427 	return QDF_STATUS_E_FAILURE;
428 }
429 
wmi_extract_twt_disable_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_disable_complete_event * params)430 QDF_STATUS wmi_extract_twt_disable_comp_event(
431 			wmi_unified_t wmi_handle,
432 			uint8_t *evt_buf,
433 			struct wmi_twt_disable_complete_event *params)
434 {
435 	if (wmi_handle->ops->extract_twt_disable_comp_event)
436 		return wmi_handle->ops->extract_twt_disable_comp_event(
437 				wmi_handle, evt_buf, params);
438 
439 	return QDF_STATUS_E_FAILURE;
440 }
441 
wmi_extract_twt_add_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_add_dialog_complete_event_param * params)442 QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
443 			wmi_unified_t wmi_handle,
444 			uint8_t *evt_buf,
445 			struct wmi_twt_add_dialog_complete_event_param *params)
446 {
447 	if (wmi_handle->ops->extract_twt_add_dialog_comp_event)
448 		return wmi_handle->ops->extract_twt_add_dialog_comp_event(
449 				wmi_handle, evt_buf, params);
450 
451 	return QDF_STATUS_E_FAILURE;
452 }
453 
wmi_extract_twt_add_dialog_comp_additional_params(wmi_unified_t wmi_handle,uint8_t * evt_buf,uint32_t evt_buf_len,uint32_t idx,struct wmi_twt_add_dialog_additional_params * additional_params)454 QDF_STATUS wmi_extract_twt_add_dialog_comp_additional_params(
455 		wmi_unified_t wmi_handle, uint8_t *evt_buf,
456 		uint32_t evt_buf_len, uint32_t idx,
457 		struct wmi_twt_add_dialog_additional_params *additional_params)
458 {
459 	if (wmi_handle->ops->extract_twt_add_dialog_comp_additional_params)
460 		return wmi_handle->ops->
461 			extract_twt_add_dialog_comp_additional_params(
462 			wmi_handle, evt_buf, evt_buf_len, idx,
463 			additional_params);
464 
465 	return QDF_STATUS_E_FAILURE;
466 }
467 
wmi_extract_twt_del_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_del_dialog_complete_event_param * params)468 QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
469 		wmi_unified_t wmi_handle,
470 		uint8_t *evt_buf,
471 		struct wmi_twt_del_dialog_complete_event_param *params)
472 {
473 	if (wmi_handle->ops->extract_twt_del_dialog_comp_event)
474 		return wmi_handle->ops->extract_twt_del_dialog_comp_event(
475 				wmi_handle, evt_buf, params);
476 
477 	return QDF_STATUS_E_FAILURE;
478 }
479 
wmi_extract_twt_pause_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_pause_dialog_complete_event_param * params)480 QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(
481 		wmi_unified_t wmi_handle,
482 		uint8_t *evt_buf,
483 		struct wmi_twt_pause_dialog_complete_event_param *params)
484 {
485 	if (wmi_handle->ops->extract_twt_pause_dialog_comp_event)
486 		return wmi_handle->ops->extract_twt_pause_dialog_comp_event(
487 				wmi_handle, evt_buf, params);
488 
489 	return QDF_STATUS_E_FAILURE;
490 }
491 
wmi_extract_twt_nudge_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_nudge_dialog_complete_event_param * params)492 QDF_STATUS wmi_extract_twt_nudge_dialog_comp_event(
493 		wmi_unified_t wmi_handle,
494 		uint8_t *evt_buf,
495 		struct wmi_twt_nudge_dialog_complete_event_param *params)
496 {
497 	if (wmi_handle->ops->extract_twt_nudge_dialog_comp_event)
498 		return wmi_handle->ops->extract_twt_nudge_dialog_comp_event(
499 				wmi_handle, evt_buf, params);
500 
501 	return QDF_STATUS_E_FAILURE;
502 }
503 
wmi_extract_twt_resume_dialog_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_resume_dialog_complete_event_param * params)504 QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(
505 		wmi_unified_t wmi_handle,
506 		uint8_t *evt_buf,
507 		struct wmi_twt_resume_dialog_complete_event_param *params)
508 {
509 	if (wmi_handle->ops->extract_twt_resume_dialog_comp_event)
510 		return wmi_handle->ops->extract_twt_resume_dialog_comp_event(
511 				wmi_handle, evt_buf, params);
512 
513 	return QDF_STATUS_E_FAILURE;
514 }
515 
wmi_extract_twt_notify_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_notify_event_param * params)516 QDF_STATUS wmi_extract_twt_notify_event(
517 		wmi_unified_t wmi_handle,
518 		uint8_t *evt_buf,
519 		struct wmi_twt_notify_event_param *params)
520 {
521 	if (wmi_handle->ops->extract_twt_notify_event)
522 		return wmi_handle->ops->extract_twt_notify_event(wmi_handle,
523 								 evt_buf,
524 								 params);
525 
526 	return QDF_STATUS_E_FAILURE;
527 }
528 
529 #ifdef WLAN_SUPPORT_BCAST_TWT
wmi_extract_twt_btwt_invite_sta_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_btwt_invite_sta_complete_event_param * params)530 QDF_STATUS wmi_extract_twt_btwt_invite_sta_comp_event(
531 		wmi_unified_t wmi_handle,
532 		uint8_t *evt_buf,
533 		struct wmi_twt_btwt_invite_sta_complete_event_param *params)
534 {
535 	if (wmi_handle->ops->extract_twt_btwt_invite_sta_comp_event)
536 		return wmi_handle->ops->extract_twt_btwt_invite_sta_comp_event(
537 				wmi_handle, evt_buf, params);
538 
539 	return QDF_STATUS_E_FAILURE;
540 }
541 
wmi_extract_twt_btwt_remove_sta_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_btwt_remove_sta_complete_event_param * params)542 QDF_STATUS wmi_extract_twt_btwt_remove_sta_comp_event(
543 		wmi_unified_t wmi_handle,
544 		uint8_t *evt_buf,
545 		struct wmi_twt_btwt_remove_sta_complete_event_param *params)
546 {
547 	if (wmi_handle->ops->extract_twt_btwt_remove_sta_comp_event)
548 		return wmi_handle->ops->extract_twt_btwt_remove_sta_comp_event(
549 				wmi_handle, evt_buf, params);
550 
551 	return QDF_STATUS_E_FAILURE;
552 }
553 #endif
554 
wmi_extract_twt_session_stats_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_session_stats_event_param * params)555 QDF_STATUS wmi_extract_twt_session_stats_event(
556 		wmi_unified_t wmi_handle,
557 		uint8_t *evt_buf,
558 		struct wmi_twt_session_stats_event_param *params)
559 {
560 	if (wmi_handle->ops->extract_twt_session_stats_event)
561 		return wmi_handle->ops->extract_twt_session_stats_event(
562 				wmi_handle, evt_buf, params);
563 
564 	return QDF_STATUS_E_FAILURE;
565 }
566 
wmi_extract_twt_session_stats_data(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_session_stats_event_param * params,struct wmi_host_twt_session_stats_info * session,uint32_t idx)567 QDF_STATUS wmi_extract_twt_session_stats_data(
568 		wmi_unified_t wmi_handle,
569 		uint8_t *evt_buf,
570 		struct wmi_twt_session_stats_event_param *params,
571 		struct wmi_host_twt_session_stats_info *session,
572 		uint32_t idx)
573 {
574 	if (wmi_handle->ops->extract_twt_session_stats_data)
575 		return wmi_handle->ops->extract_twt_session_stats_data(
576 				wmi_handle, evt_buf, params, session, idx);
577 
578 	return QDF_STATUS_E_FAILURE;
579 }
580 
wmi_extract_twt_cap_service_ready_ext2(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_cap_bitmap_params * params)581 QDF_STATUS wmi_extract_twt_cap_service_ready_ext2(
582 		wmi_unified_t wmi_handle,
583 		uint8_t *evt_buf,
584 		struct wmi_twt_cap_bitmap_params *params)
585 {
586 	if (wmi_handle->ops->extract_twt_cap_service_ready_ext2)
587 		return wmi_handle->ops->extract_twt_cap_service_ready_ext2(
588 				wmi_handle, evt_buf, params);
589 
590 	return QDF_STATUS_E_FAILURE;
591 }
592 
wmi_extract_twt_ack_comp_event(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct wmi_twt_ack_complete_event_param * params)593 QDF_STATUS wmi_extract_twt_ack_comp_event(
594 		wmi_unified_t wmi_handle,
595 		uint8_t *evt_buf,
596 		struct wmi_twt_ack_complete_event_param *params)
597 {
598 	if (wmi_handle->ops->extract_twt_ack_comp_event)
599 		return wmi_handle->ops->extract_twt_ack_comp_event(
600 				wmi_handle, evt_buf, params);
601 
602 	return QDF_STATUS_E_FAILURE;
603 }
604 #endif
605