Linux Audio

Check our new training course

Loading...
v6.13.7
   1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
   2/*
   3 * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
   4 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
   5 * Copyright (C) 2015-2017 Intel Deutschland GmbH
   6 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   7#ifndef __iwl_fw_api_d3_h__
   8#define __iwl_fw_api_d3_h__
   9#include <iwl-trans.h>
  10
  11/**
  12 * enum iwl_d0i3_flags - d0i3 flags
  13 * @IWL_D0I3_RESET_REQUIRE: FW require reset upon resume
  14 */
  15enum iwl_d0i3_flags {
  16	IWL_D0I3_RESET_REQUIRE = BIT(0),
  17};
  18
  19/**
  20 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
  21 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
  22 */
  23enum iwl_d3_wakeup_flags {
  24	IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
  25}; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
  26
  27/**
  28 * struct iwl_d3_manager_config - D3 manager configuration command
  29 * @min_sleep_time: minimum sleep time (in usec)
  30 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
  31 * @wakeup_host_timer: force wakeup after this many seconds
  32 *
  33 * The structure is used for the D3_CONFIG_CMD command.
  34 */
  35struct iwl_d3_manager_config {
  36	__le32 min_sleep_time;
  37	__le32 wakeup_flags;
  38	__le32 wakeup_host_timer;
  39} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
  40
  41
  42/* TODO: OFFLOADS_QUERY_API_S_VER_1 */
  43
  44/**
  45 * enum iwl_proto_offloads - enabled protocol offloads
  46 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
  47 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
  48 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
  49 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
  50 * @IWL_D3_PROTO_OFFLOAD_BTM: BTM offload is enabled
  51 */
  52enum iwl_proto_offloads {
  53	IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
  54	IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
  55	IWL_D3_PROTO_IPV4_VALID = BIT(2),
  56	IWL_D3_PROTO_IPV6_VALID = BIT(3),
  57	IWL_D3_PROTO_OFFLOAD_BTM = BIT(4),
  58};
  59
  60#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1	2
  61#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2	6
  62#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L	12
  63#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S	4
  64#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX	12
  65
  66#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L	4
  67#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S	2
  68
  69/**
  70 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
  71 * @enabled: enable flags
  72 * @remote_ipv4_addr: remote address to answer to (or zero if all)
  73 * @host_ipv4_addr: our IPv4 address to respond to queries for
  74 * @arp_mac_addr: our MAC address for ARP responses
  75 * @reserved: unused
  76 */
  77struct iwl_proto_offload_cmd_common {
  78	__le32 enabled;
  79	__be32 remote_ipv4_addr;
  80	__be32 host_ipv4_addr;
  81	u8 arp_mac_addr[ETH_ALEN];
  82	__le16 reserved;
  83} __packed;
  84
  85/**
  86 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
  87 * @common: common/IPv4 configuration
  88 * @remote_ipv6_addr: remote address to answer to (or zero if all)
  89 * @solicited_node_ipv6_addr: broken -- solicited node address exists
  90 *	for each target address
  91 * @target_ipv6_addr: our target addresses
  92 * @ndp_mac_addr: neighbor solicitation response MAC address
  93 * @reserved2: reserved
  94 */
  95struct iwl_proto_offload_cmd_v1 {
  96	struct iwl_proto_offload_cmd_common common;
  97	u8 remote_ipv6_addr[16];
  98	u8 solicited_node_ipv6_addr[16];
  99	u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
 100	u8 ndp_mac_addr[ETH_ALEN];
 101	__le16 reserved2;
 102} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
 103
 104/**
 105 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
 106 * @common: common/IPv4 configuration
 107 * @remote_ipv6_addr: remote address to answer to (or zero if all)
 108 * @solicited_node_ipv6_addr: broken -- solicited node address exists
 109 *	for each target address
 110 * @target_ipv6_addr: our target addresses
 111 * @ndp_mac_addr: neighbor solicitation response MAC address
 112 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 113 * @reserved2: reserved
 114 */
 115struct iwl_proto_offload_cmd_v2 {
 116	struct iwl_proto_offload_cmd_common common;
 117	u8 remote_ipv6_addr[16];
 118	u8 solicited_node_ipv6_addr[16];
 119	u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
 120	u8 ndp_mac_addr[ETH_ALEN];
 121	u8 num_valid_ipv6_addrs;
 122	u8 reserved2[3];
 123} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
 124
 125struct iwl_ns_config {
 126	struct in6_addr source_ipv6_addr;
 127	struct in6_addr dest_ipv6_addr;
 128	u8 target_mac_addr[ETH_ALEN];
 129	__le16 reserved;
 130} __packed; /* NS_OFFLOAD_CONFIG */
 131
 132struct iwl_targ_addr {
 133	struct in6_addr addr;
 134	__le32 config_num;
 135} __packed; /* TARGET_IPV6_ADDRESS */
 136
 137/**
 138 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
 139 * @common: common/IPv4 configuration
 140 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 141 * @targ_addrs: target IPv6 addresses
 142 * @ns_config: NS offload configurations
 143 */
 144struct iwl_proto_offload_cmd_v3_small {
 145	struct iwl_proto_offload_cmd_common common;
 146	__le32 num_valid_ipv6_addrs;
 147	struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
 148	struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
 149} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
 150
 151/**
 152 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
 153 * @common: common/IPv4 configuration
 154 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 155 * @targ_addrs: target IPv6 addresses
 156 * @ns_config: NS offload configurations
 157 */
 158struct iwl_proto_offload_cmd_v3_large {
 159	struct iwl_proto_offload_cmd_common common;
 160	__le32 num_valid_ipv6_addrs;
 161	struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
 162	struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
 163} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
 164
 165/**
 166 * struct iwl_proto_offload_cmd_v4 - ARP/NS offload configuration
 167 * @sta_id: station id
 168 * @common: common/IPv4 configuration
 169 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 170 * @targ_addrs: target IPv6 addresses
 171 * @ns_config: NS offload configurations
 172 */
 173struct iwl_proto_offload_cmd_v4 {
 174	__le32 sta_id;
 175	struct iwl_proto_offload_cmd_common common;
 176	__le32 num_valid_ipv6_addrs;
 177	struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
 178	struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
 179} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_4 */
 180
 181/*
 182 * WOWLAN_PATTERNS
 183 */
 184#define IWL_WOWLAN_MIN_PATTERN_LEN	16
 185#define IWL_WOWLAN_MAX_PATTERN_LEN	128
 186
 187struct iwl_wowlan_pattern_v1 {
 188	u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
 189	u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
 190	u8 mask_size;
 191	u8 pattern_size;
 192	__le16 reserved;
 193} __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
 194
 195#define IWL_WOWLAN_MAX_PATTERNS	20
 196
 197/**
 198 * struct iwl_wowlan_patterns_cmd_v1 - WoWLAN wakeup patterns
 199 */
 200struct iwl_wowlan_patterns_cmd_v1 {
 201	/**
 202	 * @n_patterns: number of patterns
 203	 */
 204	__le32 n_patterns;
 205
 206	/**
 207	 * @patterns: the patterns, array length in @n_patterns
 208	 */
 209	struct iwl_wowlan_pattern_v1 patterns[];
 210} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
 211
 212#define IPV4_ADDR_SIZE	4
 213#define IPV6_ADDR_SIZE	16
 214
 215enum iwl_wowlan_pattern_type {
 216	WOWLAN_PATTERN_TYPE_BITMASK,
 217	WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN,
 218	WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN,
 219	WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD,
 220	WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD,
 221}; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */
 222
 223/**
 224 * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data
 225 */
 226struct iwl_wowlan_ipv4_tcp_syn {
 227	/**
 228	 * @src_addr: source IP address to match
 229	 */
 230	u8 src_addr[IPV4_ADDR_SIZE];
 231
 232	/**
 233	 * @dst_addr: destination IP address to match
 234	 */
 235	u8 dst_addr[IPV4_ADDR_SIZE];
 236
 237	/**
 238	 * @src_port: source TCP port to match
 239	 */
 240	__le16 src_port;
 241
 242	/**
 243	 * @dst_port: destination TCP port to match
 244	 */
 245	__le16 dst_port;
 246} __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */
 247
 248/**
 249 * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data
 250 */
 251struct iwl_wowlan_ipv6_tcp_syn {
 252	/**
 253	 * @src_addr: source IP address to match
 254	 */
 255	u8 src_addr[IPV6_ADDR_SIZE];
 256
 257	/**
 258	 * @dst_addr: destination IP address to match
 259	 */
 260	u8 dst_addr[IPV6_ADDR_SIZE];
 261
 262	/**
 263	 * @src_port: source TCP port to match
 264	 */
 265	__le16 src_port;
 266
 267	/**
 268	 * @dst_port: destination TCP port to match
 269	 */
 270	__le16 dst_port;
 271} __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */
 272
 273/**
 274 * union iwl_wowlan_pattern_data - Data for the different pattern types
 275 *
 276 * If wildcard addresses/ports are to be used, the union can be left
 277 * undefined.
 278 */
 279union iwl_wowlan_pattern_data {
 280	/**
 281	 * @bitmask: bitmask pattern data
 282	 */
 283	struct iwl_wowlan_pattern_v1 bitmask;
 284
 285	/**
 286	 * @ipv4_tcp_syn: IPv4 TCP SYN pattern data
 287	 */
 288	struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn;
 289
 290	/**
 291	 * @ipv6_tcp_syn: IPv6 TCP SYN pattern data
 292	 */
 293	struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn;
 294}; /* WOWLAN_PATTERN_API_U_VER_1 */
 295
 296/**
 297 * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns
 298 */
 299struct iwl_wowlan_pattern_v2 {
 300	/**
 301	 * @pattern_type: defines the struct type to be used in the union
 302	 */
 303	u8 pattern_type;
 304
 305	/**
 306	 * @reserved: reserved for alignment
 307	 */
 308	u8 reserved[3];
 309
 310	/**
 311	 * @u: the union containing the match data, or undefined for
 312	 *     wildcard matches
 313	 */
 314	union iwl_wowlan_pattern_data u;
 315} __packed; /* WOWLAN_PATTERN_API_S_VER_2 */
 316
 317/**
 318 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command
 319 */
 320struct iwl_wowlan_patterns_cmd {
 321	/**
 322	 * @n_patterns: number of patterns
 323	 */
 324	u8 n_patterns;
 325
 326	/**
 327	 * @sta_id: sta_id
 328	 */
 329	u8 sta_id;
 330
 331	/**
 332	 * @reserved: reserved for alignment
 333	 */
 334	__le16 reserved;
 335
 336	/**
 337	 * @patterns: the patterns, array length in @n_patterns
 338	 */
 339	struct iwl_wowlan_pattern_v2 patterns[];
 340} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_3 */
 341
 342enum iwl_wowlan_wakeup_filters {
 343	IWL_WOWLAN_WAKEUP_MAGIC_PACKET			= BIT(0),
 344	IWL_WOWLAN_WAKEUP_PATTERN_MATCH			= BIT(1),
 345	IWL_WOWLAN_WAKEUP_BEACON_MISS			= BIT(2),
 346	IWL_WOWLAN_WAKEUP_LINK_CHANGE			= BIT(3),
 347	IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL		= BIT(4),
 348	IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ			= BIT(5),
 349	IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE		= BIT(6),
 350	IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT		= BIT(7),
 351	IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT		= BIT(8),
 352	IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS		= BIT(9),
 353	IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE	= BIT(10),
 354	IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL		= BIT(11),
 355	IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET		= BIT(12),
 356	IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET		= BIT(13),
 357	IWL_WOWLAN_WAKEUP_HOST_TIMER			= BIT(14),
 358	IWL_WOWLAN_WAKEUP_RX_FRAME			= BIT(15),
 359	IWL_WOWLAN_WAKEUP_BCN_FILTERING			= BIT(16),
 360}; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
 361
 362enum iwl_wowlan_flags {
 363	IS_11W_ASSOC		= BIT(0),
 364	ENABLE_L3_FILTERING	= BIT(1),
 365	ENABLE_NBNS_FILTERING	= BIT(2),
 366	ENABLE_DHCP_FILTERING	= BIT(3),
 367	ENABLE_STORE_BEACON	= BIT(4),
 368};
 369
 370/**
 371 * struct iwl_wowlan_config_cmd_v6 - WoWLAN configuration (versions 5 and 6)
 372 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
 373 * @non_qos_seq: non-QoS sequence counter to use next.
 374 *               Reserved if the struct has version >= 6.
 375 * @qos_seq: QoS sequence counters to use next
 376 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
 377 * @is_11n_connection: indicates HT connection
 378 * @offloading_tid: TID reserved for firmware use
 379 * @flags: extra flags, see &enum iwl_wowlan_flags
 380 * @sta_id: station ID for wowlan.
 381 * @reserved: reserved
 382 */
 383struct iwl_wowlan_config_cmd_v6 {
 384	__le32 wakeup_filter;
 385	__le16 non_qos_seq;
 386	__le16 qos_seq[8];
 387	u8 wowlan_ba_teardown_tids;
 388	u8 is_11n_connection;
 389	u8 offloading_tid;
 390	u8 flags;
 391	u8 sta_id;
 392	u8 reserved;
 393} __packed; /* WOWLAN_CONFIG_API_S_VER_6 */
 394
 395/**
 396 * struct iwl_wowlan_config_cmd - WoWLAN configuration
 397 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
 398 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
 399 * @is_11n_connection: indicates HT connection
 400 * @offloading_tid: TID reserved for firmware use
 401 * @flags: extra flags, see &enum iwl_wowlan_flags
 402 * @sta_id: station ID for wowlan.
 403 * @reserved: reserved
 404 */
 405struct iwl_wowlan_config_cmd {
 406	__le32 wakeup_filter;
 407	u8 wowlan_ba_teardown_tids;
 408	u8 is_11n_connection;
 409	u8 offloading_tid;
 410	u8 flags;
 411	u8 sta_id;
 412	u8 reserved[3];
 413} __packed; /* WOWLAN_CONFIG_API_S_VER_7 */
 414
 415#define IWL_NUM_RSC	16
 416#define WOWLAN_KEY_MAX_SIZE	32
 417#define WOWLAN_GTK_KEYS_NUM     2
 418#define WOWLAN_IGTK_KEYS_NUM	2
 419#define WOWLAN_IGTK_MIN_INDEX	4
 420#define WOWLAN_BIGTK_KEYS_NUM	2
 421#define WOWLAN_BIGTK_MIN_INDEX	6
 422
 423/*
 424 * WOWLAN_TSC_RSC_PARAMS
 425 */
 
 
 426struct tkip_sc {
 427	__le16 iv16;
 428	__le16 pad;
 429	__le32 iv32;
 430} __packed; /* TKIP_SC_API_U_VER_1 */
 431
 432struct iwl_tkip_rsc_tsc {
 433	struct tkip_sc unicast_rsc[IWL_NUM_RSC];
 434	struct tkip_sc multicast_rsc[IWL_NUM_RSC];
 435	struct tkip_sc tsc;
 436} __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
 437
 438struct aes_sc {
 439	__le64 pn;
 440} __packed; /* TKIP_AES_SC_API_U_VER_1 */
 441
 442struct iwl_aes_rsc_tsc {
 443	struct aes_sc unicast_rsc[IWL_NUM_RSC];
 444	struct aes_sc multicast_rsc[IWL_NUM_RSC];
 445	struct aes_sc tsc;
 446} __packed; /* AES_TSC_RSC_API_S_VER_1 */
 447
 448union iwl_all_tsc_rsc {
 449	struct iwl_tkip_rsc_tsc tkip;
 450	struct iwl_aes_rsc_tsc aes;
 451}; /* ALL_TSC_RSC_API_S_VER_2 */
 452
 453struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 {
 454	union iwl_all_tsc_rsc all_tsc_rsc;
 455} __packed; /* ALL_TSC_RSC_API_S_VER_2 */
 456
 457struct iwl_wowlan_rsc_tsc_params_cmd_v4 {
 458	struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 params;
 459	__le32 sta_id;
 460} __packed; /* ALL_TSC_RSC_API_S_VER_4 */
 461
 462struct iwl_wowlan_rsc_tsc_params_cmd {
 463	__le64 ucast_rsc[IWL_MAX_TID_COUNT];
 464	__le64 mcast_rsc[WOWLAN_GTK_KEYS_NUM][IWL_MAX_TID_COUNT];
 465	__le32 sta_id;
 466#define IWL_MCAST_KEY_MAP_INVALID	0xff
 467	u8 mcast_key_id_map[4];
 468} __packed; /* ALL_TSC_RSC_API_S_VER_5 */
 469
 470#define IWL_MIC_KEY_SIZE	8
 471struct iwl_mic_keys {
 472	u8 tx[IWL_MIC_KEY_SIZE];
 473	u8 rx_unicast[IWL_MIC_KEY_SIZE];
 474	u8 rx_mcast[IWL_MIC_KEY_SIZE];
 475} __packed; /* MIC_KEYS_API_S_VER_1 */
 476
 477#define IWL_P1K_SIZE		5
 478struct iwl_p1k_cache {
 479	__le16 p1k[IWL_P1K_SIZE];
 480} __packed;
 481
 482#define IWL_NUM_RX_P1K_CACHE	2
 483
 484struct iwl_wowlan_tkip_params_cmd_ver_1 {
 485	struct iwl_mic_keys mic_keys;
 486	struct iwl_p1k_cache tx;
 487	struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
 488	struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
 489} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
 490
 491struct iwl_wowlan_tkip_params_cmd {
 492	struct iwl_mic_keys mic_keys;
 493	struct iwl_p1k_cache tx;
 494	struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
 495	struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
 496	u8     reversed[2];
 497	__le32 sta_id;
 498} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */
 499
 500#define IWL_KCK_MAX_SIZE	32
 501#define IWL_KEK_MAX_SIZE	32
 502
 503struct iwl_wowlan_kek_kck_material_cmd_v2 {
 504	u8	kck[IWL_KCK_MAX_SIZE];
 505	u8	kek[IWL_KEK_MAX_SIZE];
 506	__le16	kck_len;
 507	__le16	kek_len;
 508	__le64	replay_ctr;
 509} __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
 510
 511struct iwl_wowlan_kek_kck_material_cmd_v3 {
 512	u8	kck[IWL_KCK_MAX_SIZE];
 513	u8	kek[IWL_KEK_MAX_SIZE];
 514	__le16	kck_len;
 515	__le16	kek_len;
 516	__le64	replay_ctr;
 517	__le32  akm;
 518	__le32  gtk_cipher;
 519	__le32  igtk_cipher;
 520	__le32  bigtk_cipher;
 521} __packed; /* KEK_KCK_MATERIAL_API_S_VER_3 */
 522
 523struct iwl_wowlan_kek_kck_material_cmd_v4 {
 524	__le32  sta_id;
 525	u8	kck[IWL_KCK_MAX_SIZE];
 526	u8	kek[IWL_KEK_MAX_SIZE];
 527	__le16	kck_len;
 528	__le16	kek_len;
 529	__le64	replay_ctr;
 530	__le32  akm;
 531	__le32  gtk_cipher;
 532	__le32  igtk_cipher;
 533	__le32  bigtk_cipher;
 534} __packed; /* KEK_KCK_MATERIAL_API_S_VER_4 */
 535
 536struct iwl_wowlan_get_status_cmd {
 537	__le32  sta_id;
 538} __packed; /* WOWLAN_GET_STATUSES_CMD_API_S_VER_1 */
 539
 540#define RF_KILL_INDICATOR_FOR_WOWLAN	0x87
 541
 542enum iwl_wowlan_rekey_status {
 543	IWL_WOWLAN_REKEY_POST_REKEY = 0,
 544	IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
 545}; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
 546
 547enum iwl_wowlan_wakeup_reason {
 548	IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS			= 0,
 549	IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET			= BIT(0),
 550	IWL_WOWLAN_WAKEUP_BY_PATTERN				= BIT(1),
 551	IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON	= BIT(2),
 552	IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH		= BIT(3),
 553	IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE			= BIT(4),
 554	IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED			= BIT(5),
 555	IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR			= BIT(6),
 556	IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST			= BIT(7),
 557	IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE			= BIT(8),
 558	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS			= BIT(9),
 559	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE		= BIT(10),
 560	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL		= BIT(11),
 561	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET		= BIT(12),
 562	IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET			= BIT(13),
 563	IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER		= BIT(14),
 564	IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN		= BIT(15),
 565	IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN			= BIT(16),
 566	IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC	= BIT(17),
 567	IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN			= BIT(18),
 568	IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD		= BIT(19),
 569	IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN			= BIT(20),
 570	IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD		= BIT(21),
 571}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
 572
 573struct iwl_wowlan_gtk_status_v1 {
 574	u8 key_index;
 575	u8 reserved[3];
 576	u8 decrypt_key[16];
 577	u8 tkip_mic_key[8];
 578	struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
 579} __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */
 580
 
 
 
 
 581/**
 582 * struct iwl_wowlan_gtk_status_v2 - GTK status
 583 * @key: GTK material
 584 * @key_len: GTK legth, if set to 0, the key is not available
 585 * @key_flags: information about the key:
 586 *	bits[0:1]:  key index assigned by the AP
 587 *	bits[2:6]:  GTK index of the key in the internal DB
 588 *	bit[7]:     Set iff this is the currently used GTK
 589 * @reserved: padding
 590 * @tkip_mic_key: TKIP RX MIC key
 591 * @rsc: TSC RSC counters
 592 */
 593struct iwl_wowlan_gtk_status_v2 {
 594	u8 key[WOWLAN_KEY_MAX_SIZE];
 595	u8 key_len;
 596	u8 key_flags;
 597	u8 reserved[2];
 598	u8 tkip_mic_key[8];
 599	struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
 600} __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */
 601
 602/**
 603 * struct iwl_wowlan_all_rsc_tsc_v5 - key counters
 604 * @ucast_rsc: unicast RSC values
 605 * @mcast_rsc: multicast RSC values (per key map value)
 606 * @sta_id: station ID
 607 * @mcast_key_id_map: map of key id to @mcast_rsc entry
 608 */
 609struct iwl_wowlan_all_rsc_tsc_v5 {
 610	__le64 ucast_rsc[IWL_MAX_TID_COUNT];
 611	__le64 mcast_rsc[2][IWL_MAX_TID_COUNT];
 612	__le32 sta_id;
 613	u8 mcast_key_id_map[4];
 614} __packed; /* ALL_TSC_RSC_API_S_VER_5 */
 615
 616/**
 617 * struct iwl_wowlan_gtk_status_v3 - GTK status
 618 * @key: GTK material
 619 * @key_len: GTK length, if set to 0, the key is not available
 620 * @key_flags: information about the key:
 621 *	bits[0:1]:  key index assigned by the AP
 622 *	bits[2:6]:  GTK index of the key in the internal DB
 623 *	bit[7]:     Set iff this is the currently used GTK
 624 * @reserved: padding
 625 * @tkip_mic_key: TKIP RX MIC key
 626 * @sc: RSC/TSC counters
 627 */
 628struct iwl_wowlan_gtk_status_v3 {
 629	u8 key[WOWLAN_KEY_MAX_SIZE];
 630	u8 key_len;
 631	u8 key_flags;
 632	u8 reserved[2];
 633	u8 tkip_mic_key[IWL_MIC_KEY_SIZE];
 634	struct iwl_wowlan_all_rsc_tsc_v5 sc;
 635} __packed; /* WOWLAN_GTK_MATERIAL_VER_3 */
 636
 637#define IWL_WOWLAN_GTK_IDX_MASK		(BIT(0) | BIT(1))
 638#define IWL_WOWLAN_IGTK_BIGTK_IDX_MASK	(BIT(0))
 639
 640/**
 641 * struct iwl_wowlan_igtk_status - IGTK status
 642 * @key: IGTK material
 643 * @ipn: the IGTK packet number (replay counter)
 644 * @key_len: IGTK length, if set to 0, the key is not available
 645 * @key_flags: information about the key:
 646 *	bits[0]: key index assigned by the AP (0: index 4, 1: index 5)
 647 *	(0: index 6, 1: index 7 with bigtk)
 648 *	bits[1:5]: IGTK index of the key in the internal DB
 649 *	bit[6]: Set iff this is the currently used IGTK
 650 */
 651struct iwl_wowlan_igtk_status {
 652	u8 key[WOWLAN_KEY_MAX_SIZE];
 653	u8 ipn[6];
 654	u8 key_len;
 655	u8 key_flags;
 656} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
 657
 658/**
 659 * struct iwl_wowlan_status_v6 - WoWLAN status
 660 * @gtk: GTK data
 661 * @replay_ctr: GTK rekey replay counter
 662 * @pattern_number: number of the matched pattern
 663 * @non_qos_seq_ctr: non-QoS sequence counter to use next
 664 * @qos_seq_ctr: QoS sequence counters to use next
 665 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 666 * @num_of_gtk_rekeys: number of GTK rekeys
 667 * @transmitted_ndps: number of transmitted neighbor discovery packets
 668 * @received_beacons: number of received beacons
 669 * @wake_packet_length: wakeup packet length
 670 * @wake_packet_bufsize: wakeup packet buffer size
 671 * @wake_packet: wakeup packet
 672 */
 673struct iwl_wowlan_status_v6 {
 674	struct iwl_wowlan_gtk_status_v1 gtk;
 675	__le64 replay_ctr;
 676	__le16 pattern_number;
 677	__le16 non_qos_seq_ctr;
 678	__le16 qos_seq_ctr[8];
 679	__le32 wakeup_reasons;
 680	__le32 num_of_gtk_rekeys;
 681	__le32 transmitted_ndps;
 682	__le32 received_beacons;
 683	__le32 wake_packet_length;
 684	__le32 wake_packet_bufsize;
 685	u8 wake_packet[]; /* can be truncated from _length to _bufsize */
 686} __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
 687
 688/**
 689 * struct iwl_wowlan_status_v7 - WoWLAN status
 690 * @gtk: GTK data
 691 * @igtk: IGTK data
 692 * @replay_ctr: GTK rekey replay counter
 693 * @pattern_number: number of the matched pattern
 694 * @non_qos_seq_ctr: non-QoS sequence counter to use next
 695 * @qos_seq_ctr: QoS sequence counters to use next
 696 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 697 * @num_of_gtk_rekeys: number of GTK rekeys
 698 * @transmitted_ndps: number of transmitted neighbor discovery packets
 699 * @received_beacons: number of received beacons
 700 * @wake_packet_length: wakeup packet length
 701 * @wake_packet_bufsize: wakeup packet buffer size
 702 * @wake_packet: wakeup packet
 703 */
 704struct iwl_wowlan_status_v7 {
 705	struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
 706	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
 707	__le64 replay_ctr;
 708	__le16 pattern_number;
 709	__le16 non_qos_seq_ctr;
 710	__le16 qos_seq_ctr[8];
 711	__le32 wakeup_reasons;
 712	__le32 num_of_gtk_rekeys;
 713	__le32 transmitted_ndps;
 714	__le32 received_beacons;
 715	__le32 wake_packet_length;
 716	__le32 wake_packet_bufsize;
 717	u8 wake_packet[]; /* can be truncated from _length to _bufsize */
 718} __packed; /* WOWLAN_STATUSES_API_S_VER_7 */
 719
 720/**
 721 * struct iwl_wowlan_status_v9 - WoWLAN status (versions 9 and 10)
 722 * @gtk: GTK data
 723 * @igtk: IGTK data
 724 * @replay_ctr: GTK rekey replay counter
 725 * @pattern_number: number of the matched pattern
 726 * @non_qos_seq_ctr: non-QoS sequence counter to use next.
 727 *                   Reserved if the struct has version >= 10.
 728 * @qos_seq_ctr: QoS sequence counters to use next
 729 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 730 * @num_of_gtk_rekeys: number of GTK rekeys
 731 * @transmitted_ndps: number of transmitted neighbor discovery packets
 732 * @received_beacons: number of received beacons
 733 * @wake_packet_length: wakeup packet length
 734 * @wake_packet_bufsize: wakeup packet buffer size
 735 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 736 *		   in suspend state
 737 * @reserved: unused
 738 * @wake_packet: wakeup packet
 739 */
 740struct iwl_wowlan_status_v9 {
 741	struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
 742	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
 743	__le64 replay_ctr;
 744	__le16 pattern_number;
 745	__le16 non_qos_seq_ctr;
 746	__le16 qos_seq_ctr[8];
 747	__le32 wakeup_reasons;
 748	__le32 num_of_gtk_rekeys;
 749	__le32 transmitted_ndps;
 750	__le32 received_beacons;
 751	__le32 wake_packet_length;
 752	__le32 wake_packet_bufsize;
 753	u8 tid_tear_down;
 754	u8 reserved[3];
 755	u8 wake_packet[]; /* can be truncated from _length to _bufsize */
 756} __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_9 */
 757
 758/**
 759 * struct iwl_wowlan_status_v12 - WoWLAN status
 760 * @gtk: GTK data
 761 * @igtk: IGTK data
 762 * @replay_ctr: GTK rekey replay counter
 763 * @pattern_number: number of the matched pattern
 764 * @non_qos_seq_ctr: non-QoS sequence counter to use next.
 765 *                   Reserved if the struct has version >= 10.
 766 * @qos_seq_ctr: QoS sequence counters to use next
 767 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 768 * @num_of_gtk_rekeys: number of GTK rekeys
 769 * @transmitted_ndps: number of transmitted neighbor discovery packets
 770 * @received_beacons: number of received beacons
 771 * @wake_packet_length: wakeup packet length
 772 * @wake_packet_bufsize: wakeup packet buffer size
 773 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 774 *		   in suspend state
 775 * @reserved: unused
 776 * @wake_packet: wakeup packet
 777 */
 778struct iwl_wowlan_status_v12 {
 779	struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
 780	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
 781	__le64 replay_ctr;
 782	__le16 pattern_number;
 783	__le16 non_qos_seq_ctr;
 784	__le16 qos_seq_ctr[8];
 785	__le32 wakeup_reasons;
 786	__le32 num_of_gtk_rekeys;
 787	__le32 transmitted_ndps;
 788	__le32 received_beacons;
 789	__le32 wake_packet_length;
 790	__le32 wake_packet_bufsize;
 791	u8 tid_tear_down;
 792	u8 reserved[3];
 793	u8 wake_packet[]; /* can be truncated from _length to _bufsize */
 794} __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_12 */
 795
 796/**
 797 * struct iwl_wowlan_info_notif_v1 - WoWLAN information notification
 798 * @gtk: GTK data
 799 * @igtk: IGTK data
 800 * @replay_ctr: GTK rekey replay counter
 801 * @pattern_number: number of the matched patterns
 802 * @reserved1: reserved
 803 * @qos_seq_ctr: QoS sequence counters to use next
 804 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 805 * @num_of_gtk_rekeys: number of GTK rekeys
 806 * @transmitted_ndps: number of transmitted neighbor discovery packets
 807 * @received_beacons: number of received beacons
 808 * @wake_packet_length: wakeup packet length
 809 * @wake_packet_bufsize: wakeup packet buffer size
 810 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 811 *	in suspend state
 812 * @station_id: station id
 813 * @reserved2: reserved
 814 */
 815struct iwl_wowlan_info_notif_v1 {
 816	struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
 817	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
 818	__le64 replay_ctr;
 819	__le16 pattern_number;
 820	__le16 reserved1;
 821	__le16 qos_seq_ctr[8];
 822	__le32 wakeup_reasons;
 823	__le32 num_of_gtk_rekeys;
 824	__le32 transmitted_ndps;
 825	__le32 received_beacons;
 826	__le32 wake_packet_length;
 827	__le32 wake_packet_bufsize;
 828	u8 tid_tear_down;
 829	u8 station_id;
 830	u8 reserved2[2];
 831} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_1 */
 832
 833/**
 834 * struct iwl_wowlan_info_notif_v2 - WoWLAN information notification
 835 * @gtk: GTK data
 836 * @igtk: IGTK data
 837 * @replay_ctr: GTK rekey replay counter
 838 * @pattern_number: number of the matched patterns
 839 * @reserved1: reserved
 840 * @qos_seq_ctr: QoS sequence counters to use next
 841 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 842 * @num_of_gtk_rekeys: number of GTK rekeys
 843 * @transmitted_ndps: number of transmitted neighbor discovery packets
 844 * @received_beacons: number of received beacons
 845 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 846 *	in suspend state
 847 * @station_id: station id
 848 * @reserved2: reserved
 849 */
 850struct iwl_wowlan_info_notif_v2 {
 851	struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
 852	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
 853	__le64 replay_ctr;
 854	__le16 pattern_number;
 855	__le16 reserved1;
 856	__le16 qos_seq_ctr[8];
 857	__le32 wakeup_reasons;
 858	__le32 num_of_gtk_rekeys;
 859	__le32 transmitted_ndps;
 860	__le32 received_beacons;
 861	u8 tid_tear_down;
 862	u8 station_id;
 863	u8 reserved2[2];
 864} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_2 */
 865
 866/* MAX MLO keys of non-active links that can arrive in the notification */
 867#define WOWLAN_MAX_MLO_KEYS 18
 868
 869/**
 870 * enum iwl_wowlan_mlo_gtk_type - GTK types
 871 * @WOWLAN_MLO_GTK_KEY_TYPE_GTK: GTK
 872 * @WOWLAN_MLO_GTK_KEY_TYPE_IGTK: IGTK
 873 * @WOWLAN_MLO_GTK_KEY_TYPE_BIGTK: BIGTK
 874 * @WOWLAN_MLO_GTK_KEY_NUM_TYPES: number of key types
 875 */
 876enum iwl_wowlan_mlo_gtk_type {
 877	WOWLAN_MLO_GTK_KEY_TYPE_GTK,
 878	WOWLAN_MLO_GTK_KEY_TYPE_IGTK,
 879	WOWLAN_MLO_GTK_KEY_TYPE_BIGTK,
 880	WOWLAN_MLO_GTK_KEY_NUM_TYPES
 881}; /* WOWLAN_MLO_GTK_KEY_TYPE_API_E_VER_1 */
 882
 883/**
 884 * enum iwl_wowlan_mlo_gtk_flag - MLO GTK flags
 885 * @WOWLAN_MLO_GTK_FLAG_KEY_LEN_MSK: 0 for len 16, 1 for len 32
 886 * @WOWLAN_MLO_GTK_FLAG_KEY_ID_MSK: key id (ranges from 0 to 7)
 887 * @WOWLAN_MLO_GTK_FLAG_LINK_ID_MSK: spec link id of the key
 888 * @WOWLAN_MLO_GTK_FLAG_KEY_TYPE_MSK: &enum iwl_wowlan_mlo_gtk_type
 889 * @WOWLAN_MLO_GTK_FLAG_LAST_KEY_MSK: is this the last given key per
 890 *	key-type / link-id - the currently used key
 891 */
 892enum iwl_wowlan_mlo_gtk_flag {
 893	WOWLAN_MLO_GTK_FLAG_KEY_LEN_MSK = 0x0001,
 894	WOWLAN_MLO_GTK_FLAG_KEY_ID_MSK = 0x000E,
 895	WOWLAN_MLO_GTK_FLAG_LINK_ID_MSK = 0x00F0,
 896	WOWLAN_MLO_GTK_FLAG_KEY_TYPE_MSK = 0x0300,
 897	WOWLAN_MLO_GTK_FLAG_LAST_KEY_MSK = 0x0400
 898}; /* WOWLAN_MLO_GTK_FLAG_API_E_VER_1 */
 899
 900/**
 901 * struct iwl_wowlan_mlo_gtk - MLO GTK info
 902 * @key: key material
 903 * @flags: &enum iwl_wowlan_mlo_gtk_flag
 904 * @pn: packet number
 905 */
 906struct iwl_wowlan_mlo_gtk {
 907	u8 key[WOWLAN_KEY_MAX_SIZE];
 908	__le16 flags;
 909	u8 pn[6];
 910} __packed; /* WOWLAN_MLO_GTK_KEY_API_S_VER_1 */
 911
 912/**
 913 * struct iwl_wowlan_info_notif_v4 - WoWLAN information notification
 914 * @gtk: GTK data
 915 * @igtk: IGTK data
 916 * @bigtk: BIGTK data
 917 * @replay_ctr: GTK rekey replay counter
 918 * @pattern_number: number of the matched patterns
 919 * @reserved1: reserved
 920 * @qos_seq_ctr: QoS sequence counters to use next
 921 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 922 * @num_of_gtk_rekeys: number of GTK rekeys
 923 * @transmitted_ndps: number of transmitted neighbor discovery packets
 924 * @received_beacons: number of received beacons
 925 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 926 *	in suspend state
 927 * @station_id: station id
 928 * @num_mlo_link_keys: number of &struct iwl_wowlan_mlo_gtk structs
 929 *	following this notif, or reserved in version < 4
 930 * @reserved2: reserved
 931 * @mlo_gtks: array of GTKs of size num_mlo_link_keys for version >= 4
 932 */
 933struct iwl_wowlan_info_notif_v4 {
 934	struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
 935	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
 936	struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];
 937	__le64 replay_ctr;
 938	__le16 pattern_number;
 939	__le16 reserved1;
 940	__le16 qos_seq_ctr[8];
 941	__le32 wakeup_reasons;
 942	__le32 num_of_gtk_rekeys;
 943	__le32 transmitted_ndps;
 944	__le32 received_beacons;
 945	u8 tid_tear_down;
 946	u8 station_id;
 947	u8 num_mlo_link_keys;
 948	u8 reserved2;
 949	struct iwl_wowlan_mlo_gtk mlo_gtks[];
 950} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_3, _VER_4 */
 951
 952/**
 953 * struct iwl_wowlan_info_notif - WoWLAN information notification
 954 * @gtk: GTK data
 955 * @igtk: IGTK data
 956 * @bigtk: BIGTK data
 957 * @replay_ctr: GTK rekey replay counter
 958 * @pattern_number: number of the matched patterns
 959 * @qos_seq_ctr: QoS sequence counters to use next
 960 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 961 * @num_of_gtk_rekeys: number of GTK rekeys
 962 * @transmitted_ndps: number of transmitted neighbor discovery packets
 963 * @received_beacons: number of received beacons
 964 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 965 *	in suspend state
 966 * @station_id: station id
 967 * @num_mlo_link_keys: number of &struct iwl_wowlan_mlo_gtk structs
 968 *	following this notif
 969 * @tid_offloaded_tx: tid used by the firmware to transmit data packets
 970 *	while in wowlan
 971 * @mlo_gtks: array of GTKs of size num_mlo_link_keys
 972 */
 973struct iwl_wowlan_info_notif {
 974	struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
 975	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
 976	struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];
 977	__le64 replay_ctr;
 978	__le16 pattern_number;
 979	__le16 qos_seq_ctr;
 980	__le32 wakeup_reasons;
 981	__le32 num_of_gtk_rekeys;
 982	__le32 transmitted_ndps;
 983	__le32 received_beacons;
 984	u8 tid_tear_down;
 985	u8 station_id;
 986	u8 num_mlo_link_keys;
 987	u8 tid_offloaded_tx;
 988	struct iwl_wowlan_mlo_gtk mlo_gtks[];
 989} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_5 */
 990
 991/**
 992 * struct iwl_wowlan_wake_pkt_notif - WoWLAN wake packet notification
 993 * @wake_packet_length: wakeup packet length
 994 * @station_id: station id
 995 * @reserved: unused
 996 * @wake_packet: wakeup packet
 997 */
 998struct iwl_wowlan_wake_pkt_notif {
 999	__le32 wake_packet_length;
1000	u8 station_id;
1001	u8 reserved[3];
1002	u8 wake_packet[1];
1003} __packed; /* WOWLAN_WAKE_PKT_NTFY_API_S_VER_1 */
1004
1005/**
1006 * struct iwl_mvm_d3_end_notif -  d3 end notification
1007 * @flags: See &enum iwl_d0i3_flags
1008 */
1009struct iwl_mvm_d3_end_notif {
1010	__le32 flags;
1011} __packed;
1012
1013/* TODO: NetDetect API */
1014
1015#endif /* __iwl_fw_api_d3_h__ */
v5.4
  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 */
 71enum 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 */
 83struct 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 */
 99enum 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 */
