1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66#ifndef __fw_api_d3_h__
67#define __fw_api_d3_h__
68
69
70
71
72
73enum iwl_d3_wakeup_flags {
74 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
75};
76
77
78
79
80
81
82
83
84
85struct iwl_d3_manager_config {
86 __le32 min_sleep_time;
87 __le32 wakeup_flags;
88 __le32 wakeup_host_timer;
89} __packed;
90
91
92
93
94
95
96
97
98
99
100
101enum iwl_proto_offloads {
102 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
103 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
104 IWL_D3_PROTO_IPV4_VALID = BIT(2),
105 IWL_D3_PROTO_IPV6_VALID = BIT(3),
106};
107
108#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
109#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
110#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
111#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
112#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
113
114#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
115#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
116
117
118
119
120
121
122
123
124
125struct iwl_proto_offload_cmd_common {
126 __le32 enabled;
127 __be32 remote_ipv4_addr;
128 __be32 host_ipv4_addr;
129 u8 arp_mac_addr[ETH_ALEN];
130 __le16 reserved;
131} __packed;
132
133
134
135
136
137
138
139
140
141
142struct iwl_proto_offload_cmd_v1 {
143 struct iwl_proto_offload_cmd_common common;
144 u8 remote_ipv6_addr[16];
145 u8 solicited_node_ipv6_addr[16];
146 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
147 u8 ndp_mac_addr[ETH_ALEN];
148 __le16 reserved2;
149} __packed;
150
151
152
153
154
155
156
157
158
159
160struct iwl_proto_offload_cmd_v2 {
161 struct iwl_proto_offload_cmd_common common;
162 u8 remote_ipv6_addr[16];
163 u8 solicited_node_ipv6_addr[16];
164 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
165 u8 ndp_mac_addr[ETH_ALEN];
166 u8 numValidIPv6Addresses;
167 u8 reserved2[3];
168} __packed;
169
170struct iwl_ns_config {
171 struct in6_addr source_ipv6_addr;
172 struct in6_addr dest_ipv6_addr;
173 u8 target_mac_addr[ETH_ALEN];
174 __le16 reserved;
175} __packed;
176
177struct iwl_targ_addr {
178 struct in6_addr addr;
179 __le32 config_num;
180} __packed;
181
182
183
184
185
186
187
188struct iwl_proto_offload_cmd_v3_small {
189 struct iwl_proto_offload_cmd_common common;
190 __le32 num_valid_ipv6_addrs;
191 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
192 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
193} __packed;
194
195
196
197
198
199
200
201struct iwl_proto_offload_cmd_v3_large {
202 struct iwl_proto_offload_cmd_common common;
203 __le32 num_valid_ipv6_addrs;
204 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
205 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
206} __packed;
207
208
209
210
211#define IWL_WOWLAN_MIN_PATTERN_LEN 16
212#define IWL_WOWLAN_MAX_PATTERN_LEN 128
213
214struct iwl_wowlan_pattern {
215 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
216 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
217 u8 mask_size;
218 u8 pattern_size;
219 __le16 reserved;
220} __packed;
221
222#define IWL_WOWLAN_MAX_PATTERNS 20
223
224struct iwl_wowlan_patterns_cmd {
225 __le32 n_patterns;
226 struct iwl_wowlan_pattern patterns[];
227} __packed;
228
229enum iwl_wowlan_wakeup_filters {
230 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
231 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
232 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
233 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
234 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
235 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
236 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
237 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
238 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
239 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
240 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
241 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
242 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
243 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
244 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
245 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
246 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
247};
248
249enum iwl_wowlan_flags {
250 IS_11W_ASSOC = BIT(0),
251 ENABLE_L3_FILTERING = BIT(1),
252 ENABLE_NBNS_FILTERING = BIT(2),
253 ENABLE_DHCP_FILTERING = BIT(3),
254 ENABLE_STORE_BEACON = BIT(4),
255};
256
257struct iwl_wowlan_config_cmd {
258 __le32 wakeup_filter;
259 __le16 non_qos_seq;
260 __le16 qos_seq[8];
261 u8 wowlan_ba_teardown_tids;
262 u8 is_11n_connection;
263 u8 offloading_tid;
264 u8 flags;
265 u8 reserved[2];
266} __packed;
267
268
269
270
271#define IWL_NUM_RSC 16
272
273struct tkip_sc {
274 __le16 iv16;
275 __le16 pad;
276 __le32 iv32;
277} __packed;
278
279struct iwl_tkip_rsc_tsc {
280 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
281 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
282 struct tkip_sc tsc;
283} __packed;
284
285struct aes_sc {
286 __le64 pn;
287} __packed;
288
289struct iwl_aes_rsc_tsc {
290 struct aes_sc unicast_rsc[IWL_NUM_RSC];
291 struct aes_sc multicast_rsc[IWL_NUM_RSC];
292 struct aes_sc tsc;
293} __packed;
294
295union iwl_all_tsc_rsc {
296 struct iwl_tkip_rsc_tsc tkip;
297 struct iwl_aes_rsc_tsc aes;
298};
299
300struct iwl_wowlan_rsc_tsc_params_cmd {
301 union iwl_all_tsc_rsc all_tsc_rsc;
302} __packed;
303
304#define IWL_MIC_KEY_SIZE 8
305struct iwl_mic_keys {
306 u8 tx[IWL_MIC_KEY_SIZE];
307 u8 rx_unicast[IWL_MIC_KEY_SIZE];
308 u8 rx_mcast[IWL_MIC_KEY_SIZE];
309} __packed;
310
311#define IWL_P1K_SIZE 5
312struct iwl_p1k_cache {
313 __le16 p1k[IWL_P1K_SIZE];
314} __packed;
315
316#define IWL_NUM_RX_P1K_CACHE 2
317
318struct iwl_wowlan_tkip_params_cmd {
319 struct iwl_mic_keys mic_keys;
320 struct iwl_p1k_cache tx;
321 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
322 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
323} __packed;
324
325#define IWL_KCK_MAX_SIZE 32
326#define IWL_KEK_MAX_SIZE 32
327
328struct iwl_wowlan_kek_kck_material_cmd {
329 u8 kck[IWL_KCK_MAX_SIZE];
330 u8 kek[IWL_KEK_MAX_SIZE];
331 __le16 kck_len;
332 __le16 kek_len;
333 __le64 replay_ctr;
334} __packed;
335
336#define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
337
338enum iwl_wowlan_rekey_status {
339 IWL_WOWLAN_REKEY_POST_REKEY = 0,
340 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
341};
342
343enum iwl_wowlan_wakeup_reason {
344 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
345 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
346 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
347 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
348 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
349 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
350 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
351 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
352 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
353 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
354 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
355 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
356 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
357 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
358 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
359 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
360 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
361 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
362
363};
364
365struct iwl_wowlan_gtk_status {
366 u8 key_index;
367 u8 reserved[3];
368 u8 decrypt_key[16];
369 u8 tkip_mic_key[8];
370 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
371} __packed;
372
373struct iwl_wowlan_status {
374 struct iwl_wowlan_gtk_status gtk;
375 __le64 replay_ctr;
376 __le16 pattern_number;
377 __le16 non_qos_seq_ctr;
378 __le16 qos_seq_ctr[8];
379 __le32 wakeup_reasons;
380 __le32 num_of_gtk_rekeys;
381 __le32 transmitted_ndps;
382 __le32 received_beacons;
383 __le32 wake_packet_length;
384 __le32 wake_packet_bufsize;
385 u8 wake_packet[];
386} __packed;
387
388#define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
389#define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
390#define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
391
392struct iwl_tcp_packet_info {
393 __le16 tcp_pseudo_header_checksum;
394 __le16 tcp_payload_length;
395} __packed;
396
397struct iwl_tcp_packet {
398 struct iwl_tcp_packet_info info;
399 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
400 u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
401} __packed;
402
403struct iwl_remote_wake_packet {
404 struct iwl_tcp_packet_info info;
405 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
406 u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
407} __packed;
408
409struct iwl_wowlan_remote_wake_config {
410 __le32 connection_max_time;
411
412 u8 max_syn_retries;
413 u8 max_data_retries;
414 u8 tcp_syn_ack_timeout;
415 u8 tcp_ack_timeout;
416
417 struct iwl_tcp_packet syn_tx;
418 struct iwl_tcp_packet synack_rx;
419 struct iwl_tcp_packet keepalive_ack_rx;
420 struct iwl_tcp_packet fin_tx;
421
422 struct iwl_remote_wake_packet keepalive_tx;
423 struct iwl_remote_wake_packet wake_rx;
424
425
426 u8 sequence_number_offset;
427 u8 sequence_number_length;
428 u8 token_offset;
429 u8 token_length;
430
431 __le32 initial_sequence_number;
432 __le16 keepalive_interval;
433 __le16 num_tokens;
434 u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
435} __packed;
436
437
438
439#endif
440