This source file includes following definitions.
- iwlmvm_wowlan_gtk_idx
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 #ifndef __iwl_fw_api_d3_h__
65 #define __iwl_fw_api_d3_h__
66
67
68
69
70
71 enum iwl_d3_wakeup_flags {
72 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
73 };
74
75
76
77
78
79
80
81
82
83 struct iwl_d3_manager_config {
84 __le32 min_sleep_time;
85 __le32 wakeup_flags;
86 __le32 wakeup_host_timer;
87 } __packed;
88
89
90
91
92
93
94
95
96
97
98
99 enum iwl_proto_offloads {
100 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
101 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
102 IWL_D3_PROTO_IPV4_VALID = BIT(2),
103 IWL_D3_PROTO_IPV6_VALID = BIT(3),
104 };
105
106 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
107 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
108 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
109 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
110 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
111
112 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
113 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
114
115
116
117
118
119
120
121
122
123 struct iwl_proto_offload_cmd_common {
124 __le32 enabled;
125 __be32 remote_ipv4_addr;
126 __be32 host_ipv4_addr;
127 u8 arp_mac_addr[ETH_ALEN];
128 __le16 reserved;
129 } __packed;
130
131
132
133
134
135
136
137
138
139
140
141 struct iwl_proto_offload_cmd_v1 {
142 struct iwl_proto_offload_cmd_common common;
143 u8 remote_ipv6_addr[16];
144 u8 solicited_node_ipv6_addr[16];
145 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
146 u8 ndp_mac_addr[ETH_ALEN];
147 __le16 reserved2;
148 } __packed;
149
150
151
152
153
154
155
156
157
158
159
160
161 struct iwl_proto_offload_cmd_v2 {
162 struct iwl_proto_offload_cmd_common common;
163 u8 remote_ipv6_addr[16];
164 u8 solicited_node_ipv6_addr[16];
165 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
166 u8 ndp_mac_addr[ETH_ALEN];
167 u8 num_valid_ipv6_addrs;
168 u8 reserved2[3];
169 } __packed;
170
171 struct iwl_ns_config {
172 struct in6_addr source_ipv6_addr;
173 struct in6_addr dest_ipv6_addr;
174 u8 target_mac_addr[ETH_ALEN];
175 __le16 reserved;
176 } __packed;
177
178 struct iwl_targ_addr {
179 struct in6_addr addr;
180 __le32 config_num;
181 } __packed;
182
183
184
185
186
187
188
189
190 struct iwl_proto_offload_cmd_v3_small {
191 struct iwl_proto_offload_cmd_common common;
192 __le32 num_valid_ipv6_addrs;
193 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
194 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
195 } __packed;
196
197
198
199
200
201
202
203
204 struct iwl_proto_offload_cmd_v3_large {
205 struct iwl_proto_offload_cmd_common common;
206 __le32 num_valid_ipv6_addrs;
207 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
208 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
209 } __packed;
210
211
212
213
214 #define IWL_WOWLAN_MIN_PATTERN_LEN 16
215 #define IWL_WOWLAN_MAX_PATTERN_LEN 128
216
217 struct iwl_wowlan_pattern_v1 {
218 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
219 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
220 u8 mask_size;
221 u8 pattern_size;
222 __le16 reserved;
223 } __packed;
224
225 #define IWL_WOWLAN_MAX_PATTERNS 20
226
227
228
229
230 struct iwl_wowlan_patterns_cmd_v1 {
231
232
233
234 __le32 n_patterns;
235
236
237
238
239 struct iwl_wowlan_pattern_v1 patterns[];
240 } __packed;
241
242 #define IPV4_ADDR_SIZE 4
243 #define IPV6_ADDR_SIZE 16
244
245 enum iwl_wowlan_pattern_type {
246 WOWLAN_PATTERN_TYPE_BITMASK,
247 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN,
248 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN,
249 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD,
250 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD,
251 };
252
253
254
255
256 struct iwl_wowlan_ipv4_tcp_syn {
257
258
259
260 u8 src_addr[IPV4_ADDR_SIZE];
261
262
263
264
265 u8 dst_addr[IPV4_ADDR_SIZE];
266
267
268
269
270 __le16 src_port;
271
272
273
274
275 __le16 dst_port;
276 } __packed;
277
278
279
280
281 struct iwl_wowlan_ipv6_tcp_syn {
282
283
284
285 u8 src_addr[IPV6_ADDR_SIZE];
286
287
288
289
290 u8 dst_addr[IPV6_ADDR_SIZE];
291
292
293
294
295 __le16 src_port;
296
297
298
299
300 __le16 dst_port;
301 } __packed;
302
303
304
305
306
307
308
309 union iwl_wowlan_pattern_data {
310
311
312
313 struct iwl_wowlan_pattern_v1 bitmask;
314
315
316
317
318 struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn;
319
320
321
322
323 struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn;
324 };
325
326
327
328
329 struct iwl_wowlan_pattern_v2 {
330
331
332
333 u8 pattern_type;
334
335
336
337
338 u8 reserved[3];
339
340
341
342
343
344 union iwl_wowlan_pattern_data u;
345 } __packed;
346
347
348
349
350 struct iwl_wowlan_patterns_cmd {
351
352
353
354 __le32 n_patterns;
355
356
357
358
359 struct iwl_wowlan_pattern_v2 patterns[];
360 } __packed;
361
362 enum iwl_wowlan_wakeup_filters {
363 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
364 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
365 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
366 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
367 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
368 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
369 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
370 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
371 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
372 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
373 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
374 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
375 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
376 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
377 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
378 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
379 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
380 };
381
382 enum iwl_wowlan_flags {
383 IS_11W_ASSOC = BIT(0),
384 ENABLE_L3_FILTERING = BIT(1),
385 ENABLE_NBNS_FILTERING = BIT(2),
386 ENABLE_DHCP_FILTERING = BIT(3),
387 ENABLE_STORE_BEACON = BIT(4),
388 };
389
390
391
392
393
394
395
396
397
398
399
400
401
402 struct iwl_wowlan_config_cmd {
403 __le32 wakeup_filter;
404 __le16 non_qos_seq;
405 __le16 qos_seq[8];
406 u8 wowlan_ba_teardown_tids;
407 u8 is_11n_connection;
408 u8 offloading_tid;
409 u8 flags;
410 u8 sta_id;
411 u8 reserved;
412 } __packed;
413
414
415
416
417 #define IWL_NUM_RSC 16
418
419 struct tkip_sc {
420 __le16 iv16;
421 __le16 pad;
422 __le32 iv32;
423 } __packed;
424
425 struct iwl_tkip_rsc_tsc {
426 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
427 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
428 struct tkip_sc tsc;
429 } __packed;
430
431 struct aes_sc {
432 __le64 pn;
433 } __packed;
434
435 struct iwl_aes_rsc_tsc {
436 struct aes_sc unicast_rsc[IWL_NUM_RSC];
437 struct aes_sc multicast_rsc[IWL_NUM_RSC];
438 struct aes_sc tsc;
439 } __packed;
440
441 union iwl_all_tsc_rsc {
442 struct iwl_tkip_rsc_tsc tkip;
443 struct iwl_aes_rsc_tsc aes;
444 };
445
446 struct iwl_wowlan_rsc_tsc_params_cmd {
447 union iwl_all_tsc_rsc all_tsc_rsc;
448 } __packed;
449
450 #define IWL_MIC_KEY_SIZE 8
451 struct 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;
456
457 #define IWL_P1K_SIZE 5
458 struct iwl_p1k_cache {
459 __le16 p1k[IWL_P1K_SIZE];
460 } __packed;
461
462 #define IWL_NUM_RX_P1K_CACHE 2
463
464 struct iwl_wowlan_tkip_params_cmd {
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;
470
471 #define IWL_KCK_MAX_SIZE 32
472 #define IWL_KEK_MAX_SIZE 32
473
474 struct iwl_wowlan_kek_kck_material_cmd {
475 u8 kck[IWL_KCK_MAX_SIZE];
476 u8 kek[IWL_KEK_MAX_SIZE];
477 __le16 kck_len;
478 __le16 kek_len;
479 __le64 replay_ctr;
480 } __packed;
481
482 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
483
484 enum iwl_wowlan_rekey_status {
485 IWL_WOWLAN_REKEY_POST_REKEY = 0,
486 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
487 };
488
489 enum iwl_wowlan_wakeup_reason {
490 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
491 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
492 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
493 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
494 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
495 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
496 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
497 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
498 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
499 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
500 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
501 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
502 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
503 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
504 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
505 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
506 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
507 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
508 IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT(17),
509 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT(18),
510 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT(19),
511 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT(20),
512 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT(21),
513 };
514
515 struct iwl_wowlan_gtk_status_v1 {
516 u8 key_index;
517 u8 reserved[3];
518 u8 decrypt_key[16];
519 u8 tkip_mic_key[8];
520 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
521 } __packed;
522
523 #define WOWLAN_KEY_MAX_SIZE 32
524 #define WOWLAN_GTK_KEYS_NUM 2
525 #define WOWLAN_IGTK_KEYS_NUM 2
526
527
528
529
530
531
532
533
534
535
536
537
538
539 struct iwl_wowlan_gtk_status {
540 u8 key[WOWLAN_KEY_MAX_SIZE];
541 u8 key_len;
542 u8 key_flags;
543 u8 reserved[2];
544 u8 tkip_mic_key[8];
545 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
546 } __packed;
547
548 #define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1))
549
550
551
552
553
554
555
556
557
558
559
560 struct iwl_wowlan_igtk_status {
561 u8 key[WOWLAN_KEY_MAX_SIZE];
562 u8 ipn[6];
563 u8 key_len;
564 u8 key_flags;
565 } __packed;
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582 struct iwl_wowlan_status_v6 {
583 struct iwl_wowlan_gtk_status_v1 gtk;
584 __le64 replay_ctr;
585 __le16 pattern_number;
586 __le16 non_qos_seq_ctr;
587 __le16 qos_seq_ctr[8];
588 __le32 wakeup_reasons;
589 __le32 num_of_gtk_rekeys;
590 __le32 transmitted_ndps;
591 __le32 received_beacons;
592 __le32 wake_packet_length;
593 __le32 wake_packet_bufsize;
594 u8 wake_packet[];
595 } __packed;
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613 struct iwl_wowlan_status {
614 struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM];
615 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
616 __le64 replay_ctr;
617 __le16 pattern_number;
618 __le16 non_qos_seq_ctr;
619 __le16 qos_seq_ctr[8];
620 __le32 wakeup_reasons;
621 __le32 num_of_gtk_rekeys;
622 __le32 transmitted_ndps;
623 __le32 received_beacons;
624 __le32 wake_packet_length;
625 __le32 wake_packet_bufsize;
626 u8 wake_packet[];
627 } __packed;
628
629 static inline u8 iwlmvm_wowlan_gtk_idx(struct iwl_wowlan_gtk_status *gtk)
630 {
631 return gtk->key_flags & IWL_WOWLAN_GTK_IDX_MASK;
632 }
633
634 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
635 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
636 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
637
638 struct iwl_tcp_packet_info {
639 __le16 tcp_pseudo_header_checksum;
640 __le16 tcp_payload_length;
641 } __packed;
642
643 struct iwl_tcp_packet {
644 struct iwl_tcp_packet_info info;
645 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
646 u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
647 } __packed;
648
649 struct iwl_remote_wake_packet {
650 struct iwl_tcp_packet_info info;
651 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
652 u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
653 } __packed;
654
655 struct iwl_wowlan_remote_wake_config {
656 __le32 connection_max_time;
657
658 u8 max_syn_retries;
659 u8 max_data_retries;
660 u8 tcp_syn_ack_timeout;
661 u8 tcp_ack_timeout;
662
663 struct iwl_tcp_packet syn_tx;
664 struct iwl_tcp_packet synack_rx;
665 struct iwl_tcp_packet keepalive_ack_rx;
666 struct iwl_tcp_packet fin_tx;
667
668 struct iwl_remote_wake_packet keepalive_tx;
669 struct iwl_remote_wake_packet wake_rx;
670
671
672 u8 sequence_number_offset;
673 u8 sequence_number_length;
674 u8 token_offset;
675 u8 token_length;
676
677 __le32 initial_sequence_number;
678 __le16 keepalive_interval;
679 __le16 num_tokens;
680 u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
681 } __packed;
682
683
684
685 #endif