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