xref: /freebsd/sys/contrib/dev/iwlwifi/fw/api/mac-cfg.h (revision 97759ccc715c4b365432c16d763c50eecfcb1100)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2012-2014, 2018-2019, 2021-2022 Intel Corporation
4  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5  * Copyright (C) 2016-2017 Intel Deutschland GmbH
6  */
7 #ifndef __iwl_fw_api_mac_cfg_h__
8 #define __iwl_fw_api_mac_cfg_h__
9 
10 #include "mac.h"
11 
12 /**
13  * enum iwl_mac_conf_subcmd_ids - mac configuration command IDs
14  */
15 enum iwl_mac_conf_subcmd_ids {
16 	/**
17 	 * @LOW_LATENCY_CMD: &struct iwl_mac_low_latency_cmd
18 	 */
19 	LOW_LATENCY_CMD = 0x3,
20 	/**
21 	 * @CHANNEL_SWITCH_TIME_EVENT_CMD: &struct iwl_chan_switch_te_cmd
22 	 */
23 	CHANNEL_SWITCH_TIME_EVENT_CMD = 0x4,
24 	/**
25 	 * @MISSED_VAP_NOTIF: &struct iwl_missed_vap_notif
26 	 */
27 	MISSED_VAP_NOTIF = 0xFA,
28 	/**
29 	 * @SESSION_PROTECTION_CMD: &struct iwl_mvm_session_prot_cmd
30 	 */
31 	SESSION_PROTECTION_CMD = 0x5,
32 	/**
33 	 * @CANCEL_CHANNEL_SWITCH_CMD: &struct iwl_cancel_channel_switch_cmd
34 	 */
35 	CANCEL_CHANNEL_SWITCH_CMD = 0x6,
36 	/**
37 	 * @MAC_CONFIG_CMD: &struct iwl_mac_config_cmd
38 	 */
39 	MAC_CONFIG_CMD = 0x8,
40 	/**
41 	 * @LINK_CONFIG_CMD: &struct iwl_link_config_cmd
42 	 */
43 	LINK_CONFIG_CMD = 0x9,
44 	/**
45 	 * @STA_CONFIG_CMD: &struct iwl_mvm_sta_cfg_cmd
46 	 */
47 	STA_CONFIG_CMD = 0xA,
48 	/**
49 	 * @AUX_STA_CMD: &struct iwl_mvm_aux_sta_cmd
50 	 */
51 	AUX_STA_CMD = 0xB,
52 	/**
53 	 * @STA_REMOVE_CMD: &struct iwl_mvm_remove_sta_cmd
54 	 */
55 	STA_REMOVE_CMD = 0xC,
56 	/**
57 	 * @STA_DISABLE_TX_CMD: &struct iwl_mvm_sta_disable_tx_cmd
58 	 */
59 	STA_DISABLE_TX_CMD = 0xD,
60 	/**
61 	 * @SESSION_PROTECTION_NOTIF: &struct iwl_mvm_session_prot_notif
62 	 */
63 	SESSION_PROTECTION_NOTIF = 0xFB,
64 
65 	/**
66 	 * @PROBE_RESPONSE_DATA_NOTIF: &struct iwl_probe_resp_data_notif
67 	 */
68 	PROBE_RESPONSE_DATA_NOTIF = 0xFC,
69 
70 	/**
71 	 * @CHANNEL_SWITCH_START_NOTIF: &struct iwl_channel_switch_start_notif
72 	 */
73 	CHANNEL_SWITCH_START_NOTIF = 0xFF,
74 
75 	/**
76 	 *@CHANNEL_SWITCH_ERROR_NOTIF: &struct iwl_channel_switch_error_notif
77 	 */
78 	CHANNEL_SWITCH_ERROR_NOTIF = 0xF9,
79 };
80 
81 #define IWL_P2P_NOA_DESC_COUNT	(2)
82 
83 /**
84  * struct iwl_p2p_noa_attr - NOA attr contained in probe resp FW notification
85  *
86  * @id: attribute id
87  * @len_low: length low half
88  * @len_high: length high half
89  * @idx: instance of NoA timing
90  * @ctwin: GO's ct window and pwer save capability
91  * @desc: NoA descriptor
92  * @reserved: reserved for alignment purposes
93  */
94 struct iwl_p2p_noa_attr {
95 	u8 id;
96 	u8 len_low;
97 	u8 len_high;
98 	u8 idx;
99 	u8 ctwin;
100 	struct ieee80211_p2p_noa_desc desc[IWL_P2P_NOA_DESC_COUNT];
101 	u8 reserved;
102 } __packed;
103 
104 #define IWL_PROBE_RESP_DATA_NO_CSA (0xff)
105 
106 /**
107  * struct iwl_probe_resp_data_notif - notification with NOA and CSA counter
108  *
109  * @mac_id: the mac which should send the probe response
110  * @noa_active: notifies if the noa attribute should be handled
111  * @noa_attr: P2P NOA attribute
112  * @csa_counter: current csa counter
113  * @reserved: reserved for alignment purposes
114  */
115 struct iwl_probe_resp_data_notif {
116 	__le32 mac_id;
117 	__le32 noa_active;
118 	struct iwl_p2p_noa_attr noa_attr;
119 	u8 csa_counter;
120 	u8 reserved[3];
121 } __packed; /* PROBE_RESPONSE_DATA_NTFY_API_S_VER_1 */
122 
123 /**
124  * struct iwl_missed_vap_notif - notification of missing vap detection
125  *
126  * @mac_id: the mac for which the ucode sends the notification for
127  * @num_beacon_intervals_elapsed: beacons elpased with no vap profile inside
128  * @profile_periodicity: beacons period to have our profile inside
129  * @reserved: reserved for alignment purposes
130  */
131 struct iwl_missed_vap_notif {
132 	__le32 mac_id;
133 	u8 num_beacon_intervals_elapsed;
134 	u8 profile_periodicity;
135 	u8 reserved[2];
136 } __packed; /* MISSED_VAP_NTFY_API_S_VER_1 */
137 
138 /**
139  * struct iwl_channel_switch_start_notif - Channel switch start notification
140  *
141  * @id_and_color: ID and color of the MAC
142  */
143 struct iwl_channel_switch_start_notif_v1 {
144 	__le32 id_and_color;
145 } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
146 
147 /**
148  * struct iwl_channel_switch_start_notif - Channel switch start notification
149  *
150  * @link_id: FW link id
151  */
152 struct iwl_channel_switch_start_notif {
153 	__le32 link_id;
154 } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_3 */
155 
156 #define CS_ERR_COUNT_ERROR BIT(0)
157 #define CS_ERR_LONG_DELAY_AFTER_CS BIT(1)
158 #define CS_ERR_LONG_TX_BLOCK BIT(2)
159 #define CS_ERR_TX_BLOCK_TIMER_EXPIRED BIT(3)
160 
161 /**
162  * struct iwl_channel_switch_error_notif_v1 - Channel switch error notification
163  *
164  * @mac_id: the mac for which the ucode sends the notification for
165  * @csa_err_mask: mask of channel switch error that can occur
166  */
167 struct iwl_channel_switch_error_notif_v1 {
168 	__le32 mac_id;
169 	__le32 csa_err_mask;
170 } __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_1 */
171 
172 /**
173  * struct iwl_channel_switch_error_notif - Channel switch error notification
174  *
175  * @link_id: FW link id
176  * @csa_err_mask: mask of channel switch error that can occur
177  */
178 struct iwl_channel_switch_error_notif {
179 	__le32 link_id;
180 	__le32 csa_err_mask;
181 } __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_2 */
182 
183 /**
184  * struct iwl_cancel_channel_switch_cmd - Cancel Channel Switch command
185  *
186  * @id: the id of the link or mac that should cancel the channel switch
187  */
188 struct iwl_cancel_channel_switch_cmd {
189 	__le32 id;
190 } __packed; /* MAC_CANCEL_CHANNEL_SWITCH_S_VER_1 */
191 
192 /**
193  * struct iwl_chan_switch_te_cmd - Channel Switch Time Event command
194  *
195  * @mac_id: MAC ID for channel switch
196  * @action: action to perform, see &enum iwl_ctxt_action
197  * @tsf: beacon tsf
198  * @cs_count: channel switch count from CSA/eCSA IE
199  * @cs_delayed_bcn_count: if set to N (!= 0) GO/AP can delay N beacon intervals
200  *	at the new channel after the channel switch, otherwise (N == 0) expect
201  *	beacon right after the channel switch.
202  * @cs_mode: 1 - quiet, 0 - otherwise
203  * @reserved: reserved for alignment purposes
204  */
205 struct iwl_chan_switch_te_cmd {
206 	__le32 mac_id;
207 	__le32 action;
208 	__le32 tsf;
209 	u8 cs_count;
210 	u8 cs_delayed_bcn_count;
211 	u8 cs_mode;
212 	u8 reserved;
213 } __packed; /* MAC_CHANNEL_SWITCH_TIME_EVENT_S_VER_2 */
214 
215 /**
216  * struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode'
217  *
218  * @mac_id: MAC ID to whom to apply the low-latency configurations
219  * @low_latency_rx: 1/0 to set/clear Rx low latency direction
220  * @low_latency_tx: 1/0 to set/clear Tx low latency direction
221  * @reserved: reserved for alignment purposes
222  */
223 struct iwl_mac_low_latency_cmd {
224 	__le32 mac_id;
225 	u8 low_latency_rx;
226 	u8 low_latency_tx;
227 	__le16 reserved;
228 } __packed; /* MAC_LOW_LATENCY_API_S_VER_1 */
229 
230 /**
231  * struct iwl_mac_client_data - configuration data for client MAC context
232  *
233  * @is_assoc: 1 for associated state, 0 otherwise
234  * @esr_transition_timeout: the timeout required by the AP for the
235  *	eSR transition.
236  *	Available only from version 2 of the command.
237  *	This values comes from the EMLSR transition delay in the EML
238  *	Capabilities subfield.
239  * @medium_sync_delay: the value as it appeasr in P802.11be_D2.2 Figure 9-1002j.
240  * @assoc_id: unique ID assigned by the AP during association
241  * @reserved1: alignment
242  * @data_policy: see &enum iwl_mac_data_policy
243  * @reserved2: alignment
244  * @ctwin: client traffic window in TU (period after TBTT when GO is present).
245  *	0 indicates that there is no CT window.
246  */
247 struct iwl_mac_client_data {
248 	u8 is_assoc;
249 	u8 esr_transition_timeout;
250 	__le16 medium_sync_delay;
251 
252 	__le16 assoc_id;
253 	__le16 reserved1;
254 	__le16 data_policy;
255 	__le16 reserved2;
256 	__le32 ctwin;
257 } __packed; /* MAC_CONTEXT_CONFIG_CLIENT_DATA_API_S_VER_2 */
258 
259 /**
260  * struct iwl_mac_p2p_dev_data  - configuration data for P2P device MAC context
261  *
262  * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
263  *	other channels as well. This should be to true only in case that the
264  *	device is discoverable and there is an active GO. Note that setting this
265  *	field when not needed, will increase the number of interrupts and have
266  *	effect on the platform power, as this setting opens the Rx filters on
267  *	all macs.
268  */
269 struct iwl_mac_p2p_dev_data {
270 	__le32 is_disc_extended;
271 } __packed; /* MAC_CONTEXT_CONFIG_P2P_DEV_DATA_API_S_VER_1 */
272 
273 /**
274  * enum iwl_mac_config_filter_flags - MAC context configuration filter flags
275  *
276  * @MAC_CFG_FILTER_PROMISC: accept all data frames
277  * @MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT: pass all management and
278  *	control frames to the host
279  * @MAC_CFG_FILTER_ACCEPT_GRP: accept multicast frames
280  * @MAC_CFG_FILTER_ACCEPT_BEACON: accept beacon frames
281  * @MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe response
282  * @MAC_CFG_FILTER_ACCEPT_PROBE_REQ: accept probe requests
283  */
284 enum iwl_mac_config_filter_flags {
285 	MAC_CFG_FILTER_PROMISC			= BIT(0),
286 	MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT	= BIT(1),
287 	MAC_CFG_FILTER_ACCEPT_GRP		= BIT(2),
288 	MAC_CFG_FILTER_ACCEPT_BEACON		= BIT(3),
289 	MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP	= BIT(4),
290 	MAC_CFG_FILTER_ACCEPT_PROBE_REQ		= BIT(5),
291 }; /* MAC_FILTER_FLAGS_MASK_E_VER_1 */
292 
293 /**
294  * struct iwl_mac_config_cmd - command structure to configure MAC contexts in
295  *	MLD API
296  * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
297  *
298  * @id_and_color: ID and color of the MAC
299  * @action: action to perform, see &enum iwl_ctxt_action
300  * @mac_type: one of &enum iwl_mac_types
301  * @local_mld_addr: mld address
302  * @reserved_for_local_mld_addr: reserved
303  * @filter_flags: combination of &enum iwl_mac_config_filter_flags
304  * @he_support: does this MAC support HE
305  * @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
306  * @eht_support: does this MAC support EHT. Requires he_support
307  * @nic_not_ack_enabled: mark that the NIC doesn't support receiving
308  *	ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
309  *	If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
310  *	len delim to determine if AGG or single.
311  * @client: client mac data
312  * @go_ibss: mac data for go or ibss
313  * @p2p_dev: mac data for p2p device
314  */
315 struct iwl_mac_config_cmd {
316 	/* COMMON_INDEX_HDR_API_S_VER_1 */
317 	__le32 id_and_color;
318 	__le32 action;
319 	/* MAC_CONTEXT_TYPE_API_E */
320 	__le32 mac_type;
321 	u8 local_mld_addr[6];
322 	__le16 reserved_for_local_mld_addr;
323 	__le32 filter_flags;
324 	__le16 he_support;
325 	__le16 he_ap_support;
326 	__le32 eht_support;
327 	__le32 nic_not_ack_enabled;
328 	/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_2 */
329 	union {
330 		struct iwl_mac_client_data client;
331 		struct iwl_mac_p2p_dev_data p2p_dev;
332 	};
333 } __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2 */
334 
335 /**
336  * enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being
337  *	modified in &iwl_link_ctx_cfg_cmd
338  *
339  * @LINK_CONTEXT_MODIFY_ACTIVE: covers iwl_link_ctx_cfg_cmd::active
340  * @LINK_CONTEXT_MODIFY_RATES_INFO: covers iwl_link_ctx_cfg_cmd::cck_rates,
341  *	iwl_link_ctx_cfg_cmd::ofdm_rates,
342  *	iwl_link_ctx_cfg_cmd::cck_short_preamble,
343  *	iwl_link_ctx_cfg_cmd::short_slot
344  * @LINK_CONTEXT_MODIFY_PROTECT_FLAGS: covers
345  *	iwl_link_ctx_cfg_cmd::protection_flags
346  * @LINK_CONTEXT_MODIFY_QOS_PARAMS: covers iwl_link_ctx_cfg_cmd::qos_flags,
347  *	iwl_link_ctx_cfg_cmd::ac,
348  * @LINK_CONTEXT_MODIFY_BEACON_TIMING: covers iwl_link_ctx_cfg_cmd::bi,
349  *	iwl_link_ctx_cfg_cmd::dtim_interval,
350  *	iwl_link_ctx_cfg_cmd::dtim_time,
351  *	iwl_link_ctx_cfg_cmd::dtim_tsf,
352  *	iwl_link_ctx_cfg_cmd::assoc_beacon_arrive_time.
353  *	This flag can be set only once after assoc.
354  * @LINK_CONTEXT_MODIFY_HE_PARAMS: covers
355  *	iwl_link_ctx_cfg_cmd::htc_trig_based_pkt_ext
356  *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmin,
357  *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmax,
358  *	iwl_link_ctx_cfg_cmd::trig_based_txf,
359  *	iwl_link_ctx_cfg_cmd::bss_color,
360  *	iwl_link_ctx_cfg_cmd::ndp_fdbk_buff_th_exp,
361  *	iwl_link_ctx_cfg_cmd::ref_bssid_addr
362  *	iwl_link_ctx_cfg_cmd::bssid_index,
363  *	iwl_link_ctx_cfg_cmd::frame_time_rts_th.
364  *	This flag can be set any time.
365  * @LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE: covers
366  *	iwl_link_ctx_cfg_cmd::bss_color_disable
367  * @LINK_CONTEXT_MODIFY_EHT_PARAMS: covers iwl_link_ctx_cfg_cmd::puncture_mask.
368  *	This flag can be set only if the MAC that this link relates to has
369  *	eht_support set to true.
370  * @LINK_CONTEXT_MODIFY_ALL: set all above flags
371  */
372 enum iwl_link_ctx_modify_flags {
373 	LINK_CONTEXT_MODIFY_ACTIVE		= BIT(0),
374 	LINK_CONTEXT_MODIFY_RATES_INFO		= BIT(1),
375 	LINK_CONTEXT_MODIFY_PROTECT_FLAGS	= BIT(2),
376 	LINK_CONTEXT_MODIFY_QOS_PARAMS		= BIT(3),
377 	LINK_CONTEXT_MODIFY_BEACON_TIMING	= BIT(4),
378 	LINK_CONTEXT_MODIFY_HE_PARAMS		= BIT(5),
379 	LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE	= BIT(6),
380 	LINK_CONTEXT_MODIFY_EHT_PARAMS		= BIT(7),
381 	LINK_CONTEXT_MODIFY_ALL			= 0xff,
382 }; /* LINK_CONTEXT_MODIFY_MASK_E_VER_1 */
383 
384 /**
385  * enum iwl_link_ctx_protection_flags - link protection flags
386  * @LINK_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
387  *	this will require CCK RTS/CTS2self.
388  *	RTS/CTS will protect full burst time.
389  * @LINK_PROT_FLG_HT_PROT: enable HT protection
390  * @LINK_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
391  * @LINK_PROT_FLG_SELF_CTS_EN: allow CTS2self
392  */
393 enum iwl_link_ctx_protection_flags {
394 	LINK_PROT_FLG_TGG_PROTECT	= BIT(0),
395 	LINK_PROT_FLG_HT_PROT		= BIT(1),
396 	LINK_PROT_FLG_FAT_PROT		= BIT(2),
397 	LINK_PROT_FLG_SELF_CTS_EN	= BIT(3),
398 }; /* LINK_PROTECT_FLAGS_E_VER_1 */
399 
400 /**
401  * enum iwl_link_ctx_flags - link context flags
402  *
403  * @LINK_FLG_BSS_COLOR_DIS: BSS color disable, don't use the BSS
404  *	color for RX filter but use MAC header
405  *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
406  * @LINK_FLG_MU_EDCA_CW: indicates that there is an element of MU EDCA
407  *	parameter set, i.e. the backoff counters for trig-based ACs
408  * @LINK_FLG_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
409  *      not allowed (as there are OBSS that might classify such transmissions as
410  *      radar pulses).
411  * @LINK_FLG_NDP_FEEDBACK_ENABLED: mark support for NDP feedback and change
412  *	of threshold
413  */
414 enum iwl_link_ctx_flags {
415 	LINK_FLG_BSS_COLOR_DIS		= BIT(0),
416 	LINK_FLG_MU_EDCA_CW		= BIT(1),
417 	LINK_FLG_RU_2MHZ_BLOCK		= BIT(2),
418 	LINK_FLG_NDP_FEEDBACK_ENABLED	= BIT(3),
419 }; /* LINK_CONTEXT_FLAG_E_VER_1 */
420 
421 /**
422  * struct iwl_link_config_cmd - command structure to configure the LINK context
423  *	in MLD API
424  * ( LINK_CONFIG_CMD =0x9 )
425  *
426  * @action: action to perform, see &enum iwl_ctxt_action
427  * @link_id: the id of the link that this cmd configures
428  * @mac_id: interface ID. Relevant only if action is FW_CTXT_ACTION_ADD
429  * @phy_id: PHY index. Can be changed only if the link was inactive
430  *	(and stays inactive). If the link is active (or becomes active),
431  *	this field is ignored.
432  * @local_link_addr: the links MAC address. Can be changed only if the link was
433  *	inactive (and stays inactive). If the link is active
434  *	(or becomes active), this field is ignored.
435  * @reserved_for_local_link_addr: reserved
436  * @modify_mask: from &enum iwl_link_ctx_modify_flags, selects what to change.
437  *	Relevant only if action is FW_CTXT_ACTION_MODIFY
438  * @active: indicates whether the link is active or not
439  * @listen_lmac: indicates whether the link should be allocated on the Listen
440  *	Lmac or on the Main Lmac. Cannot be changed on an active Link.
441  *	Relevant only for eSR.
442  * @cck_rates: basic rates available for CCK
443  * @ofdm_rates: basic rates available for OFDM
444  * @cck_short_preamble: 1 for enabling short preamble, 0 otherwise
445  * @short_slot: 1 for enabling short slots, 0 otherwise
446  * @protection_flags: combination of &enum iwl_link_ctx_protection_flags
447  * @qos_flags: from &enum iwl_mac_qos_flags
448  * @ac: one iwl_mac_qos configuration for each AC
449  * @htc_trig_based_pkt_ext: default PE in 4us units
450  * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
451  * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
452  * @ndp_fdbk_buff_th_exp: set exponent for the NDP feedback buffered threshold
453  * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
454  * @bi: beacon interval in TU, applicable only when associated
455  * @dtim_interval: DTIM interval in TU.
456  *	Relevant only for GO, otherwise this is offloaded.
457  * @puncture_mask: puncture mask for EHT
458  * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
459  * @flags: a combination from &enum iwl_link_ctx_flags
460  * @flags_mask: what of %flags have changed. Also &enum iwl_link_ctx_flags
461  * Below fields are for multi-bssid:
462  * @ref_bssid_addr: reference BSSID used by the AP
463  * @reserved_for_ref_bssid_addr: reserved
464  * @bssid_index: index of the associated VAP
465  * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
466  * @spec_link_id: link_id as the AP knows it
467  * @reserved: alignment
468  * @ibss_bssid_addr: bssid for ibss
469  * @reserved_for_ibss_bssid_addr: reserved
470  * @reserved1: reserved for future use
471  */
472 struct iwl_link_config_cmd {
473 	__le32 action;
474 	__le32 link_id;
475 	__le32 mac_id;
476 	__le32 phy_id;
477 	u8 local_link_addr[6];
478 	__le16 reserved_for_local_link_addr;
479 	__le32 modify_mask;
480 	__le32 active;
481 	__le32 listen_lmac;
482 	__le32 cck_rates;
483 	__le32 ofdm_rates;
484 	__le32 cck_short_preamble;
485 	__le32 short_slot;
486 	__le32 protection_flags;
487 	/* MAC_QOS_PARAM_API_S_VER_1 */
488 	__le32 qos_flags;
489 	struct iwl_ac_qos ac[AC_NUM + 1];
490 	u8 htc_trig_based_pkt_ext;
491 	u8 rand_alloc_ecwmin;
492 	u8 rand_alloc_ecwmax;
493 	u8 ndp_fdbk_buff_th_exp;
494 	struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
495 	__le32 bi;
496 	__le32 dtim_interval;
497 	__le16 puncture_mask;
498 	__le16 frame_time_rts_th;
499 	__le32 flags;
500 	__le32 flags_mask;
501 	/* The below fields are for multi-bssid */
502 	u8 ref_bssid_addr[6];
503 	__le16 reserved_for_ref_bssid_addr;
504 	u8 bssid_index;
505 	u8 bss_color;
506 	u8 spec_link_id;
507 	u8 reserved;
508 	u8 ibss_bssid_addr[6];
509 	__le16 reserved_for_ibss_bssid_addr;
510 	__le32 reserved1[8];
511 } __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1 */
512 
513 /* Currently FW supports link ids in the range 0-3 and can have
514  * at most two active links for each vif.
515  */
516 #define IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM 2
517 #define IWL_MVM_FW_MAX_LINK_ID 3
518 
519 /**
520  * enum iwl_fw_sta_type - FW station types
521  * @STATION_TYPE_PEER: represents a peer - AP in BSS, a TDLS sta, a client in
522  *	P2P.
523  * @STATION_TYPE_BCAST_MGMT: The station used to send beacons and
524  *	probe responses. Also used for traffic injection in sniffer mode
525  * @STATION_TYPE_MCAST: the station used for BCAST / MCAST in GO. Will be
526  *	suspended / resumed at the right timing depending on the clients'
527  *	power save state and the DTIM timing
528  * @STATION_TYPE_AUX: aux sta. In the FW there is no need for a special type
529  *	for the aux sta, so this type is only for driver - internal use.
530  */
531 enum iwl_fw_sta_type {
532 	STATION_TYPE_PEER,
533 	STATION_TYPE_BCAST_MGMT,
534 	STATION_TYPE_MCAST,
535 	STATION_TYPE_AUX,
536 }; /* STATION_TYPE_E_VER_1 */
537 
538 /**
539  * struct iwl_mvm_sta_cfg_cmd - cmd structure to add a peer sta to the uCode's
540  *	station table
541  * ( STA_CONFIG_CMD = 0xA )
542  *
543  * @sta_id: index of station in uCode's station table
544  * @link_id: the id of the link that is used to communicate with this sta
545  * @peer_mld_address: the peers mld address
546  * @reserved_for_peer_mld_address: reserved
547  * @peer_link_address: the address of the link that is used to communicate
548  *	with this sta
549  * @reserved_for_peer_link_address: reserved
550  * @station_type: type of this station. See &enum iwl_fw_sta_type
551  * @assoc_id: for GO only
552  * @beamform_flags: beam forming controls
553  * @mfp: indicates whether the STA uses management frame protection or not.
554  * @mimo: indicates whether the sta uses mimo or not
555  * @mimo_protection: indicates whether the sta uses mimo protection or not
556  * @ack_enabled: indicates that the AP supports receiving ACK-
557  *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
558  * @trig_rnd_alloc: indicates that trigger based random allocation
559  *	is enabled according to UORA element existence
560  * @tx_ampdu_spacing: minimum A-MPDU spacing:
561  *	4 - 2us density, 5 - 4us density, 6 - 8us density, 7 - 16us density
562  * @tx_ampdu_max_size: maximum A-MPDU length: 0 - 8K, 1 - 16K, 2 - 32K,
563  *	3 - 64K, 4 - 128K, 5 - 256K, 6 - 512K, 7 - 1024K.
564  * @sp_length: the size of the SP in actual number of frames
565  * @uapsd_acs:  4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
566  *	enabled ACs.
567  * @pkt_ext: optional, exists according to PPE-present bit in the HE/EHT-PHY
568  *	capa
569  * @htc_flags: which features are supported in HTC
570  */
571 struct iwl_mvm_sta_cfg_cmd {
572 	__le32 sta_id;
573 	__le32 link_id;
574 	u8 peer_mld_address[ETH_ALEN];
575 	__le16 reserved_for_peer_mld_address;
576 	u8 peer_link_address[ETH_ALEN];
577 	__le16 reserved_for_peer_link_address;
578 	__le32 station_type;
579 	__le32 assoc_id;
580 	__le32 beamform_flags;
581 	__le32 mfp;
582 	__le32 mimo;
583 	__le32 mimo_protection;
584 	__le32 ack_enabled;
585 	__le32 trig_rnd_alloc;
586 	__le32 tx_ampdu_spacing;
587 	__le32 tx_ampdu_max_size;
588 	__le32 sp_length;
589 	__le32 uapsd_acs;
590 	struct iwl_he_pkt_ext_v2 pkt_ext;
591 	__le32 htc_flags;
592 } __packed; /* STA_CMD_API_S_VER_1 */
593 
594 /**
595  * struct iwl_mvm_aux_sta_cmd - command for AUX STA configuration
596  * ( AUX_STA_CMD = 0xB )
597  *
598  * @sta_id: index of aux sta to configure
599  * @lmac_id: ?
600  * @mac_addr: mac addr of the auxilary sta
601  * @reserved_for_mac_addr: reserved
602  */
603 struct iwl_mvm_aux_sta_cmd {
604 	__le32 sta_id;
605 	__le32 lmac_id;
606 	u8 mac_addr[ETH_ALEN];
607 	__le16 reserved_for_mac_addr;
608 
609 } __packed; /* AUX_STA_CMD_API_S_VER_1 */
610 
611 /**
612  * struct iwl_mvm_remove_sta_cmd - a cmd structure to remove a sta added by
613  *	STA_CONFIG_CMD or AUX_STA_CONFIG_CMD
614  * ( STA_REMOVE_CMD = 0xC )
615  *
616  * @sta_id: index of station to remove
617  */
618 struct iwl_mvm_remove_sta_cmd {
619 	__le32 sta_id;
620 } __packed; /* REMOVE_STA_API_S_VER_1 */
621 
622 /**
623  * struct iwl_mvm_sta_disable_tx_cmd - disable / re-enable tx to a sta
624  * ( STA_DISABLE_TX_CMD = 0xD )
625  *
626  * @sta_id: index of the station to disable tx to
627  * @disable: indicates if to disable or re-enable tx
628  */
629 struct iwl_mvm_sta_disable_tx_cmd {
630 	__le32 sta_id;
631 	__le32 disable;
632 } __packed; /* STA_DISABLE_TX_API_S_VER_1 */
633 
634 #endif /* __iwl_fw_api_mac_cfg_h__ */
635