1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
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
7 #ifndef __iwl_fw_api_mac_cfg_h__
8 #define __iwl_fw_api_mac_cfg_h__
13 * enum iwl_mac_conf_subcmd_ids - mac configuration command IDs
15 enum iwl_mac_conf_subcmd_ids {
17 * @LOW_LATENCY_CMD: &struct iwl_mac_low_latency_cmd
19 LOW_LATENCY_CMD = 0x3,
21 * @CHANNEL_SWITCH_TIME_EVENT_CMD: &struct iwl_chan_switch_te_cmd
23 CHANNEL_SWITCH_TIME_EVENT_CMD = 0x4,
25 * @MISSED_VAP_NOTIF: &struct iwl_missed_vap_notif
27 MISSED_VAP_NOTIF = 0xFA,
29 * @SESSION_PROTECTION_CMD: &struct iwl_mvm_session_prot_cmd
31 SESSION_PROTECTION_CMD = 0x5,
33 * @CANCEL_CHANNEL_SWITCH_CMD: &struct iwl_cancel_channel_switch_cmd
35 CANCEL_CHANNEL_SWITCH_CMD = 0x6,
37 * @MAC_CONFIG_CMD: &struct iwl_mac_config_cmd
41 * @SESSION_PROTECTION_NOTIF: &struct iwl_mvm_session_prot_notif
43 SESSION_PROTECTION_NOTIF = 0xFB,
46 * @PROBE_RESPONSE_DATA_NOTIF: &struct iwl_probe_resp_data_notif
48 PROBE_RESPONSE_DATA_NOTIF = 0xFC,
51 * @CHANNEL_SWITCH_START_NOTIF: &struct iwl_channel_switch_start_notif
53 CHANNEL_SWITCH_START_NOTIF = 0xFF,
56 *@CHANNEL_SWITCH_ERROR_NOTIF: &struct iwl_channel_switch_error_notif
58 CHANNEL_SWITCH_ERROR_NOTIF = 0xF9,
61 #define IWL_P2P_NOA_DESC_COUNT (2)
64 * struct iwl_p2p_noa_attr - NOA attr contained in probe resp FW notification
67 * @len_low: length low half
68 * @len_high: length high half
69 * @idx: instance of NoA timing
70 * @ctwin: GO's ct window and pwer save capability
71 * @desc: NoA descriptor
72 * @reserved: reserved for alignment purposes
74 struct iwl_p2p_noa_attr {
80 struct ieee80211_p2p_noa_desc desc[IWL_P2P_NOA_DESC_COUNT];
84 #define IWL_PROBE_RESP_DATA_NO_CSA (0xff)
87 * struct iwl_probe_resp_data_notif - notification with NOA and CSA counter
89 * @mac_id: the mac which should send the probe response
90 * @noa_active: notifies if the noa attribute should be handled
91 * @noa_attr: P2P NOA attribute
92 * @csa_counter: current csa counter
93 * @reserved: reserved for alignment purposes
95 struct iwl_probe_resp_data_notif {
98 struct iwl_p2p_noa_attr noa_attr;
101 } __packed; /* PROBE_RESPONSE_DATA_NTFY_API_S_VER_1 */
104 * struct iwl_missed_vap_notif - notification of missing vap detection
106 * @mac_id: the mac for which the ucode sends the notification for
107 * @num_beacon_intervals_elapsed: beacons elpased with no vap profile inside
108 * @profile_periodicity: beacons period to have our profile inside
109 * @reserved: reserved for alignment purposes
111 struct iwl_missed_vap_notif {
113 u8 num_beacon_intervals_elapsed;
114 u8 profile_periodicity;
116 } __packed; /* MISSED_VAP_NTFY_API_S_VER_1 */
119 * struct iwl_channel_switch_start_notif - Channel switch start notification
121 * @id_and_color: ID and color of the MAC
123 struct iwl_channel_switch_start_notif {
125 } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
127 #define CS_ERR_COUNT_ERROR BIT(0)
128 #define CS_ERR_LONG_DELAY_AFTER_CS BIT(1)
129 #define CS_ERR_LONG_TX_BLOCK BIT(2)
130 #define CS_ERR_TX_BLOCK_TIMER_EXPIRED BIT(3)
133 * struct iwl_channel_switch_error_notif - Channel switch error notification
135 * @mac_id: the mac for which the ucode sends the notification for
136 * @csa_err_mask: mask of channel switch error that can occur
138 struct iwl_channel_switch_error_notif {
141 } __packed; /* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_1 */
144 * struct iwl_cancel_channel_switch_cmd - Cancel Channel Switch command
146 * @mac_id: the mac that should cancel the channel switch
148 struct iwl_cancel_channel_switch_cmd {
150 } __packed; /* MAC_CANCEL_CHANNEL_SWITCH_S_VER_1 */
153 * struct iwl_chan_switch_te_cmd - Channel Switch Time Event command
155 * @mac_id: MAC ID for channel switch
156 * @action: action to perform, one of FW_CTXT_ACTION_*
158 * @cs_count: channel switch count from CSA/eCSA IE
159 * @cs_delayed_bcn_count: if set to N (!= 0) GO/AP can delay N beacon intervals
160 * at the new channel after the channel switch, otherwise (N == 0) expect
161 * beacon right after the channel switch.
162 * @cs_mode: 1 - quiet, 0 - otherwise
163 * @reserved: reserved for alignment purposes
165 struct iwl_chan_switch_te_cmd {
170 u8 cs_delayed_bcn_count;
173 } __packed; /* MAC_CHANNEL_SWITCH_TIME_EVENT_S_VER_2 */
176 * struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode'
178 * @mac_id: MAC ID to whom to apply the low-latency configurations
179 * @low_latency_rx: 1/0 to set/clear Rx low latency direction
180 * @low_latency_tx: 1/0 to set/clear Tx low latency direction
181 * @reserved: reserved for alignment purposes
183 struct iwl_mac_low_latency_cmd {
188 } __packed; /* MAC_LOW_LATENCY_API_S_VER_1 */
191 * struct iwl_mac_client_data - configuration data for client MAC context
193 * @is_assoc: 1 for associated state, 0 otherwise
194 * @assoc_id: unique ID assigned by the AP during association
195 * @data_policy: see &enum iwl_mac_data_policy
196 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
197 * 0 indicates that there is no CT window.
199 struct iwl_mac_client_data {
204 } __packed; /* MAC_CONTEXT_CONFIG_CLIENT_DATA_API_S_VER_1 */
207 * struct iwl_mac_go_ibss_data - configuration data for GO and IBSS MAC context
209 * @beacon_template: beacon template ID
211 struct iwl_mac_go_ibss_data {
212 __le32 beacon_template;
213 } __packed; /* MAC_CONTEXT_CONFIG_GO_IBSS_DATA_API_S_VER_1 */
216 * struct iwl_mac_p2p_dev_data - configuration data for P2P device MAC context
218 * @is_disc_extended: if set to true, P2P Device discoverability is enabled on
219 * other channels as well. This should be to true only in case that the
220 * device is discoverable and there is an active GO. Note that setting this
221 * field when not needed, will increase the number of interrupts and have
222 * effect on the platform power, as this setting opens the Rx filters on
225 struct iwl_mac_p2p_dev_data {
226 __le32 is_disc_extended;
227 } __packed; /* MAC_CONTEXT_CONFIG_P2P_DEV_DATA_API_S_VER_1 */
230 * enum iwl_mac_config_filter_flags - MAC context configuration filter flags
232 * @MAC_CFG_FILTER_PROMISC: accept all data frames
233 * @MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT: pass all management and
234 * control frames to the host
235 * @MAC_CFG_FILTER_ACCEPT_GRP: accept multicast frames
236 * @MAC_CFG_FILTER_ACCEPT_BEACON: accept beacon frames
237 * @MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe response
238 * @MAC_CFG_FILTER_ACCEPT_PROBE_REQ: accept probe requests
240 enum iwl_mac_config_filter_flags {
241 MAC_CFG_FILTER_PROMISC = BIT(0),
242 MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT = BIT(1),
243 MAC_CFG_FILTER_ACCEPT_GRP = BIT(2),
244 MAC_CFG_FILTER_ACCEPT_BEACON = BIT(3),
245 MAC_CFG_FILTER_ACCEPT_BCAST_PROBE_RESP = BIT(4),
246 MAC_CFG_FILTER_ACCEPT_PROBE_REQ = BIT(5),
247 }; /* MAC_FILTER_FLAGS_MASK_E_VER_1 */
250 * struct iwl_mac_config_cmd - command structure to configure MAC contexts in
252 * ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
254 * @id_and_color: ID and color of the MAC
255 * @action: action to perform, one of FW_CTXT_ACTION_*
256 * @mac_type: one of &enum iwl_mac_types
257 * @local_mld_addr: mld address
258 * @reserved_for_local_mld_addr: reserved
259 * @filter_flags: combination of &enum iwl_mac_config_filter_flags
260 * @he_support: does this MAC support HE
261 * @eht_support: does this MAC support EHT. Requires he_support
262 * @nic_not_ack_enabled: mark that the NIC doesn't support receiving
263 * ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
264 * If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
265 * len delim to determine if AGG or single.
266 * @client: client mac data
267 * @go_ibss: mac data for go or ibss
268 * @p2p_dev: mac data for p2p device
270 struct iwl_mac_config_cmd {
271 /* COMMON_INDEX_HDR_API_S_VER_1 */
274 /* MAC_CONTEXT_TYPE_API_E */
276 u8 local_mld_addr[6];
277 __le16 reserved_for_local_mld_addr;
281 __le32 nic_not_ack_enabled;
282 /* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_1 */
284 struct iwl_mac_client_data client;
285 struct iwl_mac_go_ibss_data go_ibss;
286 struct iwl_mac_p2p_dev_data p2p_dev;
288 } __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_1 */
290 #endif /* __iwl_fw_api_mac_cfg_h__ */