Loading...
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2/*
3 * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
4 * Copyright (C) 2017 Intel Deutschland GmbH
5 */
6#ifndef __iwl_fw_api_mac_h__
7#define __iwl_fw_api_mac_h__
8
9/*
10 * The first MAC indices (starting from 0) are available to the driver,
11 * AUX indices follows - 1 for non-CDB, 2 for CDB.
12 */
13#define MAC_INDEX_AUX 4
14#define MAC_INDEX_MIN_DRIVER 0
15#define NUM_MAC_INDEX_DRIVER MAC_INDEX_AUX
16#define NUM_MAC_INDEX (NUM_MAC_INDEX_DRIVER + 1)
17#define NUM_MAC_INDEX_CDB (NUM_MAC_INDEX_DRIVER + 2)
18
19#define IWL_MVM_STATION_COUNT_MAX 16
20#define IWL_MVM_INVALID_STA 0xFF
21
22enum iwl_ac {
23 AC_BK,
24 AC_BE,
25 AC_VI,
26 AC_VO,
27 AC_NUM,
28};
29
30/**
31 * enum iwl_mac_protection_flags - MAC context flags
32 * @MAC_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
33 * this will require CCK RTS/CTS2self.
34 * RTS/CTS will protect full burst time.
35 * @MAC_PROT_FLG_HT_PROT: enable HT protection
36 * @MAC_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
37 * @MAC_PROT_FLG_SELF_CTS_EN: allow CTS2self
38 */
39enum iwl_mac_protection_flags {
40 MAC_PROT_FLG_TGG_PROTECT = BIT(3),
41 MAC_PROT_FLG_HT_PROT = BIT(23),
42 MAC_PROT_FLG_FAT_PROT = BIT(24),
43 MAC_PROT_FLG_SELF_CTS_EN = BIT(30),
44};
45
46#define MAC_FLG_SHORT_SLOT BIT(4)
47#define MAC_FLG_SHORT_PREAMBLE BIT(5)
48
49/**
50 * enum iwl_mac_types - Supported MAC types
51 * @FW_MAC_TYPE_FIRST: lowest supported MAC type
52 * @FW_MAC_TYPE_AUX: Auxiliary MAC (internal)
53 * @FW_MAC_TYPE_LISTENER: monitor MAC type (?)
54 * @FW_MAC_TYPE_PIBSS: Pseudo-IBSS
55 * @FW_MAC_TYPE_IBSS: IBSS
56 * @FW_MAC_TYPE_BSS_STA: BSS (managed) station
57 * @FW_MAC_TYPE_P2P_DEVICE: P2P Device
58 * @FW_MAC_TYPE_P2P_STA: P2P client
59 * @FW_MAC_TYPE_GO: P2P GO
60 * @FW_MAC_TYPE_TEST: ?
61 * @FW_MAC_TYPE_MAX: highest support MAC type
62 */
63enum iwl_mac_types {
64 FW_MAC_TYPE_FIRST = 1,
65 FW_MAC_TYPE_AUX = FW_MAC_TYPE_FIRST,
66 FW_MAC_TYPE_LISTENER,
67 FW_MAC_TYPE_PIBSS,
68 FW_MAC_TYPE_IBSS,
69 FW_MAC_TYPE_BSS_STA,
70 FW_MAC_TYPE_P2P_DEVICE,
71 FW_MAC_TYPE_P2P_STA,
72 FW_MAC_TYPE_GO,
73 FW_MAC_TYPE_TEST,
74 FW_MAC_TYPE_MAX = FW_MAC_TYPE_TEST
75}; /* MAC_CONTEXT_TYPE_API_E_VER_1 */
76
77/**
78 * enum iwl_tsf_id - TSF hw timer ID
79 * @TSF_ID_A: use TSF A
80 * @TSF_ID_B: use TSF B
81 * @TSF_ID_C: use TSF C
82 * @TSF_ID_D: use TSF D
83 * @NUM_TSF_IDS: number of TSF timers available
84 */
85enum iwl_tsf_id {
86 TSF_ID_A = 0,
87 TSF_ID_B = 1,
88 TSF_ID_C = 2,
89 TSF_ID_D = 3,
90 NUM_TSF_IDS = 4,
91}; /* TSF_ID_API_E_VER_1 */
92
93/**
94 * struct iwl_mac_data_ap - configuration data for AP MAC context
95 * @beacon_time: beacon transmit time in system time
96 * @beacon_tsf: beacon transmit time in TSF
97 * @bi: beacon interval in TU
98 * @reserved1: reserved
99 * @dtim_interval: dtim transmit time in TU
100 * @reserved2: reserved
101 * @mcast_qid: queue ID for multicast traffic.
102 * NOTE: obsolete from VER2 and on
103 * @beacon_template: beacon template ID
104 */
105struct iwl_mac_data_ap {
106 __le32 beacon_time;
107 __le64 beacon_tsf;
108 __le32 bi;
109 __le32 reserved1;
110 __le32 dtim_interval;
111 __le32 reserved2;
112 __le32 mcast_qid;
113 __le32 beacon_template;
114} __packed; /* AP_MAC_DATA_API_S_VER_2 */
115
116/**
117 * struct iwl_mac_data_ibss - configuration data for IBSS MAC context
118 * @beacon_time: beacon transmit time in system time
119 * @beacon_tsf: beacon transmit time in TSF
120 * @bi: beacon interval in TU
121 * @reserved: reserved
122 * @beacon_template: beacon template ID
123 */
124struct iwl_mac_data_ibss {
125 __le32 beacon_time;
126 __le64 beacon_tsf;
127 __le32 bi;
128 __le32 reserved;
129 __le32 beacon_template;
130} __packed; /* IBSS_MAC_DATA_API_S_VER_1 */
131
132/**
133 * enum iwl_mac_data_policy - policy of the data path for this MAC
134 * @TWT_SUPPORTED: twt is supported
135 * @MORE_DATA_ACK_SUPPORTED: AP supports More Data Ack according to
136 * paragraph 9.4.1.17 in P802.11ax_D4 specification. Used for TWT
137 * early termination detection.
138 * @FLEXIBLE_TWT_SUPPORTED: AP supports flexible TWT schedule
139 * @PROTECTED_TWT_SUPPORTED: AP supports protected TWT frames (with 11w)
140 * @BROADCAST_TWT_SUPPORTED: AP and STA support broadcast TWT
141 * @COEX_HIGH_PRIORITY_ENABLE: high priority mode for BT coex, to be used
142 * during 802.1X negotiation (and allowed during 4-way-HS)
143 */
144enum iwl_mac_data_policy {
145 TWT_SUPPORTED = BIT(0),
146 MORE_DATA_ACK_SUPPORTED = BIT(1),
147 FLEXIBLE_TWT_SUPPORTED = BIT(2),
148 PROTECTED_TWT_SUPPORTED = BIT(3),
149 BROADCAST_TWT_SUPPORTED = BIT(4),
150 COEX_HIGH_PRIORITY_ENABLE = BIT(5),
151};
152
153/**
154 * struct iwl_mac_data_sta - configuration data for station MAC context
155 * @is_assoc: 1 for associated state, 0 otherwise
156 * @dtim_time: DTIM arrival time in system time
157 * @dtim_tsf: DTIM arrival time in TSF
158 * @bi: beacon interval in TU, applicable only when associated
159 * @reserved1: reserved
160 * @dtim_interval: DTIM interval in TU, applicable only when associated
161 * @data_policy: see &enum iwl_mac_data_policy
162 * @listen_interval: in beacon intervals, applicable only when associated
163 * @assoc_id: unique ID assigned by the AP during association
164 * @assoc_beacon_arrive_time: TSF of first beacon after association
165 */
166struct iwl_mac_data_sta {
167 __le32 is_assoc;
168 __le32 dtim_time;
169 __le64 dtim_tsf;
170 __le32 bi;
171 __le32 reserved1;
172 __le32 dtim_interval;
173 __le32 data_policy;
174 __le32 listen_interval;
175 __le32 assoc_id;
176 __le32 assoc_beacon_arrive_time;
177} __packed; /* STA_MAC_DATA_API_S_VER_2 */
178
179/**
180 * struct iwl_mac_data_go - configuration data for P2P GO MAC context
181 * @ap: iwl_mac_data_ap struct with most config data
182 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
183 * 0 indicates that there is no CT window.
184 * @opp_ps_enabled: indicate that opportunistic PS allowed
185 */
186struct iwl_mac_data_go {
187 struct iwl_mac_data_ap ap;
188 __le32 ctwin;
189 __le32 opp_ps_enabled;
190} __packed; /* GO_MAC_DATA_API_S_VER_1 */
191
192/**
193 * struct iwl_mac_data_p2p_sta - configuration data for P2P client MAC context
194 * @sta: iwl_mac_data_sta struct with most config data
195 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
196 * 0 indicates that there is no CT window.
197 */
198struct iwl_mac_data_p2p_sta {
199 struct iwl_mac_data_sta sta;
200 __le32 ctwin;
201} __packed; /* P2P_STA_MAC_DATA_API_S_VER_2 */
202
203/**
204 * struct iwl_mac_data_pibss - Pseudo IBSS config data
205 * @stats_interval: interval in TU between statistics notifications to host.
206 */
207struct iwl_mac_data_pibss {
208 __le32 stats_interval;
209} __packed; /* PIBSS_MAC_DATA_API_S_VER_1 */
210
211/*
212 * struct iwl_mac_data_p2p_dev - configuration data for the P2P Device MAC
213 * context.
214 * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
215 * other channels as well. This should be to true only in case that the
216 * device is discoverable and there is an active GO. Note that setting this
217 * field when not needed, will increase the number of interrupts and have
218 * effect on the platform power, as this setting opens the Rx filters on
219 * all macs.
220 */
221struct iwl_mac_data_p2p_dev {
222 __le32 is_disc_extended;
223} __packed; /* _P2P_DEV_MAC_DATA_API_S_VER_1 */
224
225/**
226 * enum iwl_mac_filter_flags - MAC context filter flags
227 * @MAC_FILTER_IN_PROMISC: accept all data frames
228 * @MAC_FILTER_IN_CONTROL_AND_MGMT: pass all management and
229 * control frames to the host
230 * @MAC_FILTER_ACCEPT_GRP: accept multicast frames
231 * @MAC_FILTER_DIS_DECRYPT: don't decrypt unicast frames
232 * @MAC_FILTER_DIS_GRP_DECRYPT: don't decrypt multicast frames
233 * @MAC_FILTER_IN_BEACON: transfer foreign BSS's beacons to host
234 * (in station mode when associated)
235 * @MAC_FILTER_OUT_BCAST: filter out all broadcast frames
236 * @MAC_FILTER_IN_CRC32: extract FCS and append it to frames
237 * @MAC_FILTER_IN_PROBE_REQUEST: pass probe requests to host
238 */
239enum iwl_mac_filter_flags {
240 MAC_FILTER_IN_PROMISC = BIT(0),
241 MAC_FILTER_IN_CONTROL_AND_MGMT = BIT(1),
242 MAC_FILTER_ACCEPT_GRP = BIT(2),
243 MAC_FILTER_DIS_DECRYPT = BIT(3),
244 MAC_FILTER_DIS_GRP_DECRYPT = BIT(4),
245 MAC_FILTER_IN_BEACON = BIT(6),
246 MAC_FILTER_OUT_BCAST = BIT(8),
247 MAC_FILTER_IN_CRC32 = BIT(11),
248 MAC_FILTER_IN_PROBE_REQUEST = BIT(12),
249 /**
250 * @MAC_FILTER_IN_11AX: mark BSS as supporting 802.11ax
251 */
252 MAC_FILTER_IN_11AX = BIT(14),
253};
254
255/**
256 * enum iwl_mac_qos_flags - QoS flags
257 * @MAC_QOS_FLG_UPDATE_EDCA: ?
258 * @MAC_QOS_FLG_TGN: HT is enabled
259 * @MAC_QOS_FLG_TXOP_TYPE: ?
260 *
261 */
262enum iwl_mac_qos_flags {
263 MAC_QOS_FLG_UPDATE_EDCA = BIT(0),
264 MAC_QOS_FLG_TGN = BIT(1),
265 MAC_QOS_FLG_TXOP_TYPE = BIT(4),
266};
267
268/**
269 * struct iwl_ac_qos - QOS timing params for MAC_CONTEXT_CMD
270 * @cw_min: Contention window, start value in numbers of slots.
271 * Should be a power-of-2, minus 1. Device's default is 0x0f.
272 * @cw_max: Contention window, max value in numbers of slots.
273 * Should be a power-of-2, minus 1. Device's default is 0x3f.
274 * @aifsn: Number of slots in Arbitration Interframe Space (before
275 * performing random backoff timing prior to Tx). Device default 1.
276 * @fifos_mask: FIFOs used by this MAC for this AC
277 * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0.
278 *
279 * One instance of this config struct for each of 4 EDCA access categories
280 * in struct iwl_qosparam_cmd.
281 *
282 * Device will automatically increase contention window by (2*CW) + 1 for each
283 * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW
284 * value, to cap the CW value.
285 */
286struct iwl_ac_qos {
287 __le16 cw_min;
288 __le16 cw_max;
289 u8 aifsn;
290 u8 fifos_mask;
291 __le16 edca_txop;
292} __packed; /* AC_QOS_API_S_VER_2 */
293
294/**
295 * struct iwl_mac_ctx_cmd - command structure to configure MAC contexts
296 * ( MAC_CONTEXT_CMD = 0x28 )
297 * @id_and_color: ID and color of the MAC
298 * @action: action to perform, see &enum iwl_ctxt_action
299 * @mac_type: one of &enum iwl_mac_types
300 * @tsf_id: TSF HW timer, one of &enum iwl_tsf_id
301 * @node_addr: MAC address
302 * @reserved_for_node_addr: reserved
303 * @bssid_addr: BSSID
304 * @reserved_for_bssid_addr: reserved
305 * @cck_rates: basic rates available for CCK
306 * @ofdm_rates: basic rates available for OFDM
307 * @protection_flags: combination of &enum iwl_mac_protection_flags
308 * @cck_short_preamble: 0x20 for enabling short preamble, 0 otherwise
309 * @short_slot: 0x10 for enabling short slots, 0 otherwise
310 * @filter_flags: combination of &enum iwl_mac_filter_flags
311 * @qos_flags: from &enum iwl_mac_qos_flags
312 * @ac: one iwl_mac_qos configuration for each AC
313 */
314struct iwl_mac_ctx_cmd {
315 /* COMMON_INDEX_HDR_API_S_VER_1 */
316 __le32 id_and_color;
317 __le32 action;
318 /* MAC_CONTEXT_COMMON_DATA_API_S_VER_1 */
319 __le32 mac_type;
320 __le32 tsf_id;
321 u8 node_addr[6];
322 __le16 reserved_for_node_addr;
323 u8 bssid_addr[6];
324 __le16 reserved_for_bssid_addr;
325 __le32 cck_rates;
326 __le32 ofdm_rates;
327 __le32 protection_flags;
328 __le32 cck_short_preamble;
329 __le32 short_slot;
330 __le32 filter_flags;
331 /* MAC_QOS_PARAM_API_S_VER_1 */
332 __le32 qos_flags;
333 struct iwl_ac_qos ac[AC_NUM+1];
334 /* MAC_CONTEXT_COMMON_DATA_API_S */
335 union {
336 struct iwl_mac_data_ap ap;
337 struct iwl_mac_data_go go;
338 struct iwl_mac_data_sta sta;
339 struct iwl_mac_data_p2p_sta p2p_sta;
340 struct iwl_mac_data_p2p_dev p2p_dev;
341 struct iwl_mac_data_pibss pibss;
342 struct iwl_mac_data_ibss ibss;
343 };
344} __packed; /* MAC_CONTEXT_CMD_API_S_VER_1 */
345
346#define IWL_NONQOS_SEQ_GET 0x1
347#define IWL_NONQOS_SEQ_SET 0x2
348struct iwl_nonqos_seq_query_cmd {
349 __le32 get_set_flag;
350 __le32 mac_id_n_color;
351 __le16 value;
352 __le16 reserved;
353} __packed; /* NON_QOS_TX_COUNTER_GET_SET_API_S_VER_1 */
354
355/**
356 * struct iwl_missed_beacons_notif_ver_3 - information on missed beacons
357 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
358 * @mac_id: interface ID
359 * @consec_missed_beacons_since_last_rx: number of consecutive missed
360 * beacons since last RX.
361 * @consec_missed_beacons: number of consecutive missed beacons
362 * @num_expected_beacons: number of expected beacons
363 * @num_recvd_beacons: number of received beacons
364 */
365struct iwl_missed_beacons_notif_ver_3 {
366 __le32 mac_id;
367 __le32 consec_missed_beacons_since_last_rx;
368 __le32 consec_missed_beacons;
369 __le32 num_expected_beacons;
370 __le32 num_recvd_beacons;
371} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
372
373/**
374 * struct iwl_missed_beacons_notif - information on missed beacons
375 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
376 * @link_id: fw link ID
377 * @consec_missed_beacons_since_last_rx: number of consecutive missed
378 * beacons since last RX.
379 * @consec_missed_beacons: number of consecutive missed beacons
380 * @num_expected_beacons: number of expected beacons
381 * @num_recvd_beacons: number of received beacons
382 */
383struct iwl_missed_beacons_notif {
384 __le32 link_id;
385 __le32 consec_missed_beacons_since_last_rx;
386 __le32 consec_missed_beacons;
387 __le32 num_expected_beacons;
388 __le32 num_recvd_beacons;
389} __packed; /* MISSED_BEACON_NTFY_API_S_VER_4 */
390
391/**
392 * struct iwl_he_backoff_conf - used for backoff configuration
393 * Per each trigger-based AC, (set by MU EDCA Parameter set info-element)
394 * used for backoff configuration of TXF5..TXF8 trigger based.
395 * The MU-TIMER is reloaded w/ MU_TIME each time a frame from the AC is sent via
396 * trigger-based TX.
397 * @cwmin: CW min
398 * @cwmax: CW max
399 * @aifsn: AIFSN
400 * AIFSN=0, means that no backoff from the specified TRIG-BASED AC is
401 * allowed till the MU-TIMER is 0
402 * @mu_time: MU time in 8TU units
403 */
404struct iwl_he_backoff_conf {
405 __le16 cwmin;
406 __le16 cwmax;
407 __le16 aifsn;
408 __le16 mu_time;
409} __packed; /* AC_QOS_DOT11AX_API_S */
410
411/**
412 * enum iwl_he_pkt_ext_constellations - PPE constellation indices
413 * @IWL_HE_PKT_EXT_BPSK: BPSK
414 * @IWL_HE_PKT_EXT_QPSK: QPSK
415 * @IWL_HE_PKT_EXT_16QAM: 16-QAM
416 * @IWL_HE_PKT_EXT_64QAM: 64-QAM
417 * @IWL_HE_PKT_EXT_256QAM: 256-QAM
418 * @IWL_HE_PKT_EXT_1024QAM: 1024-QAM
419 * @IWL_HE_PKT_EXT_4096QAM: 4096-QAM, for EHT only
420 * @IWL_HE_PKT_EXT_NONE: not defined
421 */
422enum iwl_he_pkt_ext_constellations {
423 IWL_HE_PKT_EXT_BPSK = 0,
424 IWL_HE_PKT_EXT_QPSK,
425 IWL_HE_PKT_EXT_16QAM,
426 IWL_HE_PKT_EXT_64QAM,
427 IWL_HE_PKT_EXT_256QAM,
428 IWL_HE_PKT_EXT_1024QAM,
429 IWL_HE_PKT_EXT_4096QAM,
430 IWL_HE_PKT_EXT_NONE,
431};
432
433#define MAX_HE_SUPP_NSS 2
434#define MAX_CHANNEL_BW_INDX_API_D_VER_2 4
435#define MAX_CHANNEL_BW_INDX_API_D_VER_3 5
436
437/**
438 * struct iwl_he_pkt_ext_v1 - QAM thresholds
439 * The required PPE is set via HE Capabilities IE, per Nss x BW x MCS
440 * The IE is organized in the following way:
441 * Support for Nss x BW (or RU) matrix:
442 * (0=SISO, 1=MIMO2) x (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz)
443 * Each entry contains 2 QAM thresholds for 8us and 16us:
444 * 0=BPSK, 1=QPSK, 2=16QAM, 3=64QAM, 4=256QAM, 5=1024QAM, 6=RES, 7=NONE
445 * i.e. QAM_th1 < QAM_th2 such if TX uses QAM_tx:
446 * QAM_tx < QAM_th1 --> PPE=0us
447 * QAM_th1 <= QAM_tx < QAM_th2 --> PPE=8us
448 * QAM_th2 <= QAM_tx --> PPE=16us
449 * @pkt_ext_qam_th: QAM thresholds
450 * For each Nss/Bw define 2 QAM thrsholds (0..5)
451 * For rates below the low_th, no need for PPE
452 * For rates between low_th and high_th, need 8us PPE
453 * For rates equal or higher then the high_th, need 16us PPE
454 * Nss (0-siso, 1-mimo2) x BW (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz) x
455 * (0-low_th, 1-high_th)
456 */
457struct iwl_he_pkt_ext_v1 {
458 u8 pkt_ext_qam_th[MAX_HE_SUPP_NSS][MAX_CHANNEL_BW_INDX_API_D_VER_2][2];
459} __packed; /* PKT_EXT_DOT11AX_API_S_VER_1 */
460
461/**
462 * struct iwl_he_pkt_ext_v2 - QAM thresholds
463 * The required PPE is set via HE Capabilities IE, per Nss x BW x MCS
464 * The IE is organized in the following way:
465 * Support for Nss x BW (or RU) matrix:
466 * (0=SISO, 1=MIMO2) x (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz)
467 * Each entry contains 2 QAM thresholds for 8us and 16us:
468 * 0=BPSK, 1=QPSK, 2=16QAM, 3=64QAM, 4=256QAM, 5=1024QAM, 6=RES, 7=NONE
469 * i.e. QAM_th1 < QAM_th2 such if TX uses QAM_tx:
470 * QAM_tx < QAM_th1 --> PPE=0us
471 * QAM_th1 <= QAM_tx < QAM_th2 --> PPE=8us
472 * QAM_th2 <= QAM_tx --> PPE=16us
473 * @pkt_ext_qam_th: QAM thresholds
474 * For each Nss/Bw define 2 QAM thrsholds (0..5)
475 * For rates below the low_th, no need for PPE
476 * For rates between low_th and high_th, need 8us PPE
477 * For rates equal or higher then the high_th, need 16us PPE
478 * Nss (0-siso, 1-mimo2) x
479 * BW (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz, 4-320MHz) x
480 * (0-low_th, 1-high_th)
481 */
482struct iwl_he_pkt_ext_v2 {
483 u8 pkt_ext_qam_th[MAX_HE_SUPP_NSS][MAX_CHANNEL_BW_INDX_API_D_VER_3][2];
484} __packed; /* PKT_EXT_DOT11AX_API_S_VER_2 */
485
486/**
487 * enum iwl_he_sta_ctxt_flags - HE STA context flags
488 * @STA_CTXT_HE_REF_BSSID_VALID: ref bssid addr valid (for receiving specific
489 * control frames such as TRIG, NDPA, BACK)
490 * @STA_CTXT_HE_BSS_COLOR_DIS: BSS color disable, don't use the BSS
491 * color for RX filter but use MAC header
492 * @STA_CTXT_HE_PARTIAL_BSS_COLOR: partial BSS color allocation
493 * @STA_CTXT_HE_32BIT_BA_BITMAP: indicates the receiver supports BA bitmap
494 * of 32-bits
495 * @STA_CTXT_HE_PACKET_EXT: indicates that the packet-extension info is valid
496 * and should be used
497 * @STA_CTXT_HE_TRIG_RND_ALLOC: indicates that trigger based random allocation
498 * is enabled according to UORA element existence
499 * @STA_CTXT_HE_CONST_TRIG_RND_ALLOC: used for AV testing
500 * @STA_CTXT_HE_ACK_ENABLED: indicates that the AP supports receiving ACK-
501 * enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
502 * @STA_CTXT_HE_MU_EDCA_CW: indicates that there is an element of MU EDCA
503 * parameter set, i.e. the backoff counters for trig-based ACs
504 * @STA_CTXT_HE_NIC_NOT_ACK_ENABLED: mark that the NIC doesn't support receiving
505 * ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
506 * If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
507 * len delim to determine if AGG or single.
508 * @STA_CTXT_HE_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
509 * not allowed (as there are OBSS that might classify such transmissions as
510 * radar pulses).
511 * @STA_CTXT_HE_NDP_FEEDBACK_ENABLED: mark support for NDP feedback and change
512 * of threshold
513 * @STA_CTXT_EHT_PUNCTURE_MASK_VALID: indicates the puncture_mask field is valid
514 * @STA_CTXT_EHT_LONG_PPE_ENABLED: indicates the PPE requirement should be
515 * extended to 20us for BW > 160Mhz or for MCS w/ 4096-QAM.
516 */
517enum iwl_he_sta_ctxt_flags {
518 STA_CTXT_HE_REF_BSSID_VALID = BIT(4),
519 STA_CTXT_HE_BSS_COLOR_DIS = BIT(5),
520 STA_CTXT_HE_PARTIAL_BSS_COLOR = BIT(6),
521 STA_CTXT_HE_32BIT_BA_BITMAP = BIT(7),
522 STA_CTXT_HE_PACKET_EXT = BIT(8),
523 STA_CTXT_HE_TRIG_RND_ALLOC = BIT(9),
524 STA_CTXT_HE_CONST_TRIG_RND_ALLOC = BIT(10),
525 STA_CTXT_HE_ACK_ENABLED = BIT(11),
526 STA_CTXT_HE_MU_EDCA_CW = BIT(12),
527 STA_CTXT_HE_NIC_NOT_ACK_ENABLED = BIT(13),
528 STA_CTXT_HE_RU_2MHZ_BLOCK = BIT(14),
529 STA_CTXT_HE_NDP_FEEDBACK_ENABLED = BIT(15),
530 STA_CTXT_EHT_PUNCTURE_MASK_VALID = BIT(16),
531 STA_CTXT_EHT_LONG_PPE_ENABLED = BIT(17),
532};
533
534/**
535 * enum iwl_he_htc_flags - HE HTC support flags
536 * @IWL_HE_HTC_SUPPORT: HE-HTC support
537 * @IWL_HE_HTC_UL_MU_RESP_SCHED: HE UL MU response schedule
538 * support via A-control field
539 * @IWL_HE_HTC_BSR_SUPP: BSR support in A-control field
540 * @IWL_HE_HTC_OMI_SUPP: A-OMI support in A-control field
541 * @IWL_HE_HTC_BQR_SUPP: A-BQR support in A-control field
542 */
543enum iwl_he_htc_flags {
544 IWL_HE_HTC_SUPPORT = BIT(0),
545 IWL_HE_HTC_UL_MU_RESP_SCHED = BIT(3),
546 IWL_HE_HTC_BSR_SUPP = BIT(4),
547 IWL_HE_HTC_OMI_SUPP = BIT(5),
548 IWL_HE_HTC_BQR_SUPP = BIT(6),
549};
550
551/*
552 * @IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK: the STA does not provide HE MFB
553 * @IWL_HE_HTC_LINK_ADAP_UNSOLICITED: the STA provides only unsolicited HE MFB
554 * @IWL_HE_HTC_LINK_ADAP_BOTH: the STA is capable of providing HE MFB in
555 * response to HE MRQ and if the STA provides unsolicited HE MFB
556 */
557#define IWL_HE_HTC_LINK_ADAP_POS (1)
558#define IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK (0)
559#define IWL_HE_HTC_LINK_ADAP_UNSOLICITED (2 << IWL_HE_HTC_LINK_ADAP_POS)
560#define IWL_HE_HTC_LINK_ADAP_BOTH (3 << IWL_HE_HTC_LINK_ADAP_POS)
561
562/**
563 * struct iwl_he_sta_context_cmd_v1 - configure FW to work with HE AP
564 * @sta_id: STA id
565 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
566 * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
567 * @reserved1: reserved byte for future use
568 * @reserved2: reserved byte for future use
569 * @flags: see %iwl_11ax_sta_ctxt_flags
570 * @ref_bssid_addr: reference BSSID used by the AP
571 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
572 * @htc_flags: which features are supported in HTC
573 * @frag_flags: frag support in A-MSDU
574 * @frag_level: frag support level
575 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
576 * @frag_min_size: min frag size (except last frag)
577 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
578 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
579 * @htc_trig_based_pkt_ext: default PE in 4us units
580 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
581 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
582 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
583 * @reserved3: reserved byte for future use
584 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
585 */
586struct iwl_he_sta_context_cmd_v1 {
587 u8 sta_id;
588 u8 tid_limit;
589 u8 reserved1;
590 u8 reserved2;
591 __le32 flags;
592
593 /* The below fields are set via Multiple BSSID IE */
594 u8 ref_bssid_addr[6];
595 __le16 reserved0;
596
597 /* The below fields are set via HE-capabilities IE */
598 __le32 htc_flags;
599
600 u8 frag_flags;
601 u8 frag_level;
602 u8 frag_max_num;
603 u8 frag_min_size;
604
605 /* The below fields are set via PPE thresholds element */
606 struct iwl_he_pkt_ext_v1 pkt_ext;
607
608 /* The below fields are set via HE-Operation IE */
609 u8 bss_color;
610 u8 htc_trig_based_pkt_ext;
611 __le16 frame_time_rts_th;
612
613 /* Random access parameter set (i.e. RAPS) */
614 u8 rand_alloc_ecwmin;
615 u8 rand_alloc_ecwmax;
616 __le16 reserved3;
617
618 /* The below fields are set via MU EDCA parameter set element */
619 struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
620} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_1 */
621
622/**
623 * struct iwl_he_sta_context_cmd_v2 - configure FW to work with HE AP
624 * @sta_id: STA id
625 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
626 * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
627 * @reserved1: reserved byte for future use
628 * @reserved2: reserved byte for future use
629 * @flags: see %iwl_11ax_sta_ctxt_flags
630 * @ref_bssid_addr: reference BSSID used by the AP
631 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
632 * @htc_flags: which features are supported in HTC
633 * @frag_flags: frag support in A-MSDU
634 * @frag_level: frag support level
635 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
636 * @frag_min_size: min frag size (except last frag)
637 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
638 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
639 * @htc_trig_based_pkt_ext: default PE in 4us units
640 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
641 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
642 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
643 * @reserved3: reserved byte for future use
644 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
645 * @max_bssid_indicator: indicator of the max bssid supported on the associated
646 * bss
647 * @bssid_index: index of the associated VAP
648 * @ema_ap: AP supports enhanced Multi BSSID advertisement
649 * @profile_periodicity: number of Beacon periods that are needed to receive the
650 * complete VAPs info
651 * @bssid_count: actual number of VAPs in the MultiBSS Set
652 * @reserved4: alignment
653 */
654struct iwl_he_sta_context_cmd_v2 {
655 u8 sta_id;
656 u8 tid_limit;
657 u8 reserved1;
658 u8 reserved2;
659 __le32 flags;
660
661 /* The below fields are set via Multiple BSSID IE */
662 u8 ref_bssid_addr[6];
663 __le16 reserved0;
664
665 /* The below fields are set via HE-capabilities IE */
666 __le32 htc_flags;
667
668 u8 frag_flags;
669 u8 frag_level;
670 u8 frag_max_num;
671 u8 frag_min_size;
672
673 /* The below fields are set via PPE thresholds element */
674 struct iwl_he_pkt_ext_v1 pkt_ext;
675
676 /* The below fields are set via HE-Operation IE */
677 u8 bss_color;
678 u8 htc_trig_based_pkt_ext;
679 __le16 frame_time_rts_th;
680
681 /* Random access parameter set (i.e. RAPS) */
682 u8 rand_alloc_ecwmin;
683 u8 rand_alloc_ecwmax;
684 __le16 reserved3;
685
686 /* The below fields are set via MU EDCA parameter set element */
687 struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
688
689 u8 max_bssid_indicator;
690 u8 bssid_index;
691 u8 ema_ap;
692 u8 profile_periodicity;
693 u8 bssid_count;
694 u8 reserved4[3];
695} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */
696
697/**
698 * struct iwl_he_sta_context_cmd_v3 - configure FW to work with HE AP
699 * @sta_id: STA id
700 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
701 * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
702 * @reserved1: reserved byte for future use
703 * @reserved2: reserved byte for future use
704 * @flags: see %iwl_11ax_sta_ctxt_flags
705 * @ref_bssid_addr: reference BSSID used by the AP
706 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
707 * @htc_flags: which features are supported in HTC
708 * @frag_flags: frag support in A-MSDU
709 * @frag_level: frag support level
710 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
711 * @frag_min_size: min frag size (except last frag)
712 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
713 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
714 * @htc_trig_based_pkt_ext: default PE in 4us units
715 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
716 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
717 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
718 * @puncture_mask: puncture mask for EHT
719 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
720 * @max_bssid_indicator: indicator of the max bssid supported on the associated
721 * bss
722 * @bssid_index: index of the associated VAP
723 * @ema_ap: AP supports enhanced Multi BSSID advertisement
724 * @profile_periodicity: number of Beacon periods that are needed to receive the
725 * complete VAPs info
726 * @bssid_count: actual number of VAPs in the MultiBSS Set
727 * @reserved4: alignment
728 */
729struct iwl_he_sta_context_cmd_v3 {
730 u8 sta_id;
731 u8 tid_limit;
732 u8 reserved1;
733 u8 reserved2;
734 __le32 flags;
735
736 /* The below fields are set via Multiple BSSID IE */
737 u8 ref_bssid_addr[6];
738 __le16 reserved0;
739
740 /* The below fields are set via HE-capabilities IE */
741 __le32 htc_flags;
742
743 u8 frag_flags;
744 u8 frag_level;
745 u8 frag_max_num;
746 u8 frag_min_size;
747
748 /* The below fields are set via PPE thresholds element */
749 struct iwl_he_pkt_ext_v2 pkt_ext;
750
751 /* The below fields are set via HE-Operation IE */
752 u8 bss_color;
753 u8 htc_trig_based_pkt_ext;
754 __le16 frame_time_rts_th;
755
756 /* Random access parameter set (i.e. RAPS) */
757 u8 rand_alloc_ecwmin;
758 u8 rand_alloc_ecwmax;
759 __le16 puncture_mask;
760
761 /* The below fields are set via MU EDCA parameter set element */
762 struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
763
764 u8 max_bssid_indicator;
765 u8 bssid_index;
766 u8 ema_ap;
767 u8 profile_periodicity;
768 u8 bssid_count;
769 u8 reserved4[3];
770} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */
771
772/**
773 * struct iwl_he_monitor_cmd - configure air sniffer for HE
774 * @bssid: the BSSID to sniff for
775 * @reserved1: reserved for dword alignment
776 * @aid: the AID to track on for HE MU
777 * @reserved2: reserved for future use
778 */
779struct iwl_he_monitor_cmd {
780 u8 bssid[6];
781 __le16 reserved1;
782 __le16 aid;
783 u8 reserved2[6];
784} __packed; /* HE_AIR_SNIFFER_CONFIG_CMD_API_S_VER_1 */
785
786#endif /* __iwl_fw_api_mac_h__ */
1/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2017 Intel Deutschland GmbH
10 * Copyright(c) 2018 - 2019 Intel Corporation
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * The full GNU General Public License is included in this distribution
22 * in the file called COPYING.
23 *
24 * Contact Information:
25 * Intel Linux Wireless <linuxwifi@intel.com>
26 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
27 *
28 * BSD LICENSE
29 *
30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
31 * Copyright(c) 2017 Intel Deutschland GmbH
32 * Copyright(c) 2018 - 2019 Intel Corporation
33 * All rights reserved.
34 *
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
37 * are met:
38 *
39 * * Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * * Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in
43 * the documentation and/or other materials provided with the
44 * distribution.
45 * * Neither the name Intel Corporation nor the names of its
46 * contributors may be used to endorse or promote products derived
47 * from this software without specific prior written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
50 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
51 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
52 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
53 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
54 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
55 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
59 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 *****************************************************************************/
61
62#ifndef __iwl_fw_api_mac_h__
63#define __iwl_fw_api_mac_h__
64
65/*
66 * The first MAC indices (starting from 0) are available to the driver,
67 * AUX indices follows - 1 for non-CDB, 2 for CDB.
68 */
69#define MAC_INDEX_AUX 4
70#define MAC_INDEX_MIN_DRIVER 0
71#define NUM_MAC_INDEX_DRIVER MAC_INDEX_AUX
72#define NUM_MAC_INDEX (NUM_MAC_INDEX_DRIVER + 1)
73#define NUM_MAC_INDEX_CDB (NUM_MAC_INDEX_DRIVER + 2)
74
75#define IWL_MVM_STATION_COUNT 16
76#define IWL_MVM_INVALID_STA 0xFF
77
78enum iwl_ac {
79 AC_BK,
80 AC_BE,
81 AC_VI,
82 AC_VO,
83 AC_NUM,
84};
85
86/**
87 * enum iwl_mac_protection_flags - MAC context flags
88 * @MAC_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
89 * this will require CCK RTS/CTS2self.
90 * RTS/CTS will protect full burst time.
91 * @MAC_PROT_FLG_HT_PROT: enable HT protection
92 * @MAC_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
93 * @MAC_PROT_FLG_SELF_CTS_EN: allow CTS2self
94 */
95enum iwl_mac_protection_flags {
96 MAC_PROT_FLG_TGG_PROTECT = BIT(3),
97 MAC_PROT_FLG_HT_PROT = BIT(23),
98 MAC_PROT_FLG_FAT_PROT = BIT(24),
99 MAC_PROT_FLG_SELF_CTS_EN = BIT(30),
100};
101
102#define MAC_FLG_SHORT_SLOT BIT(4)
103#define MAC_FLG_SHORT_PREAMBLE BIT(5)
104
105/**
106 * enum iwl_mac_types - Supported MAC types
107 * @FW_MAC_TYPE_FIRST: lowest supported MAC type
108 * @FW_MAC_TYPE_AUX: Auxiliary MAC (internal)
109 * @FW_MAC_TYPE_LISTENER: monitor MAC type (?)
110 * @FW_MAC_TYPE_PIBSS: Pseudo-IBSS
111 * @FW_MAC_TYPE_IBSS: IBSS
112 * @FW_MAC_TYPE_BSS_STA: BSS (managed) station
113 * @FW_MAC_TYPE_P2P_DEVICE: P2P Device
114 * @FW_MAC_TYPE_P2P_STA: P2P client
115 * @FW_MAC_TYPE_GO: P2P GO
116 * @FW_MAC_TYPE_TEST: ?
117 * @FW_MAC_TYPE_MAX: highest support MAC type
118 */
119enum iwl_mac_types {
120 FW_MAC_TYPE_FIRST = 1,
121 FW_MAC_TYPE_AUX = FW_MAC_TYPE_FIRST,
122 FW_MAC_TYPE_LISTENER,
123 FW_MAC_TYPE_PIBSS,
124 FW_MAC_TYPE_IBSS,
125 FW_MAC_TYPE_BSS_STA,
126 FW_MAC_TYPE_P2P_DEVICE,
127 FW_MAC_TYPE_P2P_STA,
128 FW_MAC_TYPE_GO,
129 FW_MAC_TYPE_TEST,
130 FW_MAC_TYPE_MAX = FW_MAC_TYPE_TEST
131}; /* MAC_CONTEXT_TYPE_API_E_VER_1 */
132
133/**
134 * enum iwl_tsf_id - TSF hw timer ID
135 * @TSF_ID_A: use TSF A
136 * @TSF_ID_B: use TSF B
137 * @TSF_ID_C: use TSF C
138 * @TSF_ID_D: use TSF D
139 * @NUM_TSF_IDS: number of TSF timers available
140 */
141enum iwl_tsf_id {
142 TSF_ID_A = 0,
143 TSF_ID_B = 1,
144 TSF_ID_C = 2,
145 TSF_ID_D = 3,
146 NUM_TSF_IDS = 4,
147}; /* TSF_ID_API_E_VER_1 */
148
149/**
150 * struct iwl_mac_data_ap - configuration data for AP MAC context
151 * @beacon_time: beacon transmit time in system time
152 * @beacon_tsf: beacon transmit time in TSF
153 * @bi: beacon interval in TU
154 * @reserved1: reserved
155 * @dtim_interval: dtim transmit time in TU
156 * @reserved2: reserved
157 * @mcast_qid: queue ID for multicast traffic.
158 * NOTE: obsolete from VER2 and on
159 * @beacon_template: beacon template ID
160 */
161struct iwl_mac_data_ap {
162 __le32 beacon_time;
163 __le64 beacon_tsf;
164 __le32 bi;
165 __le32 reserved1;
166 __le32 dtim_interval;
167 __le32 reserved2;
168 __le32 mcast_qid;
169 __le32 beacon_template;
170} __packed; /* AP_MAC_DATA_API_S_VER_2 */
171
172/**
173 * struct iwl_mac_data_ibss - configuration data for IBSS MAC context
174 * @beacon_time: beacon transmit time in system time
175 * @beacon_tsf: beacon transmit time in TSF
176 * @bi: beacon interval in TU
177 * @reserved: reserved
178 * @beacon_template: beacon template ID
179 */
180struct iwl_mac_data_ibss {
181 __le32 beacon_time;
182 __le64 beacon_tsf;
183 __le32 bi;
184 __le32 reserved;
185 __le32 beacon_template;
186} __packed; /* IBSS_MAC_DATA_API_S_VER_1 */
187
188/**
189 * enum iwl_mac_data_policy - policy of the data path for this MAC
190 * @TWT_SUPPORTED: twt is supported
191 */
192enum iwl_mac_data_policy {
193 TWT_SUPPORTED = BIT(0),
194};
195
196/**
197 * struct iwl_mac_data_sta - configuration data for station MAC context
198 * @is_assoc: 1 for associated state, 0 otherwise
199 * @dtim_time: DTIM arrival time in system time
200 * @dtim_tsf: DTIM arrival time in TSF
201 * @bi: beacon interval in TU, applicable only when associated
202 * @reserved1: reserved
203 * @dtim_interval: DTIM interval in TU, applicable only when associated
204 * @data_policy: see &enum iwl_mac_data_policy
205 * @listen_interval: in beacon intervals, applicable only when associated
206 * @assoc_id: unique ID assigned by the AP during association
207 * @assoc_beacon_arrive_time: TSF of first beacon after association
208 */
209struct iwl_mac_data_sta {
210 __le32 is_assoc;
211 __le32 dtim_time;
212 __le64 dtim_tsf;
213 __le32 bi;
214 __le32 reserved1;
215 __le32 dtim_interval;
216 __le32 data_policy;
217 __le32 listen_interval;
218 __le32 assoc_id;
219 __le32 assoc_beacon_arrive_time;
220} __packed; /* STA_MAC_DATA_API_S_VER_2 */
221
222/**
223 * struct iwl_mac_data_go - configuration data for P2P GO MAC context
224 * @ap: iwl_mac_data_ap struct with most config data
225 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
226 * 0 indicates that there is no CT window.
227 * @opp_ps_enabled: indicate that opportunistic PS allowed
228 */
229struct iwl_mac_data_go {
230 struct iwl_mac_data_ap ap;
231 __le32 ctwin;
232 __le32 opp_ps_enabled;
233} __packed; /* GO_MAC_DATA_API_S_VER_1 */
234
235/**
236 * struct iwl_mac_data_p2p_sta - configuration data for P2P client MAC context
237 * @sta: iwl_mac_data_sta struct with most config data
238 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
239 * 0 indicates that there is no CT window.
240 */
241struct iwl_mac_data_p2p_sta {
242 struct iwl_mac_data_sta sta;
243 __le32 ctwin;
244} __packed; /* P2P_STA_MAC_DATA_API_S_VER_2 */
245
246/**
247 * struct iwl_mac_data_pibss - Pseudo IBSS config data
248 * @stats_interval: interval in TU between statistics notifications to host.
249 */
250struct iwl_mac_data_pibss {
251 __le32 stats_interval;
252} __packed; /* PIBSS_MAC_DATA_API_S_VER_1 */
253
254/*
255 * struct iwl_mac_data_p2p_dev - configuration data for the P2P Device MAC
256 * context.
257 * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
258 * other channels as well. This should be to true only in case that the
259 * device is discoverable and there is an active GO. Note that setting this
260 * field when not needed, will increase the number of interrupts and have
261 * effect on the platform power, as this setting opens the Rx filters on
262 * all macs.
263 */
264struct iwl_mac_data_p2p_dev {
265 __le32 is_disc_extended;
266} __packed; /* _P2P_DEV_MAC_DATA_API_S_VER_1 */
267
268/**
269 * enum iwl_mac_filter_flags - MAC context filter flags
270 * @MAC_FILTER_IN_PROMISC: accept all data frames
271 * @MAC_FILTER_IN_CONTROL_AND_MGMT: pass all management and
272 * control frames to the host
273 * @MAC_FILTER_ACCEPT_GRP: accept multicast frames
274 * @MAC_FILTER_DIS_DECRYPT: don't decrypt unicast frames
275 * @MAC_FILTER_DIS_GRP_DECRYPT: don't decrypt multicast frames
276 * @MAC_FILTER_IN_BEACON: transfer foreign BSS's beacons to host
277 * (in station mode when associated)
278 * @MAC_FILTER_OUT_BCAST: filter out all broadcast frames
279 * @MAC_FILTER_IN_CRC32: extract FCS and append it to frames
280 * @MAC_FILTER_IN_PROBE_REQUEST: pass probe requests to host
281 */
282enum iwl_mac_filter_flags {
283 MAC_FILTER_IN_PROMISC = BIT(0),
284 MAC_FILTER_IN_CONTROL_AND_MGMT = BIT(1),
285 MAC_FILTER_ACCEPT_GRP = BIT(2),
286 MAC_FILTER_DIS_DECRYPT = BIT(3),
287 MAC_FILTER_DIS_GRP_DECRYPT = BIT(4),
288 MAC_FILTER_IN_BEACON = BIT(6),
289 MAC_FILTER_OUT_BCAST = BIT(8),
290 MAC_FILTER_IN_CRC32 = BIT(11),
291 MAC_FILTER_IN_PROBE_REQUEST = BIT(12),
292 /**
293 * @MAC_FILTER_IN_11AX: mark BSS as supporting 802.11ax
294 */
295 MAC_FILTER_IN_11AX = BIT(14),
296};
297
298/**
299 * enum iwl_mac_qos_flags - QoS flags
300 * @MAC_QOS_FLG_UPDATE_EDCA: ?
301 * @MAC_QOS_FLG_TGN: HT is enabled
302 * @MAC_QOS_FLG_TXOP_TYPE: ?
303 *
304 */
305enum iwl_mac_qos_flags {
306 MAC_QOS_FLG_UPDATE_EDCA = BIT(0),
307 MAC_QOS_FLG_TGN = BIT(1),
308 MAC_QOS_FLG_TXOP_TYPE = BIT(4),
309};
310
311/**
312 * struct iwl_ac_qos - QOS timing params for MAC_CONTEXT_CMD
313 * @cw_min: Contention window, start value in numbers of slots.
314 * Should be a power-of-2, minus 1. Device's default is 0x0f.
315 * @cw_max: Contention window, max value in numbers of slots.
316 * Should be a power-of-2, minus 1. Device's default is 0x3f.
317 * @aifsn: Number of slots in Arbitration Interframe Space (before
318 * performing random backoff timing prior to Tx). Device default 1.
319 * @fifos_mask: FIFOs used by this MAC for this AC
320 * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0.
321 *
322 * One instance of this config struct for each of 4 EDCA access categories
323 * in struct iwl_qosparam_cmd.
324 *
325 * Device will automatically increase contention window by (2*CW) + 1 for each
326 * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW
327 * value, to cap the CW value.
328 */
329struct iwl_ac_qos {
330 __le16 cw_min;
331 __le16 cw_max;
332 u8 aifsn;
333 u8 fifos_mask;
334 __le16 edca_txop;
335} __packed; /* AC_QOS_API_S_VER_2 */
336
337/**
338 * struct iwl_mac_ctx_cmd - command structure to configure MAC contexts
339 * ( MAC_CONTEXT_CMD = 0x28 )
340 * @id_and_color: ID and color of the MAC
341 * @action: action to perform, one of FW_CTXT_ACTION_*
342 * @mac_type: one of &enum iwl_mac_types
343 * @tsf_id: TSF HW timer, one of &enum iwl_tsf_id
344 * @node_addr: MAC address
345 * @reserved_for_node_addr: reserved
346 * @bssid_addr: BSSID
347 * @reserved_for_bssid_addr: reserved
348 * @cck_rates: basic rates available for CCK
349 * @ofdm_rates: basic rates available for OFDM
350 * @protection_flags: combination of &enum iwl_mac_protection_flags
351 * @cck_short_preamble: 0x20 for enabling short preamble, 0 otherwise
352 * @short_slot: 0x10 for enabling short slots, 0 otherwise
353 * @filter_flags: combination of &enum iwl_mac_filter_flags
354 * @qos_flags: from &enum iwl_mac_qos_flags
355 * @ac: one iwl_mac_qos configuration for each AC
356 */
357struct iwl_mac_ctx_cmd {
358 /* COMMON_INDEX_HDR_API_S_VER_1 */
359 __le32 id_and_color;
360 __le32 action;
361 /* MAC_CONTEXT_COMMON_DATA_API_S_VER_1 */
362 __le32 mac_type;
363 __le32 tsf_id;
364 u8 node_addr[6];
365 __le16 reserved_for_node_addr;
366 u8 bssid_addr[6];
367 __le16 reserved_for_bssid_addr;
368 __le32 cck_rates;
369 __le32 ofdm_rates;
370 __le32 protection_flags;
371 __le32 cck_short_preamble;
372 __le32 short_slot;
373 __le32 filter_flags;
374 /* MAC_QOS_PARAM_API_S_VER_1 */
375 __le32 qos_flags;
376 struct iwl_ac_qos ac[AC_NUM+1];
377 /* MAC_CONTEXT_COMMON_DATA_API_S */
378 union {
379 struct iwl_mac_data_ap ap;
380 struct iwl_mac_data_go go;
381 struct iwl_mac_data_sta sta;
382 struct iwl_mac_data_p2p_sta p2p_sta;
383 struct iwl_mac_data_p2p_dev p2p_dev;
384 struct iwl_mac_data_pibss pibss;
385 struct iwl_mac_data_ibss ibss;
386 };
387} __packed; /* MAC_CONTEXT_CMD_API_S_VER_1 */
388
389#define IWL_NONQOS_SEQ_GET 0x1
390#define IWL_NONQOS_SEQ_SET 0x2
391struct iwl_nonqos_seq_query_cmd {
392 __le32 get_set_flag;
393 __le32 mac_id_n_color;
394 __le16 value;
395 __le16 reserved;
396} __packed; /* NON_QOS_TX_COUNTER_GET_SET_API_S_VER_1 */
397
398/**
399 * struct iwl_missed_beacons_notif - information on missed beacons
400 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )
401 * @mac_id: interface ID
402 * @consec_missed_beacons_since_last_rx: number of consecutive missed
403 * beacons since last RX.
404 * @consec_missed_beacons: number of consecutive missed beacons
405 * @num_expected_beacons: number of expected beacons
406 * @num_recvd_beacons: number of received beacons
407 */
408struct iwl_missed_beacons_notif {
409 __le32 mac_id;
410 __le32 consec_missed_beacons_since_last_rx;
411 __le32 consec_missed_beacons;
412 __le32 num_expected_beacons;
413 __le32 num_recvd_beacons;
414} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */
415
416/**
417 * struct iwl_he_backoff_conf - used for backoff configuration
418 * Per each trigger-based AC, (set by MU EDCA Parameter set info-element)
419 * used for backoff configuration of TXF5..TXF8 trigger based.
420 * The MU-TIMER is reloaded w/ MU_TIME each time a frame from the AC is sent via
421 * trigger-based TX.
422 * @cwmin: CW min
423 * @cwmax: CW max
424 * @aifsn: AIFSN
425 * AIFSN=0, means that no backoff from the specified TRIG-BASED AC is
426 * allowed till the MU-TIMER is 0
427 * @mu_time: MU time in 8TU units
428 */
429struct iwl_he_backoff_conf {
430 __le16 cwmin;
431 __le16 cwmax;
432 __le16 aifsn;
433 __le16 mu_time;
434} __packed; /* AC_QOS_DOT11AX_API_S */
435
436/**
437 * enum iwl_he_pkt_ext_constellations - PPE constellation indices
438 * @IWL_HE_PKT_EXT_BPSK: BPSK
439 * @IWL_HE_PKT_EXT_QPSK: QPSK
440 * @IWL_HE_PKT_EXT_16QAM: 16-QAM
441 * @IWL_HE_PKT_EXT_64QAM: 64-QAM
442 * @IWL_HE_PKT_EXT_256QAM: 256-QAM
443 * @IWL_HE_PKT_EXT_1024QAM: 1024-QAM
444 * @IWL_HE_PKT_EXT_RESERVED: reserved value
445 * @IWL_HE_PKT_EXT_NONE: not defined
446 */
447enum iwl_he_pkt_ext_constellations {
448 IWL_HE_PKT_EXT_BPSK = 0,
449 IWL_HE_PKT_EXT_QPSK,
450 IWL_HE_PKT_EXT_16QAM,
451 IWL_HE_PKT_EXT_64QAM,
452 IWL_HE_PKT_EXT_256QAM,
453 IWL_HE_PKT_EXT_1024QAM,
454 IWL_HE_PKT_EXT_RESERVED,
455 IWL_HE_PKT_EXT_NONE,
456};
457
458#define MAX_HE_SUPP_NSS 2
459#define MAX_HE_CHANNEL_BW_INDX 4
460
461/**
462 * struct iwl_he_pkt_ext - QAM thresholds
463 * The required PPE is set via HE Capabilities IE, per Nss x BW x MCS
464 * The IE is organized in the following way:
465 * Support for Nss x BW (or RU) matrix:
466 * (0=SISO, 1=MIMO2) x (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz)
467 * Each entry contains 2 QAM thresholds for 8us and 16us:
468 * 0=BPSK, 1=QPSK, 2=16QAM, 3=64QAM, 4=256QAM, 5=1024QAM, 6=RES, 7=NONE
469 * i.e. QAM_th1 < QAM_th2 such if TX uses QAM_tx:
470 * QAM_tx < QAM_th1 --> PPE=0us
471 * QAM_th1 <= QAM_tx < QAM_th2 --> PPE=8us
472 * QAM_th2 <= QAM_tx --> PPE=16us
473 * @pkt_ext_qam_th: QAM thresholds
474 * For each Nss/Bw define 2 QAM thrsholds (0..5)
475 * For rates below the low_th, no need for PPE
476 * For rates between low_th and high_th, need 8us PPE
477 * For rates equal or higher then the high_th, need 16us PPE
478 * Nss (0-siso, 1-mimo2) x BW (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz) x
479 * (0-low_th, 1-high_th)
480 */
481struct iwl_he_pkt_ext {
482 u8 pkt_ext_qam_th[MAX_HE_SUPP_NSS][MAX_HE_CHANNEL_BW_INDX][2];
483} __packed; /* PKT_EXT_DOT11AX_API_S */
484
485/**
486 * enum iwl_he_sta_ctxt_flags - HE STA context flags
487 * @STA_CTXT_HE_REF_BSSID_VALID: ref bssid addr valid (for receiving specific
488 * control frames such as TRIG, NDPA, BACK)
489 * @STA_CTXT_HE_BSS_COLOR_DIS: BSS color disable, don't use the BSS
490 * color for RX filter but use MAC header
491 * @STA_CTXT_HE_PARTIAL_BSS_COLOR: partial BSS color allocation
492 * @STA_CTXT_HE_32BIT_BA_BITMAP: indicates the receiver supports BA bitmap
493 * of 32-bits
494 * @STA_CTXT_HE_PACKET_EXT: indicates that the packet-extension info is valid
495 * and should be used
496 * @STA_CTXT_HE_TRIG_RND_ALLOC: indicates that trigger based random allocation
497 * is enabled according to UORA element existence
498 * @STA_CTXT_HE_CONST_TRIG_RND_ALLOC: used for AV testing
499 * @STA_CTXT_HE_ACK_ENABLED: indicates that the AP supports receiving ACK-
500 * enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
501 * @STA_CTXT_HE_MU_EDCA_CW: indicates that there is an element of MU EDCA
502 * parameter set, i.e. the backoff counters for trig-based ACs
503 * @STA_CTXT_HE_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
504 * not allowed (as there are OBSS that might classify such transmissions as
505 * radar pulses).
506 */
507enum iwl_he_sta_ctxt_flags {
508 STA_CTXT_HE_REF_BSSID_VALID = BIT(4),
509 STA_CTXT_HE_BSS_COLOR_DIS = BIT(5),
510 STA_CTXT_HE_PARTIAL_BSS_COLOR = BIT(6),
511 STA_CTXT_HE_32BIT_BA_BITMAP = BIT(7),
512 STA_CTXT_HE_PACKET_EXT = BIT(8),
513 STA_CTXT_HE_TRIG_RND_ALLOC = BIT(9),
514 STA_CTXT_HE_CONST_TRIG_RND_ALLOC = BIT(10),
515 STA_CTXT_HE_ACK_ENABLED = BIT(11),
516 STA_CTXT_HE_MU_EDCA_CW = BIT(12),
517 STA_CTXT_HE_RU_2MHZ_BLOCK = BIT(14),
518};
519
520/**
521 * enum iwl_he_htc_flags - HE HTC support flags
522 * @IWL_HE_HTC_SUPPORT: HE-HTC support
523 * @IWL_HE_HTC_UL_MU_RESP_SCHED: HE UL MU response schedule
524 * support via A-control field
525 * @IWL_HE_HTC_BSR_SUPP: BSR support in A-control field
526 * @IWL_HE_HTC_OMI_SUPP: A-OMI support in A-control field
527 * @IWL_HE_HTC_BQR_SUPP: A-BQR support in A-control field
528 */
529enum iwl_he_htc_flags {
530 IWL_HE_HTC_SUPPORT = BIT(0),
531 IWL_HE_HTC_UL_MU_RESP_SCHED = BIT(3),
532 IWL_HE_HTC_BSR_SUPP = BIT(4),
533 IWL_HE_HTC_OMI_SUPP = BIT(5),
534 IWL_HE_HTC_BQR_SUPP = BIT(6),
535};
536
537/*
538 * @IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK: the STA does not provide HE MFB
539 * @IWL_HE_HTC_LINK_ADAP_UNSOLICITED: the STA provides only unsolicited HE MFB
540 * @IWL_HE_HTC_LINK_ADAP_BOTH: the STA is capable of providing HE MFB in
541 * response to HE MRQ and if the STA provides unsolicited HE MFB
542 */
543#define IWL_HE_HTC_LINK_ADAP_POS (1)
544#define IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK (0)
545#define IWL_HE_HTC_LINK_ADAP_UNSOLICITED (2 << IWL_HE_HTC_LINK_ADAP_POS)
546#define IWL_HE_HTC_LINK_ADAP_BOTH (3 << IWL_HE_HTC_LINK_ADAP_POS)
547
548/**
549 * struct iwl_he_sta_context_cmd_v1 - configure FW to work with HE AP
550 * @sta_id: STA id
551 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
552 * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
553 * @reserved1: reserved byte for future use
554 * @reserved2: reserved byte for future use
555 * @flags: see %iwl_11ax_sta_ctxt_flags
556 * @ref_bssid_addr: reference BSSID used by the AP
557 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
558 * @htc_flags: which features are supported in HTC
559 * @frag_flags: frag support in A-MSDU
560 * @frag_level: frag support level
561 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
562 * @frag_min_size: min frag size (except last frag)
563 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
564 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
565 * @htc_trig_based_pkt_ext: default PE in 4us units
566 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
567 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
568 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
569 * @reserved3: reserved byte for future use
570 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
571 */
572struct iwl_he_sta_context_cmd_v1 {
573 u8 sta_id;
574 u8 tid_limit;
575 u8 reserved1;
576 u8 reserved2;
577 __le32 flags;
578
579 /* The below fields are set via Multiple BSSID IE */
580 u8 ref_bssid_addr[6];
581 __le16 reserved0;
582
583 /* The below fields are set via HE-capabilities IE */
584 __le32 htc_flags;
585
586 u8 frag_flags;
587 u8 frag_level;
588 u8 frag_max_num;
589 u8 frag_min_size;
590
591 /* The below fields are set via PPE thresholds element */
592 struct iwl_he_pkt_ext pkt_ext;
593
594 /* The below fields are set via HE-Operation IE */
595 u8 bss_color;
596 u8 htc_trig_based_pkt_ext;
597 __le16 frame_time_rts_th;
598
599 /* Random access parameter set (i.e. RAPS) */
600 u8 rand_alloc_ecwmin;
601 u8 rand_alloc_ecwmax;
602 __le16 reserved3;
603
604 /* The below fields are set via MU EDCA parameter set element */
605 struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
606} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_1 */
607
608/**
609 * struct iwl_he_sta_context_cmd - configure FW to work with HE AP
610 * @sta_id: STA id
611 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg
612 * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit
613 * @reserved1: reserved byte for future use
614 * @reserved2: reserved byte for future use
615 * @flags: see %iwl_11ax_sta_ctxt_flags
616 * @ref_bssid_addr: reference BSSID used by the AP
617 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes
618 * @htc_flags: which features are supported in HTC
619 * @frag_flags: frag support in A-MSDU
620 * @frag_level: frag support level
621 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)
622 * @frag_min_size: min frag size (except last frag)
623 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa
624 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
625 * @htc_trig_based_pkt_ext: default PE in 4us units
626 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
627 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
628 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
629 * @reserved3: reserved byte for future use
630 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
631 * @max_bssid_indicator: indicator of the max bssid supported on the associated
632 * bss
633 * @bssid_index: index of the associated VAP
634 * @ema_ap: AP supports enhanced Multi BSSID advertisement
635 * @profile_periodicity: number of Beacon periods that are needed to receive the
636 * complete VAPs info
637 * @bssid_count: actual number of VAPs in the MultiBSS Set
638 * @reserved4: alignment
639 */
640struct iwl_he_sta_context_cmd {
641 u8 sta_id;
642 u8 tid_limit;
643 u8 reserved1;
644 u8 reserved2;
645 __le32 flags;
646
647 /* The below fields are set via Multiple BSSID IE */
648 u8 ref_bssid_addr[6];
649 __le16 reserved0;
650
651 /* The below fields are set via HE-capabilities IE */
652 __le32 htc_flags;
653
654 u8 frag_flags;
655 u8 frag_level;
656 u8 frag_max_num;
657 u8 frag_min_size;
658
659 /* The below fields are set via PPE thresholds element */
660 struct iwl_he_pkt_ext pkt_ext;
661
662 /* The below fields are set via HE-Operation IE */
663 u8 bss_color;
664 u8 htc_trig_based_pkt_ext;
665 __le16 frame_time_rts_th;
666
667 /* Random access parameter set (i.e. RAPS) */
668 u8 rand_alloc_ecwmin;
669 u8 rand_alloc_ecwmax;
670 __le16 reserved3;
671
672 /* The below fields are set via MU EDCA parameter set element */
673 struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
674
675 u8 max_bssid_indicator;
676 u8 bssid_index;
677 u8 ema_ap;
678 u8 profile_periodicity;
679 u8 bssid_count;
680 u8 reserved4[3];
681} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */
682
683/**
684 * struct iwl_he_monitor_cmd - configure air sniffer for HE
685 * @bssid: the BSSID to sniff for
686 * @reserved1: reserved for dword alignment
687 * @aid: the AID to track on for HE MU
688 * @reserved2: reserved for future use
689 */
690struct iwl_he_monitor_cmd {
691 u8 bssid[6];
692 __le16 reserved1;
693 __le16 aid;
694 u8 reserved2[6];
695} __packed; /* HE_AIR_SNIFFER_CONFIG_CMD_API_S_VER_1 */
696
697#endif /* __iwl_fw_api_mac_h__ */