1*bfcc09ddSBjoern A. Zeeb /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2*bfcc09ddSBjoern A. Zeeb /* 3*bfcc09ddSBjoern A. Zeeb * Copyright (C) 2012-2014, 2018-2021 Intel Corporation 4*bfcc09ddSBjoern A. Zeeb * Copyright (C) 2013-2014 Intel Mobile Communications GmbH 5*bfcc09ddSBjoern A. Zeeb * Copyright (C) 2015-2017 Intel Deutschland GmbH 6*bfcc09ddSBjoern A. Zeeb */ 7*bfcc09ddSBjoern A. Zeeb #ifndef __iwl_fw_api_d3_h__ 8*bfcc09ddSBjoern A. Zeeb #define __iwl_fw_api_d3_h__ 9*bfcc09ddSBjoern A. Zeeb #include <iwl-trans.h> 10*bfcc09ddSBjoern A. Zeeb 11*bfcc09ddSBjoern A. Zeeb /** 12*bfcc09ddSBjoern A. Zeeb * enum iwl_d0i3_flags - d0i3 flags 13*bfcc09ddSBjoern A. Zeeb * @IWL_D0I3_RESET_REQUIRE: FW require reset upon resume 14*bfcc09ddSBjoern A. Zeeb */ 15*bfcc09ddSBjoern A. Zeeb enum iwl_d0i3_flags { 16*bfcc09ddSBjoern A. Zeeb IWL_D0I3_RESET_REQUIRE = BIT(0), 17*bfcc09ddSBjoern A. Zeeb }; 18*bfcc09ddSBjoern A. Zeeb 19*bfcc09ddSBjoern A. Zeeb /** 20*bfcc09ddSBjoern A. Zeeb * enum iwl_d3_wakeup_flags - D3 manager wakeup flags 21*bfcc09ddSBjoern A. Zeeb * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert 22*bfcc09ddSBjoern A. Zeeb */ 23*bfcc09ddSBjoern A. Zeeb enum iwl_d3_wakeup_flags { 24*bfcc09ddSBjoern A. Zeeb IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0), 25*bfcc09ddSBjoern A. Zeeb }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */ 26*bfcc09ddSBjoern A. Zeeb 27*bfcc09ddSBjoern A. Zeeb /** 28*bfcc09ddSBjoern A. Zeeb * struct iwl_d3_manager_config - D3 manager configuration command 29*bfcc09ddSBjoern A. Zeeb * @min_sleep_time: minimum sleep time (in usec) 30*bfcc09ddSBjoern A. Zeeb * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags 31*bfcc09ddSBjoern A. Zeeb * @wakeup_host_timer: force wakeup after this many seconds 32*bfcc09ddSBjoern A. Zeeb * 33*bfcc09ddSBjoern A. Zeeb * The structure is used for the D3_CONFIG_CMD command. 34*bfcc09ddSBjoern A. Zeeb */ 35*bfcc09ddSBjoern A. Zeeb struct iwl_d3_manager_config { 36*bfcc09ddSBjoern A. Zeeb __le32 min_sleep_time; 37*bfcc09ddSBjoern A. Zeeb __le32 wakeup_flags; 38*bfcc09ddSBjoern A. Zeeb __le32 wakeup_host_timer; 39*bfcc09ddSBjoern A. Zeeb } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */ 40*bfcc09ddSBjoern A. Zeeb 41*bfcc09ddSBjoern A. Zeeb 42*bfcc09ddSBjoern A. Zeeb /* TODO: OFFLOADS_QUERY_API_S_VER_1 */ 43*bfcc09ddSBjoern A. Zeeb 44*bfcc09ddSBjoern A. Zeeb /** 45*bfcc09ddSBjoern A. Zeeb * enum iwl_d3_proto_offloads - enabled protocol offloads 46*bfcc09ddSBjoern A. Zeeb * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled 47*bfcc09ddSBjoern A. Zeeb * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled 48*bfcc09ddSBjoern A. Zeeb * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid 49*bfcc09ddSBjoern A. Zeeb * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid 50*bfcc09ddSBjoern A. Zeeb */ 51*bfcc09ddSBjoern A. Zeeb enum iwl_proto_offloads { 52*bfcc09ddSBjoern A. Zeeb IWL_D3_PROTO_OFFLOAD_ARP = BIT(0), 53*bfcc09ddSBjoern A. Zeeb IWL_D3_PROTO_OFFLOAD_NS = BIT(1), 54*bfcc09ddSBjoern A. Zeeb IWL_D3_PROTO_IPV4_VALID = BIT(2), 55*bfcc09ddSBjoern A. Zeeb IWL_D3_PROTO_IPV6_VALID = BIT(3), 56*bfcc09ddSBjoern A. Zeeb }; 57*bfcc09ddSBjoern A. Zeeb 58*bfcc09ddSBjoern A. Zeeb #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2 59*bfcc09ddSBjoern A. Zeeb #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6 60*bfcc09ddSBjoern A. Zeeb #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 12 61*bfcc09ddSBjoern A. Zeeb #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 4 62*bfcc09ddSBjoern A. Zeeb #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 12 63*bfcc09ddSBjoern A. Zeeb 64*bfcc09ddSBjoern A. Zeeb #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4 65*bfcc09ddSBjoern A. Zeeb #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2 66*bfcc09ddSBjoern A. Zeeb 67*bfcc09ddSBjoern A. Zeeb /** 68*bfcc09ddSBjoern A. Zeeb * struct iwl_proto_offload_cmd_common - ARP/NS offload common part 69*bfcc09ddSBjoern A. Zeeb * @enabled: enable flags 70*bfcc09ddSBjoern A. Zeeb * @remote_ipv4_addr: remote address to answer to (or zero if all) 71*bfcc09ddSBjoern A. Zeeb * @host_ipv4_addr: our IPv4 address to respond to queries for 72*bfcc09ddSBjoern A. Zeeb * @arp_mac_addr: our MAC address for ARP responses 73*bfcc09ddSBjoern A. Zeeb * @reserved: unused 74*bfcc09ddSBjoern A. Zeeb */ 75*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_common { 76*bfcc09ddSBjoern A. Zeeb __le32 enabled; 77*bfcc09ddSBjoern A. Zeeb __be32 remote_ipv4_addr; 78*bfcc09ddSBjoern A. Zeeb __be32 host_ipv4_addr; 79*bfcc09ddSBjoern A. Zeeb u8 arp_mac_addr[ETH_ALEN]; 80*bfcc09ddSBjoern A. Zeeb __le16 reserved; 81*bfcc09ddSBjoern A. Zeeb } __packed; 82*bfcc09ddSBjoern A. Zeeb 83*bfcc09ddSBjoern A. Zeeb /** 84*bfcc09ddSBjoern A. Zeeb * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration 85*bfcc09ddSBjoern A. Zeeb * @common: common/IPv4 configuration 86*bfcc09ddSBjoern A. Zeeb * @remote_ipv6_addr: remote address to answer to (or zero if all) 87*bfcc09ddSBjoern A. Zeeb * @solicited_node_ipv6_addr: broken -- solicited node address exists 88*bfcc09ddSBjoern A. Zeeb * for each target address 89*bfcc09ddSBjoern A. Zeeb * @target_ipv6_addr: our target addresses 90*bfcc09ddSBjoern A. Zeeb * @ndp_mac_addr: neighbor solicitation response MAC address 91*bfcc09ddSBjoern A. Zeeb * @reserved2: reserved 92*bfcc09ddSBjoern A. Zeeb */ 93*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_v1 { 94*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_common common; 95*bfcc09ddSBjoern A. Zeeb u8 remote_ipv6_addr[16]; 96*bfcc09ddSBjoern A. Zeeb u8 solicited_node_ipv6_addr[16]; 97*bfcc09ddSBjoern A. Zeeb u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16]; 98*bfcc09ddSBjoern A. Zeeb u8 ndp_mac_addr[ETH_ALEN]; 99*bfcc09ddSBjoern A. Zeeb __le16 reserved2; 100*bfcc09ddSBjoern A. Zeeb } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */ 101*bfcc09ddSBjoern A. Zeeb 102*bfcc09ddSBjoern A. Zeeb /** 103*bfcc09ddSBjoern A. Zeeb * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration 104*bfcc09ddSBjoern A. Zeeb * @common: common/IPv4 configuration 105*bfcc09ddSBjoern A. Zeeb * @remote_ipv6_addr: remote address to answer to (or zero if all) 106*bfcc09ddSBjoern A. Zeeb * @solicited_node_ipv6_addr: broken -- solicited node address exists 107*bfcc09ddSBjoern A. Zeeb * for each target address 108*bfcc09ddSBjoern A. Zeeb * @target_ipv6_addr: our target addresses 109*bfcc09ddSBjoern A. Zeeb * @ndp_mac_addr: neighbor solicitation response MAC address 110*bfcc09ddSBjoern A. Zeeb * @num_valid_ipv6_addrs: number of valid IPv6 addresses 111*bfcc09ddSBjoern A. Zeeb * @reserved2: reserved 112*bfcc09ddSBjoern A. Zeeb */ 113*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_v2 { 114*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_common common; 115*bfcc09ddSBjoern A. Zeeb u8 remote_ipv6_addr[16]; 116*bfcc09ddSBjoern A. Zeeb u8 solicited_node_ipv6_addr[16]; 117*bfcc09ddSBjoern A. Zeeb u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16]; 118*bfcc09ddSBjoern A. Zeeb u8 ndp_mac_addr[ETH_ALEN]; 119*bfcc09ddSBjoern A. Zeeb u8 num_valid_ipv6_addrs; 120*bfcc09ddSBjoern A. Zeeb u8 reserved2[3]; 121*bfcc09ddSBjoern A. Zeeb } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */ 122*bfcc09ddSBjoern A. Zeeb 123*bfcc09ddSBjoern A. Zeeb struct iwl_ns_config { 124*bfcc09ddSBjoern A. Zeeb struct in6_addr source_ipv6_addr; 125*bfcc09ddSBjoern A. Zeeb struct in6_addr dest_ipv6_addr; 126*bfcc09ddSBjoern A. Zeeb u8 target_mac_addr[ETH_ALEN]; 127*bfcc09ddSBjoern A. Zeeb __le16 reserved; 128*bfcc09ddSBjoern A. Zeeb } __packed; /* NS_OFFLOAD_CONFIG */ 129*bfcc09ddSBjoern A. Zeeb 130*bfcc09ddSBjoern A. Zeeb struct iwl_targ_addr { 131*bfcc09ddSBjoern A. Zeeb struct in6_addr addr; 132*bfcc09ddSBjoern A. Zeeb __le32 config_num; 133*bfcc09ddSBjoern A. Zeeb } __packed; /* TARGET_IPV6_ADDRESS */ 134*bfcc09ddSBjoern A. Zeeb 135*bfcc09ddSBjoern A. Zeeb /** 136*bfcc09ddSBjoern A. Zeeb * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration 137*bfcc09ddSBjoern A. Zeeb * @common: common/IPv4 configuration 138*bfcc09ddSBjoern A. Zeeb * @num_valid_ipv6_addrs: number of valid IPv6 addresses 139*bfcc09ddSBjoern A. Zeeb * @targ_addrs: target IPv6 addresses 140*bfcc09ddSBjoern A. Zeeb * @ns_config: NS offload configurations 141*bfcc09ddSBjoern A. Zeeb */ 142*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_v3_small { 143*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_common common; 144*bfcc09ddSBjoern A. Zeeb __le32 num_valid_ipv6_addrs; 145*bfcc09ddSBjoern A. Zeeb struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S]; 146*bfcc09ddSBjoern A. Zeeb struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S]; 147*bfcc09ddSBjoern A. Zeeb } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */ 148*bfcc09ddSBjoern A. Zeeb 149*bfcc09ddSBjoern A. Zeeb /** 150*bfcc09ddSBjoern A. Zeeb * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration 151*bfcc09ddSBjoern A. Zeeb * @common: common/IPv4 configuration 152*bfcc09ddSBjoern A. Zeeb * @num_valid_ipv6_addrs: number of valid IPv6 addresses 153*bfcc09ddSBjoern A. Zeeb * @targ_addrs: target IPv6 addresses 154*bfcc09ddSBjoern A. Zeeb * @ns_config: NS offload configurations 155*bfcc09ddSBjoern A. Zeeb */ 156*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_v3_large { 157*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_common common; 158*bfcc09ddSBjoern A. Zeeb __le32 num_valid_ipv6_addrs; 159*bfcc09ddSBjoern A. Zeeb struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L]; 160*bfcc09ddSBjoern A. Zeeb struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L]; 161*bfcc09ddSBjoern A. Zeeb } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */ 162*bfcc09ddSBjoern A. Zeeb 163*bfcc09ddSBjoern A. Zeeb /** 164*bfcc09ddSBjoern A. Zeeb * struct iwl_proto_offload_cmd_v4 - ARP/NS offload configuration 165*bfcc09ddSBjoern A. Zeeb * @sta_id: station id 166*bfcc09ddSBjoern A. Zeeb * @common: common/IPv4 configuration 167*bfcc09ddSBjoern A. Zeeb * @num_valid_ipv6_addrs: number of valid IPv6 addresses 168*bfcc09ddSBjoern A. Zeeb * @targ_addrs: target IPv6 addresses 169*bfcc09ddSBjoern A. Zeeb * @ns_config: NS offload configurations 170*bfcc09ddSBjoern A. Zeeb */ 171*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_v4 { 172*bfcc09ddSBjoern A. Zeeb __le32 sta_id; 173*bfcc09ddSBjoern A. Zeeb struct iwl_proto_offload_cmd_common common; 174*bfcc09ddSBjoern A. Zeeb __le32 num_valid_ipv6_addrs; 175*bfcc09ddSBjoern A. Zeeb struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L]; 176*bfcc09ddSBjoern A. Zeeb struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L]; 177*bfcc09ddSBjoern A. Zeeb } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_4 */ 178*bfcc09ddSBjoern A. Zeeb 179*bfcc09ddSBjoern A. Zeeb /* 180*bfcc09ddSBjoern A. Zeeb * WOWLAN_PATTERNS 181*bfcc09ddSBjoern A. Zeeb */ 182*bfcc09ddSBjoern A. Zeeb #define IWL_WOWLAN_MIN_PATTERN_LEN 16 183*bfcc09ddSBjoern A. Zeeb #define IWL_WOWLAN_MAX_PATTERN_LEN 128 184*bfcc09ddSBjoern A. Zeeb 185*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_pattern_v1 { 186*bfcc09ddSBjoern A. Zeeb u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8]; 187*bfcc09ddSBjoern A. Zeeb u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN]; 188*bfcc09ddSBjoern A. Zeeb u8 mask_size; 189*bfcc09ddSBjoern A. Zeeb u8 pattern_size; 190*bfcc09ddSBjoern A. Zeeb __le16 reserved; 191*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */ 192*bfcc09ddSBjoern A. Zeeb 193*bfcc09ddSBjoern A. Zeeb #define IWL_WOWLAN_MAX_PATTERNS 20 194*bfcc09ddSBjoern A. Zeeb 195*bfcc09ddSBjoern A. Zeeb /** 196*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns 197*bfcc09ddSBjoern A. Zeeb */ 198*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_patterns_cmd_v1 { 199*bfcc09ddSBjoern A. Zeeb /** 200*bfcc09ddSBjoern A. Zeeb * @n_patterns: number of patterns 201*bfcc09ddSBjoern A. Zeeb */ 202*bfcc09ddSBjoern A. Zeeb __le32 n_patterns; 203*bfcc09ddSBjoern A. Zeeb 204*bfcc09ddSBjoern A. Zeeb /** 205*bfcc09ddSBjoern A. Zeeb * @patterns: the patterns, array length in @n_patterns 206*bfcc09ddSBjoern A. Zeeb */ 207*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_pattern_v1 patterns[]; 208*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */ 209*bfcc09ddSBjoern A. Zeeb 210*bfcc09ddSBjoern A. Zeeb #define IPV4_ADDR_SIZE 4 211*bfcc09ddSBjoern A. Zeeb #define IPV6_ADDR_SIZE 16 212*bfcc09ddSBjoern A. Zeeb 213*bfcc09ddSBjoern A. Zeeb enum iwl_wowlan_pattern_type { 214*bfcc09ddSBjoern A. Zeeb WOWLAN_PATTERN_TYPE_BITMASK, 215*bfcc09ddSBjoern A. Zeeb WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN, 216*bfcc09ddSBjoern A. Zeeb WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN, 217*bfcc09ddSBjoern A. Zeeb WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD, 218*bfcc09ddSBjoern A. Zeeb WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD, 219*bfcc09ddSBjoern A. Zeeb }; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */ 220*bfcc09ddSBjoern A. Zeeb 221*bfcc09ddSBjoern A. Zeeb /** 222*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data 223*bfcc09ddSBjoern A. Zeeb */ 224*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_ipv4_tcp_syn { 225*bfcc09ddSBjoern A. Zeeb /** 226*bfcc09ddSBjoern A. Zeeb * @src_addr: source IP address to match 227*bfcc09ddSBjoern A. Zeeb */ 228*bfcc09ddSBjoern A. Zeeb u8 src_addr[IPV4_ADDR_SIZE]; 229*bfcc09ddSBjoern A. Zeeb 230*bfcc09ddSBjoern A. Zeeb /** 231*bfcc09ddSBjoern A. Zeeb * @dst_addr: destination IP address to match 232*bfcc09ddSBjoern A. Zeeb */ 233*bfcc09ddSBjoern A. Zeeb u8 dst_addr[IPV4_ADDR_SIZE]; 234*bfcc09ddSBjoern A. Zeeb 235*bfcc09ddSBjoern A. Zeeb /** 236*bfcc09ddSBjoern A. Zeeb * @src_port: source TCP port to match 237*bfcc09ddSBjoern A. Zeeb */ 238*bfcc09ddSBjoern A. Zeeb __le16 src_port; 239*bfcc09ddSBjoern A. Zeeb 240*bfcc09ddSBjoern A. Zeeb /** 241*bfcc09ddSBjoern A. Zeeb * @dst_port: destination TCP port to match 242*bfcc09ddSBjoern A. Zeeb */ 243*bfcc09ddSBjoern A. Zeeb __le16 dst_port; 244*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */ 245*bfcc09ddSBjoern A. Zeeb 246*bfcc09ddSBjoern A. Zeeb /** 247*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data 248*bfcc09ddSBjoern A. Zeeb */ 249*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_ipv6_tcp_syn { 250*bfcc09ddSBjoern A. Zeeb /** 251*bfcc09ddSBjoern A. Zeeb * @src_addr: source IP address to match 252*bfcc09ddSBjoern A. Zeeb */ 253*bfcc09ddSBjoern A. Zeeb u8 src_addr[IPV6_ADDR_SIZE]; 254*bfcc09ddSBjoern A. Zeeb 255*bfcc09ddSBjoern A. Zeeb /** 256*bfcc09ddSBjoern A. Zeeb * @dst_addr: destination IP address to match 257*bfcc09ddSBjoern A. Zeeb */ 258*bfcc09ddSBjoern A. Zeeb u8 dst_addr[IPV6_ADDR_SIZE]; 259*bfcc09ddSBjoern A. Zeeb 260*bfcc09ddSBjoern A. Zeeb /** 261*bfcc09ddSBjoern A. Zeeb * @src_port: source TCP port to match 262*bfcc09ddSBjoern A. Zeeb */ 263*bfcc09ddSBjoern A. Zeeb __le16 src_port; 264*bfcc09ddSBjoern A. Zeeb 265*bfcc09ddSBjoern A. Zeeb /** 266*bfcc09ddSBjoern A. Zeeb * @dst_port: destination TCP port to match 267*bfcc09ddSBjoern A. Zeeb */ 268*bfcc09ddSBjoern A. Zeeb __le16 dst_port; 269*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */ 270*bfcc09ddSBjoern A. Zeeb 271*bfcc09ddSBjoern A. Zeeb /** 272*bfcc09ddSBjoern A. Zeeb * union iwl_wowlan_pattern_data - Data for the different pattern types 273*bfcc09ddSBjoern A. Zeeb * 274*bfcc09ddSBjoern A. Zeeb * If wildcard addresses/ports are to be used, the union can be left 275*bfcc09ddSBjoern A. Zeeb * undefined. 276*bfcc09ddSBjoern A. Zeeb */ 277*bfcc09ddSBjoern A. Zeeb union iwl_wowlan_pattern_data { 278*bfcc09ddSBjoern A. Zeeb /** 279*bfcc09ddSBjoern A. Zeeb * @bitmask: bitmask pattern data 280*bfcc09ddSBjoern A. Zeeb */ 281*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_pattern_v1 bitmask; 282*bfcc09ddSBjoern A. Zeeb 283*bfcc09ddSBjoern A. Zeeb /** 284*bfcc09ddSBjoern A. Zeeb * @ipv4_tcp_syn: IPv4 TCP SYN pattern data 285*bfcc09ddSBjoern A. Zeeb */ 286*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn; 287*bfcc09ddSBjoern A. Zeeb 288*bfcc09ddSBjoern A. Zeeb /** 289*bfcc09ddSBjoern A. Zeeb * @ipv6_tcp_syn: IPv6 TCP SYN pattern data 290*bfcc09ddSBjoern A. Zeeb */ 291*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn; 292*bfcc09ddSBjoern A. Zeeb }; /* WOWLAN_PATTERN_API_U_VER_1 */ 293*bfcc09ddSBjoern A. Zeeb 294*bfcc09ddSBjoern A. Zeeb /** 295*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns 296*bfcc09ddSBjoern A. Zeeb */ 297*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_pattern_v2 { 298*bfcc09ddSBjoern A. Zeeb /** 299*bfcc09ddSBjoern A. Zeeb * @pattern_type: defines the struct type to be used in the union 300*bfcc09ddSBjoern A. Zeeb */ 301*bfcc09ddSBjoern A. Zeeb u8 pattern_type; 302*bfcc09ddSBjoern A. Zeeb 303*bfcc09ddSBjoern A. Zeeb /** 304*bfcc09ddSBjoern A. Zeeb * @reserved: reserved for alignment 305*bfcc09ddSBjoern A. Zeeb */ 306*bfcc09ddSBjoern A. Zeeb u8 reserved[3]; 307*bfcc09ddSBjoern A. Zeeb 308*bfcc09ddSBjoern A. Zeeb /** 309*bfcc09ddSBjoern A. Zeeb * @u: the union containing the match data, or undefined for 310*bfcc09ddSBjoern A. Zeeb * wildcard matches 311*bfcc09ddSBjoern A. Zeeb */ 312*bfcc09ddSBjoern A. Zeeb union iwl_wowlan_pattern_data u; 313*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_PATTERN_API_S_VER_2 */ 314*bfcc09ddSBjoern A. Zeeb 315*bfcc09ddSBjoern A. Zeeb /** 316*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command 317*bfcc09ddSBjoern A. Zeeb */ 318*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_patterns_cmd { 319*bfcc09ddSBjoern A. Zeeb /** 320*bfcc09ddSBjoern A. Zeeb * @n_patterns: number of patterns 321*bfcc09ddSBjoern A. Zeeb */ 322*bfcc09ddSBjoern A. Zeeb u8 n_patterns; 323*bfcc09ddSBjoern A. Zeeb 324*bfcc09ddSBjoern A. Zeeb /** 325*bfcc09ddSBjoern A. Zeeb * @n_patterns: sta_id 326*bfcc09ddSBjoern A. Zeeb */ 327*bfcc09ddSBjoern A. Zeeb u8 sta_id; 328*bfcc09ddSBjoern A. Zeeb 329*bfcc09ddSBjoern A. Zeeb /** 330*bfcc09ddSBjoern A. Zeeb * @reserved: reserved for alignment 331*bfcc09ddSBjoern A. Zeeb */ 332*bfcc09ddSBjoern A. Zeeb __le16 reserved; 333*bfcc09ddSBjoern A. Zeeb 334*bfcc09ddSBjoern A. Zeeb /** 335*bfcc09ddSBjoern A. Zeeb * @patterns: the patterns, array length in @n_patterns 336*bfcc09ddSBjoern A. Zeeb */ 337*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_pattern_v2 patterns[]; 338*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_3 */ 339*bfcc09ddSBjoern A. Zeeb 340*bfcc09ddSBjoern A. Zeeb enum iwl_wowlan_wakeup_filters { 341*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0), 342*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1), 343*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2), 344*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3), 345*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4), 346*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5), 347*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6), 348*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7), 349*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8), 350*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9), 351*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10), 352*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11), 353*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12), 354*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13), 355*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14), 356*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15), 357*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16), 358*bfcc09ddSBjoern A. Zeeb }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */ 359*bfcc09ddSBjoern A. Zeeb 360*bfcc09ddSBjoern A. Zeeb enum iwl_wowlan_flags { 361*bfcc09ddSBjoern A. Zeeb IS_11W_ASSOC = BIT(0), 362*bfcc09ddSBjoern A. Zeeb ENABLE_L3_FILTERING = BIT(1), 363*bfcc09ddSBjoern A. Zeeb ENABLE_NBNS_FILTERING = BIT(2), 364*bfcc09ddSBjoern A. Zeeb ENABLE_DHCP_FILTERING = BIT(3), 365*bfcc09ddSBjoern A. Zeeb ENABLE_STORE_BEACON = BIT(4), 366*bfcc09ddSBjoern A. Zeeb }; 367*bfcc09ddSBjoern A. Zeeb 368*bfcc09ddSBjoern A. Zeeb /** 369*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_config_cmd - WoWLAN configuration (versions 5 and 6) 370*bfcc09ddSBjoern A. Zeeb * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters 371*bfcc09ddSBjoern A. Zeeb * @non_qos_seq: non-QoS sequence counter to use next. 372*bfcc09ddSBjoern A. Zeeb * Reserved if the struct has version >= 6. 373*bfcc09ddSBjoern A. Zeeb * @qos_seq: QoS sequence counters to use next 374*bfcc09ddSBjoern A. Zeeb * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down 375*bfcc09ddSBjoern A. Zeeb * @is_11n_connection: indicates HT connection 376*bfcc09ddSBjoern A. Zeeb * @offloading_tid: TID reserved for firmware use 377*bfcc09ddSBjoern A. Zeeb * @flags: extra flags, see &enum iwl_wowlan_flags 378*bfcc09ddSBjoern A. Zeeb * @sta_id: station ID for wowlan. 379*bfcc09ddSBjoern A. Zeeb * @reserved: reserved 380*bfcc09ddSBjoern A. Zeeb */ 381*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_config_cmd { 382*bfcc09ddSBjoern A. Zeeb __le32 wakeup_filter; 383*bfcc09ddSBjoern A. Zeeb __le16 non_qos_seq; 384*bfcc09ddSBjoern A. Zeeb __le16 qos_seq[8]; 385*bfcc09ddSBjoern A. Zeeb u8 wowlan_ba_teardown_tids; 386*bfcc09ddSBjoern A. Zeeb u8 is_11n_connection; 387*bfcc09ddSBjoern A. Zeeb u8 offloading_tid; 388*bfcc09ddSBjoern A. Zeeb u8 flags; 389*bfcc09ddSBjoern A. Zeeb u8 sta_id; 390*bfcc09ddSBjoern A. Zeeb u8 reserved; 391*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_CONFIG_API_S_VER_5 */ 392*bfcc09ddSBjoern A. Zeeb 393*bfcc09ddSBjoern A. Zeeb #define IWL_NUM_RSC 16 394*bfcc09ddSBjoern A. Zeeb #define WOWLAN_KEY_MAX_SIZE 32 395*bfcc09ddSBjoern A. Zeeb #define WOWLAN_GTK_KEYS_NUM 2 396*bfcc09ddSBjoern A. Zeeb #define WOWLAN_IGTK_KEYS_NUM 2 397*bfcc09ddSBjoern A. Zeeb 398*bfcc09ddSBjoern A. Zeeb /* 399*bfcc09ddSBjoern A. Zeeb * WOWLAN_TSC_RSC_PARAMS 400*bfcc09ddSBjoern A. Zeeb */ 401*bfcc09ddSBjoern A. Zeeb struct tkip_sc { 402*bfcc09ddSBjoern A. Zeeb __le16 iv16; 403*bfcc09ddSBjoern A. Zeeb __le16 pad; 404*bfcc09ddSBjoern A. Zeeb __le32 iv32; 405*bfcc09ddSBjoern A. Zeeb } __packed; /* TKIP_SC_API_U_VER_1 */ 406*bfcc09ddSBjoern A. Zeeb 407*bfcc09ddSBjoern A. Zeeb struct iwl_tkip_rsc_tsc { 408*bfcc09ddSBjoern A. Zeeb struct tkip_sc unicast_rsc[IWL_NUM_RSC]; 409*bfcc09ddSBjoern A. Zeeb struct tkip_sc multicast_rsc[IWL_NUM_RSC]; 410*bfcc09ddSBjoern A. Zeeb struct tkip_sc tsc; 411*bfcc09ddSBjoern A. Zeeb } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */ 412*bfcc09ddSBjoern A. Zeeb 413*bfcc09ddSBjoern A. Zeeb struct aes_sc { 414*bfcc09ddSBjoern A. Zeeb __le64 pn; 415*bfcc09ddSBjoern A. Zeeb } __packed; /* TKIP_AES_SC_API_U_VER_1 */ 416*bfcc09ddSBjoern A. Zeeb 417*bfcc09ddSBjoern A. Zeeb struct iwl_aes_rsc_tsc { 418*bfcc09ddSBjoern A. Zeeb struct aes_sc unicast_rsc[IWL_NUM_RSC]; 419*bfcc09ddSBjoern A. Zeeb struct aes_sc multicast_rsc[IWL_NUM_RSC]; 420*bfcc09ddSBjoern A. Zeeb struct aes_sc tsc; 421*bfcc09ddSBjoern A. Zeeb } __packed; /* AES_TSC_RSC_API_S_VER_1 */ 422*bfcc09ddSBjoern A. Zeeb 423*bfcc09ddSBjoern A. Zeeb union iwl_all_tsc_rsc { 424*bfcc09ddSBjoern A. Zeeb struct iwl_tkip_rsc_tsc tkip; 425*bfcc09ddSBjoern A. Zeeb struct iwl_aes_rsc_tsc aes; 426*bfcc09ddSBjoern A. Zeeb }; /* ALL_TSC_RSC_API_S_VER_2 */ 427*bfcc09ddSBjoern A. Zeeb 428*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 { 429*bfcc09ddSBjoern A. Zeeb union iwl_all_tsc_rsc all_tsc_rsc; 430*bfcc09ddSBjoern A. Zeeb } __packed; /* ALL_TSC_RSC_API_S_VER_2 */ 431*bfcc09ddSBjoern A. Zeeb 432*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_rsc_tsc_params_cmd_v4 { 433*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 params; 434*bfcc09ddSBjoern A. Zeeb __le32 sta_id; 435*bfcc09ddSBjoern A. Zeeb } __packed; /* ALL_TSC_RSC_API_S_VER_4 */ 436*bfcc09ddSBjoern A. Zeeb 437*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_rsc_tsc_params_cmd { 438*bfcc09ddSBjoern A. Zeeb __le64 ucast_rsc[IWL_MAX_TID_COUNT]; 439*bfcc09ddSBjoern A. Zeeb __le64 mcast_rsc[WOWLAN_GTK_KEYS_NUM][IWL_MAX_TID_COUNT]; 440*bfcc09ddSBjoern A. Zeeb __le32 sta_id; 441*bfcc09ddSBjoern A. Zeeb #define IWL_MCAST_KEY_MAP_INVALID 0xff 442*bfcc09ddSBjoern A. Zeeb u8 mcast_key_id_map[4]; 443*bfcc09ddSBjoern A. Zeeb } __packed; /* ALL_TSC_RSC_API_S_VER_5 */ 444*bfcc09ddSBjoern A. Zeeb 445*bfcc09ddSBjoern A. Zeeb #define IWL_MIC_KEY_SIZE 8 446*bfcc09ddSBjoern A. Zeeb struct iwl_mic_keys { 447*bfcc09ddSBjoern A. Zeeb u8 tx[IWL_MIC_KEY_SIZE]; 448*bfcc09ddSBjoern A. Zeeb u8 rx_unicast[IWL_MIC_KEY_SIZE]; 449*bfcc09ddSBjoern A. Zeeb u8 rx_mcast[IWL_MIC_KEY_SIZE]; 450*bfcc09ddSBjoern A. Zeeb } __packed; /* MIC_KEYS_API_S_VER_1 */ 451*bfcc09ddSBjoern A. Zeeb 452*bfcc09ddSBjoern A. Zeeb #define IWL_P1K_SIZE 5 453*bfcc09ddSBjoern A. Zeeb struct iwl_p1k_cache { 454*bfcc09ddSBjoern A. Zeeb __le16 p1k[IWL_P1K_SIZE]; 455*bfcc09ddSBjoern A. Zeeb } __packed; 456*bfcc09ddSBjoern A. Zeeb 457*bfcc09ddSBjoern A. Zeeb #define IWL_NUM_RX_P1K_CACHE 2 458*bfcc09ddSBjoern A. Zeeb 459*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_tkip_params_cmd_ver_1 { 460*bfcc09ddSBjoern A. Zeeb struct iwl_mic_keys mic_keys; 461*bfcc09ddSBjoern A. Zeeb struct iwl_p1k_cache tx; 462*bfcc09ddSBjoern A. Zeeb struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE]; 463*bfcc09ddSBjoern A. Zeeb struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE]; 464*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */ 465*bfcc09ddSBjoern A. Zeeb 466*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_tkip_params_cmd { 467*bfcc09ddSBjoern A. Zeeb struct iwl_mic_keys mic_keys; 468*bfcc09ddSBjoern A. Zeeb struct iwl_p1k_cache tx; 469*bfcc09ddSBjoern A. Zeeb struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE]; 470*bfcc09ddSBjoern A. Zeeb struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE]; 471*bfcc09ddSBjoern A. Zeeb u8 reversed[2]; 472*bfcc09ddSBjoern A. Zeeb __le32 sta_id; 473*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */ 474*bfcc09ddSBjoern A. Zeeb 475*bfcc09ddSBjoern A. Zeeb #define IWL_KCK_MAX_SIZE 32 476*bfcc09ddSBjoern A. Zeeb #define IWL_KEK_MAX_SIZE 32 477*bfcc09ddSBjoern A. Zeeb 478*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_kek_kck_material_cmd_v2 { 479*bfcc09ddSBjoern A. Zeeb u8 kck[IWL_KCK_MAX_SIZE]; 480*bfcc09ddSBjoern A. Zeeb u8 kek[IWL_KEK_MAX_SIZE]; 481*bfcc09ddSBjoern A. Zeeb __le16 kck_len; 482*bfcc09ddSBjoern A. Zeeb __le16 kek_len; 483*bfcc09ddSBjoern A. Zeeb __le64 replay_ctr; 484*bfcc09ddSBjoern A. Zeeb } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */ 485*bfcc09ddSBjoern A. Zeeb 486*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_kek_kck_material_cmd_v3 { 487*bfcc09ddSBjoern A. Zeeb u8 kck[IWL_KCK_MAX_SIZE]; 488*bfcc09ddSBjoern A. Zeeb u8 kek[IWL_KEK_MAX_SIZE]; 489*bfcc09ddSBjoern A. Zeeb __le16 kck_len; 490*bfcc09ddSBjoern A. Zeeb __le16 kek_len; 491*bfcc09ddSBjoern A. Zeeb __le64 replay_ctr; 492*bfcc09ddSBjoern A. Zeeb __le32 akm; 493*bfcc09ddSBjoern A. Zeeb __le32 gtk_cipher; 494*bfcc09ddSBjoern A. Zeeb __le32 igtk_cipher; 495*bfcc09ddSBjoern A. Zeeb __le32 bigtk_cipher; 496*bfcc09ddSBjoern A. Zeeb } __packed; /* KEK_KCK_MATERIAL_API_S_VER_3 */ 497*bfcc09ddSBjoern A. Zeeb 498*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_kek_kck_material_cmd_v4 { 499*bfcc09ddSBjoern A. Zeeb __le32 sta_id; 500*bfcc09ddSBjoern A. Zeeb u8 kck[IWL_KCK_MAX_SIZE]; 501*bfcc09ddSBjoern A. Zeeb u8 kek[IWL_KEK_MAX_SIZE]; 502*bfcc09ddSBjoern A. Zeeb __le16 kck_len; 503*bfcc09ddSBjoern A. Zeeb __le16 kek_len; 504*bfcc09ddSBjoern A. Zeeb __le64 replay_ctr; 505*bfcc09ddSBjoern A. Zeeb __le32 akm; 506*bfcc09ddSBjoern A. Zeeb __le32 gtk_cipher; 507*bfcc09ddSBjoern A. Zeeb __le32 igtk_cipher; 508*bfcc09ddSBjoern A. Zeeb __le32 bigtk_cipher; 509*bfcc09ddSBjoern A. Zeeb } __packed; /* KEK_KCK_MATERIAL_API_S_VER_4 */ 510*bfcc09ddSBjoern A. Zeeb 511*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_get_status_cmd { 512*bfcc09ddSBjoern A. Zeeb __le32 sta_id; 513*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_GET_STATUSES_CMD_API_S_VER_1 */ 514*bfcc09ddSBjoern A. Zeeb 515*bfcc09ddSBjoern A. Zeeb #define RF_KILL_INDICATOR_FOR_WOWLAN 0x87 516*bfcc09ddSBjoern A. Zeeb 517*bfcc09ddSBjoern A. Zeeb enum iwl_wowlan_rekey_status { 518*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_REKEY_POST_REKEY = 0, 519*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_REKEY_WHILE_REKEY = 1, 520*bfcc09ddSBjoern A. Zeeb }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */ 521*bfcc09ddSBjoern A. Zeeb 522*bfcc09ddSBjoern A. Zeeb enum iwl_wowlan_wakeup_reason { 523*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0, 524*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0), 525*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1), 526*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2), 527*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3), 528*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4), 529*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5), 530*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6), 531*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7), 532*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8), 533*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9), 534*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10), 535*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11), 536*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12), 537*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13), 538*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14), 539*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15), 540*bfcc09ddSBjoern A. Zeeb IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16), 541*bfcc09ddSBjoern A. Zeeb IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT(17), 542*bfcc09ddSBjoern A. Zeeb IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT(18), 543*bfcc09ddSBjoern A. Zeeb IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT(19), 544*bfcc09ddSBjoern A. Zeeb IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT(20), 545*bfcc09ddSBjoern A. Zeeb IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT(21), 546*bfcc09ddSBjoern A. Zeeb }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */ 547*bfcc09ddSBjoern A. Zeeb 548*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_gtk_status_v1 { 549*bfcc09ddSBjoern A. Zeeb u8 key_index; 550*bfcc09ddSBjoern A. Zeeb u8 reserved[3]; 551*bfcc09ddSBjoern A. Zeeb u8 decrypt_key[16]; 552*bfcc09ddSBjoern A. Zeeb u8 tkip_mic_key[8]; 553*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc; 554*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */ 555*bfcc09ddSBjoern A. Zeeb 556*bfcc09ddSBjoern A. Zeeb /** 557*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_gtk_status - GTK status 558*bfcc09ddSBjoern A. Zeeb * @key: GTK material 559*bfcc09ddSBjoern A. Zeeb * @key_len: GTK legth, if set to 0, the key is not available 560*bfcc09ddSBjoern A. Zeeb * @key_flags: information about the key: 561*bfcc09ddSBjoern A. Zeeb * bits[0:1]: key index assigned by the AP 562*bfcc09ddSBjoern A. Zeeb * bits[2:6]: GTK index of the key in the internal DB 563*bfcc09ddSBjoern A. Zeeb * bit[7]: Set iff this is the currently used GTK 564*bfcc09ddSBjoern A. Zeeb * @reserved: padding 565*bfcc09ddSBjoern A. Zeeb * @tkip_mic_key: TKIP RX MIC key 566*bfcc09ddSBjoern A. Zeeb * @rsc: TSC RSC counters 567*bfcc09ddSBjoern A. Zeeb */ 568*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_gtk_status { 569*bfcc09ddSBjoern A. Zeeb u8 key[WOWLAN_KEY_MAX_SIZE]; 570*bfcc09ddSBjoern A. Zeeb u8 key_len; 571*bfcc09ddSBjoern A. Zeeb u8 key_flags; 572*bfcc09ddSBjoern A. Zeeb u8 reserved[2]; 573*bfcc09ddSBjoern A. Zeeb u8 tkip_mic_key[8]; 574*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc; 575*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */ 576*bfcc09ddSBjoern A. Zeeb 577*bfcc09ddSBjoern A. Zeeb #define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1)) 578*bfcc09ddSBjoern A. Zeeb 579*bfcc09ddSBjoern A. Zeeb /** 580*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_igtk_status - IGTK status 581*bfcc09ddSBjoern A. Zeeb * @key: IGTK material 582*bfcc09ddSBjoern A. Zeeb * @ipn: the IGTK packet number (replay counter) 583*bfcc09ddSBjoern A. Zeeb * @key_len: IGTK length, if set to 0, the key is not available 584*bfcc09ddSBjoern A. Zeeb * @key_flags: information about the key: 585*bfcc09ddSBjoern A. Zeeb * bits[0]: key index assigned by the AP (0: index 4, 1: index 5) 586*bfcc09ddSBjoern A. Zeeb * bits[1:5]: IGTK index of the key in the internal DB 587*bfcc09ddSBjoern A. Zeeb * bit[6]: Set iff this is the currently used IGTK 588*bfcc09ddSBjoern A. Zeeb */ 589*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_igtk_status { 590*bfcc09ddSBjoern A. Zeeb u8 key[WOWLAN_KEY_MAX_SIZE]; 591*bfcc09ddSBjoern A. Zeeb u8 ipn[6]; 592*bfcc09ddSBjoern A. Zeeb u8 key_len; 593*bfcc09ddSBjoern A. Zeeb u8 key_flags; 594*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */ 595*bfcc09ddSBjoern A. Zeeb 596*bfcc09ddSBjoern A. Zeeb /** 597*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_status_v6 - WoWLAN status 598*bfcc09ddSBjoern A. Zeeb * @gtk: GTK data 599*bfcc09ddSBjoern A. Zeeb * @replay_ctr: GTK rekey replay counter 600*bfcc09ddSBjoern A. Zeeb * @pattern_number: number of the matched pattern 601*bfcc09ddSBjoern A. Zeeb * @non_qos_seq_ctr: non-QoS sequence counter to use next 602*bfcc09ddSBjoern A. Zeeb * @qos_seq_ctr: QoS sequence counters to use next 603*bfcc09ddSBjoern A. Zeeb * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 604*bfcc09ddSBjoern A. Zeeb * @num_of_gtk_rekeys: number of GTK rekeys 605*bfcc09ddSBjoern A. Zeeb * @transmitted_ndps: number of transmitted neighbor discovery packets 606*bfcc09ddSBjoern A. Zeeb * @received_beacons: number of received beacons 607*bfcc09ddSBjoern A. Zeeb * @wake_packet_length: wakeup packet length 608*bfcc09ddSBjoern A. Zeeb * @wake_packet_bufsize: wakeup packet buffer size 609*bfcc09ddSBjoern A. Zeeb * @wake_packet: wakeup packet 610*bfcc09ddSBjoern A. Zeeb */ 611*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_status_v6 { 612*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_gtk_status_v1 gtk; 613*bfcc09ddSBjoern A. Zeeb __le64 replay_ctr; 614*bfcc09ddSBjoern A. Zeeb __le16 pattern_number; 615*bfcc09ddSBjoern A. Zeeb __le16 non_qos_seq_ctr; 616*bfcc09ddSBjoern A. Zeeb __le16 qos_seq_ctr[8]; 617*bfcc09ddSBjoern A. Zeeb __le32 wakeup_reasons; 618*bfcc09ddSBjoern A. Zeeb __le32 num_of_gtk_rekeys; 619*bfcc09ddSBjoern A. Zeeb __le32 transmitted_ndps; 620*bfcc09ddSBjoern A. Zeeb __le32 received_beacons; 621*bfcc09ddSBjoern A. Zeeb __le32 wake_packet_length; 622*bfcc09ddSBjoern A. Zeeb __le32 wake_packet_bufsize; 623*bfcc09ddSBjoern A. Zeeb u8 wake_packet[]; /* can be truncated from _length to _bufsize */ 624*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */ 625*bfcc09ddSBjoern A. Zeeb 626*bfcc09ddSBjoern A. Zeeb /** 627*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_status_v7 - WoWLAN status 628*bfcc09ddSBjoern A. Zeeb * @gtk: GTK data 629*bfcc09ddSBjoern A. Zeeb * @igtk: IGTK data 630*bfcc09ddSBjoern A. Zeeb * @replay_ctr: GTK rekey replay counter 631*bfcc09ddSBjoern A. Zeeb * @pattern_number: number of the matched pattern 632*bfcc09ddSBjoern A. Zeeb * @non_qos_seq_ctr: non-QoS sequence counter to use next 633*bfcc09ddSBjoern A. Zeeb * @qos_seq_ctr: QoS sequence counters to use next 634*bfcc09ddSBjoern A. Zeeb * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 635*bfcc09ddSBjoern A. Zeeb * @num_of_gtk_rekeys: number of GTK rekeys 636*bfcc09ddSBjoern A. Zeeb * @transmitted_ndps: number of transmitted neighbor discovery packets 637*bfcc09ddSBjoern A. Zeeb * @received_beacons: number of received beacons 638*bfcc09ddSBjoern A. Zeeb * @wake_packet_length: wakeup packet length 639*bfcc09ddSBjoern A. Zeeb * @wake_packet_bufsize: wakeup packet buffer size 640*bfcc09ddSBjoern A. Zeeb * @wake_packet: wakeup packet 641*bfcc09ddSBjoern A. Zeeb */ 642*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_status_v7 { 643*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM]; 644*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM]; 645*bfcc09ddSBjoern A. Zeeb __le64 replay_ctr; 646*bfcc09ddSBjoern A. Zeeb __le16 pattern_number; 647*bfcc09ddSBjoern A. Zeeb __le16 non_qos_seq_ctr; 648*bfcc09ddSBjoern A. Zeeb __le16 qos_seq_ctr[8]; 649*bfcc09ddSBjoern A. Zeeb __le32 wakeup_reasons; 650*bfcc09ddSBjoern A. Zeeb __le32 num_of_gtk_rekeys; 651*bfcc09ddSBjoern A. Zeeb __le32 transmitted_ndps; 652*bfcc09ddSBjoern A. Zeeb __le32 received_beacons; 653*bfcc09ddSBjoern A. Zeeb __le32 wake_packet_length; 654*bfcc09ddSBjoern A. Zeeb __le32 wake_packet_bufsize; 655*bfcc09ddSBjoern A. Zeeb u8 wake_packet[]; /* can be truncated from _length to _bufsize */ 656*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_STATUSES_API_S_VER_7 */ 657*bfcc09ddSBjoern A. Zeeb 658*bfcc09ddSBjoern A. Zeeb /** 659*bfcc09ddSBjoern A. Zeeb * struct iwl_wowlan_status_v9 - WoWLAN status (versions 9 and 10) 660*bfcc09ddSBjoern A. Zeeb * @gtk: GTK data 661*bfcc09ddSBjoern A. Zeeb * @igtk: IGTK data 662*bfcc09ddSBjoern A. Zeeb * @replay_ctr: GTK rekey replay counter 663*bfcc09ddSBjoern A. Zeeb * @pattern_number: number of the matched pattern 664*bfcc09ddSBjoern A. Zeeb * @non_qos_seq_ctr: non-QoS sequence counter to use next. 665*bfcc09ddSBjoern A. Zeeb * Reserved if the struct has version >= 10. 666*bfcc09ddSBjoern A. Zeeb * @qos_seq_ctr: QoS sequence counters to use next 667*bfcc09ddSBjoern A. Zeeb * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason 668*bfcc09ddSBjoern A. Zeeb * @num_of_gtk_rekeys: number of GTK rekeys 669*bfcc09ddSBjoern A. Zeeb * @transmitted_ndps: number of transmitted neighbor discovery packets 670*bfcc09ddSBjoern A. Zeeb * @received_beacons: number of received beacons 671*bfcc09ddSBjoern A. Zeeb * @wake_packet_length: wakeup packet length 672*bfcc09ddSBjoern A. Zeeb * @wake_packet_bufsize: wakeup packet buffer size 673*bfcc09ddSBjoern A. Zeeb * @tid_tear_down: bit mask of tids whose BA sessions were closed 674*bfcc09ddSBjoern A. Zeeb * in suspend state 675*bfcc09ddSBjoern A. Zeeb * @reserved: unused 676*bfcc09ddSBjoern A. Zeeb * @wake_packet: wakeup packet 677*bfcc09ddSBjoern A. Zeeb */ 678*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_status_v9 { 679*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM]; 680*bfcc09ddSBjoern A. Zeeb struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM]; 681*bfcc09ddSBjoern A. Zeeb __le64 replay_ctr; 682*bfcc09ddSBjoern A. Zeeb __le16 pattern_number; 683*bfcc09ddSBjoern A. Zeeb __le16 non_qos_seq_ctr; 684*bfcc09ddSBjoern A. Zeeb __le16 qos_seq_ctr[8]; 685*bfcc09ddSBjoern A. Zeeb __le32 wakeup_reasons; 686*bfcc09ddSBjoern A. Zeeb __le32 num_of_gtk_rekeys; 687*bfcc09ddSBjoern A. Zeeb __le32 transmitted_ndps; 688*bfcc09ddSBjoern A. Zeeb __le32 received_beacons; 689*bfcc09ddSBjoern A. Zeeb __le32 wake_packet_length; 690*bfcc09ddSBjoern A. Zeeb __le32 wake_packet_bufsize; 691*bfcc09ddSBjoern A. Zeeb u8 tid_tear_down; 692*bfcc09ddSBjoern A. Zeeb u8 reserved[3]; 693*bfcc09ddSBjoern A. Zeeb u8 wake_packet[]; /* can be truncated from _length to _bufsize */ 694*bfcc09ddSBjoern A. Zeeb } __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_9 */ 695*bfcc09ddSBjoern A. Zeeb 696*bfcc09ddSBjoern A. Zeeb /* TODO: NetDetect API */ 697*bfcc09ddSBjoern A. Zeeb 698*bfcc09ddSBjoern A. Zeeb #endif /* __iwl_fw_api_d3_h__ */ 699