123struct 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 */
141struct 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 */
161struct 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
171struct 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
178struct 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 */
190struct 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 */
204struct 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
217struct 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 */
230struct 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
245enum 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 */
256struct 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 */
281struct 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 */
309union 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 */
329struct 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 */
350struct 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
362enum 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
382enum 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 * @sta_id: station ID for wowlan.
400 * @reserved: reserved
401 */
402struct iwl_wowlan_config_cmd {
403	__le32 wakeup_filter;
404	__le16 non_qos_seq;
405	__le16 qos_seq[8];
406	u8 wowlan_ba_teardown_tids;
407	u8 is_11n_connection;
408	u8 offloading_tid;
409	u8 flags;
410	u8 sta_id;
411	u8 reserved;
412} __packed; /* WOWLAN_CONFIG_API_S_VER_5 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
414/*
415 * WOWLAN_TSC_RSC_PARAMS
416 */
417#define IWL_NUM_RSC	16
418
419struct tkip_sc {
420	__le16 iv16;
421	__le16 pad;
422	__le32 iv32;
423} __packed; /* TKIP_SC_API_U_VER_1 */
424
425struct iwl_tkip_rsc_tsc {
426	struct tkip_sc unicast_rsc[IWL_NUM_RSC];
427	struct tkip_sc multicast_rsc[IWL_NUM_RSC];
428	struct tkip_sc tsc;
429} __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
430
431struct aes_sc {
432	__le64 pn;
433} __packed; /* TKIP_AES_SC_API_U_VER_1 */
434
435struct iwl_aes_rsc_tsc {
436	struct aes_sc unicast_rsc[IWL_NUM_RSC];
437	struct aes_sc multicast_rsc[IWL_NUM_RSC];
438	struct aes_sc tsc;
439} __packed; /* AES_TSC_RSC_API_S_VER_1 */
440
441union iwl_all_tsc_rsc {
442	struct iwl_tkip_rsc_tsc tkip;
443	struct iwl_aes_rsc_tsc aes;
444}; /* ALL_TSC_RSC_API_S_VER_2 */
445
446struct iwl_wowlan_rsc_tsc_params_cmd {
447	union iwl_all_tsc_rsc all_tsc_rsc;
448} __packed; /* ALL_TSC_RSC_API_S_VER_2 */
449
 
 
 
 
 
 
 
 
 
 
 
 
 
