xref: /linux/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h (revision 1a9239bb4253f9076b5b4b2a1a4e8d7defd77a95)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2012-2014, 2018-2019, 2021-2025 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_sta_cfg_cmd
46 	 */
47 	STA_CONFIG_CMD = 0xA,
48 	/**
49 	 * @AUX_STA_CMD: &struct iwl_aux_sta_cmd
50 	 */
51 	AUX_STA_CMD = 0xB,
52 	/**
53 	 * @STA_REMOVE_CMD: &struct iwl_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 	 * @ROC_CMD: &struct iwl_roc_req
62 	 */
63 	ROC_CMD = 0xE,
64 	/**
65 	 * @TWT_OPERATION_CMD: &struct iwl_twt_operation_cmd
66 	 */
67 	TWT_OPERATION_CMD = 0x10,
68 	/**
69 	 * @MISSED_BEACONS_NOTIF: &struct iwl_missed_beacons_notif
70 	 */
71 	MISSED_BEACONS_NOTIF = 0xF6,
72 	/**
73 	 * @EMLSR_TRANS_FAIL_NOTIF: &struct iwl_esr_trans_fail_notif
74 	 */
75 	EMLSR_TRANS_FAIL_NOTIF = 0xF7,
76 	/**
77 	 * @ROC_NOTIF: &struct iwl_roc_notif
78 	 */
79 	ROC_NOTIF = 0xF8,
80 	/**
81 	 * @SESSION_PROTECTION_NOTIF: &struct iwl_session_prot_notif
82 	 */
83 	SESSION_PROTECTION_NOTIF = 0xFB,
84 
85 	/**
86 	 * @PROBE_RESPONSE_DATA_NOTIF: &struct iwl_probe_resp_data_notif
87 	 */
88 	PROBE_RESPONSE_DATA_NOTIF = 0xFC,
89 
90 	/**
91 	 * @CHANNEL_SWITCH_START_NOTIF: &struct iwl_channel_switch_start_notif
92 	 */
93 	CHANNEL_SWITCH_START_NOTIF = 0xFF,
94 
95 	/**
96 	 *@CHANNEL_SWITCH_ERROR_NOTIF: &struct iwl_channel_switch_error_notif
97 	 */
98 	CHANNEL_SWITCH_ERROR_NOTIF = 0xF9,
99 };
100 
101 #define IWL_P2P_NOA_DESC_COUNT	(2)
102 
103 /**
104  * struct iwl_p2p_noa_attr - NOA attr contained in probe resp FW notification
105  *
106  * @id: attribute id
107  * @len_low: length low half
108  * @len_high: length high half
109  * @idx: instance of NoA timing
110  * @ctwin: GO's ct window and pwer save capability
111  * @desc: NoA descriptor
112  * @reserved: reserved for alignment purposes
113  */
114 struct iwl_p2p_noa_attr {
115 	u8 id;
116 	u8 len_low;
117 	u8 len_high;
118 	u8 idx;
119 	u8 ctwin;
120 	struct ieee80211_p2p_noa_desc desc[IWL_P2P_NOA_DESC_COUNT];
121 	u8 reserved;
122 } __packed;
123 
124 #define IWL_PROBE_RESP_DATA_NO_CSA (0xff)
125 
126 /**
127  * struct iwl_probe_resp_data_notif - notification with NOA and CSA counter
128  *
129  * @mac_id: the mac which should send the probe response
130  * @noa_active: notifies if the noa attribute should be handled
131  * @noa_attr: P2P NOA attribute
132  * @csa_counter: current csa counter
133  * @reserved: reserved for alignment purposes
134  */
135 struct iwl_probe_resp_data_notif {
136 	__le32 mac_id;
137 	__le32 noa_active;
138 	struct iwl_p2p_noa_attr noa_attr;
139 	u8 csa_counter;
140 	u8 reserved[3];
141 } __packed; /* PROBE_RESPONSE_DATA_NTFY_API_S_VER_1 */
142 
143 /**
144  * struct iwl_missed_vap_notif - notification of missing vap detection
145  *
146  * @mac_id: the mac for which the ucode sends the notification for
147  * @num_beacon_intervals_elapsed: beacons elpased with no vap profile inside
148  * @profile_periodicity: beacons period to have our profile inside
149  * @reserved: reserved for alignment purposes
150  */
151 struct iwl_missed_vap_notif {
152 	__le32 mac_id;
153 	u8 num_beacon_intervals_elapsed;
154 	u8 profile_periodicity;
155 	u8 reserved[2];
156 } __packed; /* MISSED_VAP_NTFY_API_S_VER_1 */
157 
158 /**
159  * struct iwl_channel_switch_start_notif_v1 - Channel switch start notification
160  *
161  * @id_and_color: ID and color of the MAC
162  */
163 struct iwl_channel_switch_start_notif_v1 {
164 	__le32 id_and_color;
165 } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
166 
167 /**
168  * struct iwl_channel_switch_start_notif - Channel switch start notification
169  *
170  * @link_id: FW link id
171  */
172 struct iwl_channel_switch_start_notif {
173 	__le32 link_id;
174 } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_3 */
175 
176 #define CS_ERR_COUNT_ERROR BIT(0)
177 #define CS_ERR_LONG_DELAY_AFTER_CS BIT(1)
178 #define CS_ERR_LONG_TX_BLOCK BIT(2)
179 #define CS_ERR_TX_BLOCK_TIMER_EXPIRED BIT(3)
180 
181 /**
182  * struct iwl_channel_switch_error_notif_v1 - Channel switch error notification
183  *
184  * @mac_id: the mac for which the ucode sends the notification for
185  * @csa_err_mask: mask of channel switch error that can occur
186  */
187 struct iwl_channel_switch_error_notif_v1 {
188 	__le32 mac_id;
189 	__le32 csa_err_mask;
190 } __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_1 */
191 
192 /**
193  * struct iwl_channel_switch_error_notif - Channel switch error notification
194  *
195  * @link_id: FW link id
196  * @csa_err_mask: mask of channel switch error that can occur
197  */
198 struct iwl_channel_switch_error_notif {
199 	__le32 link_id;
200 	__le32 csa_err_mask;
201 } __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_2 */
202 
203 /**
204  * struct iwl_cancel_channel_switch_cmd - Cancel Channel Switch command
205  *
206  * @id: the id of the link or mac that should cancel the channel switch
207  */
208 struct iwl_cancel_channel_switch_cmd {
209 	__le32 id;
210 } __packed; /* MAC_CANCEL_CHANNEL_SWITCH_S_VER_1 */
211 
212 /**
213  * struct iwl_chan_switch_te_cmd - Channel Switch Time Event command
214  *
215  * @mac_id: MAC ID for channel switch
216  * @action: action to perform, see &enum iwl_ctxt_action
217  * @tsf: beacon tsf
218  * @cs_count: channel switch count from CSA/eCSA IE
219  * @cs_delayed_bcn_count: if set to N (!= 0) GO/AP can delay N beacon intervals
220  *	at the new channel after the channel switch, otherwise (N == 0) expect
221  *	beacon right after the channel switch.
222  * @cs_mode: 1 - quiet, 0 - otherwise
223  * @reserved: reserved for alignment purposes
224  */
225 struct iwl_chan_switch_te_cmd {
226 	__le32 mac_id;
227 	__le32 action;
228 	__le32 tsf;
229 	u8 cs_count;
230 	u8 cs_delayed_bcn_count;
231 	u8 cs_mode;
232 	u8 reserved;
233 } __packed; /* MAC_CHANNEL_SWITCH_TIME_EVENT_S_VER_2 */
234 
235 /**
236  * struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode'
237  *
238  * @mac_id: MAC ID to whom to apply the low-latency configurations
239  * @low_latency_rx: 1/0 to set/clear Rx low latency direction
240  * @low_latency_tx: 1/0 to set/clear Tx low latency direction
241  * @reserved: reserved for alignment purposes
242  */
243 struct iwl_mac_low_latency_cmd {
244 	__le32 mac_id;
245 	u8 low_latency_rx;
246 	u8 low_latency_tx;
247 	__le16 reserved;
248 } __packed; /* MAC_LOW_LATENCY_API_S_VER_1 */
249 
250 /**
251  * struct iwl_mac_client_data - configuration data for client MAC context
252  *
253  * @is_assoc: 1 for associated state, 0 otherwise
254  * @esr_transition_timeout: the timeout required by the AP for the
255  *	eSR transition.
256  *	Available only from version 2 of the command.
257  *	This value comes from the EMLSR transition delay in the EML
258  *	Capabilities subfield.
259  * @medium_sync_delay: the value as it appears in P802.11be_D2.2 Figure 9-1002j.
260  * @assoc_id: unique ID assigned by the AP during association
261  * @reserved1: alignment
262  * @data_policy: see &enum iwl_mac_data_policy
263  * @reserved2: alignment
264  * @ctwin: client traffic window in TU (period after TBTT when GO is present).
265  *	0 indicates that there is no CT window.
266  */
267 struct iwl_mac_client_data {
268 	u8 is_assoc;
269 	u8 esr_transition_timeout;
270 	__le16 medium_sync_delay;
271 
272 	__le16 assoc_id;
273 	__le16 reserved1;
274 	__le16 data_policy;
275 	__le16 reserved2;
276 	__le32 ctwin;
277 } __packed; /* MAC_CONTEXT_CONFIG_CLIENT_DATA_API_S_VER_2 */
278 
279 /**
280  * struct iwl_mac_p2p_dev_data  - configuration data for P2P device MAC context
281  *
282  * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
283  *	other channels as well. This should be to true only in case that the
284  *	device is discoverable and there is an active GO. Note that setting this
285  *	field when not needed, will increase the number of interrupts and have
286  *	effect on the platform power, as this setting opens the Rx filters on
287  *	all macs.
288  */
289 struct iwl_mac_p2p_dev_data {
290 	__le32 is_disc_extended;
291 } __packed; /* MAC_CONTEXT_CONFIG_P2P_DEV_DATA_API_S_VER_1 */
292 
293 /**
294  * enum iwl_mac_config_filter_flags - MAC context configuration filter flags
295  *
296  * @MAC_CFG_FILTER_PROMISC: accept all data frames
297  * @MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT: pass all management and
298  *	control frames to the host
299  * @MAC_CFG_FILTER_ACCEPT_GRP: accept multicast frames
300  * @MAC_CFG_FILTER_ACCEPT_BEACON: accept beacon frames
301  * @MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe response
302  * @MAC_CFG_FILTER_ACCEPT_PROBE_REQ: accept probe requests
303  */
304 enum iwl_mac_config_filter_flags {
305 	MAC_CFG_FILTER_PROMISC			= BIT(0),
306 	MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT	= BIT(1),
307 	MAC_CFG_FILTER_ACCEPT_GRP		= BIT(2),
308 	MAC_CFG_FILTER_ACCEPT_BEACON		= BIT(3),
309 	MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP	= BIT(4),
310 	MAC_CFG_FILTER_ACCEPT_PROBE_REQ		= BIT(5),
311 }; /* MAC_FILTER_FLAGS_MASK_E_VER_1 */
312 
313 /**
314  * struct iwl_mac_config_cmd - command structure to configure MAC contexts in
315  *	MLD API
316  * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
317  *
318  * @id_and_color: ID and color of the MAC
319  * @action: action to perform, see &enum iwl_ctxt_action
320  * @mac_type: one of &enum iwl_mac_types
321  * @local_mld_addr: mld address
322  * @reserved_for_local_mld_addr: reserved
323  * @filter_flags: combination of &enum iwl_mac_config_filter_flags
324  * @he_support: does this MAC support HE
325  * @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
326  * @eht_support: does this MAC support EHT. Requires he_support
327  * @nic_not_ack_enabled: mark that the NIC doesn't support receiving
328  *	ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
329  *	If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
330  *	len delim to determine if AGG or single.
331  * @client: client mac data
332  * @p2p_dev: mac data for p2p device
333  */
334 struct iwl_mac_config_cmd {
335 	/* COMMON_INDEX_HDR_API_S_VER_1 */
336 	__le32 id_and_color;
337 	__le32 action;
338 	/* MAC_CONTEXT_TYPE_API_E */
339 	__le32 mac_type;
340 	u8 local_mld_addr[6];
341 	__le16 reserved_for_local_mld_addr;
342 	__le32 filter_flags;
343 	__le16 he_support;
344 	__le16 he_ap_support;
345 	__le32 eht_support;
346 	__le32 nic_not_ack_enabled;
347 	/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_2 */
348 	union {
349 		struct iwl_mac_client_data client;
350 		struct iwl_mac_p2p_dev_data p2p_dev;
351 	};
352 } __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2 */
353 
354 /**
355  * enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being
356  *	modified in &iwl_link_ctx_cfg_cmd
357  *
358  * @LINK_CONTEXT_MODIFY_ACTIVE: covers iwl_link_ctx_cfg_cmd::active
359  * @LINK_CONTEXT_MODIFY_RATES_INFO: covers iwl_link_ctx_cfg_cmd::cck_rates,
360  *	iwl_link_ctx_cfg_cmd::ofdm_rates,
361  *	iwl_link_ctx_cfg_cmd::cck_short_preamble,
362  *	iwl_link_ctx_cfg_cmd::short_slot
363  * @LINK_CONTEXT_MODIFY_PROTECT_FLAGS: covers
364  *	iwl_link_ctx_cfg_cmd::protection_flags
365  * @LINK_CONTEXT_MODIFY_QOS_PARAMS: covers iwl_link_ctx_cfg_cmd::qos_flags,
366  *	iwl_link_ctx_cfg_cmd::ac,
367  * @LINK_CONTEXT_MODIFY_BEACON_TIMING: covers iwl_link_ctx_cfg_cmd::bi,
368  *	iwl_link_ctx_cfg_cmd::dtim_interval,
369  *	iwl_link_ctx_cfg_cmd::dtim_time,
370  *	iwl_link_ctx_cfg_cmd::dtim_tsf,
371  *	iwl_link_ctx_cfg_cmd::assoc_beacon_arrive_time.
372  *	This flag can be set only once after assoc.
373  * @LINK_CONTEXT_MODIFY_HE_PARAMS: covers
374  *	iwl_link_ctx_cfg_cmd::htc_trig_based_pkt_ext
375  *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmin,
376  *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmax,
377  *	iwl_link_ctx_cfg_cmd::trig_based_txf,
378  *	iwl_link_ctx_cfg_cmd::bss_color,
379  *	iwl_link_ctx_cfg_cmd::ndp_fdbk_buff_th_exp,
380  *	iwl_link_ctx_cfg_cmd::ref_bssid_addr
381  *	iwl_link_ctx_cfg_cmd::bssid_index,
382  *	iwl_link_ctx_cfg_cmd::frame_time_rts_th.
383  *	This flag can be set any time.
384  * @LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE: covers
385  *	iwl_link_ctx_cfg_cmd::bss_color_disable
386  * @LINK_CONTEXT_MODIFY_EHT_PARAMS: covers iwl_link_ctx_cfg_cmd::puncture_mask.
387  *	This flag can be set only if the MAC that this link relates to has
388  *	eht_support set to true. No longer used since _VER_3 of this command.
389  * @LINK_CONTEXT_MODIFY_BANDWIDTH: Covers iwl_link_ctx_cfg_cmd::modify_bandwidth.
390  *	Request RX OMI to the AP to modify bandwidth of this link.
391  * @LINK_CONTEXT_MODIFY_ALL: set all above flags
392  */
393 enum iwl_link_ctx_modify_flags {
394 	LINK_CONTEXT_MODIFY_ACTIVE		= BIT(0),
395 	LINK_CONTEXT_MODIFY_RATES_INFO		= BIT(1),
396 	LINK_CONTEXT_MODIFY_PROTECT_FLAGS	= BIT(2),
397 	LINK_CONTEXT_MODIFY_QOS_PARAMS		= BIT(3),
398 	LINK_CONTEXT_MODIFY_BEACON_TIMING	= BIT(4),
399 	LINK_CONTEXT_MODIFY_HE_PARAMS		= BIT(5),
400 	LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE	= BIT(6),
401 	LINK_CONTEXT_MODIFY_EHT_PARAMS		= BIT(7),
402 	LINK_CONTEXT_MODIFY_BANDWIDTH		= BIT(8),
403 	LINK_CONTEXT_MODIFY_ALL			= 0xff,
404 }; /* LINK_CONTEXT_MODIFY_MASK_E_VER_1 */
405 
406 /**
407  * enum iwl_link_ctx_protection_flags - link protection flags
408  * @LINK_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
409  *	this will require CCK RTS/CTS2self.
410  *	RTS/CTS will protect full burst time.
411  * @LINK_PROT_FLG_HT_PROT: enable HT protection
412  * @LINK_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
413  * @LINK_PROT_FLG_SELF_CTS_EN: allow CTS2self
414  */
415 enum iwl_link_ctx_protection_flags {
416 	LINK_PROT_FLG_TGG_PROTECT	= BIT(0),
417 	LINK_PROT_FLG_HT_PROT		= BIT(1),
418 	LINK_PROT_FLG_FAT_PROT		= BIT(2),
419 	LINK_PROT_FLG_SELF_CTS_EN	= BIT(3),
420 }; /* LINK_PROTECT_FLAGS_E_VER_1 */
421 
422 /**
423  * enum iwl_link_ctx_flags - link context flags
424  *
425  * @LINK_FLG_BSS_COLOR_DIS: BSS color disable, don't use the BSS
426  *	color for RX filter but use MAC header
427  *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
428  * @LINK_FLG_MU_EDCA_CW: indicates that there is an element of MU EDCA
429  *	parameter set, i.e. the backoff counters for trig-based ACs
430  * @LINK_FLG_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
431  *      not allowed (as there are OBSS that might classify such transmissions as
432  *      radar pulses).
433  * @LINK_FLG_NDP_FEEDBACK_ENABLED: mark support for NDP feedback and change
434  *	of threshold
435  */
436 enum iwl_link_ctx_flags {
437 	LINK_FLG_BSS_COLOR_DIS		= BIT(0),
438 	LINK_FLG_MU_EDCA_CW		= BIT(1),
439 	LINK_FLG_RU_2MHZ_BLOCK		= BIT(2),
440 	LINK_FLG_NDP_FEEDBACK_ENABLED	= BIT(3),
441 }; /* LINK_CONTEXT_FLAG_E_VER_1 */
442 
443 /**
444  * enum iwl_link_modify_bandwidth - link modify (RX OMI) bandwidth
445  * @IWL_LINK_MODIFY_BW_20: request 20 MHz
446  * @IWL_LINK_MODIFY_BW_40: request 40 MHz
447  * @IWL_LINK_MODIFY_BW_80: request 80 MHz
448  * @IWL_LINK_MODIFY_BW_160: request 160 MHz
449  * @IWL_LINK_MODIFY_BW_320: request 320 MHz
450  */
451 enum iwl_link_modify_bandwidth {
452 	IWL_LINK_MODIFY_BW_20,
453 	IWL_LINK_MODIFY_BW_40,
454 	IWL_LINK_MODIFY_BW_80,
455 	IWL_LINK_MODIFY_BW_160,
456 	IWL_LINK_MODIFY_BW_320,
457 };
458 
459 /**
460  * struct iwl_link_config_cmd - command structure to configure the LINK context
461  *	in MLD API
462  * ( LINK_CONFIG_CMD =0x9 )
463  *
464  * @action: action to perform, see &enum iwl_ctxt_action
465  * @link_id: the id of the link that this cmd configures
466  * @mac_id: interface ID. Relevant only if action is FW_CTXT_ACTION_ADD
467  * @phy_id: PHY index. Can be changed only if the link was inactive
468  *	(and stays inactive). If the link is active (or becomes active),
469  *	this field is ignored.
470  * @local_link_addr: the links MAC address. Can be changed only if the link was
471  *	inactive (and stays inactive). If the link is active
472  *	(or becomes active), this field is ignored.
473  * @reserved_for_local_link_addr: reserved
474  * @modify_mask: from &enum iwl_link_ctx_modify_flags, selects what to change.
475  *	Relevant only if action is FW_CTXT_ACTION_MODIFY
476  * @active: indicates whether the link is active or not
477  * @listen_lmac: indicates whether the link should be allocated on the Listen
478  *	Lmac or on the Main Lmac. Cannot be changed on an active Link.
479  *	Relevant only for eSR.
480  * @block_tx: tell the firmware that this link can't Tx. This should be used
481  *	only when a link is de-activated because of CSA with mode = 1.
482  *	Available since version 5.
483  * @modify_bandwidth: bandwidth request value for RX OMI (see also
484  *	%LINK_CONTEXT_MODIFY_BANDWIDTH), from &enum iwl_link_modify_bandwidth.
485  * @reserved1: in version 2, listen_lmac became reserved
486  * @cck_rates: basic rates available for CCK
487  * @ofdm_rates: basic rates available for OFDM
488  * @cck_short_preamble: 1 for enabling short preamble, 0 otherwise
489  * @short_slot: 1 for enabling short slots, 0 otherwise
490  * @protection_flags: combination of &enum iwl_link_ctx_protection_flags
491  * @qos_flags: from &enum iwl_mac_qos_flags
492  * @ac: one iwl_mac_qos configuration for each AC
493  * @htc_trig_based_pkt_ext: default PE in 4us units
494  * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
495  * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
496  * @ndp_fdbk_buff_th_exp: set exponent for the NDP feedback buffered threshold
497  * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
498  * @bi: beacon interval in TU, applicable only when associated
499  * @dtim_interval: DTIM interval in TU.
500  *	Relevant only for GO, otherwise this is offloaded.
501  * @puncture_mask: puncture mask for EHT (removed in VER_3)
502  * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
503  * @flags: a combination from &enum iwl_link_ctx_flags
504  * @flags_mask: what of %flags have changed. Also &enum iwl_link_ctx_flags
505  * Below fields are for multi-bssid:
506  * @ref_bssid_addr: reference BSSID used by the AP
507  * @reserved_for_ref_bssid_addr: reserved
508  * @bssid_index: index of the associated VAP
509  * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
510  * @spec_link_id: link_id as the AP knows it
511  * @ul_mu_data_disable: OM Control UL MU Data Disable RX Support (bit 44) in
512  *	HE MAC Capabilities information field as defined in figure 9-897 in
513  *	IEEE802.11REVme-D5.0
514  * @ibss_bssid_addr: bssid for ibss
515  * @reserved_for_ibss_bssid_addr: reserved
516  * @reserved3: reserved for future use
517  */
518 struct iwl_link_config_cmd {
519 	__le32 action;
520 	__le32 link_id;
521 	__le32 mac_id;
522 	__le32 phy_id;
523 	u8 local_link_addr[6];
524 	__le16 reserved_for_local_link_addr;
525 	__le32 modify_mask;
526 	__le32 active;
527 	union {
528 		__le32 listen_lmac; /* only _VER_1 */
529 		struct {
530 			u8 block_tx; /* since _VER_5 */
531 			u8 modify_bandwidth; /* since _VER_6 */
532 			u8 reserved1[2];
533 		};
534 	};
535 	__le32 cck_rates;
536 	__le32 ofdm_rates;
537 	__le32 cck_short_preamble;
538 	__le32 short_slot;
539 	__le32 protection_flags;
540 	/* MAC_QOS_PARAM_API_S_VER_1 */
541 	__le32 qos_flags;
542 	struct iwl_ac_qos ac[AC_NUM + 1];
543 	u8 htc_trig_based_pkt_ext;
544 	u8 rand_alloc_ecwmin;
545 	u8 rand_alloc_ecwmax;
546 	u8 ndp_fdbk_buff_th_exp;
547 	struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
548 	__le32 bi;
549 	__le32 dtim_interval;
550 	__le16 puncture_mask; /* removed in _VER_3 */
551 	__le16 frame_time_rts_th;
552 	__le32 flags;
553 	__le32 flags_mask; /* removed in _VER_6 */
554 	/* The below fields are for multi-bssid */
555 	u8 ref_bssid_addr[6];
556 	__le16 reserved_for_ref_bssid_addr;
557 	u8 bssid_index;
558 	u8 bss_color;
559 	u8 spec_link_id;
560 	u8 ul_mu_data_disable;
561 	u8 ibss_bssid_addr[6];
562 	__le16 reserved_for_ibss_bssid_addr;
563 	__le32 reserved3[8];
564 } __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1, _VER_2, _VER_3, _VER_4, _VER_5, _VER_6 */
565 
566 /* Currently FW supports link ids in the range 0-3 and can have
567  * at most two active links for each vif.
568  */
569 #define IWL_FW_MAX_ACTIVE_LINKS_NUM 2
570 #define IWL_FW_MAX_LINK_ID 3
571 
572 /**
573  * enum iwl_fw_sta_type - FW station types
574  * @STATION_TYPE_PEER: represents a peer - AP in BSS, a TDLS sta, a client in
575  *	P2P.
576  * @STATION_TYPE_BCAST_MGMT: The station used to send beacons and
577  *	probe responses. Also used for traffic injection in sniffer mode
578  * @STATION_TYPE_MCAST: the station used for BCAST / MCAST in GO. Will be
579  *	suspended / resumed at the right timing depending on the clients'
580  *	power save state and the DTIM timing
581  * @STATION_TYPE_AUX: aux sta. In the FW there is no need for a special type
582  *	for the aux sta, so this type is only for driver - internal use.
583  */
584 enum iwl_fw_sta_type {
585 	STATION_TYPE_PEER,
586 	STATION_TYPE_BCAST_MGMT,
587 	STATION_TYPE_MCAST,
588 	STATION_TYPE_AUX,
589 }; /* STATION_TYPE_E_VER_1 */
590 
591 /**
592  * struct iwl_sta_cfg_cmd - cmd structure to add a peer sta to the uCode's
593  *	station table
594  * ( STA_CONFIG_CMD = 0xA )
595  *
596  * @sta_id: index of station in uCode's station table
597  * @link_id: the id of the link that is used to communicate with this sta
598  * @peer_mld_address: the peers mld address
599  * @reserved_for_peer_mld_address: reserved
600  * @peer_link_address: the address of the link that is used to communicate
601  *	with this sta
602  * @reserved_for_peer_link_address: reserved
603  * @station_type: type of this station. See &enum iwl_fw_sta_type
604  * @assoc_id: for GO only
605  * @beamform_flags: beam forming controls
606  * @mfp: indicates whether the STA uses management frame protection or not.
607  * @mimo: indicates whether the sta uses mimo or not
608  * @mimo_protection: indicates whether the sta uses mimo protection or not
609  * @ack_enabled: indicates that the AP supports receiving ACK-
610  *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
611  * @trig_rnd_alloc: indicates that trigger based random allocation
612  *	is enabled according to UORA element existence
613  * @tx_ampdu_spacing: minimum A-MPDU spacing:
614  *	4 - 2us density, 5 - 4us density, 6 - 8us density, 7 - 16us density
615  * @tx_ampdu_max_size: maximum A-MPDU length: 0 - 8K, 1 - 16K, 2 - 32K,
616  *	3 - 64K, 4 - 128K, 5 - 256K, 6 - 512K, 7 - 1024K.
617  * @sp_length: the size of the SP in actual number of frames
618  * @uapsd_acs:  4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
619  *	enabled ACs.
620  * @pkt_ext: optional, exists according to PPE-present bit in the HE/EHT-PHY
621  *	capa
622  * @htc_flags: which features are supported in HTC
623  */
624 struct iwl_sta_cfg_cmd {
625 	__le32 sta_id;
626 	__le32 link_id;
627 	u8 peer_mld_address[ETH_ALEN];
628 	__le16 reserved_for_peer_mld_address;
629 	u8 peer_link_address[ETH_ALEN];
630 	__le16 reserved_for_peer_link_address;
631 	__le32 station_type;
632 	__le32 assoc_id;
633 	__le32 beamform_flags;
634 	__le32 mfp;
635 	__le32 mimo;
636 	__le32 mimo_protection;
637 	__le32 ack_enabled;
638 	__le32 trig_rnd_alloc;
639 	__le32 tx_ampdu_spacing;
640 	__le32 tx_ampdu_max_size;
641 	__le32 sp_length;
642 	__le32 uapsd_acs;
643 	struct iwl_he_pkt_ext_v2 pkt_ext;
644 	__le32 htc_flags;
645 } __packed; /* STA_CMD_API_S_VER_1 */
646 
647 /**
648  * struct iwl_aux_sta_cmd - command for AUX STA configuration
649  * ( AUX_STA_CMD = 0xB )
650  *
651  * @sta_id: index of aux sta to configure
652  * @lmac_id: ?
653  * @mac_addr: mac addr of the auxilary sta
654  * @reserved_for_mac_addr: reserved
655  */
656 struct iwl_aux_sta_cmd {
657 	__le32 sta_id;
658 	__le32 lmac_id;
659 	u8 mac_addr[ETH_ALEN];
660 	__le16 reserved_for_mac_addr;
661 
662 } __packed; /* AUX_STA_CMD_API_S_VER_1 */
663 
664 /**
665  * struct iwl_remove_sta_cmd - a cmd structure to remove a sta added by
666  *	STA_CONFIG_CMD or AUX_STA_CONFIG_CMD
667  * ( STA_REMOVE_CMD = 0xC )
668  *
669  * @sta_id: index of station to remove
670  */
671 struct iwl_remove_sta_cmd {
672 	__le32 sta_id;
673 } __packed; /* REMOVE_STA_API_S_VER_1 */
674 
675 /**
676  * struct iwl_mvm_sta_disable_tx_cmd - disable / re-enable tx to a sta
677  * ( STA_DISABLE_TX_CMD = 0xD )
678  *
679  * @sta_id: index of the station to disable tx to
680  * @disable: indicates if to disable or re-enable tx
681  */
682 struct iwl_mvm_sta_disable_tx_cmd {
683 	__le32 sta_id;
684 	__le32 disable;
685 } __packed; /* STA_DISABLE_TX_API_S_VER_1 */
686 
687 /**
688  * enum iwl_mvm_fw_esr_recommendation - FW recommendation code
689  * @ESR_RECOMMEND_LEAVE: recommendation to leave esr
690  * @ESR_FORCE_LEAVE: force exiting esr
691  * @ESR_RECOMMEND_ENTER: recommendation to enter esr
692  */
693 enum iwl_mvm_fw_esr_recommendation {
694 	ESR_RECOMMEND_LEAVE,
695 	ESR_FORCE_LEAVE,
696 	ESR_RECOMMEND_ENTER,
697 }; /* ESR_MODE_RECOMMENDATION_CODE_API_E_VER_1 */
698 
699 /**
700  * struct iwl_esr_mode_notif - FWs recommendation/force for esr mode
701  *
702  * @action: the action to apply on esr state. See &iwl_mvm_fw_esr_recommendation
703  */
704 struct iwl_esr_mode_notif {
705 	__le32 action;
706 } __packed; /* ESR_MODE_RECOMMENDATION_NTFY_API_S_VER_1 */
707 
708 /**
709  * struct iwl_missed_beacons_notif - sent when by the firmware upon beacon loss
710  *  ( MISSED_BEACONS_NOTIF = 0xF6 )
711  * @link_id: fw link ID
712  * @consec_missed_beacons_since_last_rx: number of consecutive missed
713  *	beacons since last RX.
714  * @consec_missed_beacons: number of consecutive missed beacons
715  * @other_link_id: used in EMLSR only. The fw link ID for
716  *	&consec_missed_beacons_other_link. IWL_MVM_FW_LINK_ID_INVALID (0xff) if
717  *	invalid.
718  * @consec_missed_beacons_other_link: number of consecutive missed beacons on
719  *	&other_link_id.
720  */
721 struct iwl_missed_beacons_notif {
722 	__le32 link_id;
723 	__le32 consec_missed_beacons_since_last_rx;
724 	__le32 consec_missed_beacons;
725 	__le32 other_link_id;
726 	__le32 consec_missed_beacons_other_link;
727 } __packed; /* MISSED_BEACON_NTFY_API_S_VER_5 */
728 
729 /*
730  * enum iwl_esr_trans_fail_code: to be used to parse the notif below
731  *
732  * @ESR_TRANS_FAILED_TX_STATUS_ERROR: failed to TX EML OMN frame
733  * @ESR_TRANSITION_FAILED_TX_TIMEOUT: timeout on the EML OMN frame
734  * @ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD: can't get a beacon on the new link
735  */
736 enum iwl_esr_trans_fail_code {
737 	ESR_TRANS_FAILED_TX_STATUS_ERROR,
738 	ESR_TRANSITION_FAILED_TX_TIMEOUT,
739 	ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD,
740 };
741 
742 /**
743  * struct iwl_esr_trans_fail_notif - FW reports a failure in EMLSR transition
744  *
745  * @link_id: the link_id that still works after the failure
746  * @activation: true if the link was activated, false otherwise
747  * @err_code: see &enum iwl_esr_trans_fail_code
748  */
749 struct iwl_esr_trans_fail_notif {
750 	__le32 link_id;
751 	__le32 activation;
752 	__le32 err_code;
753 } __packed; /* ESR_TRANSITION_FAILED_NTFY_API_S_VER_1 */
754 
755 /*
756  * enum iwl_twt_operation_type: TWT operation in a TWT action frame
757  *
758  * @TWT_OPERATION_REQUEST: TWT Request
759  * @TWT_OPERATION_SUGGEST: TWT Suggest
760  * @TWT_OPERATION_DEMAND: TWT Demand
761  * @TWT_OPERATION_GROUPING: TWT Grouping
762  * @TWT_OPERATION_ACCEPT: TWT Accept
763  * @TWT_OPERATION_ALTERNATE: TWT Alternate
764  * @TWT_OPERATION_DICTATE: TWT Dictate
765  * @TWT_OPERATION_REJECT: TWT Reject
766  * @TWT_OPERATION_TEARDOWN: TWT Teardown
767  * @TWT_OPERATION_UNAVAILABILITY: TWT Unavailability
768  */
769 enum iwl_twt_operation_type {
770 	TWT_OPERATION_REQUEST,
771 	TWT_OPERATION_SUGGEST,
772 	TWT_OPERATION_DEMAND,
773 	TWT_OPERATION_GROUPING,
774 	TWT_OPERATION_ACCEPT,
775 	TWT_OPERATION_ALTERNATE,
776 	TWT_OPERATION_DICTATE,
777 	TWT_OPERATION_REJECT,
778 	TWT_OPERATION_TEARDOWN,
779 	TWT_OPERATION_UNAVAILABILITY,
780 	TWT_OPERATION_MAX,
781 }; /* TWT_OPERATION_TYPE_E_VER_1 */
782 
783 /**
784  * struct iwl_twt_operation_cmd - initiate a TWT session from driver
785  *
786  * @link_id: FW link id to initiate the TWT
787  * @twt_operation: &enum iwl_twt_operation_type
788  * @target_wake_time: TSF time to start the TWT
789  * @interval_exponent: the exponent for the interval
790  * @interval_mantissa: the mantissa for the interval
791  * @minimum_wake_duration: the minimum duration for the wake period
792  * @trigger: is the TWT triggered or not
793  * @flow_type: is the TWT announced (0) or not (1)
794  * @flow_id: the TWT flow identifier 0 - 7
795  * @twt_protection: is the TWT protected
796  * @ndp_paging_indicator: is ndp paging indicator set
797  * @responder_pm_mode: is responder pm mode set
798  * @negotiation_type: if the responder wants to doze outside the TWT SP
799  * @twt_request: 1 for TWT request (STA), 0 for TWT response (AP)
800  * @implicit: is TWT implicit
801  * @twt_group_assignment: the TWT group assignment
802  * @twt_channel: the TWT channel
803  * @restricted_info_present: is this a restricted TWT
804  * @dl_bitmap_valid: is DL (download) bitmap valid (restricted TWT)
805  * @ul_bitmap_valid: is UL (upload) bitmap valid (restricted TWT)
806  * @dl_tid_bitmap: DL TID bitmap (restricted TWT)
807  * @ul_tid_bitmap: UL TID bitmap (restricted TWT)
808  */
809 struct iwl_twt_operation_cmd {
810 	__le32 link_id;
811 	__le32 twt_operation;
812 	__le64 target_wake_time;
813 	__le32 interval_exponent;
814 	__le32 interval_mantissa;
815 	__le32 minimum_wake_duration;
816 	u8 trigger;
817 	u8 flow_type;
818 	u8 flow_id;
819 	u8 twt_protection;
820 	u8 ndp_paging_indicator;
821 	u8 responder_pm_mode;
822 	u8 negotiation_type;
823 	u8 twt_request;
824 	u8 implicit;
825 	u8 twt_group_assignment;
826 	u8 twt_channel;
827 	u8 restricted_info_present;
828 	u8 dl_bitmap_valid;
829 	u8 ul_bitmap_valid;
830 	u8 dl_tid_bitmap;
831 	u8 ul_tid_bitmap;
832 } __packed; /* TWT_OPERATION_API_S_VER_1 */
833 
834 #endif /* __iwl_fw_api_mac_cfg_h__ */
835