18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
3*21fb8da6SAvraham Stern  * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
48e99ea8dSJohannes Berg  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
58e99ea8dSJohannes Berg  * Copyright (C) 2016-2017 Intel Deutschland GmbH
68e99ea8dSJohannes Berg  */
7d172a5efSJohannes Berg #ifndef __iwl_fw_api_datapath_h__
8d172a5efSJohannes Berg #define __iwl_fw_api_datapath_h__
9d172a5efSJohannes Berg 
10d172a5efSJohannes Berg /**
11d172a5efSJohannes Berg  * enum iwl_data_path_subcmd_ids - data path group commands
12d172a5efSJohannes Berg  */
13d172a5efSJohannes Berg enum iwl_data_path_subcmd_ids {
14d172a5efSJohannes Berg 	/**
15d172a5efSJohannes Berg 	 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
16d172a5efSJohannes Berg 	 */
17d172a5efSJohannes Berg 	DQA_ENABLE_CMD = 0x0,
18d172a5efSJohannes Berg 
19d172a5efSJohannes Berg 	/**
20d172a5efSJohannes Berg 	 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
21d172a5efSJohannes Berg 	 */
22d172a5efSJohannes Berg 	UPDATE_MU_GROUPS_CMD = 0x1,
23d172a5efSJohannes Berg 
24d172a5efSJohannes Berg 	/**
25d172a5efSJohannes Berg 	 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
26d172a5efSJohannes Berg 	 */
27d172a5efSJohannes Berg 	TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
28d172a5efSJohannes Berg 
29d172a5efSJohannes Berg 	/**
30*21fb8da6SAvraham Stern 	 * @WNM_PLATFORM_PTM_REQUEST_CMD: &struct iwl_time_sync_cfg_cmd
31*21fb8da6SAvraham Stern 	 */
32*21fb8da6SAvraham Stern 	WNM_PLATFORM_PTM_REQUEST_CMD = 0x3,
33*21fb8da6SAvraham Stern 
34*21fb8da6SAvraham Stern 	/**
358a6171a7SLuca Coelho 	 * @STA_HE_CTXT_CMD: &struct iwl_he_sta_context_cmd
368a6171a7SLuca Coelho 	 */
378a6171a7SLuca Coelho 	STA_HE_CTXT_CMD = 0x7,
388a6171a7SLuca Coelho 
398a6171a7SLuca Coelho 	/**
40c48e93a6SJohannes Berg 	 * @RLC_CONFIG_CMD: &struct iwl_rlc_config_cmd
41c48e93a6SJohannes Berg 	 */
42c48e93a6SJohannes Berg 	RLC_CONFIG_CMD = 0x8,
43c48e93a6SJohannes Berg 
44c48e93a6SJohannes Berg 	/**
458edbfaa1SSara Sharon 	 * @RFH_QUEUE_CONFIG_CMD: &struct iwl_rfh_queue_config
468edbfaa1SSara Sharon 	 */
478edbfaa1SSara Sharon 	RFH_QUEUE_CONFIG_CMD = 0xD,
488edbfaa1SSara Sharon 
498edbfaa1SSara Sharon 	/**
50e4b89fceSAbhishek Naik 	 * @TLC_MNG_CONFIG_CMD: &struct iwl_tlc_config_cmd_v4
51110b32f0SGregory Greenman 	 */
52110b32f0SGregory Greenman 	TLC_MNG_CONFIG_CMD = 0xF,
53110b32f0SGregory Greenman 
54110b32f0SGregory Greenman 	/**
5598920961SShaul Triebitz 	 * @HE_AIR_SNIFFER_CONFIG_CMD: &struct iwl_he_monitor_cmd
5698920961SShaul Triebitz 	 */
5798920961SShaul Triebitz 	HE_AIR_SNIFFER_CONFIG_CMD = 0x13,
5898920961SShaul Triebitz 
5998920961SShaul Triebitz 	/**
605213e8a8SJohannes Berg 	 * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI
615213e8a8SJohannes Berg 	 *	matrix collection, uses &struct iwl_channel_estimation_cfg
625213e8a8SJohannes Berg 	 */
635213e8a8SJohannes Berg 	CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14,
645213e8a8SJohannes Berg 
655213e8a8SJohannes Berg 	/**
6697f70c56SJohannes Berg 	 * @RX_BAID_ALLOCATION_CONFIG_CMD: Allocate/deallocate a BAID for an RX
6797f70c56SJohannes Berg 	 *	blockack session, uses &struct iwl_rx_baid_cfg_cmd for the
6897f70c56SJohannes Berg 	 *	command, and &struct iwl_rx_baid_cfg_resp as a response.
6997f70c56SJohannes Berg 	 */
7097f70c56SJohannes Berg 	RX_BAID_ALLOCATION_CONFIG_CMD = 0x16,
7197f70c56SJohannes Berg 
7297f70c56SJohannes Berg 	/**
73227f2597SJohannes Berg 	 * @SCD_QUEUE_CONFIG_CMD: new scheduler queue allocation/config/removal
74227f2597SJohannes Berg 	 *	command, uses &struct iwl_scd_queue_cfg_cmd and the response
75227f2597SJohannes Berg 	 *	is (same as before) &struct iwl_tx_queue_cfg_rsp.
76227f2597SJohannes Berg 	 */
77227f2597SJohannes Berg 	SCD_QUEUE_CONFIG_CMD = 0x17,
78227f2597SJohannes Berg 
79227f2597SJohannes Berg 	/**
805c75a208SJohannes Berg 	 * @SEC_KEY_CMD: security key command, uses &struct iwl_sec_key_cmd
815c75a208SJohannes Berg 	 */
825c75a208SJohannes Berg 	SEC_KEY_CMD = 0x18,
835c75a208SJohannes Berg 
845c75a208SJohannes Berg 	/**
85f7d6ef33SJohannes Berg 	 * @MONITOR_NOTIF: Datapath monitoring notification, using
86f7d6ef33SJohannes Berg 	 *	&struct iwl_datapath_monitor_notif
87f7d6ef33SJohannes Berg 	 */
88f7d6ef33SJohannes Berg 	MONITOR_NOTIF = 0xF4,
89f7d6ef33SJohannes Berg 
90f7d6ef33SJohannes Berg 	/**
918dd51b5fSMordechay Goodstein 	 * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data or &struct iwl_rx_no_data_ver_3
92bf9dfedaSShaul Triebitz 	 */
93bf9dfedaSShaul Triebitz 	RX_NO_DATA_NOTIF = 0xF5,
94bf9dfedaSShaul Triebitz 
95bf9dfedaSShaul Triebitz 	/**
962a7ce54cSJohannes Berg 	 * @THERMAL_DUAL_CHAIN_DISABLE_REQ: firmware request for SMPS mode,
972a7ce54cSJohannes Berg 	 *	&struct iwl_thermal_dual_chain_request
982a7ce54cSJohannes Berg 	 */
992a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQUEST = 0xF6,
1002a7ce54cSJohannes Berg 
1012a7ce54cSJohannes Berg 	/**
10246d372afSGregory Greenman 	 * @TLC_MNG_UPDATE_NOTIF: &struct iwl_tlc_update_notif
10346d372afSGregory Greenman 	 */
10446d372afSGregory Greenman 	TLC_MNG_UPDATE_NOTIF = 0xF7,
10546d372afSGregory Greenman 
10646d372afSGregory Greenman 	/**
107d172a5efSJohannes Berg 	 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
108d172a5efSJohannes Berg 	 */
109d172a5efSJohannes Berg 	STA_PM_NOTIF = 0xFD,
110d172a5efSJohannes Berg 
111d172a5efSJohannes Berg 	/**
112d172a5efSJohannes Berg 	 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
113d172a5efSJohannes Berg 	 */
114d172a5efSJohannes Berg 	MU_GROUP_MGMT_NOTIF = 0xFE,
115d172a5efSJohannes Berg 
116d172a5efSJohannes Berg 	/**
117d172a5efSJohannes Berg 	 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
118d172a5efSJohannes Berg 	 */
119d172a5efSJohannes Berg 	RX_QUEUES_NOTIFICATION = 0xFF,
120d172a5efSJohannes Berg };
121d172a5efSJohannes Berg 
122d172a5efSJohannes Berg /**
123d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
124d172a5efSJohannes Berg  *
125d172a5efSJohannes Berg  * @reserved: reserved
126d172a5efSJohannes Berg  * @membership_status: a bitmap of MU groups
127d172a5efSJohannes Berg  * @user_position:the position of station in a group. If the station is in the
128d172a5efSJohannes Berg  *	group then bits (group * 2) is the position -1
129d172a5efSJohannes Berg  */
130d172a5efSJohannes Berg struct iwl_mu_group_mgmt_cmd {
131d172a5efSJohannes Berg 	__le32 reserved;
132d172a5efSJohannes Berg 	__le32 membership_status[2];
133d172a5efSJohannes Berg 	__le32 user_position[4];
134d172a5efSJohannes Berg } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
135d172a5efSJohannes Berg 
136d172a5efSJohannes Berg /**
137d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
138d172a5efSJohannes Berg  *
139d172a5efSJohannes Berg  * @membership_status: a bitmap of MU groups
140d172a5efSJohannes Berg  * @user_position: the position of station in a group. If the station is in the
141d172a5efSJohannes Berg  *	group then bits (group * 2) is the position -1
142d172a5efSJohannes Berg  */
143d172a5efSJohannes Berg struct iwl_mu_group_mgmt_notif {
144d172a5efSJohannes Berg 	__le32 membership_status[2];
145d172a5efSJohannes Berg 	__le32 user_position[4];
146d172a5efSJohannes Berg } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
147d172a5efSJohannes Berg 
1485213e8a8SJohannes Berg enum iwl_channel_estimation_flags {
1495213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_ENABLE	= BIT(0),
1505213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_TIMER	= BIT(1),
1515213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_COUNTER	= BIT(2),
1525213e8a8SJohannes Berg };
1535213e8a8SJohannes Berg 
1545213e8a8SJohannes Berg /**
155*21fb8da6SAvraham Stern  * enum iwl_synced_time_operation - PTM request options
156*21fb8da6SAvraham Stern  *
157*21fb8da6SAvraham Stern  * @IWL_SYNCED_TIME_OPERATION_READ_ARTB: read only the ARTB time
158*21fb8da6SAvraham Stern  * @IWL_SYNCED_TIME_OPERATION_READ_GP2: read only the GP2 time
159*21fb8da6SAvraham Stern  * @IWL_SYNCED_TIME_OPERATION_READ_BOTH: latch the ARTB and GP2 clocks and
160*21fb8da6SAvraham Stern  *	provide timestamps from both clocks for the same time point
161*21fb8da6SAvraham Stern  */
162*21fb8da6SAvraham Stern enum iwl_synced_time_operation {
163*21fb8da6SAvraham Stern 	IWL_SYNCED_TIME_OPERATION_READ_ARTB = 1,
164*21fb8da6SAvraham Stern 	IWL_SYNCED_TIME_OPERATION_READ_GP2,
165*21fb8da6SAvraham Stern 	IWL_SYNCED_TIME_OPERATION_READ_BOTH,
166*21fb8da6SAvraham Stern };
167*21fb8da6SAvraham Stern 
168*21fb8da6SAvraham Stern /**
169*21fb8da6SAvraham Stern  * struct iwl_synced_time_cmd - request synced GP2/ARTB timestamps
170*21fb8da6SAvraham Stern  *
171*21fb8da6SAvraham Stern  * @operation: one of &enum iwl_synced_time_operation
172*21fb8da6SAvraham Stern  */
173*21fb8da6SAvraham Stern struct iwl_synced_time_cmd {
174*21fb8da6SAvraham Stern 	__le32 operation;
175*21fb8da6SAvraham Stern } __packed; /* WNM_80211V_TIMING_CMD_API_S_VER_1 */
176*21fb8da6SAvraham Stern 
177*21fb8da6SAvraham Stern /**
178*21fb8da6SAvraham Stern  * struct iwl_synced_time_rsp - response to iwl_synced_time_cmd
179*21fb8da6SAvraham Stern  *
180*21fb8da6SAvraham Stern  * @operation: one of &enum iwl_synced_time_operation
181*21fb8da6SAvraham Stern  * @platform_timestamp_hi: high DWORD of the ARTB clock timestamp in nanoseconds
182*21fb8da6SAvraham Stern  * @platform_timestamp_lo: low DWORD of the ARTB clock timestamp in nanoseconds
183*21fb8da6SAvraham Stern  * @gp2_timestamp_hi: high DWORD of the GP2 clock timestamp in 10's of
184*21fb8da6SAvraham Stern  *	nanoseconds
185*21fb8da6SAvraham Stern  * @gp2_timestamp_lo: low DWORD of the GP2 clock timestamp in 10's of
186*21fb8da6SAvraham Stern  *	nanoseconds
187*21fb8da6SAvraham Stern  */
188*21fb8da6SAvraham Stern struct iwl_synced_time_rsp {
189*21fb8da6SAvraham Stern 	__le32 operation;
190*21fb8da6SAvraham Stern 	__le32 platform_timestamp_hi;
191*21fb8da6SAvraham Stern 	__le32 platform_timestamp_lo;
192*21fb8da6SAvraham Stern 	__le32 gp2_timestamp_hi;
193*21fb8da6SAvraham Stern 	__le32 gp2_timestamp_lo;
194*21fb8da6SAvraham Stern } __packed; /* WNM_80211V_TIMING_RSP_API_S_VER_1 */
195*21fb8da6SAvraham Stern 
196*21fb8da6SAvraham Stern /**
1975213e8a8SJohannes Berg  * struct iwl_channel_estimation_cfg - channel estimation reporting config
1985213e8a8SJohannes Berg  */
1995213e8a8SJohannes Berg struct iwl_channel_estimation_cfg {
2005213e8a8SJohannes Berg 	/**
2015213e8a8SJohannes Berg 	 * @flags: flags, see &enum iwl_channel_estimation_flags
2025213e8a8SJohannes Berg 	 */
2035213e8a8SJohannes Berg 	__le32 flags;
2045213e8a8SJohannes Berg 	/**
2055213e8a8SJohannes Berg 	 * @timer: if enabled via flags, automatically disable after this many
2065213e8a8SJohannes Berg 	 *	microseconds
2075213e8a8SJohannes Berg 	 */
2085213e8a8SJohannes Berg 	__le32 timer;
2095213e8a8SJohannes Berg 	/**
2105213e8a8SJohannes Berg 	 * @count: if enabled via flags, automatically disable after this many
2115213e8a8SJohannes Berg 	 *	frames with channel estimation matrix were captured
2125213e8a8SJohannes Berg 	 */
2135213e8a8SJohannes Berg 	__le32 count;
2145213e8a8SJohannes Berg 	/**
2155213e8a8SJohannes Berg 	 * @rate_n_flags_mask: only try to record the channel estimation matrix
2165213e8a8SJohannes Berg 	 *	if the rate_n_flags value for the received frame (let's call
2175213e8a8SJohannes Berg 	 *	that rx_rnf) matches the mask/value given here like this:
2185213e8a8SJohannes Berg 	 *	(rx_rnf & rate_n_flags_mask) == rate_n_flags_val.
2195213e8a8SJohannes Berg 	 */
2205213e8a8SJohannes Berg 	__le32 rate_n_flags_mask;
2215213e8a8SJohannes Berg 	/**
2225213e8a8SJohannes Berg 	 * @rate_n_flags_val: see @rate_n_flags_mask
2235213e8a8SJohannes Berg 	 */
2245213e8a8SJohannes Berg 	__le32 rate_n_flags_val;
2255213e8a8SJohannes Berg 	/**
2265213e8a8SJohannes Berg 	 * @reserved: reserved (for alignment)
2275213e8a8SJohannes Berg 	 */
2285213e8a8SJohannes Berg 	__le32 reserved;
2295213e8a8SJohannes Berg 	/**
2305213e8a8SJohannes Berg 	 * @frame_types: bitmap of frame types to capture, the received frame's
2315213e8a8SJohannes Berg 	 *	subtype|type takes 6 bits in the frame and the corresponding bit
2325213e8a8SJohannes Berg 	 *	in this field must be set to 1 to capture channel estimation for
2335213e8a8SJohannes Berg 	 *	that frame type. Set to all-ones to enable capturing for all
2345213e8a8SJohannes Berg 	 *	frame types.
2355213e8a8SJohannes Berg 	 */
2365213e8a8SJohannes Berg 	__le64 frame_types;
2375213e8a8SJohannes Berg } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */
2385213e8a8SJohannes Berg 
239f7d6ef33SJohannes Berg enum iwl_datapath_monitor_notif_type {
240f7d6ef33SJohannes Berg 	IWL_DP_MON_NOTIF_TYPE_EXT_CCA,
241f7d6ef33SJohannes Berg };
242f7d6ef33SJohannes Berg 
243f7d6ef33SJohannes Berg struct iwl_datapath_monitor_notif {
244f7d6ef33SJohannes Berg 	__le32 type;
245f7d6ef33SJohannes Berg 	u8 mac_id;
246f7d6ef33SJohannes Berg 	u8 reserved[3];
247f7d6ef33SJohannes Berg } __packed; /* MONITOR_NTF_API_S_VER_1 */
248f7d6ef33SJohannes Berg 
2492a7ce54cSJohannes Berg /**
2502a7ce54cSJohannes Berg  * enum iwl_thermal_dual_chain_req_events - firmware SMPS request event
2512a7ce54cSJohannes Berg  * @THERMAL_DUAL_CHAIN_REQ_ENABLE: (re-)enable dual-chain operation
2522a7ce54cSJohannes Berg  *	(subject to other constraints)
2532a7ce54cSJohannes Berg  * @THERMAL_DUAL_CHAIN_REQ_DISABLE: disable dual-chain operation
2542a7ce54cSJohannes Berg  *	(static SMPS)
2552a7ce54cSJohannes Berg  */
2562a7ce54cSJohannes Berg enum iwl_thermal_dual_chain_req_events {
2572a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQ_ENABLE,
2582a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQ_DISABLE,
2592a7ce54cSJohannes Berg }; /* THERMAL_DUAL_CHAIN_DISABLE_STATE_API_E_VER_1 */
2602a7ce54cSJohannes Berg 
2612a7ce54cSJohannes Berg /**
2622a7ce54cSJohannes Berg  * struct iwl_thermal_dual_chain_request - SMPS request
2632a7ce54cSJohannes Berg  * @event: the type of request, see &enum iwl_thermal_dual_chain_req_events
2642a7ce54cSJohannes Berg  */
2652a7ce54cSJohannes Berg struct iwl_thermal_dual_chain_request {
2662a7ce54cSJohannes Berg 	__le32 event;
2672a7ce54cSJohannes Berg } __packed; /* THERMAL_DUAL_CHAIN_DISABLE_REQ_NTFY_API_S_VER_1 */
2682a7ce54cSJohannes Berg 
269c48e93a6SJohannes Berg enum iwl_rlc_chain_info {
270c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_DRIVER_FORCE		= BIT(0),
271c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_VALID		= 0x000e,
272c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_FORCE		= 0x0070,
273c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_FORCE_MIMO		= 0x0380,
274c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_COUNT		= 0x0c00,
275c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_MIMO_COUNT		= 0x3000,
276c48e93a6SJohannes Berg };
277c48e93a6SJohannes Berg 
278c48e93a6SJohannes Berg /**
279c48e93a6SJohannes Berg  * struct iwl_rlc_properties - RLC properties
280c48e93a6SJohannes Berg  * @rx_chain_info: RX chain info, &enum iwl_rlc_chain_info
281c48e93a6SJohannes Berg  * @reserved: reserved
282c48e93a6SJohannes Berg  */
283c48e93a6SJohannes Berg struct iwl_rlc_properties {
284c48e93a6SJohannes Berg 	__le32 rx_chain_info;
285c48e93a6SJohannes Berg 	__le32 reserved;
286c48e93a6SJohannes Berg } __packed; /* RLC_PROPERTIES_S_VER_1 */
287c48e93a6SJohannes Berg 
288c48e93a6SJohannes Berg enum iwl_sad_mode {
289c48e93a6SJohannes Berg 	IWL_SAD_MODE_ENABLED		= BIT(0),
290c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_MSK	= 0x6,
291c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_FW	= 0x0,
292c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_A	= 0x2,
293c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_B	= 0x4,
294c48e93a6SJohannes Berg };
295c48e93a6SJohannes Berg 
296c48e93a6SJohannes Berg /**
297c48e93a6SJohannes Berg  * struct iwl_sad_properties - SAD properties
298c48e93a6SJohannes Berg  * @chain_a_sad_mode: chain A SAD mode, &enum iwl_sad_mode
299c48e93a6SJohannes Berg  * @chain_b_sad_mode: chain B SAD mode, &enum iwl_sad_mode
300c48e93a6SJohannes Berg  * @mac_id: MAC index
301c48e93a6SJohannes Berg  * @reserved: reserved
302c48e93a6SJohannes Berg  */
303c48e93a6SJohannes Berg struct iwl_sad_properties {
304c48e93a6SJohannes Berg 	__le32 chain_a_sad_mode;
305c48e93a6SJohannes Berg 	__le32 chain_b_sad_mode;
306c48e93a6SJohannes Berg 	__le32 mac_id;
307c48e93a6SJohannes Berg 	__le32 reserved;
308c48e93a6SJohannes Berg } __packed;
309c48e93a6SJohannes Berg 
310c48e93a6SJohannes Berg /**
311c48e93a6SJohannes Berg  * struct iwl_rlc_config_cmd - RLC configuration
312c48e93a6SJohannes Berg  * @phy_id: PHY index
313c48e93a6SJohannes Berg  * @rlc: RLC properties, &struct iwl_rlc_properties
314c48e93a6SJohannes Berg  * @sad: SAD (single antenna diversity) options, &struct iwl_sad_properties
315c48e93a6SJohannes Berg  * @flags: flags, &enum iwl_rlc_flags
316c48e93a6SJohannes Berg  * @reserved: reserved
317c48e93a6SJohannes Berg  */
318c48e93a6SJohannes Berg struct iwl_rlc_config_cmd {
319c48e93a6SJohannes Berg 	__le32 phy_id;
320c48e93a6SJohannes Berg 	struct iwl_rlc_properties rlc;
321c48e93a6SJohannes Berg 	struct iwl_sad_properties sad;
322c48e93a6SJohannes Berg 	u8 flags;
323c48e93a6SJohannes Berg 	u8 reserved[3];
324c48e93a6SJohannes Berg } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */
325c48e93a6SJohannes Berg 
326ded5ded3SEmmanuel Grumbach #define IWL_MAX_BAID_OLD	16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */
327ded5ded3SEmmanuel Grumbach #define IWL_MAX_BAID		32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */
328ded5ded3SEmmanuel Grumbach 
32997f70c56SJohannes Berg /**
33097f70c56SJohannes Berg  * enum iwl_rx_baid_action - BAID allocation/config action
33197f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_ADD: add a new BAID session
33297f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_MODIFY: modify the BAID session
33397f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_REMOVE: remove the BAID session
33497f70c56SJohannes Berg  */
33597f70c56SJohannes Berg enum iwl_rx_baid_action {
33697f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_ADD,
33797f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_MODIFY,
33897f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_REMOVE,
33997f70c56SJohannes Berg }; /*  RX_BAID_ALLOCATION_ACTION_E_VER_1 */
34097f70c56SJohannes Berg 
34197f70c56SJohannes Berg /**
34297f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_alloc - BAID allocation data
34397f70c56SJohannes Berg  * @sta_id_mask: station ID mask
34497f70c56SJohannes Berg  * @tid: the TID for this session
34597f70c56SJohannes Berg  * @reserved: reserved
34697f70c56SJohannes Berg  * @ssn: the starting sequence number
34797f70c56SJohannes Berg  * @win_size: RX BA session window size
34897f70c56SJohannes Berg  */
34997f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_alloc {
35097f70c56SJohannes Berg 	__le32 sta_id_mask;
35197f70c56SJohannes Berg 	u8 tid;
35297f70c56SJohannes Berg 	u8 reserved[3];
35397f70c56SJohannes Berg 	__le16 ssn;
35497f70c56SJohannes Berg 	__le16 win_size;
35597f70c56SJohannes Berg } __packed; /* RX_BAID_ALLOCATION_ADD_CMD_API_S_VER_1 */
35697f70c56SJohannes Berg 
35797f70c56SJohannes Berg /**
35897f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_modify - BAID modification data
35926de4c8bSJohannes Berg  * @old_sta_id_mask: old station ID mask
36026de4c8bSJohannes Berg  * @new_sta_id_mask: new station ID mask
36126de4c8bSJohannes Berg  * @tid: TID of the BAID
36297f70c56SJohannes Berg  */
36397f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_modify {
36426de4c8bSJohannes Berg 	__le32 old_sta_id_mask;
36526de4c8bSJohannes Berg 	__le32 new_sta_id_mask;
36626de4c8bSJohannes Berg 	__le32 tid;
36726de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_MODIFY_CMD_API_S_VER_2 */
36826de4c8bSJohannes Berg 
36926de4c8bSJohannes Berg /**
37026de4c8bSJohannes Berg  * struct iwl_rx_baid_cfg_cmd_remove_v1 - BAID removal data
37126de4c8bSJohannes Berg  * @baid: the BAID to remove
37226de4c8bSJohannes Berg  */
37326de4c8bSJohannes Berg struct iwl_rx_baid_cfg_cmd_remove_v1 {
37497f70c56SJohannes Berg 	__le32 baid;
37526de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_1 */
37697f70c56SJohannes Berg 
37797f70c56SJohannes Berg /**
37897f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_remove - BAID removal data
37926de4c8bSJohannes Berg  * @sta_id_mask: the station mask of the BAID to remove
38026de4c8bSJohannes Berg  * @tid: the TID of the BAID to remove
38197f70c56SJohannes Berg  */
38297f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_remove {
38326de4c8bSJohannes Berg 	__le32 sta_id_mask;
38426de4c8bSJohannes Berg 	__le32 tid;
38526de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_2 */
38697f70c56SJohannes Berg 
38797f70c56SJohannes Berg /**
38897f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd - BAID allocation/config command
38997f70c56SJohannes Berg  * @action: the action, from &enum iwl_rx_baid_action
39097f70c56SJohannes Berg  */
39197f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd {
39297f70c56SJohannes Berg 	__le32 action;
39397f70c56SJohannes Berg 	union {
39497f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_alloc alloc;
39597f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_modify modify;
39626de4c8bSJohannes Berg 		struct iwl_rx_baid_cfg_cmd_remove_v1 remove_v1;
39797f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_remove remove;
39826de4c8bSJohannes Berg 	}; /* RX_BAID_ALLOCATION_OPERATION_API_U_VER_2 */
39926de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_CONFIG_CMD_API_S_VER_2 */
40097f70c56SJohannes Berg 
40197f70c56SJohannes Berg /**
40297f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_resp - BAID allocation response
40397f70c56SJohannes Berg  * @baid: the allocated BAID
40497f70c56SJohannes Berg  */
40597f70c56SJohannes Berg struct iwl_rx_baid_cfg_resp {
40697f70c56SJohannes Berg 	__le32 baid;
40797f70c56SJohannes Berg }; /* RX_BAID_ALLOCATION_RESPONSE_API_S_VER_1 */
40897f70c56SJohannes Berg 
409227f2597SJohannes Berg /**
410227f2597SJohannes Berg  * enum iwl_scd_queue_cfg_operation - scheduler queue operation
411227f2597SJohannes Berg  * @IWL_SCD_QUEUE_ADD: allocate a new queue
412227f2597SJohannes Berg  * @IWL_SCD_QUEUE_REMOVE: remove a queue
413227f2597SJohannes Berg  * @IWL_SCD_QUEUE_MODIFY: modify a queue
414227f2597SJohannes Berg  */
415227f2597SJohannes Berg enum iwl_scd_queue_cfg_operation {
416227f2597SJohannes Berg 	IWL_SCD_QUEUE_ADD = 0,
417227f2597SJohannes Berg 	IWL_SCD_QUEUE_REMOVE = 1,
418227f2597SJohannes Berg 	IWL_SCD_QUEUE_MODIFY = 2,
419227f2597SJohannes Berg };
420227f2597SJohannes Berg 
421227f2597SJohannes Berg /**
422227f2597SJohannes Berg  * struct iwl_scd_queue_cfg_cmd - scheduler queue allocation command
423227f2597SJohannes Berg  * @operation: the operation, see &enum iwl_scd_queue_cfg_operation
424227f2597SJohannes Berg  * @u.add.sta_mask: station mask
425227f2597SJohannes Berg  * @u.add.tid: TID
426227f2597SJohannes Berg  * @u.add.reserved: reserved
427227f2597SJohannes Berg  * @u.add.flags: flags from &enum iwl_tx_queue_cfg_actions, except
428227f2597SJohannes Berg  *	%TX_QUEUE_CFG_ENABLE_QUEUE is not valid
429227f2597SJohannes Berg  * @u.add.cb_size: size code
430227f2597SJohannes Berg  * @u.add.bc_dram_addr: byte-count table IOVA
431227f2597SJohannes Berg  * @u.add.tfdq_dram_addr: TFD queue IOVA
432c5a976cfSJohannes Berg  * @u.remove.sta_mask: station mask of queue to remove
433c5a976cfSJohannes Berg  * @u.remove.tid: TID of queue to remove
434c5a976cfSJohannes Berg  * @u.modify.old_sta_mask: old station mask for modify
435c5a976cfSJohannes Berg  * @u.modify.tid: TID of queue to modify
436c5a976cfSJohannes Berg  * @u.modify.new_sta_mask: new station mask for modify
437227f2597SJohannes Berg  */
438227f2597SJohannes Berg struct iwl_scd_queue_cfg_cmd {
439227f2597SJohannes Berg 	__le32 operation;
440227f2597SJohannes Berg 	union {
441227f2597SJohannes Berg 		struct {
442227f2597SJohannes Berg 			__le32 sta_mask;
443227f2597SJohannes Berg 			u8 tid;
444227f2597SJohannes Berg 			u8 reserved[3];
445227f2597SJohannes Berg 			__le32 flags;
446227f2597SJohannes Berg 			__le32 cb_size;
447227f2597SJohannes Berg 			__le64 bc_dram_addr;
448227f2597SJohannes Berg 			__le64 tfdq_dram_addr;
449227f2597SJohannes Berg 		} __packed add; /* TX_QUEUE_CFG_CMD_ADD_API_S_VER_1 */
450227f2597SJohannes Berg 		struct {
451c5a976cfSJohannes Berg 			__le32 sta_mask;
452c5a976cfSJohannes Berg 			__le32 tid;
453227f2597SJohannes Berg 		} __packed remove; /* TX_QUEUE_CFG_CMD_REMOVE_API_S_VER_1 */
454227f2597SJohannes Berg 		struct {
455c5a976cfSJohannes Berg 			__le32 old_sta_mask;
456c5a976cfSJohannes Berg 			__le32 tid;
457c5a976cfSJohannes Berg 			__le32 new_sta_mask;
458227f2597SJohannes Berg 		} __packed modify; /* TX_QUEUE_CFG_CMD_MODIFY_API_S_VER_1 */
459227f2597SJohannes Berg 	} __packed u; /* TX_QUEUE_CFG_CMD_OPERATION_API_U_VER_1 */
460227f2597SJohannes Berg } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_3 */
461227f2597SJohannes Berg 
4625c75a208SJohannes Berg /**
4635c75a208SJohannes Berg  * enum iwl_sec_key_flags - security key command key flags
4645c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_MASK: cipher mask
4655c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_WEP: WEP cipher
4665c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_CCMP: CCMP/CMAC cipher
4675c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_TKIP: TKIP cipher
4685c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_GCMP: GCMP/GMAC cipher
4695c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_NO_TX: don't install for TX
4705c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_KEY_SIZE: large key size (WEP-104, GCMP-256, GMAC-256)
4715c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_MFP: MFP is in used for this key
4725c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_MCAST_KEY: this is a multicast key
4735c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_SPP_AMSDU: SPP A-MSDU should be used
4745c75a208SJohannes Berg  */
4755c75a208SJohannes Berg enum iwl_sec_key_flags {
4765c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_MASK	= 0x07,
4775c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_WEP	= 0x01,
4785c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_CCMP	= 0x02,
4795c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_TKIP	= 0x03,
4805c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_GCMP	= 0x05,
4815c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_NO_TX		= 0x08,
4825c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_KEY_SIZE	= 0x10,
4835c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_MFP		= 0x20,
4845c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_MCAST_KEY	= 0x40,
4855c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_SPP_AMSDU	= 0x80,
4865c75a208SJohannes Berg };
4875c75a208SJohannes Berg 
4885c75a208SJohannes Berg #define IWL_SEC_WEP_KEY_OFFSET	3
4895c75a208SJohannes Berg 
4905c75a208SJohannes Berg /**
4915c75a208SJohannes Berg  * struct iwl_sec_key_cmd - security key command
4925c75a208SJohannes Berg  * @action: action from &enum iwl_ctxt_action
4935c75a208SJohannes Berg  * @u.add.sta_mask: station mask for the new key
4945c75a208SJohannes Berg  * @u.add.key_id: key ID (0-7) for the new key
4955c75a208SJohannes Berg  * @u.add.key_flags: key flags per &enum iwl_sec_key_flags
4965c75a208SJohannes Berg  * @u.add.key: key material. WEP keys should start from &IWL_SEC_WEP_KEY_OFFSET.
4975c75a208SJohannes Berg  * @u.add.tkip_mic_rx_key: TKIP MIC RX key
4985c75a208SJohannes Berg  * @u.add.tkip_mic_tx_key: TKIP MIC TX key
4995c75a208SJohannes Berg  * @u.add.rx_seq: RX sequence counter value
5005c75a208SJohannes Berg  * @u.add.tx_seq: TX sequence counter value
5015c75a208SJohannes Berg  * @u.modify.old_sta_mask: old station mask
5025c75a208SJohannes Berg  * @u.modify.new_sta_mask: new station mask
5035c75a208SJohannes Berg  * @u.modify.key_id: key ID
5045c75a208SJohannes Berg  * @u.modify.key_flags: new key flags
5055c75a208SJohannes Berg  * @u.remove.sta_mask: station mask
5065c75a208SJohannes Berg  * @u.remove.key_id: key ID
5075c75a208SJohannes Berg  * @u.remove.key_flags: key flags
5085c75a208SJohannes Berg  */
5095c75a208SJohannes Berg struct iwl_sec_key_cmd {
5105c75a208SJohannes Berg 	__le32 action;
5115c75a208SJohannes Berg 	union {
5125c75a208SJohannes Berg 		struct {
5135c75a208SJohannes Berg 			__le32 sta_mask;
5145c75a208SJohannes Berg 			__le32 key_id;
5155c75a208SJohannes Berg 			__le32 key_flags;
5165c75a208SJohannes Berg 			u8 key[32];
5175c75a208SJohannes Berg 			u8 tkip_mic_rx_key[8];
5185c75a208SJohannes Berg 			u8 tkip_mic_tx_key[8];
5195c75a208SJohannes Berg 			__le64 rx_seq;
5205c75a208SJohannes Berg 			__le64 tx_seq;
5215c75a208SJohannes Berg 		} __packed add; /* SEC_KEY_ADD_CMD_API_S_VER_1 */
5225c75a208SJohannes Berg 		struct {
5235c75a208SJohannes Berg 			__le32 old_sta_mask;
5245c75a208SJohannes Berg 			__le32 new_sta_mask;
5255c75a208SJohannes Berg 			__le32 key_id;
5265c75a208SJohannes Berg 			__le32 key_flags;
5275c75a208SJohannes Berg 		} __packed modify; /* SEC_KEY_MODIFY_CMD_API_S_VER_1 */
5285c75a208SJohannes Berg 		struct {
5295c75a208SJohannes Berg 			__le32 sta_mask;
5305c75a208SJohannes Berg 			__le32 key_id;
5315c75a208SJohannes Berg 			__le32 key_flags;
5325c75a208SJohannes Berg 		} __packed remove; /* SEC_KEY_REMOVE_CMD_API_S_VER_1 */
5335c75a208SJohannes Berg 	} __packed u; /* SEC_KEY_OPERATION_API_U_VER_1 */
5345c75a208SJohannes Berg } __packed; /* SEC_KEY_CMD_API_S_VER_1 */
5355c75a208SJohannes Berg 
536d172a5efSJohannes Berg #endif /* __iwl_fw_api_datapath_h__ */
537