450#define IWL_MIC_KEY_SIZE	8
451struct iwl_mic_keys {
452	u8 tx[IWL_MIC_KEY_SIZE];
453	u8 rx_unicast[IWL_MIC_KEY_SIZE];
454	u8 rx_mcast[IWL_MIC_KEY_SIZE];
455} __packed; /* MIC_KEYS_API_S_VER_1 */
456
457#define IWL_P1K_SIZE		5
458struct iwl_p1k_cache {
459	__le16 p1k[IWL_P1K_SIZE];
460} __packed;
461
462#define IWL_NUM_RX_P1K_CACHE	2
463
 
 
 
 
 
 
 
464struct iwl_wowlan_tkip_params_cmd {
465	struct iwl_mic_keys mic_keys;
466	struct iwl_p1k_cache tx;
467	struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
468	struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
469} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
 
 
470
471#define IWL_KCK_MAX_SIZE	32
472#define IWL_KEK_MAX_SIZE	32
473
474struct iwl_wowlan_kek_kck_material_cmd {
475	u8	kck[IWL_KCK_MAX_SIZE];
476	u8	kek[IWL_KEK_MAX_SIZE];
477	__le16	kck_len;
478	__le16	kek_len;
479	__le64	replay_ctr;
480} __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
481
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
482#define RF_KILL_INDICATOR_FOR_WOWLAN	0x87
483
484enum iwl_wowlan_rekey_status {
485	IWL_WOWLAN_REKEY_POST_REKEY = 0,
486	IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
487}; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
488
489enum iwl_wowlan_wakeup_reason {
490	IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS			= 0,
491	IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET			= BIT(0),
492	IWL_WOWLAN_WAKEUP_BY_PATTERN				= BIT(1),
493	IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON	= BIT(2),
494	IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH		= BIT(3),
495	IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE			= BIT(4),
496	IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED			= BIT(5),
497	IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR			= BIT(6),
498	IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST			= BIT(7),
499	IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE			= BIT(8),
500	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS			= BIT(9),
501	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE		= BIT(10),
502	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL		= BIT(11),
503	IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET		= BIT(12),
504	IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET			= BIT(13),
505	IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER		= BIT(14),
506	IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN		= BIT(15),
507	IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN			= BIT(16),
508	IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC	= BIT(17),
509	IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN			= BIT(18),
510	IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD		= BIT(19),
511	IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN			= BIT(20),
512	IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD		= BIT(21),
513}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
514
515struct iwl_wowlan_gtk_status_v1 {
516	u8 key_index;
517	u8 reserved[3];
518	u8 decrypt_key[16];
519	u8 tkip_mic_key[8];
520	struct iwl_wowlan_rsc_tsc_params_cmd rsc;
521} __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */
522
523#define WOWLAN_KEY_MAX_SIZE	32
524#define WOWLAN_GTK_KEYS_NUM     2
525#define WOWLAN_IGTK_KEYS_NUM	2
526
527/**
528 * struct iwl_wowlan_gtk_status - GTK status
529 * @key: GTK material
530 * @key_len: GTK legth, if set to 0, the key is not available
531 * @key_flags: information about the key:
532 *	bits[0:1]:  key index assigned by the AP
533 *	bits[2:6]:  GTK index of the key in the internal DB
534 *	bit[7]:     Set iff this is the currently used GTK
535 * @reserved: padding
536 * @tkip_mic_key: TKIP RX MIC key
537 * @rsc: TSC RSC counters
538 */
539struct iwl_wowlan_gtk_status {
540	u8 key[WOWLAN_KEY_MAX_SIZE];
541	u8 key_len;
542	u8 key_flags;
543	u8 reserved[2];
544	u8 tkip_mic_key[8];
545	struct iwl_wowlan_rsc_tsc_params_cmd rsc;
546} __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */
547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548#define IWL_WOWLAN_GTK_IDX_MASK		(BIT(0) | BIT(1))
 
