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