xref: /wlan-dirver/qca-wifi-host-cmn/umac/twt/dispatcher/inc/wlan_twt_public_structs.h (revision 45c28558a520fd0e975b20c0ad534a0aa7f08021)
1 /*
2  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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  * DOC: This file contains various structures, macros used by the TWT
21  * component and other components interfacing with TWT component.
22  */
23 
24 #ifndef _WLAN_TWT_PUBLIC_STRUCTS_H_
25 #define _WLAN_TWT_PUBLIC_STRUCTS_H_
26 
27 #include <qdf_types.h>
28 
29 #define WLAN_MAX_TWT_SESSIONS_PER_PEER 1
30 #define TWT_ALL_SESSIONS_DIALOG_ID 255
31 
32 /**
33  * enum wlan_twt_commands  - TWT commands
34  * @WLAN_TWT_NONE: Indicates none of the TWT commands are active.
35  * @WLAN_TWT_SETUP: TWT setup
36  * @WLAN_TWT_TERMINATE: TWT terminate
37  * @WLAN_TWT_SUSPEND: TWT suspend
38  * @WLAN_TWT_RESUME: TWT resume
39  * @WLAN_TWT_NUDGE: TWT nudge
40  * @WLAN_TWT_STATISTICS: TWT statistics
41  * @WLAN_TWT_CLEAR_STATISTICS: TWT clear statistics
42  * @WLAN_TWT_ANY: Indicates one of the commands is in progress.
43  */
44 enum wlan_twt_commands {
45 	WLAN_TWT_NONE             = 0,
46 	WLAN_TWT_SETUP            = BIT(0),
47 	WLAN_TWT_TERMINATE        = BIT(1),
48 	WLAN_TWT_SUSPEND          = BIT(2),
49 	WLAN_TWT_RESUME           = BIT(3),
50 	WLAN_TWT_NUDGE            = BIT(4),
51 	WLAN_TWT_STATISTICS       = BIT(5),
52 	WLAN_TWT_CLEAR_STATISTICS = BIT(6),
53 	WLAN_TWT_ANY              = 0xFF,
54 };
55 
56 /**
57  * enum wlan_twt_capabilities  - Represents the Bitmap of TWT capabilities
58  * supported by device and peer.
59  * @WLAN_TWT_CAPA_REQUESTOR: TWT requestor support is advertised by TWT
60  * non-scheduling STA.
61  * @WLAN_TWT_CAPA_RESPONDER: TWT responder support is advertised by TWT
62  * AP.
63  * @WLAN_TWT_CAPA_BROADCAST: This indicates support for the role of broadcast
64  * TWT scheduling/receiving functionality.
65  * @WLAN_TWT_CAPA_FLEXIBLE: Device supports flexible TWT schedule.
66  * @WLAN_TWT_CAPA_REQUIRED: The TWT Required is advertised by AP to indicate
67  * that it mandates the associated HE STAs to support TWT.
68  */
69 enum wlan_twt_capabilities {
70 	WLAN_TWT_CAPA_REQUESTOR = BIT(0),
71 	WLAN_TWT_CAPA_RESPONDER = BIT(1),
72 	WLAN_TWT_CAPA_BROADCAST = BIT(2),
73 	WLAN_TWT_CAPA_FLEXIBLE =  BIT(3),
74 	WLAN_TWT_CAPA_REQUIRED =  BIT(4),
75 };
76 
77 /**
78  * enum wlan_twt_session_state  - TWT session state for a dialog id
79  * @WLAN_TWT_SETUP_STATE_NOT_ESTABLISHED: Session doesn't exist
80  * @WLAN_TWT_SETUP_STATE_ACTIVE: TWT session is active
81  * @WLAN_TWT_SETUP_STATE_SUSPEND: TWT session is suspended
82  */
83 enum wlan_twt_session_state {
84 	WLAN_TWT_SETUP_STATE_NOT_ESTABLISHED = 0,
85 	WLAN_TWT_SETUP_STATE_ACTIVE          = 1,
86 	WLAN_TWT_SETUP_STATE_SUSPEND         = 2,
87 };
88 
89 /* enum TWT_ROLE - role specified in ext conf in wmi_twt_enable/disable_cmd
90  * TWT_ROLE_REQUESTOR: TWT role is requestor
91  * TWT_ROLE_RESPONDER: TWT role is responder
92  */
93 enum TWT_ROLE {
94 	TWT_ROLE_REQUESTOR,
95 	TWT_ROLE_RESPONDER,
96 };
97 
98 /* enum TWT_OPERATION - specified in ext conf in wmi_twt_enable/disable_cmd
99  * TWT_OPERATION_INDIVIDUAL: Individual TWT operation
100  * TWT_OPERATION_BROADCAST: Broadcast TWT operation
101  */
102 enum TWT_OPERATION {
103 	TWT_OPERATION_INDIVIDUAL,
104 	TWT_OPERATION_BROADCAST,
105 };
106 
107 /**
108  * struct twt_enable_param:
109  * @pdev_id: pdev_id for identifying the MAC.
110  * @sta_cong_timer_ms: STA TWT congestion timer TO value in terms of ms
111  * @mbss_support: Flag indicating if AP TWT feature supported in
112  *                MBSS mode or not.
113  * @default_slot_size: This is the default value for the TWT slot setup
114  *                by AP (units = microseconds)
115  * @congestion_thresh_setup: Minimum congestion required to start setting
116  *                up TWT sessions
117  * @congestion_thresh_teardown: Minimum congestion below which TWT will be
118  *                torn down (in percent of occupied airtime)
119  * @congestion_thresh_critical: Threshold above which TWT will not be active
120  *                (in percent of occupied airtime)
121  * @interference_thresh_teardown: Minimum interference above that TWT
122  *                 will not be active. The interference parameters use an
123  *                 abstract method of evaluating interference.
124  *                 The parameters are in percent, ranging from 0 for no
125  *                 interference, to 100 for interference extreme enough
126  *                 to completely block the signal of interest.
127  * @interference_thresh_setup: Minimum interference below that TWT session
128  *                 can be setup. The interference parameters use an
129  *                 abstract method of evaluating interference.
130  *                 The parameters are in percent, ranging from 0 for no
131  *                 interference, to 100 for interference extreme enough
132  *                 to completely block the signal of interest.
133  * @min_no_sta_setup: Minimum no of STA required to start TWT setup
134  * @min_no_sta_teardown: Minimum no of STA below which TWT will be torn down
135  * @no_of_bcast_mcast_slots: Number of default slot sizes reserved for
136  *                 BCAST/MCAST delivery
137  * @min_no_twt_slots: Minimum no of available slots for TWT to be operational
138  * @max_no_sta_twt: Max no of STA with which TWT is possible
139  *                 (must be <= the wmi_resource_config's twt_ap_sta_count value)
140  *      * The below interval parameters have units of milliseconds.
141  * @mode_check_interval: Interval between two successive check to decide the
142  *                 mode of TWT. (units = milliseconds)
143  * @add_sta_slot_interval: Interval between decisions making to create
144  *                 TWT slots for STAs. (units = milliseconds)
145  * @remove_sta_slot_interval: Inrerval between decisions making to remove TWT
146  *                 slot of STAs. (units = milliseconds)
147  * @twt_role: values from enum TWT_ROLE.
148  * @twt_oper: values from enum TWT_OPERATION.
149  * @ext_conf_present: If requestor/responder extend config is present.
150  * @b_twt_enable: Enable or disable broadcast TWT.
151  * @b_twt_legacy_mbss_enable: Enable or disable legacy MBSSID TWT.
152  * @b_twt_ax_mbss_enable: Enable or disable 11AX MBSSID TWT.
153  */
154 struct twt_enable_param {
155 	uint32_t pdev_id;
156 	uint32_t sta_cong_timer_ms;
157 	uint32_t mbss_support;
158 	uint32_t default_slot_size;
159 	uint32_t congestion_thresh_setup;
160 	uint32_t congestion_thresh_teardown;
161 	uint32_t congestion_thresh_critical;
162 	uint32_t interference_thresh_teardown;
163 	uint32_t interference_thresh_setup;
164 	uint32_t min_no_sta_setup;
165 	uint32_t min_no_sta_teardown;
166 	uint32_t no_of_bcast_mcast_slots;
167 	uint32_t min_no_twt_slots;
168 	uint32_t max_no_sta_twt;
169 	uint32_t mode_check_interval;
170 	uint32_t add_sta_slot_interval;
171 	uint32_t remove_sta_slot_interval;
172 	enum TWT_ROLE twt_role;
173 	enum TWT_OPERATION twt_oper;
174 	bool ext_conf_present;
175 	uint32_t b_twt_enable:1,
176 		 b_twt_legacy_mbss_enable:1,
177 		 b_twt_ax_mbss_enable:1;
178 };
179 
180 /* HOST_TWT_DISABLE_REASON - reason code of disable TWT
181  * @HOST_TWT_DISABLE_REASON_NONE: Host sends TWT disable command to firmware
182  *                              in normal case.
183  * @HOST_TWT_DISABLE_REASON_CONCURRENCY_SCC: Host sends TWT disable command
184  *                              to firmware when SCC concurrency exist.
185  * @HOST_TWT_DISABLE_REASON_CONCURRENCY_MCC: Host sends TWT disable command
186  *                              to firmware when MCC concurrency exist.
187  * @HOST_TWT_DISABLE_REASON_CHANGE_CONGESTION_TIMEOUT: Host sends TWT disable
188  *                              command to firmware to change congestion timeout
189  * @HOST_TWT_DISABLE_REASON_P2P_GO_NOA: Host sends TWT disable command to
190  *                              firmware when P2P GO NOA exist.
191  */
192 enum HOST_TWT_DISABLE_REASON {
193 	HOST_TWT_DISABLE_REASON_NONE,
194 	HOST_TWT_DISABLE_REASON_CONCURRENCY_SCC,
195 	HOST_TWT_DISABLE_REASON_CONCURRENCY_MCC,
196 	HOST_TWT_DISABLE_REASON_CHANGE_CONGESTION_TIMEOUT,
197 	HOST_TWT_DISABLE_REASON_P2P_GO_NOA,
198 };
199 
200 /**
201  * struct twt_disable_param:
202  * @pdev_id: pdev_id for identifying the MAC.
203  * @ext_conf_present: If requestor/responder extend config is present.
204  * @twt_role: values from enum TWT_ROLE.
205  * @twt_oper: values from enum TWT_OPERATION.
206  * @dis_reason_code: values from disable reason code.
207  */
208 struct twt_disable_param {
209 	uint32_t pdev_id;
210 	bool ext_conf_present;
211 	enum TWT_ROLE twt_role;
212 	enum TWT_OPERATION twt_oper;
213 	enum HOST_TWT_DISABLE_REASON dis_reason_code;
214 };
215 
216 /* status code of enabling TWT
217  * HOST_TWT_ENABLE_STATUS_OK: enabling TWT successfully completed
218  * HOST_TWT_ENABLE_STATUS_ALREADY_ENABLED: TWT already enabled
219  * HOST_TWT_ENABLE_STATUS_NOT_READY: FW not ready for enabling TWT
220  * HOST_TWT_ENABLE_INVALID_PARAM: invalid parameters
221  * HOST_TWT_ENABLE_STATUS_UNKNOWN_ERROR: enabling TWT failed with an
222  *                                      unknown reason
223  * HOST_TWT_ENABLE_STATUS_INVALID_COMMAND: If the host has sent TWT enable
224  *                     command and received TWT disable event or any other event
225  *                     then host sets this status internally.
226  */
227 enum HOST_TWT_ENABLE_STATUS {
228 	HOST_TWT_ENABLE_STATUS_OK,
229 	HOST_TWT_ENABLE_STATUS_ALREADY_ENABLED,
230 	HOST_TWT_ENABLE_STATUS_NOT_READY,
231 	HOST_TWT_ENABLE_INVALID_PARAM,
232 	HOST_TWT_ENABLE_STATUS_UNKNOWN_ERROR,
233 };
234 
235 /* enum - status code of adding TWT dialog
236  * @HOST_ADD_TWT_STATUS_OK: adding TWT dialog successfully completed
237  * @HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED: TWT not enabled
238  * @HOST_ADD_TWT_STATUS_USED_DIALOG_ID: TWT dialog ID is already used
239  * @HOST_ADD_TWT_STATUS_INVALID_PARAM: invalid parameters
240  * @HOST_ADD_TWT_STATUS_NOT_READY: FW not ready
241  * @HOST_ADD_TWT_STATUS_NO_RESOURCE: FW resource exhausted
242  * @HOST_ADD_TWT_STATUS_NO_ACK: peer AP/STA did not ACK the
243  * request/response frame
244  * @HOST_ADD_TWT_STATUS_NO_RESPONSE: peer AP did not send the response frame
245  * @HOST_ADD_TWT_STATUS_DENIED: AP did not accept the request
246  * @HOST_ADD_TWT_STATUS_UNKNOWN_ERROR: adding TWT dialog failed with
247  * an unknown reason
248  * @HOST_ADD_TWT_STATUS_AP_PARAMS_NOT_IN_RANGE: peer AP wake interval,
249  * duration not in range
250  * @HOST_ADD_TWT_STATUS_AP_IE_VALIDATION_FAILED: peer AP IE Validation
251  * Failed
252  * @HOST_ADD_TWT_STATUS_ROAM_IN_PROGRESS: Roaming in progress
253  * @HOST_ADD_TWT_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
254  * @HOST_ADD_TWT_STATUS_SCAN_IN_PROGRESS: Scan is in progress
255  */
256 enum HOST_ADD_TWT_STATUS {
257 	HOST_ADD_TWT_STATUS_OK,
258 	HOST_ADD_TWT_STATUS_TWT_NOT_ENABLED,
259 	HOST_ADD_TWT_STATUS_USED_DIALOG_ID,
260 	HOST_ADD_TWT_STATUS_INVALID_PARAM,
261 	HOST_ADD_TWT_STATUS_NOT_READY,
262 	HOST_ADD_TWT_STATUS_NO_RESOURCE,
263 	HOST_ADD_TWT_STATUS_NO_ACK,
264 	HOST_ADD_TWT_STATUS_NO_RESPONSE,
265 	HOST_ADD_TWT_STATUS_DENIED,
266 	HOST_ADD_TWT_STATUS_UNKNOWN_ERROR,
267 	HOST_ADD_TWT_STATUS_AP_PARAMS_NOT_IN_RANGE,
268 	HOST_ADD_TWT_STATUS_AP_IE_VALIDATION_FAILED,
269 	HOST_ADD_TWT_STATUS_ROAM_IN_PROGRESS,
270 	HOST_ADD_TWT_STATUS_CHAN_SW_IN_PROGRESS,
271 	HOST_ADD_TWT_STATUS_SCAN_IN_PROGRESS,
272 };
273 
274 /**
275  * struct twt_enable_complete_event_param:
276  * @pdev_id: pdev_id for identifying the MAC.
277  * @status: From enum TWT_ENABLE_STATUS
278  */
279 struct twt_enable_complete_event_param {
280 	uint32_t pdev_id;
281 	uint32_t status;
282 };
283 
284 /* enum HOST_TWT_DISABLE_STATUS  - status code of disable TWT
285  * @HOST_TWT_DISABLE_STATUS_OK: TWT disable is successfully completed
286  * @HOST_TWT_DISABLE_STATUS_ROAM_IN_PROGRESS: roaming in progress
287  * @HOST_TWT_DISABLE_STATUS_CHAN_SW_IN_PROGRESS: channel switch in progress
288  * @HOST_TWT_DISABLE_STATUS_SCAN_IN_PROGRESS: scan in progress
289  * @HOST_TWT_DISABLE_STATUS_UNKNOWN_ERROR: unknown error
290  */
291 enum HOST_TWT_DISABLE_STATUS {
292 	HOST_TWT_DISABLE_STATUS_OK,
293 	HOST_TWT_DISABLE_STATUS_ROAM_IN_PROGRESS,
294 	HOST_TWT_DISABLE_STATUS_CHAN_SW_IN_PROGRESS,
295 	HOST_TWT_DISABLE_STATUS_SCAN_IN_PROGRESS,
296 	HOST_TWT_DISABLE_STATUS_UNKNOWN_ERROR,
297 };
298 
299 /**
300  * struct twt_disable_complete_event:
301  * @pdev_id: pdev_id for identifying the MAC.
302  * @status: From enum HOST_TWT_DISABLE_STATUS
303  */
304 struct twt_disable_complete_event_param {
305 	uint32_t pdev_id;
306 	uint32_t status;
307 };
308 
309 /**
310  * twt_ack_context - twt ack private context
311  * @vdev_id: vdev id
312  * @peer_macaddr: peer mac address
313  * @dialog_id: dialog id
314  * @twt_cmd_ack: twt ack command
315  * @status: twt command status
316  */
317 struct twt_ack_context {
318 	uint32_t vdev_id;
319 	struct qdf_mac_addr peer_macaddr;
320 	uint32_t dialog_id;
321 	uint32_t twt_cmd_ack;
322 	uint32_t status;
323 };
324 
325 /**
326  * twt_en_dis_context - twt enable/disable private context
327  * @twt_role: twt role. When the upper layer is invoking requestor/responder
328  * enable/disable command via the TWT component API, Firmare WMI event
329  * doesn't have the info in the event params to distinguish if this enable or
330  * disable is for requestor or responder, hence TWT component stores this role
331  * before the request is sent to the firmware.
332  * @context: cookie. This is the cookie information passed back to the upper
333  * layer to help identify the request structure
334  */
335 struct twt_en_dis_context {
336 	enum TWT_ROLE twt_role;
337 	void *context;
338 };
339 
340 /**
341  * struct twt_ack_complete_event_param:
342  * @vdev_id: vdev id
343  * @peer_macaddr: peer mac address
344  * @dialog_id: dialog id
345  * @twt_cmd_ack: ack event to the corresponding twt command
346  * @status: twt command status
347  */
348 struct twt_ack_complete_event_param {
349 	uint32_t vdev_id;
350 	struct qdf_mac_addr peer_macaddr;
351 	uint32_t dialog_id;
352 	uint32_t twt_cmd_ack;
353 	uint32_t status;
354 };
355 
356 /**
357  * struct twt_session_stats_info:
358  * @vdev_id: id of VDEV for twt session
359  * @peer_mac: MAC address of node
360  * @event_type: Indicates TWT session type (SETUP/TEARDOWN/UPDATE)
361  * @flow_id: TWT flow identifier established with TWT peer
362  * @bcast:  If this is a broacast TWT session
363  * @trig: If the TWT session is trigger enabled
364  * @announ: If the flow type is announced/unannounced
365  * @protection: If the TWT protection field is set
366  * @info_frame_disabled: If the TWT Information frame is disabled
367  * @dialog_id: Dialog_id of current session
368  * @wake_dura_us: wake duration in us
369  * @wake_intvl_us: wake time interval in us
370  * @sp_offset_us: Time until initial TWT SP occurs
371  * @sp_tsf_us_lo: TWT wake time TSF in usecs lower bits - 31:0
372  * @sp_tsf_us_hi: TWT wake time TSF in usecs higher bits - 63:32
373  */
374 struct twt_session_stats_info {
375 	uint32_t vdev_id;
376 	struct qdf_mac_addr peer_mac;
377 	uint32_t event_type;
378 	uint32_t flow_id:16,
379 		 bcast:1,
380 		 trig:1,
381 		 announ:1,
382 		 protection:1,
383 		 info_frame_disabled:1,
384 		 pm_responder_bit_valid:1,
385 		 pm_responder_bit:1;
386 	uint32_t dialog_id;
387 	uint32_t wake_dura_us;
388 	uint32_t wake_intvl_us;
389 	uint32_t sp_offset_us;
390 	uint32_t sp_tsf_us_lo;
391 	uint32_t sp_tsf_us_hi;
392 };
393 
394 /**
395  * struct twt_session_stats_event_param:
396  * @pdev_id: pdev_id for identifying the MAC.
397  * @num_sessions: number of TWT sessions
398  * @twt_sessions: received TWT sessions
399  */
400 struct twt_session_stats_event_param {
401 	uint32_t pdev_id;
402 	uint32_t num_sessions;
403 };
404 
405 /* from IEEE 802.11ah section 9.4.2.200 */
406 enum HOST_TWT_COMMAND {
407 	HOST_TWT_COMMAND_REQUEST_TWT    = 0,
408 	HOST_TWT_COMMAND_SUGGEST_TWT    = 1,
409 	HOST_TWT_COMMAND_DEMAND_TWT     = 2,
410 	HOST_TWT_COMMAND_TWT_GROUPING   = 3,
411 	HOST_TWT_COMMAND_ACCEPT_TWT     = 4,
412 	HOST_TWT_COMMAND_ALTERNATE_TWT  = 5,
413 	HOST_TWT_COMMAND_DICTATE_TWT    = 6,
414 	HOST_TWT_COMMAND_REJECT_TWT     = 7,
415 };
416 
417 /**
418  * struct twt_add_dialog_param -
419  * @vdev_id: VDEV identifier
420  * @peer_macaddr: peer MAC address when vdev is AP VDEV
421  * @dialog_id: diaglog_id (TWT dialog ID)
422  *             This dialog ID must be unique within its vdev.
423  * @wake_intvl_us: TWT Wake Interval in units of us
424  * @wake_intvl_mantis: TWT Wake Interval Mantissa
425  *                 - wake_intvl_mantis must be <= 0xFFFF
426  *                 - wake_intvl_us must be divided evenly by wake_intvl_mantis,
427  *                   i.e., wake_intvl_us % wake_intvl_mantis == 0
428  *                 - the quotient of wake_intvl_us/wake_intvl_mantis must be
429  *                   2 to N-th(0<=N<=31) power,
430  *                   i.e., wake_intvl_us/wake_intvl_mantis == 2^N, 0<=N<=31
431  * @min_wake_intvl_us: Min tolerance limit of TWT wake interval
432  * @max_wake_intvl_us: Max tolerance limit of TWT wake interval
433  * @wake_dura_us: TWT Wake Duration in units of us, must be <= 0xFFFF
434  *                wake_dura_us must be divided evenly by 256,
435  *                i.e., wake_dura_us % 256 == 0
436  * @min_wake_dura_us: Min tolerance limit of TWT wake duration.
437  * @max_wake_dura_us: Max tolerance limit of TWT wake duration.
438  * @sp_offset_us: this long time after TWT setup the 1st SP will start.
439  * @twt_cmd: cmd from enum HOST_TWT_COMMAND
440  * @flag_bcast: 0 means Individual TWT,
441  *              1 means Broadcast TWT
442  * @flag_trigger: 0 means non-Trigger-enabled TWT,
443  *                1 means  means Trigger-enabled TWT
444  * @flag_flow_type:  0 means announced TWT,
445  *                   1 means un-announced TWT
446  * @flag_protection: 0 means TWT protection is required,
447  *                   1 means TWT protection is not required
448  * @b_twt_id0: 0 means BTWT recommendation will not be used
449  *             1 means BTWT recommendation will be used
450  * @flag_reserved: unused bits
451  * @b_twt_recommendation: defines types of frames tx during bTWT SP
452  * @b_twt_persistence: Countdown VAL frames to param update/teardown
453  * @wake_time_tsf: Absolute TSF value to start first TWT service period
454  * @annouce_timeout_us: Timeout value before sending QoS NULL frame.
455  */
456 struct twt_add_dialog_param {
457 	uint32_t vdev_id;
458 	struct qdf_mac_addr peer_macaddr;
459 	uint32_t dialog_id;
460 	uint32_t wake_intvl_us;
461 	uint32_t wake_intvl_mantis;
462 	uint32_t min_wake_intvl_us;
463 	uint32_t max_wake_intvl_us;
464 	uint32_t wake_dura_us;
465 	uint32_t min_wake_dura_us;
466 	uint32_t max_wake_dura_us;
467 	uint32_t sp_offset_us;
468 	enum HOST_TWT_COMMAND twt_cmd;
469 	uint32_t
470 		flag_bcast:1,
471 		flag_trigger:1,
472 		flag_flow_type:1,
473 		flag_protection:1,
474 		flag_b_twt_id0:1,
475 		flag_reserved:11,
476 		b_twt_persistence:8,
477 		b_twt_recommendation:3;
478 	uint64_t wake_time_tsf;
479 	uint32_t announce_timeout_us;
480 };
481 
482 /* enum HOST_TWT_GET_STATS_STATUS - status code of TWT Get stats dialog id
483  * @HOST_TWT_GET_STATS_STATUS_OK: Get status TWT dialog successfully completed
484  * @HOST_TWT_GET_STATS_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID does not exist
485  * @HOST_TWT_GET_STATS_STATUS_INVALID_PARAM: Invalid parameters
486  * @HOST_TWT_GET_STATS_STATUS_UNKNOWN_ERROR: Unknown error
487  */
488 enum HOST_TWT_GET_STATS_STATUS {
489 	HOST_TWT_GET_STATS_STATUS_OK,
490 	HOST_TWT_GET_STATS_STATUS_DIALOG_ID_NOT_EXIST,
491 	HOST_TWT_GET_STATS_STATUS_INVALID_PARAM,
492 	HOST_TWT_GET_STATS_STATUS_UNKNOWN_ERROR,
493 };
494 
495 /* enum HOST_TWT_ADD_STATUS - status code of TWT add dialog
496  * @HOST_TWT_ADD_STATUS_OK: add TWT dialog successfully completed
497  * @HOST_TWT_ADD_STATUS_TWT_NOT_ENABLED: TWT not enabled
498  * @HOST_TWT_ADD_STATUS_USED_DIALOG_ID: TWT dialog ID is already used
499  * @HOST_TWT_ADD_STATUS_INVALID_PARAM: invalid parameters
500  * @HOST_TWT_ADD_STATUS_NOT_READY: FW not ready
501  * @HOST_TWT_ADD_STATUS_NO_RESOURCE: FW resource exhausted
502  * @HOST_TWT_ADD_STATUS_NO_ACK: peer AP/STA did not ACK the
503  * request/response frame
504  * @HOST_TWT_ADD_STATUS_NO_RESPONSE: peer AP did not send the response frame
505  * @HOST_TWT_ADD_STATUS_DENIED: AP did not accept the request
506  * @HOST_TWT_ADD_STATUS_UNKNOWN_ERROR: adding TWT dialog failed with
507  * an unknown reason
508  * @HOST_TWT_ADD_STATUS_AP_PARAMS_NOT_IN_RANGE: peer AP wake interval,
509  * duration not in range
510  * @HOST_TWT_ADD_STATUS_AP_IE_VALIDATION_FAILED: peer AP IE Validation
511  * Failed
512  * @HOST_TWT_ADD_STATUS_ROAM_IN_PROGRESS: Roaming in progress
513  * @HOST_TWT_ADD_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
514  * @HOST_TWT_ADD_STATUS_SCAN_IN_PROGRESS: Scan is in progress
515  */
516 enum HOST_TWT_ADD_STATUS {
517 	HOST_TWT_ADD_STATUS_OK,
518 	HOST_TWT_ADD_STATUS_TWT_NOT_ENABLED,
519 	HOST_TWT_ADD_STATUS_USED_DIALOG_ID,
520 	HOST_TWT_ADD_STATUS_INVALID_PARAM,
521 	HOST_TWT_ADD_STATUS_NOT_READY,
522 	HOST_TWT_ADD_STATUS_NO_RESOURCE,
523 	HOST_TWT_ADD_STATUS_NO_ACK,
524 	HOST_TWT_ADD_STATUS_NO_RESPONSE,
525 	HOST_TWT_ADD_STATUS_DENIED,
526 	HOST_TWT_ADD_STATUS_UNKNOWN_ERROR,
527 	HOST_TWT_ADD_STATUS_AP_PARAMS_NOT_IN_RANGE,
528 	HOST_TWT_ADD_STATUS_AP_IE_VALIDATION_FAILED,
529 	HOST_TWT_ADD_STATUS_ROAM_IN_PROGRESS,
530 	HOST_TWT_ADD_STATUS_CHAN_SW_IN_PROGRESS,
531 	HOST_TWT_ADD_STATUS_SCAN_IN_PROGRESS,
532 };
533 
534 /**
535  * struct twt_add_dialog_additional_params -
536  * @twt_cmd: TWT command
537  * @bcast: 0 means Individual TWT
538  *         1 means Broadcast TWT
539  * @trig_en: 0 means non-Trigger-enabled TWT
540  *           1 means Trigger-enabled TWT
541  * @announce: 0 means announced TWT
542  *            1 means un-announced TWT
543  * @protection: 0 means TWT protection is required
544  *              1 means TWT protection is not required
545  * @b_twt_id0: 0 means non-0 B-TWT ID or I-TWT
546  *             1 means B-TWT ID 0
547  * @info_frame_disabled: 0 means TWT Information frame is enabled
548  *                       1 means TWT Information frame is disabled
549  * @pm_responder_bit_valid: 1 means responder pm mode field is valid
550  *                          0 means responder pm mode field is not valid
551  * @pm_responder_bit: 1 means that responder set responder pm mode to 1
552  *                    0 means that responder set responder pm mode to 0
553  * @wake_dura_us: wake duration in us
554  * @wake_intvl_us: wake time interval in us
555  * @sp_offset_us: Time until initial TWT SP occurs
556  * @sp_tsf_us_lo: TWT service period tsf in usecs lower bits - 31:0
557  * @sp_tsf_us_hi: TWT service period tsf in usecs higher bits - 63:32
558  */
559 struct twt_add_dialog_additional_params {
560 	uint32_t twt_cmd:8,
561 		 bcast:1,
562 		 trig_en:1,
563 		 announce:1,
564 		 protection:1,
565 		 b_twt_id0:1,
566 		 info_frame_disabled:1,
567 		 pm_responder_bit_valid:1,
568 		 pm_responder_bit:1;
569 	uint32_t wake_dur_us;
570 	uint32_t wake_intvl_us;
571 	uint32_t sp_offset_us;
572 	uint32_t sp_tsf_us_lo;
573 	uint32_t sp_tsf_us_hi;
574 };
575 
576 /**
577  * struct twt_add_dialog_complete_param -
578  * @vdev_id: VDEV identifier
579  * @peer_macaddr: Peer mac address
580  * @dialog_id: TWT dialog ID
581  * @status: refer to HOST_TWT_ADD_STATUS enum
582  * @num_additional_twt_params: no of additional_twt_params available
583  */
584 struct twt_add_dialog_complete_event_param {
585 	uint32_t vdev_id;
586 	struct qdf_mac_addr peer_macaddr;
587 	uint32_t dialog_id;
588 	uint32_t status;
589 	uint32_t num_additional_twt_params;
590 };
591 
592 /**
593  * struct twt_add_dialog_complete_event - TWT add dialog complete event
594  * @params: Fixed parameters for TWT add dialog complete event
595  * @additional_params: additional parameters for TWT add dialog complete event
596  *
597  * Holds the fixed and additional parameters from add dialog
598  * complete event
599  */
600 struct twt_add_dialog_complete_event {
601 	struct twt_add_dialog_complete_event_param params;
602 	struct twt_add_dialog_additional_params additional_params;
603 };
604 
605 /**
606  * struct twt_del_dialog_param -
607  * @vdev_id: VDEV identifier
608  * @peer_macaddr: Peer mac address
609  * @dialog_id: TWT dialog ID
610  * @b_twt_persistence: persistence val for b-twt
611  */
612 struct twt_del_dialog_param {
613 	uint32_t vdev_id;
614 	struct qdf_mac_addr peer_macaddr;
615 	uint32_t dialog_id;
616 #ifdef WLAN_SUPPORT_BCAST_TWT
617 	uint32_t b_twt_persistence;
618 #endif
619 };
620 
621 /**
622  * enum HOST_TWT_DEL_STATUS - status code of delete TWT dialog
623  * @HOST_TWT_DEL_STATUS_OK: deleting TWT dialog successfully completed
624  * @HOST_TWT_DEL_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
625  * @HOST_TWT_DEL_STATUS_INVALID_PARAM: invalid parameters
626  * @HOST_TWT_DEL_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
627  * this dialog
628  * @HOST_TWT_DEL_STATUS_NO_RESOURCE: FW resource exhausted
629  * @HOST_TWT_DEL_STATUS_NO_ACK: peer AP/STA did not ACK the request/response
630  * frame
631  * @HOST_TWT_DEL_STATUS_UNKNOWN_ERROR: deleting TWT dialog failed with an
632  * unknown reason
633  * @HOST_TWT_DEL_STATUS_PEER_INIT_TEARDOWN: Peer initiated TWT teardown
634  * @HOST_TWT_DEL_STATUS_ROAMING: TWT teardown due to roaming.
635  * @HOST_TWT_DEL_STATUS_CONCURRENCY: TWT session teardown due to
636  * concurrent session coming up.
637  * @HOST_TWT_DEL_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
638  * @HOST_TWT_DEL_STATUS_SCAN_IN_PROGRESS: Scan is in progress
639  * @HOST_TWT_DEL_STATUS_PS_DISABLE_TEARDOWN: PS disable TWT teardown
640  */
641 enum HOST_TWT_DEL_STATUS {
642 	HOST_TWT_DEL_STATUS_OK,
643 	HOST_TWT_DEL_STATUS_DIALOG_ID_NOT_EXIST,
644 	HOST_TWT_DEL_STATUS_INVALID_PARAM,
645 	HOST_TWT_DEL_STATUS_DIALOG_ID_BUSY,
646 	HOST_TWT_DEL_STATUS_NO_RESOURCE,
647 	HOST_TWT_DEL_STATUS_NO_ACK,
648 	HOST_TWT_DEL_STATUS_UNKNOWN_ERROR,
649 	HOST_TWT_DEL_STATUS_PEER_INIT_TEARDOWN,
650 	HOST_TWT_DEL_STATUS_ROAMING,
651 	HOST_TWT_DEL_STATUS_CONCURRENCY,
652 	HOST_TWT_DEL_STATUS_CHAN_SW_IN_PROGRESS,
653 	HOST_TWT_DEL_STATUS_SCAN_IN_PROGRESS,
654 	HOST_TWT_DEL_STATUS_PS_DISABLE_TEARDOWN,
655 };
656 
657 /**
658  * struct twt_del_dialog_complete_event_param -
659  * @vdev_id: VDEV identifier
660  * @peer_macaddr: Peer mac address
661  * @dialog_id: TWT dialog ID
662  * @b_twt_persistence: persistence val for b-twt
663  * @status: refer to HOST_TWT_DEL_STATUS enum
664  */
665 struct twt_del_dialog_complete_event_param {
666 	uint32_t vdev_id;
667 	struct qdf_mac_addr peer_macaddr;
668 	uint32_t dialog_id;
669 #ifdef WLAN_SUPPORT_BCAST_TWT
670 	uint32_t b_twt_persistence;
671 #endif
672 	uint32_t status;
673 };
674 
675 /**
676  * struct twt_pause_dialog_cmd_param -
677  * @vdev_id: VDEV identifier
678  * @peer_macaddr: Peer mac address
679  * @dialog_id: TWT dialog ID
680  */
681 struct twt_pause_dialog_cmd_param {
682 	uint32_t vdev_id;
683 	struct qdf_mac_addr peer_macaddr;
684 	uint32_t dialog_id;
685 };
686 
687 /**
688  * struct twt_nudge_dialog_cmd_param -
689  * @vdev_id: VDEV identifier
690  * @peer_macaddr: Peer mac address
691  * @dialog_id: TWT dialog ID
692  * @suspend_duration: TWT suspend duration in microseconds
693  * @next_twt_size: next TWT size
694  * @sp_start_offset: value to offset the start of service period
695  */
696 struct twt_nudge_dialog_cmd_param {
697 	uint32_t vdev_id;
698 	struct qdf_mac_addr peer_macaddr;
699 	uint32_t dialog_id;
700 	uint32_t suspend_duration;
701 	uint32_t next_twt_size;
702 	int32_t sp_start_offset;
703 };
704 
705 /* enum HOST_TWT_PAUSE_STATUS - status code of pause TWT dialog
706  * @HOST_TWT_PAUSE_STATUS_OK: pausing TWT dialog successfully completed
707  * @HOST_TWT_PAUSE_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
708  * @HOST_TWT_PAUSE_STATUS_INVALID_PARAM: invalid parameters
709  * @HOST_TWT_PAUSE_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
710  * this dialog
711  * @HOST_TWT_PAUSE_STATUS_NO_RESOURCE: FW resource exhausted
712  * @HOST_TWT_PAUSE_STATUS_NO_ACK: peer AP/STA did not ACK the
713  * request/response frame
714  * @HOST_TWT_PAUSE_STATUS_UNKNOWN_ERROR: pausing TWT dialog failed with an
715  * unknown reason
716  * @HOST_TWT_PAUSE_STATUS_ALREADY_PAUSED: TWT dialog already in paused state
717  * @HOST_TWT_PAUSE_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
718  * @HOST_TWT_PAUSE_STATUS_ROAM_IN_PROGRESS: Roaming is in progress
719  * @HOST_TWT_PAUSE_STATUS_SCAN_IN_PROGRESS: Scan is in progress
720  */
721 enum HOST_TWT_PAUSE_STATUS {
722 	HOST_TWT_PAUSE_STATUS_OK,
723 	HOST_TWT_PAUSE_STATUS_DIALOG_ID_NOT_EXIST,
724 	HOST_TWT_PAUSE_STATUS_INVALID_PARAM,
725 	HOST_TWT_PAUSE_STATUS_DIALOG_ID_BUSY,
726 	HOST_TWT_PAUSE_STATUS_NO_RESOURCE,
727 	HOST_TWT_PAUSE_STATUS_NO_ACK,
728 	HOST_TWT_PAUSE_STATUS_UNKNOWN_ERROR,
729 	HOST_TWT_PAUSE_STATUS_ALREADY_PAUSED,
730 	HOST_TWT_PAUSE_STATUS_CHAN_SW_IN_PROGRESS,
731 	HOST_TWT_PAUSE_STATUS_ROAM_IN_PROGRESS,
732 	HOST_TWT_PAUSE_STATUS_SCAN_IN_PROGRESS,
733 };
734 
735 /**
736  * struct twt_pause_dialog_complete_event_param -
737  * @vdev_id: VDEV identifier
738  * @peer_macaddr: Peer mac address
739  * @dialog_id: TWT dialog ID
740  * @status: refer to HOST_TWT_PAUSE_STATUS
741  */
742 struct twt_pause_dialog_complete_event_param {
743 	uint32_t vdev_id;
744 	struct qdf_mac_addr peer_macaddr;
745 	uint32_t dialog_id;
746 	enum HOST_TWT_PAUSE_STATUS status;
747 };
748 
749 /* enum HOST_TWT_NUDGE_STATUS - status code of nudge TWT dialog
750  * @HOST_TWT_NUDGE_STATUS_OK: nudge TWT dialog successfully completed
751  * @HOST_TWT_NUDGE_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
752  * @HOST_TWT_NUDGE_STATUS_INVALID_PARAM: invalid parameters
753  * @HOST_TWT_NUDGE_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
754  * this dialog
755  * @HOST_TWT_NUDGE_STATUS_NO_RESOURCE: FW resource exhausted
756  * @HOST_TWT_NUDGE_STATUS_NO_ACK: peer AP/STA did not ACK the
757  * request/response frame
758  * @HOST_TWT_NUDGE_STATUS_UNKNOWN_ERROR: nudge TWT dialog failed with an
759  * unknown reason
760  * @HOST_TWT_NUDGE_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
761  * @HOST_TWT_NUDGE_STATUS_ROAM_IN_PROGRESS: Roaming in progress
762  * @HOST_TWT_NUDGE_STATUS_SCAN_IN_PROGRESS: Scan is in progress
763  */
764 enum HOST_TWT_NUDGE_STATUS {
765 	HOST_TWT_NUDGE_STATUS_OK,
766 	HOST_TWT_NUDGE_STATUS_DIALOG_ID_NOT_EXIST,
767 	HOST_TWT_NUDGE_STATUS_INVALID_PARAM,
768 	HOST_TWT_NUDGE_STATUS_DIALOG_ID_BUSY,
769 	HOST_TWT_NUDGE_STATUS_NO_RESOURCE,
770 	HOST_TWT_NUDGE_STATUS_NO_ACK,
771 	HOST_TWT_NUDGE_STATUS_UNKNOWN_ERROR,
772 	HOST_TWT_NUDGE_STATUS_ALREADY_PAUSED,
773 	HOST_TWT_NUDGE_STATUS_CHAN_SW_IN_PROGRESS,
774 	HOST_TWT_NUDGE_STATUS_ROAM_IN_PROGRESS,
775 	HOST_TWT_NUDGE_STATUS_SCAN_IN_PROGRESS,
776 };
777 
778 /**
779  * struct twt_nudge_dialog_complete_event_param -
780  * @vdev_id: VDEV identifier
781  * @peer_macaddr: Peer mac address
782  * @dialog_id: TWT dialog ID
783  * @status: refer to HOST_TWT_PAUSE_STATUS
784  * @next_twt_tsf_us_lo: TSF lower bits (31:0) of next wake time
785  * @next_twt_tsf_us_hi: TSF higher bits (32:63) of next wake time
786  */
787 struct twt_nudge_dialog_complete_event_param {
788 	uint32_t vdev_id;
789 	struct qdf_mac_addr peer_macaddr;
790 	uint32_t dialog_id;
791 	enum     HOST_TWT_NUDGE_STATUS status;
792 	uint32_t next_twt_tsf_us_lo;
793 	uint32_t next_twt_tsf_us_hi;
794 };
795 
796 /**
797  * struct twt_resume_dialog_cmd_param -
798  * @vdev_id: VDEV identifier
799  * @peer_macaddr: Peer mac address
800  * @dialog_id: TWT dialog ID
801  * @sp_offset_us: this long time after TWT resumed the 1st SP will start
802  * @next_twt_size: Next TWT subfield Size.
803  *                 Refer IEEE 802.11ax section "9.4.1.60 TWT Information field"
804  */
805 struct twt_resume_dialog_cmd_param {
806 	uint32_t vdev_id;
807 	struct qdf_mac_addr peer_macaddr;
808 	uint32_t dialog_id;
809 	uint32_t sp_offset_us;
810 	uint32_t next_twt_size;
811 };
812 
813 /* enum HOST_TWT_RESUME_STATUS - status code of resume TWT dialog
814  * @HOST_TWT_RESUME_STATUS_OK: resuming TWT dialog successfully completed
815  * @HOST_TWT_RESUME_STATUS_DIALOG_ID_NOT_EXIST: TWT dialog ID not exists
816  * @HOST_TWT_RESUME_STATUS_INVALID_PARAM: invalid parameters
817  * @HOST_TWT_RESUME_STATUS_DIALOG_ID_BUSY: FW is in the process of handling
818  * this dialog
819  * @HOST_TWT_RESUME_STATUS_NOT_PAUSED: dialog not paused currently
820  * @HOST_TWT_RESUME_STATUS_NO_RESOURCE: FW resource exhausted
821  * @HOST_TWT_RESUME_STATUS_NO_ACK: peer AP/STA did not ACK the
822  * request/response frame
823  * @HOST_TWT_RESUME_STATUS_UNKNOWN_ERROR: resuming TWT dialog failed with an
824  * unknown reason
825  * @HOST_TWT_RESUME_STATUS_CHAN_SW_IN_PROGRESS: Channel switch in progress
826  * @HOST_TWT_RESUME_STATUS_ROAM_IN_PROGRESS: Roaming in progress
827  * @HOST_TWT_RESUME_STATUS_SCAN_IN_PROGRESS: Scan is in progress
828  */
829 enum HOST_TWT_RESUME_STATUS {
830 	HOST_TWT_RESUME_STATUS_OK,
831 	HOST_TWT_RESUME_STATUS_DIALOG_ID_NOT_EXIST,
832 	HOST_TWT_RESUME_STATUS_INVALID_PARAM,
833 	HOST_TWT_RESUME_STATUS_DIALOG_ID_BUSY,
834 	HOST_TWT_RESUME_STATUS_NOT_PAUSED,
835 	HOST_TWT_RESUME_STATUS_NO_RESOURCE,
836 	HOST_TWT_RESUME_STATUS_NO_ACK,
837 	HOST_TWT_RESUME_STATUS_UNKNOWN_ERROR,
838 	HOST_TWT_RESUME_STATUS_CHAN_SW_IN_PROGRESS,
839 	HOST_TWT_RESUME_STATUS_ROAM_IN_PROGRESS,
840 	HOST_TWT_RESUME_STATUS_SCAN_IN_PROGRESS,
841 };
842 
843 /**
844  * struct twt_resume_dialog_complete_event_param -
845  * @vdev_id: VDEV identifier
846  * @peer_macaddr: Peer mac address
847  * @dialog_id: TWT dialog ID
848  * @status: refer to HOST_TWT_RESUME_STATUS
849  */
850 struct twt_resume_dialog_complete_event_param {
851 	uint32_t vdev_id;
852 	struct qdf_mac_addr peer_macaddr;
853 	uint32_t dialog_id;
854 	uint32_t status;
855 };
856 
857 /* enum HOST_TWT_NOTIFY_STATUS - status code of notify TWT event
858  * @HOST_TWT_NOTIFY_EVENT_READY: FW is ready to process the TWT setup request.
859  * @HOST_TWT_NOTIFY_EVENT_AP_TWT_REQ_BIT_SET: AP set the TWT required bit
860  * @HOST_TWT_NOTIFY_EVENT_AP_TWT_REQ_BIT_CLEAR: AP cleared the TWT required bit
861  */
862 enum HOST_TWT_NOTIFY_STATUS {
863 	HOST_TWT_NOTIFY_EVENT_READY,
864 	HOST_TWT_NOTIFY_EVENT_AP_TWT_REQ_BIT_SET,
865 	HOST_TWT_NOTIFY_EVENT_AP_TWT_REQ_BIT_CLEAR,
866 };
867 
868 /**
869  * struct twt_notify_event_param -
870  * @vdev_id: VDEV identifier
871  * @status: refer to HOST_TWT_NOTIFY_STATUS
872  */
873 struct twt_notify_event_param {
874 	uint32_t vdev_id;
875 	enum HOST_TWT_NOTIFY_STATUS status;
876 };
877 
878 /* HOST_TWT_NEXT_WORK_ACTION - next action of TWT worker thread
879  * @HOST_TWT_SEND_DELETE_CMD: Send TWT delete command request
880  */
881 enum HOST_TWT_NEXT_WORK_ACTION {
882 	HOST_TWT_SEND_DELETE_CMD = 1,
883 };
884 
885 /**
886  * struct twt_work_params
887  * @peer_macaddr: peer mac address
888  * @dialog_id: Dialog ID
889  */
890 struct twt_work_params {
891 	struct qdf_mac_addr peer_macaddr;
892 	uint32_t dialog_id;
893 };
894 #ifdef WLAN_SUPPORT_BCAST_TWT
895 /**
896  * struct twt_btwt_invite_sta_cmd_param -
897  * @vdev_id: VDEV identifier
898  * @peer_macaddr: Peer mac address
899  * @dialog_id: TWT dialog ID
900  */
901 struct twt_btwt_invite_sta_cmd_param {
902 	uint32_t vdev_id;
903 	struct qdf_mac_addr peer_macaddr;
904 	uint32_t dialog_id;
905 };
906 
907 /* enum HOST_TWT_INVITATION_BTWT_STATUS - status code of TWT Invitation
908  *                              dialog
909  * HOST_TWT_INVITATION_BTWT_STATUS_OK: BTWT invitation successfully
910  *                              completed
911  * HOST_TWT_INVITATION_TWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
912  *                              exists
913  * HOST_TWT_INVITATION_BTWT_STATUS_INVALID_PARAM: invalid parameters
914  * HOST_TWT_INVITATION_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
915  *                              handling this dialog
916  * HOST_TWT_INVITATION_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
917  * HOST_TWT_INVITATION_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
918  *                              request/response frame
919  * HOST_TWT_INVITATION_BTWT_STATUS_UNKNOWN_ERROR: BTWT invitation failed
920  *                              with an unknown reason
921  */
922 enum HOST_TWT_INVITATION_BTWT_STATUS {
923 	HOST_TWT_INVITATION_BTWT_STATUS_OK,
924 	HOST_TWT_INVITATION_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
925 	HOST_TWT_INVITATION_BTWT_STATUS_INVALID_PARAM,
926 	HOST_TWT_INVITATION_BTWT_STATUS_DIALOG_ID_BUSY,
927 	HOST_TWT_INVITATION_BTWT_STATUS_NO_RESOURCE,
928 	HOST_TWT_INVITATION_BTWT_STATUS_NO_ACK,
929 	HOST_TWT_INVITATION_BTWT_STATUS_UNKNOWN_ERROR,
930 };
931 
932 /**
933  * struct twt_btwt_invite_sta_complete_event_param -
934  * @vdev_id: VDEV identifier
935  * @peer_macaddr: Peer mac address
936  * @dialog_id: BTWT dialog ID
937  * @status: refer to HOST_TWT_INVITATION_BTWT_STATUS
938  */
939 struct twt_btwt_invite_sta_complete_event_param {
940 	uint32_t vdev_id;
941 	struct qdf_mac_addr peer_macaddr;
942 	uint32_t dialog_id;
943 	uint32_t status;
944 };
945 
946 /**
947  * struct twt_btwt_remove_sta_cmd_param -
948  * @vdev_id: VDEV identifier
949  * @peer_macaddr: Peer mac address
950  * @dialog_id: BTWT dialog ID
951  */
952 struct twt_btwt_remove_sta_cmd_param {
953 	uint32_t vdev_id;
954 	struct qdf_mac_addr peer_macaddr;
955 	uint32_t dialog_id;
956 };
957 
958 /* enum HOST_TWT_KICKOFF_BTWT_STATUS - status code of kickoff BTWT dialog
959  * HOST_TWT_KICKOFF_BTWT_STATUS_OK: TWT kickoff successfully completed
960  * HOST_TWT_KICKOFF_BTWT_STATUS_DIALOG_ID_NOT_EXIST: BTWT dialog ID not
961  *                              exists
962  * HOST_TWT_KICKOFF_BTWT_STATUS_INVALID_PARAM: invalid parameters
963  * HOST_TWT_KICKOFF_BTWT_STATUS_DIALOG_ID_BUSY: FW is in the process of
964  *                              handling this dialog
965  * HOST_TWT_KICKOFF_BTWT_STATUS_NOT_PAUSED: Dialog not currently paused
966  * HOST_TWT_KICKOFF_BTWT_STATUS_NO_RESOURCE: FW resource exhausted
967  * HOST_TWT_KICKOFF_BTWT_STATUS_NO_ACK: peer AP/STA did not ACK the
968  *                              request/response frame
969  * HOST_TWT_KICKOFF_BTWT_STATUS_UNKNOWN_ERROR: BTWT kickoff failed with an
970  *                              unknown reason
971  */
972 enum HOST_TWT_KICKOFF_BTWT_STATUS {
973 	HOST_TWT_KICKOFF_BTWT_STATUS_OK,
974 	HOST_TWT_KICKOFF_BTWT_STATUS_DIALOG_ID_NOT_EXIST,
975 	HOST_TWT_KICKOFF_BTWT_STATUS_INVALID_PARAM,
976 	HOST_TWT_KICKOFF_BTWT_STATUS_DIALOG_ID_BUSY,
977 	HOST_TWT_KICKOFF_BTWT_STATUS_NOT_PAUSED,
978 	HOST_TWT_KICKOFF_BTWT_STATUS_NO_RESOURCE,
979 	HOST_TWT_KICKOFF_BTWT_STATUS_NO_ACK,
980 	HOST_TWT_KICKOFF_BTWT_STATUS_UNKNOWN_ERROR,
981 };
982 
983 /**
984  * struct twt_btwt_remove_sta_complete_event_param -
985  * @vdev_id: VDEV identifier
986  * @peer_macaddr: Peer mac address
987  * @dialog_id: BTWT dialog ID
988  * @status: refer to HOST_TWT_KICKOFF_BTWT_STATUS
989  */
990 struct twt_btwt_remove_sta_complete_event_param {
991 	uint32_t vdev_id;
992 	struct qdf_mac_addr peer_macaddr;
993 	uint32_t dialog_id;
994 	uint32_t status;
995 };
996 #endif
997 
998 /**
999  * enum HOST_TWT_CMD_FOR_ACK_EVENT - Ack event for different TWT command
1000  * HOST_TWT_ADD_DIALOG_CMDID: Ack event for add dialog command
1001  * HOST_TWT_DEL_DIALOG_CMDID: Ack event for delete dialog command
1002  * HOST_TWT_PAUSE_DIALOG_CMDID: Ack event for pause command
1003  * HOST_TWT_RESUME_DIALOG_CMDID: Ack event for resume command
1004  * HOST_TWT_NUDGE_DIALOG_CMDID: Ack event for nudge command
1005  * HOST_TWT_UNKNOWN_CMDID: Ack event for unknown TWT command
1006  */
1007 enum HOST_TWT_CMD_FOR_ACK_EVENT {
1008 	HOST_TWT_ADD_DIALOG_CMDID = 0,
1009 	HOST_TWT_DEL_DIALOG_CMDID,
1010 	HOST_TWT_PAUSE_DIALOG_CMDID,
1011 	HOST_TWT_RESUME_DIALOG_CMDID,
1012 	HOST_TWT_NUDGE_DIALOG_CMDID,
1013 	HOST_TWT_UNKNOWN_CMDID,
1014 };
1015 
1016 /* access categories */
1017 enum twt_traffic_ac {
1018 	TWT_AC_VO  = 0,
1019 	TWT_AC_VI  = 1,
1020 	TWT_AC_BE  = 2,
1021 	TWT_AC_BK  = 3,
1022 	TWT_AC_MAX = 4,
1023 };
1024 
1025 #endif /* _WLAN_TWT_PUBLIC_STRUCTS_H_ */
1026 
1027