Loading...
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2/*
3 * Copyright (C) 2012-2014, 2018-2023 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 */
15enum 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 */
23enum iwl_d3_wakeup_flags {
24 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
25}; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
26
27/**
28 * struct iwl_d3_manager_config - D3 manager configuration command
29 * @min_sleep_time: minimum sleep time (in usec)
30 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
31 * @wakeup_host_timer: force wakeup after this many seconds
32 *
33 * The structure is used for the D3_CONFIG_CMD command.
34 */
35struct iwl_d3_manager_config {
36 __le32 min_sleep_time;
37 __le32 wakeup_flags;
38 __le32 wakeup_host_timer;
39} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
40
41
42/* TODO: OFFLOADS_QUERY_API_S_VER_1 */
43
44/**
45 * enum iwl_d3_proto_offloads - enabled protocol offloads
46 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
47 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
48 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
49 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
50 * @IWL_D3_PROTO_OFFLOAD_BTM: BTM offload is enabled
51 */
52enum iwl_proto_offloads {
53 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
54 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
55 IWL_D3_PROTO_IPV4_VALID = BIT(2),
56 IWL_D3_PROTO_IPV6_VALID = BIT(3),
57 IWL_D3_PROTO_OFFLOAD_BTM = BIT(4),
58};
59
60#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
61#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
62#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
63#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
64#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
65
66#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
67#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
68
69/**
70 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
71 * @enabled: enable flags
72 * @remote_ipv4_addr: remote address to answer to (or zero if all)
73 * @host_ipv4_addr: our IPv4 address to respond to queries for
74 * @arp_mac_addr: our MAC address for ARP responses
75 * @reserved: unused
76 */
77struct iwl_proto_offload_cmd_common {
78 __le32 enabled;
79 __be32 remote_ipv4_addr;
80 __be32 host_ipv4_addr;
81 u8 arp_mac_addr[ETH_ALEN];
82 __le16 reserved;
83} __packed;
84
85/**
86 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
87 * @common: common/IPv4 configuration
88 * @remote_ipv6_addr: remote address to answer to (or zero if all)
89 * @solicited_node_ipv6_addr: broken -- solicited node address exists
90 * for each target address
91 * @target_ipv6_addr: our target addresses
92 * @ndp_mac_addr: neighbor solicitation response MAC address
93 * @reserved2: reserved
94 */
95struct iwl_proto_offload_cmd_v1 {
96 struct iwl_proto_offload_cmd_common common;
97 u8 remote_ipv6_addr[16];
98 u8 solicited_node_ipv6_addr[16];
99 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
100 u8 ndp_mac_addr[ETH_ALEN];
101 __le16 reserved2;
102} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
103
104/**
105 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
106 * @common: common/IPv4 configuration
107 * @remote_ipv6_addr: remote address to answer to (or zero if all)
108 * @solicited_node_ipv6_addr: broken -- solicited node address exists
109 * for each target address
110 * @target_ipv6_addr: our target addresses
111 * @ndp_mac_addr: neighbor solicitation response MAC address
112 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
113 * @reserved2: reserved
114 */
115struct iwl_proto_offload_cmd_v2 {
116 struct iwl_proto_offload_cmd_common common;
117 u8 remote_ipv6_addr[16];
118 u8 solicited_node_ipv6_addr[16];
119 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
120 u8 ndp_mac_addr[ETH_ALEN];
121 u8 num_valid_ipv6_addrs;
122 u8 reserved2[3];
123} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
124
125struct iwl_ns_config {
126 struct in6_addr source_ipv6_addr;
127 struct in6_addr dest_ipv6_addr;
128 u8 target_mac_addr[ETH_ALEN];
129 __le16 reserved;
130} __packed; /* NS_OFFLOAD_CONFIG */
131
132struct iwl_targ_addr {
133 struct in6_addr addr;
134 __le32 config_num;
135} __packed; /* TARGET_IPV6_ADDRESS */
136
137/**
138 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
139 * @common: common/IPv4 configuration
140 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
141 * @targ_addrs: target IPv6 addresses
142 * @ns_config: NS offload configurations
143 */
144struct iwl_proto_offload_cmd_v3_small {
145 struct iwl_proto_offload_cmd_common common;
146 __le32 num_valid_ipv6_addrs;
147 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
148 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
149} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
150
151/**
152 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
153 * @common: common/IPv4 configuration
154 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
155 * @targ_addrs: target IPv6 addresses
156 * @ns_config: NS offload configurations
157 */
158struct iwl_proto_offload_cmd_v3_large {
159 struct iwl_proto_offload_cmd_common common;
160 __le32 num_valid_ipv6_addrs;
161 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
162 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
163} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
164
165/**
166 * struct iwl_proto_offload_cmd_v4 - ARP/NS offload configuration
167 * @sta_id: station id
168 * @common: common/IPv4 configuration
169 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
170 * @targ_addrs: target IPv6 addresses
171 * @ns_config: NS offload configurations
172 */
173struct iwl_proto_offload_cmd_v4 {
174 __le32 sta_id;
175 struct iwl_proto_offload_cmd_common common;
176 __le32 num_valid_ipv6_addrs;
177 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
178 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
179} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_4 */
180
181/*
182 * WOWLAN_PATTERNS
183 */
184#define IWL_WOWLAN_MIN_PATTERN_LEN 16
185#define IWL_WOWLAN_MAX_PATTERN_LEN 128
186
187struct iwl_wowlan_pattern_v1 {
188 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
189 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
190 u8 mask_size;
191 u8 pattern_size;
192 __le16 reserved;
193} __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
194
195#define IWL_WOWLAN_MAX_PATTERNS 20
196
197/**
198 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns
199 */
200struct iwl_wowlan_patterns_cmd_v1 {
201 /**
202 * @n_patterns: number of patterns
203 */
204 __le32 n_patterns;
205
206 /**
207 * @patterns: the patterns, array length in @n_patterns
208 */
209 struct iwl_wowlan_pattern_v1 patterns[];
210} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
211
212#define IPV4_ADDR_SIZE 4
213#define IPV6_ADDR_SIZE 16
214
215enum iwl_wowlan_pattern_type {
216 WOWLAN_PATTERN_TYPE_BITMASK,
217 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN,
218 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN,
219 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD,
220 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD,
221}; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */
222
223/**
224 * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data
225 */
226struct iwl_wowlan_ipv4_tcp_syn {
227 /**
228 * @src_addr: source IP address to match
229 */
230 u8 src_addr[IPV4_ADDR_SIZE];
231
232 /**
233 * @dst_addr: destination IP address to match
234 */
235 u8 dst_addr[IPV4_ADDR_SIZE];
236
237 /**
238 * @src_port: source TCP port to match
239 */
240 __le16 src_port;
241
242 /**
243 * @dst_port: destination TCP port to match
244 */
245 __le16 dst_port;
246} __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */
247
248/**
249 * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data
250 */
251struct iwl_wowlan_ipv6_tcp_syn {
252 /**
253 * @src_addr: source IP address to match
254 */
255 u8 src_addr[IPV6_ADDR_SIZE];
256
257 /**
258 * @dst_addr: destination IP address to match
259 */
260 u8 dst_addr[IPV6_ADDR_SIZE];
261
262 /**
263 * @src_port: source TCP port to match
264 */
265 __le16 src_port;
266
267 /**
268 * @dst_port: destination TCP port to match
269 */
270 __le16 dst_port;
271} __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */
272
273/**
274 * union iwl_wowlan_pattern_data - Data for the different pattern types
275 *
276 * If wildcard addresses/ports are to be used, the union can be left
277 * undefined.
278 */
279union iwl_wowlan_pattern_data {
280 /**
281 * @bitmask: bitmask pattern data
282 */
283 struct iwl_wowlan_pattern_v1 bitmask;
284
285 /**
286 * @ipv4_tcp_syn: IPv4 TCP SYN pattern data
287 */
288 struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn;
289
290 /**
291 * @ipv6_tcp_syn: IPv6 TCP SYN pattern data
292 */
293 struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn;
294}; /* WOWLAN_PATTERN_API_U_VER_1 */
295
296/**
297 * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns
298 */
299struct iwl_wowlan_pattern_v2 {
300 /**
301 * @pattern_type: defines the struct type to be used in the union
302 */
303 u8 pattern_type;
304
305 /**
306 * @reserved: reserved for alignment
307 */
308 u8 reserved[3];
309
310 /**
311 * @u: the union containing the match data, or undefined for
312 * wildcard matches
313 */
314 union iwl_wowlan_pattern_data u;
315} __packed; /* WOWLAN_PATTERN_API_S_VER_2 */
316
317/**
318 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command
319 */
320struct iwl_wowlan_patterns_cmd {
321 /**
322 * @n_patterns: number of patterns
323 */
324 u8 n_patterns;
325
326 /**
327 * @n_patterns: sta_id
328 */
329 u8 sta_id;
330
331 /**
332 * @reserved: reserved for alignment
333 */
334 __le16 reserved;
335
336 /**
337 * @patterns: the patterns, array length in @n_patterns
338 */
339 struct iwl_wowlan_pattern_v2 patterns[];
340} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_3 */
341
342enum iwl_wowlan_wakeup_filters {
343 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
344 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
345 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
346 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
347 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
348 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
349 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
350 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
351 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
352 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
353 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
354 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
355 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
356 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
357 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
358 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
359 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
360}; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
361
362enum iwl_wowlan_flags {
363 IS_11W_ASSOC = BIT(0),
364 ENABLE_L3_FILTERING = BIT(1),
365 ENABLE_NBNS_FILTERING = BIT(2),
366 ENABLE_DHCP_FILTERING = BIT(3),
367 ENABLE_STORE_BEACON = BIT(4),
368};
369
370/**
371 * struct iwl_wowlan_config_cmd - WoWLAN configuration (versions 5 and 6)
372 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
373 * @non_qos_seq: non-QoS sequence counter to use next.
374 * Reserved if the struct has version >= 6.
375 * @qos_seq: QoS sequence counters to use next
376 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
377 * @is_11n_connection: indicates HT connection
378 * @offloading_tid: TID reserved for firmware use
379 * @flags: extra flags, see &enum iwl_wowlan_flags
380 * @sta_id: station ID for wowlan.
381 * @reserved: reserved
382 */
383struct iwl_wowlan_config_cmd {
384 __le32 wakeup_filter;
385 __le16 non_qos_seq;
386 __le16 qos_seq[8];
387 u8 wowlan_ba_teardown_tids;
388 u8 is_11n_connection;
389 u8 offloading_tid;
390 u8 flags;
391 u8 sta_id;
392 u8 reserved;
393} __packed; /* WOWLAN_CONFIG_API_S_VER_5 */
394
395#define IWL_NUM_RSC 16
396#define WOWLAN_KEY_MAX_SIZE 32
397#define WOWLAN_GTK_KEYS_NUM 2
398#define WOWLAN_IGTK_KEYS_NUM 2
399#define WOWLAN_IGTK_MIN_INDEX 4
400#define WOWLAN_BIGTK_KEYS_NUM 2
401#define WOWLAN_BIGTK_MIN_INDEX 6
402
403/*
404 * WOWLAN_TSC_RSC_PARAMS
405 */
406struct tkip_sc {
407 __le16 iv16;
408 __le16 pad;
409 __le32 iv32;
410} __packed; /* TKIP_SC_API_U_VER_1 */
411
412struct iwl_tkip_rsc_tsc {
413 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
414 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
415 struct tkip_sc tsc;
416} __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
417
418struct aes_sc {
419 __le64 pn;
420} __packed; /* TKIP_AES_SC_API_U_VER_1 */
421
422struct iwl_aes_rsc_tsc {
423 struct aes_sc unicast_rsc[IWL_NUM_RSC];
424 struct aes_sc multicast_rsc[IWL_NUM_RSC];
425 struct aes_sc tsc;
426} __packed; /* AES_TSC_RSC_API_S_VER_1 */
427
428union iwl_all_tsc_rsc {
429 struct iwl_tkip_rsc_tsc tkip;
430 struct iwl_aes_rsc_tsc aes;
431}; /* ALL_TSC_RSC_API_S_VER_2 */
432
433struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 {
434 union iwl_all_tsc_rsc all_tsc_rsc;
435} __packed; /* ALL_TSC_RSC_API_S_VER_2 */
436
437struct iwl_wowlan_rsc_tsc_params_cmd_v4 {
438 struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 params;
439 __le32 sta_id;
440} __packed; /* ALL_TSC_RSC_API_S_VER_4 */
441
442struct iwl_wowlan_rsc_tsc_params_cmd {
443 __le64 ucast_rsc[IWL_MAX_TID_COUNT];
444 __le64 mcast_rsc[WOWLAN_GTK_KEYS_NUM][IWL_MAX_TID_COUNT];
445 __le32 sta_id;
446#define IWL_MCAST_KEY_MAP_INVALID 0xff
447 u8 mcast_key_id_map[4];
448} __packed; /* ALL_TSC_RSC_API_S_VER_5 */
449
450#define IWL_MIC_KEY_SIZE 8
451struct iwl_mic_keys {
452 u8 tx[IWL_MIC_KEY_SIZE];
453 u8 rx_unicast[IWL_MIC_KEY_SIZE];
454 u8 rx_mcast[IWL_MIC_KEY_SIZE];
455} __packed; /* MIC_KEYS_API_S_VER_1 */
456
457#define IWL_P1K_SIZE 5
458struct iwl_p1k_cache {
459 __le16 p1k[IWL_P1K_SIZE];
460} __packed;
461
462#define IWL_NUM_RX_P1K_CACHE 2
463
464struct iwl_wowlan_tkip_params_cmd_ver_1 {
465 struct iwl_mic_keys mic_keys;
466 struct iwl_p1k_cache tx;
467 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
468 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
469} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
470
471struct iwl_wowlan_tkip_params_cmd {
472 struct iwl_mic_keys mic_keys;
473 struct iwl_p1k_cache tx;
474 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
475 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
476 u8 reversed[2];
477 __le32 sta_id;
478} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */
479
480#define IWL_KCK_MAX_SIZE 32
481#define IWL_KEK_MAX_SIZE 32
482
483struct iwl_wowlan_kek_kck_material_cmd_v2 {
484 u8 kck[IWL_KCK_MAX_SIZE];
485 u8 kek[IWL_KEK_MAX_SIZE];
486 __le16 kck_len;
487 __le16 kek_len;
488 __le64 replay_ctr;
489} __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
490
491struct iwl_wowlan_kek_kck_material_cmd_v3 {
492 u8 kck[IWL_KCK_MAX_SIZE];
493 u8 kek[IWL_KEK_MAX_SIZE];
494 __le16 kck_len;
495 __le16 kek_len;
496 __le64 replay_ctr;
497 __le32 akm;
498 __le32 gtk_cipher;
499 __le32 igtk_cipher;
500 __le32 bigtk_cipher;
501} __packed; /* KEK_KCK_MATERIAL_API_S_VER_3 */
502
503struct iwl_wowlan_kek_kck_material_cmd_v4 {
504 __le32 sta_id;
505 u8 kck[IWL_KCK_MAX_SIZE];
506 u8 kek[IWL_KEK_MAX_SIZE];
507 __le16 kck_len;
508 __le16 kek_len;
509 __le64 replay_ctr;
510 __le32 akm;
511 __le32 gtk_cipher;
512 __le32 igtk_cipher;
513 __le32 bigtk_cipher;
514} __packed; /* KEK_KCK_MATERIAL_API_S_VER_4 */
515
516struct iwl_wowlan_get_status_cmd {
517 __le32 sta_id;
518} __packed; /* WOWLAN_GET_STATUSES_CMD_API_S_VER_1 */
519
520#define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
521
522enum iwl_wowlan_rekey_status {
523 IWL_WOWLAN_REKEY_POST_REKEY = 0,
524 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
525}; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
526
527enum iwl_wowlan_wakeup_reason {
528 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
529 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
530 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
531 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
532 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
533 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
534 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
535 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
536 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
537 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
538 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
539 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
540 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
541 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
542 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
543 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
544 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
545 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
546 IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT(17),
547 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT(18),
548 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT(19),
549 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT(20),
550 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT(21),
551}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
552
553struct iwl_wowlan_gtk_status_v1 {
554 u8 key_index;
555 u8 reserved[3];
556 u8 decrypt_key[16];
557 u8 tkip_mic_key[8];
558 struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
559} __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */
560
561/**
562 * struct iwl_wowlan_gtk_status_v2 - GTK status
563 * @key: GTK material
564 * @key_len: GTK legth, if set to 0, the key is not available
565 * @key_flags: information about the key:
566 * bits[0:1]: key index assigned by the AP
567 * bits[2:6]: GTK index of the key in the internal DB
568 * bit[7]: Set iff this is the currently used GTK
569 * @reserved: padding
570 * @tkip_mic_key: TKIP RX MIC key
571 * @rsc: TSC RSC counters
572 */
573struct iwl_wowlan_gtk_status_v2 {
574 u8 key[WOWLAN_KEY_MAX_SIZE];
575 u8 key_len;
576 u8 key_flags;
577 u8 reserved[2];
578 u8 tkip_mic_key[8];
579 struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
580} __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */
581
582/**
583 * struct iwl_wowlan_all_rsc_tsc_v5 - key counters
584 * @ucast_rsc: unicast RSC values
585 * @mcast_rsc: multicast RSC values (per key map value)
586 * @sta_id: station ID
587 * @mcast_key_id_map: map of key id to @mcast_rsc entry
588 */
589struct iwl_wowlan_all_rsc_tsc_v5 {
590 __le64 ucast_rsc[IWL_MAX_TID_COUNT];
591 __le64 mcast_rsc[2][IWL_MAX_TID_COUNT];
592 __le32 sta_id;
593 u8 mcast_key_id_map[4];
594} __packed; /* ALL_TSC_RSC_API_S_VER_5 */
595
596/**
597 * struct iwl_wowlan_gtk_status_v3 - GTK status
598 * @key: GTK material
599 * @key_len: GTK length, if set to 0, the key is not available
600 * @key_flags: information about the key:
601 * bits[0:1]: key index assigned by the AP
602 * bits[2:6]: GTK index of the key in the internal DB
603 * bit[7]: Set iff this is the currently used GTK
604 * @reserved: padding
605 * @tkip_mic_key: TKIP RX MIC key
606 * @sc: RSC/TSC counters
607 */
608struct iwl_wowlan_gtk_status_v3 {
609 u8 key[WOWLAN_KEY_MAX_SIZE];
610 u8 key_len;
611 u8 key_flags;
612 u8 reserved[2];
613 u8 tkip_mic_key[IWL_MIC_KEY_SIZE];
614 struct iwl_wowlan_all_rsc_tsc_v5 sc;
615} __packed; /* WOWLAN_GTK_MATERIAL_VER_3 */
616
617#define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1))
618#define IWL_WOWLAN_IGTK_BIGTK_IDX_MASK (BIT(0))
619
620/**
621 * struct iwl_wowlan_igtk_status - IGTK status
622 * @key: IGTK material
623 * @ipn: the IGTK packet number (replay counter)
624 * @key_len: IGTK length, if set to 0, the key is not available
625 * @key_flags: information about the key:
626 * bits[0]: key index assigned by the AP (0: index 4, 1: index 5)
627 * (0: index 6, 1: index 7 with bigtk)
628 * bits[1:5]: IGTK index of the key in the internal DB
629 * bit[6]: Set iff this is the currently used IGTK
630 */
631struct iwl_wowlan_igtk_status {
632 u8 key[WOWLAN_KEY_MAX_SIZE];
633 u8 ipn[6];
634 u8 key_len;
635 u8 key_flags;
636} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
637
638/**
639 * struct iwl_wowlan_status_v6 - WoWLAN status
640 * @gtk: GTK data
641 * @replay_ctr: GTK rekey replay counter
642 * @pattern_number: number of the matched pattern
643 * @non_qos_seq_ctr: non-QoS sequence counter to use next
644 * @qos_seq_ctr: QoS sequence counters to use next
645 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
646 * @num_of_gtk_rekeys: number of GTK rekeys
647 * @transmitted_ndps: number of transmitted neighbor discovery packets
648 * @received_beacons: number of received beacons
649 * @wake_packet_length: wakeup packet length
650 * @wake_packet_bufsize: wakeup packet buffer size
651 * @wake_packet: wakeup packet
652 */
653struct iwl_wowlan_status_v6 {
654 struct iwl_wowlan_gtk_status_v1 gtk;
655 __le64 replay_ctr;
656 __le16 pattern_number;
657 __le16 non_qos_seq_ctr;
658 __le16 qos_seq_ctr[8];
659 __le32 wakeup_reasons;
660 __le32 num_of_gtk_rekeys;
661 __le32 transmitted_ndps;
662 __le32 received_beacons;
663 __le32 wake_packet_length;
664 __le32 wake_packet_bufsize;
665 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
666} __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
667
668/**
669 * struct iwl_wowlan_status_v7 - WoWLAN status
670 * @gtk: GTK data
671 * @igtk: IGTK data
672 * @replay_ctr: GTK rekey replay counter
673 * @pattern_number: number of the matched pattern
674 * @non_qos_seq_ctr: non-QoS sequence counter to use next
675 * @qos_seq_ctr: QoS sequence counters to use next
676 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
677 * @num_of_gtk_rekeys: number of GTK rekeys
678 * @transmitted_ndps: number of transmitted neighbor discovery packets
679 * @received_beacons: number of received beacons
680 * @wake_packet_length: wakeup packet length
681 * @wake_packet_bufsize: wakeup packet buffer size
682 * @wake_packet: wakeup packet
683 */
684struct iwl_wowlan_status_v7 {
685 struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
686 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
687 __le64 replay_ctr;
688 __le16 pattern_number;
689 __le16 non_qos_seq_ctr;
690 __le16 qos_seq_ctr[8];
691 __le32 wakeup_reasons;
692 __le32 num_of_gtk_rekeys;
693 __le32 transmitted_ndps;
694 __le32 received_beacons;
695 __le32 wake_packet_length;
696 __le32 wake_packet_bufsize;
697 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
698} __packed; /* WOWLAN_STATUSES_API_S_VER_7 */
699
700/**
701 * struct iwl_wowlan_status_v9 - WoWLAN status (versions 9 and 10)
702 * @gtk: GTK data
703 * @igtk: IGTK data
704 * @replay_ctr: GTK rekey replay counter
705 * @pattern_number: number of the matched pattern
706 * @non_qos_seq_ctr: non-QoS sequence counter to use next.
707 * Reserved if the struct has version >= 10.
708 * @qos_seq_ctr: QoS sequence counters to use next
709 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
710 * @num_of_gtk_rekeys: number of GTK rekeys
711 * @transmitted_ndps: number of transmitted neighbor discovery packets
712 * @received_beacons: number of received beacons
713 * @wake_packet_length: wakeup packet length
714 * @wake_packet_bufsize: wakeup packet buffer size
715 * @tid_tear_down: bit mask of tids whose BA sessions were closed
716 * in suspend state
717 * @reserved: unused
718 * @wake_packet: wakeup packet
719 */
720struct iwl_wowlan_status_v9 {
721 struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
722 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
723 __le64 replay_ctr;
724 __le16 pattern_number;
725 __le16 non_qos_seq_ctr;
726 __le16 qos_seq_ctr[8];
727 __le32 wakeup_reasons;
728 __le32 num_of_gtk_rekeys;
729 __le32 transmitted_ndps;
730 __le32 received_beacons;
731 __le32 wake_packet_length;
732 __le32 wake_packet_bufsize;
733 u8 tid_tear_down;
734 u8 reserved[3];
735 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
736} __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_9 */
737
738/**
739 * struct iwl_wowlan_status_v12 - WoWLAN status
740 * @gtk: GTK data
741 * @igtk: IGTK data
742 * @replay_ctr: GTK rekey replay counter
743 * @pattern_number: number of the matched pattern
744 * @non_qos_seq_ctr: non-QoS sequence counter to use next.
745 * Reserved if the struct has version >= 10.
746 * @qos_seq_ctr: QoS sequence counters to use next
747 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
748 * @num_of_gtk_rekeys: number of GTK rekeys
749 * @transmitted_ndps: number of transmitted neighbor discovery packets
750 * @received_beacons: number of received beacons
751 * @wake_packet_length: wakeup packet length
752 * @wake_packet_bufsize: wakeup packet buffer size
753 * @tid_tear_down: bit mask of tids whose BA sessions were closed
754 * in suspend state
755 * @reserved: unused
756 * @wake_packet: wakeup packet
757 */
758struct iwl_wowlan_status_v12 {
759 struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
760 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
761 __le64 replay_ctr;
762 __le16 pattern_number;
763 __le16 non_qos_seq_ctr;
764 __le16 qos_seq_ctr[8];
765 __le32 wakeup_reasons;
766 __le32 num_of_gtk_rekeys;
767 __le32 transmitted_ndps;
768 __le32 received_beacons;
769 __le32 wake_packet_length;
770 __le32 wake_packet_bufsize;
771 u8 tid_tear_down;
772 u8 reserved[3];
773 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
774} __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_12 */
775
776/**
777 * struct iwl_wowlan_info_notif_v1 - WoWLAN information notification
778 * @gtk: GTK data
779 * @igtk: IGTK data
780 * @replay_ctr: GTK rekey replay counter
781 * @pattern_number: number of the matched patterns
782 * @reserved1: reserved
783 * @qos_seq_ctr: QoS sequence counters to use next
784 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
785 * @num_of_gtk_rekeys: number of GTK rekeys
786 * @transmitted_ndps: number of transmitted neighbor discovery packets
787 * @received_beacons: number of received beacons
788 * @wake_packet_length: wakeup packet length
789 * @wake_packet_bufsize: wakeup packet buffer size
790 * @tid_tear_down: bit mask of tids whose BA sessions were closed
791 * in suspend state
792 * @station_id: station id
793 * @reserved2: reserved
794 */
795struct iwl_wowlan_info_notif_v1 {
796 struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
797 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
798 __le64 replay_ctr;
799 __le16 pattern_number;
800 __le16 reserved1;
801 __le16 qos_seq_ctr[8];
802 __le32 wakeup_reasons;
803 __le32 num_of_gtk_rekeys;
804 __le32 transmitted_ndps;
805 __le32 received_beacons;
806 __le32 wake_packet_length;
807 __le32 wake_packet_bufsize;
808 u8 tid_tear_down;
809 u8 station_id;
810 u8 reserved2[2];
811} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_1 */
812
813/**
814 * struct iwl_wowlan_info_notif_v2 - WoWLAN information notification
815 * @gtk: GTK data
816 * @igtk: IGTK data
817 * @replay_ctr: GTK rekey replay counter
818 * @pattern_number: number of the matched patterns
819 * @reserved1: reserved
820 * @qos_seq_ctr: QoS sequence counters to use next
821 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
822 * @num_of_gtk_rekeys: number of GTK rekeys
823 * @transmitted_ndps: number of transmitted neighbor discovery packets
824 * @received_beacons: number of received beacons
825 * @tid_tear_down: bit mask of tids whose BA sessions were closed
826 * in suspend state
827 * @station_id: station id
828 * @reserved2: reserved
829 */
830struct iwl_wowlan_info_notif_v2 {
831 struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
832 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
833 __le64 replay_ctr;
834 __le16 pattern_number;
835 __le16 reserved1;
836 __le16 qos_seq_ctr[8];
837 __le32 wakeup_reasons;
838 __le32 num_of_gtk_rekeys;
839 __le32 transmitted_ndps;
840 __le32 received_beacons;
841 u8 tid_tear_down;
842 u8 station_id;
843 u8 reserved2[2];
844} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_2 */
845
846/**
847 * struct iwl_wowlan_info_notif - WoWLAN information notification
848 * @gtk: GTK data
849 * @igtk: IGTK data
850 * @bigtk: BIGTK data
851 * @replay_ctr: GTK rekey replay counter
852 * @pattern_number: number of the matched patterns
853 * @reserved1: reserved
854 * @qos_seq_ctr: QoS sequence counters to use next
855 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
856 * @num_of_gtk_rekeys: number of GTK rekeys
857 * @transmitted_ndps: number of transmitted neighbor discovery packets
858 * @received_beacons: number of received beacons
859 * @tid_tear_down: bit mask of tids whose BA sessions were closed
860 * in suspend state
861 * @station_id: station id
862 * @reserved2: reserved
863 */
864struct iwl_wowlan_info_notif {
865 struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
866 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
867 struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];
868 __le64 replay_ctr;
869 __le16 pattern_number;
870 __le16 reserved1;
871 __le16 qos_seq_ctr[8];
872 __le32 wakeup_reasons;
873 __le32 num_of_gtk_rekeys;
874 __le32 transmitted_ndps;
875 __le32 received_beacons;
876 u8 tid_tear_down;
877 u8 station_id;
878 u8 reserved2[2];
879} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_3 */
880
881/**
882 * struct iwl_wowlan_wake_pkt_notif - WoWLAN wake packet notification
883 * @wake_packet_length: wakeup packet length
884 * @station_id: station id
885 * @reserved: unused
886 * @wake_packet: wakeup packet
887 */
888struct iwl_wowlan_wake_pkt_notif {
889 __le32 wake_packet_length;
890 u8 station_id;
891 u8 reserved[3];
892 u8 wake_packet[1];
893} __packed; /* WOWLAN_WAKE_PKT_NTFY_API_S_VER_1 */
894
895/**
896 * struct iwl_mvm_d3_end_notif - d3 end notification
897 * @flags: See &enum iwl_d0i3_flags
898 */
899struct iwl_mvm_d3_end_notif {
900 __le32 flags;
901} __packed;
902
903/* TODO: NetDetect API */
904
905#endif /* __iwl_fw_api_d3_h__ */
1/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2018 - 2019 Intel Corporation
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as
15 * published by the Free Software Foundation.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * The full GNU General Public License is included in this distribution
23 * in the file called COPYING.
24 *
25 * Contact Information:
26 * Intel Linux Wireless <linuxwifi@intel.com>
27 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
28 *
29 * BSD LICENSE
30 *
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2018 - 2019 Intel Corporation
35 * All rights reserved.
36 *
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
39 * are met:
40 *
41 * * Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * * Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in
45 * the documentation and/or other materials provided with the
46 * distribution.
47 * * Neither the name Intel Corporation nor the names of its
48 * contributors may be used to endorse or promote products derived
49 * from this software without specific prior written permission.
50 *
51 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 *****************************************************************************/
63
64#ifndef __iwl_fw_api_d3_h__
65#define __iwl_fw_api_d3_h__
66
67/**
68 * enum iwl_d0i3_flags - d0i3 flags
69 * @IWL_D0I3_RESET_REQUIRE: FW require reset upon resume
70 */
71enum iwl_d0i3_flags {
72 IWL_D0I3_RESET_REQUIRE = BIT(0),
73};
74
75/**
76 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
77 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
78 */
79enum iwl_d3_wakeup_flags {
80 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
81}; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
82
83/**
84 * struct iwl_d3_manager_config - D3 manager configuration command
85 * @min_sleep_time: minimum sleep time (in usec)
86 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
87 * @wakeup_host_timer: force wakeup after this many seconds
88 *
89 * The structure is used for the D3_CONFIG_CMD command.
90 */
91struct iwl_d3_manager_config {
92 __le32 min_sleep_time;
93 __le32 wakeup_flags;
94 __le32 wakeup_host_timer;
95} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
96
97
98/* TODO: OFFLOADS_QUERY_API_S_VER_1 */
99
100/**
101 * enum iwl_d3_proto_offloads - enabled protocol offloads
102 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
103 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
104 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
105 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
106 */
107enum iwl_proto_offloads {
108 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
109 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
110 IWL_D3_PROTO_IPV4_VALID = BIT(2),
111 IWL_D3_PROTO_IPV6_VALID = BIT(3),
112};
113
114#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
115#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
116#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
117#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
118#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
119
120#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
121#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
122
123/**
124 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
125 * @enabled: enable flags
126 * @remote_ipv4_addr: remote address to answer to (or zero if all)
127 * @host_ipv4_addr: our IPv4 address to respond to queries for
128 * @arp_mac_addr: our MAC address for ARP responses
129 * @reserved: unused
130 */
131struct iwl_proto_offload_cmd_common {
132 __le32 enabled;
133 __be32 remote_ipv4_addr;
134 __be32 host_ipv4_addr;
135 u8 arp_mac_addr[ETH_ALEN];
136 __le16 reserved;
137} __packed;
138
139/**
140 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
141 * @common: common/IPv4 configuration
142 * @remote_ipv6_addr: remote address to answer to (or zero if all)
143 * @solicited_node_ipv6_addr: broken -- solicited node address exists
144 * for each target address
145 * @target_ipv6_addr: our target addresses
146 * @ndp_mac_addr: neighbor solicitation response MAC address
147 * @reserved2: reserved
148 */
149struct iwl_proto_offload_cmd_v1 {
150 struct iwl_proto_offload_cmd_common common;
151 u8 remote_ipv6_addr[16];
152 u8 solicited_node_ipv6_addr[16];
153 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
154 u8 ndp_mac_addr[ETH_ALEN];
155 __le16 reserved2;
156} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
157
158/**
159 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
160 * @common: common/IPv4 configuration
161 * @remote_ipv6_addr: remote address to answer to (or zero if all)
162 * @solicited_node_ipv6_addr: broken -- solicited node address exists
163 * for each target address
164 * @target_ipv6_addr: our target addresses
165 * @ndp_mac_addr: neighbor solicitation response MAC address
166 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
167 * @reserved2: reserved
168 */
169struct iwl_proto_offload_cmd_v2 {
170 struct iwl_proto_offload_cmd_common common;
171 u8 remote_ipv6_addr[16];
172 u8 solicited_node_ipv6_addr[16];
173 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
174 u8 ndp_mac_addr[ETH_ALEN];
175 u8 num_valid_ipv6_addrs;
176 u8 reserved2[3];
177} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
178
179struct iwl_ns_config {
180 struct in6_addr source_ipv6_addr;
181 struct in6_addr dest_ipv6_addr;
182 u8 target_mac_addr[ETH_ALEN];
183 __le16 reserved;
184} __packed; /* NS_OFFLOAD_CONFIG */
185
186struct iwl_targ_addr {
187 struct in6_addr addr;
188 __le32 config_num;
189} __packed; /* TARGET_IPV6_ADDRESS */
190
191/**
192 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
193 * @common: common/IPv4 configuration
194 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
195 * @targ_addrs: target IPv6 addresses
196 * @ns_config: NS offload configurations
197 */
198struct iwl_proto_offload_cmd_v3_small {
199 struct iwl_proto_offload_cmd_common common;
200 __le32 num_valid_ipv6_addrs;
201 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
202 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
203} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
204
205/**
206 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
207 * @common: common/IPv4 configuration
208 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
209 * @targ_addrs: target IPv6 addresses
210 * @ns_config: NS offload configurations
211 */
212struct iwl_proto_offload_cmd_v3_large {
213 struct iwl_proto_offload_cmd_common common;
214 __le32 num_valid_ipv6_addrs;
215 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
216 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
217} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
218
219/*
220 * WOWLAN_PATTERNS
221 */
222#define IWL_WOWLAN_MIN_PATTERN_LEN 16
223#define IWL_WOWLAN_MAX_PATTERN_LEN 128
224
225struct iwl_wowlan_pattern_v1 {
226 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
227 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
228 u8 mask_size;
229 u8 pattern_size;
230 __le16 reserved;
231} __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
232
233#define IWL_WOWLAN_MAX_PATTERNS 20
234
235/**
236 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns
237 */
238struct iwl_wowlan_patterns_cmd_v1 {
239 /**
240 * @n_patterns: number of patterns
241 */
242 __le32 n_patterns;
243
244 /**
245 * @patterns: the patterns, array length in @n_patterns
246 */
247 struct iwl_wowlan_pattern_v1 patterns[];
248} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
249
250#define IPV4_ADDR_SIZE 4
251#define IPV6_ADDR_SIZE 16
252
253enum iwl_wowlan_pattern_type {
254 WOWLAN_PATTERN_TYPE_BITMASK,
255 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN,
256 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN,
257 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD,
258 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD,
259}; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */
260
261/**
262 * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data
263 */
264struct iwl_wowlan_ipv4_tcp_syn {
265 /**
266 * @src_addr: source IP address to match
267 */
268 u8 src_addr[IPV4_ADDR_SIZE];
269
270 /**
271 * @dst_addr: destination IP address to match
272 */
273 u8 dst_addr[IPV4_ADDR_SIZE];
274
275 /**
276 * @src_port: source TCP port to match
277 */
278 __le16 src_port;
279
280 /**
281 * @dst_port: destination TCP port to match
282 */
283 __le16 dst_port;
284} __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */
285
286/**
287 * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data
288 */
289struct iwl_wowlan_ipv6_tcp_syn {
290 /**
291 * @src_addr: source IP address to match
292 */
293 u8 src_addr[IPV6_ADDR_SIZE];
294
295 /**
296 * @dst_addr: destination IP address to match
297 */
298 u8 dst_addr[IPV6_ADDR_SIZE];
299
300 /**
301 * @src_port: source TCP port to match
302 */
303 __le16 src_port;
304
305 /**
306 * @dst_port: destination TCP port to match
307 */
308 __le16 dst_port;
309} __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */
310
311/**
312 * union iwl_wowlan_pattern_data - Data for the different pattern types
313 *
314 * If wildcard addresses/ports are to be used, the union can be left
315 * undefined.
316 */
317union iwl_wowlan_pattern_data {
318 /**
319 * @bitmask: bitmask pattern data
320 */
321 struct iwl_wowlan_pattern_v1 bitmask;
322
323 /**
324 * @ipv4_tcp_syn: IPv4 TCP SYN pattern data
325 */
326 struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn;
327
328 /**
329 * @ipv6_tcp_syn: IPv6 TCP SYN pattern data
330 */
331 struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn;
332}; /* WOWLAN_PATTERN_API_U_VER_1 */
333
334/**
335 * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns
336 */
337struct iwl_wowlan_pattern_v2 {
338 /**
339 * @pattern_type: defines the struct type to be used in the union
340 */
341 u8 pattern_type;
342
343 /**
344 * @reserved: reserved for alignment
345 */
346 u8 reserved[3];
347
348 /**
349 * @u: the union containing the match data, or undefined for
350 * wildcard matches
351 */
352 union iwl_wowlan_pattern_data u;
353} __packed; /* WOWLAN_PATTERN_API_S_VER_2 */
354
355/**
356 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command
357 */
358struct iwl_wowlan_patterns_cmd {
359 /**
360 * @n_patterns: number of patterns
361 */
362 __le32 n_patterns;
363
364 /**
365 * @patterns: the patterns, array length in @n_patterns
366 */
367 struct iwl_wowlan_pattern_v2 patterns[];
368} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_2 */
369
370enum iwl_wowlan_wakeup_filters {
371 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
372 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
373 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
374 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
375 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
376 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
377 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
378 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
379 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
380 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
381 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
382 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
383 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
384 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
385 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
386 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
387 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
388}; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
389
390enum iwl_wowlan_flags {
391 IS_11W_ASSOC = BIT(0),
392 ENABLE_L3_FILTERING = BIT(1),
393 ENABLE_NBNS_FILTERING = BIT(2),
394 ENABLE_DHCP_FILTERING = BIT(3),
395 ENABLE_STORE_BEACON = BIT(4),
396};
397
398/**
399 * struct iwl_wowlan_config_cmd - WoWLAN configuration
400 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
401 * @non_qos_seq: non-QoS sequence counter to use next
402 * @qos_seq: QoS sequence counters to use next
403 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
404 * @is_11n_connection: indicates HT connection
405 * @offloading_tid: TID reserved for firmware use
406 * @flags: extra flags, see &enum iwl_wowlan_flags
407 * @sta_id: station ID for wowlan.
408 * @reserved: reserved
409 */
410struct iwl_wowlan_config_cmd {
411 __le32 wakeup_filter;
412 __le16 non_qos_seq;
413 __le16 qos_seq[8];
414 u8 wowlan_ba_teardown_tids;
415 u8 is_11n_connection;
416 u8 offloading_tid;
417 u8 flags;
418 u8 sta_id;
419 u8 reserved;
420} __packed; /* WOWLAN_CONFIG_API_S_VER_5 */
421
422/*
423 * WOWLAN_TSC_RSC_PARAMS
424 */
425#define IWL_NUM_RSC 16
426
427struct tkip_sc {
428 __le16 iv16;
429 __le16 pad;
430 __le32 iv32;
431} __packed; /* TKIP_SC_API_U_VER_1 */
432
433struct iwl_tkip_rsc_tsc {
434 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
435 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
436 struct tkip_sc tsc;
437} __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
438
439struct aes_sc {
440 __le64 pn;
441} __packed; /* TKIP_AES_SC_API_U_VER_1 */
442
443struct iwl_aes_rsc_tsc {
444 struct aes_sc unicast_rsc[IWL_NUM_RSC];
445 struct aes_sc multicast_rsc[IWL_NUM_RSC];
446 struct aes_sc tsc;
447} __packed; /* AES_TSC_RSC_API_S_VER_1 */
448
449union iwl_all_tsc_rsc {
450 struct iwl_tkip_rsc_tsc tkip;
451 struct iwl_aes_rsc_tsc aes;
452}; /* ALL_TSC_RSC_API_S_VER_2 */
453
454struct iwl_wowlan_rsc_tsc_params_cmd {
455 union iwl_all_tsc_rsc all_tsc_rsc;
456} __packed; /* ALL_TSC_RSC_API_S_VER_2 */
457
458#define IWL_MIC_KEY_SIZE 8
459struct iwl_mic_keys {
460 u8 tx[IWL_MIC_KEY_SIZE];
461 u8 rx_unicast[IWL_MIC_KEY_SIZE];
462 u8 rx_mcast[IWL_MIC_KEY_SIZE];
463} __packed; /* MIC_KEYS_API_S_VER_1 */
464
465#define IWL_P1K_SIZE 5
466struct iwl_p1k_cache {
467 __le16 p1k[IWL_P1K_SIZE];
468} __packed;
469
470#define IWL_NUM_RX_P1K_CACHE 2
471
472struct iwl_wowlan_tkip_params_cmd {
473 struct iwl_mic_keys mic_keys;
474 struct iwl_p1k_cache tx;
475 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
476 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
477} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
478
479#define IWL_KCK_MAX_SIZE 32
480#define IWL_KEK_MAX_SIZE 32
481
482struct iwl_wowlan_kek_kck_material_cmd {
483 u8 kck[IWL_KCK_MAX_SIZE];
484 u8 kek[IWL_KEK_MAX_SIZE];
485 __le16 kck_len;
486 __le16 kek_len;
487 __le64 replay_ctr;
488} __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
489
490#define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
491
492enum iwl_wowlan_rekey_status {
493 IWL_WOWLAN_REKEY_POST_REKEY = 0,
494 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
495}; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
496
497enum iwl_wowlan_wakeup_reason {
498 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
499 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
500 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
501 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
502 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
503 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
504 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
505 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
506 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
507 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
508 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
509 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
510 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
511 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
512 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
513 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
514 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
515 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
516 IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT(17),
517 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT(18),
518 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT(19),
519 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT(20),
520 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT(21),
521}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
522
523struct iwl_wowlan_gtk_status_v1 {
524 u8 key_index;
525 u8 reserved[3];
526 u8 decrypt_key[16];
527 u8 tkip_mic_key[8];
528 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
529} __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */
530
531#define WOWLAN_KEY_MAX_SIZE 32
532#define WOWLAN_GTK_KEYS_NUM 2
533#define WOWLAN_IGTK_KEYS_NUM 2
534
535/**
536 * struct iwl_wowlan_gtk_status - GTK status
537 * @key: GTK material
538 * @key_len: GTK legth, if set to 0, the key is not available
539 * @key_flags: information about the key:
540 * bits[0:1]: key index assigned by the AP
541 * bits[2:6]: GTK index of the key in the internal DB
542 * bit[7]: Set iff this is the currently used GTK
543 * @reserved: padding
544 * @tkip_mic_key: TKIP RX MIC key
545 * @rsc: TSC RSC counters
546 */
547struct iwl_wowlan_gtk_status {
548 u8 key[WOWLAN_KEY_MAX_SIZE];
549 u8 key_len;
550 u8 key_flags;
551 u8 reserved[2];
552 u8 tkip_mic_key[8];
553 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
554} __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */
555
556#define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1))
557
558/**
559 * struct iwl_wowlan_igtk_status - IGTK status
560 * @key: IGTK material
561 * @ipn: the IGTK packet number (replay counter)
562 * @key_len: IGTK length, if set to 0, the key is not available
563 * @key_flags: information about the key:
564 * bits[0]: key index assigned by the AP (0: index 4, 1: index 5)
565 * bits[1:5]: IGTK index of the key in the internal DB
566 * bit[6]: Set iff this is the currently used IGTK
567 */
568struct iwl_wowlan_igtk_status {
569 u8 key[WOWLAN_KEY_MAX_SIZE];
570 u8 ipn[6];
571 u8 key_len;
572 u8 key_flags;
573} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
574
575/**
576 * struct iwl_wowlan_status_v6 - WoWLAN status
577 * @gtk: GTK data
578 * @replay_ctr: GTK rekey replay counter
579 * @pattern_number: number of the matched pattern
580 * @non_qos_seq_ctr: non-QoS sequence counter to use next
581 * @qos_seq_ctr: QoS sequence counters to use next
582 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
583 * @num_of_gtk_rekeys: number of GTK rekeys
584 * @transmitted_ndps: number of transmitted neighbor discovery packets
585 * @received_beacons: number of received beacons
586 * @wake_packet_length: wakeup packet length
587 * @wake_packet_bufsize: wakeup packet buffer size
588 * @wake_packet: wakeup packet
589 */
590struct iwl_wowlan_status_v6 {
591 struct iwl_wowlan_gtk_status_v1 gtk;
592 __le64 replay_ctr;
593 __le16 pattern_number;
594 __le16 non_qos_seq_ctr;
595 __le16 qos_seq_ctr[8];
596 __le32 wakeup_reasons;
597 __le32 num_of_gtk_rekeys;
598 __le32 transmitted_ndps;
599 __le32 received_beacons;
600 __le32 wake_packet_length;
601 __le32 wake_packet_bufsize;
602 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
603} __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
604
605/**
606 * struct iwl_wowlan_status - WoWLAN status
607 * @gtk: GTK data
608 * @igtk: IGTK data
609 * @replay_ctr: GTK rekey replay counter
610 * @pattern_number: number of the matched pattern
611 * @non_qos_seq_ctr: non-QoS sequence counter to use next
612 * @qos_seq_ctr: QoS sequence counters to use next
613 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
614 * @num_of_gtk_rekeys: number of GTK rekeys
615 * @transmitted_ndps: number of transmitted neighbor discovery packets
616 * @received_beacons: number of received beacons
617 * @wake_packet_length: wakeup packet length
618 * @wake_packet_bufsize: wakeup packet buffer size
619 * @wake_packet: wakeup packet
620 */
621struct iwl_wowlan_status_v7 {
622 struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM];
623 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
624 __le64 replay_ctr;
625 __le16 pattern_number;
626 __le16 non_qos_seq_ctr;
627 __le16 qos_seq_ctr[8];
628 __le32 wakeup_reasons;
629 __le32 num_of_gtk_rekeys;
630 __le32 transmitted_ndps;
631 __le32 received_beacons;
632 __le32 wake_packet_length;
633 __le32 wake_packet_bufsize;
634 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
635} __packed; /* WOWLAN_STATUSES_API_S_VER_7 */
636
637/**
638 * struct iwl_wowlan_status - WoWLAN status
639 * @gtk: GTK data
640 * @igtk: IGTK data
641 * @replay_ctr: GTK rekey replay counter
642 * @pattern_number: number of the matched pattern
643 * @non_qos_seq_ctr: non-QoS sequence counter to use next
644 * @qos_seq_ctr: QoS sequence counters to use next
645 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
646 * @num_of_gtk_rekeys: number of GTK rekeys
647 * @transmitted_ndps: number of transmitted neighbor discovery packets
648 * @received_beacons: number of received beacons
649 * @wake_packet_length: wakeup packet length
650 * @wake_packet_bufsize: wakeup packet buffer size
651 * @tid_tear_down: bit mask of tids whose BA sessions were closed
652 * in suspend state
653 * @reserved: unused
654 * @wake_packet: wakeup packet
655 */
656struct iwl_wowlan_status {
657 struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM];
658 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
659 __le64 replay_ctr;
660 __le16 pattern_number;
661 __le16 non_qos_seq_ctr;
662 __le16 qos_seq_ctr[8];
663 __le32 wakeup_reasons;
664 __le32 num_of_gtk_rekeys;
665 __le32 transmitted_ndps;
666 __le32 received_beacons;
667 __le32 wake_packet_length;
668 __le32 wake_packet_bufsize;
669 u8 tid_tear_down;
670 u8 reserved[3];
671 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
672} __packed; /* WOWLAN_STATUSES_API_S_VER_9 */
673
674static inline u8 iwlmvm_wowlan_gtk_idx(struct iwl_wowlan_gtk_status *gtk)
675{
676 return gtk->key_flags & IWL_WOWLAN_GTK_IDX_MASK;
677}
678
679#define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
680#define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
681#define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
682
683struct iwl_tcp_packet_info {
684 __le16 tcp_pseudo_header_checksum;
685 __le16 tcp_payload_length;
686} __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
687
688struct iwl_tcp_packet {
689 struct iwl_tcp_packet_info info;
690 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
691 u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
692} __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
693
694struct iwl_remote_wake_packet {
695 struct iwl_tcp_packet_info info;
696 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
697 u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
698} __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
699
700struct iwl_wowlan_remote_wake_config {
701 __le32 connection_max_time; /* unused */
702 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
703 u8 max_syn_retries;
704 u8 max_data_retries;
705 u8 tcp_syn_ack_timeout;
706 u8 tcp_ack_timeout;
707
708 struct iwl_tcp_packet syn_tx;
709 struct iwl_tcp_packet synack_rx;
710 struct iwl_tcp_packet keepalive_ack_rx;
711 struct iwl_tcp_packet fin_tx;
712
713 struct iwl_remote_wake_packet keepalive_tx;
714 struct iwl_remote_wake_packet wake_rx;
715
716 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
717 u8 sequence_number_offset;
718 u8 sequence_number_length;
719 u8 token_offset;
720 u8 token_length;
721 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
722 __le32 initial_sequence_number;
723 __le16 keepalive_interval;
724 __le16 num_tokens;
725 u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
726} __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
727
728/* TODO: NetDetect API */
729
730#endif /* __iwl_fw_api_d3_h__ */