1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2012-2014, 2018-2019, 2021-2022 Intel Corporation
4  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5  * Copyright (C) 2016-2017 Intel Deutschland GmbH
6  */
7 #ifndef __iwl_fw_api_mac_cfg_h__
8 #define __iwl_fw_api_mac_cfg_h__
9 
10 #include "mac.h"
11 
12 /**
13  * enum iwl_mac_conf_subcmd_ids - mac configuration command IDs
14  */
15 enum iwl_mac_conf_subcmd_ids {
16 	/**
17 	 * @LOW_LATENCY_CMD: &struct iwl_mac_low_latency_cmd
18 	 */
19 	LOW_LATENCY_CMD = 0x3,
20 	/**
21 	 * @CHANNEL_SWITCH_TIME_EVENT_CMD: &struct iwl_chan_switch_te_cmd
22 	 */
23 	CHANNEL_SWITCH_TIME_EVENT_CMD = 0x4,
24 	/**
25 	 * @MISSED_VAP_NOTIF: &struct iwl_missed_vap_notif
26 	 */
27 	MISSED_VAP_NOTIF = 0xFA,
28 	/**
29 	 * @SESSION_PROTECTION_CMD: &struct iwl_mvm_session_prot_cmd
30 	 */
31 	SESSION_PROTECTION_CMD = 0x5,
32 	/**
33 	 * @CANCEL_CHANNEL_SWITCH_CMD: &struct iwl_cancel_channel_switch_cmd
34 	 */
35 	CANCEL_CHANNEL_SWITCH_CMD = 0x6,
36 	/**
37 	 * @MAC_CONFIG_CMD: &struct iwl_mac_config_cmd
38 	 */
39 	MAC_CONFIG_CMD = 0x8,
40 	/**
41 	 * @LINK_CONFIG_CMD: &struct iwl_link_config_cmd
42 	 */
43 	LINK_CONFIG_CMD = 0x9,
44 	/**
45 	 * @STA_CONFIG_CMD: &struct iwl_mvm_sta_cfg_cmd
46 	 */
47 	STA_CONFIG_CMD = 0xA,
48 	/**
49 	 * @AUX_STA_CMD: &struct iwl_mvm_aux_sta_cmd
50 	 */
51 	AUX_STA_CMD = 0xB,
52 	/**
53 	 * @STA_REMOVE_CMD: &struct iwl_mvm_remove_sta_cmd
54 	 */
55 	STA_REMOVE_CMD = 0xC,
56 	/**
57 	 * @STA_DISABLE_TX_CMD: &struct iwl_mvm_sta_disable_tx_cmd
58 	 */
59 	STA_DISABLE_TX_CMD = 0xD,
60 	/**
61 	 * @SESSION_PROTECTION_NOTIF: &struct iwl_mvm_session_prot_notif
62 	 */
63 	SESSION_PROTECTION_NOTIF = 0xFB,
64 
65 	/**
66 	 * @PROBE_RESPONSE_DATA_NOTIF: &struct iwl_probe_resp_data_notif
67 	 */
68 	PROBE_RESPONSE_DATA_NOTIF = 0xFC,
69 
70 	/**
71 	 * @CHANNEL_SWITCH_START_NOTIF: &struct iwl_channel_switch_start_notif
72 	 */
73 	CHANNEL_SWITCH_START_NOTIF = 0xFF,
74 
75 	/**
76 	 *@CHANNEL_SWITCH_ERROR_NOTIF: &struct iwl_channel_switch_error_notif
77 	 */
78 	CHANNEL_SWITCH_ERROR_NOTIF = 0xF9,
79 };
80 
81 #define IWL_P2P_NOA_DESC_COUNT	(2)
82 
83 /**
84  * struct iwl_p2p_noa_attr - NOA attr contained in probe resp FW notification
85  *
86  * @id: attribute id
87  * @len_low: length low half
88  * @len_high: length high half
89  * @idx: instance of NoA timing
90  * @ctwin: GO's ct window and pwer save capability
91  * @desc: NoA descriptor
92  * @reserved: reserved for alignment purposes
93  */
94 struct iwl_p2p_noa_attr {
95 	u8 id;
96 	u8 len_low;
97 	u8 len_high;
98 	u8 idx;
99 	u8 ctwin;
100 	struct ieee80211_p2p_noa_desc desc[IWL_P2P_NOA_DESC_COUNT];
101 	u8 reserved;
102 } __packed;
103 
104 #define IWL_PROBE_RESP_DATA_NO_CSA (0xff)
105 
106 /**
107  * struct iwl_probe_resp_data_notif - notification with NOA and CSA counter
108  *
109  * @mac_id: the mac which should send the probe response
110  * @noa_active: notifies if the noa attribute should be handled
111  * @noa_attr: P2P NOA attribute
112  * @csa_counter: current csa counter
113  * @reserved: reserved for alignment purposes
114  */
115 struct iwl_probe_resp_data_notif {
116 	__le32 mac_id;
117 	__le32 noa_active;
118 	struct iwl_p2p_noa_attr noa_attr;
119 	u8 csa_counter;
120 	u8 reserved[3];
121 } __packed; /* PROBE_RESPONSE_DATA_NTFY_API_S_VER_1 */
122 
123 /**
124  * struct iwl_missed_vap_notif - notification of missing vap detection
125  *
126  * @mac_id: the mac for which the ucode sends the notification for
127  * @num_beacon_intervals_elapsed: beacons elpased with no vap profile inside
128  * @profile_periodicity: beacons period to have our profile inside
129  * @reserved: reserved for alignment purposes
130  */
131 struct iwl_missed_vap_notif {
132 	__le32 mac_id;
133 	u8 num_beacon_intervals_elapsed;
134 	u8 profile_periodicity;
135 	u8 reserved[2];
136 } __packed; /* MISSED_VAP_NTFY_API_S_VER_1 */
137 
138 /**
139  * struct iwl_channel_switch_start_notif - Channel switch start notification
140  *
141  * @id_and_color: ID and color of the MAC
142  */
143 struct iwl_channel_switch_start_notif {
144 	__le32 id_and_color;
145 } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
146 
147 #define CS_ERR_COUNT_ERROR BIT(0)
148 #define CS_ERR_LONG_DELAY_AFTER_CS BIT(1)
149 #define CS_ERR_LONG_TX_BLOCK BIT(2)
150 #define CS_ERR_TX_BLOCK_TIMER_EXPIRED BIT(3)
151 
152 /**
153  * struct iwl_channel_switch_error_notif - Channel switch error notification
154  *
155  * @mac_id: the mac for which the ucode sends the notification for
156  * @csa_err_mask: mask of channel switch error that can occur
157  */
158 struct iwl_channel_switch_error_notif {
159 	__le32 mac_id;
160 	__le32 csa_err_mask;
161 } __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_1 */
162 
163 /**
164  * struct iwl_cancel_channel_switch_cmd - Cancel Channel Switch command
165  *
166  * @mac_id: the mac that should cancel the channel switch
167  */
168 struct iwl_cancel_channel_switch_cmd {
169 	__le32 mac_id;
170 } __packed; /* MAC_CANCEL_CHANNEL_SWITCH_S_VER_1 */
171 
172 /**
173  * struct iwl_chan_switch_te_cmd - Channel Switch Time Event command
174  *
175  * @mac_id: MAC ID for channel switch
176  * @action: action to perform, one of FW_CTXT_ACTION_*
177  * @tsf: beacon tsf
178  * @cs_count: channel switch count from CSA/eCSA IE
179  * @cs_delayed_bcn_count: if set to N (!= 0) GO/AP can delay N beacon intervals
180  *	at the new channel after the channel switch, otherwise (N == 0) expect
181  *	beacon right after the channel switch.
182  * @cs_mode: 1 - quiet, 0 - otherwise
183  * @reserved: reserved for alignment purposes
184  */
185 struct iwl_chan_switch_te_cmd {
186 	__le32 mac_id;
187 	__le32 action;
188 	__le32 tsf;
189 	u8 cs_count;
190 	u8 cs_delayed_bcn_count;
191 	u8 cs_mode;
192 	u8 reserved;
193 } __packed; /* MAC_CHANNEL_SWITCH_TIME_EVENT_S_VER_2 */
194 
195 /**
196  * struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode'
197  *
198  * @mac_id: MAC ID to whom to apply the low-latency configurations
199  * @low_latency_rx: 1/0 to set/clear Rx low latency direction
200  * @low_latency_tx: 1/0 to set/clear Tx low latency direction
201  * @reserved: reserved for alignment purposes
202  */
203 struct iwl_mac_low_latency_cmd {
204 	__le32 mac_id;
205 	u8 low_latency_rx;
206 	u8 low_latency_tx;
207 	__le16 reserved;
208 } __packed; /* MAC_LOW_LATENCY_API_S_VER_1 */
209 
210 /**
211  * struct iwl_mac_client_data - configuration data for client MAC context
212  *
213  * @is_assoc: 1 for associated state, 0 otherwise
214  * @assoc_id: unique ID assigned by the AP during association
215  * @data_policy: see &enum iwl_mac_data_policy
216  * @ctwin: client traffic window in TU (period after TBTT when GO is present).
217  *	0 indicates that there is no CT window.
218  */
219 struct iwl_mac_client_data {
220 	__le32 is_assoc;
221 	__le32 assoc_id;
222 	__le32 data_policy;
223 	__le32 ctwin;
224 } __packed; /* MAC_CONTEXT_CONFIG_CLIENT_DATA_API_S_VER_1 */
225 
226 /**
227  * struct iwl_mac_p2p_dev_data  - configuration data for P2P device MAC context
228  *
229  * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
230  *	other channels as well. This should be to true only in case that the
231  *	device is discoverable and there is an active GO. Note that setting this
232  *	field when not needed, will increase the number of interrupts and have
233  *	effect on the platform power, as this setting opens the Rx filters on
234  *	all macs.
235  */
236 struct iwl_mac_p2p_dev_data {
237 	__le32 is_disc_extended;
238 } __packed; /* MAC_CONTEXT_CONFIG_P2P_DEV_DATA_API_S_VER_1 */
239 
240 /**
241  * enum iwl_mac_config_filter_flags - MAC context configuration filter flags
242  *
243  * @MAC_CFG_FILTER_PROMISC: accept all data frames
244  * @MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT: pass all management and
245  *	control frames to the host
246  * @MAC_CFG_FILTER_ACCEPT_GRP: accept multicast frames
247  * @MAC_CFG_FILTER_ACCEPT_BEACON: accept beacon frames
248  * @MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe response
249  * @MAC_CFG_FILTER_ACCEPT_PROBE_REQ: accept probe requests
250  */
251 enum iwl_mac_config_filter_flags {
252 	MAC_CFG_FILTER_PROMISC			= BIT(0),
253 	MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT	= BIT(1),
254 	MAC_CFG_FILTER_ACCEPT_GRP		= BIT(2),
255 	MAC_CFG_FILTER_ACCEPT_BEACON		= BIT(3),
256 	MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP	= BIT(4),
257 	MAC_CFG_FILTER_ACCEPT_PROBE_REQ		= BIT(5),
258 }; /* MAC_FILTER_FLAGS_MASK_E_VER_1 */
259 
260 /**
261  * struct iwl_mac_config_cmd - command structure to configure MAC contexts in
262  *	MLD API
263  * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
264  *
265  * @id_and_color: ID and color of the MAC
266  * @action: action to perform, one of FW_CTXT_ACTION_*
267  * @mac_type: one of &enum iwl_mac_types
268  * @local_mld_addr: mld address
269  * @reserved_for_local_mld_addr: reserved
270  * @filter_flags: combination of &enum iwl_mac_config_filter_flags
271  * @he_support: does this MAC support HE
272  * @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
273  * @eht_support: does this MAC support EHT. Requires he_support
274  * @nic_not_ack_enabled: mark that the NIC doesn't support receiving
275  *	ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
276  *	If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
277  *	len delim to determine if AGG or single.
278  * @client: client mac data
279  * @go_ibss: mac data for go or ibss
280  * @p2p_dev: mac data for p2p device
281  */
282 struct iwl_mac_config_cmd {
283 	/* COMMON_INDEX_HDR_API_S_VER_1 */
284 	__le32 id_and_color;
285 	__le32 action;
286 	/* MAC_CONTEXT_TYPE_API_E */
287 	__le32 mac_type;
288 	u8 local_mld_addr[6];
289 	__le16 reserved_for_local_mld_addr;
290 	__le32 filter_flags;
291 	__le16 he_support;
292 	__le16 he_ap_support;
293 	__le32 eht_support;
294 	__le32 nic_not_ack_enabled;
295 	/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_1 */
296 	union {
297 		struct iwl_mac_client_data client;
298 		struct iwl_mac_p2p_dev_data p2p_dev;
299 	};
300 } __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_1 */
301 
302 /**
303  * enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being
304  *	modified in &iwl_link_ctx_cfg_cmd
305  *
306  * @LINK_CONTEXT_MODIFY_ACTIVE: covers iwl_link_ctx_cfg_cmd::active
307  * @LINK_CONTEXT_MODIFY_RATES_INFO: covers iwl_link_ctx_cfg_cmd::cck_rates,
308  *	iwl_link_ctx_cfg_cmd::ofdm_rates,
309  *	iwl_link_ctx_cfg_cmd::cck_short_preamble,
310  *	iwl_link_ctx_cfg_cmd::short_slot
311  * @LINK_CONTEXT_MODIFY_PROTECT_FLAGS: covers
312  *	iwl_link_ctx_cfg_cmd::protection_flags
313  * @LINK_CONTEXT_MODIFY_QOS_PARAMS: covers iwl_link_ctx_cfg_cmd::qos_flags,
314  *	iwl_link_ctx_cfg_cmd::ac,
315  * @LINK_CONTEXT_MODIFY_BEACON_TIMING: covers iwl_link_ctx_cfg_cmd::bi,
316  *	iwl_link_ctx_cfg_cmd::dtim_interval,
317  *	iwl_link_ctx_cfg_cmd::dtim_time,
318  *	iwl_link_ctx_cfg_cmd::dtim_tsf,
319  *	iwl_link_ctx_cfg_cmd::assoc_beacon_arrive_time.
320  *	This flag can be set only once after assoc.
321  * @LINK_CONTEXT_MODIFY_HE_PARAMS: covers
322  *	iwl_link_ctx_cfg_cmd::htc_trig_based_pkt_ext
323  *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmin,
324  *	iwl_link_ctx_cfg_cmd::rand_alloc_ecwmax,
325  *	iwl_link_ctx_cfg_cmd::trig_based_txf,
326  *	iwl_link_ctx_cfg_cmd::bss_color,
327  *	iwl_link_ctx_cfg_cmd::ndp_fdbk_buff_th_exp,
328  *	iwl_link_ctx_cfg_cmd::ref_bssid_addr
329  *	iwl_link_ctx_cfg_cmd::bssid_index,
330  *	iwl_link_ctx_cfg_cmd::frame_time_rts_th.
331  *	This flag can be set any time.
332  * @LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE: covers
333  *	iwl_link_ctx_cfg_cmd::bss_color_disable
334  * @LINK_CONTEXT_MODIFY_EHT_PARAMS: covers iwl_link_ctx_cfg_cmd::puncture_mask.
335  *	This flag can be set only if the MAC that this link relates to has
336  *	eht_support set to true.
337  * @LINK_CONTEXT_MODIFY_ALL: set all above flags
338  */
339 enum iwl_link_ctx_modify_flags {
340 	LINK_CONTEXT_MODIFY_ACTIVE		= BIT(0),
341 	LINK_CONTEXT_MODIFY_RATES_INFO		= BIT(1),
342 	LINK_CONTEXT_MODIFY_PROTECT_FLAGS	= BIT(2),
343 	LINK_CONTEXT_MODIFY_QOS_PARAMS		= BIT(3),
344 	LINK_CONTEXT_MODIFY_BEACON_TIMING	= BIT(4),
345 	LINK_CONTEXT_MODIFY_HE_PARAMS		= BIT(5),
346 	LINK_CONTEXT_MODIFY_BSS_COLOR_DISABLE	= BIT(6),
347 	LINK_CONTEXT_MODIFY_EHT_PARAMS		= BIT(7),
348 	LINK_CONTEXT_MODIFY_ALL			= 0xff,
349 }; /* LINK_CONTEXT_MODIFY_MASK_E_VER_1 */
350 
351 /**
352  * enum iwl_link_ctx_protection_flags - link protection flags
353  * @LINK_PROT_FLG_TGG_PROTECT: 11g protection when transmitting OFDM frames,
354  *	this will require CCK RTS/CTS2self.
355  *	RTS/CTS will protect full burst time.
356  * @LINK_PROT_FLG_HT_PROT: enable HT protection
357  * @LINK_PROT_FLG_FAT_PROT: protect 40 MHz transmissions
358  * @LINK_PROT_FLG_SELF_CTS_EN: allow CTS2self
359  */
360 enum iwl_link_ctx_protection_flags {
361 	LINK_PROT_FLG_TGG_PROTECT	= BIT(0),
362 	LINK_PROT_FLG_HT_PROT		= BIT(1),
363 	LINK_PROT_FLG_FAT_PROT		= BIT(2),
364 	LINK_PROT_FLG_SELF_CTS_EN	= BIT(3),
365 }; /* LINK_PROTECT_FLAGS_E_VER_1 */
366 
367 /**
368  * enum iwl_link_ctx_flags - link context flags
369  *
370  * @LINK_FLG_BSS_COLOR_DIS: BSS color disable, don't use the BSS
371  *	color for RX filter but use MAC header
372  *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
373  * @LINK_FLG_MU_EDCA_CW: indicates that there is an element of MU EDCA
374  *	parameter set, i.e. the backoff counters for trig-based ACs
375  * @LINK_FLG_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
376  *      not allowed (as there are OBSS that might classify such transmissions as
377  *      radar pulses).
378  * @LINK_FLG_NDP_FEEDBACK_ENABLED: mark support for NDP feedback and change
379  *	of threshold
380  */
381 enum iwl_link_ctx_flags {
382 	LINK_FLG_BSS_COLOR_DIS		= BIT(0),
383 	LINK_FLG_MU_EDCA_CW		= BIT(1),
384 	LINK_FLG_RU_2MHZ_BLOCK		= BIT(2),
385 	LINK_FLG_NDP_FEEDBACK_ENABLED	= BIT(3),
386 }; /* LINK_CONTEXT_FLAG_E_VER_1 */
387 
388 /**
389  * struct iwl_link_config_cmd - command structure to configure the LINK context
390  *	in MLD API
391  * ( LINK_CONFIG_CMD =0x9 )
392  *
393  * @action: action to perform, one of FW_CTXT_ACTION_*
394  * @link_id: the id of the link that this cmd configures
395  * @mac_id: interface ID. Relevant only if action is FW_CTXT_ACTION_ADD
396  * @phy_id: PHY index. Can be changed only if the link was inactive
397  *	(and stays inactive). If the link is active (or becomes active),
398  *	this field is ignored.
399  * @local_link_addr: the links MAC address. Can be changed only if the link was
400  *	inactive (and stays inactive). If the link is active
401  *	(or becomes active), this field is ignored.
402  * @reserved_for_local_link_addr: reserved
403  * @modify_mask: from &enum iwl_link_ctx_modify_flags, selects what to change.
404  *	Relevant only if action is FW_CTXT_ACTION_MODIFY
405  * @active: indicates whether the link is active or not
406  * @listen_lmac: indicates whether the link should be allocated on the Listen
407  *	Lmac or on the Main Lmac. Cannot be changed on an active Link.
408  *	Relevant only for eSR.
409  * @cck_rates: basic rates available for CCK
410  * @ofdm_rates: basic rates available for OFDM
411  * @cck_short_preamble: 1 for enabling short preamble, 0 otherwise
412  * @short_slot: 1 for enabling short slots, 0 otherwise
413  * @protection_flags: combination of &enum iwl_link_ctx_protection_flags
414  * @qos_flags: from &enum iwl_mac_qos_flags
415  * @ac: one iwl_mac_qos configuration for each AC
416  * @htc_trig_based_pkt_ext: default PE in 4us units
417  * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1
418  * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1
419  * @ndp_fdbk_buff_th_exp: set exponent for the NDP feedback buffered threshold
420  * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues
421  * @bi: beacon interval in TU, applicable only when associated
422  * @dtim_interval: DTIM interval in TU.
423  *	Relevant only for GO, otherwise this is offloaded.
424  * @puncture_mask: puncture mask for EHT
425  * @frame_time_rts_th: HE duration RTS threshold, in units of 32us
426  * @flags: a combination from &enum iwl_link_ctx_flags
427  * @flags_mask: what of %flags have changed. Also &enum iwl_link_ctx_flags
428  * Below fields are for multi-bssid:
429  * @ref_bssid_addr: reference BSSID used by the AP
430  * @reserved_for_ref_bssid_addr: reserved
431  * @bssid_index: index of the associated VAP
432  * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
433  * @reserved: alignment
434  * @ibss_bssid_addr: bssid for ibss
435  * @reserved_for_ibss_bssid_addr: reserved
436  * @reserved1: reserved for future use
437  */
438 struct iwl_link_config_cmd {
439 	__le32 action;
440 	__le32 link_id;
441 	__le32 mac_id;
442 	__le32 phy_id;
443 	u8 local_link_addr[6];
444 	__le16 reserved_for_local_link_addr;
445 	__le32 modify_mask;
446 	__le32 active;
447 	__le32 listen_lmac;
448 	__le32 cck_rates;
449 	__le32 ofdm_rates;
450 	__le32 cck_short_preamble;
451 	__le32 short_slot;
452 	__le32 protection_flags;
453 	/* MAC_QOS_PARAM_API_S_VER_1 */
454 	__le32 qos_flags;
455 	struct iwl_ac_qos ac[AC_NUM + 1];
456 	u8 htc_trig_based_pkt_ext;
457 	u8 rand_alloc_ecwmin;
458 	u8 rand_alloc_ecwmax;
459 	u8 ndp_fdbk_buff_th_exp;
460 	struct iwl_he_backoff_conf trig_based_txf[AC_NUM];
461 	__le32 bi;
462 	__le32 dtim_interval;
463 	__le16 puncture_mask;
464 	__le16 frame_time_rts_th;
465 	__le32 flags;
466 	__le32 flags_mask;
467 	/* The below fields are for multi-bssid */
468 	u8 ref_bssid_addr[6];
469 	__le16 reserved_for_ref_bssid_addr;
470 	u8 bssid_index;
471 	u8 bss_color;
472 	u8 reserved[2];
473 	u8 ibss_bssid_addr[6];
474 	__le16 reserved_for_ibss_bssid_addr;
475 	__le32 reserved1[8];
476 } __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1 */
477 
478 /* Currently FW supports link ids in the range 0-3 and can have
479  * at most two active links for each vif.
480  */
481 #define IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM 2
482 #define IWL_MVM_FW_MAX_LINK_ID 3
483 
484 /**
485  * enum iwl_fw_sta_type - FW station types
486  * @STATION_TYPE_PEER: represents a peer - AP in BSS, a TDLS sta, a client in
487  *	P2P.
488  * @STATION_TYPE_BCAST_MGMT: The station used to send beacons and
489  *	probe responses. Also used for traffic injection in sniffer mode
490  * @STATION_TYPE_MCAST: the station used for BCAST / MCAST in GO. Will be
491  *	suspended / resumed at the right timing depending on the clients'
492  *	power save state and the DTIM timing
493  * @STATION_TYPE_AUX: aux sta. In the FW there is no need for a special type
494  *	for the aux sta, so this type is only for driver - internal use.
495  */
496 enum iwl_fw_sta_type {
497 	STATION_TYPE_PEER,
498 	STATION_TYPE_BCAST_MGMT,
499 	STATION_TYPE_MCAST,
500 	STATION_TYPE_AUX,
501 }; /* STATION_TYPE_E_VER_1 */
502 
503 /**
504  * struct iwl_mvm_sta_cfg_cmd - cmd structure to add a peer sta to the uCode's
505  *	station table
506  * ( STA_CONFIG_CMD = 0xA )
507  *
508  * @sta_id: index of station in uCode's station table
509  * @link_id: the id of the link that is used to communicate with this sta
510  * @peer_mld_address: the peers mld address
511  * @reserved_for_peer_mld_address: reserved
512  * @peer_link_address: the address of the link that is used to communicate
513  *	with this sta
514  * @reserved_for_peer_link_address: reserved
515  * @station_type: type of this station. See &enum iwl_fw_sta_type
516  * @assoc_id: for GO only
517  * @beamform_flags: beam forming controls
518  * @mfp: indicates whether the STA uses management frame protection or not.
519  * @mimo: indicates whether the sta uses mimo or not
520  * @mimo_protection: indicates whether the sta uses mimo protection or not
521  * @ack_enabled: indicates that the AP supports receiving ACK-
522  *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
523  * @trig_rnd_alloc: indicates that trigger based random allocation
524  *	is enabled according to UORA element existence
525  * @tx_ampdu_spacing: minimum A-MPDU spacing:
526  *	4 - 2us density, 5 - 4us density, 6 - 8us density, 7 - 16us density
527  * @tx_ampdu_max_size: maximum A-MPDU length: 0 - 8K, 1 - 16K, 2 - 32K,
528  *	3 - 64K, 4 - 128K, 5 - 256K, 6 - 512K, 7 - 1024K.
529  * @sp_length: the size of the SP in actual number of frames
530  * @uapsd_acs:  4 LS bits are trigger enabled ACs, 4 MS bits are the deliver
531  *	enabled ACs.
532  * @pkt_ext: optional, exists according to PPE-present bit in the HE/EHT-PHY
533  *	capa
534  * @htc_flags: which features are supported in HTC
535  */
536 struct iwl_mvm_sta_cfg_cmd {
537 	__le32 sta_id;
538 	__le32 link_id;
539 	u8 peer_mld_address[ETH_ALEN];
540 	__le16 reserved_for_peer_mld_address;
541 	u8 peer_link_address[ETH_ALEN];
542 	__le16 reserved_for_peer_link_address;
543 	__le32 station_type;
544 	__le32 assoc_id;
545 	__le32 beamform_flags;
546 	__le32 mfp;
547 	__le32 mimo;
548 	__le32 mimo_protection;
549 	__le32 ack_enabled;
550 	__le32 trig_rnd_alloc;
551 	__le32 tx_ampdu_spacing;
552 	__le32 tx_ampdu_max_size;
553 	__le32 sp_length;
554 	__le32 uapsd_acs;
555 	struct iwl_he_pkt_ext_v2 pkt_ext;
556 	__le32 htc_flags;
557 } __packed; /* STA_CMD_API_S_VER_1 */
558 
559 /**
560  * struct iwl_mvm_aux_sta_cmd - command for AUX STA configuration
561  * ( AUX_STA_CMD = 0xB )
562  *
563  * @sta_id: index of aux sta to configure
564  * @lmac_id: ?
565  * @mac_addr: mac addr of the auxilary sta
566  * @reserved_for_mac_addr: reserved
567  */
568 struct iwl_mvm_aux_sta_cmd {
569 	__le32 sta_id;
570 	__le32 lmac_id;
571 	u8 mac_addr[ETH_ALEN];
572 	__le16 reserved_for_mac_addr;
573 
574 } __packed; /* AUX_STA_CMD_API_S_VER_1 */
575 
576 /**
577  * struct iwl_mvm_remove_sta_cmd - a cmd structure to remove a sta added by
578  *	STA_CONFIG_CMD or AUX_STA_CONFIG_CMD
579  * ( STA_REMOVE_CMD = 0xC )
580  *
581  * @sta_id: index of station to remove
582  */
583 struct iwl_mvm_remove_sta_cmd {
584 	__le32 sta_id;
585 } __packed; /* REMOVE_STA_API_S_VER_1 */
586 
587 /**
588  * struct iwl_mvm_sta_disable_tx_cmd - disable / re-enable tx to a sta
589  * ( STA_DISABLE_TX_CMD = 0xD )
590  *
591  * @sta_id: index of the station to disable tx to
592  * @disable: indicates if to disable or re-enable tx
593  */
594 struct iwl_mvm_sta_disable_tx_cmd {
595 	__le32 sta_id;
596 	__le32 disable;
597 } __packed; /* STA_DISABLE_TX_API_S_VER_1 */
598 
599 #endif /* __iwl_fw_api_mac_cfg_h__ */
600