]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h
Input: fix PWM-related undefined reference errors
[karo-tx-linux.git] / drivers / net / wireless / 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 - 2013 Intel Corporation. All rights reserved.
9  *
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.
13  *
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.
18  *
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,
22  * USA
23  *
24  * The full GNU General Public License is included in this distribution
25  * in the file called COPYING.
26  *
27  * Contact Information:
28  *  Intel Linux Wireless <ilw@linux.intel.com>
29  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30  *
31  * BSD LICENSE
32  *
33  * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved.
34  * All rights reserved.
35  *
36  * Redistribution and use in source and binary forms, with or without
37  * modification, are permitted provided that the following conditions
38  * are met:
39  *
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
45  *    distribution.
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.
49  *
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  *****************************************************************************/
62
63 #ifndef __fw_api_d3_h__
64 #define __fw_api_d3_h__
65
66 /**
67  * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
68  * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
69  */
70 enum iwl_d3_wakeup_flags {
71         IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
72 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
73
74 /**
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
79  *
80  * The structure is used for the D3_CONFIG_CMD command.
81  */
82 struct iwl_d3_manager_config {
83         __le32 min_sleep_time;
84         __le32 wakeup_flags;
85         __le32 wakeup_host_timer;
86 } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
87
88
89 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
90
91 /**
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
95  */
96 enum iwl_proto_offloads {
97         IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
98         IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
99 };
100
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_MAX    6
104
105 /**
106  * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
107  * @enabled: enable flags
108  * @remote_ipv4_addr: remote address to answer to (or zero if all)
109  * @host_ipv4_addr: our IPv4 address to respond to queries for
110  * @arp_mac_addr: our MAC address for ARP responses
111  * @reserved: unused
112  */
113 struct iwl_proto_offload_cmd_common {
114         __le32 enabled;
115         __be32 remote_ipv4_addr;
116         __be32 host_ipv4_addr;
117         u8 arp_mac_addr[ETH_ALEN];
118         __le16 reserved;
119 } __packed;
120
121 /**
122  * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
123  * @common: common/IPv4 configuration
124  * @remote_ipv6_addr: remote address to answer to (or zero if all)
125  * @solicited_node_ipv6_addr: broken -- solicited node address exists
126  *      for each target address
127  * @target_ipv6_addr: our target addresses
128  * @ndp_mac_addr: neighbor soliciation response MAC address
129  */
130 struct iwl_proto_offload_cmd_v1 {
131         struct iwl_proto_offload_cmd_common common;
132         u8 remote_ipv6_addr[16];
133         u8 solicited_node_ipv6_addr[16];
134         u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
135         u8 ndp_mac_addr[ETH_ALEN];
136         __le16 reserved2;
137 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
138
139 /**
140  * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
141  * @common: common/IPv4 configuration
142  * @remote_ipv6_addr: remote address to answer to (or zero if all)
143  * @solicited_node_ipv6_addr: broken -- solicited node address exists
144  *      for each target address
145  * @target_ipv6_addr: our target addresses
146  * @ndp_mac_addr: neighbor soliciation response MAC address
147  */
148 struct iwl_proto_offload_cmd_v2 {
149         struct iwl_proto_offload_cmd_common common;
150         u8 remote_ipv6_addr[16];
151         u8 solicited_node_ipv6_addr[16];
152         u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
153         u8 ndp_mac_addr[ETH_ALEN];
154         u8 numValidIPv6Addresses;
155         u8 reserved2[3];
156 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
157
158
159 /*
160  * WOWLAN_PATTERNS
161  */
162 #define IWL_WOWLAN_MIN_PATTERN_LEN      16
163 #define IWL_WOWLAN_MAX_PATTERN_LEN      128
164
165 struct iwl_wowlan_pattern {
166         u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
167         u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
168         u8 mask_size;
169         u8 pattern_size;
170         __le16 reserved;
171 } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
172
173 #define IWL_WOWLAN_MAX_PATTERNS 20
174
175 struct iwl_wowlan_patterns_cmd {
176         __le32 n_patterns;
177         struct iwl_wowlan_pattern patterns[];
178 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
179
180 enum iwl_wowlan_wakeup_filters {
181         IWL_WOWLAN_WAKEUP_MAGIC_PACKET                  = BIT(0),
182         IWL_WOWLAN_WAKEUP_PATTERN_MATCH                 = BIT(1),
183         IWL_WOWLAN_WAKEUP_BEACON_MISS                   = BIT(2),
184         IWL_WOWLAN_WAKEUP_LINK_CHANGE                   = BIT(3),
185         IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL                = BIT(4),
186         IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ                 = BIT(5),
187         IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE                = BIT(6),
188         IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT             = BIT(7),
189         IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT              = BIT(8),
190         IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS              = BIT(9),
191         IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE        = BIT(10),
192         /* BIT(11) reserved */
193         IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET          = BIT(12),
194 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
195
196 struct iwl_wowlan_config_cmd {
197         __le32 wakeup_filter;
198         __le16 non_qos_seq;
199         __le16 qos_seq[8];
200         u8 wowlan_ba_teardown_tids;
201         u8 is_11n_connection;
202 } __packed; /* WOWLAN_CONFIG_API_S_VER_2 */
203
204 /*
205  * WOWLAN_TSC_RSC_PARAMS
206  */
207 #define IWL_NUM_RSC     16
208
209 struct tkip_sc {
210         __le16 iv16;
211         __le16 pad;
212         __le32 iv32;
213 } __packed; /* TKIP_SC_API_U_VER_1 */
214
215 struct iwl_tkip_rsc_tsc {
216         struct tkip_sc unicast_rsc[IWL_NUM_RSC];
217         struct tkip_sc multicast_rsc[IWL_NUM_RSC];
218         struct tkip_sc tsc;
219 } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
220
221 struct aes_sc {
222         __le64 pn;
223 } __packed; /* TKIP_AES_SC_API_U_VER_1 */
224
225 struct iwl_aes_rsc_tsc {
226         struct aes_sc unicast_rsc[IWL_NUM_RSC];
227         struct aes_sc multicast_rsc[IWL_NUM_RSC];
228         struct aes_sc tsc;
229 } __packed; /* AES_TSC_RSC_API_S_VER_1 */
230
231 union iwl_all_tsc_rsc {
232         struct iwl_tkip_rsc_tsc tkip;
233         struct iwl_aes_rsc_tsc aes;
234 }; /* ALL_TSC_RSC_API_S_VER_2 */
235
236 struct iwl_wowlan_rsc_tsc_params_cmd {
237         union iwl_all_tsc_rsc all_tsc_rsc;
238 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
239
240 #define IWL_MIC_KEY_SIZE        8
241 struct iwl_mic_keys {
242         u8 tx[IWL_MIC_KEY_SIZE];
243         u8 rx_unicast[IWL_MIC_KEY_SIZE];
244         u8 rx_mcast[IWL_MIC_KEY_SIZE];
245 } __packed; /* MIC_KEYS_API_S_VER_1 */
246
247 #define IWL_P1K_SIZE            5
248 struct iwl_p1k_cache {
249         __le16 p1k[IWL_P1K_SIZE];
250 } __packed;
251
252 #define IWL_NUM_RX_P1K_CACHE    2
253
254 struct iwl_wowlan_tkip_params_cmd {
255         struct iwl_mic_keys mic_keys;
256         struct iwl_p1k_cache tx;
257         struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
258         struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
259 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
260
261 #define IWL_KCK_MAX_SIZE        32
262 #define IWL_KEK_MAX_SIZE        32
263
264 struct iwl_wowlan_kek_kck_material_cmd {
265         u8      kck[IWL_KCK_MAX_SIZE];
266         u8      kek[IWL_KEK_MAX_SIZE];
267         __le16  kck_len;
268         __le16  kek_len;
269         __le64  replay_ctr;
270 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
271
272 #define RF_KILL_INDICATOR_FOR_WOWLAN    0x87
273
274 enum iwl_wowlan_rekey_status {
275         IWL_WOWLAN_REKEY_POST_REKEY = 0,
276         IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
277 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
278
279 enum iwl_wowlan_wakeup_reason {
280         IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS                       = 0,
281         IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET                       = BIT(0),
282         IWL_WOWLAN_WAKEUP_BY_PATTERN                            = BIT(1),
283         IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON     = BIT(2),
284         IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH            = BIT(3),
285         IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE                  = BIT(4),
286         IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED                  = BIT(5),
287         IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR                        = BIT(6),
288         IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST                      = BIT(7),
289         IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE                 = BIT(8),
290         IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS                 = BIT(9),
291         IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE           = BIT(10),
292         /* BIT(11) reserved */
293         IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET             = BIT(12),
294 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
295
296 struct iwl_wowlan_status {
297         __le64 replay_ctr;
298         __le16 pattern_number;
299         __le16 non_qos_seq_ctr;
300         __le16 qos_seq_ctr[8];
301         __le32 wakeup_reasons;
302         __le32 rekey_status;
303         __le32 num_of_gtk_rekeys;
304         __le32 transmitted_ndps;
305         __le32 received_beacons;
306         __le32 wake_packet_length;
307         __le32 wake_packet_bufsize;
308         u8 wake_packet[]; /* can be truncated from _length to _bufsize */
309 } __packed; /* WOWLAN_STATUSES_API_S_VER_4 */
310
311 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN           64
312 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN   128
313 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS       2048
314
315 struct iwl_tcp_packet_info {
316         __le16 tcp_pseudo_header_checksum;
317         __le16 tcp_payload_length;
318 } __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
319
320 struct iwl_tcp_packet {
321         struct iwl_tcp_packet_info info;
322         u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
323         u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
324 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
325
326 struct iwl_remote_wake_packet {
327         struct iwl_tcp_packet_info info;
328         u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
329         u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
330 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
331
332 struct iwl_wowlan_remote_wake_config {
333         __le32 connection_max_time; /* unused */
334         /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
335         u8 max_syn_retries;
336         u8 max_data_retries;
337         u8 tcp_syn_ack_timeout;
338         u8 tcp_ack_timeout;
339
340         struct iwl_tcp_packet syn_tx;
341         struct iwl_tcp_packet synack_rx;
342         struct iwl_tcp_packet keepalive_ack_rx;
343         struct iwl_tcp_packet fin_tx;
344
345         struct iwl_remote_wake_packet keepalive_tx;
346         struct iwl_remote_wake_packet wake_rx;
347
348         /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
349         u8 sequence_number_offset;
350         u8 sequence_number_length;
351         u8 token_offset;
352         u8 token_length;
353         /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
354         __le32 initial_sequence_number;
355         __le16 keepalive_interval;
356         __le16 num_tokens;
357         u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
358 } __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
359
360 /* TODO: NetDetect API */
361
362 #endif /* __fw_api_d3_h__ */