xref: /linux/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2024 Intel Corporation
4  * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
5  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
6  * Copyright (C) 2016-2017 Intel Deutschland GmbH
7  */
8 #ifndef __iwl_fw_api_datapath_h__
9 #define __iwl_fw_api_datapath_h__
10 
11 /**
12  * enum iwl_data_path_subcmd_ids - data path group commands
13  */
14 enum iwl_data_path_subcmd_ids {
15 	/**
16 	 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
17 	 */
18 	DQA_ENABLE_CMD = 0x0,
19 
20 	/**
21 	 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
22 	 */
23 	UPDATE_MU_GROUPS_CMD = 0x1,
24 
25 	/**
26 	 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
27 	 */
28 	TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
29 
30 	/**
31 	 * @WNM_PLATFORM_PTM_REQUEST_CMD: &struct iwl_time_sync_cfg_cmd
32 	 */
33 	WNM_PLATFORM_PTM_REQUEST_CMD = 0x3,
34 
35 	/**
36 	 * @WNM_80211V_TIMING_MEASUREMENT_CONFIG_CMD:
37 	 *	&struct iwl_time_sync_cfg_cmd
38 	 */
39 	WNM_80211V_TIMING_MEASUREMENT_CONFIG_CMD = 0x4,
40 
41 	/**
42 	 * @STA_HE_CTXT_CMD: &struct iwl_he_sta_context_cmd_v1,
43 	 *	&struct iwl_he_sta_context_cmd_v2 or
44 	 *	&struct iwl_he_sta_context_cmd_v3
45 	 */
46 	STA_HE_CTXT_CMD = 0x7,
47 
48 	/**
49 	 * @RLC_CONFIG_CMD: &struct iwl_rlc_config_cmd
50 	 */
51 	RLC_CONFIG_CMD = 0x8,
52 
53 	/**
54 	 * @RFH_QUEUE_CONFIG_CMD: &struct iwl_rfh_queue_config
55 	 */
56 	RFH_QUEUE_CONFIG_CMD = 0xD,
57 
58 	/**
59 	 * @TLC_MNG_CONFIG_CMD: &struct iwl_tlc_config_cmd_v4
60 	 */
61 	TLC_MNG_CONFIG_CMD = 0xF,
62 
63 	/**
64 	 * @HE_AIR_SNIFFER_CONFIG_CMD: &struct iwl_he_monitor_cmd
65 	 */
66 	HE_AIR_SNIFFER_CONFIG_CMD = 0x13,
67 
68 	/**
69 	 * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI
70 	 *	matrix collection, uses &struct iwl_channel_estimation_cfg
71 	 */
72 	CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14,
73 
74 	/**
75 	 * @RX_BAID_ALLOCATION_CONFIG_CMD: Allocate/deallocate a BAID for an RX
76 	 *	blockack session, uses &struct iwl_rx_baid_cfg_cmd for the
77 	 *	command, and &struct iwl_rx_baid_cfg_resp as a response.
78 	 */
79 	RX_BAID_ALLOCATION_CONFIG_CMD = 0x16,
80 
81 	/**
82 	 * @SCD_QUEUE_CONFIG_CMD: new scheduler queue allocation/config/removal
83 	 *	command, uses &struct iwl_scd_queue_cfg_cmd and the response
84 	 *	is (same as before) &struct iwl_tx_queue_cfg_rsp.
85 	 */
86 	SCD_QUEUE_CONFIG_CMD = 0x17,
87 
88 	/**
89 	 * @SEC_KEY_CMD: security key command, uses &struct iwl_sec_key_cmd
90 	 */
91 	SEC_KEY_CMD = 0x18,
92 
93 	/**
94 	 * @ESR_MODE_NOTIF: notification to recommend/force a wanted esr mode,
95 	 *	uses &struct iwl_mvm_esr_mode_notif
96 	 */
97 	ESR_MODE_NOTIF = 0xF3,
98 
99 	/**
100 	 * @MONITOR_NOTIF: Datapath monitoring notification, using
101 	 *	&struct iwl_datapath_monitor_notif
102 	 */
103 	MONITOR_NOTIF = 0xF4,
104 
105 	/**
106 	 * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data or &struct iwl_rx_no_data_ver_3
107 	 */
108 	RX_NO_DATA_NOTIF = 0xF5,
109 
110 	/**
111 	 * @THERMAL_DUAL_CHAIN_REQUEST: firmware request for SMPS mode,
112 	 *	&struct iwl_thermal_dual_chain_request
113 	 */
114 	THERMAL_DUAL_CHAIN_REQUEST = 0xF6,
115 
116 	/**
117 	 * @TLC_MNG_UPDATE_NOTIF: &struct iwl_tlc_update_notif
118 	 */
119 	TLC_MNG_UPDATE_NOTIF = 0xF7,
120 
121 	/**
122 	 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
123 	 */
124 	STA_PM_NOTIF = 0xFD,
125 
126 	/**
127 	 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
128 	 */
129 	MU_GROUP_MGMT_NOTIF = 0xFE,
130 
131 	/**
132 	 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
133 	 */
134 	RX_QUEUES_NOTIFICATION = 0xFF,
135 };
136 
137 /**
138  * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
139  *
140  * @reserved: reserved
141  * @membership_status: a bitmap of MU groups
142  * @user_position:the position of station in a group. If the station is in the
143  *	group then bits (group * 2) is the position -1
144  */
145 struct iwl_mu_group_mgmt_cmd {
146 	__le32 reserved;
147 	__le32 membership_status[2];
148 	__le32 user_position[4];
149 } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
150 
151 /**
152  * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
153  *
154  * @membership_status: a bitmap of MU groups
155  * @user_position: the position of station in a group. If the station is in the
156  *	group then bits (group * 2) is the position -1
157  */
158 struct iwl_mu_group_mgmt_notif {
159 	__le32 membership_status[2];
160 	__le32 user_position[4];
161 } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
162 
163 enum iwl_channel_estimation_flags {
164 	IWL_CHANNEL_ESTIMATION_ENABLE	= BIT(0),
165 	IWL_CHANNEL_ESTIMATION_TIMER	= BIT(1),
166 	IWL_CHANNEL_ESTIMATION_COUNTER	= BIT(2),
167 };
168 
169 enum iwl_time_sync_protocol_type {
170 	IWL_TIME_SYNC_PROTOCOL_TM	= BIT(0),
171 	IWL_TIME_SYNC_PROTOCOL_FTM	= BIT(1),
172 }; /* WNM_TIMING_ENABLED_PROTOCOL_API_E_VER_1 */
173 
174 /**
175  * struct iwl_time_sync_cfg_cmd - TM/FTM time sync measurement configuration
176  *
177  * @protocols: The type of frames to raise notifications for. A bitmap
178  *	of @iwl_time_sync_protocol_type
179  * @peer_addr: peer address with which TM/FTM measurements are required
180  * @reserved: for alignment
181  */
182 struct iwl_time_sync_cfg_cmd {
183 	__le32 protocols;
184 	u8 peer_addr[ETH_ALEN];
185 	u8 reserved[2];
186 } __packed; /* WNM_80211V_TIMING_MEASUREMENT_CONFIG_CMD_API_S_VER_1 */
187 
188 /**
189  * enum iwl_synced_time_operation - PTM request options
190  *
191  * @IWL_SYNCED_TIME_OPERATION_READ_ARTB: read only the ARTB time
192  * @IWL_SYNCED_TIME_OPERATION_READ_GP2: read only the GP2 time
193  * @IWL_SYNCED_TIME_OPERATION_READ_BOTH: latch the ARTB and GP2 clocks and
194  *	provide timestamps from both clocks for the same time point
195  */
196 enum iwl_synced_time_operation {
197 	IWL_SYNCED_TIME_OPERATION_READ_ARTB = 1,
198 	IWL_SYNCED_TIME_OPERATION_READ_GP2,
199 	IWL_SYNCED_TIME_OPERATION_READ_BOTH,
200 };
201 
202 /**
203  * struct iwl_synced_time_cmd - request synced GP2/ARTB timestamps
204  *
205  * @operation: one of &enum iwl_synced_time_operation
206  */
207 struct iwl_synced_time_cmd {
208 	__le32 operation;
209 } __packed; /* WNM_80211V_TIMING_CMD_API_S_VER_1 */
210 
211 /**
212  * struct iwl_synced_time_rsp - response to iwl_synced_time_cmd
213  *
214  * @operation: one of &enum iwl_synced_time_operation
215  * @platform_timestamp_hi: high DWORD of the ARTB clock timestamp in nanoseconds
216  * @platform_timestamp_lo: low DWORD of the ARTB clock timestamp in nanoseconds
217  * @gp2_timestamp_hi: high DWORD of the GP2 clock timestamp in 10's of
218  *	nanoseconds
219  * @gp2_timestamp_lo: low DWORD of the GP2 clock timestamp in 10's of
220  *	nanoseconds
221  */
222 struct iwl_synced_time_rsp {
223 	__le32 operation;
224 	__le32 platform_timestamp_hi;
225 	__le32 platform_timestamp_lo;
226 	__le32 gp2_timestamp_hi;
227 	__le32 gp2_timestamp_lo;
228 } __packed; /* WNM_80211V_TIMING_RSP_API_S_VER_1 */
229 
230 /* PTP_CTX_MAX_DATA_SIZE_IN_API_D_VER_1 */
231 #define PTP_CTX_MAX_DATA_SIZE   128
232 
233 /**
234  * struct iwl_time_msmt_ptp_ctx - Vendor specific element
235  * to allow a space for flexibility for the userspace App
236  *
237  * @ftm: FTM specific vendor element
238  * @ftm.element_id: element id of vendor specific ie
239  * @ftm.length: length of vendor specific ie
240  * @ftm.reserved: for alignment
241  * @ftm.data: vendor specific data blob
242  * @tm: TM specific vendor element
243  * @tm.element_id: element id of vendor specific ie
244  * @tm.length: length of vendor specific ie
245  * @tm.data: vendor specific data blob
246  */
247 struct iwl_time_msmt_ptp_ctx {
248 	/* Differentiate between FTM and TM specific Vendor elements */
249 	union {
250 		struct {
251 			u8 element_id;
252 			u8 length;
253 			__le16 reserved;
254 			u8 data[PTP_CTX_MAX_DATA_SIZE];
255 		} ftm;
256 		struct {
257 			u8 element_id;
258 			u8 length;
259 			u8 data[PTP_CTX_MAX_DATA_SIZE];
260 		} tm;
261 	};
262 } __packed /* PTP_CTX_VER_1 */;
263 
264 /**
265  * struct iwl_time_msmt_notify - Time Sync measurement notification
266  * for TM/FTM, along with additional meta data.
267  *
268  * @peer_addr: peer address
269  * @reserved: for alignment
270  * @dialog_token: measurement flow dialog token number
271  * @followup_dialog_token: Measurement flow previous dialog token number
272  * @t1_hi: high dword of t1-time of the Tx'ed action frame departure on
273  *	sender side in units of 10 nano seconds
274  * @t1_lo: low dword of t1-time of the Tx'ed action frame departure on
275  *	sender side in units of 10 nano seconds
276  * @t1_max_err: maximum t1-time error in units of 10 nano seconds
277  * @t4_hi: high dword of t4-time of the Rx'ed action frame's Ack arrival on
278  *	sender side in units of 10 nano seconds
279  * @t4_lo: low dword of t4-time of the Rx'ed action frame's Ack arrival on
280  *	sender side in units of 10 nano seconds
281  * @t4_max_err: maximum t4-time error in units of 10 nano seconds
282  * @t2_hi: high dword of t2-time of the Rx'ed action frame arrival on
283  *	receiver side in units of 10 nano seconds
284  * @t2_lo: low dword of t2-time of the Rx'ed action frame arrival on
285  *	receiver side in units of 10 nano seconds
286  * @t2_max_err: maximum t2-time error in units of 10 nano seconds
287  * @t3_hi: high dword of t3-time of the Tx'ed action frame's Ack departure on
288  *	receiver side in units of 10 nano seconds
289  * @t3_lo: low dword of t3-time of the Tx'ed action frame's Ack departure on
290  *	receiver side in units of 10 nano seconds
291  * @t3_max_err: maximum t3-time error in units of 10 nano seconds
292  * @ptp: vendor specific information element
293  */
294 struct iwl_time_msmt_notify {
295 	u8 peer_addr[ETH_ALEN];
296 	u8 reserved[2];
297 	__le32 dialog_token;
298 	__le32 followup_dialog_token;
299 	__le32 t1_hi;
300 	__le32 t1_lo;
301 	__le32 t1_max_err;
302 	__le32 t4_hi;
303 	__le32 t4_lo;
304 	__le32 t4_max_err;
305 	__le32 t2_hi;
306 	__le32 t2_lo;
307 	__le32 t2_max_err;
308 	__le32 t3_hi;
309 	__le32 t3_lo;
310 	__le32 t3_max_err;
311 	struct iwl_time_msmt_ptp_ctx ptp;
312 } __packed; /* WNM_80211V_TIMING_MEASUREMENT_NTFY_API_S_VER_1 */
313 
314 /**
315  * struct iwl_time_msmt_cfm_notify - Time Sync measurement confirmation
316  * notification for TM/FTM. Sent on receipt of 802.11 Ack from peer for the
317  * Tx'ed TM/FTM measurement action frame.
318  *
319  * @peer_addr: peer address
320  * @reserved: for alignment
321  * @dialog_token: measurement flow dialog token number
322  * @t1_hi: high dword of t1-time of the Tx'ed action frame departure on
323  *	sender side in units of 10 nano seconds
324  * @t1_lo: low dword of t1-time of the Tx'ed action frame departure on
325  *	sender side in units of 10 nano seconds
326  * @t1_max_err: maximum t1-time error in units of 10 nano seconds
327  * @t4_hi: high dword of t4-time of the Rx'ed action frame's Ack arrival on
328  *	sender side in units of 10 nano seconds
329  * @t4_lo: low dword of t4-time of the Rx'ed action frame's Ack arrival on
330  *	sender side in units of 10 nano seconds
331  * @t4_max_err: maximum t4-time error in units of 10 nano seconds
332  */
333 struct iwl_time_msmt_cfm_notify {
334 	u8 peer_addr[ETH_ALEN];
335 	u8 reserved[2];
336 	__le32 dialog_token;
337 	__le32 t1_hi;
338 	__le32 t1_lo;
339 	__le32 t1_max_err;
340 	__le32 t4_hi;
341 	__le32 t4_lo;
342 	__le32 t4_max_err;
343 } __packed; /* WNM_80211V_TIMING_MEASUREMENT_CONFIRM_NTFY_API_S_VER_1 */
344 
345 /**
346  * struct iwl_channel_estimation_cfg - channel estimation reporting config
347  */
348 struct iwl_channel_estimation_cfg {
349 	/**
350 	 * @flags: flags, see &enum iwl_channel_estimation_flags
351 	 */
352 	__le32 flags;
353 	/**
354 	 * @timer: if enabled via flags, automatically disable after this many
355 	 *	microseconds
356 	 */
357 	__le32 timer;
358 	/**
359 	 * @count: if enabled via flags, automatically disable after this many
360 	 *	frames with channel estimation matrix were captured
361 	 */
362 	__le32 count;
363 	/**
364 	 * @rate_n_flags_mask: only try to record the channel estimation matrix
365 	 *	if the rate_n_flags value for the received frame (let's call
366 	 *	that rx_rnf) matches the mask/value given here like this:
367 	 *	(rx_rnf & rate_n_flags_mask) == rate_n_flags_val.
368 	 */
369 	__le32 rate_n_flags_mask;
370 	/**
371 	 * @rate_n_flags_val: see @rate_n_flags_mask
372 	 */
373 	__le32 rate_n_flags_val;
374 	/**
375 	 * @reserved: reserved (for alignment)
376 	 */
377 	__le32 reserved;
378 	/**
379 	 * @frame_types: bitmap of frame types to capture, the received frame's
380 	 *	subtype|type takes 6 bits in the frame and the corresponding bit
381 	 *	in this field must be set to 1 to capture channel estimation for
382 	 *	that frame type. Set to all-ones to enable capturing for all
383 	 *	frame types.
384 	 */
385 	__le64 frame_types;
386 } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */
387 
388 enum iwl_datapath_monitor_notif_type {
389 	IWL_DP_MON_NOTIF_TYPE_EXT_CCA,
390 };
391 
392 struct iwl_datapath_monitor_notif {
393 	__le32 type;
394 	u8 mac_id;
395 	u8 reserved[3];
396 } __packed; /* MONITOR_NTF_API_S_VER_1 */
397 
398 /**
399  * enum iwl_thermal_dual_chain_req_events - firmware SMPS request event
400  * @THERMAL_DUAL_CHAIN_REQ_ENABLE: (re-)enable dual-chain operation
401  *	(subject to other constraints)
402  * @THERMAL_DUAL_CHAIN_REQ_DISABLE: disable dual-chain operation
403  *	(static SMPS)
404  */
405 enum iwl_thermal_dual_chain_req_events {
406 	THERMAL_DUAL_CHAIN_REQ_ENABLE,
407 	THERMAL_DUAL_CHAIN_REQ_DISABLE,
408 }; /* THERMAL_DUAL_CHAIN_DISABLE_STATE_API_E_VER_1 */
409 
410 /**
411  * struct iwl_thermal_dual_chain_request - SMPS request
412  * @event: the type of request, see &enum iwl_thermal_dual_chain_req_events
413  */
414 struct iwl_thermal_dual_chain_request {
415 	__le32 event;
416 } __packed; /* THERMAL_DUAL_CHAIN_DISABLE_REQ_NTFY_API_S_VER_1 */
417 
418 enum iwl_rlc_chain_info {
419 	IWL_RLC_CHAIN_INFO_DRIVER_FORCE		= BIT(0),
420 	IWL_RLC_CHAIN_INFO_VALID		= 0x000e,
421 	IWL_RLC_CHAIN_INFO_FORCE		= 0x0070,
422 	IWL_RLC_CHAIN_INFO_FORCE_MIMO		= 0x0380,
423 	IWL_RLC_CHAIN_INFO_COUNT		= 0x0c00,
424 	IWL_RLC_CHAIN_INFO_MIMO_COUNT		= 0x3000,
425 };
426 
427 /**
428  * struct iwl_rlc_properties - RLC properties
429  * @rx_chain_info: RX chain info, &enum iwl_rlc_chain_info
430  * @reserved: reserved
431  */
432 struct iwl_rlc_properties {
433 	__le32 rx_chain_info;
434 	__le32 reserved;
435 } __packed; /* RLC_PROPERTIES_S_VER_1 */
436 
437 enum iwl_sad_mode {
438 	IWL_SAD_MODE_ENABLED		= BIT(0),
439 	IWL_SAD_MODE_DEFAULT_ANT_MSK	= 0x6,
440 	IWL_SAD_MODE_DEFAULT_ANT_FW	= 0x0,
441 	IWL_SAD_MODE_DEFAULT_ANT_A	= 0x2,
442 	IWL_SAD_MODE_DEFAULT_ANT_B	= 0x4,
443 };
444 
445 /**
446  * struct iwl_sad_properties - SAD properties
447  * @chain_a_sad_mode: chain A SAD mode, &enum iwl_sad_mode
448  * @chain_b_sad_mode: chain B SAD mode, &enum iwl_sad_mode
449  * @mac_id: MAC index
450  * @reserved: reserved
451  */
452 struct iwl_sad_properties {
453 	__le32 chain_a_sad_mode;
454 	__le32 chain_b_sad_mode;
455 	__le32 mac_id;
456 	__le32 reserved;
457 } __packed;
458 
459 /**
460  * struct iwl_rlc_config_cmd - RLC configuration
461  * @phy_id: PHY index
462  * @rlc: RLC properties, &struct iwl_rlc_properties
463  * @sad: SAD (single antenna diversity) options, &struct iwl_sad_properties
464  * @flags: flags (unused)
465  * @reserved: reserved
466  */
467 struct iwl_rlc_config_cmd {
468 	__le32 phy_id;
469 	struct iwl_rlc_properties rlc;
470 	struct iwl_sad_properties sad;
471 	u8 flags;
472 	u8 reserved[3];
473 } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */
474 
475 #define IWL_MAX_BAID_OLD	16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */
476 #define IWL_MAX_BAID		32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */
477 
478 /**
479  * enum iwl_rx_baid_action - BAID allocation/config action
480  * @IWL_RX_BAID_ACTION_ADD: add a new BAID session
481  * @IWL_RX_BAID_ACTION_MODIFY: modify the BAID session
482  * @IWL_RX_BAID_ACTION_REMOVE: remove the BAID session
483  */
484 enum iwl_rx_baid_action {
485 	IWL_RX_BAID_ACTION_ADD,
486 	IWL_RX_BAID_ACTION_MODIFY,
487 	IWL_RX_BAID_ACTION_REMOVE,
488 }; /*  RX_BAID_ALLOCATION_ACTION_E_VER_1 */
489 
490 /**
491  * struct iwl_rx_baid_cfg_cmd_alloc - BAID allocation data
492  * @sta_id_mask: station ID mask
493  * @tid: the TID for this session
494  * @reserved: reserved
495  * @ssn: the starting sequence number
496  * @win_size: RX BA session window size
497  */
498 struct iwl_rx_baid_cfg_cmd_alloc {
499 	__le32 sta_id_mask;
500 	u8 tid;
501 	u8 reserved[3];
502 	__le16 ssn;
503 	__le16 win_size;
504 } __packed; /* RX_BAID_ALLOCATION_ADD_CMD_API_S_VER_1 */
505 
506 /**
507  * struct iwl_rx_baid_cfg_cmd_modify - BAID modification data
508  * @old_sta_id_mask: old station ID mask
509  * @new_sta_id_mask: new station ID mask
510  * @tid: TID of the BAID
511  */
512 struct iwl_rx_baid_cfg_cmd_modify {
513 	__le32 old_sta_id_mask;
514 	__le32 new_sta_id_mask;
515 	__le32 tid;
516 } __packed; /* RX_BAID_ALLOCATION_MODIFY_CMD_API_S_VER_2 */
517 
518 /**
519  * struct iwl_rx_baid_cfg_cmd_remove_v1 - BAID removal data
520  * @baid: the BAID to remove
521  */
522 struct iwl_rx_baid_cfg_cmd_remove_v1 {
523 	__le32 baid;
524 } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_1 */
525 
526 /**
527  * struct iwl_rx_baid_cfg_cmd_remove - BAID removal data
528  * @sta_id_mask: the station mask of the BAID to remove
529  * @tid: the TID of the BAID to remove
530  */
531 struct iwl_rx_baid_cfg_cmd_remove {
532 	__le32 sta_id_mask;
533 	__le32 tid;
534 } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_2 */
535 
536 /**
537  * struct iwl_rx_baid_cfg_cmd - BAID allocation/config command
538  * @action: the action, from &enum iwl_rx_baid_action
539  * @alloc: allocation data
540  * @modify: modify data
541  * @remove_v1: remove data (version 1)
542  * @remove: remove data
543  */
544 struct iwl_rx_baid_cfg_cmd {
545 	__le32 action;
546 	union {
547 		struct iwl_rx_baid_cfg_cmd_alloc alloc;
548 		struct iwl_rx_baid_cfg_cmd_modify modify;
549 		struct iwl_rx_baid_cfg_cmd_remove_v1 remove_v1;
550 		struct iwl_rx_baid_cfg_cmd_remove remove;
551 	}; /* RX_BAID_ALLOCATION_OPERATION_API_U_VER_2 */
552 } __packed; /* RX_BAID_ALLOCATION_CONFIG_CMD_API_S_VER_2 */
553 
554 /**
555  * struct iwl_rx_baid_cfg_resp - BAID allocation response
556  * @baid: the allocated BAID
557  */
558 struct iwl_rx_baid_cfg_resp {
559 	__le32 baid;
560 }; /* RX_BAID_ALLOCATION_RESPONSE_API_S_VER_1 */
561 
562 /**
563  * enum iwl_scd_queue_cfg_operation - scheduler queue operation
564  * @IWL_SCD_QUEUE_ADD: allocate a new queue
565  * @IWL_SCD_QUEUE_REMOVE: remove a queue
566  * @IWL_SCD_QUEUE_MODIFY: modify a queue
567  */
568 enum iwl_scd_queue_cfg_operation {
569 	IWL_SCD_QUEUE_ADD = 0,
570 	IWL_SCD_QUEUE_REMOVE = 1,
571 	IWL_SCD_QUEUE_MODIFY = 2,
572 };
573 
574 /**
575  * struct iwl_scd_queue_cfg_cmd - scheduler queue allocation command
576  * @operation: the operation, see &enum iwl_scd_queue_cfg_operation
577  * @u: union depending on command usage
578  * @u.add.sta_mask: station mask
579  * @u.add.tid: TID
580  * @u.add.reserved: reserved
581  * @u.add.flags: flags from &enum iwl_tx_queue_cfg_actions, except
582  *	%TX_QUEUE_CFG_ENABLE_QUEUE is not valid
583  * @u.add.cb_size: size code
584  * @u.add.bc_dram_addr: byte-count table IOVA
585  * @u.add.tfdq_dram_addr: TFD queue IOVA
586  * @u.remove.sta_mask: station mask of queue to remove
587  * @u.remove.tid: TID of queue to remove
588  * @u.modify.old_sta_mask: old station mask for modify
589  * @u.modify.tid: TID of queue to modify
590  * @u.modify.new_sta_mask: new station mask for modify
591  */
592 struct iwl_scd_queue_cfg_cmd {
593 	__le32 operation;
594 	union {
595 		struct {
596 			__le32 sta_mask;
597 			u8 tid;
598 			u8 reserved[3];
599 			__le32 flags;
600 			__le32 cb_size;
601 			__le64 bc_dram_addr;
602 			__le64 tfdq_dram_addr;
603 		} __packed add; /* TX_QUEUE_CFG_CMD_ADD_API_S_VER_1 */
604 		struct {
605 			__le32 sta_mask;
606 			__le32 tid;
607 		} __packed remove; /* TX_QUEUE_CFG_CMD_REMOVE_API_S_VER_1 */
608 		struct {
609 			__le32 old_sta_mask;
610 			__le32 tid;
611 			__le32 new_sta_mask;
612 		} __packed modify; /* TX_QUEUE_CFG_CMD_MODIFY_API_S_VER_1 */
613 	} __packed u; /* TX_QUEUE_CFG_CMD_OPERATION_API_U_VER_1 */
614 } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_3 */
615 
616 /**
617  * enum iwl_sec_key_flags - security key command key flags
618  * @IWL_SEC_KEY_FLAG_CIPHER_MASK: cipher mask
619  * @IWL_SEC_KEY_FLAG_CIPHER_WEP: WEP cipher
620  * @IWL_SEC_KEY_FLAG_CIPHER_CCMP: CCMP/CMAC cipher
621  * @IWL_SEC_KEY_FLAG_CIPHER_TKIP: TKIP cipher
622  * @IWL_SEC_KEY_FLAG_CIPHER_GCMP: GCMP/GMAC cipher
623  * @IWL_SEC_KEY_FLAG_NO_TX: don't install for TX
624  * @IWL_SEC_KEY_FLAG_KEY_SIZE: large key size (WEP-104, GCMP-256, GMAC-256)
625  * @IWL_SEC_KEY_FLAG_MFP: MFP is in used for this key
626  * @IWL_SEC_KEY_FLAG_MCAST_KEY: this is a multicast key
627  * @IWL_SEC_KEY_FLAG_SPP_AMSDU: SPP A-MSDU should be used
628  */
629 enum iwl_sec_key_flags {
630 	IWL_SEC_KEY_FLAG_CIPHER_MASK	= 0x07,
631 	IWL_SEC_KEY_FLAG_CIPHER_WEP	= 0x01,
632 	IWL_SEC_KEY_FLAG_CIPHER_CCMP	= 0x02,
633 	IWL_SEC_KEY_FLAG_CIPHER_TKIP	= 0x03,
634 	IWL_SEC_KEY_FLAG_CIPHER_GCMP	= 0x05,
635 	IWL_SEC_KEY_FLAG_NO_TX		= 0x08,
636 	IWL_SEC_KEY_FLAG_KEY_SIZE	= 0x10,
637 	IWL_SEC_KEY_FLAG_MFP		= 0x20,
638 	IWL_SEC_KEY_FLAG_MCAST_KEY	= 0x40,
639 	IWL_SEC_KEY_FLAG_SPP_AMSDU	= 0x80,
640 };
641 
642 #define IWL_SEC_WEP_KEY_OFFSET	3
643 
644 /**
645  * struct iwl_sec_key_cmd - security key command
646  * @action: action from &enum iwl_ctxt_action
647  * @u: union depending on command type
648  * @u.add.sta_mask: station mask for the new key
649  * @u.add.key_id: key ID (0-7) for the new key
650  * @u.add.key_flags: key flags per &enum iwl_sec_key_flags
651  * @u.add.key: key material. WEP keys should start from &IWL_SEC_WEP_KEY_OFFSET.
652  * @u.add.tkip_mic_rx_key: TKIP MIC RX key
653  * @u.add.tkip_mic_tx_key: TKIP MIC TX key
654  * @u.add.rx_seq: RX sequence counter value
655  * @u.add.tx_seq: TX sequence counter value
656  * @u.modify.old_sta_mask: old station mask
657  * @u.modify.new_sta_mask: new station mask
658  * @u.modify.key_id: key ID
659  * @u.modify.key_flags: new key flags
660  * @u.remove.sta_mask: station mask
661  * @u.remove.key_id: key ID
662  * @u.remove.key_flags: key flags
663  */
664 struct iwl_sec_key_cmd {
665 	__le32 action;
666 	union {
667 		struct {
668 			__le32 sta_mask;
669 			__le32 key_id;
670 			__le32 key_flags;
671 			u8 key[32];
672 			u8 tkip_mic_rx_key[8];
673 			u8 tkip_mic_tx_key[8];
674 			__le64 rx_seq;
675 			__le64 tx_seq;
676 		} __packed add; /* SEC_KEY_ADD_CMD_API_S_VER_1 */
677 		struct {
678 			__le32 old_sta_mask;
679 			__le32 new_sta_mask;
680 			__le32 key_id;
681 			__le32 key_flags;
682 		} __packed modify; /* SEC_KEY_MODIFY_CMD_API_S_VER_1 */
683 		struct {
684 			__le32 sta_mask;
685 			__le32 key_id;
686 			__le32 key_flags;
687 		} __packed remove; /* SEC_KEY_REMOVE_CMD_API_S_VER_1 */
688 	} __packed u; /* SEC_KEY_OPERATION_API_U_VER_1 */
689 } __packed; /* SEC_KEY_CMD_API_S_VER_1 */
690 
691 #endif /* __iwl_fw_api_datapath_h__ */
692