18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
3f7d6ef33SJohannes Berg  * Copyright (C) 2012-2014, 2018-2020 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 	/**
308a6171a7SLuca Coelho 	 * @STA_HE_CTXT_CMD: &struct iwl_he_sta_context_cmd
318a6171a7SLuca Coelho 	 */
328a6171a7SLuca Coelho 	STA_HE_CTXT_CMD = 0x7,
338a6171a7SLuca Coelho 
348a6171a7SLuca Coelho 	/**
35c48e93a6SJohannes Berg 	 * @RLC_CONFIG_CMD: &struct iwl_rlc_config_cmd
36c48e93a6SJohannes Berg 	 */
37c48e93a6SJohannes Berg 	RLC_CONFIG_CMD = 0x8,
38c48e93a6SJohannes Berg 
39c48e93a6SJohannes Berg 	/**
408edbfaa1SSara Sharon 	 * @RFH_QUEUE_CONFIG_CMD: &struct iwl_rfh_queue_config
418edbfaa1SSara Sharon 	 */
428edbfaa1SSara Sharon 	RFH_QUEUE_CONFIG_CMD = 0xD,
438edbfaa1SSara Sharon 
448edbfaa1SSara Sharon 	/**
45e4b89fceSAbhishek Naik 	 * @TLC_MNG_CONFIG_CMD: &struct iwl_tlc_config_cmd_v4
46110b32f0SGregory Greenman 	 */
47110b32f0SGregory Greenman 	TLC_MNG_CONFIG_CMD = 0xF,
48110b32f0SGregory Greenman 
49110b32f0SGregory Greenman 	/**
5098920961SShaul Triebitz 	 * @HE_AIR_SNIFFER_CONFIG_CMD: &struct iwl_he_monitor_cmd
5198920961SShaul Triebitz 	 */
5298920961SShaul Triebitz 	HE_AIR_SNIFFER_CONFIG_CMD = 0x13,
5398920961SShaul Triebitz 
5498920961SShaul Triebitz 	/**
555213e8a8SJohannes Berg 	 * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI
565213e8a8SJohannes Berg 	 *	matrix collection, uses &struct iwl_channel_estimation_cfg
575213e8a8SJohannes Berg 	 */
585213e8a8SJohannes Berg 	CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14,
595213e8a8SJohannes Berg 
605213e8a8SJohannes Berg 	/**
6197f70c56SJohannes Berg 	 * @RX_BAID_ALLOCATION_CONFIG_CMD: Allocate/deallocate a BAID for an RX
6297f70c56SJohannes Berg 	 *	blockack session, uses &struct iwl_rx_baid_cfg_cmd for the
6397f70c56SJohannes Berg 	 *	command, and &struct iwl_rx_baid_cfg_resp as a response.
6497f70c56SJohannes Berg 	 */
6597f70c56SJohannes Berg 	RX_BAID_ALLOCATION_CONFIG_CMD = 0x16,
6697f70c56SJohannes Berg 
6797f70c56SJohannes Berg 	/**
68227f2597SJohannes Berg 	 * @SCD_QUEUE_CONFIG_CMD: new scheduler queue allocation/config/removal
69227f2597SJohannes Berg 	 *	command, uses &struct iwl_scd_queue_cfg_cmd and the response
70227f2597SJohannes Berg 	 *	is (same as before) &struct iwl_tx_queue_cfg_rsp.
71227f2597SJohannes Berg 	 */
72227f2597SJohannes Berg 	SCD_QUEUE_CONFIG_CMD = 0x17,
73227f2597SJohannes Berg 
74227f2597SJohannes Berg 	/**
75*5c75a208SJohannes Berg 	 * @SEC_KEY_CMD: security key command, uses &struct iwl_sec_key_cmd
76*5c75a208SJohannes Berg 	 */
77*5c75a208SJohannes Berg 	SEC_KEY_CMD = 0x18,
78*5c75a208SJohannes Berg 
79*5c75a208SJohannes Berg 	/**
80f7d6ef33SJohannes Berg 	 * @MONITOR_NOTIF: Datapath monitoring notification, using
81f7d6ef33SJohannes Berg 	 *	&struct iwl_datapath_monitor_notif
82f7d6ef33SJohannes Berg 	 */
83f7d6ef33SJohannes Berg 	MONITOR_NOTIF = 0xF4,
84f7d6ef33SJohannes Berg 
85f7d6ef33SJohannes Berg 	/**
86bf9dfedaSShaul Triebitz 	 * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data
87bf9dfedaSShaul Triebitz 	 */
88bf9dfedaSShaul Triebitz 	RX_NO_DATA_NOTIF = 0xF5,
89bf9dfedaSShaul Triebitz 
90bf9dfedaSShaul Triebitz 	/**
912a7ce54cSJohannes Berg 	 * @THERMAL_DUAL_CHAIN_DISABLE_REQ: firmware request for SMPS mode,
922a7ce54cSJohannes Berg 	 *	&struct iwl_thermal_dual_chain_request
932a7ce54cSJohannes Berg 	 */
942a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQUEST = 0xF6,
952a7ce54cSJohannes Berg 
962a7ce54cSJohannes Berg 	/**
9746d372afSGregory Greenman 	 * @TLC_MNG_UPDATE_NOTIF: &struct iwl_tlc_update_notif
9846d372afSGregory Greenman 	 */
9946d372afSGregory Greenman 	TLC_MNG_UPDATE_NOTIF = 0xF7,
10046d372afSGregory Greenman 
10146d372afSGregory Greenman 	/**
102d172a5efSJohannes Berg 	 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
103d172a5efSJohannes Berg 	 */
104d172a5efSJohannes Berg 	STA_PM_NOTIF = 0xFD,
105d172a5efSJohannes Berg 
106d172a5efSJohannes Berg 	/**
107d172a5efSJohannes Berg 	 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
108d172a5efSJohannes Berg 	 */
109d172a5efSJohannes Berg 	MU_GROUP_MGMT_NOTIF = 0xFE,
110d172a5efSJohannes Berg 
111d172a5efSJohannes Berg 	/**
112d172a5efSJohannes Berg 	 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
113d172a5efSJohannes Berg 	 */
114d172a5efSJohannes Berg 	RX_QUEUES_NOTIFICATION = 0xFF,
115d172a5efSJohannes Berg };
116d172a5efSJohannes Berg 
117d172a5efSJohannes Berg /**
118d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
119d172a5efSJohannes Berg  *
120d172a5efSJohannes Berg  * @reserved: reserved
121d172a5efSJohannes Berg  * @membership_status: a bitmap of MU groups
122d172a5efSJohannes Berg  * @user_position:the position of station in a group. If the station is in the
123d172a5efSJohannes Berg  *	group then bits (group * 2) is the position -1
124d172a5efSJohannes Berg  */
125d172a5efSJohannes Berg struct iwl_mu_group_mgmt_cmd {
126d172a5efSJohannes Berg 	__le32 reserved;
127d172a5efSJohannes Berg 	__le32 membership_status[2];
128d172a5efSJohannes Berg 	__le32 user_position[4];
129d172a5efSJohannes Berg } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
130d172a5efSJohannes Berg 
131d172a5efSJohannes Berg /**
132d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
133d172a5efSJohannes Berg  *
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_notif {
139d172a5efSJohannes Berg 	__le32 membership_status[2];
140d172a5efSJohannes Berg 	__le32 user_position[4];
141d172a5efSJohannes Berg } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
142d172a5efSJohannes Berg 
1435213e8a8SJohannes Berg enum iwl_channel_estimation_flags {
1445213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_ENABLE	= BIT(0),
1455213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_TIMER	= BIT(1),
1465213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_COUNTER	= BIT(2),
1475213e8a8SJohannes Berg };
1485213e8a8SJohannes Berg 
1495213e8a8SJohannes Berg /**
1505213e8a8SJohannes Berg  * struct iwl_channel_estimation_cfg - channel estimation reporting config
1515213e8a8SJohannes Berg  */
1525213e8a8SJohannes Berg struct iwl_channel_estimation_cfg {
1535213e8a8SJohannes Berg 	/**
1545213e8a8SJohannes Berg 	 * @flags: flags, see &enum iwl_channel_estimation_flags
1555213e8a8SJohannes Berg 	 */
1565213e8a8SJohannes Berg 	__le32 flags;
1575213e8a8SJohannes Berg 	/**
1585213e8a8SJohannes Berg 	 * @timer: if enabled via flags, automatically disable after this many
1595213e8a8SJohannes Berg 	 *	microseconds
1605213e8a8SJohannes Berg 	 */
1615213e8a8SJohannes Berg 	__le32 timer;
1625213e8a8SJohannes Berg 	/**
1635213e8a8SJohannes Berg 	 * @count: if enabled via flags, automatically disable after this many
1645213e8a8SJohannes Berg 	 *	frames with channel estimation matrix were captured
1655213e8a8SJohannes Berg 	 */
1665213e8a8SJohannes Berg 	__le32 count;
1675213e8a8SJohannes Berg 	/**
1685213e8a8SJohannes Berg 	 * @rate_n_flags_mask: only try to record the channel estimation matrix
1695213e8a8SJohannes Berg 	 *	if the rate_n_flags value for the received frame (let's call
1705213e8a8SJohannes Berg 	 *	that rx_rnf) matches the mask/value given here like this:
1715213e8a8SJohannes Berg 	 *	(rx_rnf & rate_n_flags_mask) == rate_n_flags_val.
1725213e8a8SJohannes Berg 	 */
1735213e8a8SJohannes Berg 	__le32 rate_n_flags_mask;
1745213e8a8SJohannes Berg 	/**
1755213e8a8SJohannes Berg 	 * @rate_n_flags_val: see @rate_n_flags_mask
1765213e8a8SJohannes Berg 	 */
1775213e8a8SJohannes Berg 	__le32 rate_n_flags_val;
1785213e8a8SJohannes Berg 	/**
1795213e8a8SJohannes Berg 	 * @reserved: reserved (for alignment)
1805213e8a8SJohannes Berg 	 */
1815213e8a8SJohannes Berg 	__le32 reserved;
1825213e8a8SJohannes Berg 	/**
1835213e8a8SJohannes Berg 	 * @frame_types: bitmap of frame types to capture, the received frame's
1845213e8a8SJohannes Berg 	 *	subtype|type takes 6 bits in the frame and the corresponding bit
1855213e8a8SJohannes Berg 	 *	in this field must be set to 1 to capture channel estimation for
1865213e8a8SJohannes Berg 	 *	that frame type. Set to all-ones to enable capturing for all
1875213e8a8SJohannes Berg 	 *	frame types.
1885213e8a8SJohannes Berg 	 */
1895213e8a8SJohannes Berg 	__le64 frame_types;
1905213e8a8SJohannes Berg } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */
1915213e8a8SJohannes Berg 
192f7d6ef33SJohannes Berg enum iwl_datapath_monitor_notif_type {
193f7d6ef33SJohannes Berg 	IWL_DP_MON_NOTIF_TYPE_EXT_CCA,
194f7d6ef33SJohannes Berg };
195f7d6ef33SJohannes Berg 
196f7d6ef33SJohannes Berg struct iwl_datapath_monitor_notif {
197f7d6ef33SJohannes Berg 	__le32 type;
198f7d6ef33SJohannes Berg 	u8 mac_id;
199f7d6ef33SJohannes Berg 	u8 reserved[3];
200f7d6ef33SJohannes Berg } __packed; /* MONITOR_NTF_API_S_VER_1 */
201f7d6ef33SJohannes Berg 
2022a7ce54cSJohannes Berg /**
2032a7ce54cSJohannes Berg  * enum iwl_thermal_dual_chain_req_events - firmware SMPS request event
2042a7ce54cSJohannes Berg  * @THERMAL_DUAL_CHAIN_REQ_ENABLE: (re-)enable dual-chain operation
2052a7ce54cSJohannes Berg  *	(subject to other constraints)
2062a7ce54cSJohannes Berg  * @THERMAL_DUAL_CHAIN_REQ_DISABLE: disable dual-chain operation
2072a7ce54cSJohannes Berg  *	(static SMPS)
2082a7ce54cSJohannes Berg  */
2092a7ce54cSJohannes Berg enum iwl_thermal_dual_chain_req_events {
2102a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQ_ENABLE,
2112a7ce54cSJohannes Berg 	THERMAL_DUAL_CHAIN_REQ_DISABLE,
2122a7ce54cSJohannes Berg }; /* THERMAL_DUAL_CHAIN_DISABLE_STATE_API_E_VER_1 */
2132a7ce54cSJohannes Berg 
2142a7ce54cSJohannes Berg /**
2152a7ce54cSJohannes Berg  * struct iwl_thermal_dual_chain_request - SMPS request
2162a7ce54cSJohannes Berg  * @event: the type of request, see &enum iwl_thermal_dual_chain_req_events
2172a7ce54cSJohannes Berg  */
2182a7ce54cSJohannes Berg struct iwl_thermal_dual_chain_request {
2192a7ce54cSJohannes Berg 	__le32 event;
2202a7ce54cSJohannes Berg } __packed; /* THERMAL_DUAL_CHAIN_DISABLE_REQ_NTFY_API_S_VER_1 */
2212a7ce54cSJohannes Berg 
222c48e93a6SJohannes Berg enum iwl_rlc_chain_info {
223c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_DRIVER_FORCE		= BIT(0),
224c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_VALID		= 0x000e,
225c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_FORCE		= 0x0070,
226c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_FORCE_MIMO		= 0x0380,
227c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_COUNT		= 0x0c00,
228c48e93a6SJohannes Berg 	IWL_RLC_CHAIN_INFO_MIMO_COUNT		= 0x3000,
229c48e93a6SJohannes Berg };
230c48e93a6SJohannes Berg 
231c48e93a6SJohannes Berg /**
232c48e93a6SJohannes Berg  * struct iwl_rlc_properties - RLC properties
233c48e93a6SJohannes Berg  * @rx_chain_info: RX chain info, &enum iwl_rlc_chain_info
234c48e93a6SJohannes Berg  * @reserved: reserved
235c48e93a6SJohannes Berg  */
236c48e93a6SJohannes Berg struct iwl_rlc_properties {
237c48e93a6SJohannes Berg 	__le32 rx_chain_info;
238c48e93a6SJohannes Berg 	__le32 reserved;
239c48e93a6SJohannes Berg } __packed; /* RLC_PROPERTIES_S_VER_1 */
240c48e93a6SJohannes Berg 
241c48e93a6SJohannes Berg enum iwl_sad_mode {
242c48e93a6SJohannes Berg 	IWL_SAD_MODE_ENABLED		= BIT(0),
243c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_MSK	= 0x6,
244c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_FW	= 0x0,
245c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_A	= 0x2,
246c48e93a6SJohannes Berg 	IWL_SAD_MODE_DEFAULT_ANT_B	= 0x4,
247c48e93a6SJohannes Berg };
248c48e93a6SJohannes Berg 
249c48e93a6SJohannes Berg /**
250c48e93a6SJohannes Berg  * struct iwl_sad_properties - SAD properties
251c48e93a6SJohannes Berg  * @chain_a_sad_mode: chain A SAD mode, &enum iwl_sad_mode
252c48e93a6SJohannes Berg  * @chain_b_sad_mode: chain B SAD mode, &enum iwl_sad_mode
253c48e93a6SJohannes Berg  * @mac_id: MAC index
254c48e93a6SJohannes Berg  * @reserved: reserved
255c48e93a6SJohannes Berg  */
256c48e93a6SJohannes Berg struct iwl_sad_properties {
257c48e93a6SJohannes Berg 	__le32 chain_a_sad_mode;
258c48e93a6SJohannes Berg 	__le32 chain_b_sad_mode;
259c48e93a6SJohannes Berg 	__le32 mac_id;
260c48e93a6SJohannes Berg 	__le32 reserved;
261c48e93a6SJohannes Berg } __packed;
262c48e93a6SJohannes Berg 
263c48e93a6SJohannes Berg /**
264c48e93a6SJohannes Berg  * struct iwl_rlc_config_cmd - RLC configuration
265c48e93a6SJohannes Berg  * @phy_id: PHY index
266c48e93a6SJohannes Berg  * @rlc: RLC properties, &struct iwl_rlc_properties
267c48e93a6SJohannes Berg  * @sad: SAD (single antenna diversity) options, &struct iwl_sad_properties
268c48e93a6SJohannes Berg  * @flags: flags, &enum iwl_rlc_flags
269c48e93a6SJohannes Berg  * @reserved: reserved
270c48e93a6SJohannes Berg  */
271c48e93a6SJohannes Berg struct iwl_rlc_config_cmd {
272c48e93a6SJohannes Berg 	__le32 phy_id;
273c48e93a6SJohannes Berg 	struct iwl_rlc_properties rlc;
274c48e93a6SJohannes Berg 	struct iwl_sad_properties sad;
275c48e93a6SJohannes Berg 	u8 flags;
276c48e93a6SJohannes Berg 	u8 reserved[3];
277c48e93a6SJohannes Berg } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */
278c48e93a6SJohannes Berg 
279ded5ded3SEmmanuel Grumbach #define IWL_MAX_BAID_OLD	16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */
280ded5ded3SEmmanuel Grumbach #define IWL_MAX_BAID		32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */
281ded5ded3SEmmanuel Grumbach 
28297f70c56SJohannes Berg /**
28397f70c56SJohannes Berg  * enum iwl_rx_baid_action - BAID allocation/config action
28497f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_ADD: add a new BAID session
28597f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_MODIFY: modify the BAID session
28697f70c56SJohannes Berg  * @IWL_RX_BAID_ACTION_REMOVE: remove the BAID session
28797f70c56SJohannes Berg  */
28897f70c56SJohannes Berg enum iwl_rx_baid_action {
28997f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_ADD,
29097f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_MODIFY,
29197f70c56SJohannes Berg 	IWL_RX_BAID_ACTION_REMOVE,
29297f70c56SJohannes Berg }; /*  RX_BAID_ALLOCATION_ACTION_E_VER_1 */
29397f70c56SJohannes Berg 
29497f70c56SJohannes Berg /**
29597f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_alloc - BAID allocation data
29697f70c56SJohannes Berg  * @sta_id_mask: station ID mask
29797f70c56SJohannes Berg  * @tid: the TID for this session
29897f70c56SJohannes Berg  * @reserved: reserved
29997f70c56SJohannes Berg  * @ssn: the starting sequence number
30097f70c56SJohannes Berg  * @win_size: RX BA session window size
30197f70c56SJohannes Berg  */
30297f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_alloc {
30397f70c56SJohannes Berg 	__le32 sta_id_mask;
30497f70c56SJohannes Berg 	u8 tid;
30597f70c56SJohannes Berg 	u8 reserved[3];
30697f70c56SJohannes Berg 	__le16 ssn;
30797f70c56SJohannes Berg 	__le16 win_size;
30897f70c56SJohannes Berg } __packed; /* RX_BAID_ALLOCATION_ADD_CMD_API_S_VER_1 */
30997f70c56SJohannes Berg 
31097f70c56SJohannes Berg /**
31197f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_modify - BAID modification data
31226de4c8bSJohannes Berg  * @old_sta_id_mask: old station ID mask
31326de4c8bSJohannes Berg  * @new_sta_id_mask: new station ID mask
31426de4c8bSJohannes Berg  * @tid: TID of the BAID
31597f70c56SJohannes Berg  */
31697f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_modify {
31726de4c8bSJohannes Berg 	__le32 old_sta_id_mask;
31826de4c8bSJohannes Berg 	__le32 new_sta_id_mask;
31926de4c8bSJohannes Berg 	__le32 tid;
32026de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_MODIFY_CMD_API_S_VER_2 */
32126de4c8bSJohannes Berg 
32226de4c8bSJohannes Berg /**
32326de4c8bSJohannes Berg  * struct iwl_rx_baid_cfg_cmd_remove_v1 - BAID removal data
32426de4c8bSJohannes Berg  * @baid: the BAID to remove
32526de4c8bSJohannes Berg  */
32626de4c8bSJohannes Berg struct iwl_rx_baid_cfg_cmd_remove_v1 {
32797f70c56SJohannes Berg 	__le32 baid;
32826de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_1 */
32997f70c56SJohannes Berg 
33097f70c56SJohannes Berg /**
33197f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd_remove - BAID removal data
33226de4c8bSJohannes Berg  * @sta_id_mask: the station mask of the BAID to remove
33326de4c8bSJohannes Berg  * @tid: the TID of the BAID to remove
33497f70c56SJohannes Berg  */
33597f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd_remove {
33626de4c8bSJohannes Berg 	__le32 sta_id_mask;
33726de4c8bSJohannes Berg 	__le32 tid;
33826de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_2 */
33997f70c56SJohannes Berg 
34097f70c56SJohannes Berg /**
34197f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_cmd - BAID allocation/config command
34297f70c56SJohannes Berg  * @action: the action, from &enum iwl_rx_baid_action
34397f70c56SJohannes Berg  */
34497f70c56SJohannes Berg struct iwl_rx_baid_cfg_cmd {
34597f70c56SJohannes Berg 	__le32 action;
34697f70c56SJohannes Berg 	union {
34797f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_alloc alloc;
34897f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_modify modify;
34926de4c8bSJohannes Berg 		struct iwl_rx_baid_cfg_cmd_remove_v1 remove_v1;
35097f70c56SJohannes Berg 		struct iwl_rx_baid_cfg_cmd_remove remove;
35126de4c8bSJohannes Berg 	}; /* RX_BAID_ALLOCATION_OPERATION_API_U_VER_2 */
35226de4c8bSJohannes Berg } __packed; /* RX_BAID_ALLOCATION_CONFIG_CMD_API_S_VER_2 */
35397f70c56SJohannes Berg 
35497f70c56SJohannes Berg /**
35597f70c56SJohannes Berg  * struct iwl_rx_baid_cfg_resp - BAID allocation response
35697f70c56SJohannes Berg  * @baid: the allocated BAID
35797f70c56SJohannes Berg  */
35897f70c56SJohannes Berg struct iwl_rx_baid_cfg_resp {
35997f70c56SJohannes Berg 	__le32 baid;
36097f70c56SJohannes Berg }; /* RX_BAID_ALLOCATION_RESPONSE_API_S_VER_1 */
36197f70c56SJohannes Berg 
362227f2597SJohannes Berg /**
363227f2597SJohannes Berg  * enum iwl_scd_queue_cfg_operation - scheduler queue operation
364227f2597SJohannes Berg  * @IWL_SCD_QUEUE_ADD: allocate a new queue
365227f2597SJohannes Berg  * @IWL_SCD_QUEUE_REMOVE: remove a queue
366227f2597SJohannes Berg  * @IWL_SCD_QUEUE_MODIFY: modify a queue
367227f2597SJohannes Berg  */
368227f2597SJohannes Berg enum iwl_scd_queue_cfg_operation {
369227f2597SJohannes Berg 	IWL_SCD_QUEUE_ADD = 0,
370227f2597SJohannes Berg 	IWL_SCD_QUEUE_REMOVE = 1,
371227f2597SJohannes Berg 	IWL_SCD_QUEUE_MODIFY = 2,
372227f2597SJohannes Berg };
373227f2597SJohannes Berg 
374227f2597SJohannes Berg /**
375227f2597SJohannes Berg  * struct iwl_scd_queue_cfg_cmd - scheduler queue allocation command
376227f2597SJohannes Berg  * @operation: the operation, see &enum iwl_scd_queue_cfg_operation
377227f2597SJohannes Berg  * @u.add.sta_mask: station mask
378227f2597SJohannes Berg  * @u.add.tid: TID
379227f2597SJohannes Berg  * @u.add.reserved: reserved
380227f2597SJohannes Berg  * @u.add.flags: flags from &enum iwl_tx_queue_cfg_actions, except
381227f2597SJohannes Berg  *	%TX_QUEUE_CFG_ENABLE_QUEUE is not valid
382227f2597SJohannes Berg  * @u.add.cb_size: size code
383227f2597SJohannes Berg  * @u.add.bc_dram_addr: byte-count table IOVA
384227f2597SJohannes Berg  * @u.add.tfdq_dram_addr: TFD queue IOVA
385227f2597SJohannes Berg  * @u.remove.queue: queue ID for removal
386227f2597SJohannes Berg  * @u.modify.sta_mask: new station mask for modify
387227f2597SJohannes Berg  * @u.modify.queue: queue ID to modify
388227f2597SJohannes Berg  */
389227f2597SJohannes Berg struct iwl_scd_queue_cfg_cmd {
390227f2597SJohannes Berg 	__le32 operation;
391227f2597SJohannes Berg 	union {
392227f2597SJohannes Berg 		struct {
393227f2597SJohannes Berg 			__le32 sta_mask;
394227f2597SJohannes Berg 			u8 tid;
395227f2597SJohannes Berg 			u8 reserved[3];
396227f2597SJohannes Berg 			__le32 flags;
397227f2597SJohannes Berg 			__le32 cb_size;
398227f2597SJohannes Berg 			__le64 bc_dram_addr;
399227f2597SJohannes Berg 			__le64 tfdq_dram_addr;
400227f2597SJohannes Berg 		} __packed add; /* TX_QUEUE_CFG_CMD_ADD_API_S_VER_1 */
401227f2597SJohannes Berg 		struct {
402227f2597SJohannes Berg 			__le32 queue;
403227f2597SJohannes Berg 		} __packed remove; /* TX_QUEUE_CFG_CMD_REMOVE_API_S_VER_1 */
404227f2597SJohannes Berg 		struct {
405227f2597SJohannes Berg 			__le32 sta_mask;
406227f2597SJohannes Berg 			__le32 queue;
407227f2597SJohannes Berg 		} __packed modify; /* TX_QUEUE_CFG_CMD_MODIFY_API_S_VER_1 */
408227f2597SJohannes Berg 	} __packed u; /* TX_QUEUE_CFG_CMD_OPERATION_API_U_VER_1 */
409227f2597SJohannes Berg } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_3 */
410227f2597SJohannes Berg 
411*5c75a208SJohannes Berg /**
412*5c75a208SJohannes Berg  * enum iwl_sec_key_flags - security key command key flags
413*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_MASK: cipher mask
414*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_WEP: WEP cipher
415*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_CCMP: CCMP/CMAC cipher
416*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_TKIP: TKIP cipher
417*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_CIPHER_GCMP: GCMP/GMAC cipher
418*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_NO_TX: don't install for TX
419*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_KEY_SIZE: large key size (WEP-104, GCMP-256, GMAC-256)
420*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_MFP: MFP is in used for this key
421*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_MCAST_KEY: this is a multicast key
422*5c75a208SJohannes Berg  * @IWL_SEC_KEY_FLAG_SPP_AMSDU: SPP A-MSDU should be used
423*5c75a208SJohannes Berg  */
424*5c75a208SJohannes Berg enum iwl_sec_key_flags {
425*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_MASK	= 0x07,
426*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_WEP	= 0x01,
427*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_CCMP	= 0x02,
428*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_TKIP	= 0x03,
429*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_CIPHER_GCMP	= 0x05,
430*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_NO_TX		= 0x08,
431*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_KEY_SIZE	= 0x10,
432*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_MFP		= 0x20,
433*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_MCAST_KEY	= 0x40,
434*5c75a208SJohannes Berg 	IWL_SEC_KEY_FLAG_SPP_AMSDU	= 0x80,
435*5c75a208SJohannes Berg };
436*5c75a208SJohannes Berg 
437*5c75a208SJohannes Berg #define IWL_SEC_WEP_KEY_OFFSET	3
438*5c75a208SJohannes Berg 
439*5c75a208SJohannes Berg /**
440*5c75a208SJohannes Berg  * struct iwl_sec_key_cmd - security key command
441*5c75a208SJohannes Berg  * @action: action from &enum iwl_ctxt_action
442*5c75a208SJohannes Berg  * @u.add.sta_mask: station mask for the new key
443*5c75a208SJohannes Berg  * @u.add.key_id: key ID (0-7) for the new key
444*5c75a208SJohannes Berg  * @u.add.key_flags: key flags per &enum iwl_sec_key_flags
445*5c75a208SJohannes Berg  * @u.add.key: key material. WEP keys should start from &IWL_SEC_WEP_KEY_OFFSET.
446*5c75a208SJohannes Berg  * @u.add.tkip_mic_rx_key: TKIP MIC RX key
447*5c75a208SJohannes Berg  * @u.add.tkip_mic_tx_key: TKIP MIC TX key
448*5c75a208SJohannes Berg  * @u.add.rx_seq: RX sequence counter value
449*5c75a208SJohannes Berg  * @u.add.tx_seq: TX sequence counter value
450*5c75a208SJohannes Berg  * @u.modify.old_sta_mask: old station mask
451*5c75a208SJohannes Berg  * @u.modify.new_sta_mask: new station mask
452*5c75a208SJohannes Berg  * @u.modify.key_id: key ID
453*5c75a208SJohannes Berg  * @u.modify.key_flags: new key flags
454*5c75a208SJohannes Berg  * @u.remove.sta_mask: station mask
455*5c75a208SJohannes Berg  * @u.remove.key_id: key ID
456*5c75a208SJohannes Berg  * @u.remove.key_flags: key flags
457*5c75a208SJohannes Berg  */
458*5c75a208SJohannes Berg struct iwl_sec_key_cmd {
459*5c75a208SJohannes Berg 	__le32 action;
460*5c75a208SJohannes Berg 	union {
461*5c75a208SJohannes Berg 		struct {
462*5c75a208SJohannes Berg 			__le32 sta_mask;
463*5c75a208SJohannes Berg 			__le32 key_id;
464*5c75a208SJohannes Berg 			__le32 key_flags;
465*5c75a208SJohannes Berg 			u8 key[32];
466*5c75a208SJohannes Berg 			u8 tkip_mic_rx_key[8];
467*5c75a208SJohannes Berg 			u8 tkip_mic_tx_key[8];
468*5c75a208SJohannes Berg 			__le64 rx_seq;
469*5c75a208SJohannes Berg 			__le64 tx_seq;
470*5c75a208SJohannes Berg 		} __packed add; /* SEC_KEY_ADD_CMD_API_S_VER_1 */
471*5c75a208SJohannes Berg 		struct {
472*5c75a208SJohannes Berg 			__le32 old_sta_mask;
473*5c75a208SJohannes Berg 			__le32 new_sta_mask;
474*5c75a208SJohannes Berg 			__le32 key_id;
475*5c75a208SJohannes Berg 			__le32 key_flags;
476*5c75a208SJohannes Berg 		} __packed modify; /* SEC_KEY_MODIFY_CMD_API_S_VER_1 */
477*5c75a208SJohannes Berg 		struct {
478*5c75a208SJohannes Berg 			__le32 sta_mask;
479*5c75a208SJohannes Berg 			__le32 key_id;
480*5c75a208SJohannes Berg 			__le32 key_flags;
481*5c75a208SJohannes Berg 		} __packed remove; /* SEC_KEY_REMOVE_CMD_API_S_VER_1 */
482*5c75a208SJohannes Berg 	} __packed u; /* SEC_KEY_OPERATION_API_U_VER_1 */
483*5c75a208SJohannes Berg } __packed; /* SEC_KEY_CMD_API_S_VER_1 */
484*5c75a208SJohannes Berg 
485d172a5efSJohannes Berg #endif /* __iwl_fw_api_datapath_h__ */
486