xref: /wlan-driver/qca-wifi-host-cmn/wmi/inc/wmi_unified_twt_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 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 #ifndef _WMI_UNIFIED_TWT_API_H_
24 #define _WMI_UNIFIED_TWT_API_H_
25 
26 #include "wmi_unified_twt_param.h"
27 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
28 #include <wlan_twt_public_structs.h>
29 /**
30  * wmi_unified_twt_enable_cmd() - Send WMI command to Enable TWT
31  * @wmi_handle: wmi handle
32  * @params: Parameters to be configured
33  *
34  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
35  */
36 QDF_STATUS
37 wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,
38 			   struct twt_enable_param *params);
39 
40 /**
41  * wmi_unified_twt_disable_cmd() - Send WMI command to disable TWT
42  * @wmi_handle: wmi handle
43  * @params: Parameters to be configured
44  *
45  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
46  */
47 QDF_STATUS
48 wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,
49 			    struct twt_disable_param *params);
50 
51 /**
52  * wmi_unified_twt_add_dialog_cmd() - Send WMI command to add TWT dialog
53  * @wmi_handle: wmi handle
54  * @params: Parameters to be configured
55  *
56  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
57  */
58 QDF_STATUS
59 wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,
60 			       struct twt_add_dialog_param *params);
61 
62 /**
63  * wmi_unified_twt_del_dialog_cmd() - Send WMI command to delete TWT dialog
64  * @wmi_handle: wmi handle
65  * @params: Parameters to be configured
66  *
67  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
68  */
69 QDF_STATUS
70 wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,
71 			       struct twt_del_dialog_param *params);
72 
73 /**
74  * wmi_unified_twt_pause_dialog_cmd() - Send WMI command to pause TWT dialog
75  * @wmi_handle: wmi handle
76  * @params: Parameters to be configured
77  *
78  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
79  */
80 QDF_STATUS
81 wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,
82 				 struct twt_pause_dialog_cmd_param *params);
83 
84 /**
85  * wmi_unified_twt_nudge_dialog_cmd() - Send WMI command to nudge TWT dialog
86  * @wmi_handle: wmi handle
87  * @params: Parameters to be configured
88  *
89  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
90  */
91 QDF_STATUS
92 wmi_unified_twt_nudge_dialog_cmd(wmi_unified_t wmi_handle,
93 				 struct twt_nudge_dialog_cmd_param *params);
94 
95 /**
96  * wmi_unified_twt_resume_dialog_cmd() - Send WMI command to resume TWT dialog
97  * @wmi_handle: wmi handle
98  * @params: Parameters to be configured
99  *
100  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
101  */
102 QDF_STATUS wmi_unified_twt_resume_dialog_cmd(
103 			wmi_unified_t wmi_handle,
104 			struct twt_resume_dialog_cmd_param *params);
105 
106 #ifdef WLAN_SUPPORT_BCAST_TWT
107 /**
108  * wmi_unified_twt_btwt_invite_sta_cmd() - Send WMI command for bTWT sta
109  *                               invitation
110  * @wmi_handle: wmi handle
111  * @params: Parameters to be configured
112  *
113  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
114  */
115 QDF_STATUS wmi_unified_twt_btwt_invite_sta_cmd(
116 			wmi_unified_t wmi_handle,
117 			struct twt_btwt_invite_sta_cmd_param *params);
118 
119 /**
120  * wmi_unified_twt_btwt_remove_sta_cmd() - Send WMI command for bTWT sta kickoff
121  * @wmi_handle: wmi handle
122  * @params: Parameters to be configured
123  *
124  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
125  */
126 QDF_STATUS wmi_unified_twt_btwt_remove_sta_cmd(
127 			wmi_unified_t wmi_handle,
128 			struct twt_btwt_remove_sta_cmd_param *params);
129 #endif
130 
131 /**
132  * wmi_extract_twt_enable_comp_event() - Extract WMI event params for TWT enable
133  *                               completion event
134  * @wmi_handle: wmi handle
135  * @evt_buf: Pointer event buffer
136  * @params: Parameters to extract
137  *
138  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
139  */
140 QDF_STATUS wmi_extract_twt_enable_comp_event(
141 		wmi_unified_t wmi_handle,
142 		uint8_t *evt_buf,
143 		struct twt_enable_complete_event_param *params);
144 
145 /**
146  * wmi_extract_twt_disable_comp_event() - Extract WMI event params for TWT
147  *                               disable completion event
148  * @wmi_handle: wmi handle
149  * @evt_buf: Pointer event buffer
150  * @params: Parameters to extract
151  *
152  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
153  */
154 QDF_STATUS wmi_extract_twt_disable_comp_event(
155 		wmi_unified_t wmi_handle,
156 		uint8_t *evt_buf,
157 		struct twt_disable_complete_event_param *params);
158 
159 /**
160  * wmi_extract_twt_add_dialog_comp_event() - Extract WMI event params for TWT
161  *                               add dialog completion event
162  * @wmi_handle: wmi handle
163  * @evt_buf: Pointer event buffer
164  * @params: Parameters to extract
165  *
166  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
167  */
168 QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
169 		wmi_unified_t wmi_handle,
170 		uint8_t *evt_buf,
171 		struct twt_add_dialog_complete_event_param *params);
172 
173 /**
174  * wmi_extract_twt_add_dialog_comp_additional_params() - Extracts additional
175  * twt parameters, as part of add dialog completion event
176  * @wmi_handle: wmi handle
177  * @evt_buf: Pointer event buffer
178  * @evt_buf_len: length of the add dialog event buffer
179  * @idx: index of num_twt_params to extract
180  * @additional_params: additional parameters to extract
181  *
182  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
183  */
184 QDF_STATUS wmi_extract_twt_add_dialog_comp_additional_params(
185 		wmi_unified_t wmi_handle, uint8_t *evt_buf,
186 		uint32_t evt_buf_len, uint32_t idx,
187 		struct twt_add_dialog_additional_params *additional_params);
188 
189 /**
190  * wmi_extract_twt_del_dialog_comp_event() - Extract WMI event params for TWT
191  *                               delete dialog completion event
192  * @wmi_handle: wmi handle
193  * @evt_buf: Pointer event buffer
194  * @params: Parameters to extract
195  *
196  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
197  */
198 QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
199 		wmi_unified_t wmi_handle,
200 		uint8_t *evt_buf,
201 		struct twt_del_dialog_complete_event_param *params);
202 
203 /**
204  * wmi_extract_twt_pause_dialog_comp_event() - Extract WMI event params for TWT
205  *                               pause dialog completion event
206  * @wmi_handle: wmi handle
207  * @evt_buf: Pointer event buffer
208  * @params: Parameters to extract
209  *
210  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
211  */
212 QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(
213 		wmi_unified_t wmi_handle,
214 		uint8_t *evt_buf,
215 		struct twt_pause_dialog_complete_event_param *params);
216 
217 /**
218  * wmi_extract_twt_nudge_dialog_comp_event() - Extract WMI event params for TWT
219  *                               nudge dialog completion event
220  * @wmi_handle: wmi handle
221  * @evt_buf: Pointer event buffer
222  * @params: Parameters to extract
223  *
224  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
225  */
226 QDF_STATUS wmi_extract_twt_nudge_dialog_comp_event(
227 		wmi_unified_t wmi_handle,
228 		uint8_t *evt_buf,
229 		struct twt_nudge_dialog_complete_event_param *params);
230 
231 /**
232  * wmi_extract_twt_resume_dialog_comp_event() - Extract WMI event params for TWT
233  *                               resume dialog completion event
234  * @wmi_handle: wmi handle
235  * @evt_buf: Pointer event buffer
236  * @params: Parameters to extract
237  *
238  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
239  */
240 QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(
241 		wmi_unified_t wmi_handle,
242 		uint8_t *evt_buf,
243 		struct twt_resume_dialog_complete_event_param *params);
244 
245 /**
246  * wmi_extract_twt_notify_event() - Extract WMI event params for TWT
247  *                                  notify event
248  * @wmi_handle: wmi handle
249  * @evt_buf: Pointer event buffer
250  * @params: Parameters to extract
251  *
252  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
253  */
254 QDF_STATUS wmi_extract_twt_notify_event(
255 		wmi_unified_t wmi_handle,
256 		uint8_t *evt_buf,
257 		struct twt_notify_event_param *params);
258 
259 #ifdef WLAN_SUPPORT_BCAST_TWT
260 /**
261  * wmi_extract_twt_btwt_invite_sta_comp_event() - Extract WMI event params for
262  *                          BTWT sta invitation completion event
263  * @wmi_handle: wmi handle
264  * @evt_buf: Pointer event buffer
265  * @params: Parameters to extract
266  *
267  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
268  */
269 QDF_STATUS wmi_extract_twt_btwt_invite_sta_comp_event(
270 		wmi_unified_t wmi_handle,
271 		uint8_t *evt_buf,
272 		struct twt_btwt_invite_sta_complete_event_param *params);
273 
274 /**
275  * wmi_extract_twt_btwt_remove_sta_comp_event() - Extract WMI event params for
276  *                          BTWT sta kickoff completion event
277  * @wmi_handle: wmi handle
278  * @evt_buf: Pointer event buffer
279  * @params: Parameters to extract
280  *
281  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
282  */
283 QDF_STATUS wmi_extract_twt_btwt_remove_sta_comp_event(
284 		wmi_unified_t wmi_handle,
285 		uint8_t *evt_buf,
286 		struct twt_btwt_remove_sta_complete_event_param *params);
287 #endif
288 
289 /**
290  * wmi_extract_twt_session_stats_event() - Extract WMI event params for TWT
291  *                               session stats event
292  * @wmi_handle: wmi handle
293  * @evt_buf: Pointer event buffer
294  * @params: Parameters to extract
295  *
296  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
297  */
298 QDF_STATUS wmi_extract_twt_session_stats_event(
299 		wmi_unified_t wmi_handle,
300 		uint8_t *evt_buf,
301 		struct twt_session_stats_event_param *params);
302 
303 /**
304  * wmi_extract_twt_session_stats_data() - Extract one TWT session from TWT
305  *                               session stats event
306  * @wmi_handle: wmi handle
307  * @evt_buf: Pointer event buffer
308  * @params: Parameters to extract
309  * @session: Session struct to save one TWT session
310  * @idx: TWT session index
311  *
312  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
313  */
314 QDF_STATUS wmi_extract_twt_session_stats_data(
315 		wmi_unified_t wmi_handle,
316 		uint8_t *evt_buf,
317 		struct twt_session_stats_event_param *params,
318 		struct twt_session_stats_info *session,
319 		uint32_t idx);
320 
321 void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle);
322 
323 /**
324  * wmi_extract_twt_cap_service_ready_ext2: Extract TWT bitmap value
325  *                                         received through extended
326  *                                         service ready2 event
327  * @wmi_handle: WMI handle
328  * @evt_buf: Event buffer
329  * @params: Pointer to TWT bitmap param
330  *
331  * Return: QDF_STATUS_SUCCESS for success or error code
332  */
333 QDF_STATUS wmi_extract_twt_cap_service_ready_ext2(
334 			wmi_unified_t wmi_handle,
335 			uint8_t *evt_buf,
336 			struct wmi_twt_cap_bitmap_params *params);
337 
338 /**
339  * wmi_extract_twt_ack_comp_event() - Extract WMI event params for TWT ack event
340  *
341  * @wmi_handle: wmi handle
342  * @evt_buf: Pointer event buffer
343  * @param: Parameters to extract
344  *
345  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
346  */
347 QDF_STATUS wmi_extract_twt_ack_comp_event(
348 			wmi_unified_t wmi_handle,
349 			uint8_t *evt_buf,
350 			struct twt_ack_complete_event_param *param);
351 #elif defined(WLAN_SUPPORT_TWT)
352 /**
353  * wmi_unified_twt_enable_cmd() - Send WMI command to Enable TWT
354  * @wmi_handle: wmi handle
355  * @params: Parameters to be configured
356  *
357  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
358  */
359 QDF_STATUS
360 wmi_unified_twt_enable_cmd(wmi_unified_t wmi_handle,
361 			   struct wmi_twt_enable_param *params);
362 
363 /**
364  * wmi_unified_twt_disable_cmd() - Send WMI command to disable TWT
365  * @wmi_handle: wmi handle
366  * @params: Parameters to be configured
367  *
368  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
369  */
370 QDF_STATUS
371 wmi_unified_twt_disable_cmd(wmi_unified_t wmi_handle,
372 			    struct wmi_twt_disable_param *params);
373 
374 /**
375  * wmi_unified_twt_add_dialog_cmd() - Send WMI command to add TWT dialog
376  * @wmi_handle: wmi handle
377  * @params: Parameters to be configured
378  *
379  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
380  */
381 QDF_STATUS
382 wmi_unified_twt_add_dialog_cmd(wmi_unified_t wmi_handle,
383 			       struct wmi_twt_add_dialog_param *params);
384 
385 /**
386  * wmi_unified_twt_del_dialog_cmd() - Send WMI command to delete TWT dialog
387  * @wmi_handle: wmi handle
388  * @params: Parameters to be configured
389  *
390  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
391  */
392 QDF_STATUS
393 wmi_unified_twt_del_dialog_cmd(wmi_unified_t wmi_handle,
394 			       struct wmi_twt_del_dialog_param *params);
395 
396 /**
397  * wmi_unified_twt_pause_dialog_cmd() - Send WMI command to pause TWT dialog
398  * @wmi_handle: wmi handle
399  * @params: Parameters to be configured
400  *
401  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
402  */
403 QDF_STATUS
404 wmi_unified_twt_pause_dialog_cmd(wmi_unified_t wmi_handle,
405 				 struct wmi_twt_pause_dialog_cmd_param *params);
406 
407 /**
408  * wmi_unified_twt_nudge_dialog_cmd() - Send WMI command to nudge TWT dialog
409  * @wmi_handle: wmi handle
410  * @params: Parameters to be configured
411  *
412  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
413  */
414 QDF_STATUS
415 wmi_unified_twt_nudge_dialog_cmd(wmi_unified_t wmi_handle,
416 				 struct wmi_twt_nudge_dialog_cmd_param *params);
417 
418 /**
419  * wmi_unified_twt_resume_dialog_cmd() - Send WMI command to resume TWT dialog
420  * @wmi_handle: wmi handle
421  * @params: Parameters to be configured
422  *
423  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
424  */
425 QDF_STATUS wmi_unified_twt_resume_dialog_cmd(
426 			wmi_unified_t wmi_handle,
427 			struct wmi_twt_resume_dialog_cmd_param *params);
428 
429 #ifdef WLAN_SUPPORT_BCAST_TWT
430 /**
431  * wmi_unified_twt_btwt_invite_sta_cmd() - Send WMI command for bTWT sta
432  *                               invitation
433  * @wmi_handle: wmi handle
434  * @params: Parameters to be configured
435  *
436  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
437  */
438 QDF_STATUS wmi_unified_twt_btwt_invite_sta_cmd(
439 			wmi_unified_t wmi_handle,
440 			struct wmi_twt_btwt_invite_sta_cmd_param *params);
441 
442 /**
443  * wmi_unified_twt_btwt_remove_sta_cmd() - Send WMI command for bTWT sta kickoff
444  * @wmi_handle: wmi handle
445  * @params: Parameters to be configured
446  *
447  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
448  */
449 QDF_STATUS wmi_unified_twt_btwt_remove_sta_cmd(
450 			wmi_unified_t wmi_handle,
451 			struct wmi_twt_btwt_remove_sta_cmd_param *params);
452 #endif
453 
454 /**
455  * wmi_extract_twt_enable_comp_event() - Extract WMI event params for TWT enable
456  *                               completion event
457  * @wmi_handle: wmi handle
458  * @evt_buf: Pointer event buffer
459  * @params: Parameters to extract
460  *
461  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
462  */
463 QDF_STATUS wmi_extract_twt_enable_comp_event(
464 		wmi_unified_t wmi_handle,
465 		uint8_t *evt_buf,
466 		struct wmi_twt_enable_complete_event_param *params);
467 
468 /**
469  * wmi_extract_twt_disable_comp_event() - Extract WMI event params for TWT
470  *                               disable completion event
471  * @wmi_handle: wmi handle
472  * @evt_buf: Pointer event buffer
473  * @params: Parameters to extract
474  *
475  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
476  */
477 QDF_STATUS wmi_extract_twt_disable_comp_event(
478 		wmi_unified_t wmi_handle,
479 		uint8_t *evt_buf,
480 		struct wmi_twt_disable_complete_event *params);
481 
482 /**
483  * wmi_extract_twt_add_dialog_comp_event() - Extract WMI event params for TWT
484  *                               add dialog completion event
485  * @wmi_handle: wmi handle
486  * @evt_buf: Pointer event buffer
487  * @params: Parameters to extract
488  *
489  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
490  */
491 QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
492 		wmi_unified_t wmi_handle,
493 		uint8_t *evt_buf,
494 		struct wmi_twt_add_dialog_complete_event_param *params);
495 
496 /**
497  * wmi_extract_twt_add_dialog_comp_additional_params() - Extracts additional
498  * twt parameters, as part of add dialog completion event
499  * @wmi_handle: wmi handle
500  * @evt_buf: Pointer event buffer
501  * @evt_buf_len: length of the add dialog event buffer
502  * @idx: index of num_twt_params to extract
503  * @additional_params: additional parameters to extract
504  *
505  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
506  */
507 QDF_STATUS wmi_extract_twt_add_dialog_comp_additional_params(
508 		wmi_unified_t wmi_handle, uint8_t *evt_buf,
509 		uint32_t evt_buf_len, uint32_t idx,
510 		struct wmi_twt_add_dialog_additional_params *additional_params);
511 
512 /**
513  * wmi_extract_twt_del_dialog_comp_event() - Extract WMI event params for TWT
514  *                               delete dialog completion event
515  * @wmi_handle: wmi handle
516  * @evt_buf: Pointer event buffer
517  * @params: Parameters to extract
518  *
519  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
520  */
521 QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
522 		wmi_unified_t wmi_handle,
523 		uint8_t *evt_buf,
524 		struct wmi_twt_del_dialog_complete_event_param *params);
525 
526 /**
527  * wmi_extract_twt_pause_dialog_comp_event() - Extract WMI event params for TWT
528  *                               pause dialog completion event
529  * @wmi_handle: wmi handle
530  * @evt_buf: Pointer event buffer
531  * @params: Parameters to extract
532  *
533  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
534  */
535 QDF_STATUS wmi_extract_twt_pause_dialog_comp_event(
536 		wmi_unified_t wmi_handle,
537 		uint8_t *evt_buf,
538 		struct wmi_twt_pause_dialog_complete_event_param *params);
539 
540 /**
541  * wmi_extract_twt_nudge_dialog_comp_event() - Extract WMI event params for TWT
542  *                               nudge dialog completion event
543  * @wmi_handle: wmi handle
544  * @evt_buf: Pointer event buffer
545  * @params: Parameters to extract
546  *
547  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
548  */
549 QDF_STATUS wmi_extract_twt_nudge_dialog_comp_event(
550 		wmi_unified_t wmi_handle,
551 		uint8_t *evt_buf,
552 		struct wmi_twt_nudge_dialog_complete_event_param *params);
553 
554 /**
555  * wmi_extract_twt_resume_dialog_comp_event() - Extract WMI event params for TWT
556  *                               resume dialog completion event
557  * @wmi_handle: wmi handle
558  * @evt_buf: Pointer event buffer
559  * @params: Parameters to extract
560  *
561  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
562  */
563 QDF_STATUS wmi_extract_twt_resume_dialog_comp_event(
564 		wmi_unified_t wmi_handle,
565 		uint8_t *evt_buf,
566 		struct wmi_twt_resume_dialog_complete_event_param *params);
567 
568 /**
569  * wmi_extract_twt_notify_event() - Extract WMI event params for TWT
570  *                                  notify event
571  * @wmi_handle: wmi handle
572  * @evt_buf: Pointer event buffer
573  * @params: Parameters to extract
574  *
575  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
576  */
577 QDF_STATUS wmi_extract_twt_notify_event(
578 		wmi_unified_t wmi_handle,
579 		uint8_t *evt_buf,
580 		struct wmi_twt_notify_event_param *params);
581 
582 #ifdef WLAN_SUPPORT_BCAST_TWT
583 /**
584  * wmi_extract_twt_btwt_invite_sta_comp_event() - Extract WMI event params for
585  *                          BTWT sta invitation completion event
586  * @wmi_handle: wmi handle
587  * @evt_buf: Pointer event buffer
588  * @params: Parameters to extract
589  *
590  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
591  */
592 QDF_STATUS wmi_extract_twt_btwt_invite_sta_comp_event(
593 		wmi_unified_t wmi_handle,
594 		uint8_t *evt_buf,
595 		struct wmi_twt_btwt_invite_sta_complete_event_param *params);
596 
597 /**
598  * wmi_extract_twt_btwt_remove_sta_comp_event() - Extract WMI event params for
599  *                          BTWT sta kickoff completion event
600  * @wmi_handle: wmi handle
601  * @evt_buf: Pointer event buffer
602  * @params: Parameters to extract
603  *
604  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
605  */
606 QDF_STATUS wmi_extract_twt_btwt_remove_sta_comp_event(
607 		wmi_unified_t wmi_handle,
608 		uint8_t *evt_buf,
609 		struct wmi_twt_btwt_remove_sta_complete_event_param *params);
610 #endif
611 
612 /**
613  * wmi_extract_twt_session_stats_event() - Extract WMI event params for TWT
614  *                               session stats event
615  * @wmi_handle: wmi handle
616  * @evt_buf: Pointer event buffer
617  * @params: Parameters to extract
618  *
619  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
620  */
621 QDF_STATUS wmi_extract_twt_session_stats_event(
622 		wmi_unified_t wmi_handle,
623 		uint8_t *evt_buf,
624 		struct wmi_twt_session_stats_event_param *params);
625 
626 /**
627  * wmi_extract_twt_session_stats_data() - Extract one TWT session from TWT
628  *                               session stats event
629  * @wmi_handle: wmi handle
630  * @evt_buf: Pointer event buffer
631  * @params: Parameters to extract
632  * @session: Session struct to save one TWT session
633  * @idx: TWT session index
634  *
635  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
636  */
637 QDF_STATUS wmi_extract_twt_session_stats_data(
638 		wmi_unified_t wmi_handle,
639 		uint8_t *evt_buf,
640 		struct wmi_twt_session_stats_event_param *params,
641 		struct wmi_host_twt_session_stats_info *session,
642 		uint32_t idx);
643 
644 void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle);
645 
646 /**
647  * wmi_extract_twt_cap_service_ready_ext2: Extract TWT bitmap value
648  *                                         received through extended
649  *                                         service ready2 event
650  * @wmi_handle: WMI handle
651  * @evt_buf: Event buffer
652  * @params: Pointer to TWT bitmap param
653  *
654  * Return: QDF_STATUS_SUCCESS for success or error code
655  */
656 QDF_STATUS wmi_extract_twt_cap_service_ready_ext2(
657 			wmi_unified_t wmi_handle,
658 			uint8_t *evt_buf,
659 			struct wmi_twt_cap_bitmap_params *params);
660 
661 /**
662  * wmi_extract_twt_ack_comp_event() - Extract WMI event params for TWT ack event
663  *
664  * @wmi_handle: wmi handle
665  * @evt_buf: Pointer event buffer
666  * @param: Parameters to extract
667  *
668  * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
669  */
670 QDF_STATUS wmi_extract_twt_ack_comp_event(
671 			wmi_unified_t wmi_handle,
672 			uint8_t *evt_buf,
673 			struct wmi_twt_ack_complete_event_param *param);
674 #else
wmi_twt_attach_tlv(struct wmi_unified * wmi_handle)675 static inline void wmi_twt_attach_tlv(struct wmi_unified *wmi_handle)
676 {
677 }
678 #endif
679 #endif /* _WMI_UNIFIED_TWT_API_H_ */
680