xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_twt_param.h (revision 97f44cd39e4ff816eaa1710279d28cf6b9e65ad9)
1 /*
2  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /*
20  * This file contains the API definitions for the TWT WMI APIs.
21  */
22 
23 #ifndef _WMI_UNIFIED_TWT_PARAM_H_
24 #define _WMI_UNIFIED_TWT_PARAM_H_
25 
26 /**
27  * @pdev_id: pdev_id for identifying the MAC.
28  * @sta_cong_timer_ms: STA TWT congestion timer TO value in terms of ms
29  * @mbss_support: Flag indicating if AP TWT feature supported in
30  *                MBSS mode or not.
31  * @default_slot_size: This is the default value for the TWT slot setup
32  *                by AP (units = microseconds)
33  * @congestion_thresh_setup: Minimum congestion required to start setting
34  *                up TWT sessions
35  * @congestion_thresh_teardown: Minimum congestion below which TWT will be
36  *                torn down (in percent of occupied airtime)
37  * @congestion_thresh_critical: Threshold above which TWT will not be active
38  *                (in percent of occupied airtime)
39  * @interference_thresh_teardown: Minimum interference above that TWT
40  *                 will not be active. The interference parameters use an
41  *                 abstract method of evaluating interference.
42  *                 The parameters are in percent, ranging from 0 for no
43  *                 interference, to 100 for interference extreme enough
44  *                 to completely block the signal of interest.
45  * @interference_thresh_setup: Minimum interference below that TWT session
46  *                 can be setup. The interference parameters use an
47  *                 abstract method of evaluating interference.
48  *                 The parameters are in percent, ranging from 0 for no
49  *                 interference, to 100 for interference extreme enough
50  *                 to completely block the signal of interest.
51  * @min_no_sta_setup: Minimum no of STA required to start TWT setup
52  * @min_no_sta_teardown: Minimum no of STA below which TWT will be torn down
53  * @no_of_bcast_mcast_slots: Number of default slot sizes reserved for
54  *                 BCAST/MCAST delivery
55  * @min_no_twt_slots: Minimum no of available slots for TWT to be operational
56  * @max_no_sta_twt: Max no of STA with which TWT is possible
57  *                 (must be <= the wmi_resource_config's twt_ap_sta_count value)
58  *      * The below interval parameters have units of milliseconds.
59  * @mode_check_interval: Interval between two successive check to decide the
60  *                 mode of TWT. (units = milliseconds)
61  * @add_sta_slot_interval: Interval between decisions making to create
62  *                 TWT slots for STAs. (units = milliseconds)
63  * @remove_sta_slot_interval: Inrerval between decisions making to remove TWT
64  *                 slot of STAs. (units = milliseconds)
65  * @b_twt_enable: Enable or disable broadcast TWT.
66  * @b_twt_legacy_mbss_enable: Enable or disable legacy MBSSID TWT.
67  * @b_twt_ax_mbss_enable: Enable or disable 11AX MBSSID TWT.
68  */
69 struct wmi_twt_enable_param {
70 	uint32_t pdev_id;
71 	uint32_t sta_cong_timer_ms;
72 	uint32_t mbss_support;
73 	uint32_t default_slot_size;
74 	uint32_t congestion_thresh_setup;
75 	uint32_t congestion_thresh_teardown;
76 	uint32_t congestion_thresh_critical;
77 	uint32_t interference_thresh_teardown;
78 	uint32_t interference_thresh_setup;
79 	uint32_t min_no_sta_setup;
80 	uint32_t min_no_sta_teardown;
81 	uint32_t no_of_bcast_mcast_slots;
82 	uint32_t min_no_twt_slots;
83 	uint32_t max_no_sta_twt;
84 	uint32_t mode_check_interval;
85 	uint32_t add_sta_slot_interval;
86 	uint32_t remove_sta_slot_interval;
87 	uint32_t b_twt_enable:1,
88 		 b_twt_legacy_mbss_enable:1,
89 		 b_twt_ax_mbss_enable:1;
90 };
91 
92 /* status code of enabling TWT
93  * WMI_ENABLE_TWT_STATUS_OK: enabling TWT successfully completed
94  * WMI_ENABLE_TWT_STATUS_ALREADY_ENABLED: TWT already enabled
95  * WMI_ENABLE_TWT_STATUS_NOT_READY: FW not ready for enabling TWT
96  * WMI_ENABLE_TWT_INVALID_PARAM: invalid parameters
97  * WMI_ENABLE_TWT_STATUS_UNKNOWN_ERROR: enabling TWT failed with an
98  *                                      unknown reason
99  */
100 enum WMI_HOST_ENABLE_TWT_STATUS {
101 	WMI_HOST_ENABLE_TWT_STATUS_OK,
102 	WMI_HOST_ENABLE_TWT_STATUS_ALREADY_ENABLED,
103 	WMI_HOST_ENABLE_TWT_STATUS_NOT_READY,
104 	WMI_HOST_ENABLE_TWT_INVALID_PARAM,
105 	WMI_HOST_ENABLE_TWT_STATUS_UNKNOWN_ERROR,
106 };
107 
108 /** struct wmi_twt_enable_complete_event_param:
109  * @pdev_is: pdev_id for identifying the MAC.
110  * @status: From enum WMI_HOST_ENABLE_TWT_STATUS
111  */
112 struct wmi_twt_enable_complete_event_param {
113 	uint32_t pdev_id;
114 	uint32_t status;
115 };
116 
117 /** struct wmi_twt_disable_param:
118  * @pdev_id: pdev_id for identifying the MAC.
119  */
120 struct wmi_twt_disable_param {
121 	uint32_t pdev_id;
122 };
123 
124 /** struct wmi_twt_disable_complete_event:
125  * @pdev_id: pdev_id for identifying the MAC.
126  */
127 struct wmi_twt_disable_complete_event {
128 	uint32_t pdev_id;
129 };
130 
131 /* TWT event types
132  *  refer to wmi_unified.h enum wmi_twt_session_stats_type
133  */
134 enum host_twt_session_stats_type {
135 	HOST_TWT_SESSION_SETUP     = 1,
136 	HOST_TWT_SESSION_TEARDOWN  = 2,
137 	HOST_TWT_SESSION_UPDATE    = 3,
138 };
139 
140 /**
141  * struct wmi_host_twt_session_stats_info:
142  * @vdev_id: id of VDEV for twt session
143  * @peer_mac: MAC address of node
144  * @event_type: Indicates TWT session type (SETUP/TEARDOWN/UPDATE)
145  * @flow_id: TWT flow identifier established with TWT peer
146  * @bcast:  If this is a broacast TWT session
147  * @trig: If the TWT session is trigger enabled
148  * @announ: If the flow type is announced/unannounced
149  * @protection: If the TWT protection field is set
150  * @info_frame_disabled: If the TWT Information frame is disabled
151  * @dialog_id: Dialog_id of current session
152  * @wake_dura_us: wake duration in us
153  * @wake_intvl_us: wake time interval in us
154  * @sp_offset_us: Time until initial TWT SP occurs
155  * @sp_tsf_us_lo: TWT wake time TSF in usecs lower bits - 31:0
156  * @sp_tsf_us_hi: TWT wake time TSF in usecs higher bits - 63:32
157  */
158 struct wmi_host_twt_session_stats_info {
159 	uint32_t vdev_id;
160 	uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
161 	uint32_t event_type;
162 	uint32_t flow_id:16,
163 		 bcast:1,
164 		 trig:1,
165 		 announ:1,
166 		 protection:1,
167 		 info_frame_disabled:1;
168 	uint32_t dialog_id;
169 	uint32_t wake_dura_us;
170 	uint32_t wake_intvl_us;
171 	uint32_t sp_offset_us;
172 	uint32_t sp_tsf_us_lo;
173 	uint32_t sp_tsf_us_hi;
174 };
175 
176 /** struct wmi_twt_session_stats_event:
177  * @pdev_id: pdev_id for identifying the MAC.
178  * @num_sessions: number of TWT sessions
179  * @twt_sessions: received TWT sessions
180  */
181 struct wmi_twt_session_stats_event_param {
182 	uint32_t pdev_id;
183 	uint32_t num_sessions;
184 };
185 
186 /* from IEEE 802.11ah section 9.4.2.200 */
187 enum WMI_HOST_TWT_COMMAND {
188 	WMI_HOST_TWT_COMMAND_REQUEST_TWT    = 0,
189 	WMI_HOST_TWT_COMMAND_SUGGEST_TWT    = 1,
190 	WMI_HOST_TWT_COMMAND_DEMAND_TWT     = 2,
191 	WMI_HOST_TWT_COMMAND_TWT_GROUPING   = 3,
192 	WMI_HOST_TWT_COMMAND_ACCEPT_TWT     = 4,
193 	WMI_HOST_TWT_COMMAND_ALTERNATE_TWT  = 5,
194 	WMI_HOST_TWT_COMMAND_DICTATE_TWT    = 6,
195 	WMI_HOST_TWT_COMMAND_REJECT_TWT     = 7,
196 };
197 
198 /** struct wmi_twt_add_dialog_param -
199  * @vdev_id: VDEV identifier
200  * @peer_macaddr: peer MAC address when vdev is AP VDEV
201  * @dialog_id: diaglog_id (TWT dialog ID)
202  *             This dialog ID must be unique within its vdev.
203  * @wake_intvl_us: TWT Wake Interval in units of us
204  * @wake_intvl_mantis: TWT Wake Interval Mantissa
205  *                 - wake_intvl_mantis must be <= 0xFFFF
206  *                 - wake_intvl_us must be divided evenly by wake_intvl_mantis,
207  *                   i.e., wake_intvl_us % wake_intvl_mantis == 0
208  *                 - the quotient of wake_intvl_us/wake_intvl_mantis must be
209  *                   2 to N-th(0<=N<=31) power,
210  *                   i.e., wake_intvl_us/wake_intvl_mantis == 2^N, 0<=N<=31
211  * @wake_dura_us: TWT Wake Duration in units of us, must be <= 0xFFFF
212  *                wake_dura_us must be divided evenly by 256,
213  *                i.e., wake_dura_us % 256 == 0
214  * @sp_offset_us: this long time after TWT setup the 1st SP will start.
215  * @twt_cmd: cmd from enum WMI_HOST_TWT_COMMAND
216  * @flag_bcast: 0 means Individual TWT,
217  *              1 means Broadcast TWT
218  * @flag_trigger: 0 means non-Trigger-enabled TWT,
219  *                1 means  means Trigger-enabled TWT
220  * @flag_flow_type:  0 means announced TWT,
221  *                   1 means un-announced TWT
222  * @flag_protection: 0 means TWT protection is required,
223  *                   1 means TWT protection is not required
224  * @b_twt_id0: 0 means BTWT recommendation will not be used
225  *             1 means BTWT recommendation will be used
226  * @flag_reserved: unused bits
227  * @b_twt_recommendation: defines types of frames tx during bTWT SP
228  * @b_twt_persistence: Countdown VAL frames to param update/teardown
229  */
230 struct wmi_twt_add_dialog_param {
231 	uint32_t vdev_id;
232 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
233 	uint32_t dialog_id;
234 	uint32_t wake_intvl_us;
235 	uint32_t wake_intvl_mantis;
236 	uint32_t wake_dura_us;
237 	uint32_t sp_offset_us;
238 	enum WMI_HOST_TWT_COMMAND twt_cmd;
239 	uint32_t
240 		flag_bcast:1,
241 		flag_trigger:1,
242 		flag_flow_type:1,
243 		flag_protection:1,
244 		flag_b_twt_id0:1,
245 		flag_reserved:11,
246 		b_twt_persistence:8,
247 		b_twt_recommendation:3;
248 };
249 
250 /* enum - status code of adding TWT dialog
251  * WMI_HOST_ADD_TWT_STATUS_OK: adding TWT dialog successfully completed
252  * WMI_HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED: TWT not enabled
253  * WMI_HOST_ADD_TWT_STATUS_USED_DIALOG_ID: TWT dialog ID is already used
254  * WMI_HOST_ADD_TWT_STATUS_INVALID_PARAM: invalid parameters
255  * WMI_HOST_ADD_TWT_STATUS_NOT_READY: FW not ready
256  * WMI_HOST_ADD_TWT_STATUS_NO_RESOURCE: FW resource exhausted
257  * WMI_HOST_ADD_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
258  *                                 request/response frame
259  * WMI_HOST_ADD_TWT_STATUS_NO_RESPONSE: peer AP did not send the response frame
260  * WMI_HOST_ADD_TWT_STATUS_DENIED: AP did not accept the request
261  * WMI_HOST_ADD_TWT_STATUS_UNKNOWN_ERROR: adding TWT dialog failed with
262  *                                 an unknown reason
263  */
264 enum WMI_HOST_ADD_TWT_STATUS {
265 	WMI_HOST_ADD_TWT_STATUS_OK,
266 	WMI_HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED,
267 	WMI_HOST_ADD_TWT_STATUS_USED_DIALOG_ID,
268 	WMI_HOST_ADD_TWT_STATUS_INVALID_PARAM,
269 	WMI_HOST_ADD_TWT_STATUS_NOT_READY,
270 	WMI_HOST_ADD_TWT_STATUS_NO_RESOURCE,
271 	WMI_HOST_ADD_TWT_STATUS_NO_ACK,
272 	WMI_HOST_ADD_TWT_STATUS_NO_RESPONSE,
273 	WMI_HOST_ADD_TWT_STATUS_DENIED,
274 	WMI_HOST_ADD_TWT_STATUS_UNKNOWN_ERROR,
275 };
276 
277 /**
278  * struct wmi_twt_add_dialog_additional_params -
279  * @twt_cmd: TWT command
280  * @bcast: 0 means Individual TWT
281  *         1 means Broadcast TWT
282  * @trig_en: 0 means non-Trigger-enabled TWT
283  *           1 means Trigger-enabled TWT
284  * @announce: 0 means announced TWT
285  *            1 means un-announced TWT
286  * @protection: 0 means TWT protection is required
287  *              1 means TWT protection is not required
288  * @b_twt_id0: 0 means non-0 B-TWT ID or I-TWT
289  *             1 means B-TWT ID 0
290  * @info_frame_disabled: 0 means TWT Information frame is enabled
291  *                       1 means TWT Information frame is disabled
292  * @wake_dura_us: wake duration in us
293  * @wake_intvl_us: wake time interval in us
294  * @sp_offset_us: Time until initial TWT SP occurs
295  * @sp_tsf_us_lo: TWT service period tsf in usecs lower bits - 31:0
296  * @sp_tsf_us_hi: TWT service period tsf in usecs higher bits - 63:32
297  */
298 struct wmi_twt_add_dialog_additional_params {
299 	uint32_t twt_cmd:8,
300 		 bcast:1,
301 		 trig_en:1,
302 		 announce:1,
303 		 protection:1,
304 		 b_twt_id0:1,
305 		 info_frame_disabled:1;
306 	uint32_t wake_dur_us;
307 	uint32_t wake_intvl_us;
308 	uint32_t sp_offset_us;
309 	uint32_t sp_tsf_us_lo;
310 	uint32_t sp_tsf_us_hi;
311 };
312 
313 /** struct wmi_twt_add_dialog_complete_param -
314  * @vdev_id: VDEV identifier
315  * @peer_macaddr: Peer mac address
316  * @dialog_id: TWT dialog ID
317  * @status: refer to WMI_HOST_ADD_TWT_STATUS enum
318  * @num_additional_twt_params: no of additional_twt_params available
319  */
320 struct wmi_twt_add_dialog_complete_event_param {
321 	uint32_t vdev_id;
322 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
323 	uint32_t dialog_id;
324 	uint32_t status;
325 	uint32_t num_additional_twt_params;
326 };
327 
328 /** struct wmi_twt_del_dialog_param -
329  * @vdev_id: VDEV identifier
330  * @peer_macaddr: Peer mac address
331  * @dialog_id: TWT dialog ID
332  * @b_twt_persistence: persistence val for b-twt
333  */
334 struct wmi_twt_del_dialog_param {
335 	uint32_t vdev_id;
336 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
337 	uint32_t dialog_id;
338 #ifdef WLAN_SUPPORT_BCAST_TWT
339 	uint32_t b_twt_persistence;
340 #endif
341 };
342 
343 /* status code of deleting TWT dialog
344  * WMI_HOST_DEL_TWT_STATUS_OK: deleting TWT dialog successfully completed
345  * WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
346  * WMI_HOST_DEL_TWT_STATUS_INVALID_PARAM: invalid parameters
347  * WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
348  *                                    this dialog
349  * WMI_HOST_DEL_TWT_STATUS_NO_RESOURCE: FW resource exhausted
350  * WMI_HOST_DEL_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the request/response
351  *                            frame
352  * WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR: deleting TWT dialog failed with an
353  *                            unknown reason
354  */
355 enum WMI_HOST_DEL_TWT_STATUS {
356 	WMI_HOST_DEL_TWT_STATUS_OK,
357 	WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_NOT_EXIST,
358 	WMI_HOST_DEL_TWT_STATUS_INVALID_PARAM,
359 	WMI_HOST_DEL_TWT_STATUS_DIALOG_ID_BUSY,
360 	WMI_HOST_DEL_TWT_STATUS_NO_RESOURCE,
361 	WMI_HOST_DEL_TWT_STATUS_NO_ACK,
362 	WMI_HOST_DEL_TWT_STATUS_UNKNOWN_ERROR,
363 };
364 
365 /** struct wmi_twt_del_dialog_complete_event_param -
366  * @vdev_id: VDEV identifier
367  * @peer_macaddr: Peer mac address
368  * @dialog_id: TWT dialog ID
369  * @b_twt_persistence: persistence val for b-twt
370  * @status: refer to WMI_HOST_DEL_TWT_STATUS enum
371  */
372 struct wmi_twt_del_dialog_complete_event_param {
373 	uint32_t vdev_id;
374 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
375 	uint32_t dialog_id;
376 #ifdef WLAN_SUPPORT_BCAST_TWT
377 	uint32_t b_twt_persistence;
378 #endif
379 	uint32_t status;
380 };
381 
382 /** struct wmi_twt_pause_dialog_cmd_param -
383  * @vdev_id: VDEV identifier
384  * @peer_macaddr: Peer mac address
385  * @dialog_id: TWT dialog ID
386  */
387 struct wmi_twt_pause_dialog_cmd_param {
388 	uint32_t vdev_id;
389 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
390 	uint32_t dialog_id;
391 };
392 
393 /* enum WMI_HOST_PAUSE_TWT_STATUS - status code of pausing TWT dialog
394  * WMI_HOST_PAUSE_TWT_STATUS_OK: pausing TWT dialog successfully completed
395  * WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
396  * WMI_HOST_PAUSE_TWT_STATUS_INVALID_PARAM: invalid parameters
397  * WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
398  *                          this dialog
399  * WMI_HOST_PAUSE_TWT_STATUS_NO_RESOURCE: FW resource exhausted
400  * WMI_HOST_PAUSE_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
401  *                          request/response frame
402  * WMI_HOST_PAUSE_TWT_STATUS_UNKNOWN_ERROR: pausing TWT dialog failed with an
403  *                          unknown reason
404  * WMI_HOST_PAUSE_TWT_STATUS_ALREADY_PAUSED: TWT dialog already in paused state
405  */
406 enum WMI_HOST_PAUSE_TWT_STATUS {
407 	WMI_HOST_PAUSE_TWT_STATUS_OK,
408 	WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_NOT_EXIST,
409 	WMI_HOST_PAUSE_TWT_STATUS_INVALID_PARAM,
410 	WMI_HOST_PAUSE_TWT_STATUS_DIALOG_ID_BUSY,
411 	WMI_HOST_PAUSE_TWT_STATUS_NO_RESOURCE,
412 	WMI_HOST_PAUSE_TWT_STATUS_NO_ACK,
413 	WMI_HOST_PAUSE_TWT_STATUS_UNKNOWN_ERROR,
414 	WMI_HOST_PAUSE_TWT_STATUS_ALREADY_PAUSED,
415 };
416 
417 /** struct wmi_twt_pause_dialog_complete_event_param -
418  * @vdev_id: VDEV identifier
419  * @peer_macaddr: Peer mac address
420  * @dialog_id: TWT dialog ID
421  * @status: refer to WMI_HOST_PAUSE_TWT_STATUS
422  */
423 struct wmi_twt_pause_dialog_complete_event_param {
424 	uint32_t vdev_id;
425 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
426 	uint32_t dialog_id;
427 	uint32_t status;
428 };
429 
430 /** struct wmi_twt_resume_dialog_cmd_param -
431  * @vdev_id: VDEV identifier
432  * @peer_macaddr: Peer mac address
433  * @dialog_id: TWT dialog ID
434  * @sp_offset_us: this long time after TWT resumed the 1st SP will start
435  * @next_twt_size: Next TWT subfield Size.
436  *                 Refer IEEE 802.11ax section "9.4.1.60 TWT Information field"
437  */
438 struct wmi_twt_resume_dialog_cmd_param {
439 	uint32_t vdev_id;
440 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
441 	uint32_t dialog_id;
442 	uint32_t sp_offset_us;
443 	uint32_t next_twt_size;
444 };
445 
446 /* enum WMI_HOST_RESUME_TWT_STATUS - status code of resuming TWT dialog
447  * WMI_HOST_RESUME_TWT_STATUS_OK: resuming TWT dialog successfully completed
448  * WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
449  * WMI_HOST_RESUME_TWT_STATUS_INVALID_PARAM: invalid parameters
450  * WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
451  *                            this dialog
452  * WMI_HOST_RESUME_TWT_STATUS_NOT_PAUSED: dialog not paused currently
453  * WMI_HOST_RESUME_TWT_STATUS_NO_RESOURCE: FW resource exhausted
454  * WMI_HOST_RESUME_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
455  *                            request/response frame
456  * WMI_HOST_RESUME_TWT_STATUS_UNKNOWN_ERROR: resuming TWT dialog failed with an
457  *                            unknown reason
458  */
459 enum WMI_HOST_RESUME_TWT_STATUS {
460 	WMI_HOST_RESUME_TWT_STATUS_OK,
461 	WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_NOT_EXIST,
462 	WMI_HOST_RESUME_TWT_STATUS_INVALID_PARAM,
463 	WMI_HOST_RESUME_TWT_STATUS_DIALOG_ID_BUSY,
464 	WMI_HOST_RESUME_TWT_STATUS_NOT_PAUSED,
465 	WMI_HOST_RESUME_TWT_STATUS_NO_RESOURCE,
466 	WMI_HOST_RESUME_TWT_STATUS_NO_ACK,
467 	WMI_HOST_RESUME_TWT_STATUS_UNKNOWN_ERROR,
468 };
469 
470 /** struct wmi_twt_resume_dialog_complete_event_param -
471  * @vdev_id: VDEV identifier
472  * @peer_macaddr: Peer mac address
473  * @dialog_id: TWT dialog ID
474  * @status: refer to WMI_HOST_RESUME_TWT_STATUS
475  */
476 struct wmi_twt_resume_dialog_complete_event_param {
477 	uint32_t vdev_id;
478 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
479 	uint32_t dialog_id;
480 	uint32_t status;
481 };
482 
483 #ifdef WLAN_SUPPORT_BCAST_TWT
484 /** struct wmi_twt_btwt_invite_sta_cmd_param -
485  * @vdev_id: VDEV identifier
486  * @peer_macaddr: Peer mac address
487  * @dialog_id: TWT dialog ID
488  */
489 struct wmi_twt_btwt_invite_sta_cmd_param {
490 	uint32_t vdev_id;
491 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
492 	uint32_t dialog_id;
493 };
494 
495 /* enum WMI_HOST_INVITATION_TWT_BTWT_STATUS - status code of TWT Invitation
496  *                              dialog
497  * WMI_HOST_INVITATION_TWT_BTWT_STATUS_OK: BTWT invitation successfully
498  *                              completed
499  * WMI_HOST_INVITATION_TWT_TWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
500  *                              exists
501  * WMI_HOST_INVITATION_TWT_BTWT_STATUS_INVALID_PARAM: invalid parameters
502  * WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
503  *                              handling this dialog
504  * WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
505  * WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
506  *                              request/response frame
507  * WMI_HOST_INVITATION_TWT_BTWT_STATUS_UNKNOWN_ERROR: BTWT invitation failed
508  *                              with an unknown reason
509  */
510 enum WMI_HOST_INVITATION_TWT_BTWT_STATUS {
511 	WMI_HOST_INVITATION_TWT_BTWT_STATUS_OK,
512 	WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
513 	WMI_HOST_INVITATION_TWT_BTWT_STATUS_INVALID_PARAM,
514 	WMI_HOST_INVITATION_TWT_BTWT_STATUS_DIALOG_ID_BUSY,
515 	WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_RESOURCE,
516 	WMI_HOST_INVITATION_TWT_BTWT_STATUS_NO_ACK,
517 	WMI_HOST_INVITATION_TWT_BTWT_STATUS_UNKNOWN_ERROR,
518 };
519 
520 /** struct wmi_twt_btwt_invite_sta_complete_event_param -
521  * @vdev_id: VDEV identifier
522  * @peer_macaddr: Peer mac address
523  * @dialog_id: BTWT dialog ID
524  * @status: refer to WMI_HOST_INVITATION_TWT_BTWT_STATUS
525  */
526 struct wmi_twt_btwt_invite_sta_complete_event_param {
527 		uint32_t vdev_id;
528 		uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
529 		uint32_t dialog_id;
530 		uint32_t status;
531 };
532 
533 /** struct wmi_twt_btwt_remove_sta_cmd_param -
534  * @vdev_id: VDEV identifier
535  * @peer_macaddr: Peer mac address
536  * @dialog_id: BTWT dialog ID
537  */
538 struct wmi_twt_btwt_remove_sta_cmd_param {
539 		uint32_t vdev_id;
540 		uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
541 		uint32_t dialog_id;
542 };
543 
544 /* enum WMI_HOST_KICKOFF_TWT_BTWT_STATUS - status code of resuming TWT dialog
545  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_OK: TWT kickoff successfully completed
546  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
547  *                              exists
548  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_INVALID_PARAM: invalid parameters
549  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
550  *                              handling this dialog
551  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NOT_PAUSED: Dialog not currently paused
552  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
553  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
554  *                              request/response frame
555  * WMI_HOST_KICKOFF_TWT_BTWT_STATUS_UNKNOWN_ERROR: BTWT kickoff failed with an
556  *                              unknown reason
557  */
558 enum WMI_HOST_KICKOFF_TWT_BTWT_STATUS {
559 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_OK,
560 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
561 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_INVALID_PARAM,
562 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_DIALOG_ID_BUSY,
563 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NOT_PAUSED,
564 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_RESOURCE,
565 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_NO_ACK,
566 	WMI_HOST_KICKOFF_TWT_BTWT_STATUS_UNKNOWN_ERROR,
567 };
568 
569 /** struct wmi_twt_btwt_remove_sta_complete_event_param -
570  * @vdev_id: VDEV identifier
571  * @peer_macaddr: Peer mac address
572  * @dialog_id: BTWT dialog ID
573  * @status: refer to WMI_HOST_KICKOFF_TWT_BTWT_STATUS
574  */
575 struct wmi_twt_btwt_remove_sta_complete_event_param {
576 	uint32_t vdev_id;
577 	uint8_t  peer_macaddr[QDF_MAC_ADDR_SIZE];
578 	uint32_t dialog_id;
579 	uint32_t status;
580 };
581 #endif
582 
583 #endif /* _WMI_UNIFIED_TWT_PARAM_H_ */
584