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
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
25 * The full GNU General Public License is included in this distribution
26 * in the file called COPYING.
28 * Contact Information:
29 * Intel Linux Wireless <ilw@linux.intel.com>
30 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
36 * All rights reserved.
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
42 * * Redistributions of source code must retain the above copyright
43 * notice, this list of conditions and the following disclaimer.
44 * * Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in
46 * the documentation and/or other materials provided with the
48 * * Neither the name Intel Corporation nor the names of its
49 * contributors may be used to endorse or promote products derived
50 * from this software without specific prior written permission.
52 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
53 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
54 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
55 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
56 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
58 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 *****************************************************************************/
65 #ifndef __fw_api_d3_h__
66 #define __fw_api_d3_h__
69 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
70 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
72 enum iwl_d3_wakeup_flags {
73 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
74 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
77 * struct iwl_d3_manager_config - D3 manager configuration command
78 * @min_sleep_time: minimum sleep time (in usec)
79 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
80 * @wakeup_host_timer: force wakeup after this many seconds
82 * The structure is used for the D3_CONFIG_CMD command.
84 struct iwl_d3_manager_config {
85 __le32 min_sleep_time;
87 __le32 wakeup_host_timer;
88 } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
91 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
94 * enum iwl_d3_proto_offloads - enabled protocol offloads
95 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
96 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
98 enum iwl_proto_offloads {
99 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
100 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
103 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
104 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
105 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
106 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
107 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
109 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
110 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
113 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
114 * @enabled: enable flags
115 * @remote_ipv4_addr: remote address to answer to (or zero if all)
116 * @host_ipv4_addr: our IPv4 address to respond to queries for
117 * @arp_mac_addr: our MAC address for ARP responses
120 struct iwl_proto_offload_cmd_common {
122 __be32 remote_ipv4_addr;
123 __be32 host_ipv4_addr;
124 u8 arp_mac_addr[ETH_ALEN];
129 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
130 * @common: common/IPv4 configuration
131 * @remote_ipv6_addr: remote address to answer to (or zero if all)
132 * @solicited_node_ipv6_addr: broken -- solicited node address exists
133 * for each target address
134 * @target_ipv6_addr: our target addresses
135 * @ndp_mac_addr: neighbor solicitation response MAC address
137 struct iwl_proto_offload_cmd_v1 {
138 struct iwl_proto_offload_cmd_common common;
139 u8 remote_ipv6_addr[16];
140 u8 solicited_node_ipv6_addr[16];
141 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
142 u8 ndp_mac_addr[ETH_ALEN];
144 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
147 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
148 * @common: common/IPv4 configuration
149 * @remote_ipv6_addr: remote address to answer to (or zero if all)
150 * @solicited_node_ipv6_addr: broken -- solicited node address exists
151 * for each target address
152 * @target_ipv6_addr: our target addresses
153 * @ndp_mac_addr: neighbor solicitation response MAC address
155 struct iwl_proto_offload_cmd_v2 {
156 struct iwl_proto_offload_cmd_common common;
157 u8 remote_ipv6_addr[16];
158 u8 solicited_node_ipv6_addr[16];
159 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
160 u8 ndp_mac_addr[ETH_ALEN];
161 u8 numValidIPv6Addresses;
163 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
165 struct iwl_ns_config {
166 struct in6_addr source_ipv6_addr;
167 struct in6_addr dest_ipv6_addr;
168 u8 target_mac_addr[ETH_ALEN];
170 } __packed; /* NS_OFFLOAD_CONFIG */
172 struct iwl_targ_addr {
173 struct in6_addr addr;
175 } __packed; /* TARGET_IPV6_ADDRESS */
178 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
179 * @common: common/IPv4 configuration
180 * @target_ipv6_addr: target IPv6 addresses
181 * @ns_config: NS offload configurations
183 struct iwl_proto_offload_cmd_v3_small {
184 struct iwl_proto_offload_cmd_common common;
185 __le32 num_valid_ipv6_addrs;
186 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
187 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
188 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
191 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
192 * @common: common/IPv4 configuration
193 * @target_ipv6_addr: target IPv6 addresses
194 * @ns_config: NS offload configurations
196 struct iwl_proto_offload_cmd_v3_large {
197 struct iwl_proto_offload_cmd_common common;
198 __le32 num_valid_ipv6_addrs;
199 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
200 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
201 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
206 #define IWL_WOWLAN_MIN_PATTERN_LEN 16
207 #define IWL_WOWLAN_MAX_PATTERN_LEN 128
209 struct iwl_wowlan_pattern {
210 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
211 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
215 } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
217 #define IWL_WOWLAN_MAX_PATTERNS 20
219 struct iwl_wowlan_patterns_cmd {
221 struct iwl_wowlan_pattern patterns[];
222 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
224 enum iwl_wowlan_wakeup_filters {
225 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
226 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
227 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
228 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
229 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
230 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
231 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
232 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
233 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
234 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
235 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
236 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
237 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
238 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
239 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
240 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
241 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
242 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
244 struct iwl_wowlan_config_cmd {
245 __le32 wakeup_filter;
248 u8 wowlan_ba_teardown_tids;
249 u8 is_11n_connection;
252 } __packed; /* WOWLAN_CONFIG_API_S_VER_3 */
255 * WOWLAN_TSC_RSC_PARAMS
257 #define IWL_NUM_RSC 16
263 } __packed; /* TKIP_SC_API_U_VER_1 */
265 struct iwl_tkip_rsc_tsc {
266 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
267 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
269 } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
273 } __packed; /* TKIP_AES_SC_API_U_VER_1 */
275 struct iwl_aes_rsc_tsc {
276 struct aes_sc unicast_rsc[IWL_NUM_RSC];
277 struct aes_sc multicast_rsc[IWL_NUM_RSC];
279 } __packed; /* AES_TSC_RSC_API_S_VER_1 */
281 union iwl_all_tsc_rsc {
282 struct iwl_tkip_rsc_tsc tkip;
283 struct iwl_aes_rsc_tsc aes;
284 }; /* ALL_TSC_RSC_API_S_VER_2 */
286 struct iwl_wowlan_rsc_tsc_params_cmd {
287 union iwl_all_tsc_rsc all_tsc_rsc;
288 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
290 #define IWL_MIC_KEY_SIZE 8
291 struct iwl_mic_keys {
292 u8 tx[IWL_MIC_KEY_SIZE];
293 u8 rx_unicast[IWL_MIC_KEY_SIZE];
294 u8 rx_mcast[IWL_MIC_KEY_SIZE];
295 } __packed; /* MIC_KEYS_API_S_VER_1 */
297 #define IWL_P1K_SIZE 5
298 struct iwl_p1k_cache {
299 __le16 p1k[IWL_P1K_SIZE];
302 #define IWL_NUM_RX_P1K_CACHE 2
304 struct iwl_wowlan_tkip_params_cmd {
305 struct iwl_mic_keys mic_keys;
306 struct iwl_p1k_cache tx;
307 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
308 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
309 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
311 #define IWL_KCK_MAX_SIZE 32
312 #define IWL_KEK_MAX_SIZE 32
314 struct iwl_wowlan_kek_kck_material_cmd {
315 u8 kck[IWL_KCK_MAX_SIZE];
316 u8 kek[IWL_KEK_MAX_SIZE];
320 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
322 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
324 enum iwl_wowlan_rekey_status {
325 IWL_WOWLAN_REKEY_POST_REKEY = 0,
326 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
327 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
329 enum iwl_wowlan_wakeup_reason {
330 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
331 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
332 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
333 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
334 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
335 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
336 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
337 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
338 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
339 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
340 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
341 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
342 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),
343 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
344 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),
345 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),
346 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),
347 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),
349 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
351 struct iwl_wowlan_gtk_status {
356 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
359 struct iwl_wowlan_status {
360 struct iwl_wowlan_gtk_status gtk;
362 __le16 pattern_number;
363 __le16 non_qos_seq_ctr;
364 __le16 qos_seq_ctr[8];
365 __le32 wakeup_reasons;
366 __le32 num_of_gtk_rekeys;
367 __le32 transmitted_ndps;
368 __le32 received_beacons;
369 __le32 wake_packet_length;
370 __le32 wake_packet_bufsize;
371 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
372 } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
374 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
375 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
376 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
378 struct iwl_tcp_packet_info {
379 __le16 tcp_pseudo_header_checksum;
380 __le16 tcp_payload_length;
381 } __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
383 struct iwl_tcp_packet {
384 struct iwl_tcp_packet_info info;
385 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
386 u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
387 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
389 struct iwl_remote_wake_packet {
390 struct iwl_tcp_packet_info info;
391 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
392 u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
393 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
395 struct iwl_wowlan_remote_wake_config {
396 __le32 connection_max_time; /* unused */
397 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
400 u8 tcp_syn_ack_timeout;
403 struct iwl_tcp_packet syn_tx;
404 struct iwl_tcp_packet synack_rx;
405 struct iwl_tcp_packet keepalive_ack_rx;
406 struct iwl_tcp_packet fin_tx;
408 struct iwl_remote_wake_packet keepalive_tx;
409 struct iwl_remote_wake_packet wake_rx;
411 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
412 u8 sequence_number_offset;
413 u8 sequence_number_length;
416 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
417 __le32 initial_sequence_number;
418 __le16 keepalive_interval;
420 u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
421 } __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
423 /* TODO: NetDetect API */
425 #endif /* __fw_api_d3_h__ */