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 /* BIT(11) reserved */
235 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET
= BIT(12),
236 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
238 struct iwl_wowlan_config_cmd
{
239 __le32 wakeup_filter
;
242 u8 wowlan_ba_teardown_tids
;
243 u8 is_11n_connection
;
244 } __packed
; /* WOWLAN_CONFIG_API_S_VER_2 */
247 * WOWLAN_TSC_RSC_PARAMS
249 #define IWL_NUM_RSC 16
255 } __packed
; /* TKIP_SC_API_U_VER_1 */
257 struct iwl_tkip_rsc_tsc
{
258 struct tkip_sc unicast_rsc
[IWL_NUM_RSC
];
259 struct tkip_sc multicast_rsc
[IWL_NUM_RSC
];
261 } __packed
; /* TKIP_TSC_RSC_API_S_VER_1 */
265 } __packed
; /* TKIP_AES_SC_API_U_VER_1 */
267 struct iwl_aes_rsc_tsc
{
268 struct aes_sc unicast_rsc
[IWL_NUM_RSC
];
269 struct aes_sc multicast_rsc
[IWL_NUM_RSC
];
271 } __packed
; /* AES_TSC_RSC_API_S_VER_1 */
273 union iwl_all_tsc_rsc
{
274 struct iwl_tkip_rsc_tsc tkip
;
275 struct iwl_aes_rsc_tsc aes
;
276 }; /* ALL_TSC_RSC_API_S_VER_2 */
278 struct iwl_wowlan_rsc_tsc_params_cmd
{
279 union iwl_all_tsc_rsc all_tsc_rsc
;
280 } __packed
; /* ALL_TSC_RSC_API_S_VER_2 */
282 #define IWL_MIC_KEY_SIZE 8
283 struct iwl_mic_keys
{
284 u8 tx
[IWL_MIC_KEY_SIZE
];
285 u8 rx_unicast
[IWL_MIC_KEY_SIZE
];
286 u8 rx_mcast
[IWL_MIC_KEY_SIZE
];
287 } __packed
; /* MIC_KEYS_API_S_VER_1 */
289 #define IWL_P1K_SIZE 5
290 struct iwl_p1k_cache
{
291 __le16 p1k
[IWL_P1K_SIZE
];
294 #define IWL_NUM_RX_P1K_CACHE 2
296 struct iwl_wowlan_tkip_params_cmd
{
297 struct iwl_mic_keys mic_keys
;
298 struct iwl_p1k_cache tx
;
299 struct iwl_p1k_cache rx_uni
[IWL_NUM_RX_P1K_CACHE
];
300 struct iwl_p1k_cache rx_multi
[IWL_NUM_RX_P1K_CACHE
];
301 } __packed
; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
303 #define IWL_KCK_MAX_SIZE 32
304 #define IWL_KEK_MAX_SIZE 32
306 struct iwl_wowlan_kek_kck_material_cmd
{
307 u8 kck
[IWL_KCK_MAX_SIZE
];
308 u8 kek
[IWL_KEK_MAX_SIZE
];
312 } __packed
; /* KEK_KCK_MATERIAL_API_S_VER_2 */
314 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
316 enum iwl_wowlan_rekey_status
{
317 IWL_WOWLAN_REKEY_POST_REKEY
= 0,
318 IWL_WOWLAN_REKEY_WHILE_REKEY
= 1,
319 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
321 enum iwl_wowlan_wakeup_reason
{
322 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS
= 0,
323 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET
= BIT(0),
324 IWL_WOWLAN_WAKEUP_BY_PATTERN
= BIT(1),
325 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON
= BIT(2),
326 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH
= BIT(3),
327 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE
= BIT(4),
328 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED
= BIT(5),
329 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR
= BIT(6),
330 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST
= BIT(7),
331 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE
= BIT(8),
332 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS
= BIT(9),
333 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE
= BIT(10),
334 /* BIT(11) reserved */
335 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET
= BIT(12),
336 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
338 struct iwl_wowlan_status_v4
{
340 __le16 pattern_number
;
341 __le16 non_qos_seq_ctr
;
342 __le16 qos_seq_ctr
[8];
343 __le32 wakeup_reasons
;
345 __le32 num_of_gtk_rekeys
;
346 __le32 transmitted_ndps
;
347 __le32 received_beacons
;
348 __le32 wake_packet_length
;
349 __le32 wake_packet_bufsize
;
350 u8 wake_packet
[]; /* can be truncated from _length to _bufsize */
351 } __packed
; /* WOWLAN_STATUSES_API_S_VER_4 */
353 struct iwl_wowlan_gtk_status
{
358 struct iwl_wowlan_rsc_tsc_params_cmd rsc
;
361 struct iwl_wowlan_status_v6
{
362 struct iwl_wowlan_gtk_status gtk
;
364 __le16 pattern_number
;
365 __le16 non_qos_seq_ctr
;
366 __le16 qos_seq_ctr
[8];
367 __le32 wakeup_reasons
;
368 __le32 num_of_gtk_rekeys
;
369 __le32 transmitted_ndps
;
370 __le32 received_beacons
;
371 __le32 wake_packet_length
;
372 __le32 wake_packet_bufsize
;
373 u8 wake_packet
[]; /* can be truncated from _length to _bufsize */
374 } __packed
; /* WOWLAN_STATUSES_API_S_VER_6 */
376 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
377 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
378 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
380 struct iwl_tcp_packet_info
{
381 __le16 tcp_pseudo_header_checksum
;
382 __le16 tcp_payload_length
;
383 } __packed
; /* TCP_PACKET_INFO_API_S_VER_2 */
385 struct iwl_tcp_packet
{
386 struct iwl_tcp_packet_info info
;
387 u8 rx_mask
[IWL_WOWLAN_MAX_PATTERN_LEN
/ 8];
388 u8 data
[IWL_WOWLAN_TCP_MAX_PACKET_LEN
];
389 } __packed
; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
391 struct iwl_remote_wake_packet
{
392 struct iwl_tcp_packet_info info
;
393 u8 rx_mask
[IWL_WOWLAN_MAX_PATTERN_LEN
/ 8];
394 u8 data
[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN
];
395 } __packed
; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
397 struct iwl_wowlan_remote_wake_config
{
398 __le32 connection_max_time
; /* unused */
399 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
402 u8 tcp_syn_ack_timeout
;
405 struct iwl_tcp_packet syn_tx
;
406 struct iwl_tcp_packet synack_rx
;
407 struct iwl_tcp_packet keepalive_ack_rx
;
408 struct iwl_tcp_packet fin_tx
;
410 struct iwl_remote_wake_packet keepalive_tx
;
411 struct iwl_remote_wake_packet wake_rx
;
413 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
414 u8 sequence_number_offset
;
415 u8 sequence_number_length
;
418 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
419 __le32 initial_sequence_number
;
420 __le16 keepalive_interval
;
422 u8 tokens
[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS
];
423 } __packed
; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
425 /* TODO: NetDetect API */
427 #endif /* __fw_api_d3_h__ */