Debian Codegraph @

drivers/net/wireless/intel/iwlwifi/fw/api/d3.h

raw
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3 * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
4 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
5 * Copyright (C) 2015-2017 Intel Deutschland GmbH
6 */
7 #ifndef __iwl_fw_api_d3_h__
8 #define __iwl_fw_api_d3_h__
9 #include <iwl-trans.h>
10
11 /**
12 * enum iwl_d0i3_flags - d0i3 flags
13 * @IWL_D0I3_RESET_REQUIRE: FW require reset upon resume
14 */
15 enum iwl_d0i3_flags {
16 IWL_D0I3_RESET_REQUIRE = BIT(0),
17 };
18
19 /**
20 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
21 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
22 * @IWL_WAKEUP_D3_HOST_TIMER: wake up on host timer expiry
23 */
24 enum iwl_d3_wakeup_flags {
25 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
26 IWL_WAKEUP_D3_HOST_TIMER = BIT(1),
27 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
28
29 /**
30 * struct iwl_d3_manager_config - D3 manager configuration command
31 * @min_sleep_time: minimum sleep time (in usec)
32 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
33 * @wakeup_host_timer: force wakeup after this many seconds
34 *
35 * The structure is used for the D3_CONFIG_CMD command.
36 */
37 struct iwl_d3_manager_config {
38 __le32 min_sleep_time;
39 __le32 wakeup_flags;
40 __le32 wakeup_host_timer;
41 } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
42
43
44 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
45
46 /**
47 * enum iwl_proto_offloads - enabled protocol offloads
48 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
49 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
50 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
51 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
52 * @IWL_D3_PROTO_OFFLOAD_BTM: BTM offload is enabled
53 */
54 enum iwl_proto_offloads {
55 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
56 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
57 IWL_D3_PROTO_IPV4_VALID = BIT(2),
58 IWL_D3_PROTO_IPV6_VALID = BIT(3),
59 IWL_D3_PROTO_OFFLOAD_BTM = BIT(4),
60 };
61
62 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
63 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
64 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
65 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
66 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
67
68 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
69 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
70
71 /**
72 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
73 * @enabled: enable flags
74 * @remote_ipv4_addr: remote address to answer to (or zero if all)
75 * @host_ipv4_addr: our IPv4 address to respond to queries for
76 * @arp_mac_addr: our MAC address for ARP responses
77 * @reserved: unused
78 */
79 struct iwl_proto_offload_cmd_common {
80 __le32 enabled;
81 __be32 remote_ipv4_addr;
82 __be32 host_ipv4_addr;
83 u8 arp_mac_addr[ETH_ALEN];
84 __le16 reserved;
85 } __packed;
86
87 /**
88 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
89 * @common: common/IPv4 configuration
90 * @remote_ipv6_addr: remote address to answer to (or zero if all)
91 * @solicited_node_ipv6_addr: broken -- solicited node address exists
92 * for each target address
93 * @target_ipv6_addr: our target addresses
94 * @ndp_mac_addr: neighbor solicitation response MAC address
95 * @reserved2: reserved
96 */
97 struct iwl_proto_offload_cmd_v1 {
98 struct iwl_proto_offload_cmd_common common;
99 u8 remote_ipv6_addr[16];
100 u8 solicited_node_ipv6_addr[16];
101 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
102 u8 ndp_mac_addr[ETH_ALEN];
103 __le16 reserved2;
104 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
105
106 /**
107 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
108 * @common: common/IPv4 configuration
109 * @remote_ipv6_addr: remote address to answer to (or zero if all)
110 * @solicited_node_ipv6_addr: broken -- solicited node address exists
111 * for each target address
112 * @target_ipv6_addr: our target addresses
113 * @ndp_mac_addr: neighbor solicitation response MAC address
114 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
115 * @reserved2: reserved
116 */
117 struct iwl_proto_offload_cmd_v2 {
118 struct iwl_proto_offload_cmd_common common;
119 u8 remote_ipv6_addr[16];
120 u8 solicited_node_ipv6_addr[16];
121 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
122 u8 ndp_mac_addr[ETH_ALEN];
123 u8 num_valid_ipv6_addrs;
124 u8 reserved2[3];
125 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
126
127 struct iwl_ns_config {
128 struct in6_addr source_ipv6_addr;
129 struct in6_addr dest_ipv6_addr;
130 u8 target_mac_addr[ETH_ALEN];
131 __le16 reserved;
132 } __packed; /* NS_OFFLOAD_CONFIG */
133
134 struct iwl_targ_addr {
135 struct in6_addr addr;
136 __le32 config_num;
137 } __packed; /* TARGET_IPV6_ADDRESS */
138
139 /**
140 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
141 * @common: common/IPv4 configuration
142 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
143 * @targ_addrs: target IPv6 addresses
144 * @ns_config: NS offload configurations
145 */
146 struct iwl_proto_offload_cmd_v3_small {
147 struct iwl_proto_offload_cmd_common common;
148 __le32 num_valid_ipv6_addrs;
149 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
150 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
151 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
152
153 /**
154 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
155 * @common: common/IPv4 configuration
156 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
157 * @targ_addrs: target IPv6 addresses
158 * @ns_config: NS offload configurations
159 */
160 struct iwl_proto_offload_cmd_v3_large {
161 struct iwl_proto_offload_cmd_common common;
162 __le32 num_valid_ipv6_addrs;
163 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
164 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
165 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
166
167 /**
168 * struct iwl_proto_offload_cmd_v4 - ARP/NS offload configuration
169 * @sta_id: station id
170 * @common: common/IPv4 configuration
171 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
172 * @targ_addrs: target IPv6 addresses
173 * @ns_config: NS offload configurations
174 */
175 struct iwl_proto_offload_cmd_v4 {
176 __le32 sta_id;
177 struct iwl_proto_offload_cmd_common common;
178 __le32 num_valid_ipv6_addrs;
179 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
180 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
181 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_4 */
182
183 /*
184 * WOWLAN_PATTERNS
185 */
186 #define IWL_WOWLAN_MIN_PATTERN_LEN 16
187 #define IWL_WOWLAN_MAX_PATTERN_LEN 128
188
189 struct iwl_wowlan_pattern_v1 {
190 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
191 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
192 u8 mask_size;
193 u8 pattern_size;
194 __le16 reserved;
195 } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
196
197 #define IWL_WOWLAN_MAX_PATTERNS 20
198
199 /**
200 * struct iwl_wowlan_patterns_cmd_v1 - WoWLAN wakeup patterns
201 */
202 struct iwl_wowlan_patterns_cmd_v1 {
203 /**
204 * @n_patterns: number of patterns
205 */
206 __le32 n_patterns;
207
208 /**
209 * @patterns: the patterns, array length in @n_patterns
210 */
211 struct iwl_wowlan_pattern_v1 patterns[];
212 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
213
214 #define IPV4_ADDR_SIZE 4
215 #define IPV6_ADDR_SIZE 16
216
217 enum iwl_wowlan_pattern_type {
218 WOWLAN_PATTERN_TYPE_BITMASK,
219 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN,
220 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN,
221 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD,
222 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD,
223 }; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */
224
225 /**
226 * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data
227 */
228 struct iwl_wowlan_ipv4_tcp_syn {
229 /**
230 * @src_addr: source IP address to match
231 */
232 u8 src_addr[IPV4_ADDR_SIZE];
233
234 /**
235 * @dst_addr: destination IP address to match
236 */
237 u8 dst_addr[IPV4_ADDR_SIZE];
238
239 /**
240 * @src_port: source TCP port to match
241 */
242 __le16 src_port;
243
244 /**
245 * @dst_port: destination TCP port to match
246 */
247 __le16 dst_port;
248 } __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */
249
250 /**
251 * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data
252 */
253 struct iwl_wowlan_ipv6_tcp_syn {
254 /**
255 * @src_addr: source IP address to match
256 */
257 u8 src_addr[IPV6_ADDR_SIZE];
258
259 /**
260 * @dst_addr: destination IP address to match
261 */
262 u8 dst_addr[IPV6_ADDR_SIZE];
263
264 /**
265 * @src_port: source TCP port to match
266 */
267 __le16 src_port;
268
269 /**
270 * @dst_port: destination TCP port to match
271 */
272 __le16 dst_port;
273 } __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */
274
275 /**
276 * union iwl_wowlan_pattern_data - Data for the different pattern types
277 *
278 * If wildcard addresses/ports are to be used, the union can be left
279 * undefined.
280 */
281 union iwl_wowlan_pattern_data {
282 /**
283 * @bitmask: bitmask pattern data
284 */
285 struct iwl_wowlan_pattern_v1 bitmask;
286
287 /**
288 * @ipv4_tcp_syn: IPv4 TCP SYN pattern data
289 */
290 struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn;
291
292 /**
293 * @ipv6_tcp_syn: IPv6 TCP SYN pattern data
294 */
295 struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn;
296 }; /* WOWLAN_PATTERN_API_U_VER_1 */
297
298 /**
299 * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns
300 */
301 struct iwl_wowlan_pattern_v2 {
302 /**
303 * @pattern_type: defines the struct type to be used in the union
304 */
305 u8 pattern_type;
306
307 /**
308 * @reserved: reserved for alignment
309 */
310 u8 reserved[3];
311
312 /**
313 * @u: the union containing the match data, or undefined for
314 * wildcard matches
315 */
316 union iwl_wowlan_pattern_data u;
317 } __packed; /* WOWLAN_PATTERN_API_S_VER_2 */
318
319 /**
320 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command
321 */
322 struct iwl_wowlan_patterns_cmd {
323 /**
324 * @n_patterns: number of patterns
325 */
326 u8 n_patterns;
327
328 /**
329 * @sta_id: sta_id
330 */
331 u8 sta_id;
332
333 /**
334 * @reserved: reserved for alignment
335 */
336 __le16 reserved;
337
338 /**
339 * @patterns: the patterns, array length in @n_patterns
340 */
341 struct iwl_wowlan_pattern_v2 patterns[];
342 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_3 */
343
344 enum iwl_wowlan_wakeup_filters {
345 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
346 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
347 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
348 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
349 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
350 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
351 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
352 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
353 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
354 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
355 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
356 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
357 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
358 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
359 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
360 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
361 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
362 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
363
364 enum iwl_wowlan_flags {
365 IS_11W_ASSOC = BIT(0),
366 ENABLE_L3_FILTERING = BIT(1),
367 ENABLE_NBNS_FILTERING = BIT(2),
368 ENABLE_DHCP_FILTERING = BIT(3),
369 ENABLE_STORE_BEACON = BIT(4),
370 HAS_BEACON_PROTECTION = BIT(5),
371 };
372
373 /**
374 * struct iwl_wowlan_config_cmd_v6 - WoWLAN configuration (versions 5 and 6)
375 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
376 * @non_qos_seq: non-QoS sequence counter to use next.
377 * Reserved if the struct has version >= 6.
378 * @qos_seq: QoS sequence counters to use next
379 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
380 * @is_11n_connection: indicates HT connection
381 * @offloading_tid: TID reserved for firmware use
382 * @flags: extra flags, see &enum iwl_wowlan_flags
383 * @sta_id: station ID for wowlan.
384 * @reserved: reserved
385 */
386 struct iwl_wowlan_config_cmd_v6 {
387 __le32 wakeup_filter;
388 __le16 non_qos_seq;
389 __le16 qos_seq[8];
390 u8 wowlan_ba_teardown_tids;
391 u8 is_11n_connection;
392 u8 offloading_tid;
393 u8 flags;
394 u8 sta_id;
395 u8 reserved;
396 } __packed; /* WOWLAN_CONFIG_API_S_VER_6 */
397
398 /**
399 * struct iwl_wowlan_config_cmd - WoWLAN configuration
400 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
401 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
402 * @is_11n_connection: indicates HT connection
403 * @offloading_tid: TID reserved for firmware use
404 * @flags: extra flags, see &enum iwl_wowlan_flags
405 * @sta_id: station ID for wowlan.
406 * @reserved: reserved
407 */
408 struct iwl_wowlan_config_cmd {
409 __le32 wakeup_filter;
410 u8 wowlan_ba_teardown_tids;
411 u8 is_11n_connection;
412 u8 offloading_tid;
413 u8 flags;
414 u8 sta_id;
415 u8 reserved[3];
416 } __packed; /* WOWLAN_CONFIG_API_S_VER_7 */
417
418 #define IWL_NUM_RSC 16
419 #define WOWLAN_KEY_MAX_SIZE 32
420 #define WOWLAN_GTK_KEYS_NUM 2
421 #define WOWLAN_IGTK_KEYS_NUM 2
422 #define WOWLAN_IGTK_MIN_INDEX 4
423 #define WOWLAN_BIGTK_KEYS_NUM 2
424 #define WOWLAN_BIGTK_MIN_INDEX 6
425
426 /*
427 * WOWLAN_TSC_RSC_PARAMS
428 */
429 struct tkip_sc {
430 __le16 iv16;
431 __le16 pad;
432 __le32 iv32;
433 } __packed; /* TKIP_SC_API_U_VER_1 */
434
435 struct iwl_tkip_rsc_tsc {
436 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
437 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
438 struct tkip_sc tsc;
439 } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
440
441 struct aes_sc {
442 __le64 pn;
443 } __packed; /* TKIP_AES_SC_API_U_VER_1 */
444
445 struct iwl_aes_rsc_tsc {
446 struct aes_sc unicast_rsc[IWL_NUM_RSC];
447 struct aes_sc multicast_rsc[IWL_NUM_RSC];
448 struct aes_sc tsc;
449 } __packed; /* AES_TSC_RSC_API_S_VER_1 */
450
451 union iwl_all_tsc_rsc {
452 struct iwl_tkip_rsc_tsc tkip;
453 struct iwl_aes_rsc_tsc aes;
454 }; /* ALL_TSC_RSC_API_S_VER_2 */
455
456 struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 {
457 union iwl_all_tsc_rsc all_tsc_rsc;
458 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
459
460 struct iwl_wowlan_rsc_tsc_params_cmd {
461 __le64 ucast_rsc[IWL_MAX_TID_COUNT];
462 __le64 mcast_rsc[WOWLAN_GTK_KEYS_NUM][IWL_MAX_TID_COUNT];
463 __le32 sta_id;
464 #define IWL_MCAST_KEY_MAP_INVALID 0xff
465 u8 mcast_key_id_map[4];
466 } __packed; /* ALL_TSC_RSC_API_S_VER_5 */
467
468 #define IWL_MIC_KEY_SIZE 8
469 struct iwl_mic_keys {
470 u8 tx[IWL_MIC_KEY_SIZE];
471 u8 rx_unicast[IWL_MIC_KEY_SIZE];
472 u8 rx_mcast[IWL_MIC_KEY_SIZE];
473 } __packed; /* MIC_KEYS_API_S_VER_1 */
474
475 #define IWL_P1K_SIZE 5
476 struct iwl_p1k_cache {
477 __le16 p1k[IWL_P1K_SIZE];
478 } __packed;
479
480 #define IWL_NUM_RX_P1K_CACHE 2
481
482 struct iwl_wowlan_tkip_params_cmd_ver_1 {
483 struct iwl_mic_keys mic_keys;
484 struct iwl_p1k_cache tx;
485 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
486 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
487 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
488
489 struct iwl_wowlan_tkip_params_cmd {
490 struct iwl_mic_keys mic_keys;
491 struct iwl_p1k_cache tx;
492 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
493 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
494 u8 reversed[2];
495 __le32 sta_id;
496 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */
497
498 #define IWL_KCK_MAX_SIZE 32
499 #define IWL_KEK_MAX_SIZE 32
500
501 struct iwl_wowlan_kek_kck_material_cmd_v2 {
502 u8 kck[IWL_KCK_MAX_SIZE];
503 u8 kek[IWL_KEK_MAX_SIZE];
504 __le16 kck_len;
505 __le16 kek_len;
506 __le64 replay_ctr;
507 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
508
509 struct iwl_wowlan_kek_kck_material_cmd_v3 {
510 u8 kck[IWL_KCK_MAX_SIZE];
511 u8 kek[IWL_KEK_MAX_SIZE];
512 __le16 kck_len;
513 __le16 kek_len;
514 __le64 replay_ctr;
515 __le32 akm;
516 __le32 gtk_cipher;
517 __le32 igtk_cipher;
518 __le32 bigtk_cipher;
519 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_3 */
520
521 struct iwl_wowlan_kek_kck_material_cmd_v4 {
522 __le32 sta_id;
523 u8 kck[IWL_KCK_MAX_SIZE];
524 u8 kek[IWL_KEK_MAX_SIZE];
525 __le16 kck_len;
526 __le16 kek_len;
527 __le64 replay_ctr;
528 __le32 akm;
529 __le32 gtk_cipher;
530 __le32 igtk_cipher;
531 __le32 bigtk_cipher;
532 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_4 */
533
534 struct iwl_wowlan_get_status_cmd {
535 __le32 sta_id;
536 } __packed; /* WOWLAN_GET_STATUSES_CMD_API_S_VER_1 */
537
538 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
539
540 enum iwl_wowlan_rekey_status {
541 IWL_WOWLAN_REKEY_POST_REKEY = 0,
542 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
543 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
544
545 enum iwl_wowlan_wakeup_reason {
546 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
547 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
548 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
549 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
550 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
551 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
552 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
553 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
554 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
555 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
556 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
557 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
558 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
559 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
560 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
561 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
562 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
563 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
564 IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT(17),
565 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT(18),
566 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT(19),
567 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT(20),
568 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT(21),
569 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
570
571 struct iwl_wowlan_gtk_status_v1 {
572 u8 key_index;
573 u8 reserved[3];
574 u8 decrypt_key[16];
575 u8 tkip_mic_key[8];
576 struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
577 } __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */
578
579 /**
580 * struct iwl_wowlan_gtk_status_v2 - GTK status
581 * @key: GTK material
582 * @key_len: GTK legth, if set to 0, the key is not available
583 * @key_flags: information about the key:
584 * bits[0:1]: key index assigned by the AP
585 * bits[2:6]: GTK index of the key in the internal DB
586 * bit[7]: Set iff this is the currently used GTK
587 * @reserved: padding
588 * @tkip_mic_key: TKIP RX MIC key
589 * @rsc: TSC RSC counters
590 */
591 struct iwl_wowlan_gtk_status_v2 {
592 u8 key[WOWLAN_KEY_MAX_SIZE];
593 u8 key_len;
594 u8 key_flags;
595 u8 reserved[2];
596 u8 tkip_mic_key[8];
597 struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
598 } __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */
599
600 /**
601 * struct iwl_wowlan_all_rsc_tsc_v5 - key counters
602 * @ucast_rsc: unicast RSC values
603 * @mcast_rsc: multicast RSC values (per key map value)
604 * @sta_id: station ID
605 * @mcast_key_id_map: map of key id to @mcast_rsc entry
606 */
607 struct iwl_wowlan_all_rsc_tsc_v5 {
608 __le64 ucast_rsc[IWL_MAX_TID_COUNT];
609 __le64 mcast_rsc[2][IWL_MAX_TID_COUNT];
610 __le32 sta_id;
611 u8 mcast_key_id_map[4];
612 } __packed; /* ALL_TSC_RSC_API_S_VER_5 */
613
614 /**
615 * struct iwl_wowlan_gtk_status_v3 - GTK status
616 * @key: GTK material
617 * @key_len: GTK length, if set to 0, the key is not available
618 * @key_flags: information about the key:
619 * bits[0:1]: key index assigned by the AP
620 * bits[2:6]: GTK index of the key in the internal DB
621 * bit[7]: Set iff this is the currently used GTK
622 * @reserved: padding
623 * @tkip_mic_key: TKIP RX MIC key
624 * @sc: RSC/TSC counters
625 */
626 struct iwl_wowlan_gtk_status_v3 {
627 u8 key[WOWLAN_KEY_MAX_SIZE];
628 u8 key_len;
629 u8 key_flags;
630 u8 reserved[2];
631 u8 tkip_mic_key[IWL_MIC_KEY_SIZE];
632 struct iwl_wowlan_all_rsc_tsc_v5 sc;
633 } __packed; /* WOWLAN_GTK_MATERIAL_VER_3 */
634
635 /**
636 * enum iwl_wowlan_key_status - Status of security keys in WoWLAN notifications
637 * @IWL_WOWLAN_NOTIF_NO_KEY: No key is present; this entry should be ignored.
638 * @IWL_WOWLAN_STATUS_OLD_KEY: old key exists; no rekey occurred, and only
639 * metadata is available.
640 * @IWL_WOWLAN_STATUS_NEW_KEY: A new key was created after a rekey; new key
641 * material is available.
642 */
643 enum iwl_wowlan_key_status {
644 IWL_WOWLAN_NOTIF_NO_KEY = 0,
645 IWL_WOWLAN_STATUS_OLD_KEY = 1,
646 IWL_WOWLAN_STATUS_NEW_KEY = 2
647 };
648
649 /**
650 * struct iwl_wowlan_gtk_status - GTK status
651 * @key: GTK material
652 * @key_len: GTK length, if set to 0, the key is not available
653 * @key_flags: information about the key:
654 * bits[0:1]: key index assigned by the AP
655 * bits[2:6]: GTK index of the key in the internal DB
656 * bit[7]: Set iff this is the currently used GTK
657 * @key_status: key status, see &enum iwl_wowlan_key_status
658 * @reserved: padding
659 * @tkip_mic_key: TKIP RX MIC key
660 * @sc: RSC/TSC counters
661 */
662 struct iwl_wowlan_gtk_status {
663 u8 key[WOWLAN_KEY_MAX_SIZE];
664 u8 key_len;
665 u8 key_flags;
666 u8 key_status;
667 u8 reserved;
668 u8 tkip_mic_key[IWL_MIC_KEY_SIZE];
669 struct iwl_wowlan_all_rsc_tsc_v5 sc;
670 } __packed; /* WOWLAN_GTK_MATERIAL_VER_4 */
671
672 #define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1))
673 #define IWL_WOWLAN_IGTK_BIGTK_IDX_MASK (BIT(0))
674
675 /**
676 * struct iwl_wowlan_igtk_status_v1 - IGTK status
677 * @key: IGTK material
678 * @ipn: the IGTK packet number (replay counter)
679 * @key_len: IGTK length, if set to 0, the key is not available
680 * @key_flags: information about the key:
681 * bits[0]: key index assigned by the AP (0: index 4, 1: index 5)
682 * (0: index 6, 1: index 7 with bigtk)
683 * bits[1:5]: IGTK index of the key in the internal DB
684 * bit[6]: Set iff this is the currently used IGTK
685 */
686 struct iwl_wowlan_igtk_status_v1 {
687 u8 key[WOWLAN_KEY_MAX_SIZE];
688 u8 ipn[6];
689 u8 key_len;
690 u8 key_flags;
691 } __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
692
693 /**
694 * struct iwl_wowlan_igtk_status - IGTK status
695 * @key: IGTK material
696 * @ipn: the IGTK packet number (replay counter)
697 * @key_len: IGTK length, if set to 0, the key is not available
698 * @key_flags: information about the key:
699 * bits[0]: key index assigned by the AP (0: index 4, 1: index 5)
700 * (0: index 6, 1: index 7 with bigtk)
701 * bits[1:5]: IGTK index of the key in the internal DB
702 * bit[6]: Set iff this is the currently used IGTK
703 * @key_status: key status, see &enum iwl_wowlan_key_status
704 * @reserved: padding
705 */
706 struct iwl_wowlan_igtk_status {
707 u8 key[WOWLAN_KEY_MAX_SIZE];
708 u8 ipn[6];
709 u8 key_len;
710 u8 key_flags;
711 u8 key_status;
712 u8 reserved[3];
713 } __packed; /* WOWLAN_IGTK_MATERIAL_VER_2 */
714
715 /**
716 * struct iwl_wowlan_status_v6 - WoWLAN status
717 * @gtk: GTK data
718 * @replay_ctr: GTK rekey replay counter
719 * @pattern_number: number of the matched pattern
720 * @non_qos_seq_ctr: non-QoS sequence counter to use next
721 * @qos_seq_ctr: QoS sequence counters to use next
722 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
723 * @num_of_gtk_rekeys: number of GTK rekeys
724 * @transmitted_ndps: number of transmitted neighbor discovery packets
725 * @received_beacons: number of received beacons
726 * @wake_packet_length: wakeup packet length
727 * @wake_packet_bufsize: wakeup packet buffer size
728 * @wake_packet: wakeup packet
729 */
730 struct iwl_wowlan_status_v6 {
731 struct iwl_wowlan_gtk_status_v1 gtk;
732 __le64 replay_ctr;
733 __le16 pattern_number;
734 __le16 non_qos_seq_ctr;
735 __le16 qos_seq_ctr[8];
736 __le32 wakeup_reasons;
737 __le32 num_of_gtk_rekeys;
738 __le32 transmitted_ndps;
739 __le32 received_beacons;
740 __le32 wake_packet_length;
741 __le32 wake_packet_bufsize;
742 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
743 } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
744
745 /**
746 * struct iwl_wowlan_status_v7 - WoWLAN status
747 * @gtk: GTK data
748 * @igtk: IGTK data
749 * @replay_ctr: GTK rekey replay counter
750 * @pattern_number: number of the matched pattern
751 * @non_qos_seq_ctr: non-QoS sequence counter to use next
752 * @qos_seq_ctr: QoS sequence counters to use next
753 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
754 * @num_of_gtk_rekeys: number of GTK rekeys
755 * @transmitted_ndps: number of transmitted neighbor discovery packets
756 * @received_beacons: number of received beacons
757 * @wake_packet_length: wakeup packet length
758 * @wake_packet_bufsize: wakeup packet buffer size
759 * @wake_packet: wakeup packet
760 */
761 struct iwl_wowlan_status_v7 {
762 struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
763 struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
764 __le64 replay_ctr;
765 __le16 pattern_number;
766 __le16 non_qos_seq_ctr;
767 __le16 qos_seq_ctr[8];
768 __le32 wakeup_reasons;
769 __le32 num_of_gtk_rekeys;
770 __le32 transmitted_ndps;
771 __le32 received_beacons;
772 __le32 wake_packet_length;
773 __le32 wake_packet_bufsize;
774 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
775 } __packed; /* WOWLAN_STATUSES_API_S_VER_7 */
776
777 /**
778 * struct iwl_wowlan_info_notif_v1 - WoWLAN information notification
779 * @gtk: GTK data
780 * @igtk: IGTK data
781 * @replay_ctr: GTK rekey replay counter
782 * @pattern_number: number of the matched patterns
783 * @reserved1: reserved
784 * @qos_seq_ctr: QoS sequence counters to use next
785 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
786 * @num_of_gtk_rekeys: number of GTK rekeys
787 * @transmitted_ndps: number of transmitted neighbor discovery packets
788 * @received_beacons: number of received beacons
789 * @wake_packet_length: wakeup packet length
790 * @wake_packet_bufsize: wakeup packet buffer size
791 * @tid_tear_down: bit mask of tids whose BA sessions were closed
792 * in suspend state
793 * @station_id: station id
794 * @reserved2: reserved
795 */
796 struct iwl_wowlan_info_notif_v1 {
797 struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
798 struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
799 __le64 replay_ctr;
800 __le16 pattern_number;
801 __le16 reserved1;
802 __le16 qos_seq_ctr[8];
803 __le32 wakeup_reasons;
804 __le32 num_of_gtk_rekeys;
805 __le32 transmitted_ndps;
806 __le32 received_beacons;
807 __le32 wake_packet_length;
808 __le32 wake_packet_bufsize;
809 u8 tid_tear_down;
810 u8 station_id;
811 u8 reserved2[2];
812 } __packed; /* WOWLAN_INFO_NTFY_API_S_VER_1 */
813
814 /* MAX MLO keys of non-active links that can arrive in the notification */
815 #define WOWLAN_MAX_MLO_KEYS 18
816
817 /**
818 * enum iwl_wowlan_mlo_gtk_type - GTK types
819 * @WOWLAN_MLO_GTK_KEY_TYPE_GTK: GTK
820 * @WOWLAN_MLO_GTK_KEY_TYPE_IGTK: IGTK
821 * @WOWLAN_MLO_GTK_KEY_TYPE_BIGTK: BIGTK
822 * @WOWLAN_MLO_GTK_KEY_NUM_TYPES: number of key types
823 */
824 enum iwl_wowlan_mlo_gtk_type {
825 WOWLAN_MLO_GTK_KEY_TYPE_GTK,
826 WOWLAN_MLO_GTK_KEY_TYPE_IGTK,
827 WOWLAN_MLO_GTK_KEY_TYPE_BIGTK,
828 WOWLAN_MLO_GTK_KEY_NUM_TYPES
829 }; /* WOWLAN_MLO_GTK_KEY_TYPE_API_E_VER_1 */
830
831 /**
832 * enum iwl_wowlan_mlo_gtk_flag - MLO GTK flags
833 * @WOWLAN_MLO_GTK_FLAG_KEY_LEN_MSK: 0 for len 16, 1 for len 32
834 * @WOWLAN_MLO_GTK_FLAG_KEY_ID_MSK: key id (ranges from 0 to 7)
835 * @WOWLAN_MLO_GTK_FLAG_LINK_ID_MSK: spec link id of the key
836 * @WOWLAN_MLO_GTK_FLAG_KEY_TYPE_MSK: &enum iwl_wowlan_mlo_gtk_type
837 * @WOWLAN_MLO_GTK_FLAG_LAST_KEY_MSK: is this the last given key per
838 * key-type / link-id - the currently used key
839 */
840 enum iwl_wowlan_mlo_gtk_flag {
841 WOWLAN_MLO_GTK_FLAG_KEY_LEN_MSK = 0x0001,
842 WOWLAN_MLO_GTK_FLAG_KEY_ID_MSK = 0x000E,
843 WOWLAN_MLO_GTK_FLAG_LINK_ID_MSK = 0x00F0,
844 WOWLAN_MLO_GTK_FLAG_KEY_TYPE_MSK = 0x0300,
845 WOWLAN_MLO_GTK_FLAG_LAST_KEY_MSK = 0x0400
846 }; /* WOWLAN_MLO_GTK_FLAG_API_E_VER_1 */
847
848 /**
849 * struct iwl_wowlan_mlo_gtk - MLO GTK info
850 * @key: key material
851 * @flags: &enum iwl_wowlan_mlo_gtk_flag
852 * @pn: packet number
853 */
854 struct iwl_wowlan_mlo_gtk {
855 u8 key[WOWLAN_KEY_MAX_SIZE];
856 __le16 flags;
857 u8 pn[6];
858 } __packed; /* WOWLAN_MLO_GTK_KEY_API_S_VER_1 */
859
860 /**
861 * struct iwl_wowlan_info_notif_v3 - WoWLAN information notification
862 * @gtk: GTK data
863 * @igtk: IGTK data
864 * @bigtk: BIGTK data
865 * @replay_ctr: GTK rekey replay counter
866 * @pattern_number: number of the matched patterns
867 * @reserved1: reserved
868 * @qos_seq_ctr: QoS sequence counters to use next
869 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
870 * @num_of_gtk_rekeys: number of GTK rekeys
871 * @transmitted_ndps: number of transmitted neighbor discovery packets
872 * @received_beacons: number of received beacons
873 * @tid_tear_down: bit mask of tids whose BA sessions were closed
874 * in suspend state
875 * @station_id: station id
876 * @reserved2: reserved
877 */
878 struct iwl_wowlan_info_notif_v3 {
879 struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
880 struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
881 struct iwl_wowlan_igtk_status_v1 bigtk[WOWLAN_BIGTK_KEYS_NUM];
882 __le64 replay_ctr;
883 __le16 pattern_number;
884 __le16 reserved1;
885 __le16 qos_seq_ctr[8];
886 __le32 wakeup_reasons;
887 __le32 num_of_gtk_rekeys;
888 __le32 transmitted_ndps;
889 __le32 received_beacons;
890 u8 tid_tear_down;
891 u8 station_id;
892 u8 reserved2[2];
893 } __packed; /* WOWLAN_INFO_NTFY_API_S_VER_3 */
894
895 /**
896 * struct iwl_wowlan_info_notif_v5 - WoWLAN information notification
897 * @gtk: GTK data
898 * @igtk: IGTK data
899 * @bigtk: BIGTK data
900 * @replay_ctr: GTK rekey replay counter
901 * @pattern_number: number of the matched patterns
902 * @qos_seq_ctr: QoS sequence counters to use next
903 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
904 * @num_of_gtk_rekeys: number of GTK rekeys
905 * @transmitted_ndps: number of transmitted neighbor discovery packets
906 * @received_beacons: number of received beacons
907 * @tid_tear_down: bit mask of tids whose BA sessions were closed
908 * in suspend state
909 * @station_id: station id
910 * @num_mlo_link_keys: number of &struct iwl_wowlan_mlo_gtk structs
911 * following this notif
912 * @tid_offloaded_tx: tid used by the firmware to transmit data packets
913 * while in wowlan
914 * @mlo_gtks: array of GTKs of size num_mlo_link_keys
915 */
916 struct iwl_wowlan_info_notif_v5 {
917 struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
918 struct iwl_wowlan_igtk_status_v1 igtk[WOWLAN_IGTK_KEYS_NUM];
919 struct iwl_wowlan_igtk_status_v1 bigtk[WOWLAN_BIGTK_KEYS_NUM];
920 __le64 replay_ctr;
921 __le16 pattern_number;
922 __le16 qos_seq_ctr;
923 __le32 wakeup_reasons;
924 __le32 num_of_gtk_rekeys;
925 __le32 transmitted_ndps;
926 __le32 received_beacons;
927 u8 tid_tear_down;
928 u8 station_id;
929 u8 num_mlo_link_keys;
930 u8 tid_offloaded_tx;
931 struct iwl_wowlan_mlo_gtk mlo_gtks[];
932 } __packed; /* WOWLAN_INFO_NTFY_API_S_VER_5 */
933
934 /**
935 * struct iwl_wowlan_info_notif - WoWLAN information notification
936 * @gtk: GTK data
937 * @igtk: IGTK data
938 * @bigtk: BIGTK data
939 * @replay_ctr: GTK rekey replay counter
940 * @pattern_number: number of the matched patterns
941 * @qos_seq_ctr: QoS sequence counters to use next
942 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
943 * @num_of_gtk_rekeys: number of GTK rekeys
944 * @transmitted_ndps: number of transmitted neighbor discovery packets
945 * @received_beacons: number of received beacons
946 * @tid_tear_down: bit mask of tids whose BA sessions were closed
947 * in suspend state
948 * @station_id: station id
949 * @num_mlo_link_keys: number of &struct iwl_wowlan_mlo_gtk structs
950 * following this notif
951 * @tid_offloaded_tx: tid used by the firmware to transmit data packets
952 * while in wowlan
953 * @mlo_gtks: array of GTKs of size num_mlo_link_keys
954 */
955 struct iwl_wowlan_info_notif {
956 struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM];
957 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
958 struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];
959 __le64 replay_ctr;
960 __le16 pattern_number;
961 __le16 qos_seq_ctr;
962 __le32 wakeup_reasons;
963 __le32 num_of_gtk_rekeys;
964 __le32 transmitted_ndps;
965 __le32 received_beacons;
966 u8 tid_tear_down;
967 u8 station_id;
968 u8 num_mlo_link_keys;
969 u8 tid_offloaded_tx;
970 struct iwl_wowlan_mlo_gtk mlo_gtks[];
971 } __packed; /* WOWLAN_INFO_NTFY_API_S_VER_6 */
972
973 /**
974 * struct iwl_wowlan_wake_pkt_notif - WoWLAN wake packet notification
975 * @wake_packet_length: wakeup packet length
976 * @station_id: station id
977 * @reserved: unused
978 * @wake_packet: wakeup packet
979 */
980 struct iwl_wowlan_wake_pkt_notif {
981 __le32 wake_packet_length;
982 u8 station_id;
983 u8 reserved[3];
984 u8 wake_packet[1];
985 } __packed; /* WOWLAN_WAKE_PKT_NTFY_API_S_VER_1 */
986
987 /**
988 * struct iwl_mvm_d3_end_notif - d3 end notification
989 * @flags: See &enum iwl_d0i3_flags
990 */
991 struct iwl_d3_end_notif {
992 __le32 flags;
993 } __packed;
994
995 /* TODO: NetDetect API */
996
997 #endif /* __iwl_fw_api_d3_h__ */