File Index
Files and directories
Sign in
FILE

mac-cfg.h

File preview with syntax highlighting.

linux-6.19.14/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h C
  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 */
 15enum 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 */
114struct 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 */
135struct 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 */
151struct 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 */
163struct 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 */
172struct 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 */
187struct 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 */
198struct 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 */
208struct 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 */
225struct 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 */
243struct 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 */
267struct 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 */
289struct 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 */
304enum 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_wifi_gen_support_v2 - parameters of iwl_mac_config_cmd
315 *	with support up to eht as in version 2 of the command
316 *
317 * @he_support: does this MAC support HE
318 * @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
319 * @eht_support: does this MAC support EHT. Requires he_support
320 */
321struct iwl_mac_wifi_gen_support_v2 {
322	__le16 he_support;
323	__le16 he_ap_support;
324	__le32 eht_support;
325} __packed;
326
327/**
328 * struct iwl_mac_wifi_gen_support - parameters of iwl_mac_config_cmd
329 *	with support up to uhr as in version 3 of the command
330 * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
331 *
332 * @he_support: does this MAC support HE
333 * @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
334 * @eht_support: does this MAC support EHT. Requires he_support
335 * @uhr_support: does this MAC support UHR. Requires eht_support
336 * @reserved: reserved for alignment and to match version 2's size
337 */
338struct iwl_mac_wifi_gen_support {
339	u8 he_support;
340	u8 he_ap_support;
341	u8 eht_support;
342	u8 uhr_support;
343	__le32 reserved;
344} __packed;
345
346/**
347 * struct iwl_mac_config_cmd - command structure to configure MAC contexts in
348 *	MLD API for versions 2 and 3
349 * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
350 *
351 * @id_and_color: ID and color of the MAC
352 * @action: action to perform, see &enum iwl_ctxt_action
353 * @mac_type: one of &enum iwl_mac_types
354 * @local_mld_addr: mld address
355 * @reserved_for_local_mld_addr: reserved
356 * @filter_flags: combination of &enum iwl_mac_config_filter_flags
357 * @wifi_gen_v2: he/eht parameters as in cmd version 2
358 * @wifi_gen: he/eht/uhr parameters as in cmd version 3
359 * @nic_not_ack_enabled: mark that the NIC doesn't support receiving
360 *	ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
361 *	If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
362 *	len delim to determine if AGG or single.
363 * @client: client mac data
364 * @p2p_dev: mac data for p2p device
365 */
366struct iwl_mac_config_cmd {
367	__le32 id_and_color;
368	__le32 action;
369	/* MAC_CONTEXT_TYPE_API_E */
370	__le32 mac_type;
371	u8 local_mld_addr[6];
372	__le16 reserved_for_local_mld_addr;
373	__le32 filter_flags;
374	union {
375		struct iwl_mac_wifi_gen_support_v2 wifi_gen_v2;
376		struct iwl_mac_wifi_gen_support wifi_gen;
377	};
378	__le32 nic_not_ack_enabled;
379	/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_2 */
380	union {
381		struct iwl_mac_client_data client;
382		struct iwl_mac_p2p_dev_data p2p_dev;
383	};
384} __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2_VER_3 */
385
386/**
387 * enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being
388 *	modified in &iwl_link_ctx_cfg_cmd
389 *
390 * @LINK_CONTEXT_MODIFY_ACTIVE: covers iwl_link_ctx_cfg_cmd::active
391 * @LINK_CONTEXT_MODIFY_RATES_INFO: covers iwl_link_ctx_cfg_cmd::cck_rates,
392 *	iwl_link_ctx_cfg_cmd::ofdm_rates,
393 *	iwl_link_ctx_cfg_cmd::cck_short_preamble,
394 *	iwl_link_ctx_cfg_cmd::short_slot
395 * @LINK_CONTEXT_MODIFY_PROTECT_FLAGS: covers
396 *	iwl_link_ctx_cfg_cmd::protection_flags
397 * @LINK_CONTEXT_MODIFY_QOS_PARAMS: covers iwl_link_ctx_cfg_cmd::qos_flags,
398 *	iwl_link_ctx_cfg_cmd::ac,
399 * @LINK_CONTEXT_MODIFY_BEACON_TIMING: covers iwl_link_ctx_cfg_cmd::bi,
400 *	iwl_link_ctx_cfg_cmd::dtim_interval,
401 *	iwl_link_ctx_cfg_cmd::dtim_time,
402 *	iwl_link_ctx_cfg_cmd::dtim_tsf,
403 *	iwl_link_ctx_cfg_cmd::assoc_beacon_arrive_time.
404 *	This flag can be set only once after assoc.
405 * @LINK_CONTEXT_MODIFY_HE_PARAMS: covers
406 *	iwl_link_ctx_cfg_cmd::htc_trig_based_pkt_ext
407 *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmin,
408 *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmax,
409 *	iwl_link_ctx_cfg_cmd::trig_based_txf,
410 *	iwl_link_ctx_cfg_cmd::bss_color,
411 *	iwl_link_ctx_cfg_cmd::ndp_fdbk_buff_th_exp,
412 *	iwl_link_ctx_cfg_cmd::ref_bssid_addr
413 *	iwl_link_ctx_cfg_cmd::bssid_index,
414 *	iwl_link_ctx_cfg_cmd::frame_time_rts_th.
415 *	This flag can be set any time.
416 * @LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE: covers
417 *	iwl_link_ctx_cfg_cmd::bss_color_disable
418 * @LINK_CONTEXT_MODIFY_EHT_PARAMS: covers iwl_link_ctx_cfg_cmd::puncture_mask.
419 *	This flag can be set only if the MAC that this link relates to has
420 *	eht_support set to true. No longer used since _VER_3 of this command.
421 * @LINK_CONTEXT_MODIFY_BANDWIDTH: Covers iwl_link_ctx_cfg_cmd::modify_bandwidth.
422 *	Request RX OMI to the AP to modify bandwidth of this link.
423 * @LINK_CONTEXT_MODIFY_UHR_PARAMS: covers iwl_link_ctx_cfg_cmd::npca_params and
424 *	iwl_link_ctx_cfg_cmd::prio_edca_params. Since _VER_7.
425 * @LINK_CONTEXT_MODIFY_ALL: set all above flags
426 */
427enum iwl_link_ctx_modify_flags {
428	LINK_CONTEXT_MODIFY_ACTIVE		= BIT(0),
429	LINK_CONTEXT_MODIFY_RATES_INFO		= BIT(1),
430	LINK_CONTEXT_MODIFY_PROTECT_FLAGS	= BIT(2),
431	LINK_CONTEXT_MODIFY_QOS_PARAMS		= BIT(3),
432	LINK_CONTEXT_MODIFY_BEACON_TIMING	= BIT(4),
433	LINK_CONTEXT_MODIFY_HE_PARAMS		= BIT(5),
434	LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE	= BIT(6),
435	LINK_CONTEXT_MODIFY_EHT_PARAMS		= BIT(7),
436	LINK_CONTEXT_MODIFY_BANDWIDTH		= BIT(8),
437	LINK_CONTEXT_MODIFY_UHR_PARAMS		= BIT(9),
438	LINK_CONTEXT_MODIFY_ALL			= 0xff,
439}; /* LINK_CONTEXT_MODIFY_MASK_E_VER_1 */
440
441/**
442 * enum iwl_link_ctx_protection_flags - link protection flags
443 * @LINK_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
444 *	this will require CCK RTS/CTS2self.
445 *	RTS/CTS will protect full burst time.
446 * @LINK_PROT_FLG_HT_PROT: enable HT protection
447 * @LINK_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
448 * @LINK_PROT_FLG_SELF_CTS_EN: allow CTS2self
449 */
450enum iwl_link_ctx_protection_flags {
451	LINK_PROT_FLG_TGG_PROTECT	= BIT(0),
452	LINK_PROT_FLG_HT_PROT		= BIT(1),
453	LINK_PROT_FLG_FAT_PROT		= BIT(2),
454	LINK_PROT_FLG_SELF_CTS_EN	= BIT(3),
455}; /* LINK_PROTECT_FLAGS_E_VER_1 */
456
457/**
458 * enum iwl_link_ctx_flags - link context flags
459 *
460 * @LINK_FLG_BSS_COLOR_DIS: BSS color disable, don't use the BSS
461 *	color for RX filter but use MAC header
462 *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
463 * @LINK_FLG_MU_EDCA_CW: indicates that there is an element of MU EDCA
464 *	parameter set, i.e. the backoff counters for trig-based ACs
465 * @LINK_FLG_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
466 *      not allowed (as there are OBSS that might classify such transmissions as
467 *      radar pulses).
468 * @LINK_FLG_NDP_FEEDBACK_ENABLED: mark support for NDP feedback and change
469 *	of threshold
470 */
471enum iwl_link_ctx_flags {
472	LINK_FLG_BSS_COLOR_DIS		= BIT(0),
473	LINK_FLG_MU_EDCA_CW		= BIT(1),
474	LINK_FLG_RU_2MHZ_BLOCK		= BIT(2),
475	LINK_FLG_NDP_FEEDBACK_ENABLED	= BIT(3),
476}; /* LINK_CONTEXT_FLAG_E_VER_1 */
477
478/**
479 * enum iwl_link_modify_bandwidth - link modify (RX OMI) bandwidth
480 * @IWL_LINK_MODIFY_BW_20: request 20 MHz
481 * @IWL_LINK_MODIFY_BW_40: request 40 MHz
482 * @IWL_LINK_MODIFY_BW_80: request 80 MHz
483 * @IWL_LINK_MODIFY_BW_160: request 160 MHz
484 * @IWL_LINK_MODIFY_BW_320: request 320 MHz
485 */
486enum iwl_link_modify_bandwidth {
487	IWL_LINK_MODIFY_BW_20,
488	IWL_LINK_MODIFY_BW_40,
489	IWL_LINK_MODIFY_BW_80,
490	IWL_LINK_MODIFY_BW_160,
491	IWL_LINK_MODIFY_BW_320,
492};
493
494/**
495 * struct iwl_npca_params - NPCA parameters (non-primary channel access)
496 *
497 * @switch_delay: after switch, delay TX according to destination AP
498 * @switch_back_delay: switch back to control channel before OBSS frame end
499 * @min_dur_threshold: minimum PPDU time to switch to the non-primary
500 *	NPCA channel
501 * @flags: NPCA flags - bit 0: puncturing allowed, bit 1: new TX allowed
502 * @reserved: reserved for alignment purposes
503 */
504struct iwl_npca_params {
505	u8 switch_delay;
506	u8 switch_back_delay;
507	__le16 min_dur_threshold;
508	__le16 flags;
509	__le16 reserved;
510} __packed; /* NPCA_PARAM_API_S_VER_1 */
511
512/**
513 * struct iwl_link_config_cmd - command structure to configure the LINK context
514 *	in MLD API
515 * ( LINK_CONFIG_CMD =0x9 )
516 *
517 * @action: action to perform, see &enum iwl_ctxt_action
518 * @link_id: the id of the link that this cmd configures
519 * @mac_id: interface ID. Relevant only if action is FW_CTXT_ACTION_ADD
520 * @phy_id: PHY index. Can be changed only if the link was inactive
521 *	(and stays inactive). If the link is active (or becomes active),
522 *	this field is ignored.
523 * @local_link_addr: the links MAC address. Can be changed only if the link was
524 *	inactive (and stays inactive). If the link is active
525 *	(or becomes active), this field is ignored.
526 * @reserved_for_local_link_addr: reserved
527 * @modify_mask: from &enum iwl_link_ctx_modify_flags, selects what to change.
528 *	Relevant only if action is FW_CTXT_ACTION_MODIFY
529 * @active: indicates whether the link is active or not
530 * @listen_lmac: indicates whether the link should be allocated on the Listen
531 *	Lmac or on the Main Lmac. Cannot be changed on an active Link.
532 *	Relevant only for eSR.
533 * @block_tx: tell the firmware that this link can't Tx. This should be used
534 *	only when a link is de-activated because of CSA with mode = 1.
535 *	Available since version 5.
536 * @modify_bandwidth: bandwidth request value for RX OMI (see also
537 *	%LINK_CONTEXT_MODIFY_BANDWIDTH), from &enum iwl_link_modify_bandwidth.
538 * @reserved1: in version 2, listen_lmac became reserved
539 * @cck_rates: basic rates available for CCK
540 * @ofdm_rates: basic rates available for OFDM
541 * @cck_short_preamble: 1 for enabling short preamble, 0 otherwise
542 * @short_slot: 1 for enabling short slots, 0 otherwise
543 * @protection_flags: combination of &enum iwl_link_ctx_protection_flags
544 * @qos_flags: from &enum iwl_mac_qos_flags
545 * @ac: one iwl_mac_qos configuration for each AC
546 * @htc_trig_based_pkt_ext: default PE in 4us units
547 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
548 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
549 * @ndp_fdbk_buff_th_exp: set exponent for the NDP feedback buffered threshold
550 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
551 * @bi: beacon interval in TU, applicable only when associated
552 * @dtim_interval: DTIM interval in TU.
553 *	Relevant only for GO, otherwise this is offloaded.
554 * @puncture_mask: puncture mask for EHT (removed in VER_3)
555 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
556 * @flags: a combination from &enum iwl_link_ctx_flags
557 * @flags_mask: what of %flags have changed. Also &enum iwl_link_ctx_flags
558 * Below fields are for multi-bssid:
559 * @ref_bssid_addr: reference BSSID used by the AP
560 * @reserved_for_ref_bssid_addr: reserved
561 * @bssid_index: index of the associated VAP
562 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
563 * @spec_link_id: link_id as the AP knows it
564 * @ul_mu_data_disable: OM Control UL MU Data Disable RX Support (bit 44) in
565 *	HE MAC Capabilities information field as defined in figure 9-897 in
566 *	IEEE802.11REVme-D5.0
567 * @ibss_bssid_addr: bssid for ibss
568 * @reserved_for_ibss_bssid_addr: reserved
569 * @npca_params: NPCA parameters
570 * @prio_edca_params: priority EDCA parameters for enhanced QoS
571 * @reserved3: reserved for future use
572 */
573struct iwl_link_config_cmd {
574	__le32 action;
575	__le32 link_id;
576	__le32 mac_id;
577	__le32 phy_id;
578	u8 local_link_addr[6];
579	__le16 reserved_for_local_link_addr;
580	__le32 modify_mask;
581	__le32 active;
582	union {
583		__le32 listen_lmac; /* only _VER_1 */
584		struct {
585			u8 block_tx; /* since _VER_5 */
586			u8 modify_bandwidth; /* since _VER_6 */
587			u8 reserved1[2];
588		};
589	};
590	__le32 cck_rates;
591	__le32 ofdm_rates;
592	__le32 cck_short_preamble;
593	__le32 short_slot;
594	__le32 protection_flags;
595	/* MAC_QOS_PARAM_API_S_VER_1 */
596	__le32 qos_flags;
597	struct iwl_ac_qos ac[AC_NUM + 1];
598	u8 htc_trig_based_pkt_ext;
599	u8 rand_alloc_ecwmin;
600	u8 rand_alloc_ecwmax;
601	u8 ndp_fdbk_buff_th_exp;
602	struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
603	__le32 bi;
604	__le32 dtim_interval;
605	__le16 puncture_mask; /* removed in _VER_3 */
606	__le16 frame_time_rts_th;
607	__le32 flags;
608	__le32 flags_mask; /* removed in _VER_6 */
609	/* The below fields are for multi-bssid */
610	u8 ref_bssid_addr[6];
611	__le16 reserved_for_ref_bssid_addr;
612	u8 bssid_index;
613	u8 bss_color;
614	u8 spec_link_id;
615	u8 ul_mu_data_disable;
616	u8 ibss_bssid_addr[6];
617	__le16 reserved_for_ibss_bssid_addr;
618	struct iwl_npca_params npca_params; /* since _VER_7 */
619	struct iwl_ac_qos prio_edca_params; /* since _VER_7 */
620	__le32 reserved3[4];
621} __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1, _VER_2, _VER_3, _VER_4, _VER_5, _VER_6, _VER_7 */
622
623/* Currently FW supports link ids in the range 0-3 and can have
624 * at most two active links for each vif.
625 */
626#define IWL_FW_MAX_ACTIVE_LINKS_NUM 2
627#define IWL_FW_MAX_LINK_ID 3
628
629/**
630 * enum iwl_fw_sta_type - FW station types
631 * @STATION_TYPE_PEER: represents a peer - AP in BSS, a TDLS sta, a client in
632 *	P2P.
633 * @STATION_TYPE_BCAST_MGMT: The station used to send beacons and
634 *	probe responses. Also used for traffic injection in sniffer mode
635 * @STATION_TYPE_MCAST: the station used for BCAST / MCAST in GO. Will be
636 *	suspended / resumed at the right timing depending on the clients'
637 *	power save state and the DTIM timing
638 * @STATION_TYPE_AUX: aux sta. In the FW there is no need for a special type
639 *	for the aux sta, so this type is only for driver - internal use.
640 */
641enum iwl_fw_sta_type {
642	STATION_TYPE_PEER,
643	STATION_TYPE_BCAST_MGMT,
644	STATION_TYPE_MCAST,
645	STATION_TYPE_AUX,
646}; /* STATION_TYPE_E_VER_1 */
647
648/**
649 * struct iwl_sta_cfg_cmd_v1 - cmd structure to add a peer sta to the uCode's
650 *	station table
651 * ( STA_CONFIG_CMD = 0xA )
652 *
653 * @sta_id: index of station in uCode's station table
654 * @link_id: the id of the link that is used to communicate with this sta
655 * @peer_mld_address: the peers mld address
656 * @reserved_for_peer_mld_address: reserved
657 * @peer_link_address: the address of the link that is used to communicate
658 *	with this sta
659 * @reserved_for_peer_link_address: reserved
660 * @station_type: type of this station. See &enum iwl_fw_sta_type
661 * @assoc_id: for GO only
662 * @beamform_flags: beam forming controls
663 * @mfp: indicates whether the STA uses management frame protection or not.
664 * @mimo: indicates whether the sta uses mimo or not
665 * @mimo_protection: indicates whether the sta uses mimo protection or not
666 * @ack_enabled: indicates that the AP supports receiving ACK-
667 *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
668 * @trig_rnd_alloc: indicates that trigger based random allocation
669 *	is enabled according to UORA element existence
670 * @tx_ampdu_spacing: minimum A-MPDU spacing:
671 *	4 - 2us density, 5 - 4us density, 6 - 8us density, 7 - 16us density
672 * @tx_ampdu_max_size: maximum A-MPDU length: 0 - 8K, 1 - 16K, 2 - 32K,
673 *	3 - 64K, 4 - 128K, 5 - 256K, 6 - 512K, 7 - 1024K.
674 * @sp_length: the size of the SP in actual number of frames
675 * @uapsd_acs:  4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
676 *	enabled ACs.
677 * @pkt_ext: optional, exists according to PPE-present bit in the HE/EHT-PHY
678 *	capa
679 * @htc_flags: which features are supported in HTC
680 */
681struct iwl_sta_cfg_cmd_v1 {
682	__le32 sta_id;
683	__le32 link_id;
684	u8 peer_mld_address[ETH_ALEN];
685	__le16 reserved_for_peer_mld_address;
686	u8 peer_link_address[ETH_ALEN];
687	__le16 reserved_for_peer_link_address;
688	__le32 station_type;
689	__le32 assoc_id;
690	__le32 beamform_flags;
691	__le32 mfp;
692	__le32 mimo;
693	__le32 mimo_protection;
694	__le32 ack_enabled;
695	__le32 trig_rnd_alloc;
696	__le32 tx_ampdu_spacing;
697	__le32 tx_ampdu_max_size;
698	__le32 sp_length;
699	__le32 uapsd_acs;
700	struct iwl_he_pkt_ext_v2 pkt_ext;
701	__le32 htc_flags;
702} __packed; /* STA_CMD_API_S_VER_1 */
703
704/**
705 * struct iwl_sta_cfg_cmd - cmd structure to add a peer sta to the uCode's
706 *	station table
707 * ( STA_CONFIG_CMD = 0xA )
708 *
709 * @sta_id: index of station in uCode's station table
710 * @link_id: the id of the link that is used to communicate with this sta
711 * @peer_mld_address: the peers mld address
712 * @reserved_for_peer_mld_address: reserved
713 * @peer_link_address: the address of the link that is used to communicate
714 *	with this sta
715 * @reserved_for_peer_link_address: reserved
716 * @station_type: type of this station. See &enum iwl_fw_sta_type
717 * @assoc_id: for GO only
718 * @beamform_flags: beam forming controls
719 * @mfp: indicates whether the STA uses management frame protection or not.
720 * @mimo: indicates whether the sta uses mimo or not
721 * @mimo_protection: indicates whether the sta uses mimo protection or not
722 * @ack_enabled: indicates that the AP supports receiving ACK-
723 *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
724 * @trig_rnd_alloc: indicates that trigger based random allocation
725 *	is enabled according to UORA element existence
726 * @tx_ampdu_spacing: minimum A-MPDU spacing:
727 *	4 - 2us density, 5 - 4us density, 6 - 8us density, 7 - 16us density
728 * @tx_ampdu_max_size: maximum A-MPDU length: 0 - 8K, 1 - 16K, 2 - 32K,
729 *	3 - 64K, 4 - 128K, 5 - 256K, 6 - 512K, 7 - 1024K.
730 * @sp_length: the size of the SP in actual number of frames
731 * @uapsd_acs:  4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
732 *	enabled ACs.
733 * @pkt_ext: optional, exists according to PPE-present bit in the HE/EHT-PHY
734 *	capa
735 * @htc_flags: which features are supported in HTC
736 * @use_ldpc_x2_cw: Indicates whether to use LDPC with double CW
737 * @use_icf: Indicates whether to use ICF instead of RTS
738 * @dps_pad_time: DPS (Dynamic Power Save) padding delay resolution to ensure
739 *	proper timing alignment
740 * @dps_trans_delay: DPS minimal time that takes the peer to return to low power
741 * @mic_prep_pad_delay: MIC prep time padding
742 * @mic_compute_pad_delay: MIC compute time padding
743 * @reserved: Reserved for alignment
744 */
745struct iwl_sta_cfg_cmd {
746	__le32 sta_id;
747	__le32 link_id;
748	u8 peer_mld_address[ETH_ALEN];
749	__le16 reserved_for_peer_mld_address;
750	u8 peer_link_address[ETH_ALEN];
751	__le16 reserved_for_peer_link_address;
752	__le32 station_type;
753	__le32 assoc_id;
754	__le32 beamform_flags;
755	__le32 mfp;
756	__le32 mimo;
757	__le32 mimo_protection;
758	__le32 ack_enabled;
759	__le32 trig_rnd_alloc;
760	__le32 tx_ampdu_spacing;
761	__le32 tx_ampdu_max_size;
762	__le32 sp_length;
763	__le32 uapsd_acs;
764	struct iwl_he_pkt_ext_v2 pkt_ext;
765	__le32 htc_flags;
766	u8 use_ldpc_x2_cw;
767	u8 use_icf;
768	u8 dps_pad_time;
769	u8 dps_trans_delay;
770	u8 mic_prep_pad_delay;
771	u8 mic_compute_pad_delay;
772	u8 reserved[2];
773} __packed; /* STA_CMD_API_S_VER_2 */
774
775/**
776 * struct iwl_aux_sta_cmd - command for AUX STA configuration
777 * ( AUX_STA_CMD = 0xB )
778 *
779 * @sta_id: index of aux sta to configure
780 * @lmac_id: ?
781 * @mac_addr: mac addr of the auxilary sta
782 * @reserved_for_mac_addr: reserved
783 */
784struct iwl_aux_sta_cmd {
785	__le32 sta_id;
786	__le32 lmac_id;
787	u8 mac_addr[ETH_ALEN];
788	__le16 reserved_for_mac_addr;
789
790} __packed; /* AUX_STA_CMD_API_S_VER_1 */
791
792/**
793 * struct iwl_remove_sta_cmd - a cmd structure to remove a sta added by
794 *	STA_CONFIG_CMD or AUX_STA_CONFIG_CMD
795 * ( STA_REMOVE_CMD = 0xC )
796 *
797 * @sta_id: index of station to remove
798 */
799struct iwl_remove_sta_cmd {
800	__le32 sta_id;
801} __packed; /* REMOVE_STA_API_S_VER_1 */
802
803/**
804 * struct iwl_mvm_sta_disable_tx_cmd - disable / re-enable tx to a sta
805 * ( STA_DISABLE_TX_CMD = 0xD )
806 *
807 * @sta_id: index of the station to disable tx to
808 * @disable: indicates if to disable or re-enable tx
809 */
810struct iwl_mvm_sta_disable_tx_cmd {
811	__le32 sta_id;
812	__le32 disable;
813} __packed; /* STA_DISABLE_TX_API_S_VER_1 */
814
815/**
816 * enum iwl_mvm_fw_esr_recommendation - FW recommendation code
817 * @ESR_RECOMMEND_LEAVE: recommendation to leave EMLSR
818 * @ESR_FORCE_LEAVE: force exiting EMLSR
819 * @ESR_RECOMMEND_ENTER: recommendation to enter EMLSR
820 */
821enum iwl_mvm_fw_esr_recommendation {
822	ESR_RECOMMEND_LEAVE,
823	ESR_FORCE_LEAVE,
824	ESR_RECOMMEND_ENTER,
825}; /* ESR_MODE_RECOMMENDATION_CODE_API_E_VER_1 */
826
827/**
828 * struct iwl_esr_mode_notif_v1 - FW recommendation/force for EMLSR mode
829 *
830 * @action: the action to apply on EMLSR state.
831 *	See &iwl_mvm_fw_esr_recommendation
832 */
833struct iwl_esr_mode_notif_v1 {
834	__le32 action;
835} __packed; /* ESR_MODE_RECOMMENDATION_NTFY_API_S_VER_1 */
836
837/**
838 * enum iwl_esr_leave_reason - reasons for leaving EMLSR mode
839 *
840 * @ESR_LEAVE_REASON_OMI_MU_UL_DISALLOWED: OMI MU UL disallowed
841 * @ESR_LEAVE_REASON_NO_TRIG_FOR_ESR_STA: No trigger for EMLSR station
842 * @ESR_LEAVE_REASON_NO_ESR_STA_IN_MU_DL: No EMLSR station in MU DL
843 * @ESR_LEAVE_REASON_BAD_ACTIV_FRAME_TH: Bad activation frame threshold
844 * @ESR_LEAVE_REASON_RTS_IN_DUAL_LISTEN: RTS in dual listen
845 */
846enum iwl_esr_leave_reason {
847	ESR_LEAVE_REASON_OMI_MU_UL_DISALLOWED	= BIT(0),
848	ESR_LEAVE_REASON_NO_TRIG_FOR_ESR_STA	= BIT(1),
849	ESR_LEAVE_REASON_NO_ESR_STA_IN_MU_DL	= BIT(2),
850	ESR_LEAVE_REASON_BAD_ACTIV_FRAME_TH	= BIT(3),
851	ESR_LEAVE_REASON_RTS_IN_DUAL_LISTEN	= BIT(4),
852};
853
854/**
855 * struct iwl_esr_mode_notif - FW recommendation/force for EMLSR mode
856 *
857 * @action: the action to apply on EMLSR state.
858 *	See &iwl_mvm_fw_esr_recommendation
859 * @leave_reason_mask: mask for various reasons to leave EMLSR mode.
860 *	See &iwl_esr_leave_reason
861 */
862struct iwl_esr_mode_notif {
863	__le32 action;
864	__le32 leave_reason_mask;
865} __packed; /* ESR_MODE_RECOMMENDATION_NTFY_API_S_VER_2 */
866
867/**
868 * struct iwl_missed_beacons_notif - sent when by the firmware upon beacon loss
869 *  ( MISSED_BEACONS_NOTIF = 0xF6 )
870 * @link_id: fw link ID
871 * @consec_missed_beacons_since_last_rx: number of consecutive missed
872 *	beacons since last RX.
873 * @consec_missed_beacons: number of consecutive missed beacons
874 * @other_link_id: used in EMLSR only. The fw link ID for
875 *	&consec_missed_beacons_other_link. IWL_MVM_FW_LINK_ID_INVALID (0xff) if
876 *	invalid.
877 * @consec_missed_beacons_other_link: number of consecutive missed beacons on
878 *	&other_link_id.
879 */
880struct iwl_missed_beacons_notif {
881	__le32 link_id;
882	__le32 consec_missed_beacons_since_last_rx;
883	__le32 consec_missed_beacons;
884	__le32 other_link_id;
885	__le32 consec_missed_beacons_other_link;
886} __packed; /* MISSED_BEACON_NTFY_API_S_VER_5 */
887
888/*
889 * enum iwl_esr_trans_fail_code: to be used to parse the notif below
890 *
891 * @ESR_TRANS_FAILED_TX_STATUS_ERROR: failed to TX EML OMN frame
892 * @ESR_TRANSITION_FAILED_TX_TIMEOUT: timeout on the EML OMN frame
893 * @ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD: can't get a beacon on the new link
894 */
895enum iwl_esr_trans_fail_code {
896	ESR_TRANS_FAILED_TX_STATUS_ERROR,
897	ESR_TRANSITION_FAILED_TX_TIMEOUT,
898	ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD,
899};
900
901/**
902 * struct iwl_esr_trans_fail_notif - FW reports a failure in EMLSR transition
903 *
904 * @link_id: the link_id that still works after the failure
905 * @activation: true if the link was activated, false otherwise
906 * @err_code: see &enum iwl_esr_trans_fail_code
907 */
908struct iwl_esr_trans_fail_notif {
909	__le32 link_id;
910	__le32 activation;
911	__le32 err_code;
912} __packed; /* ESR_TRANSITION_FAILED_NTFY_API_S_VER_1 */
913
914/*
915 * enum iwl_twt_operation_type: TWT operation in a TWT action frame
916 *
917 * @TWT_OPERATION_REQUEST: TWT Request
918 * @TWT_OPERATION_SUGGEST: TWT Suggest
919 * @TWT_OPERATION_DEMAND: TWT Demand
920 * @TWT_OPERATION_GROUPING: TWT Grouping
921 * @TWT_OPERATION_ACCEPT: TWT Accept
922 * @TWT_OPERATION_ALTERNATE: TWT Alternate
923 * @TWT_OPERATION_DICTATE: TWT Dictate
924 * @TWT_OPERATION_REJECT: TWT Reject
925 * @TWT_OPERATION_TEARDOWN: TWT Teardown
926 * @TWT_OPERATION_UNAVAILABILITY: TWT Unavailability
927 */
928enum iwl_twt_operation_type {
929	TWT_OPERATION_REQUEST,
930	TWT_OPERATION_SUGGEST,
931	TWT_OPERATION_DEMAND,
932	TWT_OPERATION_GROUPING,
933	TWT_OPERATION_ACCEPT,
934	TWT_OPERATION_ALTERNATE,
935	TWT_OPERATION_DICTATE,
936	TWT_OPERATION_REJECT,
937	TWT_OPERATION_TEARDOWN,
938	TWT_OPERATION_UNAVAILABILITY,
939	TWT_OPERATION_MAX,
940}; /* TWT_OPERATION_TYPE_E_VER_1 */
941
942/**
943 * struct iwl_twt_operation_cmd - initiate a TWT session from driver
944 *
945 * @link_id: FW link id to initiate the TWT
946 * @twt_operation: &enum iwl_twt_operation_type
947 * @target_wake_time: TSF time to start the TWT
948 * @interval_exponent: the exponent for the interval
949 * @interval_mantissa: the mantissa for the interval
950 * @minimum_wake_duration: the minimum duration for the wake period
951 * @trigger: is the TWT triggered or not
952 * @flow_type: is the TWT announced (0) or not (1)
953 * @flow_id: the TWT flow identifier 0 - 7
954 * @twt_protection: is the TWT protected
955 * @ndp_paging_indicator: is ndp paging indicator set
956 * @responder_pm_mode: is responder pm mode set
957 * @negotiation_type: if the responder wants to doze outside the TWT SP
958 * @twt_request: 1 for TWT request (STA), 0 for TWT response (AP)
959 * @implicit: is TWT implicit
960 * @twt_group_assignment: the TWT group assignment
961 * @twt_channel: the TWT channel
962 * @restricted_info_present: is this a restricted TWT
963 * @dl_bitmap_valid: is DL (download) bitmap valid (restricted TWT)
964 * @ul_bitmap_valid: is UL (upload) bitmap valid (restricted TWT)
965 * @dl_tid_bitmap: DL TID bitmap (restricted TWT)
966 * @ul_tid_bitmap: UL TID bitmap (restricted TWT)
967 */
968struct iwl_twt_operation_cmd {
969	__le32 link_id;
970	__le32 twt_operation;
971	__le64 target_wake_time;
972	__le32 interval_exponent;
973	__le32 interval_mantissa;
974	__le32 minimum_wake_duration;
975	u8 trigger;
976	u8 flow_type;
977	u8 flow_id;
978	u8 twt_protection;
979	u8 ndp_paging_indicator;
980	u8 responder_pm_mode;
981	u8 negotiation_type;
982	u8 twt_request;
983	u8 implicit;
984	u8 twt_group_assignment;
985	u8 twt_channel;
986	u8 restricted_info_present;
987	u8 dl_bitmap_valid;
988	u8 ul_bitmap_valid;
989	u8 dl_tid_bitmap;
990	u8 ul_tid_bitmap;
991} __packed; /* TWT_OPERATION_API_S_VER_1 */
992
993#endif /* __iwl_fw_api_mac_cfg_h__ */
~/ Read-only file preview.