brintos

brintos / linux-shallow public Read only

0
0
Text · 26.9 KiB · 977ca4a Raw
794 lines · c
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */2/*3 * Copyright (C) 2012-2014, 2018-2022, 2024 Intel Corporation4 * Copyright (C) 2017 Intel Deutschland GmbH5 */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		414#define MAC_INDEX_MIN_DRIVER	015#define NUM_MAC_INDEX_DRIVER	MAC_INDEX_AUX16#define NUM_MAC_INDEX		(NUM_MAC_INDEX_DRIVER + 1)17#define NUM_MAC_INDEX_CDB	(NUM_MAC_INDEX_DRIVER + 2)18 19#define IWL_STATION_COUNT_MAX	1620#define IWL_MVM_INVALID_STA		0xFF21 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 flags32 * @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 protection36 * @MAC_PROT_FLG_FAT_PROT: protect 40 MHz transmissions37 * @MAC_PROT_FLG_SELF_CTS_EN: allow CTS2self38 */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 types51 * @FW_MAC_TYPE_FIRST: lowest supported MAC type52 * @FW_MAC_TYPE_AUX: Auxiliary MAC (internal)53 * @FW_MAC_TYPE_LISTENER: monitor MAC type (?)54 * @FW_MAC_TYPE_PIBSS: Pseudo-IBSS55 * @FW_MAC_TYPE_IBSS: IBSS56 * @FW_MAC_TYPE_BSS_STA: BSS (managed) station57 * @FW_MAC_TYPE_P2P_DEVICE: P2P Device58 * @FW_MAC_TYPE_P2P_STA: P2P client59 * @FW_MAC_TYPE_GO: P2P GO60 * @FW_MAC_TYPE_TEST: ?61 * @FW_MAC_TYPE_MAX: highest support MAC type62 */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_TEST75}; /* MAC_CONTEXT_TYPE_API_E_VER_1 */76 77/**78 * enum iwl_tsf_id - TSF hw timer ID79 * @TSF_ID_A: use TSF A80 * @TSF_ID_B: use TSF B81 * @TSF_ID_C: use TSF C82 * @TSF_ID_D: use TSF D83 * @NUM_TSF_IDS: number of TSF timers available84 */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 context95 * @beacon_time: beacon transmit time in system time96 * @beacon_tsf: beacon transmit time in TSF97 * @bi: beacon interval in TU98 * @reserved1: reserved99 * @dtim_interval: dtim transmit time in TU100 * @reserved2: reserved101 * @mcast_qid: queue ID for multicast traffic.102 *	NOTE: obsolete from VER2 and on103 * @beacon_template: beacon template ID104 */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 context118 * @beacon_time: beacon transmit time in system time119 * @beacon_tsf: beacon transmit time in TSF120 * @bi: beacon interval in TU121 * @reserved: reserved122 * @beacon_template: beacon template ID123 */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 MAC134 * @TWT_SUPPORTED: twt is supported135 * @MORE_DATA_ACK_SUPPORTED: AP supports More Data Ack according to136 *	paragraph 9.4.1.17 in P802.11ax_D4 specification. Used for TWT137 *	early termination detection.138 * @FLEXIBLE_TWT_SUPPORTED: AP supports flexible TWT schedule139 * @PROTECTED_TWT_SUPPORTED: AP supports protected TWT frames (with 11w)140 * @BROADCAST_TWT_SUPPORTED: AP and STA support broadcast TWT141 * @COEX_HIGH_PRIORITY_ENABLE: high priority mode for BT coex, to be used142 *	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 context155 * @is_assoc: 1 for associated state, 0 otherwise156 * @dtim_time: DTIM arrival time in system time157 * @dtim_tsf: DTIM arrival time in TSF158 * @bi: beacon interval in TU, applicable only when associated159 * @reserved1: reserved160 * @dtim_interval: DTIM interval in TU, applicable only when associated161 * @data_policy: see &enum iwl_mac_data_policy162 * @listen_interval: in beacon intervals, applicable only when associated163 * @assoc_id: unique ID assigned by the AP during association164 * @assoc_beacon_arrive_time: TSF of first beacon after association165 */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 context181 * @ap: iwl_mac_data_ap struct with most config data182 * @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 allowed185 */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 context194 * @sta: iwl_mac_data_sta struct with most config data195 * @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 data205 * @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 MAC213 * context.214 * @is_disc_extended: if set to true, P2P Device discoverability is enabled on215 *	other channels as well. This should be to true only in case that the216 *	device is discoverable and there is an active GO. Note that setting this217 *	field when not needed, will increase the number of interrupts and have218 *	effect on the platform power, as this setting opens the Rx filters on219 *	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 flags227 * @MAC_FILTER_IN_PROMISC: accept all data frames228 * @MAC_FILTER_IN_CONTROL_AND_MGMT: pass all management and229 *	control frames to the host230 * @MAC_FILTER_ACCEPT_GRP: accept multicast frames231 * @MAC_FILTER_DIS_DECRYPT: don't decrypt unicast frames232 * @MAC_FILTER_DIS_GRP_DECRYPT: don't decrypt multicast frames233 * @MAC_FILTER_IN_BEACON: transfer foreign BSS's beacons to host234 *	(in station mode when associated)235 * @MAC_FILTER_OUT_BCAST: filter out all broadcast frames236 * @MAC_FILTER_IN_CRC32: extract FCS and append it to frames237 * @MAC_FILTER_IN_PROBE_REQUEST: pass probe requests to host238 */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.11ax251	 */252	MAC_FILTER_IN_11AX		= BIT(14),253};254 255/**256 * enum iwl_mac_qos_flags - QoS flags257 * @MAC_QOS_FLG_UPDATE_EDCA: ?258 * @MAC_QOS_FLG_TGN: HT is enabled259 * @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_CMD270 * @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 (before275 *	performing random backoff timing prior to Tx).  Device default 1.276 * @fifos_mask: FIFOs used by this MAC for this AC277 * @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 categories280 * in struct iwl_qosparam_cmd.281 *282 * Device will automatically increase contention window by (2*CW) + 1 for each283 * transmission retry.  Device uses cw_max as a bit mask, ANDed with new CW284 * 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 contexts296 * ( MAC_CONTEXT_CMD = 0x28 )297 * @id_and_color: ID and color of the MAC298 * @action: action to perform, see &enum iwl_ctxt_action299 * @mac_type: one of &enum iwl_mac_types300 * @tsf_id: TSF HW timer, one of &enum iwl_tsf_id301 * @node_addr: MAC address302 * @reserved_for_node_addr: reserved303 * @bssid_addr: BSSID304 * @reserved_for_bssid_addr: reserved305 * @cck_rates: basic rates available for CCK306 * @ofdm_rates: basic rates available for OFDM307 * @protection_flags: combination of &enum iwl_mac_protection_flags308 * @cck_short_preamble: 0x20 for enabling short preamble, 0 otherwise309 * @short_slot: 0x10 for enabling short slots, 0 otherwise310 * @filter_flags: combination of &enum iwl_mac_filter_flags311 * @qos_flags: from &enum iwl_mac_qos_flags312 * @ac: one iwl_mac_qos configuration for each AC313 * @ap: AP specific config data, see &struct iwl_mac_data_ap314 * @go: GO specific config data, see &struct iwl_mac_data_go315 * @sta: BSS client specific config data, see &struct iwl_mac_data_sta316 * @p2p_sta: P2P client specific config data, see &struct iwl_mac_data_p2p_sta317 * @p2p_dev: P2P-device specific config data, see &struct iwl_mac_data_p2p_dev318 * @pibss: Pseudo-IBSS specific data, unused; see struct iwl_mac_data_pibss319 * @ibss: IBSS specific config data, see &struct iwl_mac_data_ibss320 */321struct iwl_mac_ctx_cmd {322	/* COMMON_INDEX_HDR_API_S_VER_1 */323	__le32 id_and_color;324	__le32 action;325	/* MAC_CONTEXT_COMMON_DATA_API_S_VER_1 */326	__le32 mac_type;327	__le32 tsf_id;328	u8 node_addr[6];329	__le16 reserved_for_node_addr;330	u8 bssid_addr[6];331	__le16 reserved_for_bssid_addr;332	__le32 cck_rates;333	__le32 ofdm_rates;334	__le32 protection_flags;335	__le32 cck_short_preamble;336	__le32 short_slot;337	__le32 filter_flags;338	/* MAC_QOS_PARAM_API_S_VER_1 */339	__le32 qos_flags;340	struct iwl_ac_qos ac[AC_NUM+1];341	/* MAC_CONTEXT_COMMON_DATA_API_S */342	union {343		struct iwl_mac_data_ap ap;344		struct iwl_mac_data_go go;345		struct iwl_mac_data_sta sta;346		struct iwl_mac_data_p2p_sta p2p_sta;347		struct iwl_mac_data_p2p_dev p2p_dev;348		struct iwl_mac_data_pibss pibss;349		struct iwl_mac_data_ibss ibss;350	};351} __packed; /* MAC_CONTEXT_CMD_API_S_VER_1 */352 353#define IWL_NONQOS_SEQ_GET	0x1354#define IWL_NONQOS_SEQ_SET	0x2355struct iwl_nonqos_seq_query_cmd {356	__le32 get_set_flag;357	__le32 mac_id_n_color;358	__le16 value;359	__le16 reserved;360} __packed; /* NON_QOS_TX_COUNTER_GET_SET_API_S_VER_1 */361 362/**363 * struct iwl_missed_beacons_notif_ver_3 - information on missed beacons364 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )365 * @mac_id: interface ID366 * @consec_missed_beacons_since_last_rx: number of consecutive missed367 *	beacons since last RX.368 * @consec_missed_beacons: number of consecutive missed beacons369 * @num_expected_beacons: number of expected beacons370 * @num_recvd_beacons: number of received beacons371 */372struct iwl_missed_beacons_notif_ver_3 {373	__le32 mac_id;374	__le32 consec_missed_beacons_since_last_rx;375	__le32 consec_missed_beacons;376	__le32 num_expected_beacons;377	__le32 num_recvd_beacons;378} __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */379 380/**381 * struct iwl_missed_beacons_notif_v4 - information on missed beacons382 * ( MISSED_BEACONS_NOTIFICATION = 0xa2 )383 * @link_id: fw link ID384 * @consec_missed_beacons_since_last_rx: number of consecutive missed385 *	beacons since last RX.386 * @consec_missed_beacons: number of consecutive missed beacons387 * @num_expected_beacons: number of expected beacons388 * @num_recvd_beacons: number of received beacons389 */390struct iwl_missed_beacons_notif_v4 {391	__le32 link_id;392	__le32 consec_missed_beacons_since_last_rx;393	__le32 consec_missed_beacons;394	__le32 num_expected_beacons;395	__le32 num_recvd_beacons;396} __packed; /* MISSED_BEACON_NTFY_API_S_VER_4 */397 398/**399 * struct iwl_he_backoff_conf - used for backoff configuration400 * Per each trigger-based AC, (set by MU EDCA Parameter set info-element)401 * used for backoff configuration of TXF5..TXF8 trigger based.402 * The MU-TIMER is reloaded w/ MU_TIME each time a frame from the AC is sent via403 * trigger-based TX.404 * @cwmin: CW min405 * @cwmax: CW max406 * @aifsn: AIFSN407 *	AIFSN=0, means that no backoff from the specified TRIG-BASED AC is408 *	allowed till the MU-TIMER is 0409 * @mu_time: MU time in 8TU units410 */411struct iwl_he_backoff_conf {412	__le16 cwmin;413	__le16 cwmax;414	__le16 aifsn;415	__le16 mu_time;416} __packed; /* AC_QOS_DOT11AX_API_S */417 418/**419 * enum iwl_he_pkt_ext_constellations - PPE constellation indices420 * @IWL_HE_PKT_EXT_BPSK: BPSK421 * @IWL_HE_PKT_EXT_QPSK:  QPSK422 * @IWL_HE_PKT_EXT_16QAM: 16-QAM423 * @IWL_HE_PKT_EXT_64QAM: 64-QAM424 * @IWL_HE_PKT_EXT_256QAM: 256-QAM425 * @IWL_HE_PKT_EXT_1024QAM: 1024-QAM426 * @IWL_HE_PKT_EXT_4096QAM: 4096-QAM, for EHT only427 * @IWL_HE_PKT_EXT_NONE: not defined428 */429enum iwl_he_pkt_ext_constellations {430	IWL_HE_PKT_EXT_BPSK = 0,431	IWL_HE_PKT_EXT_QPSK,432	IWL_HE_PKT_EXT_16QAM,433	IWL_HE_PKT_EXT_64QAM,434	IWL_HE_PKT_EXT_256QAM,435	IWL_HE_PKT_EXT_1024QAM,436	IWL_HE_PKT_EXT_4096QAM,437	IWL_HE_PKT_EXT_NONE,438};439 440#define MAX_HE_SUPP_NSS	2441#define MAX_CHANNEL_BW_INDX_API_D_VER_1	4442#define MAX_CHANNEL_BW_INDX_API_D_VER_2	5443 444/**445 * struct iwl_he_pkt_ext_v1 - QAM thresholds446 * The required PPE is set via HE Capabilities IE, per Nss x BW x MCS447 * The IE is organized in the following way:448 * Support for Nss x BW (or RU) matrix:449 *	(0=SISO, 1=MIMO2) x (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz)450 * Each entry contains 2 QAM thresholds for 8us and 16us:451 *	0=BPSK, 1=QPSK, 2=16QAM, 3=64QAM, 4=256QAM, 5=1024QAM, 6=RES, 7=NONE452 * i.e. QAM_th1 < QAM_th2 such if TX uses QAM_tx:453 *	QAM_tx < QAM_th1            --> PPE=0us454 *	QAM_th1 <= QAM_tx < QAM_th2 --> PPE=8us455 *	QAM_th2 <= QAM_tx           --> PPE=16us456 * @pkt_ext_qam_th: QAM thresholds457 *	For each Nss/Bw define 2 QAM thrsholds (0..5)458 *	For rates below the low_th, no need for PPE459 *	For rates between low_th and high_th, need 8us PPE460 *	For rates equal or higher then the high_th, need 16us PPE461 *	Nss (0-siso, 1-mimo2) x BW (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz) x462 *		(0-low_th, 1-high_th)463 */464struct iwl_he_pkt_ext_v1 {465	u8 pkt_ext_qam_th[MAX_HE_SUPP_NSS][MAX_CHANNEL_BW_INDX_API_D_VER_1][2];466} __packed; /* PKT_EXT_DOT11AX_API_S_VER_1 */467 468/**469 * struct iwl_he_pkt_ext_v2 - QAM thresholds470 * The required PPE is set via HE Capabilities IE, per Nss x BW x MCS471 * The IE is organized in the following way:472 * Support for Nss x BW (or RU) matrix:473 *	(0=SISO, 1=MIMO2) x (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz)474 * Each entry contains 2 QAM thresholds for 8us and 16us:475 *	0=BPSK, 1=QPSK, 2=16QAM, 3=64QAM, 4=256QAM, 5=1024QAM, 6=RES, 7=NONE476 * i.e. QAM_th1 < QAM_th2 such if TX uses QAM_tx:477 *	QAM_tx < QAM_th1            --> PPE=0us478 *	QAM_th1 <= QAM_tx < QAM_th2 --> PPE=8us479 *	QAM_th2 <= QAM_tx           --> PPE=16us480 * @pkt_ext_qam_th: QAM thresholds481 *	For each Nss/Bw define 2 QAM thrsholds (0..5)482 *	For rates below the low_th, no need for PPE483 *	For rates between low_th and high_th, need 8us PPE484 *	For rates equal or higher then the high_th, need 16us PPE485 *	Nss (0-siso, 1-mimo2) x486 *	BW (0-20MHz, 1-40MHz, 2-80MHz, 3-160MHz, 4-320MHz) x487 *	(0-low_th, 1-high_th)488 */489struct iwl_he_pkt_ext_v2 {490	u8 pkt_ext_qam_th[MAX_HE_SUPP_NSS][MAX_CHANNEL_BW_INDX_API_D_VER_2][2];491} __packed; /* PKT_EXT_DOT11AX_API_S_VER_2 */492 493/**494 * enum iwl_he_sta_ctxt_flags - HE STA context flags495 * @STA_CTXT_HE_REF_BSSID_VALID: ref bssid addr valid (for receiving specific496 *	control frames such as TRIG, NDPA, BACK)497 * @STA_CTXT_HE_BSS_COLOR_DIS: BSS color disable, don't use the BSS498 *	color for RX filter but use MAC header499 * @STA_CTXT_HE_PARTIAL_BSS_COLOR: partial BSS color allocation500 * @STA_CTXT_HE_32BIT_BA_BITMAP: indicates the receiver supports BA bitmap501 *	of 32-bits502 * @STA_CTXT_HE_PACKET_EXT: indicates that the packet-extension info is valid503 *	and should be used504 * @STA_CTXT_HE_TRIG_RND_ALLOC: indicates that trigger based random allocation505 *	is enabled according to UORA element existence506 * @STA_CTXT_HE_CONST_TRIG_RND_ALLOC: used for AV testing507 * @STA_CTXT_HE_ACK_ENABLED: indicates that the AP supports receiving ACK-508 *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG509 * @STA_CTXT_HE_MU_EDCA_CW: indicates that there is an element of MU EDCA510 *	parameter set, i.e. the backoff counters for trig-based ACs511 * @STA_CTXT_HE_NIC_NOT_ACK_ENABLED: mark that the NIC doesn't support receiving512 *	ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).513 *	If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0514 *	len delim to determine if AGG or single.515 * @STA_CTXT_HE_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are516 *      not allowed (as there are OBSS that might classify such transmissions as517 *      radar pulses).518 * @STA_CTXT_HE_NDP_FEEDBACK_ENABLED: mark support for NDP feedback and change519 *	of threshold520 * @STA_CTXT_EHT_PUNCTURE_MASK_VALID: indicates the puncture_mask field is valid521 * @STA_CTXT_EHT_LONG_PPE_ENABLED: indicates the PPE requirement should be522 *	extended to 20us for BW > 160Mhz or for MCS w/ 4096-QAM.523 */524enum iwl_he_sta_ctxt_flags {525	STA_CTXT_HE_REF_BSSID_VALID		= BIT(4),526	STA_CTXT_HE_BSS_COLOR_DIS		= BIT(5),527	STA_CTXT_HE_PARTIAL_BSS_COLOR		= BIT(6),528	STA_CTXT_HE_32BIT_BA_BITMAP		= BIT(7),529	STA_CTXT_HE_PACKET_EXT			= BIT(8),530	STA_CTXT_HE_TRIG_RND_ALLOC		= BIT(9),531	STA_CTXT_HE_CONST_TRIG_RND_ALLOC	= BIT(10),532	STA_CTXT_HE_ACK_ENABLED			= BIT(11),533	STA_CTXT_HE_MU_EDCA_CW			= BIT(12),534	STA_CTXT_HE_NIC_NOT_ACK_ENABLED		= BIT(13),535	STA_CTXT_HE_RU_2MHZ_BLOCK		= BIT(14),536	STA_CTXT_HE_NDP_FEEDBACK_ENABLED	= BIT(15),537	STA_CTXT_EHT_PUNCTURE_MASK_VALID	= BIT(16),538	STA_CTXT_EHT_LONG_PPE_ENABLED		= BIT(17),539};540 541/**542 * enum iwl_he_htc_flags - HE HTC support flags543 * @IWL_HE_HTC_SUPPORT: HE-HTC support544 * @IWL_HE_HTC_UL_MU_RESP_SCHED: HE UL MU response schedule545 *	support via A-control field546 * @IWL_HE_HTC_BSR_SUPP: BSR support in A-control field547 * @IWL_HE_HTC_OMI_SUPP: A-OMI support in A-control field548 * @IWL_HE_HTC_BQR_SUPP: A-BQR support in A-control field549 */550enum iwl_he_htc_flags {551	IWL_HE_HTC_SUPPORT			= BIT(0),552	IWL_HE_HTC_UL_MU_RESP_SCHED		= BIT(3),553	IWL_HE_HTC_BSR_SUPP			= BIT(4),554	IWL_HE_HTC_OMI_SUPP			= BIT(5),555	IWL_HE_HTC_BQR_SUPP			= BIT(6),556};557 558/*559 * @IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK: the STA does not provide HE MFB560 * @IWL_HE_HTC_LINK_ADAP_UNSOLICITED: the STA provides only unsolicited HE MFB561 * @IWL_HE_HTC_LINK_ADAP_BOTH: the STA is capable of providing HE MFB in562 *      response to HE MRQ and if the STA provides unsolicited HE MFB563 */564#define IWL_HE_HTC_LINK_ADAP_POS		(1)565#define IWL_HE_HTC_LINK_ADAP_NO_FEEDBACK	(0)566#define IWL_HE_HTC_LINK_ADAP_UNSOLICITED	(2 << IWL_HE_HTC_LINK_ADAP_POS)567#define IWL_HE_HTC_LINK_ADAP_BOTH		(3 << IWL_HE_HTC_LINK_ADAP_POS)568 569/**570 * struct iwl_he_sta_context_cmd_v1 - configure FW to work with HE AP571 * @sta_id: STA id572 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg573 *	0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit574 * @reserved1: reserved byte for future use575 * @reserved2: reserved byte for future use576 * @flags: see %iwl_11ax_sta_ctxt_flags577 * @ref_bssid_addr: reference BSSID used by the AP578 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes579 * @htc_flags: which features are supported in HTC580 * @frag_flags: frag support in A-MSDU581 * @frag_level: frag support level582 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)583 * @frag_min_size: min frag size (except last frag)584 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa585 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame586 * @htc_trig_based_pkt_ext: default PE in 4us units587 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us588 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1589 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1590 * @reserved3: reserved byte for future use591 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues592 */593struct iwl_he_sta_context_cmd_v1 {594	u8 sta_id;595	u8 tid_limit;596	u8 reserved1;597	u8 reserved2;598	__le32 flags;599 600	/* The below fields are set via Multiple BSSID IE */601	u8 ref_bssid_addr[6];602	__le16 reserved0;603 604	/* The below fields are set via HE-capabilities IE */605	__le32 htc_flags;606 607	u8 frag_flags;608	u8 frag_level;609	u8 frag_max_num;610	u8 frag_min_size;611 612	/* The below fields are set via PPE thresholds element */613	struct iwl_he_pkt_ext_v1 pkt_ext;614 615	/* The below fields are set via HE-Operation IE */616	u8 bss_color;617	u8 htc_trig_based_pkt_ext;618	__le16 frame_time_rts_th;619 620	/* Random access parameter set (i.e. RAPS) */621	u8 rand_alloc_ecwmin;622	u8 rand_alloc_ecwmax;623	__le16 reserved3;624 625	/* The below fields are set via MU EDCA parameter set element */626	struct iwl_he_backoff_conf trig_based_txf[AC_NUM];627} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_1 */628 629/**630 * struct iwl_he_sta_context_cmd_v2 - configure FW to work with HE AP631 * @sta_id: STA id632 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg633 *	0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit634 * @reserved1: reserved byte for future use635 * @reserved2: reserved byte for future use636 * @flags: see %iwl_11ax_sta_ctxt_flags637 * @ref_bssid_addr: reference BSSID used by the AP638 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes639 * @htc_flags: which features are supported in HTC640 * @frag_flags: frag support in A-MSDU641 * @frag_level: frag support level642 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)643 * @frag_min_size: min frag size (except last frag)644 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa645 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame646 * @htc_trig_based_pkt_ext: default PE in 4us units647 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us648 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1649 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1650 * @reserved3: reserved byte for future use651 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues652 * @max_bssid_indicator: indicator of the max bssid supported on the associated653 *	bss654 * @bssid_index: index of the associated VAP655 * @ema_ap: AP supports enhanced Multi BSSID advertisement656 * @profile_periodicity: number of Beacon periods that are needed to receive the657 *	complete VAPs info658 * @bssid_count: actual number of VAPs in the MultiBSS Set659 * @reserved4: alignment660 */661struct iwl_he_sta_context_cmd_v2 {662	u8 sta_id;663	u8 tid_limit;664	u8 reserved1;665	u8 reserved2;666	__le32 flags;667 668	/* The below fields are set via Multiple BSSID IE */669	u8 ref_bssid_addr[6];670	__le16 reserved0;671 672	/* The below fields are set via HE-capabilities IE */673	__le32 htc_flags;674 675	u8 frag_flags;676	u8 frag_level;677	u8 frag_max_num;678	u8 frag_min_size;679 680	/* The below fields are set via PPE thresholds element */681	struct iwl_he_pkt_ext_v1 pkt_ext;682 683	/* The below fields are set via HE-Operation IE */684	u8 bss_color;685	u8 htc_trig_based_pkt_ext;686	__le16 frame_time_rts_th;687 688	/* Random access parameter set (i.e. RAPS) */689	u8 rand_alloc_ecwmin;690	u8 rand_alloc_ecwmax;691	__le16 reserved3;692 693	/* The below fields are set via MU EDCA parameter set element */694	struct iwl_he_backoff_conf trig_based_txf[AC_NUM];695 696	u8 max_bssid_indicator;697	u8 bssid_index;698	u8 ema_ap;699	u8 profile_periodicity;700	u8 bssid_count;701	u8 reserved4[3];702} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */703 704/**705 * struct iwl_he_sta_context_cmd_v3 - configure FW to work with HE AP706 * @sta_id: STA id707 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg708 *	0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit709 * @reserved1: reserved byte for future use710 * @reserved2: reserved byte for future use711 * @flags: see %iwl_11ax_sta_ctxt_flags712 * @ref_bssid_addr: reference BSSID used by the AP713 * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes714 * @htc_flags: which features are supported in HTC715 * @frag_flags: frag support in A-MSDU716 * @frag_level: frag support level717 * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2)718 * @frag_min_size: min frag size (except last frag)719 * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa720 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame721 * @htc_trig_based_pkt_ext: default PE in 4us units722 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us723 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1724 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1725 * @puncture_mask: puncture mask for EHT726 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues727 * @max_bssid_indicator: indicator of the max bssid supported on the associated728 *	bss729 * @bssid_index: index of the associated VAP730 * @ema_ap: AP supports enhanced Multi BSSID advertisement731 * @profile_periodicity: number of Beacon periods that are needed to receive the732 *	complete VAPs info733 * @bssid_count: actual number of VAPs in the MultiBSS Set734 * @reserved4: alignment735 */736struct iwl_he_sta_context_cmd_v3 {737	u8 sta_id;738	u8 tid_limit;739	u8 reserved1;740	u8 reserved2;741	__le32 flags;742 743	/* The below fields are set via Multiple BSSID IE */744	u8 ref_bssid_addr[6];745	__le16 reserved0;746 747	/* The below fields are set via HE-capabilities IE */748	__le32 htc_flags;749 750	u8 frag_flags;751	u8 frag_level;752	u8 frag_max_num;753	u8 frag_min_size;754 755	/* The below fields are set via PPE thresholds element */756	struct iwl_he_pkt_ext_v2 pkt_ext;757 758	/* The below fields are set via HE-Operation IE */759	u8 bss_color;760	u8 htc_trig_based_pkt_ext;761	__le16 frame_time_rts_th;762 763	/* Random access parameter set (i.e. RAPS) */764	u8 rand_alloc_ecwmin;765	u8 rand_alloc_ecwmax;766	__le16 puncture_mask;767 768	/* The below fields are set via MU EDCA parameter set element */769	struct iwl_he_backoff_conf trig_based_txf[AC_NUM];770 771	u8 max_bssid_indicator;772	u8 bssid_index;773	u8 ema_ap;774	u8 profile_periodicity;775	u8 bssid_count;776	u8 reserved4[3];777} __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */778 779/**780 * struct iwl_he_monitor_cmd - configure air sniffer for HE781 * @bssid: the BSSID to sniff for782 * @reserved1: reserved for dword alignment783 * @aid: the AID to track on for HE MU784 * @reserved2: reserved for future use785 */786struct iwl_he_monitor_cmd {787	u8 bssid[6];788	__le16 reserved1;789	__le16 aid;790	u8 reserved2[6];791} __packed; /* HE_AIR_SNIFFER_CONFIG_CMD_API_S_VER_1 */792 793#endif /* __iwl_fw_api_mac_h__ */794