18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
321fb8da6SAvraham 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 	/**
3021fb8da6SAvraham Stern 	 * @WNM_PLATFORM_PTM_REQUEST_CMD: &struct iwl_time_sync_cfg_cmd
3121fb8da6SAvraham Stern 	 */
3221fb8da6SAvraham Stern 	WNM_PLATFORM_PTM_REQUEST_CMD = 0x3,
3321fb8da6SAvraham Stern 
3421fb8da6SAvraham Stern 	/**
35c7eca79dSAvraham Stern 	 * @WNM_80211V_TIMING_MEASUREMENT_CONFIG_CMD:
36c7eca79dSAvraham Stern 	 *	&struct iwl_time_sync_cfg_cmd
37c7eca79dSAvraham Stern 	 */
38c7eca79dSAvraham Stern 	WNM_80211V_TIMING_MEASUREMENT_CONFIG_CMD = 0x4,
39c7eca79dSAvraham Stern 
40c7eca79dSAvraham Stern 	/**
41*43413a36SJohannes Berg 	 * @STA_HE_CTXT_CMD: &struct iwl_he_sta_context_cmd_v1,
42*43413a36SJohannes Berg 	 *	&struct iwl_he_sta_context_cmd_v2 or
43*43413a36SJohannes Berg 	 *	&struct iwl_he_sta_context_cmd_v3
448a6171a7SLuca Coelho 	 */
458a6171a7SLuca Coelho 	STA_HE_CTXT_CMD = 0x7,
468a6171a7SLuca Coelho 
478a6171a7SLuca Coelho 	/**
48c48e93a6SJohannes Berg 	 * @RLC_CONFIG_CMD: &struct iwl_rlc_config_cmd
49c48e93a6SJohannes Berg 	 */
50c48e93a6SJohannes Berg 	RLC_CONFIG_CMD = 0x8,
51c48e93a6SJohannes Berg 
52c48e93a6SJohannes Berg 	/**
538edbfaa1SSara Sharon 	 * @RFH_QUEUE_CONFIG_CMD: &struct iwl_rfh_queue_config
548edbfaa1SSara Sharon 	 */
558edbfaa1SSara Sharon 	RFH_QUEUE_CONFIG_CMD = 0xD,
568edbfaa1SSara Sharon 
578edbfaa1SSara Sharon 	/**
58e4b89fceSAbhishek Naik 	 * @TLC_MNG_CONFIG_CMD: &struct iwl_tlc_config_cmd_v4
59110b32f0SGregory Greenman 	 */
60110b32f0SGregory Greenman 	TLC_MNG_CONFIG_CMD = 0xF,
61110b32f0SGregory Greenman 
62110b32f0SGregory Greenman 	/**
6398920961SShaul Triebitz 	 * @HE_AIR_SNIFFER_CONFIG_CMD: &struct iwl_he_monitor_cmd
6498920961SShaul Triebitz 	 */
6598920961SShaul Triebitz 	HE_AIR_SNIFFER_CONFIG_CMD = 0x13,
6698920961SShaul Triebitz 
6798920961SShaul Triebitz 	/**
685213e8a8SJohannes Berg 	 * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI
695213e8a8SJohannes Berg 	 *	matrix collection, uses &struct iwl_channel_estimation_cfg
705213e8a8SJohannes Berg 	 */
715213e8a8SJohannes Berg 	CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14,
725213e8a8SJohannes Berg 
735213e8a8SJohannes Berg 	/**
7497f70c56SJohannes Berg 	 * @RX_BAID_ALLOCATION_CONFIG_CMD: Allocate/deallocate a BAID for an RX
7597f70c56SJohannes Berg 	 *	blockack session, uses &struct iwl_rx_baid_cfg_cmd for the
7697f70c56SJohannes Berg 	 *	command, and &struct iwl_rx_baid_cfg_resp as a response.
7797f70c56SJohannes Berg 	 */
7897f70c56SJohannes Berg 	RX_BAID_ALLOCATION_CONFIG_CMD = 0x16,
7997f70c56SJohannes Berg 
8097f70c56SJohannes Berg 	/**
81227f2597SJohannes Berg 	 * @SCD_QUEUE_CONFIG_CMD: new scheduler queue allocation/config/removal
82227f2597SJohannes Berg 	 *	command, uses &struct iwl_scd_queue_cfg_cmd and the response
83227f2597SJohannes Berg 	 *	is (same as before) &struct iwl_tx_queue_cfg_rsp.
84227f2597SJohannes Berg 	 */
85227f2597SJohannes Berg 	SCD_QUEUE_CONFIG_CMD = 0x17,
86227f2597SJohannes Berg 
87227f2597SJohannes Berg 	/**
885c75a208SJohannes Berg 	 * @SEC_KEY_CMD: security key command, uses &struct iwl_sec_key_cmd
895c75a208SJohannes Berg 	 */
905c75a208SJohannes Berg 	SEC_KEY_CMD = 0x18,
915c75a208SJohannes Berg 
925c75a208SJohannes Berg 	/**
93f7d6ef33SJohannes Berg 	 * @MONITOR_NOTIF: Datapath monitoring notification, using
94f7d6ef33SJohannes Berg 	 *	&struct iwl_datapath_monitor_notif
95f7d6ef33SJohannes Berg 	 */
96f7d6ef33SJohannes Berg 	MONITOR_NOTIF = 0xF4,
97f7d6ef33SJohannes Berg 
98f7d6ef33SJohannes Berg 	/**
998dd51b5fSMordechay Goodstein 	 * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data or &struct iwl_rx_no_data_ver_3
100bf9dfedaSShaul Triebitz 	 */
101bf9dfedaSShaul Triebitz 	RX_NO_DATA_NOTIF = 0xF5,
102bf9dfedaSShaul Triebitz 
103bf9dfedaSShaul Triebitz 	/**
1042a7ce54cSJohannes Berg 	 * @THERMAL_DUAL_CHAIN_DISABLE_REQ: firmware request for SMPS mode,
1052a7ce54cSJohannes Berg 	 *	&struct iwl_thermal_dual_chain_request
1062a7ce54cSJohannes Berg 	 */
1072a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQUEST = 0xF6,
1082a7ce54cSJohannes Berg 
1092a7ce54cSJohannes Berg 	/**
11046d372afSGregory Greenman 	 * @TLC_MNG_UPDATE_NOTIF: &struct iwl_tlc_update_notif
11146d372afSGregory Greenman 	 */
11246d372afSGregory Greenman 	TLC_MNG_UPDATE_NOTIF = 0xF7,
11346d372afSGregory Greenman 
11446d372afSGregory Greenman 	/**
115d172a5efSJohannes Berg 	 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
116d172a5efSJohannes Berg 	 */
117d172a5efSJohannes Berg 	STA_PM_NOTIF = 0xFD,
118d172a5efSJohannes Berg 
119d172a5efSJohannes Berg 	/**
120d172a5efSJohannes Berg 	 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
121d172a5efSJohannes Berg 	 */
122d172a5efSJohannes Berg 	MU_GROUP_MGMT_NOTIF = 0xFE,
123d172a5efSJohannes Berg 
124d172a5efSJohannes Berg 	/**
125d172a5efSJohannes Berg 	 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
126d172a5efSJohannes Berg 	 */
127d172a5efSJohannes Berg 	RX_QUEUES_NOTIFICATION = 0xFF,
128d172a5efSJohannes Berg };
129d172a5efSJohannes Berg 
130d172a5efSJohannes Berg /**
131d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
132d172a5efSJohannes Berg  *
133d172a5efSJohannes Berg  * @reserved: reserved
134d172a5efSJohannes Berg  * @membership_status: a bitmap of MU groups
135d172a5efSJohannes Berg  * @user_position:the position of station in a group. If the station is in the
136d172a5efSJohannes Berg  *	group then bits (group * 2) is the position -1
137d172a5efSJohannes Berg  */
138d172a5efSJohannes Berg struct iwl_mu_group_mgmt_cmd {
139d172a5efSJohannes Berg 	__le32 reserved;
140d172a5efSJohannes Berg 	__le32 membership_status[2];
141d172a5efSJohannes Berg 	__le32 user_position[4];
142d172a5efSJohannes Berg } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
143d172a5efSJohannes Berg 
144d172a5efSJohannes Berg /**
145d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
146d172a5efSJohannes Berg  *
147d172a5efSJohannes Berg  * @membership_status: a bitmap of MU groups
148d172a5efSJohannes Berg  * @user_position: the position of station in a group. If the station is in the
149d172a5efSJohannes Berg  *	group then bits (group * 2) is the position -1
150d172a5efSJohannes Berg  */
151d172a5efSJohannes Berg struct iwl_mu_group_mgmt_notif {
152d172a5efSJohannes Berg 	__le32 membership_status[2];
153d172a5efSJohannes Berg 	__le32 user_position[4];
154d172a5efSJohannes Berg } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
155d172a5efSJohannes Berg 
1565213e8a8SJohannes Berg enum iwl_channel_estimation_flags {
1575213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_ENABLE	= BIT(0),
1585213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_TIMER	= BIT(1),
1595213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_COUNTER	= BIT(2),
1605213e8a8SJohannes Berg };
1615213e8a8SJohannes Berg 
162c7eca79dSAvraham Stern enum iwl_time_sync_protocol_type {
163c7eca79dSAvraham Stern 	IWL_TIME_SYNC_PROTOCOL_TM	= BIT(0),
164c7eca79dSAvraham Stern 	IWL_TIME_SYNC_PROTOCOL_FTM	= BIT(1),
165c7eca79dSAvraham Stern }; /* WNM_TIMING_ENABLED_PROTOCOL_API_E_VER_1 */
166c7eca79dSAvraham Stern 
167c7eca79dSAvraham Stern /**
168c7eca79dSAvraham Stern  * struct iwl_time_sync_cfg_cmd - TM/FTM time sync measurement configuration
169c7eca79dSAvraham Stern  *
170c7eca79dSAvraham Stern  * @protocols: The type of frames to raise notifications for. A bitmap
171c7eca79dSAvraham Stern  *	of @iwl_time_sync_protocol_type
172c7eca79dSAvraham Stern  * @peer_addr: peer address with which TM/FTM measurements are required
173c7eca79dSAvraham Stern  * @reserved: for alignment
174c7eca79dSAvraham Stern  */
175c7eca79dSAvraham Stern struct iwl_time_sync_cfg_cmd {
176c7eca79dSAvraham Stern 	__le32 protocols;
177c7eca79dSAvraham Stern 	u8 peer_addr[ETH_ALEN];
178c7eca79dSAvraham Stern 	u8 reserved[2];
179c7eca79dSAvraham Stern } __packed; /* WNM_80211V_TIMING_MEASUREMENT_CONFIG_CMD_API_S_VER_1 */
180c7eca79dSAvraham Stern 
1815213e8a8SJohannes Berg /**
18221fb8da6SAvraham Stern  * enum iwl_synced_time_operation - PTM request options
18321fb8da6SAvraham Stern  *
18421fb8da6SAvraham Stern  * @IWL_SYNCED_TIME_OPERATION_READ_ARTB: read only the ARTB time
18521fb8da6SAvraham Stern  * @IWL_SYNCED_TIME_OPERATION_READ_GP2: read only the GP2 time
18621fb8da6SAvraham Stern  * @IWL_SYNCED_TIME_OPERATION_READ_BOTH: latch the ARTB and GP2 clocks and
18721fb8da6SAvraham Stern  *	provide timestamps from both clocks for the same time point
18821fb8da6SAvraham Stern  */
18921fb8da6SAvraham Stern enum iwl_synced_time_operation {
19021fb8da6SAvraham Stern 	IWL_SYNCED_TIME_OPERATION_READ_ARTB = 1,
19121fb8da6SAvraham Stern 	IWL_SYNCED_TIME_OPERATION_READ_GP2,
19221fb8da6SAvraham Stern 	IWL_SYNCED_TIME_OPERATION_READ_BOTH,
19321fb8da6SAvraham Stern };
19421fb8da6SAvraham Stern 
19521fb8da6SAvraham Stern /**
19621fb8da6SAvraham Stern  * struct iwl_synced_time_cmd - request synced GP2/ARTB timestamps
19721fb8da6SAvraham Stern  *
19821fb8da6SAvraham Stern  * @operation: one of &enum iwl_synced_time_operation
19921fb8da6SAvraham Stern  */
20021fb8da6SAvraham Stern struct iwl_synced_time_cmd {
20121fb8da6SAvraham Stern 	__le32 operation;
20221fb8da6SAvraham Stern } __packed; /* WNM_80211V_TIMING_CMD_API_S_VER_1 */
20321fb8da6SAvraham Stern 
20421fb8da6SAvraham Stern /**
20521fb8da6SAvraham Stern  * struct iwl_synced_time_rsp - response to iwl_synced_time_cmd
20621fb8da6SAvraham Stern  *
20721fb8da6SAvraham Stern  * @operation: one of &enum iwl_synced_time_operation
20821fb8da6SAvraham Stern  * @platform_timestamp_hi: high DWORD of the ARTB clock timestamp in nanoseconds
20921fb8da6SAvraham Stern  * @platform_timestamp_lo: low DWORD of the ARTB clock timestamp in nanoseconds
21021fb8da6SAvraham Stern  * @gp2_timestamp_hi: high DWORD of the GP2 clock timestamp in 10's of
21121fb8da6SAvraham Stern  *	nanoseconds
21221fb8da6SAvraham Stern  * @gp2_timestamp_lo: low DWORD of the GP2 clock timestamp in 10's of
21321fb8da6SAvraham Stern  *	nanoseconds
21421fb8da6SAvraham Stern  */
21521fb8da6SAvraham Stern struct iwl_synced_time_rsp {
21621fb8da6SAvraham Stern 	__le32 operation;
21721fb8da6SAvraham Stern 	__le32 platform_timestamp_hi;
21821fb8da6SAvraham Stern 	__le32 platform_timestamp_lo;
21921fb8da6SAvraham Stern 	__le32 gp2_timestamp_hi;
22021fb8da6SAvraham Stern 	__le32 gp2_timestamp_lo;
22121fb8da6SAvraham Stern } __packed; /* WNM_80211V_TIMING_RSP_API_S_VER_1 */
22221fb8da6SAvraham Stern 
223c7eca79dSAvraham Stern /* PTP_CTX_MAX_DATA_SIZE_IN_API_D_VER_1 */
224c7eca79dSAvraham Stern #define PTP_CTX_MAX_DATA_SIZE   128
225c7eca79dSAvraham Stern 
226c7eca79dSAvraham Stern /**
227c7eca79dSAvraham Stern  * struct iwl_time_msmt_ptp_ctx - Vendor specific information element
228c7eca79dSAvraham Stern  * to allow a space for flexibility for the userspace App
229c7eca79dSAvraham Stern  *
230c7eca79dSAvraham Stern  * @element_id: element id of vendor specific ie
231c7eca79dSAvraham Stern  * @length: length of vendor specific ie
232c7eca79dSAvraham Stern  * @reserved: for alignment
233c7eca79dSAvraham Stern  * @data: vendor specific data blob
234c7eca79dSAvraham Stern  */
235c7eca79dSAvraham Stern struct iwl_time_msmt_ptp_ctx {
236c7eca79dSAvraham Stern 	/* Differentiate between FTM and TM specific Vendor IEs */
237c7eca79dSAvraham Stern 	union {
238c7eca79dSAvraham Stern 		struct {
239c7eca79dSAvraham Stern 			u8 element_id;
240c7eca79dSAvraham Stern 			u8 length;
241c7eca79dSAvraham Stern 			__le16 reserved;
242c7eca79dSAvraham Stern 			u8 data[PTP_CTX_MAX_DATA_SIZE];
243c7eca79dSAvraham Stern 		} ftm; /* FTM specific vendor IE */
244c7eca79dSAvraham Stern 		struct {
245c7eca79dSAvraham Stern 			u8 element_id;
246c7eca79dSAvraham Stern 			u8 length;
247c7eca79dSAvraham Stern 			u8 data[PTP_CTX_MAX_DATA_SIZE];
248c7eca79dSAvraham Stern 		} tm; /* TM specific vendor IE */
249c7eca79dSAvraham Stern 	};
250c7eca79dSAvraham Stern } __packed /* PTP_CTX_VER_1 */;
251c7eca79dSAvraham Stern 
252c7eca79dSAvraham Stern /**
253c7eca79dSAvraham Stern  * struct iwl_time_msmt_notify - Time Sync measurement notification
254c7eca79dSAvraham Stern  * for TM/FTM, along with additional meta data.
255c7eca79dSAvraham Stern  *
256c7eca79dSAvraham Stern  * @peer_addr: peer address
257c7eca79dSAvraham Stern  * @reserved: for alignment
258c7eca79dSAvraham Stern  * @dialog_token: measurement flow dialog token number
259c7eca79dSAvraham Stern  * @followup_dialog_token: Measurement flow previous dialog token number
260c7eca79dSAvraham Stern  * @t1_hi: high dword of t1-time of the Tx'ed action frame departure on
261c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
262c7eca79dSAvraham Stern  * @t1_lo: low dword of t1-time of the Tx'ed action frame departure on
263c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
264c7eca79dSAvraham Stern  * @t1_max_err: maximum t1-time error in units of 10 nano seconds
265c7eca79dSAvraham Stern  * @t4_hi: high dword of t4-time of the Rx'ed action frame's Ack arrival on
266c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
267c7eca79dSAvraham Stern  * @t4_lo: low dword of t4-time of the Rx'ed action frame's Ack arrival on
268c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
269c7eca79dSAvraham Stern  * @t4_max_err: maximum t4-time error in units of 10 nano seconds
270c7eca79dSAvraham Stern  * @t2_hi: high dword of t2-time of the Rx'ed action frame arrival on
271c7eca79dSAvraham Stern  *	receiver side in units of 10 nano seconds
272c7eca79dSAvraham Stern  * @t2_lo: low dword of t2-time of the Rx'ed action frame arrival on
273c7eca79dSAvraham Stern  *	receiver side in units of 10 nano seconds
274c7eca79dSAvraham Stern  * @t2_max_err: maximum t2-time error in units of 10 nano seconds
275c7eca79dSAvraham Stern  * @t3_hi: high dword of t3-time of the Tx'ed action frame's Ack departure on
276c7eca79dSAvraham Stern  *	receiver side in units of 10 nano seconds
277c7eca79dSAvraham Stern  * @t3_lo: low dword of t3-time of the Tx'ed action frame's Ack departure on
278c7eca79dSAvraham Stern  *	receiver side in units of 10 nano seconds
279c7eca79dSAvraham Stern  * @t3_max_err: maximum t3-time error in units of 10 nano seconds
280c7eca79dSAvraham Stern  * @ptp: vendor specific information element
281c7eca79dSAvraham Stern  */
282c7eca79dSAvraham Stern struct iwl_time_msmt_notify {
283c7eca79dSAvraham Stern 	u8 peer_addr[ETH_ALEN];
284c7eca79dSAvraham Stern 	u8 reserved[2];
285c7eca79dSAvraham Stern 	__le32 dialog_token;
286c7eca79dSAvraham Stern 	__le32 followup_dialog_token;
287c7eca79dSAvraham Stern 	__le32 t1_hi;
288c7eca79dSAvraham Stern 	__le32 t1_lo;
289c7eca79dSAvraham Stern 	__le32 t1_max_err;
290c7eca79dSAvraham Stern 	__le32 t4_hi;
291c7eca79dSAvraham Stern 	__le32 t4_lo;
292c7eca79dSAvraham Stern 	__le32 t4_max_err;
293c7eca79dSAvraham Stern 	__le32 t2_hi;
294c7eca79dSAvraham Stern 	__le32 t2_lo;
295c7eca79dSAvraham Stern 	__le32 t2_max_err;
296c7eca79dSAvraham Stern 	__le32 t3_hi;
297c7eca79dSAvraham Stern 	__le32 t3_lo;
298c7eca79dSAvraham Stern 	__le32 t3_max_err;
299c7eca79dSAvraham Stern 	struct iwl_time_msmt_ptp_ctx ptp;
300c7eca79dSAvraham Stern } __packed; /* WNM_80211V_TIMING_MEASUREMENT_NTFY_API_S_VER_1 */
301c7eca79dSAvraham Stern 
302c7eca79dSAvraham Stern /**
303c7eca79dSAvraham Stern  * struct iwl_time_msmt_cfm_notify - Time Sync measurement confirmation
304c7eca79dSAvraham Stern  * notification for TM/FTM. Sent on receipt of 802.11 Ack from peer for the
305c7eca79dSAvraham Stern  * Tx'ed TM/FTM measurement action frame.
306c7eca79dSAvraham Stern  *
307c7eca79dSAvraham Stern  * @peer_addr: peer address
308c7eca79dSAvraham Stern  * @reserved: for alignment
309c7eca79dSAvraham Stern  * @dialog_token: measurement flow dialog token number
310c7eca79dSAvraham Stern  * @t1_hi: high dword of t1-time of the Tx'ed action frame departure on
311c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
312c7eca79dSAvraham Stern  * @t1_lo: low dword of t1-time of the Tx'ed action frame departure on
313c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
314c7eca79dSAvraham Stern  * @t1_max_err: maximum t1-time error in units of 10 nano seconds
315c7eca79dSAvraham Stern  * @t4_hi: high dword of t4-time of the Rx'ed action frame's Ack arrival on
316c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
317c7eca79dSAvraham Stern  * @t4_lo: low dword of t4-time of the Rx'ed action frame's Ack arrival on
318c7eca79dSAvraham Stern  *	sender side in units of 10 nano seconds
319c7eca79dSAvraham Stern  * @t4_max_err: maximum t4-time error in units of 10 nano seconds
320c7eca79dSAvraham Stern  */
321c7eca79dSAvraham Stern struct iwl_time_msmt_cfm_notify {
322c7eca79dSAvraham Stern 	u8 peer_addr[ETH_ALEN];
323c7eca79dSAvraham Stern 	u8 reserved[2];
324c7eca79dSAvraham Stern 	__le32 dialog_token;
325c7eca79dSAvraham Stern 	__le32 t1_hi;
326c7eca79dSAvraham Stern 	__le32 t1_lo;
327c7eca79dSAvraham Stern 	__le32 t1_max_err;
328c7eca79dSAvraham Stern 	__le32 t4_hi;
329c7eca79dSAvraham Stern 	__le32 t4_lo;
330c7eca79dSAvraham Stern 	__le32 t4_max_err;
331c7eca79dSAvraham Stern } __packed; /* WNM_80211V_TIMING_MEASUREMENT_CONFIRM_NTFY_API_S_VER_1 */
332c7eca79dSAvraham Stern 
33321fb8da6SAvraham Stern /**
3345213e8a8SJohannes Berg  * struct iwl_channel_estimation_cfg - channel estimation reporting config
3355213e8a8SJohannes Berg  */
3365213e8a8SJohannes Berg struct iwl_channel_estimation_cfg {
3375213e8a8SJohannes Berg 	/**
3385213e8a8SJohannes Berg 	 * @flags: flags, see &enum iwl_channel_estimation_flags
3395213e8a8SJohannes Berg 	 */
3405213e8a8SJohannes Berg 	__le32 flags;
3415213e8a8SJohannes Berg 	/**
3425213e8a8SJohannes Berg 	 * @timer: if enabled via flags, automatically disable after this many
3435213e8a8SJohannes Berg 	 *	microseconds
3445213e8a8SJohannes Berg 	 */
3455213e8a8SJohannes Berg 	__le32 timer;
3465213e8a8SJohannes Berg 	/**
3475213e8a8SJohannes Berg 	 * @count: if enabled via flags, automatically disable after this many
3485213e8a8SJohannes Berg 	 *	frames with channel estimation matrix were captured
3495213e8a8SJohannes Berg 	 */
3505213e8a8SJohannes Berg 	__le32 count;
3515213e8a8SJohannes Berg 	/**
3525213e8a8SJohannes Berg 	 * @rate_n_flags_mask: only try to record the channel estimation matrix
3535213e8a8SJohannes Berg 	 *	if the rate_n_flags value for the received frame (let's call
3545213e8a8SJohannes Berg 	 *	that rx_rnf) matches the mask/value given here like this:
3555213e8a8SJohannes Berg 	 *	(rx_rnf & rate_n_flags_mask) == rate_n_flags_val.
3565213e8a8SJohannes Berg 	 */
3575213e8a8SJohannes Berg 	__le32 rate_n_flags_mask;
3585213e8a8SJohannes Berg 	/**
3595213e8a8SJohannes Berg 	 * @rate_n_flags_val: see @rate_n_flags_mask
3605213e8a8SJohannes Berg 	 */
3615213e8a8SJohannes Berg 	__le32 rate_n_flags_val;
3625213e8a8SJohannes Berg 	/**
3635213e8a8SJohannes Berg 	 * @reserved: reserved (for alignment)
3645213e8a8SJohannes Berg 	 */
3655213e8a8SJohannes Berg 	__le32 reserved;
3665213e8a8SJohannes Berg 	/**
3675213e8a8SJohannes Berg 	 * @frame_types: bitmap of frame types to capture, the received frame's
3685213e8a8SJohannes Berg 	 *	subtype|type takes 6 bits in the frame and the corresponding bit
3695213e8a8SJohannes Berg 	 *	in this field must be set to 1 to capture channel estimation for
3705213e8a8SJohannes Berg 	 *	that frame type. Set to all-ones to enable capturing for all
3715213e8a8SJohannes Berg 	 *	frame types.
3725213e8a8SJohannes Berg 	 */
3735213e8a8SJohannes Berg 	__le64 frame_types;
3745213e8a8SJohannes Berg } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */
3755213e8a8SJohannes Berg 
376f7d6ef33SJohannes Berg enum iwl_datapath_monitor_notif_type {
377f7d6ef33SJohannes Berg 	IWL_DP_MON_NOTIF_TYPE_EXT_CCA,
378f7d6ef33SJohannes Berg };
379f7d6ef33SJohannes Berg 
380f7d6ef33SJohannes Berg struct iwl_datapath_monitor_notif {
381f7d6ef33SJohannes Berg 	__le32 type;
382f7d6ef33SJohannes Berg 	u8 mac_id;
383f7d6ef33SJohannes Berg 	u8 reserved[3];
384f7d6ef33SJohannes Berg } __packed; /* MONITOR_NTF_API_S_VER_1 */
385f7d6ef33SJohannes Berg 
3862a7ce54cSJohannes Berg /**
3872a7ce54cSJohannes Berg  * enum iwl_thermal_dual_chain_req_events - firmware SMPS request event
3882a7ce54cSJohannes Berg  * @THERMAL_DUAL_CHAIN_REQ_ENABLE: (re-)enable dual-chain operation
3892a7ce54cSJohannes Berg  *	(subject to other constraints)
3902a7ce54cSJohannes Berg  * @THERMAL_DUAL_CHAIN_REQ_DISABLE: disable dual-chain operation
3912a7ce54cSJohannes Berg  *	(static SMPS)
3922a7ce54cSJohannes Berg  */
3932a7ce54cSJohannes Berg enum iwl_thermal_dual_chain_req_events {
3942a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQ_ENABLE,
3952a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQ_DISABLE,
3962a7ce54cSJohannes Berg }; /* THERMAL_DUAL_CHAIN_DISABLE_STATE_API_E_VER_1 */
3972a7ce54cSJohannes Berg 
3982a7ce54cSJohannes Berg /**
3992a7ce54cSJohannes Berg  * struct iwl_thermal_dual_chain_request - SMPS request
4002a7ce54cSJohannes Berg  * @event: the type of request, see &enum iwl_thermal_dual_chain_req_events
4012a7ce54cSJohannes Berg  */
4022a7ce54cSJohannes Berg struct iwl_thermal_dual_chain_request {
4032a7ce54cSJohannes Berg 	__le32 event;
4042a7ce54cSJohannes Berg } __packed; /* THERMAL_DUAL_CHAIN_DISABLE_REQ_NTFY_API_S_VER_1 */
4052a7ce54cSJohannes Berg 
406c48e93a6SJohannes Berg enum iwl_rlc_chain_info {
407c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_DRIVER_FORCE		= BIT(0),
408c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_VALID		= 0x000e,
409c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_FORCE		= 0x0070,
410c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_FORCE_MIMO		= 0x0380,
411c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_COUNT		= 0x0c00,
412c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_MIMO_COUNT		= 0x3000,
413c48e93a6SJohannes Berg };
414c48e93a6SJohannes Berg 
415c48e93a6SJohannes Berg /**
416c48e93a6SJohannes Berg  * struct iwl_rlc_properties - RLC properties
417c48e93a6SJohannes Berg  * @rx_chain_info: RX chain info, &enum iwl_rlc_chain_info
418c48e93a6SJohannes Berg  * @reserved: reserved
419c48e93a6SJohannes Berg  */
420c48e93a6SJohannes Berg struct iwl_rlc_properties {
421c48e93a6SJohannes Berg 	__le32 rx_chain_info;
422c48e93a6SJohannes Berg 	__le32 reserved;
423c48e93a6SJohannes Berg } __packed; /* RLC_PROPERTIES_S_VER_1 */
424c48e93a6SJohannes Berg 
425c48e93a6SJohannes Berg enum iwl_sad_mode {
426c48e93a6SJohannes Berg 	IWL_SAD_MODE_ENABLED		= BIT(0),
427c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_MSK	= 0x6,
428c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_FW	= 0x0,
429c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_A	= 0x2,
430c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_B	= 0x4,
431c48e93a6SJohannes Berg };
432c48e93a6SJohannes Berg 
433c48e93a6SJohannes Berg /**
434c48e93a6SJohannes Berg  * struct iwl_sad_properties - SAD properties
435c48e93a6SJohannes Berg  * @chain_a_sad_mode: chain A SAD mode, &enum iwl_sad_mode
436c48e93a6SJohannes Berg  * @chain_b_sad_mode: chain B SAD mode, &enum iwl_sad_mode
437c48e93a6SJohannes Berg  * @mac_id: MAC index
438c48e93a6SJohannes Berg  * @reserved: reserved
439c48e93a6SJohannes Berg  */
440c48e93a6SJohannes Berg struct iwl_sad_properties {
441c48e93a6SJohannes Berg 	__le32 chain_a_sad_mode;
442c48e93a6SJohannes Berg 	__le32 chain_b_sad_mode;
443c48e93a6SJohannes Berg 	__le32 mac_id;
444c48e93a6SJohannes Berg 	__le32 reserved;
445c48e93a6SJohannes Berg } __packed;
446c48e93a6SJohannes Berg 
447c48e93a6SJohannes Berg /**
448c48e93a6SJohannes Berg  * struct iwl_rlc_config_cmd - RLC configuration
449c48e93a6SJohannes Berg  * @phy_id: PHY index
450c48e93a6SJohannes Berg  * @rlc: RLC properties, &struct iwl_rlc_properties
451c48e93a6SJohannes Berg  * @sad: SAD (single antenna diversity) options, &struct iwl_sad_properties
452*43413a36SJohannes Berg  * @flags: flags (unused)
453c48e93a6SJohannes Berg  * @reserved: reserved
454c48e93a6SJohannes Berg  */
455c48e93a6SJohannes Berg struct iwl_rlc_config_cmd {
456c48e93a6SJohannes Berg 	__le32 phy_id;
457c48e93a6SJohannes Berg 	struct iwl_rlc_properties rlc;
458c48e93a6SJohannes Berg 	struct iwl_sad_properties sad;
459c48e93a6SJohannes Berg 	u8 flags;
460c48e93a6SJohannes Berg 	u8 reserved[3];
461c48e93a6SJohannes Berg } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */
462c48e93a6SJohannes Berg 
463ded5ded3SEmmanuel Grumbach #define IWL_MAX_BAID_OLD	16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */
464ded5ded3SEmmanuel Grumbach #define IWL_MAX_BAID		32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */
465ded5ded3SEmmanuel Grumbach 
46697f70c56SJohannes Berg /**
46797f70c56SJohannes Berg  * enum iwl_rx_baid_action - BAID allocation/config action
46897f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_ADD: add a new BAID session
46997f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_MODIFY: modify the BAID session
47097f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_REMOVE: remove the BAID session
47197f70c56SJohannes Berg  */
47297f70c56SJohannes Berg enum iwl_rx_baid_action {
47397f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_ADD,
47497f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_MODIFY,
47597f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_REMOVE,
47697f70c56SJohannes Berg }; /*  RX_BAID_ALLOCATION_ACTION_E_VER_1 */
47797f70c56SJohannes Berg 
47897f70c56SJohannes Berg /**
47997f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_alloc - BAID allocation data
48097f70c56SJohannes Berg  * @sta_id_mask: station ID mask
48197f70c56SJohannes Berg  * @tid: the TID for this session
48297f70c56SJohannes Berg  * @reserved: reserved
48397f70c56SJohannes Berg  * @ssn: the starting sequence number
48497f70c56SJohannes Berg  * @win_size: RX BA session window size
48597f70c56SJohannes Berg  */
48697f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_alloc {
48797f70c56SJohannes Berg 	__le32 sta_id_mask;
48897f70c56SJohannes Berg 	u8 tid;
48997f70c56SJohannes Berg 	u8 reserved[3];
49097f70c56SJohannes Berg 	__le16 ssn;
49197f70c56SJohannes Berg 	__le16 win_size;
49297f70c56SJohannes Berg } __packed; /* RX_BAID_ALLOCATION_ADD_CMD_API_S_VER_1 */
49397f70c56SJohannes Berg 
49497f70c56SJohannes Berg /**
49597f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_modify - BAID modification data
49626de4c8bSJohannes Berg  * @old_sta_id_mask: old station ID mask
49726de4c8bSJohannes Berg  * @new_sta_id_mask: new station ID mask
49826de4c8bSJohannes Berg  * @tid: TID of the BAID
49997f70c56SJohannes Berg  */
50097f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_modify {
50126de4c8bSJohannes Berg 	__le32 old_sta_id_mask;
50226de4c8bSJohannes Berg 	__le32 new_sta_id_mask;
50326de4c8bSJohannes Berg 	__le32 tid;
50426de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_MODIFY_CMD_API_S_VER_2 */
50526de4c8bSJohannes Berg 
50626de4c8bSJohannes Berg /**
50726de4c8bSJohannes Berg  * struct iwl_rx_baid_cfg_cmd_remove_v1 - BAID removal data
50826de4c8bSJohannes Berg  * @baid: the BAID to remove
50926de4c8bSJohannes Berg  */
51026de4c8bSJohannes Berg struct iwl_rx_baid_cfg_cmd_remove_v1 {
51197f70c56SJohannes Berg 	__le32 baid;
51226de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_1 */
51397f70c56SJohannes Berg 
51497f70c56SJohannes Berg /**
51597f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_remove - BAID removal data
51626de4c8bSJohannes Berg  * @sta_id_mask: the station mask of the BAID to remove
51726de4c8bSJohannes Berg  * @tid: the TID of the BAID to remove
51897f70c56SJohannes Berg  */
51997f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_remove {
52026de4c8bSJohannes Berg 	__le32 sta_id_mask;
52126de4c8bSJohannes Berg 	__le32 tid;
52226de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_2 */
52397f70c56SJohannes Berg 
52497f70c56SJohannes Berg /**
52597f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd - BAID allocation/config command
52697f70c56SJohannes Berg  * @action: the action, from &enum iwl_rx_baid_action
52797f70c56SJohannes Berg  */
52897f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd {
52997f70c56SJohannes Berg 	__le32 action;
53097f70c56SJohannes Berg 	union {
53197f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_alloc alloc;
53297f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_modify modify;
53326de4c8bSJohannes Berg 		struct iwl_rx_baid_cfg_cmd_remove_v1 remove_v1;
53497f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_remove remove;
53526de4c8bSJohannes Berg 	}; /* RX_BAID_ALLOCATION_OPERATION_API_U_VER_2 */
53626de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_CONFIG_CMD_API_S_VER_2 */
53797f70c56SJohannes Berg 
53897f70c56SJohannes Berg /**
53997f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_resp - BAID allocation response
54097f70c56SJohannes Berg  * @baid: the allocated BAID
54197f70c56SJohannes Berg  */
54297f70c56SJohannes Berg struct iwl_rx_baid_cfg_resp {
54397f70c56SJohannes Berg 	__le32 baid;
54497f70c56SJohannes Berg }; /* RX_BAID_ALLOCATION_RESPONSE_API_S_VER_1 */
54597f70c56SJohannes Berg 
546227f2597SJohannes Berg /**
547227f2597SJohannes Berg  * enum iwl_scd_queue_cfg_operation - scheduler queue operation
548227f2597SJohannes Berg  * @IWL_SCD_QUEUE_ADD: allocate a new queue
549227f2597SJohannes Berg  * @IWL_SCD_QUEUE_REMOVE: remove a queue
550227f2597SJohannes Berg  * @IWL_SCD_QUEUE_MODIFY: modify a queue
551227f2597SJohannes Berg  */
552227f2597SJohannes Berg enum iwl_scd_queue_cfg_operation {
553227f2597SJohannes Berg 	IWL_SCD_QUEUE_ADD = 0,
554227f2597SJohannes Berg 	IWL_SCD_QUEUE_REMOVE = 1,
555227f2597SJohannes Berg 	IWL_SCD_QUEUE_MODIFY = 2,
556227f2597SJohannes Berg };
557227f2597SJohannes Berg 
558227f2597SJohannes Berg /**
559227f2597SJohannes Berg  * struct iwl_scd_queue_cfg_cmd - scheduler queue allocation command
560227f2597SJohannes Berg  * @operation: the operation, see &enum iwl_scd_queue_cfg_operation
561227f2597SJohannes Berg  * @u.add.sta_mask: station mask
562227f2597SJohannes Berg  * @u.add.tid: TID
563227f2597SJohannes Berg  * @u.add.reserved: reserved
564227f2597SJohannes Berg  * @u.add.flags: flags from &enum iwl_tx_queue_cfg_actions, except
565227f2597SJohannes Berg  *	%TX_QUEUE_CFG_ENABLE_QUEUE is not valid
566227f2597SJohannes Berg  * @u.add.cb_size: size code
567227f2597SJohannes Berg  * @u.add.bc_dram_addr: byte-count table IOVA
568227f2597SJohannes Berg  * @u.add.tfdq_dram_addr: TFD queue IOVA
569c5a976cfSJohannes Berg  * @u.remove.sta_mask: station mask of queue to remove
570c5a976cfSJohannes Berg  * @u.remove.tid: TID of queue to remove
571c5a976cfSJohannes Berg  * @u.modify.old_sta_mask: old station mask for modify
572c5a976cfSJohannes Berg  * @u.modify.tid: TID of queue to modify
573c5a976cfSJohannes Berg  * @u.modify.new_sta_mask: new station mask for modify
574227f2597SJohannes Berg  */
575227f2597SJohannes Berg struct iwl_scd_queue_cfg_cmd {
576227f2597SJohannes Berg 	__le32 operation;
577227f2597SJohannes Berg 	union {
578227f2597SJohannes Berg 		struct {
579227f2597SJohannes Berg 			__le32 sta_mask;
580227f2597SJohannes Berg 			u8 tid;
581227f2597SJohannes Berg 			u8 reserved[3];
582227f2597SJohannes Berg 			__le32 flags;
583227f2597SJohannes Berg 			__le32 cb_size;
584227f2597SJohannes Berg 			__le64 bc_dram_addr;
585227f2597SJohannes Berg 			__le64 tfdq_dram_addr;
586227f2597SJohannes Berg 		} __packed add; /* TX_QUEUE_CFG_CMD_ADD_API_S_VER_1 */
587227f2597SJohannes Berg 		struct {
588c5a976cfSJohannes Berg 			__le32 sta_mask;
589c5a976cfSJohannes Berg 			__le32 tid;
590227f2597SJohannes Berg 		} __packed remove; /* TX_QUEUE_CFG_CMD_REMOVE_API_S_VER_1 */
591227f2597SJohannes Berg 		struct {
592c5a976cfSJohannes Berg 			__le32 old_sta_mask;
593c5a976cfSJohannes Berg 			__le32 tid;
594c5a976cfSJohannes Berg 			__le32 new_sta_mask;
595227f2597SJohannes Berg 		} __packed modify; /* TX_QUEUE_CFG_CMD_MODIFY_API_S_VER_1 */
596227f2597SJohannes Berg 	} __packed u; /* TX_QUEUE_CFG_CMD_OPERATION_API_U_VER_1 */
597227f2597SJohannes Berg } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_3 */
598227f2597SJohannes Berg 
5995c75a208SJohannes Berg /**
6005c75a208SJohannes Berg  * enum iwl_sec_key_flags - security key command key flags
6015c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_MASK: cipher mask
6025c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_WEP: WEP cipher
6035c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_CCMP: CCMP/CMAC cipher
6045c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_TKIP: TKIP cipher
6055c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_GCMP: GCMP/GMAC cipher
6065c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_NO_TX: don't install for TX
6075c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_KEY_SIZE: large key size (WEP-104, GCMP-256, GMAC-256)
6085c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_MFP: MFP is in used for this key
6095c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_MCAST_KEY: this is a multicast key
6105c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_SPP_AMSDU: SPP A-MSDU should be used
6115c75a208SJohannes Berg  */
6125c75a208SJohannes Berg enum iwl_sec_key_flags {
6135c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_MASK	= 0x07,
6145c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_WEP	= 0x01,
6155c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_CCMP	= 0x02,
6165c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_TKIP	= 0x03,
6175c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_GCMP	= 0x05,
6185c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_NO_TX		= 0x08,
6195c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_KEY_SIZE	= 0x10,
6205c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_MFP		= 0x20,
6215c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_MCAST_KEY	= 0x40,
6225c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_SPP_AMSDU	= 0x80,
6235c75a208SJohannes Berg };
6245c75a208SJohannes Berg 
6255c75a208SJohannes Berg #define IWL_SEC_WEP_KEY_OFFSET	3
6265c75a208SJohannes Berg 
6275c75a208SJohannes Berg /**
6285c75a208SJohannes Berg  * struct iwl_sec_key_cmd - security key command
6295c75a208SJohannes Berg  * @action: action from &enum iwl_ctxt_action
6305c75a208SJohannes Berg  * @u.add.sta_mask: station mask for the new key
6315c75a208SJohannes Berg  * @u.add.key_id: key ID (0-7) for the new key
6325c75a208SJohannes Berg  * @u.add.key_flags: key flags per &enum iwl_sec_key_flags
6335c75a208SJohannes Berg  * @u.add.key: key material. WEP keys should start from &IWL_SEC_WEP_KEY_OFFSET.
6345c75a208SJohannes Berg  * @u.add.tkip_mic_rx_key: TKIP MIC RX key
6355c75a208SJohannes Berg  * @u.add.tkip_mic_tx_key: TKIP MIC TX key
6365c75a208SJohannes Berg  * @u.add.rx_seq: RX sequence counter value
6375c75a208SJohannes Berg  * @u.add.tx_seq: TX sequence counter value
6385c75a208SJohannes Berg  * @u.modify.old_sta_mask: old station mask
6395c75a208SJohannes Berg  * @u.modify.new_sta_mask: new station mask
6405c75a208SJohannes Berg  * @u.modify.key_id: key ID
6415c75a208SJohannes Berg  * @u.modify.key_flags: new key flags
6425c75a208SJohannes Berg  * @u.remove.sta_mask: station mask
6435c75a208SJohannes Berg  * @u.remove.key_id: key ID
6445c75a208SJohannes Berg  * @u.remove.key_flags: key flags
6455c75a208SJohannes Berg  */
6465c75a208SJohannes Berg struct iwl_sec_key_cmd {
6475c75a208SJohannes Berg 	__le32 action;
6485c75a208SJohannes Berg 	union {
6495c75a208SJohannes Berg 		struct {
6505c75a208SJohannes Berg 			__le32 sta_mask;
6515c75a208SJohannes Berg 			__le32 key_id;
6525c75a208SJohannes Berg 			__le32 key_flags;
6535c75a208SJohannes Berg 			u8 key[32];
6545c75a208SJohannes Berg 			u8 tkip_mic_rx_key[8];
6555c75a208SJohannes Berg 			u8 tkip_mic_tx_key[8];
6565c75a208SJohannes Berg 			__le64 rx_seq;
6575c75a208SJohannes Berg 			__le64 tx_seq;
6585c75a208SJohannes Berg 		} __packed add; /* SEC_KEY_ADD_CMD_API_S_VER_1 */
6595c75a208SJohannes Berg 		struct {
6605c75a208SJohannes Berg 			__le32 old_sta_mask;
6615c75a208SJohannes Berg 			__le32 new_sta_mask;
6625c75a208SJohannes Berg 			__le32 key_id;
6635c75a208SJohannes Berg 			__le32 key_flags;
6645c75a208SJohannes Berg 		} __packed modify; /* SEC_KEY_MODIFY_CMD_API_S_VER_1 */
6655c75a208SJohannes Berg 		struct {
6665c75a208SJohannes Berg 			__le32 sta_mask;
6675c75a208SJohannes Berg 			__le32 key_id;
6685c75a208SJohannes Berg 			__le32 key_flags;
6695c75a208SJohannes Berg 		} __packed remove; /* SEC_KEY_REMOVE_CMD_API_S_VER_1 */
6705c75a208SJohannes Berg 	} __packed u; /* SEC_KEY_OPERATION_API_U_VER_1 */
6715c75a208SJohannes Berg } __packed; /* SEC_KEY_CMD_API_S_VER_1 */
6725c75a208SJohannes Berg 
673d172a5efSJohannes Berg #endif /* __iwl_fw_api_datapath_h__ */
674