xref: /linux/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h (revision 8f9eb8bb5c5af846a8b1729bd7778d08ca852379)
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 information element
235  * to allow a space for flexibility for the userspace App
236  *
237  * @element_id: element id of vendor specific ie
238  * @length: length of vendor specific ie
239  * @reserved: for alignment
240  * @data: vendor specific data blob
241  */
242 struct iwl_time_msmt_ptp_ctx {
243 	/* Differentiate between FTM and TM specific Vendor IEs */
244 	union {
245 		struct {
246 			u8 element_id;
247 			u8 length;
248 			__le16 reserved;
249 			u8 data[PTP_CTX_MAX_DATA_SIZE];
250 		} ftm; /* FTM specific vendor IE */
251 		struct {
252 			u8 element_id;
253 			u8 length;
254 			u8 data[PTP_CTX_MAX_DATA_SIZE];
255 		} tm; /* TM specific vendor IE */
256 	};
257 } __packed /* PTP_CTX_VER_1 */;
258 
259 /**
260  * struct iwl_time_msmt_notify - Time Sync measurement notification
261  * for TM/FTM, along with additional meta data.
262  *
263  * @peer_addr: peer address
264  * @reserved: for alignment
265  * @dialog_token: measurement flow dialog token number
266  * @followup_dialog_token: Measurement flow previous dialog token number
267  * @t1_hi: high dword of t1-time of the Tx'ed action frame departure on
268  *	sender side in units of 10 nano seconds
269  * @t1_lo: low dword of t1-time of the Tx'ed action frame departure on
270  *	sender side in units of 10 nano seconds
271  * @t1_max_err: maximum t1-time error in units of 10 nano seconds
272  * @t4_hi: high dword of t4-time of the Rx'ed action frame's Ack arrival on
273  *	sender side in units of 10 nano seconds
274  * @t4_lo: low dword of t4-time of the Rx'ed action frame's Ack arrival on
275  *	sender side in units of 10 nano seconds
276  * @t4_max_err: maximum t4-time error in units of 10 nano seconds
277  * @t2_hi: high dword of t2-time of the Rx'ed action frame arrival on
278  *	receiver side in units of 10 nano seconds
279  * @t2_lo: low dword of t2-time of the Rx'ed action frame arrival on
280  *	receiver side in units of 10 nano seconds
281  * @t2_max_err: maximum t2-time error in units of 10 nano seconds
282  * @t3_hi: high dword of t3-time of the Tx'ed action frame's Ack departure on
283  *	receiver side in units of 10 nano seconds
284  * @t3_lo: low dword of t3-time of the Tx'ed action frame's Ack departure on
285  *	receiver side in units of 10 nano seconds
286  * @t3_max_err: maximum t3-time error in units of 10 nano seconds
287  * @ptp: vendor specific information element
288  */
289 struct iwl_time_msmt_notify {
290 	u8 peer_addr[ETH_ALEN];
291 	u8 reserved[2];
292 	__le32 dialog_token;
293 	__le32 followup_dialog_token;
294 	__le32 t1_hi;
295 	__le32 t1_lo;
296 	__le32 t1_max_err;
297 	__le32 t4_hi;
298 	__le32 t4_lo;
299 	__le32 t4_max_err;
300 	__le32 t2_hi;
301 	__le32 t2_lo;
302 	__le32 t2_max_err;
303 	__le32 t3_hi;
304 	__le32 t3_lo;
305 	__le32 t3_max_err;
306 	struct iwl_time_msmt_ptp_ctx ptp;
307 } __packed; /* WNM_80211V_TIMING_MEASUREMENT_NTFY_API_S_VER_1 */
308 
309 /**
310  * struct iwl_time_msmt_cfm_notify - Time Sync measurement confirmation
311  * notification for TM/FTM. Sent on receipt of 802.11 Ack from peer for the
312  * Tx'ed TM/FTM measurement action frame.
313  *
314  * @peer_addr: peer address
315  * @reserved: for alignment
316  * @dialog_token: measurement flow dialog token number
317  * @t1_hi: high dword of t1-time of the Tx'ed action frame departure on
318  *	sender side in units of 10 nano seconds
319  * @t1_lo: low dword of t1-time of the Tx'ed action frame departure on
320  *	sender side in units of 10 nano seconds
321  * @t1_max_err: maximum t1-time error in units of 10 nano seconds
322  * @t4_hi: high dword of t4-time of the Rx'ed action frame's Ack arrival on
323  *	sender side in units of 10 nano seconds
324  * @t4_lo: low dword of t4-time of the Rx'ed action frame's Ack arrival on
325  *	sender side in units of 10 nano seconds
326  * @t4_max_err: maximum t4-time error in units of 10 nano seconds
327  */
328 struct iwl_time_msmt_cfm_notify {
329 	u8 peer_addr[ETH_ALEN];
330 	u8 reserved[2];
331 	__le32 dialog_token;
332 	__le32 t1_hi;
333 	__le32 t1_lo;
334 	__le32 t1_max_err;
335 	__le32 t4_hi;
336 	__le32 t4_lo;
337 	__le32 t4_max_err;
338 } __packed; /* WNM_80211V_TIMING_MEASUREMENT_CONFIRM_NTFY_API_S_VER_1 */
339 
340 /**
341  * struct iwl_channel_estimation_cfg - channel estimation reporting config
342  */
343 struct iwl_channel_estimation_cfg {
344 	/**
345 	 * @flags: flags, see &enum iwl_channel_estimation_flags
346 	 */
347 	__le32 flags;
348 	/**
349 	 * @timer: if enabled via flags, automatically disable after this many
350 	 *	microseconds
351 	 */
352 	__le32 timer;
353 	/**
354 	 * @count: if enabled via flags, automatically disable after this many
355 	 *	frames with channel estimation matrix were captured
356 	 */
357 	__le32 count;
358 	/**
359 	 * @rate_n_flags_mask: only try to record the channel estimation matrix
360 	 *	if the rate_n_flags value for the received frame (let's call
361 	 *	that rx_rnf) matches the mask/value given here like this:
362 	 *	(rx_rnf & rate_n_flags_mask) == rate_n_flags_val.
363 	 */
364 	__le32 rate_n_flags_mask;
365 	/**
366 	 * @rate_n_flags_val: see @rate_n_flags_mask
367 	 */
368 	__le32 rate_n_flags_val;
369 	/**
370 	 * @reserved: reserved (for alignment)
371 	 */
372 	__le32 reserved;
373 	/**
374 	 * @frame_types: bitmap of frame types to capture, the received frame's
375 	 *	subtype|type takes 6 bits in the frame and the corresponding bit
376 	 *	in this field must be set to 1 to capture channel estimation for
377 	 *	that frame type. Set to all-ones to enable capturing for all
378 	 *	frame types.
379 	 */
380 	__le64 frame_types;
381 } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */
382 
383 enum iwl_datapath_monitor_notif_type {
384 	IWL_DP_MON_NOTIF_TYPE_EXT_CCA,
385 };
386 
387 struct iwl_datapath_monitor_notif {
388 	__le32 type;
389 	u8 mac_id;
390 	u8 reserved[3];
391 } __packed; /* MONITOR_NTF_API_S_VER_1 */
392 
393 /**
394  * enum iwl_thermal_dual_chain_req_events - firmware SMPS request event
395  * @THERMAL_DUAL_CHAIN_REQ_ENABLE: (re-)enable dual-chain operation
396  *	(subject to other constraints)
397  * @THERMAL_DUAL_CHAIN_REQ_DISABLE: disable dual-chain operation
398  *	(static SMPS)
399  */
400 enum iwl_thermal_dual_chain_req_events {
401 	THERMAL_DUAL_CHAIN_REQ_ENABLE,
402 	THERMAL_DUAL_CHAIN_REQ_DISABLE,
403 }; /* THERMAL_DUAL_CHAIN_DISABLE_STATE_API_E_VER_1 */
404 
405 /**
406  * struct iwl_thermal_dual_chain_request - SMPS request
407  * @event: the type of request, see &enum iwl_thermal_dual_chain_req_events
408  */
409 struct iwl_thermal_dual_chain_request {
410 	__le32 event;
411 } __packed; /* THERMAL_DUAL_CHAIN_DISABLE_REQ_NTFY_API_S_VER_1 */
412 
413 enum iwl_rlc_chain_info {
414 	IWL_RLC_CHAIN_INFO_DRIVER_FORCE		= BIT(0),
415 	IWL_RLC_CHAIN_INFO_VALID		= 0x000e,
416 	IWL_RLC_CHAIN_INFO_FORCE		= 0x0070,
417 	IWL_RLC_CHAIN_INFO_FORCE_MIMO		= 0x0380,
418 	IWL_RLC_CHAIN_INFO_COUNT		= 0x0c00,
419 	IWL_RLC_CHAIN_INFO_MIMO_COUNT		= 0x3000,
420 };
421 
422 /**
423  * struct iwl_rlc_properties - RLC properties
424  * @rx_chain_info: RX chain info, &enum iwl_rlc_chain_info
425  * @reserved: reserved
426  */
427 struct iwl_rlc_properties {
428 	__le32 rx_chain_info;
429 	__le32 reserved;
430 } __packed; /* RLC_PROPERTIES_S_VER_1 */
431 
432 enum iwl_sad_mode {
433 	IWL_SAD_MODE_ENABLED		= BIT(0),
434 	IWL_SAD_MODE_DEFAULT_ANT_MSK	= 0x6,
435 	IWL_SAD_MODE_DEFAULT_ANT_FW	= 0x0,
436 	IWL_SAD_MODE_DEFAULT_ANT_A	= 0x2,
437 	IWL_SAD_MODE_DEFAULT_ANT_B	= 0x4,
438 };
439 
440 /**
441  * struct iwl_sad_properties - SAD properties
442  * @chain_a_sad_mode: chain A SAD mode, &enum iwl_sad_mode
443  * @chain_b_sad_mode: chain B SAD mode, &enum iwl_sad_mode
444  * @mac_id: MAC index
445  * @reserved: reserved
446  */
447 struct iwl_sad_properties {
448 	__le32 chain_a_sad_mode;
449 	__le32 chain_b_sad_mode;
450 	__le32 mac_id;
451 	__le32 reserved;
452 } __packed;
453 
454 /**
455  * struct iwl_rlc_config_cmd - RLC configuration
456  * @phy_id: PHY index
457  * @rlc: RLC properties, &struct iwl_rlc_properties
458  * @sad: SAD (single antenna diversity) options, &struct iwl_sad_properties
459  * @flags: flags (unused)
460  * @reserved: reserved
461  */
462 struct iwl_rlc_config_cmd {
463 	__le32 phy_id;
464 	struct iwl_rlc_properties rlc;
465 	struct iwl_sad_properties sad;
466 	u8 flags;
467 	u8 reserved[3];
468 } __packed; /* RLC_CONFIG_CMD_API_S_VER_2 */
469 
470 #define IWL_MAX_BAID_OLD	16 /* MAX_IMMEDIATE_BA_API_D_VER_2 */
471 #define IWL_MAX_BAID		32 /* MAX_IMMEDIATE_BA_API_D_VER_3 */
472 
473 /**
474  * enum iwl_rx_baid_action - BAID allocation/config action
475  * @IWL_RX_BAID_ACTION_ADD: add a new BAID session
476  * @IWL_RX_BAID_ACTION_MODIFY: modify the BAID session
477  * @IWL_RX_BAID_ACTION_REMOVE: remove the BAID session
478  */
479 enum iwl_rx_baid_action {
480 	IWL_RX_BAID_ACTION_ADD,
481 	IWL_RX_BAID_ACTION_MODIFY,
482 	IWL_RX_BAID_ACTION_REMOVE,
483 }; /*  RX_BAID_ALLOCATION_ACTION_E_VER_1 */
484 
485 /**
486  * struct iwl_rx_baid_cfg_cmd_alloc - BAID allocation data
487  * @sta_id_mask: station ID mask
488  * @tid: the TID for this session
489  * @reserved: reserved
490  * @ssn: the starting sequence number
491  * @win_size: RX BA session window size
492  */
493 struct iwl_rx_baid_cfg_cmd_alloc {
494 	__le32 sta_id_mask;
495 	u8 tid;
496 	u8 reserved[3];
497 	__le16 ssn;
498 	__le16 win_size;
499 } __packed; /* RX_BAID_ALLOCATION_ADD_CMD_API_S_VER_1 */
500 
501 /**
502  * struct iwl_rx_baid_cfg_cmd_modify - BAID modification data
503  * @old_sta_id_mask: old station ID mask
504  * @new_sta_id_mask: new station ID mask
505  * @tid: TID of the BAID
506  */
507 struct iwl_rx_baid_cfg_cmd_modify {
508 	__le32 old_sta_id_mask;
509 	__le32 new_sta_id_mask;
510 	__le32 tid;
511 } __packed; /* RX_BAID_ALLOCATION_MODIFY_CMD_API_S_VER_2 */
512 
513 /**
514  * struct iwl_rx_baid_cfg_cmd_remove_v1 - BAID removal data
515  * @baid: the BAID to remove
516  */
517 struct iwl_rx_baid_cfg_cmd_remove_v1 {
518 	__le32 baid;
519 } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_1 */
520 
521 /**
522  * struct iwl_rx_baid_cfg_cmd_remove - BAID removal data
523  * @sta_id_mask: the station mask of the BAID to remove
524  * @tid: the TID of the BAID to remove
525  */
526 struct iwl_rx_baid_cfg_cmd_remove {
527 	__le32 sta_id_mask;
528 	__le32 tid;
529 } __packed; /* RX_BAID_ALLOCATION_REMOVE_CMD_API_S_VER_2 */
530 
531 /**
532  * struct iwl_rx_baid_cfg_cmd - BAID allocation/config command
533  * @action: the action, from &enum iwl_rx_baid_action
534  */
535 struct iwl_rx_baid_cfg_cmd {
536 	__le32 action;
537 	union {
538 		struct iwl_rx_baid_cfg_cmd_alloc alloc;
539 		struct iwl_rx_baid_cfg_cmd_modify modify;
540 		struct iwl_rx_baid_cfg_cmd_remove_v1 remove_v1;
541 		struct iwl_rx_baid_cfg_cmd_remove remove;
542 	}; /* RX_BAID_ALLOCATION_OPERATION_API_U_VER_2 */
543 } __packed; /* RX_BAID_ALLOCATION_CONFIG_CMD_API_S_VER_2 */
544 
545 /**
546  * struct iwl_rx_baid_cfg_resp - BAID allocation response
547  * @baid: the allocated BAID
548  */
549 struct iwl_rx_baid_cfg_resp {
550 	__le32 baid;
551 }; /* RX_BAID_ALLOCATION_RESPONSE_API_S_VER_1 */
552 
553 /**
554  * enum iwl_scd_queue_cfg_operation - scheduler queue operation
555  * @IWL_SCD_QUEUE_ADD: allocate a new queue
556  * @IWL_SCD_QUEUE_REMOVE: remove a queue
557  * @IWL_SCD_QUEUE_MODIFY: modify a queue
558  */
559 enum iwl_scd_queue_cfg_operation {
560 	IWL_SCD_QUEUE_ADD = 0,
561 	IWL_SCD_QUEUE_REMOVE = 1,
562 	IWL_SCD_QUEUE_MODIFY = 2,
563 };
564 
565 /**
566  * struct iwl_scd_queue_cfg_cmd - scheduler queue allocation command
567  * @operation: the operation, see &enum iwl_scd_queue_cfg_operation
568  * @u.add.sta_mask: station mask
569  * @u.add.tid: TID
570  * @u.add.reserved: reserved
571  * @u.add.flags: flags from &enum iwl_tx_queue_cfg_actions, except
572  *	%TX_QUEUE_CFG_ENABLE_QUEUE is not valid
573  * @u.add.cb_size: size code
574  * @u.add.bc_dram_addr: byte-count table IOVA
575  * @u.add.tfdq_dram_addr: TFD queue IOVA
576  * @u.remove.sta_mask: station mask of queue to remove
577  * @u.remove.tid: TID of queue to remove
578  * @u.modify.old_sta_mask: old station mask for modify
579  * @u.modify.tid: TID of queue to modify
580  * @u.modify.new_sta_mask: new station mask for modify
581  */
582 struct iwl_scd_queue_cfg_cmd {
583 	__le32 operation;
584 	union {
585 		struct {
586 			__le32 sta_mask;
587 			u8 tid;
588 			u8 reserved[3];
589 			__le32 flags;
590 			__le32 cb_size;
591 			__le64 bc_dram_addr;
592 			__le64 tfdq_dram_addr;
593 		} __packed add; /* TX_QUEUE_CFG_CMD_ADD_API_S_VER_1 */
594 		struct {
595 			__le32 sta_mask;
596 			__le32 tid;
597 		} __packed remove; /* TX_QUEUE_CFG_CMD_REMOVE_API_S_VER_1 */
598 		struct {
599 			__le32 old_sta_mask;
600 			__le32 tid;
601 			__le32 new_sta_mask;
602 		} __packed modify; /* TX_QUEUE_CFG_CMD_MODIFY_API_S_VER_1 */
603 	} __packed u; /* TX_QUEUE_CFG_CMD_OPERATION_API_U_VER_1 */
604 } __packed; /* TX_QUEUE_CFG_CMD_API_S_VER_3 */
605 
606 /**
607  * enum iwl_sec_key_flags - security key command key flags
608  * @IWL_SEC_KEY_FLAG_CIPHER_MASK: cipher mask
609  * @IWL_SEC_KEY_FLAG_CIPHER_WEP: WEP cipher
610  * @IWL_SEC_KEY_FLAG_CIPHER_CCMP: CCMP/CMAC cipher
611  * @IWL_SEC_KEY_FLAG_CIPHER_TKIP: TKIP cipher
612  * @IWL_SEC_KEY_FLAG_CIPHER_GCMP: GCMP/GMAC cipher
613  * @IWL_SEC_KEY_FLAG_NO_TX: don't install for TX
614  * @IWL_SEC_KEY_FLAG_KEY_SIZE: large key size (WEP-104, GCMP-256, GMAC-256)
615  * @IWL_SEC_KEY_FLAG_MFP: MFP is in used for this key
616  * @IWL_SEC_KEY_FLAG_MCAST_KEY: this is a multicast key
617  * @IWL_SEC_KEY_FLAG_SPP_AMSDU: SPP A-MSDU should be used
618  */
619 enum iwl_sec_key_flags {
620 	IWL_SEC_KEY_FLAG_CIPHER_MASK	= 0x07,
621 	IWL_SEC_KEY_FLAG_CIPHER_WEP	= 0x01,
622 	IWL_SEC_KEY_FLAG_CIPHER_CCMP	= 0x02,
623 	IWL_SEC_KEY_FLAG_CIPHER_TKIP	= 0x03,
624 	IWL_SEC_KEY_FLAG_CIPHER_GCMP	= 0x05,
625 	IWL_SEC_KEY_FLAG_NO_TX		= 0x08,
626 	IWL_SEC_KEY_FLAG_KEY_SIZE	= 0x10,
627 	IWL_SEC_KEY_FLAG_MFP		= 0x20,
628 	IWL_SEC_KEY_FLAG_MCAST_KEY	= 0x40,
629 	IWL_SEC_KEY_FLAG_SPP_AMSDU	= 0x80,
630 };
631 
632 #define IWL_SEC_WEP_KEY_OFFSET	3
633 
634 /**
635  * struct iwl_sec_key_cmd - security key command
636  * @action: action from &enum iwl_ctxt_action
637  * @u.add.sta_mask: station mask for the new key
638  * @u.add.key_id: key ID (0-7) for the new key
639  * @u.add.key_flags: key flags per &enum iwl_sec_key_flags
640  * @u.add.key: key material. WEP keys should start from &IWL_SEC_WEP_KEY_OFFSET.
641  * @u.add.tkip_mic_rx_key: TKIP MIC RX key
642  * @u.add.tkip_mic_tx_key: TKIP MIC TX key
643  * @u.add.rx_seq: RX sequence counter value
644  * @u.add.tx_seq: TX sequence counter value
645  * @u.modify.old_sta_mask: old station mask
646  * @u.modify.new_sta_mask: new station mask
647  * @u.modify.key_id: key ID
648  * @u.modify.key_flags: new key flags
649  * @u.remove.sta_mask: station mask
650  * @u.remove.key_id: key ID
651  * @u.remove.key_flags: key flags
652  */
653 struct iwl_sec_key_cmd {
654 	__le32 action;
655 	union {
656 		struct {
657 			__le32 sta_mask;
658 			__le32 key_id;
659 			__le32 key_flags;
660 			u8 key[32];
661 			u8 tkip_mic_rx_key[8];
662 			u8 tkip_mic_tx_key[8];
663 			__le64 rx_seq;
664 			__le64 tx_seq;
665 		} __packed add; /* SEC_KEY_ADD_CMD_API_S_VER_1 */
666 		struct {
667 			__le32 old_sta_mask;
668 			__le32 new_sta_mask;
669 			__le32 key_id;
670 			__le32 key_flags;
671 		} __packed modify; /* SEC_KEY_MODIFY_CMD_API_S_VER_1 */
672 		struct {
673 			__le32 sta_mask;
674 			__le32 key_id;
675 			__le32 key_flags;
676 		} __packed remove; /* SEC_KEY_REMOVE_CMD_API_S_VER_1 */
677 	} __packed u; /* SEC_KEY_OPERATION_API_U_VER_1 */
678 } __packed; /* SEC_KEY_CMD_API_S_VER_1 */
679 
680 #endif /* __iwl_fw_api_datapath_h__ */
681