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