]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/net/wireless/intel/iwlwifi/mvm/fw-api-d3.h
EDAC: Use edac_debugfs_remove_recursive() in edac_debugfs_exit()
[karo-tx-linux.git] / drivers / net / wireless / intel / iwlwifi / mvm / fw-api-d3.h
1 /******************************************************************************
2  *
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.
5  *
6  * GPL LICENSE SUMMARY
7  *
8  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10  * Copyright(c) 2015 Intel Deutschland GmbH
11  *
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.
15  *
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.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24  * USA
25  *
26  * The full GNU General Public License is included in this distribution
27  * in the file called COPYING.
28  *
29  * Contact Information:
30  *  Intel Linux Wireless <linuxwifi@intel.com>
31  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
32  *
33  * BSD LICENSE
34  *
35  * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
36  * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
37  * All rights reserved.
38  *
39  * Redistribution and use in source and binary forms, with or without
40  * modification, are permitted provided that the following conditions
41  * are met:
42  *
43  *  * Redistributions of source code must retain the above copyright
44  *    notice, this list of conditions and the following disclaimer.
45  *  * Redistributions in binary form must reproduce the above copyright
46  *    notice, this list of conditions and the following disclaimer in
47  *    the documentation and/or other materials provided with the
48  *    distribution.
49  *  * Neither the name Intel Corporation nor the names of its
50  *    contributors may be used to endorse or promote products derived
51  *    from this software without specific prior written permission.
52  *
53  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
54  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
55  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
56  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
57  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
58  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
59  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
60  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
61  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
62  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
63  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64  *****************************************************************************/
65
66 #ifndef __fw_api_d3_h__
67 #define __fw_api_d3_h__
68
69 /**
70  * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
71  * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
72  */
73 enum iwl_d3_wakeup_flags {
74         IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
75 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
76
77 /**
78  * struct iwl_d3_manager_config - D3 manager configuration command
79  * @min_sleep_time: minimum sleep time (in usec)
80  * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
81  * @wakeup_host_timer: force wakeup after this many seconds
82  *
83  * The structure is used for the D3_CONFIG_CMD command.
84  */
85 struct iwl_d3_manager_config {
86         __le32 min_sleep_time;
87         __le32 wakeup_flags;
88         __le32 wakeup_host_timer;
89 } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
90
91
92 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
93
94 /**
95  * enum iwl_d3_proto_offloads - enabled protocol offloads
96  * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
97  * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
98  * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
99  * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
100  */
101 enum iwl_proto_offloads {
102         IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
103         IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
104         IWL_D3_PROTO_IPV4_VALID = BIT(2),
105         IWL_D3_PROTO_IPV6_VALID = BIT(3),
106 };
107
108 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1     2
109 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2     6
110 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L    12
111 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S    4
112 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX    12
113
114 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L     4
115 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S     2
116
117 /**
118  * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
119  * @enabled: enable flags
120  * @remote_ipv4_addr: remote address to answer to (or zero if all)
121  * @host_ipv4_addr: our IPv4 address to respond to queries for
122  * @arp_mac_addr: our MAC address for ARP responses
123  * @reserved: unused
124  */
125 struct iwl_proto_offload_cmd_common {
126         __le32 enabled;
127         __be32 remote_ipv4_addr;
128         __be32 host_ipv4_addr;
129         u8 arp_mac_addr[ETH_ALEN];
130         __le16 reserved;
131 } __packed;
132
133 /**
134  * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
135  * @common: common/IPv4 configuration
136  * @remote_ipv6_addr: remote address to answer to (or zero if all)
137  * @solicited_node_ipv6_addr: broken -- solicited node address exists
138  *      for each target address
139  * @target_ipv6_addr: our target addresses
140  * @ndp_mac_addr: neighbor solicitation response MAC address
141  */
142 struct iwl_proto_offload_cmd_v1 {
143         struct iwl_proto_offload_cmd_common common;
144         u8 remote_ipv6_addr[16];
145         u8 solicited_node_ipv6_addr[16];
146         u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
147         u8 ndp_mac_addr[ETH_ALEN];
148         __le16 reserved2;
149 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
150
151 /**
152  * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
153  * @common: common/IPv4 configuration
154  * @remote_ipv6_addr: remote address to answer to (or zero if all)
155  * @solicited_node_ipv6_addr: broken -- solicited node address exists
156  *      for each target address
157  * @target_ipv6_addr: our target addresses
158  * @ndp_mac_addr: neighbor solicitation response MAC address
159  */
160 struct iwl_proto_offload_cmd_v2 {
161         struct iwl_proto_offload_cmd_common common;
162         u8 remote_ipv6_addr[16];
163         u8 solicited_node_ipv6_addr[16];
164         u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
165         u8 ndp_mac_addr[ETH_ALEN];
166         u8 numValidIPv6Addresses;
167         u8 reserved2[3];
168 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
169
170 struct iwl_ns_config {
171         struct in6_addr source_ipv6_addr;
172         struct in6_addr dest_ipv6_addr;
173         u8 target_mac_addr[ETH_ALEN];
174         __le16 reserved;
175 } __packed; /* NS_OFFLOAD_CONFIG */
176
177 struct iwl_targ_addr {
178         struct in6_addr addr;
179         __le32 config_num;
180 } __packed; /* TARGET_IPV6_ADDRESS */
181
182 /**
183  * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
184  * @common: common/IPv4 configuration
185  * @target_ipv6_addr: target IPv6 addresses
186  * @ns_config: NS offload configurations
187  */
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 */
194
195 /**
196  * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
197  * @common: common/IPv4 configuration
198  * @target_ipv6_addr: target IPv6 addresses
199  * @ns_config: NS offload configurations
200  */
201 struct iwl_proto_offload_cmd_v3_large {
202         struct iwl_proto_offload_cmd_common common;
203         __le32 num_valid_ipv6_addrs;
204         struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
205         struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
206 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
207
208 /*
209  * WOWLAN_PATTERNS
210  */
211 #define IWL_WOWLAN_MIN_PATTERN_LEN      16
212 #define IWL_WOWLAN_MAX_PATTERN_LEN      128
213
214 struct iwl_wowlan_pattern {
215         u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
216         u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
217         u8 mask_size;
218         u8 pattern_size;
219         __le16 reserved;
220 } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
221
222 #define IWL_WOWLAN_MAX_PATTERNS 20
223
224 struct iwl_wowlan_patterns_cmd {
225         __le32 n_patterns;
226         struct iwl_wowlan_pattern patterns[];
227 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
228
229 enum iwl_wowlan_wakeup_filters {
230         IWL_WOWLAN_WAKEUP_MAGIC_PACKET                  = BIT(0),
231         IWL_WOWLAN_WAKEUP_PATTERN_MATCH                 = BIT(1),
232         IWL_WOWLAN_WAKEUP_BEACON_MISS                   = BIT(2),
233         IWL_WOWLAN_WAKEUP_LINK_CHANGE                   = BIT(3),
234         IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL                = BIT(4),
235         IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ                 = BIT(5),
236         IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE                = BIT(6),
237         IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT             = BIT(7),
238         IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT              = BIT(8),
239         IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS              = BIT(9),
240         IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE        = BIT(10),
241         IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL           = BIT(11),
242         IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET          = BIT(12),
243         IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET             = BIT(13),
244         IWL_WOWLAN_WAKEUP_HOST_TIMER                    = BIT(14),
245         IWL_WOWLAN_WAKEUP_RX_FRAME                      = BIT(15),
246         IWL_WOWLAN_WAKEUP_BCN_FILTERING                 = BIT(16),
247 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
248
249 enum iwl_wowlan_flags {
250         IS_11W_ASSOC            = BIT(0),
251         ENABLE_L3_FILTERING     = BIT(1),
252         ENABLE_NBNS_FILTERING   = BIT(2),
253         ENABLE_DHCP_FILTERING   = BIT(3),
254 };
255
256 struct iwl_wowlan_config_cmd {
257         __le32 wakeup_filter;
258         __le16 non_qos_seq;
259         __le16 qos_seq[8];
260         u8 wowlan_ba_teardown_tids;
261         u8 is_11n_connection;
262         u8 offloading_tid;
263         u8 flags;
264         u8 reserved[2];
265 } __packed; /* WOWLAN_CONFIG_API_S_VER_4 */
266
267 /*
268  * WOWLAN_TSC_RSC_PARAMS
269  */
270 #define IWL_NUM_RSC     16
271
272 struct tkip_sc {
273         __le16 iv16;
274         __le16 pad;
275         __le32 iv32;
276 } __packed; /* TKIP_SC_API_U_VER_1 */
277
278 struct iwl_tkip_rsc_tsc {
279         struct tkip_sc unicast_rsc[IWL_NUM_RSC];
280         struct tkip_sc multicast_rsc[IWL_NUM_RSC];
281         struct tkip_sc tsc;
282 } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
283
284 struct aes_sc {
285         __le64 pn;
286 } __packed; /* TKIP_AES_SC_API_U_VER_1 */
287
288 struct iwl_aes_rsc_tsc {
289         struct aes_sc unicast_rsc[IWL_NUM_RSC];
290         struct aes_sc multicast_rsc[IWL_NUM_RSC];
291         struct aes_sc tsc;
292 } __packed; /* AES_TSC_RSC_API_S_VER_1 */
293
294 union iwl_all_tsc_rsc {
295         struct iwl_tkip_rsc_tsc tkip;
296         struct iwl_aes_rsc_tsc aes;
297 }; /* ALL_TSC_RSC_API_S_VER_2 */
298
299 struct iwl_wowlan_rsc_tsc_params_cmd {
300         union iwl_all_tsc_rsc all_tsc_rsc;
301 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
302
303 #define IWL_MIC_KEY_SIZE        8
304 struct iwl_mic_keys {
305         u8 tx[IWL_MIC_KEY_SIZE];
306         u8 rx_unicast[IWL_MIC_KEY_SIZE];
307         u8 rx_mcast[IWL_MIC_KEY_SIZE];
308 } __packed; /* MIC_KEYS_API_S_VER_1 */
309
310 #define IWL_P1K_SIZE            5
311 struct iwl_p1k_cache {
312         __le16 p1k[IWL_P1K_SIZE];
313 } __packed;
314
315 #define IWL_NUM_RX_P1K_CACHE    2
316
317 struct iwl_wowlan_tkip_params_cmd {
318         struct iwl_mic_keys mic_keys;
319         struct iwl_p1k_cache tx;
320         struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
321         struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
322 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
323
324 #define IWL_KCK_MAX_SIZE        32
325 #define IWL_KEK_MAX_SIZE        32
326
327 struct iwl_wowlan_kek_kck_material_cmd {
328         u8      kck[IWL_KCK_MAX_SIZE];
329         u8      kek[IWL_KEK_MAX_SIZE];
330         __le16  kck_len;
331         __le16  kek_len;
332         __le64  replay_ctr;
333 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
334
335 #define RF_KILL_INDICATOR_FOR_WOWLAN    0x87
336
337 enum iwl_wowlan_rekey_status {
338         IWL_WOWLAN_REKEY_POST_REKEY = 0,
339         IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
340 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
341
342 enum iwl_wowlan_wakeup_reason {
343         IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS                       = 0,
344         IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET                       = BIT(0),
345         IWL_WOWLAN_WAKEUP_BY_PATTERN                            = BIT(1),
346         IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON     = BIT(2),
347         IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH            = BIT(3),
348         IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE                  = BIT(4),
349         IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED                  = BIT(5),
350         IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR                        = BIT(6),
351         IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST                      = BIT(7),
352         IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE                 = BIT(8),
353         IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS                 = BIT(9),
354         IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE           = BIT(10),
355         IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL              = BIT(11),
356         IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET             = BIT(12),
357         IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET                  = BIT(13),
358         IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER               = BIT(14),
359         IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN                = BIT(15),
360         IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN                 = BIT(16),
361
362 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
363
364 struct iwl_wowlan_gtk_status {
365         u8 key_index;
366         u8 reserved[3];
367         u8 decrypt_key[16];
368         u8 tkip_mic_key[8];
369         struct iwl_wowlan_rsc_tsc_params_cmd rsc;
370 } __packed;
371
372 struct iwl_wowlan_status {
373         struct iwl_wowlan_gtk_status gtk;
374         __le64 replay_ctr;
375         __le16 pattern_number;
376         __le16 non_qos_seq_ctr;
377         __le16 qos_seq_ctr[8];
378         __le32 wakeup_reasons;
379         __le32 num_of_gtk_rekeys;
380         __le32 transmitted_ndps;
381         __le32 received_beacons;
382         __le32 wake_packet_length;
383         __le32 wake_packet_bufsize;
384         u8 wake_packet[]; /* can be truncated from _length to _bufsize */
385 } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
386
387 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN           64
388 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN   128
389 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS       2048
390
391 struct iwl_tcp_packet_info {
392         __le16 tcp_pseudo_header_checksum;
393         __le16 tcp_payload_length;
394 } __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
395
396 struct iwl_tcp_packet {
397         struct iwl_tcp_packet_info info;
398         u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
399         u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
400 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
401
402 struct iwl_remote_wake_packet {
403         struct iwl_tcp_packet_info info;
404         u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
405         u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
406 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
407
408 struct iwl_wowlan_remote_wake_config {
409         __le32 connection_max_time; /* unused */
410         /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
411         u8 max_syn_retries;
412         u8 max_data_retries;
413         u8 tcp_syn_ack_timeout;
414         u8 tcp_ack_timeout;
415
416         struct iwl_tcp_packet syn_tx;
417         struct iwl_tcp_packet synack_rx;
418         struct iwl_tcp_packet keepalive_ack_rx;
419         struct iwl_tcp_packet fin_tx;
420
421         struct iwl_remote_wake_packet keepalive_tx;
422         struct iwl_remote_wake_packet wake_rx;
423
424         /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
425         u8 sequence_number_offset;
426         u8 sequence_number_length;
427         u8 token_offset;
428         u8 token_length;
429         /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
430         __le32 initial_sequence_number;
431         __le16 keepalive_interval;
432         __le16 num_tokens;
433         u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
434 } __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
435
436 /* TODO: NetDetect API */
437
438 #endif /* __fw_api_d3_h__ */