blob: edde49202786a3b77544e0eee6813058db3d2984 [file] [log] [blame]
Johannes Berg8ca151b2013-01-24 14:25:36 +01001/******************************************************************************
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 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +02008 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Johannes Berg8b4139d2014-07-24 14:05:26 +02009 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
Johannes Berg816dc0b2017-03-14 10:55:09 +010010 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010011 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * USA
25 *
26 * The full GNU General Public License is included in this distribution
Emmanuel Grumbach410dc5a2013-02-18 09:22:28 +020027 * in the file called COPYING.
Johannes Berg8ca151b2013-01-24 14:25:36 +010028 *
29 * Contact Information:
Emmanuel Grumbachd01c5362015-11-17 15:39:56 +020030 * Intel Linux Wireless <linuxwifi@intel.com>
Johannes Berg8ca151b2013-01-24 14:25:36 +010031 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32 *
33 * BSD LICENSE
34 *
Emmanuel Grumbach51368bf2013-12-30 13:15:54 +020035 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
Johannes Berg8b4139d2014-07-24 14:05:26 +020036 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
Johannes Berg816dc0b2017-03-14 10:55:09 +010037 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
Johannes Berg8ca151b2013-01-24 14:25:36 +010038 * All rights reserved.
39 *
40 * Redistribution and use in source and binary forms, with or without
41 * modification, are permitted provided that the following conditions
42 * are met:
43 *
44 * * Redistributions of source code must retain the above copyright
45 * notice, this list of conditions and the following disclaimer.
46 * * Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in
48 * the documentation and/or other materials provided with the
49 * distribution.
50 * * Neither the name Intel Corporation nor the names of its
51 * contributors may be used to endorse or promote products derived
52 * from this software without specific prior written permission.
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
55 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
56 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
57 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
58 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
60 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
61 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
62 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
63 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
64 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
65 *****************************************************************************/
66
67#ifndef __fw_api_d3_h__
68#define __fw_api_d3_h__
69
70/**
71 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
72 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
73 */
74enum iwl_d3_wakeup_flags {
75 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
76}; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
77
78/**
79 * struct iwl_d3_manager_config - D3 manager configuration command
80 * @min_sleep_time: minimum sleep time (in usec)
81 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
Johannes Bergdfcb4c32013-05-15 11:44:49 +020082 * @wakeup_host_timer: force wakeup after this many seconds
Johannes Berg8ca151b2013-01-24 14:25:36 +010083 *
84 * The structure is used for the D3_CONFIG_CMD command.
85 */
86struct iwl_d3_manager_config {
87 __le32 min_sleep_time;
88 __le32 wakeup_flags;
Johannes Bergdfcb4c32013-05-15 11:44:49 +020089 __le32 wakeup_host_timer;
90} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
Johannes Berg8ca151b2013-01-24 14:25:36 +010091
92
93/* TODO: OFFLOADS_QUERY_API_S_VER_1 */
94
95/**
96 * enum iwl_d3_proto_offloads - enabled protocol offloads
97 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
98 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
Sara Sharonc97dab42015-11-19 11:53:49 +020099 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
100 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
Johannes Berg8ca151b2013-01-24 14:25:36 +0100101 */
102enum iwl_proto_offloads {
103 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
104 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
Sara Sharonc97dab42015-11-19 11:53:49 +0200105 IWL_D3_PROTO_IPV4_VALID = BIT(2),
106 IWL_D3_PROTO_IPV6_VALID = BIT(3),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100107};
108
Johannes Berg5369d6c2013-07-08 11:17:06 +0200109#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
110#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
Johannes Bergf7fc5982013-08-20 13:04:10 +0200111#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
112#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
113#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
114
115#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
116#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
Johannes Berg8ca151b2013-01-24 14:25:36 +0100117
118/**
Johannes Berg5369d6c2013-07-08 11:17:06 +0200119 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
Johannes Berg8ca151b2013-01-24 14:25:36 +0100120 * @enabled: enable flags
121 * @remote_ipv4_addr: remote address to answer to (or zero if all)
122 * @host_ipv4_addr: our IPv4 address to respond to queries for
123 * @arp_mac_addr: our MAC address for ARP responses
Johannes Berg5369d6c2013-07-08 11:17:06 +0200124 * @reserved: unused
125 */
126struct iwl_proto_offload_cmd_common {
127 __le32 enabled;
128 __be32 remote_ipv4_addr;
129 __be32 host_ipv4_addr;
130 u8 arp_mac_addr[ETH_ALEN];
131 __le16 reserved;
132} __packed;
133
134/**
135 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
136 * @common: common/IPv4 configuration
Johannes Berg8ca151b2013-01-24 14:25:36 +0100137 * @remote_ipv6_addr: remote address to answer to (or zero if all)
138 * @solicited_node_ipv6_addr: broken -- solicited node address exists
139 * for each target address
140 * @target_ipv6_addr: our target addresses
Sara Sharon0d365ae2015-03-31 12:24:05 +0300141 * @ndp_mac_addr: neighbor solicitation response MAC address
Johannes Berg8ca151b2013-01-24 14:25:36 +0100142 */
Johannes Berg5369d6c2013-07-08 11:17:06 +0200143struct iwl_proto_offload_cmd_v1 {
144 struct iwl_proto_offload_cmd_common common;
Johannes Berg8ca151b2013-01-24 14:25:36 +0100145 u8 remote_ipv6_addr[16];
146 u8 solicited_node_ipv6_addr[16];
Johannes Berg5369d6c2013-07-08 11:17:06 +0200147 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
Johannes Berg8ca151b2013-01-24 14:25:36 +0100148 u8 ndp_mac_addr[ETH_ALEN];
149 __le16 reserved2;
150} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
151
Johannes Berg5369d6c2013-07-08 11:17:06 +0200152/**
153 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
154 * @common: common/IPv4 configuration
155 * @remote_ipv6_addr: remote address to answer to (or zero if all)
156 * @solicited_node_ipv6_addr: broken -- solicited node address exists
157 * for each target address
158 * @target_ipv6_addr: our target addresses
Sara Sharon0d365ae2015-03-31 12:24:05 +0300159 * @ndp_mac_addr: neighbor solicitation response MAC address
Johannes Berg5369d6c2013-07-08 11:17:06 +0200160 */
161struct 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 numValidIPv6Addresses;
168 u8 reserved2[3];
169} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
170
Johannes Bergf7fc5982013-08-20 13:04:10 +0200171struct 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; /* NS_OFFLOAD_CONFIG */
177
178struct iwl_targ_addr {
179 struct in6_addr addr;
180 __le32 config_num;
181} __packed; /* TARGET_IPV6_ADDRESS */
182
183/**
184 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
185 * @common: common/IPv4 configuration
186 * @target_ipv6_addr: target IPv6 addresses
187 * @ns_config: NS offload configurations
188 */
189struct iwl_proto_offload_cmd_v3_small {
190 struct iwl_proto_offload_cmd_common common;
191 __le32 num_valid_ipv6_addrs;
192 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
193 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
194} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
195
196/**
197 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
198 * @common: common/IPv4 configuration
199 * @target_ipv6_addr: target IPv6 addresses
200 * @ns_config: NS offload configurations
201 */
202struct iwl_proto_offload_cmd_v3_large {
203 struct iwl_proto_offload_cmd_common common;
204 __le32 num_valid_ipv6_addrs;
205 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
206 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
207} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
Johannes Berg8ca151b2013-01-24 14:25:36 +0100208
209/*
210 * WOWLAN_PATTERNS
211 */
212#define IWL_WOWLAN_MIN_PATTERN_LEN 16
213#define IWL_WOWLAN_MAX_PATTERN_LEN 128
214
215struct iwl_wowlan_pattern {
216 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
217 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
218 u8 mask_size;
219 u8 pattern_size;
220 __le16 reserved;
221} __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
222
223#define IWL_WOWLAN_MAX_PATTERNS 20
224
225struct iwl_wowlan_patterns_cmd {
226 __le32 n_patterns;
227 struct iwl_wowlan_pattern patterns[];
228} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
229
230enum iwl_wowlan_wakeup_filters {
231 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
232 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
233 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
234 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
235 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
236 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
237 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
238 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
239 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
240 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
241 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
Eliad Pellerb77f06d2013-11-06 10:49:32 +0200242 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100243 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
Eliad Pellerb77f06d2013-11-06 10:49:32 +0200244 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
245 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
246 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
247 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100248}; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
249
Sara Sharon70b4c532015-11-19 13:12:15 +0200250enum iwl_wowlan_flags {
251 IS_11W_ASSOC = BIT(0),
252 ENABLE_L3_FILTERING = BIT(1),
253 ENABLE_NBNS_FILTERING = BIT(2),
254 ENABLE_DHCP_FILTERING = BIT(3),
Sara Sharon0db056d2015-12-29 11:07:15 +0200255 ENABLE_STORE_BEACON = BIT(4),
Sara Sharon70b4c532015-11-19 13:12:15 +0200256};
257
Johannes Berg816dc0b2017-03-14 10:55:09 +0100258/**
259 * struct iwl_wowlan_config_cmd - WoWLAN configuration
260 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
261 * @non_qos_seq: non-QoS sequence counter to use next
262 * @qos_seq: QoS sequence counters to use next
263 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
264 * @is_11n_connection: indicates HT connection
265 * @offloading_tid: TID reserved for firmware use
266 * @flags: extra flags, see &enum iwl_wowlan_flags
267 * @reserved: reserved
268 */
Emmanuel Grumbachc8b06a92014-11-24 09:06:57 +0200269struct iwl_wowlan_config_cmd {
Johannes Berg8ca151b2013-01-24 14:25:36 +0100270 __le32 wakeup_filter;
271 __le16 non_qos_seq;
272 __le16 qos_seq[8];
273 u8 wowlan_ba_teardown_tids;
274 u8 is_11n_connection;
Eliad Peller1a95c8d2013-11-21 19:19:52 +0200275 u8 offloading_tid;
Sara Sharon70b4c532015-11-19 13:12:15 +0200276 u8 flags;
277 u8 reserved[2];
278} __packed; /* WOWLAN_CONFIG_API_S_VER_4 */
Eliad Peller1a95c8d2013-11-21 19:19:52 +0200279
Johannes Berg8ca151b2013-01-24 14:25:36 +0100280/*
281 * WOWLAN_TSC_RSC_PARAMS
282 */
283#define IWL_NUM_RSC 16
284
285struct tkip_sc {
286 __le16 iv16;
287 __le16 pad;
288 __le32 iv32;
289} __packed; /* TKIP_SC_API_U_VER_1 */
290
291struct iwl_tkip_rsc_tsc {
292 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
293 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
294 struct tkip_sc tsc;
295} __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
296
297struct aes_sc {
298 __le64 pn;
299} __packed; /* TKIP_AES_SC_API_U_VER_1 */
300
301struct iwl_aes_rsc_tsc {
302 struct aes_sc unicast_rsc[IWL_NUM_RSC];
303 struct aes_sc multicast_rsc[IWL_NUM_RSC];
304 struct aes_sc tsc;
305} __packed; /* AES_TSC_RSC_API_S_VER_1 */
306
307union iwl_all_tsc_rsc {
308 struct iwl_tkip_rsc_tsc tkip;
309 struct iwl_aes_rsc_tsc aes;
310}; /* ALL_TSC_RSC_API_S_VER_2 */
311
312struct iwl_wowlan_rsc_tsc_params_cmd {
313 union iwl_all_tsc_rsc all_tsc_rsc;
314} __packed; /* ALL_TSC_RSC_API_S_VER_2 */
315
316#define IWL_MIC_KEY_SIZE 8
317struct iwl_mic_keys {
318 u8 tx[IWL_MIC_KEY_SIZE];
319 u8 rx_unicast[IWL_MIC_KEY_SIZE];
320 u8 rx_mcast[IWL_MIC_KEY_SIZE];
321} __packed; /* MIC_KEYS_API_S_VER_1 */
322
323#define IWL_P1K_SIZE 5
324struct iwl_p1k_cache {
325 __le16 p1k[IWL_P1K_SIZE];
326} __packed;
327
328#define IWL_NUM_RX_P1K_CACHE 2
329
330struct iwl_wowlan_tkip_params_cmd {
331 struct iwl_mic_keys mic_keys;
332 struct iwl_p1k_cache tx;
333 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
334 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
335} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
336
337#define IWL_KCK_MAX_SIZE 32
338#define IWL_KEK_MAX_SIZE 32
339
340struct iwl_wowlan_kek_kck_material_cmd {
341 u8 kck[IWL_KCK_MAX_SIZE];
342 u8 kek[IWL_KEK_MAX_SIZE];
343 __le16 kck_len;
344 __le16 kek_len;
345 __le64 replay_ctr;
346} __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
347
348#define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
349
350enum iwl_wowlan_rekey_status {
351 IWL_WOWLAN_REKEY_POST_REKEY = 0,
352 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
353}; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
354
355enum iwl_wowlan_wakeup_reason {
356 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
357 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
358 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
359 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
360 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
361 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
362 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
363 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
364 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
365 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
366 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
367 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
Sara Sharonba537f92015-08-19 16:29:31 +0300368 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
Johannes Berg8ca151b2013-01-24 14:25:36 +0100369 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
Sara Sharonba537f92015-08-19 16:29:31 +0300370 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
371 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
372 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
373 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
374
Johannes Berg8ca151b2013-01-24 14:25:36 +0100375}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
376
Johannes Berg6d9d32b2013-08-06 18:58:56 +0200377struct iwl_wowlan_gtk_status {
378 u8 key_index;
379 u8 reserved[3];
380 u8 decrypt_key[16];
381 u8 tkip_mic_key[8];
382 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
Johannes Berg2dd49342016-03-30 11:57:01 +0200383} __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */
Johannes Berg6d9d32b2013-08-06 18:58:56 +0200384
Johannes Berg816dc0b2017-03-14 10:55:09 +0100385/**
386 * struct iwl_wowlan_status - WoWLAN status
387 * @gtk: GTK data
388 * @replay_ctr: GTK rekey replay counter
389 * @pattern_number: number of the matched pattern
390 * @non_qos_seq_ctr: non-QoS sequence counter to use next
391 * @qos_seq_ctr: QoS sequence counters to use next
392 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
393 * @num_of_gtk_rekeys: number of GTK rekeys
394 * @transmitted_ndps: number of transmitted neighbor discovery packets
395 * @received_beacons: number of received beacons
396 * @wake_packet_length: wakeup packet length
397 * @wake_packet_bufsize: wakeup packet buffer size
398 * @wake_packet: wakeup packet
399 */
Emmanuel Grumbach3afec6392014-03-30 09:10:28 +0300400struct iwl_wowlan_status {
Johannes Berg6d9d32b2013-08-06 18:58:56 +0200401 struct iwl_wowlan_gtk_status gtk;
402 __le64 replay_ctr;
403 __le16 pattern_number;
404 __le16 non_qos_seq_ctr;
405 __le16 qos_seq_ctr[8];
406 __le32 wakeup_reasons;
407 __le32 num_of_gtk_rekeys;
408 __le32 transmitted_ndps;
409 __le32 received_beacons;
410 __le32 wake_packet_length;
411 __le32 wake_packet_bufsize;
412 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
413} __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
414
Johannes Bergf0c26462013-01-22 20:41:58 +0100415#define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
416#define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
417#define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
418
419struct iwl_tcp_packet_info {
420 __le16 tcp_pseudo_header_checksum;
421 __le16 tcp_payload_length;
422} __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
423
424struct iwl_tcp_packet {
425 struct iwl_tcp_packet_info info;
426 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
427 u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
428} __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
429
430struct iwl_remote_wake_packet {
431 struct iwl_tcp_packet_info info;
432 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
433 u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
434} __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
435
436struct iwl_wowlan_remote_wake_config {
437 __le32 connection_max_time; /* unused */
438 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
439 u8 max_syn_retries;
440 u8 max_data_retries;
441 u8 tcp_syn_ack_timeout;
442 u8 tcp_ack_timeout;
443
444 struct iwl_tcp_packet syn_tx;
445 struct iwl_tcp_packet synack_rx;
446 struct iwl_tcp_packet keepalive_ack_rx;
447 struct iwl_tcp_packet fin_tx;
448
449 struct iwl_remote_wake_packet keepalive_tx;
450 struct iwl_remote_wake_packet wake_rx;
451
452 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
453 u8 sequence_number_offset;
454 u8 sequence_number_length;
455 u8 token_offset;
456 u8 token_length;
457 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
458 __le32 initial_sequence_number;
459 __le16 keepalive_interval;
460 __le16 num_tokens;
461 u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
462} __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
463
Johannes Berg8ca151b2013-01-24 14:25:36 +0100464/* TODO: NetDetect API */
465
466#endif /* __fw_api_d3_h__ */