730 lines · c
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */2/*3 * Copyright (C) 2012-2014, 2018-2019, 2021-2024 Intel Corporation4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH5 * Copyright (C) 2016-2017 Intel Deutschland GmbH6 */7#ifndef __iwl_fw_api_mac_cfg_h__8#define __iwl_fw_api_mac_cfg_h__9 10#include "mac.h"11 12/**13 * enum iwl_mac_conf_subcmd_ids - mac configuration command IDs14 */15enum iwl_mac_conf_subcmd_ids {16 /**17 * @LOW_LATENCY_CMD: &struct iwl_mac_low_latency_cmd18 */19 LOW_LATENCY_CMD = 0x3,20 /**21 * @CHANNEL_SWITCH_TIME_EVENT_CMD: &struct iwl_chan_switch_te_cmd22 */23 CHANNEL_SWITCH_TIME_EVENT_CMD = 0x4,24 /**25 * @MISSED_VAP_NOTIF: &struct iwl_missed_vap_notif26 */27 MISSED_VAP_NOTIF = 0xFA,28 /**29 * @SESSION_PROTECTION_CMD: &struct iwl_mvm_session_prot_cmd30 */31 SESSION_PROTECTION_CMD = 0x5,32 /**33 * @CANCEL_CHANNEL_SWITCH_CMD: &struct iwl_cancel_channel_switch_cmd34 */35 CANCEL_CHANNEL_SWITCH_CMD = 0x6,36 /**37 * @MAC_CONFIG_CMD: &struct iwl_mac_config_cmd38 */39 MAC_CONFIG_CMD = 0x8,40 /**41 * @LINK_CONFIG_CMD: &struct iwl_link_config_cmd42 */43 LINK_CONFIG_CMD = 0x9,44 /**45 * @STA_CONFIG_CMD: &struct iwl_sta_cfg_cmd46 */47 STA_CONFIG_CMD = 0xA,48 /**49 * @AUX_STA_CMD: &struct iwl_mvm_aux_sta_cmd50 */51 AUX_STA_CMD = 0xB,52 /**53 * @STA_REMOVE_CMD: &struct iwl_remove_sta_cmd54 */55 STA_REMOVE_CMD = 0xC,56 /**57 * @STA_DISABLE_TX_CMD: &struct iwl_mvm_sta_disable_tx_cmd58 */59 STA_DISABLE_TX_CMD = 0xD,60 /**61 * @ROC_CMD: &struct iwl_roc_req62 */63 ROC_CMD = 0xE,64 /**65 * @MISSED_BEACONS_NOTIF: &struct iwl_missed_beacons_notif66 */67 MISSED_BEACONS_NOTIF = 0xF6,68 /**69 * @EMLSR_TRANS_FAIL_NOTIF: &struct iwl_esr_trans_fail_notif70 */71 EMLSR_TRANS_FAIL_NOTIF = 0xF7,72 /**73 * @ROC_NOTIF: &struct iwl_roc_notif74 */75 ROC_NOTIF = 0xF8,76 /**77 * @SESSION_PROTECTION_NOTIF: &struct iwl_mvm_session_prot_notif78 */79 SESSION_PROTECTION_NOTIF = 0xFB,80 81 /**82 * @PROBE_RESPONSE_DATA_NOTIF: &struct iwl_probe_resp_data_notif83 */84 PROBE_RESPONSE_DATA_NOTIF = 0xFC,85 86 /**87 * @CHANNEL_SWITCH_START_NOTIF: &struct iwl_channel_switch_start_notif88 */89 CHANNEL_SWITCH_START_NOTIF = 0xFF,90 91 /**92 *@CHANNEL_SWITCH_ERROR_NOTIF: &struct iwl_channel_switch_error_notif93 */94 CHANNEL_SWITCH_ERROR_NOTIF = 0xF9,95};96 97#define IWL_P2P_NOA_DESC_COUNT (2)98 99/**100 * struct iwl_p2p_noa_attr - NOA attr contained in probe resp FW notification101 *102 * @id: attribute id103 * @len_low: length low half104 * @len_high: length high half105 * @idx: instance of NoA timing106 * @ctwin: GO's ct window and pwer save capability107 * @desc: NoA descriptor108 * @reserved: reserved for alignment purposes109 */110struct iwl_p2p_noa_attr {111 u8 id;112 u8 len_low;113 u8 len_high;114 u8 idx;115 u8 ctwin;116 struct ieee80211_p2p_noa_desc desc[IWL_P2P_NOA_DESC_COUNT];117 u8 reserved;118} __packed;119 120#define IWL_PROBE_RESP_DATA_NO_CSA (0xff)121 122/**123 * struct iwl_probe_resp_data_notif - notification with NOA and CSA counter124 *125 * @mac_id: the mac which should send the probe response126 * @noa_active: notifies if the noa attribute should be handled127 * @noa_attr: P2P NOA attribute128 * @csa_counter: current csa counter129 * @reserved: reserved for alignment purposes130 */131struct iwl_probe_resp_data_notif {132 __le32 mac_id;133 __le32 noa_active;134 struct iwl_p2p_noa_attr noa_attr;135 u8 csa_counter;136 u8 reserved[3];137} __packed; /* PROBE_RESPONSE_DATA_NTFY_API_S_VER_1 */138 139/**140 * struct iwl_missed_vap_notif - notification of missing vap detection141 *142 * @mac_id: the mac for which the ucode sends the notification for143 * @num_beacon_intervals_elapsed: beacons elpased with no vap profile inside144 * @profile_periodicity: beacons period to have our profile inside145 * @reserved: reserved for alignment purposes146 */147struct iwl_missed_vap_notif {148 __le32 mac_id;149 u8 num_beacon_intervals_elapsed;150 u8 profile_periodicity;151 u8 reserved[2];152} __packed; /* MISSED_VAP_NTFY_API_S_VER_1 */153 154/**155 * struct iwl_channel_switch_start_notif_v1 - Channel switch start notification156 *157 * @id_and_color: ID and color of the MAC158 */159struct iwl_channel_switch_start_notif_v1 {160 __le32 id_and_color;161} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */162 163/**164 * struct iwl_channel_switch_start_notif - Channel switch start notification165 *166 * @link_id: FW link id167 */168struct iwl_channel_switch_start_notif {169 __le32 link_id;170} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_3 */171 172#define CS_ERR_COUNT_ERROR BIT(0)173#define CS_ERR_LONG_DELAY_AFTER_CS BIT(1)174#define CS_ERR_LONG_TX_BLOCK BIT(2)175#define CS_ERR_TX_BLOCK_TIMER_EXPIRED BIT(3)176 177/**178 * struct iwl_channel_switch_error_notif_v1 - Channel switch error notification179 *180 * @mac_id: the mac for which the ucode sends the notification for181 * @csa_err_mask: mask of channel switch error that can occur182 */183struct iwl_channel_switch_error_notif_v1 {184 __le32 mac_id;185 __le32 csa_err_mask;186} __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_1 */187 188/**189 * struct iwl_channel_switch_error_notif - Channel switch error notification190 *191 * @link_id: FW link id192 * @csa_err_mask: mask of channel switch error that can occur193 */194struct iwl_channel_switch_error_notif {195 __le32 link_id;196 __le32 csa_err_mask;197} __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_2 */198 199/**200 * struct iwl_cancel_channel_switch_cmd - Cancel Channel Switch command201 *202 * @id: the id of the link or mac that should cancel the channel switch203 */204struct iwl_cancel_channel_switch_cmd {205 __le32 id;206} __packed; /* MAC_CANCEL_CHANNEL_SWITCH_S_VER_1 */207 208/**209 * struct iwl_chan_switch_te_cmd - Channel Switch Time Event command210 *211 * @mac_id: MAC ID for channel switch212 * @action: action to perform, see &enum iwl_ctxt_action213 * @tsf: beacon tsf214 * @cs_count: channel switch count from CSA/eCSA IE215 * @cs_delayed_bcn_count: if set to N (!= 0) GO/AP can delay N beacon intervals216 * at the new channel after the channel switch, otherwise (N == 0) expect217 * beacon right after the channel switch.218 * @cs_mode: 1 - quiet, 0 - otherwise219 * @reserved: reserved for alignment purposes220 */221struct iwl_chan_switch_te_cmd {222 __le32 mac_id;223 __le32 action;224 __le32 tsf;225 u8 cs_count;226 u8 cs_delayed_bcn_count;227 u8 cs_mode;228 u8 reserved;229} __packed; /* MAC_CHANNEL_SWITCH_TIME_EVENT_S_VER_2 */230 231/**232 * struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode'233 *234 * @mac_id: MAC ID to whom to apply the low-latency configurations235 * @low_latency_rx: 1/0 to set/clear Rx low latency direction236 * @low_latency_tx: 1/0 to set/clear Tx low latency direction237 * @reserved: reserved for alignment purposes238 */239struct iwl_mac_low_latency_cmd {240 __le32 mac_id;241 u8 low_latency_rx;242 u8 low_latency_tx;243 __le16 reserved;244} __packed; /* MAC_LOW_LATENCY_API_S_VER_1 */245 246/**247 * struct iwl_mac_client_data - configuration data for client MAC context248 *249 * @is_assoc: 1 for associated state, 0 otherwise250 * @esr_transition_timeout: the timeout required by the AP for the251 * eSR transition.252 * Available only from version 2 of the command.253 * This value comes from the EMLSR transition delay in the EML254 * Capabilities subfield.255 * @medium_sync_delay: the value as it appears in P802.11be_D2.2 Figure 9-1002j.256 * @assoc_id: unique ID assigned by the AP during association257 * @reserved1: alignment258 * @data_policy: see &enum iwl_mac_data_policy259 * @reserved2: alignment260 * @ctwin: client traffic window in TU (period after TBTT when GO is present).261 * 0 indicates that there is no CT window.262 */263struct iwl_mac_client_data {264 u8 is_assoc;265 u8 esr_transition_timeout;266 __le16 medium_sync_delay;267 268 __le16 assoc_id;269 __le16 reserved1;270 __le16 data_policy;271 __le16 reserved2;272 __le32 ctwin;273} __packed; /* MAC_CONTEXT_CONFIG_CLIENT_DATA_API_S_VER_2 */274 275/**276 * struct iwl_mac_p2p_dev_data - configuration data for P2P device MAC context277 *278 * @is_disc_extended: if set to true, P2P Device discoverability is enabled on279 * other channels as well. This should be to true only in case that the280 * device is discoverable and there is an active GO. Note that setting this281 * field when not needed, will increase the number of interrupts and have282 * effect on the platform power, as this setting opens the Rx filters on283 * all macs.284 */285struct iwl_mac_p2p_dev_data {286 __le32 is_disc_extended;287} __packed; /* MAC_CONTEXT_CONFIG_P2P_DEV_DATA_API_S_VER_1 */288 289/**290 * enum iwl_mac_config_filter_flags - MAC context configuration filter flags291 *292 * @MAC_CFG_FILTER_PROMISC: accept all data frames293 * @MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT: pass all management and294 * control frames to the host295 * @MAC_CFG_FILTER_ACCEPT_GRP: accept multicast frames296 * @MAC_CFG_FILTER_ACCEPT_BEACON: accept beacon frames297 * @MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe response298 * @MAC_CFG_FILTER_ACCEPT_PROBE_REQ: accept probe requests299 */300enum iwl_mac_config_filter_flags {301 MAC_CFG_FILTER_PROMISC = BIT(0),302 MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT = BIT(1),303 MAC_CFG_FILTER_ACCEPT_GRP = BIT(2),304 MAC_CFG_FILTER_ACCEPT_BEACON = BIT(3),305 MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP = BIT(4),306 MAC_CFG_FILTER_ACCEPT_PROBE_REQ = BIT(5),307}; /* MAC_FILTER_FLAGS_MASK_E_VER_1 */308 309/**310 * struct iwl_mac_config_cmd - command structure to configure MAC contexts in311 * MLD API312 * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )313 *314 * @id_and_color: ID and color of the MAC315 * @action: action to perform, see &enum iwl_ctxt_action316 * @mac_type: one of &enum iwl_mac_types317 * @local_mld_addr: mld address318 * @reserved_for_local_mld_addr: reserved319 * @filter_flags: combination of &enum iwl_mac_config_filter_flags320 * @he_support: does this MAC support HE321 * @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling322 * @eht_support: does this MAC support EHT. Requires he_support323 * @nic_not_ack_enabled: mark that the NIC doesn't support receiving324 * ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).325 * If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0326 * len delim to determine if AGG or single.327 * @client: client mac data328 * @p2p_dev: mac data for p2p device329 */330struct iwl_mac_config_cmd {331 /* COMMON_INDEX_HDR_API_S_VER_1 */332 __le32 id_and_color;333 __le32 action;334 /* MAC_CONTEXT_TYPE_API_E */335 __le32 mac_type;336 u8 local_mld_addr[6];337 __le16 reserved_for_local_mld_addr;338 __le32 filter_flags;339 __le16 he_support;340 __le16 he_ap_support;341 __le32 eht_support;342 __le32 nic_not_ack_enabled;343 /* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_2 */344 union {345 struct iwl_mac_client_data client;346 struct iwl_mac_p2p_dev_data p2p_dev;347 };348} __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2 */349 350/**351 * enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being352 * modified in &iwl_link_ctx_cfg_cmd353 *354 * @LINK_CONTEXT_MODIFY_ACTIVE: covers iwl_link_ctx_cfg_cmd::active355 * @LINK_CONTEXT_MODIFY_RATES_INFO: covers iwl_link_ctx_cfg_cmd::cck_rates,356 * iwl_link_ctx_cfg_cmd::ofdm_rates,357 * iwl_link_ctx_cfg_cmd::cck_short_preamble,358 * iwl_link_ctx_cfg_cmd::short_slot359 * @LINK_CONTEXT_MODIFY_PROTECT_FLAGS: covers360 * iwl_link_ctx_cfg_cmd::protection_flags361 * @LINK_CONTEXT_MODIFY_QOS_PARAMS: covers iwl_link_ctx_cfg_cmd::qos_flags,362 * iwl_link_ctx_cfg_cmd::ac,363 * @LINK_CONTEXT_MODIFY_BEACON_TIMING: covers iwl_link_ctx_cfg_cmd::bi,364 * iwl_link_ctx_cfg_cmd::dtim_interval,365 * iwl_link_ctx_cfg_cmd::dtim_time,366 * iwl_link_ctx_cfg_cmd::dtim_tsf,367 * iwl_link_ctx_cfg_cmd::assoc_beacon_arrive_time.368 * This flag can be set only once after assoc.369 * @LINK_CONTEXT_MODIFY_HE_PARAMS: covers370 * iwl_link_ctx_cfg_cmd::htc_trig_based_pkt_ext371 * iwl_link_ctx_cfg_cmd::rand_alloc_ecwmin,372 * iwl_link_ctx_cfg_cmd::rand_alloc_ecwmax,373 * iwl_link_ctx_cfg_cmd::trig_based_txf,374 * iwl_link_ctx_cfg_cmd::bss_color,375 * iwl_link_ctx_cfg_cmd::ndp_fdbk_buff_th_exp,376 * iwl_link_ctx_cfg_cmd::ref_bssid_addr377 * iwl_link_ctx_cfg_cmd::bssid_index,378 * iwl_link_ctx_cfg_cmd::frame_time_rts_th.379 * This flag can be set any time.380 * @LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE: covers381 * iwl_link_ctx_cfg_cmd::bss_color_disable382 * @LINK_CONTEXT_MODIFY_EHT_PARAMS: covers iwl_link_ctx_cfg_cmd::puncture_mask.383 * This flag can be set only if the MAC that this link relates to has384 * eht_support set to true. No longer used since _VER_3 of this command.385 * @LINK_CONTEXT_MODIFY_ALL: set all above flags386 */387enum iwl_link_ctx_modify_flags {388 LINK_CONTEXT_MODIFY_ACTIVE = BIT(0),389 LINK_CONTEXT_MODIFY_RATES_INFO = BIT(1),390 LINK_CONTEXT_MODIFY_PROTECT_FLAGS = BIT(2),391 LINK_CONTEXT_MODIFY_QOS_PARAMS = BIT(3),392 LINK_CONTEXT_MODIFY_BEACON_TIMING = BIT(4),393 LINK_CONTEXT_MODIFY_HE_PARAMS = BIT(5),394 LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE = BIT(6),395 LINK_CONTEXT_MODIFY_EHT_PARAMS = BIT(7),396 LINK_CONTEXT_MODIFY_ALL = 0xff,397}; /* LINK_CONTEXT_MODIFY_MASK_E_VER_1 */398 399/**400 * enum iwl_link_ctx_protection_flags - link protection flags401 * @LINK_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,402 * this will require CCK RTS/CTS2self.403 * RTS/CTS will protect full burst time.404 * @LINK_PROT_FLG_HT_PROT: enable HT protection405 * @LINK_PROT_FLG_FAT_PROT: protect 40 MHz transmissions406 * @LINK_PROT_FLG_SELF_CTS_EN: allow CTS2self407 */408enum iwl_link_ctx_protection_flags {409 LINK_PROT_FLG_TGG_PROTECT = BIT(0),410 LINK_PROT_FLG_HT_PROT = BIT(1),411 LINK_PROT_FLG_FAT_PROT = BIT(2),412 LINK_PROT_FLG_SELF_CTS_EN = BIT(3),413}; /* LINK_PROTECT_FLAGS_E_VER_1 */414 415/**416 * enum iwl_link_ctx_flags - link context flags417 *418 * @LINK_FLG_BSS_COLOR_DIS: BSS color disable, don't use the BSS419 * color for RX filter but use MAC header420 * enabled AGG, i.e. both BACK and non-BACK frames in a single AGG421 * @LINK_FLG_MU_EDCA_CW: indicates that there is an element of MU EDCA422 * parameter set, i.e. the backoff counters for trig-based ACs423 * @LINK_FLG_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are424 * not allowed (as there are OBSS that might classify such transmissions as425 * radar pulses).426 * @LINK_FLG_NDP_FEEDBACK_ENABLED: mark support for NDP feedback and change427 * of threshold428 */429enum iwl_link_ctx_flags {430 LINK_FLG_BSS_COLOR_DIS = BIT(0),431 LINK_FLG_MU_EDCA_CW = BIT(1),432 LINK_FLG_RU_2MHZ_BLOCK = BIT(2),433 LINK_FLG_NDP_FEEDBACK_ENABLED = BIT(3),434}; /* LINK_CONTEXT_FLAG_E_VER_1 */435 436/**437 * struct iwl_link_config_cmd - command structure to configure the LINK context438 * in MLD API439 * ( LINK_CONFIG_CMD =0x9 )440 *441 * @action: action to perform, see &enum iwl_ctxt_action442 * @link_id: the id of the link that this cmd configures443 * @mac_id: interface ID. Relevant only if action is FW_CTXT_ACTION_ADD444 * @phy_id: PHY index. Can be changed only if the link was inactive445 * (and stays inactive). If the link is active (or becomes active),446 * this field is ignored.447 * @local_link_addr: the links MAC address. Can be changed only if the link was448 * inactive (and stays inactive). If the link is active449 * (or becomes active), this field is ignored.450 * @reserved_for_local_link_addr: reserved451 * @modify_mask: from &enum iwl_link_ctx_modify_flags, selects what to change.452 * Relevant only if action is FW_CTXT_ACTION_MODIFY453 * @active: indicates whether the link is active or not454 * @listen_lmac: indicates whether the link should be allocated on the Listen455 * Lmac or on the Main Lmac. Cannot be changed on an active Link.456 * Relevant only for eSR.457 * @block_tx: tell the firmware that this link can't Tx. This should be used458 * only when a link is de-activated because of CSA with mode = 1.459 * Available since version 5.460 * @reserved1: in version 2, listen_lmac became reserved461 * @cck_rates: basic rates available for CCK462 * @ofdm_rates: basic rates available for OFDM463 * @cck_short_preamble: 1 for enabling short preamble, 0 otherwise464 * @short_slot: 1 for enabling short slots, 0 otherwise465 * @protection_flags: combination of &enum iwl_link_ctx_protection_flags466 * @qos_flags: from &enum iwl_mac_qos_flags467 * @ac: one iwl_mac_qos configuration for each AC468 * @htc_trig_based_pkt_ext: default PE in 4us units469 * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1470 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1471 * @ndp_fdbk_buff_th_exp: set exponent for the NDP feedback buffered threshold472 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues473 * @bi: beacon interval in TU, applicable only when associated474 * @dtim_interval: DTIM interval in TU.475 * Relevant only for GO, otherwise this is offloaded.476 * @puncture_mask: puncture mask for EHT (removed in VER_3)477 * @frame_time_rts_th: HE duration RTS threshold, in units of 32us478 * @flags: a combination from &enum iwl_link_ctx_flags479 * @flags_mask: what of %flags have changed. Also &enum iwl_link_ctx_flags480 * Below fields are for multi-bssid:481 * @ref_bssid_addr: reference BSSID used by the AP482 * @reserved_for_ref_bssid_addr: reserved483 * @bssid_index: index of the associated VAP484 * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame485 * @spec_link_id: link_id as the AP knows it486 * @ul_mu_data_disable: OM Control UL MU Data Disable RX Support (bit 44) in487 * HE MAC Capabilities information field as defined in figure 9-897 in488 * IEEE802.11REVme-D5.0489 * @ibss_bssid_addr: bssid for ibss490 * @reserved_for_ibss_bssid_addr: reserved491 * @reserved3: reserved for future use492 */493struct iwl_link_config_cmd {494 __le32 action;495 __le32 link_id;496 __le32 mac_id;497 __le32 phy_id;498 u8 local_link_addr[6];499 __le16 reserved_for_local_link_addr;500 __le32 modify_mask;501 __le32 active;502 union {503 __le32 listen_lmac;504 struct {505 u8 block_tx;506 u8 reserved1[3];507 };508 };509 __le32 cck_rates;510 __le32 ofdm_rates;511 __le32 cck_short_preamble;512 __le32 short_slot;513 __le32 protection_flags;514 /* MAC_QOS_PARAM_API_S_VER_1 */515 __le32 qos_flags;516 struct iwl_ac_qos ac[AC_NUM + 1];517 u8 htc_trig_based_pkt_ext;518 u8 rand_alloc_ecwmin;519 u8 rand_alloc_ecwmax;520 u8 ndp_fdbk_buff_th_exp;521 struct iwl_he_backoff_conf trig_based_txf[AC_NUM];522 __le32 bi;523 __le32 dtim_interval;524 __le16 puncture_mask; /* removed in _VER_3 */525 __le16 frame_time_rts_th;526 __le32 flags;527 __le32 flags_mask;528 /* The below fields are for multi-bssid */529 u8 ref_bssid_addr[6];530 __le16 reserved_for_ref_bssid_addr;531 u8 bssid_index;532 u8 bss_color;533 u8 spec_link_id;534 u8 ul_mu_data_disable;535 u8 ibss_bssid_addr[6];536 __le16 reserved_for_ibss_bssid_addr;537 __le32 reserved3[8];538} __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1, _VER_2, _VER_3, _VER_4, _VER_5 */539 540/* Currently FW supports link ids in the range 0-3 and can have541 * at most two active links for each vif.542 */543#define IWL_FW_MAX_ACTIVE_LINKS_NUM 2544#define IWL_FW_MAX_LINK_ID 3545 546/**547 * enum iwl_fw_sta_type - FW station types548 * @STATION_TYPE_PEER: represents a peer - AP in BSS, a TDLS sta, a client in549 * P2P.550 * @STATION_TYPE_BCAST_MGMT: The station used to send beacons and551 * probe responses. Also used for traffic injection in sniffer mode552 * @STATION_TYPE_MCAST: the station used for BCAST / MCAST in GO. Will be553 * suspended / resumed at the right timing depending on the clients'554 * power save state and the DTIM timing555 * @STATION_TYPE_AUX: aux sta. In the FW there is no need for a special type556 * for the aux sta, so this type is only for driver - internal use.557 */558enum iwl_fw_sta_type {559 STATION_TYPE_PEER,560 STATION_TYPE_BCAST_MGMT,561 STATION_TYPE_MCAST,562 STATION_TYPE_AUX,563}; /* STATION_TYPE_E_VER_1 */564 565/**566 * struct iwl_sta_cfg_cmd - cmd structure to add a peer sta to the uCode's567 * station table568 * ( STA_CONFIG_CMD = 0xA )569 *570 * @sta_id: index of station in uCode's station table571 * @link_id: the id of the link that is used to communicate with this sta572 * @peer_mld_address: the peers mld address573 * @reserved_for_peer_mld_address: reserved574 * @peer_link_address: the address of the link that is used to communicate575 * with this sta576 * @reserved_for_peer_link_address: reserved577 * @station_type: type of this station. See &enum iwl_fw_sta_type578 * @assoc_id: for GO only579 * @beamform_flags: beam forming controls580 * @mfp: indicates whether the STA uses management frame protection or not.581 * @mimo: indicates whether the sta uses mimo or not582 * @mimo_protection: indicates whether the sta uses mimo protection or not583 * @ack_enabled: indicates that the AP supports receiving ACK-584 * enabled AGG, i.e. both BACK and non-BACK frames in a single AGG585 * @trig_rnd_alloc: indicates that trigger based random allocation586 * is enabled according to UORA element existence587 * @tx_ampdu_spacing: minimum A-MPDU spacing:588 * 4 - 2us density, 5 - 4us density, 6 - 8us density, 7 - 16us density589 * @tx_ampdu_max_size: maximum A-MPDU length: 0 - 8K, 1 - 16K, 2 - 32K,590 * 3 - 64K, 4 - 128K, 5 - 256K, 6 - 512K, 7 - 1024K.591 * @sp_length: the size of the SP in actual number of frames592 * @uapsd_acs: 4 LS bits are trigger enabled ACs, 4 MS bits are the deliver593 * enabled ACs.594 * @pkt_ext: optional, exists according to PPE-present bit in the HE/EHT-PHY595 * capa596 * @htc_flags: which features are supported in HTC597 */598struct iwl_sta_cfg_cmd {599 __le32 sta_id;600 __le32 link_id;601 u8 peer_mld_address[ETH_ALEN];602 __le16 reserved_for_peer_mld_address;603 u8 peer_link_address[ETH_ALEN];604 __le16 reserved_for_peer_link_address;605 __le32 station_type;606 __le32 assoc_id;607 __le32 beamform_flags;608 __le32 mfp;609 __le32 mimo;610 __le32 mimo_protection;611 __le32 ack_enabled;612 __le32 trig_rnd_alloc;613 __le32 tx_ampdu_spacing;614 __le32 tx_ampdu_max_size;615 __le32 sp_length;616 __le32 uapsd_acs;617 struct iwl_he_pkt_ext_v2 pkt_ext;618 __le32 htc_flags;619} __packed; /* STA_CMD_API_S_VER_1 */620 621/**622 * struct iwl_mvm_aux_sta_cmd - command for AUX STA configuration623 * ( AUX_STA_CMD = 0xB )624 *625 * @sta_id: index of aux sta to configure626 * @lmac_id: ?627 * @mac_addr: mac addr of the auxilary sta628 * @reserved_for_mac_addr: reserved629 */630struct iwl_mvm_aux_sta_cmd {631 __le32 sta_id;632 __le32 lmac_id;633 u8 mac_addr[ETH_ALEN];634 __le16 reserved_for_mac_addr;635 636} __packed; /* AUX_STA_CMD_API_S_VER_1 */637 638/**639 * struct iwl_remove_sta_cmd - a cmd structure to remove a sta added by640 * STA_CONFIG_CMD or AUX_STA_CONFIG_CMD641 * ( STA_REMOVE_CMD = 0xC )642 *643 * @sta_id: index of station to remove644 */645struct iwl_remove_sta_cmd {646 __le32 sta_id;647} __packed; /* REMOVE_STA_API_S_VER_1 */648 649/**650 * struct iwl_mvm_sta_disable_tx_cmd - disable / re-enable tx to a sta651 * ( STA_DISABLE_TX_CMD = 0xD )652 *653 * @sta_id: index of the station to disable tx to654 * @disable: indicates if to disable or re-enable tx655 */656struct iwl_mvm_sta_disable_tx_cmd {657 __le32 sta_id;658 __le32 disable;659} __packed; /* STA_DISABLE_TX_API_S_VER_1 */660 661/**662 * enum iwl_mvm_fw_esr_recommendation - FW recommendation code663 * @ESR_RECOMMEND_LEAVE: recommendation to leave esr664 * @ESR_FORCE_LEAVE: force exiting esr665 * @ESR_RECOMMEND_ENTER: recommendation to enter esr666 */667enum iwl_mvm_fw_esr_recommendation {668 ESR_RECOMMEND_LEAVE,669 ESR_FORCE_LEAVE,670 ESR_RECOMMEND_ENTER,671}; /* ESR_MODE_RECOMMENDATION_CODE_API_E_VER_1 */672 673/**674 * struct iwl_mvm_esr_mode_notif - FWs recommendation/force for esr mode675 *676 * @action: the action to apply on esr state. See &iwl_mvm_fw_esr_recommendation677 */678struct iwl_mvm_esr_mode_notif {679 __le32 action;680} __packed; /* ESR_MODE_RECOMMENDATION_NTFY_API_S_VER_1 */681 682/**683 * struct iwl_missed_beacons_notif - sent when by the firmware upon beacon loss684 * ( MISSED_BEACONS_NOTIF = 0xF6 )685 * @link_id: fw link ID686 * @consec_missed_beacons_since_last_rx: number of consecutive missed687 * beacons since last RX.688 * @consec_missed_beacons: number of consecutive missed beacons689 * @other_link_id: used in EMLSR only. The fw link ID for690 * &consec_missed_beacons_other_link. IWL_MVM_FW_LINK_ID_INVALID (0xff) if691 * invalid.692 * @consec_missed_beacons_other_link: number of consecutive missed beacons on693 * &other_link_id.694 */695struct iwl_missed_beacons_notif {696 __le32 link_id;697 __le32 consec_missed_beacons_since_last_rx;698 __le32 consec_missed_beacons;699 __le32 other_link_id;700 __le32 consec_missed_beacons_other_link;701} __packed; /* MISSED_BEACON_NTFY_API_S_VER_5 */702 703/*704 * enum iwl_esr_trans_fail_code: to be used to parse the notif below705 *706 * @ESR_TRANS_FAILED_TX_STATUS_ERROR: failed to TX EML OMN frame707 * @ESR_TRANSITION_FAILED_TX_TIMEOUT: timeout on the EML OMN frame708 * @ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD: can't get a beacon on the new link709 */710enum iwl_esr_trans_fail_code {711 ESR_TRANS_FAILED_TX_STATUS_ERROR,712 ESR_TRANSITION_FAILED_TX_TIMEOUT,713 ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD,714};715 716/**717 * struct iwl_esr_trans_fail_notif - FW reports a failure in EMLSR transition718 *719 * @link_id: the link_id that still works after the failure720 * @activation: true if the link was activated, false otherwise721 * @err_code: see &enum iwl_esr_trans_fail_code722 */723struct iwl_esr_trans_fail_notif {724 __le32 link_id;725 __le32 activation;726 __le32 err_code;727} __packed; /* ESR_TRANSITION_FAILED_NTFY_API_S_VER_1 */728 729#endif /* __iwl_fw_api_mac_cfg_h__ */730