1 /******************************************************************************
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.
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
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.
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.
21 * The full GNU General Public License is included in this distribution
22 * in the file called COPYING.
24 * Contact Information:
25 * Intel Linux Wireless <linuxwifi@intel.com>
26 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
31 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
32 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
33 * All rights reserved.
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
39 * * Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * * Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in
43 * the documentation and/or other materials provided with the
45 * * Neither the name Intel Corporation nor the names of its
46 * contributors may be used to endorse or promote products derived
47 * from this software without specific prior written permission.
49 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
50 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
51 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
52 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
53 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
54 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
55 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
57 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
58 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
59 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 *****************************************************************************/
62 #ifndef __iwl_fw_api_d3_h__
63 #define __iwl_fw_api_d3_h__
66 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
67 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
69 enum iwl_d3_wakeup_flags
{
70 IWL_WAKEUP_D3_CONFIG_FW_ERROR
= BIT(0),
71 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
74 * struct iwl_d3_manager_config - D3 manager configuration command
75 * @min_sleep_time: minimum sleep time (in usec)
76 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
77 * @wakeup_host_timer: force wakeup after this many seconds
79 * The structure is used for the D3_CONFIG_CMD command.
81 struct iwl_d3_manager_config
{
82 __le32 min_sleep_time
;
84 __le32 wakeup_host_timer
;
85 } __packed
; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
88 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
91 * enum iwl_d3_proto_offloads - enabled protocol offloads
92 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
93 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
94 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
95 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
97 enum iwl_proto_offloads
{
98 IWL_D3_PROTO_OFFLOAD_ARP
= BIT(0),
99 IWL_D3_PROTO_OFFLOAD_NS
= BIT(1),
100 IWL_D3_PROTO_IPV4_VALID
= BIT(2),
101 IWL_D3_PROTO_IPV6_VALID
= BIT(3),
104 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
105 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
106 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
107 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
108 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
110 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
111 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
114 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
115 * @enabled: enable flags
116 * @remote_ipv4_addr: remote address to answer to (or zero if all)
117 * @host_ipv4_addr: our IPv4 address to respond to queries for
118 * @arp_mac_addr: our MAC address for ARP responses
121 struct iwl_proto_offload_cmd_common
{
123 __be32 remote_ipv4_addr
;
124 __be32 host_ipv4_addr
;
125 u8 arp_mac_addr
[ETH_ALEN
];
130 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
131 * @common: common/IPv4 configuration
132 * @remote_ipv6_addr: remote address to answer to (or zero if all)
133 * @solicited_node_ipv6_addr: broken -- solicited node address exists
134 * for each target address
135 * @target_ipv6_addr: our target addresses
136 * @ndp_mac_addr: neighbor solicitation response MAC address
137 * @reserved2: reserved
139 struct iwl_proto_offload_cmd_v1
{
140 struct iwl_proto_offload_cmd_common common
;
141 u8 remote_ipv6_addr
[16];
142 u8 solicited_node_ipv6_addr
[16];
143 u8 target_ipv6_addr
[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1
][16];
144 u8 ndp_mac_addr
[ETH_ALEN
];
146 } __packed
; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
149 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
150 * @common: common/IPv4 configuration
151 * @remote_ipv6_addr: remote address to answer to (or zero if all)
152 * @solicited_node_ipv6_addr: broken -- solicited node address exists
153 * for each target address
154 * @target_ipv6_addr: our target addresses
155 * @ndp_mac_addr: neighbor solicitation response MAC address
156 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
157 * @reserved2: reserved
159 struct iwl_proto_offload_cmd_v2
{
160 struct iwl_proto_offload_cmd_common common
;
161 u8 remote_ipv6_addr
[16];
162 u8 solicited_node_ipv6_addr
[16];
163 u8 target_ipv6_addr
[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2
][16];
164 u8 ndp_mac_addr
[ETH_ALEN
];
165 u8 num_valid_ipv6_addrs
;
167 } __packed
; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
169 struct iwl_ns_config
{
170 struct in6_addr source_ipv6_addr
;
171 struct in6_addr dest_ipv6_addr
;
172 u8 target_mac_addr
[ETH_ALEN
];
174 } __packed
; /* NS_OFFLOAD_CONFIG */
176 struct iwl_targ_addr
{
177 struct in6_addr addr
;
179 } __packed
; /* TARGET_IPV6_ADDRESS */
182 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
183 * @common: common/IPv4 configuration
184 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
185 * @targ_addrs: target IPv6 addresses
186 * @ns_config: NS offload configurations
188 struct 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
; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
196 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
197 * @common: common/IPv4 configuration
198 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
199 * @targ_addrs: target IPv6 addresses
200 * @ns_config: NS offload configurations
202 struct 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 */
212 #define IWL_WOWLAN_MIN_PATTERN_LEN 16
213 #define IWL_WOWLAN_MAX_PATTERN_LEN 128
215 struct iwl_wowlan_pattern
{
216 u8 mask
[IWL_WOWLAN_MAX_PATTERN_LEN
/ 8];
217 u8 pattern
[IWL_WOWLAN_MAX_PATTERN_LEN
];
221 } __packed
; /* WOWLAN_PATTERN_API_S_VER_1 */
223 #define IWL_WOWLAN_MAX_PATTERNS 20
225 struct iwl_wowlan_patterns_cmd
{
227 struct iwl_wowlan_pattern patterns
[];
228 } __packed
; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
230 enum 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),
242 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL
= BIT(11),
243 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET
= BIT(12),
244 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),
248 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
250 enum 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),
255 ENABLE_STORE_BEACON
= BIT(4),
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
269 struct iwl_wowlan_config_cmd
{
270 __le32 wakeup_filter
;
273 u8 wowlan_ba_teardown_tids
;
274 u8 is_11n_connection
;
278 } __packed
; /* WOWLAN_CONFIG_API_S_VER_4 */
281 * WOWLAN_TSC_RSC_PARAMS
283 #define IWL_NUM_RSC 16
289 } __packed
; /* TKIP_SC_API_U_VER_1 */
291 struct iwl_tkip_rsc_tsc
{
292 struct tkip_sc unicast_rsc
[IWL_NUM_RSC
];
293 struct tkip_sc multicast_rsc
[IWL_NUM_RSC
];
295 } __packed
; /* TKIP_TSC_RSC_API_S_VER_1 */
299 } __packed
; /* TKIP_AES_SC_API_U_VER_1 */
301 struct iwl_aes_rsc_tsc
{
302 struct aes_sc unicast_rsc
[IWL_NUM_RSC
];
303 struct aes_sc multicast_rsc
[IWL_NUM_RSC
];
305 } __packed
; /* AES_TSC_RSC_API_S_VER_1 */
307 union 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 */
312 struct iwl_wowlan_rsc_tsc_params_cmd
{
313 union iwl_all_tsc_rsc all_tsc_rsc
;
314 } __packed
; /* ALL_TSC_RSC_API_S_VER_2 */
316 #define IWL_MIC_KEY_SIZE 8
317 struct 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 */
323 #define IWL_P1K_SIZE 5
324 struct iwl_p1k_cache
{
325 __le16 p1k
[IWL_P1K_SIZE
];
328 #define IWL_NUM_RX_P1K_CACHE 2
330 struct 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 */
337 #define IWL_KCK_MAX_SIZE 32
338 #define IWL_KEK_MAX_SIZE 32
340 struct iwl_wowlan_kek_kck_material_cmd
{
341 u8 kck
[IWL_KCK_MAX_SIZE
];
342 u8 kek
[IWL_KEK_MAX_SIZE
];
346 } __packed
; /* KEK_KCK_MATERIAL_API_S_VER_2 */
348 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
350 enum 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 */
355 enum 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),
368 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL
= BIT(11),
369 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET
= BIT(12),
370 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),
375 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
377 struct iwl_wowlan_gtk_status
{
382 struct iwl_wowlan_rsc_tsc_params_cmd rsc
;
383 } __packed
; /* WOWLAN_GTK_MATERIAL_VER_1 */
386 * struct iwl_wowlan_status - WoWLAN status
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
400 struct iwl_wowlan_status
{
401 struct iwl_wowlan_gtk_status gtk
;
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 */
415 #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
419 struct iwl_tcp_packet_info
{
420 __le16 tcp_pseudo_header_checksum
;
421 __le16 tcp_payload_length
;
422 } __packed
; /* TCP_PACKET_INFO_API_S_VER_2 */
424 struct 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 */
430 struct 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 */
436 struct iwl_wowlan_remote_wake_config
{
437 __le32 connection_max_time
; /* unused */
438 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
441 u8 tcp_syn_ack_timeout
;
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
;
449 struct iwl_remote_wake_packet keepalive_tx
;
450 struct iwl_remote_wake_packet wake_rx
;
452 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
453 u8 sequence_number_offset
;
454 u8 sequence_number_length
;
457 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
458 __le32 initial_sequence_number
;
459 __le16 keepalive_interval
;
461 u8 tokens
[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS
];
462 } __packed
; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
464 /* TODO: NetDetect API */
466 #endif /* __iwl_fw_api_d3_h__ */