549
550/**
551 * struct iwl_wowlan_igtk_status - IGTK status
552 * @key: IGTK material
553 * @ipn: the IGTK packet number (replay counter)
554 * @key_len: IGTK length, if set to 0, the key is not available
555 * @key_flags: information about the key:
556 *	bits[0]:    key index assigned by the AP (0: index 4, 1: index 5)
557 *	bits[1:5]:  IGTK index of the key in the internal DB
558 *	bit[6]:     Set iff this is the currently used IGTK
 
559 */
560struct iwl_wowlan_igtk_status {
561	u8 key[WOWLAN_KEY_MAX_SIZE];
562	u8 ipn[6];
563	u8 key_len;
564	u8 key_flags;
565} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
566
567/**
568 * struct iwl_wowlan_status_v6 - WoWLAN status
569 * @gtk: GTK data
570 * @replay_ctr: GTK rekey replay counter
571 * @pattern_number: number of the matched pattern
572 * @non_qos_seq_ctr: non-QoS sequence counter to use next
573 * @qos_seq_ctr: QoS sequence counters to use next
574 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
575 * @num_of_gtk_rekeys: number of GTK rekeys
576 * @transmitted_ndps: number of transmitted neighbor discovery packets
577 * @received_beacons: number of received beacons
578 * @wake_packet_length: wakeup packet length
579 * @wake_packet_bufsize: wakeup packet buffer size
580 * @wake_packet: wakeup packet
581 */
582struct iwl_wowlan_status_v6 {
583	struct iwl_wowlan_gtk_status_v1 gtk;
584	__le64 replay_ctr;
585	__le16 pattern_number;
586	__le16 non_qos_seq_ctr;
587	__le16 qos_seq_ctr[8];
588	__le32 wakeup_reasons;
589	__le32 num_of_gtk_rekeys;
590	__le32 transmitted_ndps;
591	__le32 received_beacons;
592	__le32 wake_packet_length;
593	__le32 wake_packet_bufsize;
594	u8 wake_packet[]; /* can be truncated from _length to _bufsize */
595} __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
596
597/**
598 * struct iwl_wowlan_status - WoWLAN status
599 * @gtk: GTK data
600 * @igtk: IGTK data
601 * @replay_ctr: GTK rekey replay counter
602 * @pattern_number: number of the matched pattern
603 * @non_qos_seq_ctr: non-QoS sequence counter to use next
604 * @qos_seq_ctr: QoS sequence counters to use next
605 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
606 * @num_of_gtk_rekeys: number of GTK rekeys
607 * @transmitted_ndps: number of transmitted neighbor discovery packets
608 * @received_beacons: number of received beacons
609 * @wake_packet_length: wakeup packet length
610 * @wake_packet_bufsize: wakeup packet buffer size
611 * @wake_packet: wakeup packet
612 */
613struct iwl_wowlan_status {
614	struct iwl_wowlan_gtk_status gtk[WOWLAN_GTK_KEYS_NUM];
615	struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
616	__le64 replay_ctr;
617	__le16 pattern_number;
618	__le16 non_qos_seq_ctr;
619	__le16 qos_seq_ctr[8];
620	__le32 wakeup_reasons;
621	__le32 num_of_gtk_rekeys;
622	__le32 transmitted_ndps;
623	__le32 received_beacons;
624	__le32 wake_packet_length;
625	__le32 wake_packet_bufsize;
626	u8 wake_packet[]; /* can be truncated from _length to _bufsize */
627} __packed; /* WOWLAN_STATUSES_API_S_VER_7 */
628
629static inline u8 iwlmvm_wowlan_gtk_idx(struct iwl_wowlan_gtk_status *gtk)
630{
631	return gtk->key_flags & IWL_WOWLAN_GTK_IDX_MASK;
632}
633
634#define IWL_WOWLAN_TCP_MAX_PACKET_LEN		64
635#define IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN	128
636#define IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS	2048
637
638struct iwl_tcp_packet_info {
639	__le16 tcp_pseudo_header_checksum;
640	__le16 tcp_payload_length;
641} __packed; /* TCP_PACKET_INFO_API_S_VER_2 */
642
643struct iwl_tcp_packet {
644	struct iwl_tcp_packet_info info;
645	u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
646	u8 data[IWL_WOWLAN_TCP_MAX_PACKET_LEN];
647} __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
648
649struct iwl_remote_wake_packet {
650	struct iwl_tcp_packet_info info;
651	u8 rx_mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
652	u8 data[IWL_WOWLAN_REMOTE_WAKE_MAX_PACKET_LEN];
653} __packed; /* TCP_PROTOCOL_PACKET_API_S_VER_1 */
654
655struct iwl_wowlan_remote_wake_config {
656	__le32 connection_max_time; /* unused */
657	/* TCP_PROTOCOL_CONFIG_API_S_VER_1 */
658	u8 max_syn_retries;
659	u8 max_data_retries;
660	u8 tcp_syn_ack_timeout;
661	u8 tcp_ack_timeout;
662
663	struct iwl_tcp_packet syn_tx;
664	struct iwl_tcp_packet synack_rx;
665	struct iwl_tcp_packet keepalive_ack_rx;
666	struct iwl_tcp_packet fin_tx;
667
668	struct iwl_remote_wake_packet keepalive_tx;
669	struct iwl_remote_wake_packet wake_rx;
670
671	/* REMOTE_WAKE_OFFSET_INFO_API_S_VER_1 */
672	u8 sequence_number_offset;
673	u8 sequence_number_length;
674	u8 token_offset;
675	u8 token_length;
676	/* REMOTE_WAKE_PROTOCOL_PARAMS_API_S_VER_1 */
677	__le32 initial_sequence_number;
678	__le16 keepalive_interval;
679	__le16 num_tokens;
680	u8 tokens[IWL_WOWLAN_REMOTE_WAKE_MAX_TOKENS];
681} __packed; /* REMOTE_WAKE_CONFIG_API_S_VER_2 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
683/* TODO: NetDetect API */
684
685#endif /* __iwl_fw_api_d3_h__ */