88 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
1010 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11- * Copyright(c) 2018 Intel Corporation
11+ * Copyright(c) 2018 - 2019 Intel Corporation
1212 *
1313 * This program is free software; you can redistribute it and/or modify
1414 * it under the terms of version 2 of the GNU General Public License as
3131 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3232 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
3333 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
34- * Copyright(c) 2018 Intel Corporation
34+ * Copyright(c) 2018 - 2019 Intel Corporation
3535 * All rights reserved.
3636 *
3737 * Redistribution and use in source and binary forms, with or without
@@ -214,7 +214,7 @@ struct iwl_proto_offload_cmd_v3_large {
214214#define IWL_WOWLAN_MIN_PATTERN_LEN 16
215215#define IWL_WOWLAN_MAX_PATTERN_LEN 128
216216
217- struct iwl_wowlan_pattern {
217+ struct iwl_wowlan_pattern_v1 {
218218 u8 mask [IWL_WOWLAN_MAX_PATTERN_LEN / 8 ];
219219 u8 pattern [IWL_WOWLAN_MAX_PATTERN_LEN ];
220220 u8 mask_size ;
@@ -227,7 +227,7 @@ struct iwl_wowlan_pattern {
227227/**
228228 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns
229229 */
230- struct iwl_wowlan_patterns_cmd {
230+ struct iwl_wowlan_patterns_cmd_v1 {
231231 /**
232232 * @n_patterns: number of patterns
233233 */
@@ -236,9 +236,129 @@ struct iwl_wowlan_patterns_cmd {
236236 /**
237237 * @patterns: the patterns, array length in @n_patterns
238238 */
239- struct iwl_wowlan_pattern patterns [];
239+ struct iwl_wowlan_pattern_v1 patterns [];
240240} __packed ; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
241241
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+ }; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */
252+
253+ /**
254+ * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data
255+ */
256+ struct iwl_wowlan_ipv4_tcp_syn {
257+ /**
258+ * @src_addr: source IP address to match
259+ */
260+ u8 src_addr [IPV4_ADDR_SIZE ];
261+
262+ /**
263+ * @dst_addr: destination IP address to match
264+ */
265+ u8 dst_addr [IPV4_ADDR_SIZE ];
266+
267+ /**
268+ * @src_port: source TCP port to match
269+ */
270+ __le16 src_port ;
271+
272+ /**
273+ * @dst_port: destination TCP port to match
274+ */
275+ __le16 dst_port ;
276+ } __packed ; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */
277+
278+ /**
279+ * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data
280+ */
281+ struct iwl_wowlan_ipv6_tcp_syn {
282+ /**
283+ * @src_addr: source IP address to match
284+ */
285+ u8 src_addr [IPV6_ADDR_SIZE ];
286+
287+ /**
288+ * @dst_addr: destination IP address to match
289+ */
290+ u8 dst_addr [IPV6_ADDR_SIZE ];
291+
292+ /**
293+ * @src_port: source TCP port to match
294+ */
295+ __le16 src_port ;
296+
297+ /**
298+ * @dst_port: destination TCP port to match
299+ */
300+ __le16 dst_port ;
301+ } __packed ; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */
302+
303+ /**
304+ * union iwl_wowlan_pattern_data - Data for the different pattern types
305+ *
306+ * If wildcard addresses/ports are to be used, the union can be left
307+ * undefined.
308+ */
309+ union iwl_wowlan_pattern_data {
310+ /**
311+ * @bitmask: bitmask pattern data
312+ */
313+ struct iwl_wowlan_pattern_v1 bitmask ;
314+
315+ /**
316+ * @ipv4_tcp_syn: IPv4 TCP SYN pattern data
317+ */
318+ struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn ;
319+
320+ /**
321+ * @ipv6_tcp_syn: IPv6 TCP SYN pattern data
322+ */
323+ struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn ;
324+ }; /* WOWLAN_PATTERN_API_U_VER_1 */
325+
326+ /**
327+ * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns
328+ */
329+ struct iwl_wowlan_pattern_v2 {
330+ /**
331+ * @pattern_type: defines the struct type to be used in the union
332+ */
333+ u8 pattern_type ;
334+
335+ /**
336+ * @reserved: reserved for alignment
337+ */
338+ u8 reserved [3 ];
339+
340+ /**
341+ * @u: the union containing the match data, or undefined for
342+ * wildcard matches
343+ */
344+ union iwl_wowlan_pattern_data u ;
345+ } __packed ; /* WOWLAN_PATTERN_API_S_VER_2 */
346+
347+ /**
348+ * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command
349+ */
350+ struct iwl_wowlan_patterns_cmd {
351+ /**
352+ * @n_patterns: number of patterns
353+ */
354+ __le32 n_patterns ;
355+
356+ /**
357+ * @patterns: the patterns, array length in @n_patterns
358+ */
359+ struct iwl_wowlan_pattern_v2 patterns [];
360+ } __packed ; /* WOWLAN_PATTERN_ARRAY_API_S_VER_2 */
361+
242362enum iwl_wowlan_wakeup_filters {
243363 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT (0 ),
244364 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT (1 ),
@@ -383,7 +503,11 @@ enum iwl_wowlan_wakeup_reason {
383503 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT (14 ),
384504 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT (15 ),
385505 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT (16 ),
386-
506+ IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT (17 ),
507+ IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT (18 ),
508+ IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT (19 ),
509+ IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT (20 ),
510+ IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT (21 ),
387511}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
388512
389513struct iwl_wowlan_gtk_status_v1 {
0 commit comments