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.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * The full GNU General Public License is included in this distribution
25 * in the file called COPYING.
27 * Contact Information:
28 * Intel Linux Wireless <ilw@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
33 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
34 * All rights reserved.
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 *****************************************************************************/
63 #ifndef __fw_api_d3_h__
64 #define __fw_api_d3_h__
67 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
68 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
70 enum iwl_d3_wakeup_flags {
71 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
72 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
75 * struct iwl_d3_manager_config - D3 manager configuration command
76 * @min_sleep_time: minimum sleep time (in usec)
77 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
78 * @wakeup_host_timer: force wakeup after this many seconds
80 * The structure is used for the D3_CONFIG_CMD command.
82 struct iwl_d3_manager_config {
83 __le32 min_sleep_time;
85 __le32 wakeup_host_timer;
86 } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
89 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
92 * enum iwl_d3_proto_offloads - enabled protocol offloads
93 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
94 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
96 enum iwl_proto_offloads {
97 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
98 IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
101 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
102 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
103 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12
104 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4
105 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12
107 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
108 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
111 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
112 * @enabled: enable flags
113 * @remote_ipv4_addr: remote address to answer to (or zero if all)
114 * @host_ipv4_addr: our IPv4 address to respond to queries for
115 * @arp_mac_addr: our MAC address for ARP responses
118 struct iwl_proto_offload_cmd_common {
120 __be32 remote_ipv4_addr;
121 __be32 host_ipv4_addr;
122 u8 arp_mac_addr[ETH_ALEN];
127 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
128 * @common: common/IPv4 configuration
129 * @remote_ipv6_addr: remote address to answer to (or zero if all)
130 * @solicited_node_ipv6_addr: broken -- solicited node address exists
131 * for each target address
132 * @target_ipv6_addr: our target addresses
133 * @ndp_mac_addr: neighbor soliciation response MAC address
135 struct iwl_proto_offload_cmd_v1 {
136 struct iwl_proto_offload_cmd_common common;
137 u8 remote_ipv6_addr[16];
138 u8 solicited_node_ipv6_addr[16];
139 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
140 u8 ndp_mac_addr[ETH_ALEN];
142 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
145 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
146 * @common: common/IPv4 configuration
147 * @remote_ipv6_addr: remote address to answer to (or zero if all)
148 * @solicited_node_ipv6_addr: broken -- solicited node address exists
149 * for each target address
150 * @target_ipv6_addr: our target addresses
151 * @ndp_mac_addr: neighbor soliciation response MAC address
153 struct iwl_proto_offload_cmd_v2 {
154 struct iwl_proto_offload_cmd_common common;
155 u8 remote_ipv6_addr[16];
156 u8 solicited_node_ipv6_addr[16];
157 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
158 u8 ndp_mac_addr[ETH_ALEN];
159 u8 numValidIPv6Addresses;
161 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
163 struct iwl_ns_config {
164 struct in6_addr source_ipv6_addr;
165 struct in6_addr dest_ipv6_addr;
166 u8 target_mac_addr[ETH_ALEN];
168 } __packed; /* NS_OFFLOAD_CONFIG */
170 struct iwl_targ_addr {
171 struct in6_addr addr;
173 } __packed; /* TARGET_IPV6_ADDRESS */
176 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
177 * @common: common/IPv4 configuration
178 * @target_ipv6_addr: target IPv6 addresses
179 * @ns_config: NS offload configurations
181 struct iwl_proto_offload_cmd_v3_small {
182 struct iwl_proto_offload_cmd_common common;
183 __le32 num_valid_ipv6_addrs;
184 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
185 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
186 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
189 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
190 * @common: common/IPv4 configuration
191 * @target_ipv6_addr: target IPv6 addresses
192 * @ns_config: NS offload configurations
194 struct iwl_proto_offload_cmd_v3_large {
195 struct iwl_proto_offload_cmd_common common;
196 __le32 num_valid_ipv6_addrs;
197 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
198 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
199 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
204 #define IWL_WOWLAN_MIN_PATTERN_LEN 16
205 #define IWL_WOWLAN_MAX_PATTERN_LEN 128
207 struct iwl_wowlan_pattern {
208 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
209 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
213 } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
215 #define IWL_WOWLAN_MAX_PATTERNS 20
217 struct iwl_wowlan_patterns_cmd {
219 struct iwl_wowlan_pattern patterns[];
220 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
222 enum iwl_wowlan_wakeup_filters {
223 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),
224 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),
225 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),
226 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),
227 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),
228 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),
229 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),
230 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),
231 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),
232 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),
233 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),
234 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),
235 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),
236 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),
237 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),
238 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),
239 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),
240 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
242 struct iwl_wowlan_config_cmd_v2 {
243 __le32 wakeup_filter;
246 u8 wowlan_ba_teardown_tids;
247 u8 is_11n_connection;
248 } __packed; /* WOWLAN_CONFIG_API_S_VER_2 */
250 struct iwl_wowlan_config_cmd_v3 {
251 struct iwl_wowlan_config_cmd_v2 common;
254 } __packed; /* WOWLAN_CONFIG_API_S_VER_3 */
257 * WOWLAN_TSC_RSC_PARAMS
259 #define IWL_NUM_RSC 16
265 } __packed; /* TKIP_SC_API_U_VER_1 */
267 struct iwl_tkip_rsc_tsc {
268 struct tkip_sc unicast_rsc[IWL_NUM_RSC];
269 struct tkip_sc multicast_rsc[IWL_NUM_RSC];
271 } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
275 } __packed; /* TKIP_AES_SC_API_U_VER_1 */
277 struct iwl_aes_rsc_tsc {
278 struct aes_sc unicast_rsc[IWL_NUM_RSC];
279 struct aes_sc multicast_rsc[IWL_NUM_RSC];
281 } __packed; /* AES_TSC_RSC_API_S_VER_1 */
283 union iwl_all_tsc_rsc {
284 struct iwl_tkip_rsc_tsc tkip;
285 struct iwl_aes_rsc_tsc aes;
286 }; /* ALL_TSC_RSC_API_S_VER_2 */
288 struct iwl_wowlan_rsc_tsc_params_cmd {
289 union iwl_all_tsc_rsc all_tsc_rsc;
290 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
292 #define IWL_MIC_KEY_SIZE 8
293 struct iwl_mic_keys {
294 u8 tx[IWL_MIC_KEY_SIZE];
295 u8 rx_unicast[IWL_MIC_KEY_SIZE];
296 u8 rx_mcast[IWL_MIC_KEY_SIZE];
297 } __packed; /* MIC_KEYS_API_S_VER_1 */
299 #define IWL_P1K_SIZE 5
300 struct iwl_p1k_cache {
301 __le16 p1k[IWL_P1K_SIZE];
304 #define IWL_NUM_RX_P1K_CACHE 2
306 struct iwl_wowlan_tkip_params_cmd {
307 struct iwl_mic_keys mic_keys;
308 struct iwl_p1k_cache tx;
309 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
310 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
311 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
313 #define IWL_KCK_MAX_SIZE 32
314 #define IWL_KEK_MAX_SIZE 32
316 struct iwl_wowlan_kek_kck_material_cmd {
317 u8 kck[IWL_KCK_MAX_SIZE];
318 u8 kek[IWL_KEK_MAX_SIZE];
322 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
324 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
326 enum iwl_wowlan_rekey_status {
327 IWL_WOWLAN_REKEY_POST_REKEY = 0,
328 IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
329 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
331 enum iwl_wowlan_wakeup_reason {
332 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,
333 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),
334 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),
335 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
336 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),
337 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),
338 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),
339 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),
340 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),
341 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),
342 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),
343 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),
344 /* BIT(11) reserved */
345 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),
346 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
348 struct iwl_wowlan_gtk_status {
353 struct iwl_wowlan_rsc_tsc_params_cmd rsc;
356 struct iwl_wowlan_status {
357 struct iwl_wowlan_gtk_status gtk;
359 __le16 pattern_number;
360 __le16 non_qos_seq_ctr;
361 __le16 qos_seq_ctr[8];
362 __le32 wakeup_reasons;
363 __le32 num_of_gtk_rekeys;
364 __le32 transmitted_ndps;
365 __le32 received_beacons;
366 __le32 wake_packet_length;
367 __le32 wake_packet_bufsize;
368 u8 wake_packet[]; /* can be truncated from _length to _bufsize */
369 } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
371 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
372 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
373 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
375 struct iwl_tcp_packet_info {
376 __le16 tcp_pseudo_header_checksum;
377 __le16 tcp_payload_length;
378 } __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
380 struct iwl_tcp_packet {
381 struct iwl_tcp_packet_info info;
382 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
383 u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
384 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
386 struct iwl_remote_wake_packet {
387 struct iwl_tcp_packet_info info;
388 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
389 u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
390 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
392 struct iwl_wowlan_remote_wake_config {
393 __le32 connection_max_time; /* unused */
394 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
397 u8 tcp_syn_ack_timeout;
400 struct iwl_tcp_packet syn_tx;
401 struct iwl_tcp_packet synack_rx;
402 struct iwl_tcp_packet keepalive_ack_rx;
403 struct iwl_tcp_packet fin_tx;
405 struct iwl_remote_wake_packet keepalive_tx;
406 struct iwl_remote_wake_packet wake_rx;
408 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
409 u8 sequence_number_offset;
410 u8 sequence_number_length;
413 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
414 __le32 initial_sequence_number;
415 __le16 keepalive_interval;
417 u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
418 } __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
420 /* TODO: NetDetect API */
422 #endif /* __fw_api_d3_h__ */