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 - 2017 Intel Deutschland GmbH 11 * Copyright(c) 2018 - 2019 Intel Corporation 12 * 13 * This program is free software; you can redistribute it and/or modify 14 * it under the terms of version 2 of the GNU General Public License as 15 * published by the Free Software Foundation. 16 * 17 * This program is distributed in the hope that it will be useful, but 18 * WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 * General Public License for more details. 21 * 22 * The full GNU General Public License is included in this distribution 23 * in the file called COPYING. 24 * 25 * Contact Information: 26 * Intel Linux Wireless <linuxwifi@intel.com> 27 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 28 * 29 * BSD LICENSE 30 * 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 34 * Copyright(c) 2018 - 2019 Intel Corporation 35 * All rights reserved. 36 * 37 * Redistribution and use in source and binary forms, with or without 38 * modification, are permitted provided that the following conditions 39 * are met: 40 * 41 * * Redistributions of source code must retain the above copyright 42 * notice, this list of conditions and the following disclaimer. 43 * * Redistributions in binary form must reproduce the above copyright 44 * notice, this list of conditions and the following disclaimer in 45 * the documentation and/or other materials provided with the 46 * distribution. 47 * * Neither the name Intel Corporation nor the names of its 48 * contributors may be used to endorse or promote products derived 49 * from this software without specific prior written permission. 50 * 51 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 52 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 53 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 54 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 55 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 56 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 57 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 58 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 59 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 60 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 61 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 62 *****************************************************************************/ 63 64 #ifndef __iwl_fw_api_d3_h__ 65 #define __iwl_fw_api_d3_h__ 66 67 /** 68 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags 69 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert 70 */ 71 enum iwl_d3_wakeup_flags { 72 IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0), 73 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */ 74 75 /** 76 * struct iwl_d3_manager_config - D3 manager configuration command 77 * @min_sleep_time: minimum sleep time (in usec) 78 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags 79 * @wakeup_host_timer: force wakeup after this many seconds 80 * 81 * The structure is used for the D3_CONFIG_CMD command. 82 */ 83 struct iwl_d3_manager_config { 84 __le32 min_sleep_time; 85 __le32 wakeup_flags; 86 __le32 wakeup_host_timer; 87 } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */ 88 89 90 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */ 91 92 /** 93 * enum iwl_d3_proto_offloads - enabled protocol offloads 94 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled 95 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled 96 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid 97 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid 98 */ 99 enum iwl_proto_offloads { 100 IWL_D3_PROTO_OFFLOAD_ARP = BIT(0), 101 IWL_D3_PROTO_OFFLOAD_NS = BIT(1), 102 IWL_D3_PROTO_IPV4_VALID = BIT(2), 103 IWL_D3_PROTO_IPV6_VALID = BIT(3), 104 }; 105 106 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2 107 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6 108 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12 109 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4 110 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12 111 112 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4 113 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2 114 115 /** 116 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part 117 * @enabled: enable flags 118 * @remote_ipv4_addr: remote address to answer to (or zero if all) 119 * @host_ipv4_addr: our IPv4 address to respond to queries for 120 * @arp_mac_addr: our MAC address for ARP responses 121 * @reserved: unused 122 */ 123 struct iwl_proto_offload_cmd_common { 124 __le32 enabled; 125 __be32 remote_ipv4_addr; 126 __be32 host_ipv4_addr; 127 u8 arp_mac_addr[ETH_ALEN]; 128 __le16 reserved; 129 } __packed; 130 131 /** 132 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration 133 * @common: common/IPv4 configuration 134 * @remote_ipv6_addr: remote address to answer to (or zero if all) 135 * @solicited_node_ipv6_addr: broken -- solicited node address exists 136 * for each target address 137 * @target_ipv6_addr: our target addresses 138 * @ndp_mac_addr: neighbor solicitation response MAC address 139 * @reserved2: reserved 140 */ 141 struct iwl_proto_offload_cmd_v1 { 142 struct iwl_proto_offload_cmd_common common; 143 u8 remote_ipv6_addr[16]; 144 u8 solicited_node_ipv6_addr[16]; 145 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16]; 146 u8 ndp_mac_addr[ETH_ALEN]; 147 __le16 reserved2; 148 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */ 149 150 /** 151 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration 152 * @common: common/IPv4 configuration 153 * @remote_ipv6_addr: remote address to answer to (or zero if all) 154 * @solicited_node_ipv6_addr: broken -- solicited node address exists 155 * for each target address 156 * @target_ipv6_addr: our target addresses 157 * @ndp_mac_addr: neighbor solicitation response MAC address 158 * @num_valid_ipv6_addrs: number of valid IPv6 addresses 159 * @reserved2: reserved 160 */ 161 struct iwl_proto_offload_cmd_v2 { 162 struct iwl_proto_offload_cmd_common common; 163 u8 remote_ipv6_addr[16]; 164 u8 solicited_node_ipv6_addr[16]; 165 u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16]; 166 u8 ndp_mac_addr[ETH_ALEN]; 167 u8 num_valid_ipv6_addrs; 168 u8 reserved2[3]; 169 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */ 170 171 struct iwl_ns_config { 172 struct in6_addr source_ipv6_addr; 173 struct in6_addr dest_ipv6_addr; 174 u8 target_mac_addr[ETH_ALEN]; 175 __le16 reserved; 176 } __packed; /* NS_OFFLOAD_CONFIG */ 177 178 struct iwl_targ_addr { 179 struct in6_addr addr; 180 __le32 config_num; 181 } __packed; /* TARGET_IPV6_ADDRESS */ 182 183 /** 184 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration 185 * @common: common/IPv4 configuration 186 * @num_valid_ipv6_addrs: number of valid IPv6 addresses 187 * @targ_addrs: target IPv6 addresses 188 * @ns_config: NS offload configurations 189 */ 190 struct iwl_proto_offload_cmd_v3_small { 191 struct iwl_proto_offload_cmd_common common; 192 __le32 num_valid_ipv6_addrs; 193 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S]; 194 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S]; 195 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */ 196 197 /** 198 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration 199 * @common: common/IPv4 configuration 200 * @num_valid_ipv6_addrs: number of valid IPv6 addresses 201 * @targ_addrs: target IPv6 addresses 202 * @ns_config: NS offload configurations 203 */ 204 struct iwl_proto_offload_cmd_v3_large { 205 struct iwl_proto_offload_cmd_common common; 206 __le32 num_valid_ipv6_addrs; 207 struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L]; 208 struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L]; 209 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */ 210 211 /* 212 * WOWLAN_PATTERNS 213 */ 214 #define IWL_WOWLAN_MIN_PATTERN_LEN 16 215 #define IWL_WOWLAN_MAX_PATTERN_LEN 128 216 217 struct iwl_wowlan_pattern_v1 { 218 u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8]; 219 u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN]; 220 u8 mask_size; 221 u8 pattern_size; 222 __le16 reserved; 223 } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */ 224 225 #define IWL_WOWLAN_MAX_PATTERNS 20 226 227 /** 228 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns 229 */ 230 struct iwl_wowlan_patterns_cmd_v1 { 231 /** 232 * @n_patterns: number of patterns 233 */ 234 __le32 n_patterns; 235 236 /** 237 * @patterns: the patterns, array length in @n_patterns 238 */ 239 struct iwl_wowlan_pattern_v1 patterns[]; 240 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */ 241 242 #define IPV4_ADDR_SIZE 4 243 #define IPV6_ADDR_SIZE 16 244 245 enum iwl_wowlan_pattern_type { 246 WOWLAN_PATTERN_TYPE_BITMASK, 247 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN, 248 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN, 249 WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD, 250 WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD, 251 }; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */ 252 253 /** 254 * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data 255 */ 256 struct iwl_wowlan_ipv4_tcp_syn { 257 /** 258 * @src_addr: source IP address to match 259 */ 260 u8 src_addr[IPV4_ADDR_SIZE]; 261 262 /** 263 * @dst_addr: destination IP address to match 264 */ 265 u8 dst_addr[IPV4_ADDR_SIZE]; 266 267 /** 268 * @src_port: source TCP port to match 269 */ 270 __le16 src_port; 271 272 /** 273 * @dst_port: destination TCP port to match 274 */ 275 __le16 dst_port; 276 } __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */ 277 278 /** 279 * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data 280 */ 281 struct iwl_wowlan_ipv6_tcp_syn { 282 /** 283 * @src_addr: source IP address to match 284 */ 285 u8 src_addr[IPV6_ADDR_SIZE]; 286 287 /** 288 * @dst_addr: destination IP address to match 289 */ 290 u8 dst_addr[IPV6_ADDR_SIZE]; 291 292 /** 293 * @src_port: source TCP port to match 294 */ 295 __le16 src_port; 296 297 /** 298 * @dst_port: destination TCP port to match 299 */ 300 __le16 dst_port; 301 } __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */ 302 303 /** 304 * union iwl_wowlan_pattern_data - Data for the different pattern types 305 * 306 * If wildcard addresses/ports are to be used, the union can be left 307 * undefined. 308 */ 309 union iwl_wowlan_pattern_data { 310 /** 311 * @bitmask: bitmask pattern data 312 */ 313 struct iwl_wowlan_pattern_v1 bitmask; 314 315 /** 316 * @ipv4_tcp_syn: IPv4 TCP SYN pattern data 317 */ 318 struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn; 319 320 /** 321 * @ipv6_tcp_syn: IPv6 TCP SYN pattern data 322 */ 323 struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn; 324 }; /* WOWLAN_PATTERN_API_U_VER_1 */ 325 326 /** 327 * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns 328 */ 329 struct iwl_wowlan_pattern_v2 { 330 /** 331 * @pattern_type: defines the struct type to be used in the union 332 */ 333 u8 pattern_type; 334 335 /** 336 * @reserved: reserved for alignment 337 */ 338 u8 reserved[3]; 339 340 /** 341 * @u: the union containing the match data, or undefined for 342 * wildcard matches 343 */ 344 union iwl_wowlan_pattern_data u; 345 } __packed; /* WOWLAN_PATTERN_API_S_VER_2 */ 346 347 /** 348 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command 349 */ 350 struct iwl_wowlan_patterns_cmd { 351 /** 352 * @n_patterns: number of patterns 353 */ 354 __le32 n_patterns; 355 356 /** 357 * @patterns: the patterns, array length in @n_patterns 358 */ 359 struct iwl_wowlan_pattern_v2 patterns[]; 360 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_2 */ 361 362 enum iwl_wowlan_wakeup_filters { 363 IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0), 364 IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1), 365 IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2), 366 IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3), 367 IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4), 368 IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5), 369 IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6), 370 IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7), 371 IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8), 372 IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9), 373 IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10), 374 IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11), 375 IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12), 376 IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13), 377 IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14), 378 IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15), 379 IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16), 380 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */ 381 382 enum iwl_wowlan_flags { 383 IS_11W_ASSOC = BIT(0), 384 ENABLE_L3_FILTERING = BIT(1), 385 ENABLE_NBNS_FILTERING = BIT(2), 386 ENABLE_DHCP_FILTERING = BIT(3), 387 ENABLE_STORE_BEACON = BIT(4), 388 }; 389 390 /** 391 * struct iwl_wowlan_config_cmd - WoWLAN configuration 392 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters 393 * @non_qos_seq: non-QoS sequence counter to use next 394 * @qos_seq: QoS sequence counters to use next 395 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down 396 * @is_11n_connection: indicates HT connection 397 * @offloading_tid: TID reserved for firmware use 398 * @flags: extra flags, see &enum iwl_wowlan_flags 399 * @reserved: reserved 400 */ 401 struct iwl_wowlan_config_cmd { 402 __le32 wakeup_filter; 403 __le16 non_qos_seq; 404 __le16 qos_seq[8]; 405 u8 wowlan_ba_teardown_tids; 406 u8 is_11n_connection; 407 u8 offloading_tid; 408 u8 flags; 409 u8 reserved[2]; 410 } __packed; /* WOWLAN_CONFIG_API_S_VER_4 */ 411 412 /* 413 * WOWLAN_TSC_RSC_PARAMS 414 */ 415 #define IWL_NUM_RSC 16 416 417 struct tkip_sc { 418 __le16 iv16; 419 __le16 pad; 420 __le32 iv32; 421 } __packed; /* TKIP_SC_API_U_VER_1 */ 422 423 struct iwl_tkip_rsc_tsc { 424 struct tkip_sc unicast_rsc[IWL_NUM_RSC]; 425 struct tkip_sc multicast_rsc[IWL_NUM_RSC]; 426 struct tkip_sc tsc; 427 } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */ 428 429 struct aes_sc { 430 __le64 pn; 431 } __packed; /* TKIP_AES_SC_API_U_VER_1 */ 432 433 struct iwl_aes_rsc_tsc { 434 struct aes_sc unicast_rsc[IWL_NUM_RSC]; 435 struct aes_sc multicast_rsc[IWL_NUM_RSC]; 436 struct aes_sc tsc; 437 } __packed; /* AES_TSC_RSC_API_S_VER_1 */ 438 439 union iwl_all_tsc_rsc { 440 struct iwl_tkip_rsc_tsc tkip; 441 struct iwl_aes_rsc_tsc aes; 442 }; /* ALL_TSC_RSC_API_S_VER_2 */ 443 444 struct iwl_wowlan_rsc_tsc_params_cmd { 445 union iwl_all_tsc_rsc all_tsc_rsc; 446 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */ 447 448 #define IWL_MIC_KEY_SIZE 8 449 struct iwl_mic_keys { 450 u8 tx[IWL_MIC_KEY_SIZE]; 451 u8 rx_unicast[IWL_MIC_KEY_SIZE]; 452 u8 rx_mcast[IWL_MIC_KEY_SIZE]; 453 } __packed; /* MIC_KEYS_API_S_VER_1 */ 454 455 #define IWL_P1K_SIZE 5 456 struct iwl_p1k_cache { 457 __le16 p1k[IWL_P1K_SIZE]; 458 } __packed; 459 460 #define IWL_NUM_RX_P1K_CACHE 2 461 462 struct iwl_wowlan_tkip_params_cmd { 463 struct iwl_mic_keys mic_keys; 464 struct iwl_p1k_cache tx; 465 struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE]; 466 struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE]; 467 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */ 468 469 #define IWL_KCK_MAX_SIZE 32 470 #define IWL_KEK_MAX_SIZE 32 471 472 struct iwl_wowlan_kek_kck_material_cmd { 473 u8 kck[IWL_KCK_MAX_SIZE]; 474 u8 kek[IWL_KEK_MAX_SIZE]; 475 __le16 kck_len; 476 __le16 kek_len; 477 __le64 replay_ctr; 478 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */ 479 480 #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87 481 482 enum iwl_wowlan_rekey_status { 483 IWL_WOWLAN_REKEY_POST_REKEY = 0, 484 IWL_WOWLAN_REKEY_WHILE_REKEY = 1, 485 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */ 486 487 enum iwl_wowlan_wakeup_reason { 488 IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0, 489 IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0), 490 IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1), 491 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2), 492 IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3), 493 IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4), 494 IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5), 495 IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6), 496 IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7), 497 IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8), 498 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9), 499 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10), 500 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11), 501 IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12), 502 IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13), 503 IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14), 504 IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15), 505 IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16), 506 IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT(17), 507 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT(18), 508 IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT(19), 509 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT(20), 510 IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT(21), 511 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */ 512 513 struct iwl_wowlan_gtk_status_v1 { 514 u8 key_index; 515 u8 reserved[3]; 516 u8 decrypt_key[16]; 517 u8 tkip_mic_key[8]; 518 struct iwl_wowlan_rsc_tsc_params_cmd rsc; 519 } __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */ 520 521 #define WOWLAN_KEY_MAX_SIZE 32 522 #define WOWLAN_GTK_KEYS_NUM 2 523 #define WOWLAN_IGTK_KEYS_NUM 2 524 525 /** 526 * struct iwl_wowlan_gtk_status - GTK status 527 * @key: GTK material 528 * @key_len: GTK legth, if set to 0, the key is not available 529 * @key_flags: information about the key: 530 * bits[0:1]: key index assigned by the AP 531 * bits[2:6]: GTK index of the key in the internal DB 532 * bit[7]: Set iff this is the currently used GTK 533 * @reserved: padding 534 * @tkip_mic_key: TKIP RX MIC key 535 * @rsc: TSC RSC counters 536 */ 537 struct iwl_wowlan_gtk_status { 538 u8 key[WOWLAN_KEY_MAX_SIZE]; 539 u8 key_len; 540 u8 key_flags; 541 u8 reserved[2]; 542 u8 tkip_mic_key[8]; 543 struct iwl_wowlan_rsc_tsc_params_cmd rsc; 544 } __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */ 545 546 #define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1)) 547 548 /** 549 * struct iwl_wowlan_igtk_status - IGTK status 550 * @key: IGTK material 551 * @ipn: the IGTK packet number (replay counter) 552 * @key_len: IGTK length, if set to 0, the key is not available 553 * @key_flags: information about the key: 554 * bits[0]: key index assigned by the AP (0: index 4, 1: index 5) 555 * bits[1:5]: IGTK index of the key in the internal DB 556 * bit[6]: Set iff this is the currently used IGTK 557 */ 558 struct iwl_wowlan_igtk_status { 559 u8 key[WOWLAN_KEY_MAX_SIZE]; 560 u8 ipn[6]; 561 u8 key_len; 562 u8 key_flags; 563 } __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */ 564 565 /** 566 * struct iwl_wowlan_status_v6 - WoWLAN status 567 * @gtk: GTK data 568 * @replay_ctr: GTK rekey replay counter 569 * @pattern_number: number of the matched pattern 570 * @non_qos_seq_ctr: non-QoS sequence counter to use next 571 * @qos_seq_ctr: QoS sequence counters to use next 572 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 573 * @num_of_gtk_rekeys: number of GTK rekeys 574 * @transmitted_ndps: number of transmitted neighbor discovery packets 575 * @received_beacons: number of received beacons 576 * @wake_packet_length: wakeup packet length 577 * @wake_packet_bufsize: wakeup packet buffer size 578 * @wake_packet: wakeup packet 579 */ 580 struct iwl_wowlan_status_v6 { 581 struct iwl_wowlan_gtk_status_v1 gtk; 582 __le64 replay_ctr; 583 __le16 pattern_number; 584 __le16 non_qos_seq_ctr; 585 __le16 qos_seq_ctr[8]; 586 __le32 wakeup_reasons; 587 __le32 num_of_gtk_rekeys; 588 __le32 transmitted_ndps; 589 __le32 received_beacons; 590 __le32 wake_packet_length; 591 __le32 wake_packet_bufsize; 592 u8 wake_packet[]; /* can be truncated from _length to _bufsize */ 593 } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */ 594 595 /** 596 * struct iwl_wowlan_status - WoWLAN status 597 * @gtk: GTK data 598 * @igtk: IGTK data 599 * @replay_ctr: GTK rekey replay counter 600 * @pattern_number: number of the matched pattern 601 * @non_qos_seq_ctr: non-QoS sequence counter to use next 602 * @qos_seq_ctr: QoS sequence counters to use next 603 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 604 * @num_of_gtk_rekeys: number of GTK rekeys 605 * @transmitted_ndps: number of transmitted neighbor discovery packets 606 * @received_beacons: number of received beacons 607 * @wake_packet_length: wakeup packet length 608 * @wake_packet_bufsize: wakeup packet buffer size 609 * @wake_packet: wakeup packet 610 */ 611 struct iwl_wowlan_status { 612 struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM]; 613 struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM]; 614 __le64 replay_ctr; 615 __le16 pattern_number; 616 __le16 non_qos_seq_ctr; 617 __le16 qos_seq_ctr[8]; 618 __le32 wakeup_reasons; 619 __le32 num_of_gtk_rekeys; 620 __le32 transmitted_ndps; 621 __le32 received_beacons; 622 __le32 wake_packet_length; 623 __le32 wake_packet_bufsize; 624 u8 wake_packet[]; /* can be truncated from _length to _bufsize */ 625 } __packed; /* WOWLAN_STATUSES_API_S_VER_7 */ 626 627 static inline u8 iwlmvm_wowlan_gtk_idx(struct iwl_wowlan_gtk_status *gtk) 628 { 629 return gtk->key_flags & IWL_WOWLAN_GTK_IDX_MASK; 630 } 631 632 #define IWL_WOWLAN_TCP_MAX_PACKET_LEN 64 633 #define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN 128 634 #define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS 2048 635 636 struct iwl_tcp_packet_info { 637 __le16 tcp_pseudo_header_checksum; 638 __le16 tcp_payload_length; 639 } __packed; /* TCP_PACKET_INFO_API_S_VER_2 */ 640 641 struct iwl_tcp_packet { 642 struct iwl_tcp_packet_info info; 643 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8]; 644 u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN]; 645 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */ 646 647 struct iwl_remote_wake_packet { 648 struct iwl_tcp_packet_info info; 649 u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8]; 650 u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN]; 651 } __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */ 652 653 struct iwl_wowlan_remote_wake_config { 654 __le32 connection_max_time; /* unused */ 655 /* TCP_PROTOCOL_CONFIG_API_S_VER_1 */ 656 u8 max_syn_retries; 657 u8 max_data_retries; 658 u8 tcp_syn_ack_timeout; 659 u8 tcp_ack_timeout; 660 661 struct iwl_tcp_packet syn_tx; 662 struct iwl_tcp_packet synack_rx; 663 struct iwl_tcp_packet keepalive_ack_rx; 664 struct iwl_tcp_packet fin_tx; 665 666 struct iwl_remote_wake_packet keepalive_tx; 667 struct iwl_remote_wake_packet wake_rx; 668 669 /* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */ 670 u8 sequence_number_offset; 671 u8 sequence_number_length; 672 u8 token_offset; 673 u8 token_length; 674 /* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */ 675 __le32 initial_sequence_number; 676 __le16 keepalive_interval; 677 __le16 num_tokens; 678 u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS]; 679 } __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */ 680 681 /* TODO: NetDetect API */ 682 683 #endif /* __iwl_fw_api_d3_h__ */ 684