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 - 2013 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 - 2013 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 2
104 * struct iwl_proto_offload_cmd - ARP/NS offload configuration
105 * @enabled: enable flags
106 * @remote_ipv4_addr: remote address to answer to (or zero if all)
107 * @host_ipv4_addr: our IPv4 address to respond to queries for
108 * @arp_mac_addr: our MAC address for ARP responses
109 * @remote_ipv6_addr: remote address to answer to (or zero if all)
110 * @solicited_node_ipv6_addr: broken -- solicited node address exists
111 * for each target address
112 * @target_ipv6_addr: our target addresses
113 * @ndp_mac_addr: neighbor soliciation response MAC address
115 struct iwl_proto_offload_cmd
{
117 __be32 remote_ipv4_addr
;
118 __be32 host_ipv4_addr
;
119 u8 arp_mac_addr
[ETH_ALEN
];
122 u8 remote_ipv6_addr
[16];
123 u8 solicited_node_ipv6_addr
[16];
124 u8 target_ipv6_addr
[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS
][16];
125 u8 ndp_mac_addr
[ETH_ALEN
];
127 } __packed
; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
133 #define IWL_WOWLAN_MIN_PATTERN_LEN 16
134 #define IWL_WOWLAN_MAX_PATTERN_LEN 128
136 struct iwl_wowlan_pattern
{
137 u8 mask
[IWL_WOWLAN_MAX_PATTERN_LEN
/ 8];
138 u8 pattern
[IWL_WOWLAN_MAX_PATTERN_LEN
];
142 } __packed
; /* WOWLAN_PATTERN_API_S_VER_1 */
144 #define IWL_WOWLAN_MAX_PATTERNS 20
146 struct iwl_wowlan_patterns_cmd
{
148 struct iwl_wowlan_pattern patterns
[];
149 } __packed
; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
151 enum iwl_wowlan_wakeup_filters
{
152 IWL_WOWLAN_WAKEUP_MAGIC_PACKET
= BIT(0),
153 IWL_WOWLAN_WAKEUP_PATTERN_MATCH
= BIT(1),
154 IWL_WOWLAN_WAKEUP_BEACON_MISS
= BIT(2),
155 IWL_WOWLAN_WAKEUP_LINK_CHANGE
= BIT(3),
156 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL
= BIT(4),
157 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ
= BIT(5),
158 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE
= BIT(6),
159 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT
= BIT(7),
160 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT
= BIT(8),
161 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS
= BIT(9),
162 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE
= BIT(10),
163 /* BIT(11) reserved */
164 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET
= BIT(12),
165 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
167 struct iwl_wowlan_config_cmd
{
168 __le32 wakeup_filter
;
171 u8 wowlan_ba_teardown_tids
;
172 u8 is_11n_connection
;
173 } __packed
; /* WOWLAN_CONFIG_API_S_VER_2 */
176 * WOWLAN_TSC_RSC_PARAMS
178 #define IWL_NUM_RSC 16
184 } __packed
; /* TKIP_SC_API_U_VER_1 */
186 struct iwl_tkip_rsc_tsc
{
187 struct tkip_sc unicast_rsc
[IWL_NUM_RSC
];
188 struct tkip_sc multicast_rsc
[IWL_NUM_RSC
];
190 } __packed
; /* TKIP_TSC_RSC_API_S_VER_1 */
194 } __packed
; /* TKIP_AES_SC_API_U_VER_1 */
196 struct iwl_aes_rsc_tsc
{
197 struct aes_sc unicast_rsc
[IWL_NUM_RSC
];
198 struct aes_sc multicast_rsc
[IWL_NUM_RSC
];
200 } __packed
; /* AES_TSC_RSC_API_S_VER_1 */
202 union iwl_all_tsc_rsc
{
203 struct iwl_tkip_rsc_tsc tkip
;
204 struct iwl_aes_rsc_tsc aes
;
205 }; /* ALL_TSC_RSC_API_S_VER_2 */
207 struct iwl_wowlan_rsc_tsc_params_cmd
{
208 union iwl_all_tsc_rsc all_tsc_rsc
;
209 } __packed
; /* ALL_TSC_RSC_API_S_VER_2 */
211 #define IWL_MIC_KEY_SIZE 8
212 struct iwl_mic_keys
{
213 u8 tx
[IWL_MIC_KEY_SIZE
];
214 u8 rx_unicast
[IWL_MIC_KEY_SIZE
];
215 u8 rx_mcast
[IWL_MIC_KEY_SIZE
];
216 } __packed
; /* MIC_KEYS_API_S_VER_1 */
218 #define IWL_P1K_SIZE 5
219 struct iwl_p1k_cache
{
220 __le16 p1k
[IWL_P1K_SIZE
];
223 #define IWL_NUM_RX_P1K_CACHE 2
225 struct iwl_wowlan_tkip_params_cmd
{
226 struct iwl_mic_keys mic_keys
;
227 struct iwl_p1k_cache tx
;
228 struct iwl_p1k_cache rx_uni
[IWL_NUM_RX_P1K_CACHE
];
229 struct iwl_p1k_cache rx_multi
[IWL_NUM_RX_P1K_CACHE
];
230 } __packed
; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
232 #define IWL_KCK_MAX_SIZE 32
233 #define IWL_KEK_MAX_SIZE 32
235 struct iwl_wowlan_kek_kck_material_cmd
{
236 u8 kck
[IWL_KCK_MAX_SIZE
];
237 u8 kek
[IWL_KEK_MAX_SIZE
];
241 } __packed
; /* KEK_KCK_MATERIAL_API_S_VER_2 */
243 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87
245 enum iwl_wowlan_rekey_status
{
246 IWL_WOWLAN_REKEY_POST_REKEY
= 0,
247 IWL_WOWLAN_REKEY_WHILE_REKEY
= 1,
248 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
250 enum iwl_wowlan_wakeup_reason
{
251 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS
= 0,
252 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET
= BIT(0),
253 IWL_WOWLAN_WAKEUP_BY_PATTERN
= BIT(1),
254 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON
= BIT(2),
255 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH
= BIT(3),
256 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE
= BIT(4),
257 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED
= BIT(5),
258 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR
= BIT(6),
259 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST
= BIT(7),
260 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE
= BIT(8),
261 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS
= BIT(9),
262 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE
= BIT(10),
263 /* BIT(11) reserved */
264 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET
= BIT(12),
265 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
267 struct iwl_wowlan_status
{
269 __le16 pattern_number
;
270 __le16 non_qos_seq_ctr
;
271 __le16 qos_seq_ctr
[8];
272 __le32 wakeup_reasons
;
274 __le32 num_of_gtk_rekeys
;
275 __le32 transmitted_ndps
;
276 __le32 received_beacons
;
277 __le32 wake_packet_length
;
278 __le32 wake_packet_bufsize
;
279 u8 wake_packet
[]; /* can be truncated from _length to _bufsize */
280 } __packed
; /* WOWLAN_STATUSES_API_S_VER_4 */
282 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64
283 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128
284 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048
286 struct iwl_tcp_packet_info
{
287 __le16 tcp_pseudo_header_checksum
;
288 __le16 tcp_payload_length
;
289 } __packed
; /* TCP_PACKET_INFO_API_S_VER_2 */
291 struct iwl_tcp_packet
{
292 struct iwl_tcp_packet_info info
;
293 u8 rx_mask
[IWL_WOWLAN_MAX_PATTERN_LEN
/ 8];
294 u8 data
[IWL_WOWLAN_TCP_MAX_PACKET_LEN
];
295 } __packed
; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
297 struct iwl_remote_wake_packet
{
298 struct iwl_tcp_packet_info info
;
299 u8 rx_mask
[IWL_WOWLAN_MAX_PATTERN_LEN
/ 8];
300 u8 data
[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN
];
301 } __packed
; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
303 struct iwl_wowlan_remote_wake_config
{
304 __le32 connection_max_time
; /* unused */
305 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
308 u8 tcp_syn_ack_timeout
;
311 struct iwl_tcp_packet syn_tx
;
312 struct iwl_tcp_packet synack_rx
;
313 struct iwl_tcp_packet keepalive_ack_rx
;
314 struct iwl_tcp_packet fin_tx
;
316 struct iwl_remote_wake_packet keepalive_tx
;
317 struct iwl_remote_wake_packet wake_rx
;
319 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
320 u8 sequence_number_offset
;
321 u8 sequence_number_length
;
324 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
325 __le32 initial_sequence_number
;
326 __le16 keepalive_interval
;
328 u8 tokens
[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS
];
329 } __packed
; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
331 /* TODO: NetDetect API */
333 #endif /* __fw_api_d3_h__ */