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