Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/d3.h
48426 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2012-2014, 2018-2025 Intel Corporation3* Copyright (C) 2013-2014 Intel Mobile Communications GmbH4* Copyright (C) 2015-2017 Intel Deutschland GmbH5*/6#ifndef __iwl_fw_api_d3_h__7#define __iwl_fw_api_d3_h__8#include <iwl-trans.h>910/**11* enum iwl_d0i3_flags - d0i3 flags12* @IWL_D0I3_RESET_REQUIRE: FW require reset upon resume13*/14enum iwl_d0i3_flags {15IWL_D0I3_RESET_REQUIRE = BIT(0),16};1718/**19* enum iwl_d3_wakeup_flags - D3 manager wakeup flags20* @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert21* @IWL_WAKEUP_D3_HOST_TIMER: wake up on host timer expiry22*/23enum iwl_d3_wakeup_flags {24IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),25IWL_WAKEUP_D3_HOST_TIMER = BIT(1),26}; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */2728/**29* struct iwl_d3_manager_config - D3 manager configuration command30* @min_sleep_time: minimum sleep time (in usec)31* @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags32* @wakeup_host_timer: force wakeup after this many seconds33*34* The structure is used for the D3_CONFIG_CMD command.35*/36struct iwl_d3_manager_config {37__le32 min_sleep_time;38__le32 wakeup_flags;39__le32 wakeup_host_timer;40} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */414243/* TODO: OFFLOADS_QUERY_API_S_VER_1 */4445/**46* enum iwl_proto_offloads - enabled protocol offloads47* @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled48* @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled49* @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid50* @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid51* @IWL_D3_PROTO_OFFLOAD_BTM: BTM offload is enabled52*/53enum iwl_proto_offloads {54IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),55IWL_D3_PROTO_OFFLOAD_NS = BIT(1),56IWL_D3_PROTO_IPV4_VALID = BIT(2),57IWL_D3_PROTO_IPV6_VALID = BIT(3),58IWL_D3_PROTO_OFFLOAD_BTM = BIT(4),59};6061#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 262#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 663#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L 1264#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S 465#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX 126667#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 468#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 26970/**71* struct iwl_proto_offload_cmd_common - ARP/NS offload common part72* @enabled: enable flags73* @remote_ipv4_addr: remote address to answer to (or zero if all)74* @host_ipv4_addr: our IPv4 address to respond to queries for75* @arp_mac_addr: our MAC address for ARP responses76* @reserved: unused77*/78struct iwl_proto_offload_cmd_common {79__le32 enabled;80__be32 remote_ipv4_addr;81__be32 host_ipv4_addr;82u8 arp_mac_addr[ETH_ALEN];83__le16 reserved;84} __packed;8586/**87* struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration88* @common: common/IPv4 configuration89* @remote_ipv6_addr: remote address to answer to (or zero if all)90* @solicited_node_ipv6_addr: broken -- solicited node address exists91* for each target address92* @target_ipv6_addr: our target addresses93* @ndp_mac_addr: neighbor solicitation response MAC address94* @reserved2: reserved95*/96struct iwl_proto_offload_cmd_v1 {97struct iwl_proto_offload_cmd_common common;98u8 remote_ipv6_addr[16];99u8 solicited_node_ipv6_addr[16];100u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];101u8 ndp_mac_addr[ETH_ALEN];102__le16 reserved2;103} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */104105/**106* struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration107* @common: common/IPv4 configuration108* @remote_ipv6_addr: remote address to answer to (or zero if all)109* @solicited_node_ipv6_addr: broken -- solicited node address exists110* for each target address111* @target_ipv6_addr: our target addresses112* @ndp_mac_addr: neighbor solicitation response MAC address113* @num_valid_ipv6_addrs: number of valid IPv6 addresses114* @reserved2: reserved115*/116struct iwl_proto_offload_cmd_v2 {117struct iwl_proto_offload_cmd_common common;118u8 remote_ipv6_addr[16];119u8 solicited_node_ipv6_addr[16];120u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];121u8 ndp_mac_addr[ETH_ALEN];122u8 num_valid_ipv6_addrs;123u8 reserved2[3];124} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */125126struct iwl_ns_config {127struct in6_addr source_ipv6_addr;128struct in6_addr dest_ipv6_addr;129u8 target_mac_addr[ETH_ALEN];130__le16 reserved;131} __packed; /* NS_OFFLOAD_CONFIG */132133struct iwl_targ_addr {134struct in6_addr addr;135__le32 config_num;136} __packed; /* TARGET_IPV6_ADDRESS */137138/**139* struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration140* @common: common/IPv4 configuration141* @num_valid_ipv6_addrs: number of valid IPv6 addresses142* @targ_addrs: target IPv6 addresses143* @ns_config: NS offload configurations144*/145struct iwl_proto_offload_cmd_v3_small {146struct iwl_proto_offload_cmd_common common;147__le32 num_valid_ipv6_addrs;148struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];149struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];150} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */151152/**153* struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration154* @common: common/IPv4 configuration155* @num_valid_ipv6_addrs: number of valid IPv6 addresses156* @targ_addrs: target IPv6 addresses157* @ns_config: NS offload configurations158*/159struct iwl_proto_offload_cmd_v3_large {160struct iwl_proto_offload_cmd_common common;161__le32 num_valid_ipv6_addrs;162struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];163struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];164} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */165166/**167* struct iwl_proto_offload_cmd_v4 - ARP/NS offload configuration168* @sta_id: station id169* @common: common/IPv4 configuration170* @num_valid_ipv6_addrs: number of valid IPv6 addresses171* @targ_addrs: target IPv6 addresses172* @ns_config: NS offload configurations173*/174struct iwl_proto_offload_cmd_v4 {175__le32 sta_id;176struct iwl_proto_offload_cmd_common common;177__le32 num_valid_ipv6_addrs;178struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];179struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];180} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_4 */181182/*183* WOWLAN_PATTERNS184*/185#define IWL_WOWLAN_MIN_PATTERN_LEN 16186#define IWL_WOWLAN_MAX_PATTERN_LEN 128187188struct iwl_wowlan_pattern_v1 {189u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];190u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];191u8 mask_size;192u8 pattern_size;193__le16 reserved;194} __packed; /* WOWLAN_PATTERN_API_S_VER_1 */195196#define IWL_WOWLAN_MAX_PATTERNS 20197198/**199* struct iwl_wowlan_patterns_cmd_v1 - WoWLAN wakeup patterns200*/201struct iwl_wowlan_patterns_cmd_v1 {202/**203* @n_patterns: number of patterns204*/205__le32 n_patterns;206207/**208* @patterns: the patterns, array length in @n_patterns209*/210struct iwl_wowlan_pattern_v1 patterns[];211} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */212213#define IPV4_ADDR_SIZE 4214#define IPV6_ADDR_SIZE 16215216enum iwl_wowlan_pattern_type {217WOWLAN_PATTERN_TYPE_BITMASK,218WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN,219WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN,220WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD,221WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD,222}; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */223224/**225* struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data226*/227struct iwl_wowlan_ipv4_tcp_syn {228/**229* @src_addr: source IP address to match230*/231u8 src_addr[IPV4_ADDR_SIZE];232233/**234* @dst_addr: destination IP address to match235*/236u8 dst_addr[IPV4_ADDR_SIZE];237238/**239* @src_port: source TCP port to match240*/241__le16 src_port;242243/**244* @dst_port: destination TCP port to match245*/246__le16 dst_port;247} __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */248249/**250* struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data251*/252struct iwl_wowlan_ipv6_tcp_syn {253/**254* @src_addr: source IP address to match255*/256u8 src_addr[IPV6_ADDR_SIZE];257258/**259* @dst_addr: destination IP address to match260*/261u8 dst_addr[IPV6_ADDR_SIZE];262263/**264* @src_port: source TCP port to match265*/266__le16 src_port;267268/**269* @dst_port: destination TCP port to match270*/271__le16 dst_port;272} __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */273274/**275* union iwl_wowlan_pattern_data - Data for the different pattern types276*277* If wildcard addresses/ports are to be used, the union can be left278* undefined.279*/280union iwl_wowlan_pattern_data {281/**282* @bitmask: bitmask pattern data283*/284struct iwl_wowlan_pattern_v1 bitmask;285286/**287* @ipv4_tcp_syn: IPv4 TCP SYN pattern data288*/289struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn;290291/**292* @ipv6_tcp_syn: IPv6 TCP SYN pattern data293*/294struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn;295}; /* WOWLAN_PATTERN_API_U_VER_1 */296297/**298* struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns299*/300struct iwl_wowlan_pattern_v2 {301/**302* @pattern_type: defines the struct type to be used in the union303*/304u8 pattern_type;305306/**307* @reserved: reserved for alignment308*/309u8 reserved[3];310311/**312* @u: the union containing the match data, or undefined for313* wildcard matches314*/315union iwl_wowlan_pattern_data u;316} __packed; /* WOWLAN_PATTERN_API_S_VER_2 */317318/**319* struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command320*/321struct iwl_wowlan_patterns_cmd {322/**323* @n_patterns: number of patterns324*/325u8 n_patterns;326327/**328* @sta_id: sta_id329*/330u8 sta_id;331332/**333* @reserved: reserved for alignment334*/335__le16 reserved;336337/**338* @patterns: the patterns, array length in @n_patterns339*/340struct iwl_wowlan_pattern_v2 patterns[];341} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_3 */342343enum iwl_wowlan_wakeup_filters {344IWL_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0),345IWL_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1),346IWL_WOWLAN_WAKEUP_BEACON_MISS = BIT(2),347IWL_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3),348IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4),349IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5),350IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6),351IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(7),352IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT = BIT(8),353IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS = BIT(9),354IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE = BIT(10),355IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL = BIT(11),356IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET = BIT(12),357IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET = BIT(13),358IWL_WOWLAN_WAKEUP_HOST_TIMER = BIT(14),359IWL_WOWLAN_WAKEUP_RX_FRAME = BIT(15),360IWL_WOWLAN_WAKEUP_BCN_FILTERING = BIT(16),361}; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */362363enum iwl_wowlan_flags {364IS_11W_ASSOC = BIT(0),365ENABLE_L3_FILTERING = BIT(1),366ENABLE_NBNS_FILTERING = BIT(2),367ENABLE_DHCP_FILTERING = BIT(3),368ENABLE_STORE_BEACON = BIT(4),369};370371/**372* struct iwl_wowlan_config_cmd_v6 - WoWLAN configuration (versions 5 and 6)373* @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters374* @non_qos_seq: non-QoS sequence counter to use next.375* Reserved if the struct has version >= 6.376* @qos_seq: QoS sequence counters to use next377* @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down378* @is_11n_connection: indicates HT connection379* @offloading_tid: TID reserved for firmware use380* @flags: extra flags, see &enum iwl_wowlan_flags381* @sta_id: station ID for wowlan.382* @reserved: reserved383*/384struct iwl_wowlan_config_cmd_v6 {385__le32 wakeup_filter;386__le16 non_qos_seq;387__le16 qos_seq[8];388u8 wowlan_ba_teardown_tids;389u8 is_11n_connection;390u8 offloading_tid;391u8 flags;392u8 sta_id;393u8 reserved;394} __packed; /* WOWLAN_CONFIG_API_S_VER_6 */395396/**397* struct iwl_wowlan_config_cmd - WoWLAN configuration398* @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters399* @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down400* @is_11n_connection: indicates HT connection401* @offloading_tid: TID reserved for firmware use402* @flags: extra flags, see &enum iwl_wowlan_flags403* @sta_id: station ID for wowlan.404* @reserved: reserved405*/406struct iwl_wowlan_config_cmd {407__le32 wakeup_filter;408u8 wowlan_ba_teardown_tids;409u8 is_11n_connection;410u8 offloading_tid;411u8 flags;412u8 sta_id;413u8 reserved[3];414} __packed; /* WOWLAN_CONFIG_API_S_VER_7 */415416#define IWL_NUM_RSC 16417#define WOWLAN_KEY_MAX_SIZE 32418#define WOWLAN_GTK_KEYS_NUM 2419#define WOWLAN_IGTK_KEYS_NUM 2420#define WOWLAN_IGTK_MIN_INDEX 4421#define WOWLAN_BIGTK_KEYS_NUM 2422#define WOWLAN_BIGTK_MIN_INDEX 6423424/*425* WOWLAN_TSC_RSC_PARAMS426*/427struct tkip_sc {428__le16 iv16;429__le16 pad;430__le32 iv32;431} __packed; /* TKIP_SC_API_U_VER_1 */432433struct iwl_tkip_rsc_tsc {434struct tkip_sc unicast_rsc[IWL_NUM_RSC];435struct tkip_sc multicast_rsc[IWL_NUM_RSC];436struct tkip_sc tsc;437} __packed; /* TKIP_TSC_RSC_API_S_VER_1 */438439struct aes_sc {440__le64 pn;441} __packed; /* TKIP_AES_SC_API_U_VER_1 */442443struct iwl_aes_rsc_tsc {444struct aes_sc unicast_rsc[IWL_NUM_RSC];445struct aes_sc multicast_rsc[IWL_NUM_RSC];446struct aes_sc tsc;447} __packed; /* AES_TSC_RSC_API_S_VER_1 */448449union iwl_all_tsc_rsc {450struct iwl_tkip_rsc_tsc tkip;451struct iwl_aes_rsc_tsc aes;452}; /* ALL_TSC_RSC_API_S_VER_2 */453454struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 {455union iwl_all_tsc_rsc all_tsc_rsc;456} __packed; /* ALL_TSC_RSC_API_S_VER_2 */457458struct iwl_wowlan_rsc_tsc_params_cmd {459__le64 ucast_rsc[IWL_MAX_TID_COUNT];460__le64 mcast_rsc[WOWLAN_GTK_KEYS_NUM][IWL_MAX_TID_COUNT];461__le32 sta_id;462#define IWL_MCAST_KEY_MAP_INVALID 0xff463u8 mcast_key_id_map[4];464} __packed; /* ALL_TSC_RSC_API_S_VER_5 */465466#define IWL_MIC_KEY_SIZE 8467struct iwl_mic_keys {468u8 tx[IWL_MIC_KEY_SIZE];469u8 rx_unicast[IWL_MIC_KEY_SIZE];470u8 rx_mcast[IWL_MIC_KEY_SIZE];471} __packed; /* MIC_KEYS_API_S_VER_1 */472473#define IWL_P1K_SIZE 5474struct iwl_p1k_cache {475__le16 p1k[IWL_P1K_SIZE];476} __packed;477478#define IWL_NUM_RX_P1K_CACHE 2479480struct iwl_wowlan_tkip_params_cmd_ver_1 {481struct iwl_mic_keys mic_keys;482struct iwl_p1k_cache tx;483struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];484struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];485} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */486487struct iwl_wowlan_tkip_params_cmd {488struct iwl_mic_keys mic_keys;489struct iwl_p1k_cache tx;490struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];491struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];492u8 reversed[2];493__le32 sta_id;494} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */495496#define IWL_KCK_MAX_SIZE 32497#define IWL_KEK_MAX_SIZE 32498499struct iwl_wowlan_kek_kck_material_cmd_v2 {500u8 kck[IWL_KCK_MAX_SIZE];501u8 kek[IWL_KEK_MAX_SIZE];502__le16 kck_len;503__le16 kek_len;504__le64 replay_ctr;505} __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */506507struct iwl_wowlan_kek_kck_material_cmd_v3 {508u8 kck[IWL_KCK_MAX_SIZE];509u8 kek[IWL_KEK_MAX_SIZE];510__le16 kck_len;511__le16 kek_len;512__le64 replay_ctr;513__le32 akm;514__le32 gtk_cipher;515__le32 igtk_cipher;516__le32 bigtk_cipher;517} __packed; /* KEK_KCK_MATERIAL_API_S_VER_3 */518519struct iwl_wowlan_kek_kck_material_cmd_v4 {520__le32 sta_id;521u8 kck[IWL_KCK_MAX_SIZE];522u8 kek[IWL_KEK_MAX_SIZE];523__le16 kck_len;524__le16 kek_len;525__le64 replay_ctr;526__le32 akm;527__le32 gtk_cipher;528__le32 igtk_cipher;529__le32 bigtk_cipher;530} __packed; /* KEK_KCK_MATERIAL_API_S_VER_4 */531532struct iwl_wowlan_get_status_cmd {533__le32 sta_id;534} __packed; /* WOWLAN_GET_STATUSES_CMD_API_S_VER_1 */535536#define RF_KILL_INDICATOR_FOR_WOWLAN 0x87537538enum iwl_wowlan_rekey_status {539IWL_WOWLAN_REKEY_POST_REKEY = 0,540IWL_WOWLAN_REKEY_WHILE_REKEY = 1,541}; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */542543enum iwl_wowlan_wakeup_reason {544IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS = 0,545IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET = BIT(0),546IWL_WOWLAN_WAKEUP_BY_PATTERN = BIT(1),547IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),548IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH = BIT(3),549IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE = BIT(4),550IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED = BIT(5),551IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR = BIT(6),552IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST = BIT(7),553IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE = BIT(8),554IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS = BIT(9),555IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE = BIT(10),556IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL = BIT(11),557IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET = BIT(12),558IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET = BIT(13),559IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER = BIT(14),560IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN = BIT(15),561IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN = BIT(16),562IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC = BIT(17),563IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN = BIT(18),564IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD = BIT(19),565IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN = BIT(20),566IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD = BIT(21),567}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */568569struct iwl_wowlan_gtk_status_v1 {570u8 key_index;571u8 reserved[3];572u8 decrypt_key[16];573u8 tkip_mic_key[8];574struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;575} __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */576577/**578* struct iwl_wowlan_gtk_status_v2 - GTK status579* @key: GTK material580* @key_len: GTK legth, if set to 0, the key is not available581* @key_flags: information about the key:582* bits[0:1]: key index assigned by the AP583* bits[2:6]: GTK index of the key in the internal DB584* bit[7]: Set iff this is the currently used GTK585* @reserved: padding586* @tkip_mic_key: TKIP RX MIC key587* @rsc: TSC RSC counters588*/589struct iwl_wowlan_gtk_status_v2 {590u8 key[WOWLAN_KEY_MAX_SIZE];591u8 key_len;592u8 key_flags;593u8 reserved[2];594u8 tkip_mic_key[8];595struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;596} __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */597598/**599* struct iwl_wowlan_all_rsc_tsc_v5 - key counters600* @ucast_rsc: unicast RSC values601* @mcast_rsc: multicast RSC values (per key map value)602* @sta_id: station ID603* @mcast_key_id_map: map of key id to @mcast_rsc entry604*/605struct iwl_wowlan_all_rsc_tsc_v5 {606__le64 ucast_rsc[IWL_MAX_TID_COUNT];607__le64 mcast_rsc[2][IWL_MAX_TID_COUNT];608__le32 sta_id;609u8 mcast_key_id_map[4];610} __packed; /* ALL_TSC_RSC_API_S_VER_5 */611612/**613* struct iwl_wowlan_gtk_status_v3 - GTK status614* @key: GTK material615* @key_len: GTK length, if set to 0, the key is not available616* @key_flags: information about the key:617* bits[0:1]: key index assigned by the AP618* bits[2:6]: GTK index of the key in the internal DB619* bit[7]: Set iff this is the currently used GTK620* @reserved: padding621* @tkip_mic_key: TKIP RX MIC key622* @sc: RSC/TSC counters623*/624struct iwl_wowlan_gtk_status_v3 {625u8 key[WOWLAN_KEY_MAX_SIZE];626u8 key_len;627u8 key_flags;628u8 reserved[2];629u8 tkip_mic_key[IWL_MIC_KEY_SIZE];630struct iwl_wowlan_all_rsc_tsc_v5 sc;631} __packed; /* WOWLAN_GTK_MATERIAL_VER_3 */632633#define IWL_WOWLAN_GTK_IDX_MASK (BIT(0) | BIT(1))634#define IWL_WOWLAN_IGTK_BIGTK_IDX_MASK (BIT(0))635636/**637* struct iwl_wowlan_igtk_status - IGTK status638* @key: IGTK material639* @ipn: the IGTK packet number (replay counter)640* @key_len: IGTK length, if set to 0, the key is not available641* @key_flags: information about the key:642* bits[0]: key index assigned by the AP (0: index 4, 1: index 5)643* (0: index 6, 1: index 7 with bigtk)644* bits[1:5]: IGTK index of the key in the internal DB645* bit[6]: Set iff this is the currently used IGTK646*/647struct iwl_wowlan_igtk_status {648u8 key[WOWLAN_KEY_MAX_SIZE];649u8 ipn[6];650u8 key_len;651u8 key_flags;652} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */653654/**655* struct iwl_wowlan_status_v6 - WoWLAN status656* @gtk: GTK data657* @replay_ctr: GTK rekey replay counter658* @pattern_number: number of the matched pattern659* @non_qos_seq_ctr: non-QoS sequence counter to use next660* @qos_seq_ctr: QoS sequence counters to use next661* @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason662* @num_of_gtk_rekeys: number of GTK rekeys663* @transmitted_ndps: number of transmitted neighbor discovery packets664* @received_beacons: number of received beacons665* @wake_packet_length: wakeup packet length666* @wake_packet_bufsize: wakeup packet buffer size667* @wake_packet: wakeup packet668*/669struct iwl_wowlan_status_v6 {670struct iwl_wowlan_gtk_status_v1 gtk;671__le64 replay_ctr;672__le16 pattern_number;673__le16 non_qos_seq_ctr;674__le16 qos_seq_ctr[8];675__le32 wakeup_reasons;676__le32 num_of_gtk_rekeys;677__le32 transmitted_ndps;678__le32 received_beacons;679__le32 wake_packet_length;680__le32 wake_packet_bufsize;681u8 wake_packet[]; /* can be truncated from _length to _bufsize */682} __packed; /* WOWLAN_STATUSES_API_S_VER_6 */683684/**685* struct iwl_wowlan_status_v7 - WoWLAN status686* @gtk: GTK data687* @igtk: IGTK data688* @replay_ctr: GTK rekey replay counter689* @pattern_number: number of the matched pattern690* @non_qos_seq_ctr: non-QoS sequence counter to use next691* @qos_seq_ctr: QoS sequence counters to use next692* @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason693* @num_of_gtk_rekeys: number of GTK rekeys694* @transmitted_ndps: number of transmitted neighbor discovery packets695* @received_beacons: number of received beacons696* @wake_packet_length: wakeup packet length697* @wake_packet_bufsize: wakeup packet buffer size698* @wake_packet: wakeup packet699*/700struct iwl_wowlan_status_v7 {701struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];702struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];703__le64 replay_ctr;704__le16 pattern_number;705__le16 non_qos_seq_ctr;706__le16 qos_seq_ctr[8];707__le32 wakeup_reasons;708__le32 num_of_gtk_rekeys;709__le32 transmitted_ndps;710__le32 received_beacons;711__le32 wake_packet_length;712__le32 wake_packet_bufsize;713u8 wake_packet[]; /* can be truncated from _length to _bufsize */714} __packed; /* WOWLAN_STATUSES_API_S_VER_7 */715716/**717* struct iwl_wowlan_info_notif_v1 - WoWLAN information notification718* @gtk: GTK data719* @igtk: IGTK data720* @replay_ctr: GTK rekey replay counter721* @pattern_number: number of the matched patterns722* @reserved1: reserved723* @qos_seq_ctr: QoS sequence counters to use next724* @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason725* @num_of_gtk_rekeys: number of GTK rekeys726* @transmitted_ndps: number of transmitted neighbor discovery packets727* @received_beacons: number of received beacons728* @wake_packet_length: wakeup packet length729* @wake_packet_bufsize: wakeup packet buffer size730* @tid_tear_down: bit mask of tids whose BA sessions were closed731* in suspend state732* @station_id: station id733* @reserved2: reserved734*/735struct iwl_wowlan_info_notif_v1 {736struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];737struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];738__le64 replay_ctr;739__le16 pattern_number;740__le16 reserved1;741__le16 qos_seq_ctr[8];742__le32 wakeup_reasons;743__le32 num_of_gtk_rekeys;744__le32 transmitted_ndps;745__le32 received_beacons;746__le32 wake_packet_length;747__le32 wake_packet_bufsize;748u8 tid_tear_down;749u8 station_id;750u8 reserved2[2];751} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_1 */752753/* MAX MLO keys of non-active links that can arrive in the notification */754#define WOWLAN_MAX_MLO_KEYS 18755756/**757* enum iwl_wowlan_mlo_gtk_type - GTK types758* @WOWLAN_MLO_GTK_KEY_TYPE_GTK: GTK759* @WOWLAN_MLO_GTK_KEY_TYPE_IGTK: IGTK760* @WOWLAN_MLO_GTK_KEY_TYPE_BIGTK: BIGTK761* @WOWLAN_MLO_GTK_KEY_NUM_TYPES: number of key types762*/763enum iwl_wowlan_mlo_gtk_type {764WOWLAN_MLO_GTK_KEY_TYPE_GTK,765WOWLAN_MLO_GTK_KEY_TYPE_IGTK,766WOWLAN_MLO_GTK_KEY_TYPE_BIGTK,767WOWLAN_MLO_GTK_KEY_NUM_TYPES768}; /* WOWLAN_MLO_GTK_KEY_TYPE_API_E_VER_1 */769770/**771* enum iwl_wowlan_mlo_gtk_flag - MLO GTK flags772* @WOWLAN_MLO_GTK_FLAG_KEY_LEN_MSK: 0 for len 16, 1 for len 32773* @WOWLAN_MLO_GTK_FLAG_KEY_ID_MSK: key id (ranges from 0 to 7)774* @WOWLAN_MLO_GTK_FLAG_LINK_ID_MSK: spec link id of the key775* @WOWLAN_MLO_GTK_FLAG_KEY_TYPE_MSK: &enum iwl_wowlan_mlo_gtk_type776* @WOWLAN_MLO_GTK_FLAG_LAST_KEY_MSK: is this the last given key per777* key-type / link-id - the currently used key778*/779enum iwl_wowlan_mlo_gtk_flag {780WOWLAN_MLO_GTK_FLAG_KEY_LEN_MSK = 0x0001,781WOWLAN_MLO_GTK_FLAG_KEY_ID_MSK = 0x000E,782WOWLAN_MLO_GTK_FLAG_LINK_ID_MSK = 0x00F0,783WOWLAN_MLO_GTK_FLAG_KEY_TYPE_MSK = 0x0300,784WOWLAN_MLO_GTK_FLAG_LAST_KEY_MSK = 0x0400785}; /* WOWLAN_MLO_GTK_FLAG_API_E_VER_1 */786787/**788* struct iwl_wowlan_mlo_gtk - MLO GTK info789* @key: key material790* @flags: &enum iwl_wowlan_mlo_gtk_flag791* @pn: packet number792*/793struct iwl_wowlan_mlo_gtk {794u8 key[WOWLAN_KEY_MAX_SIZE];795__le16 flags;796u8 pn[6];797} __packed; /* WOWLAN_MLO_GTK_KEY_API_S_VER_1 */798799/**800* struct iwl_wowlan_info_notif_v3 - WoWLAN information notification801* @gtk: GTK data802* @igtk: IGTK data803* @bigtk: BIGTK data804* @replay_ctr: GTK rekey replay counter805* @pattern_number: number of the matched patterns806* @reserved1: reserved807* @qos_seq_ctr: QoS sequence counters to use next808* @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason809* @num_of_gtk_rekeys: number of GTK rekeys810* @transmitted_ndps: number of transmitted neighbor discovery packets811* @received_beacons: number of received beacons812* @tid_tear_down: bit mask of tids whose BA sessions were closed813* in suspend state814* @station_id: station id815* @reserved2: reserved816*/817struct iwl_wowlan_info_notif_v3 {818struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];819struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];820struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];821__le64 replay_ctr;822__le16 pattern_number;823__le16 reserved1;824__le16 qos_seq_ctr[8];825__le32 wakeup_reasons;826__le32 num_of_gtk_rekeys;827__le32 transmitted_ndps;828__le32 received_beacons;829u8 tid_tear_down;830u8 station_id;831u8 reserved2[2];832} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_3 */833834/**835* struct iwl_wowlan_info_notif - WoWLAN information notification836* @gtk: GTK data837* @igtk: IGTK data838* @bigtk: BIGTK data839* @replay_ctr: GTK rekey replay counter840* @pattern_number: number of the matched patterns841* @qos_seq_ctr: QoS sequence counters to use next842* @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason843* @num_of_gtk_rekeys: number of GTK rekeys844* @transmitted_ndps: number of transmitted neighbor discovery packets845* @received_beacons: number of received beacons846* @tid_tear_down: bit mask of tids whose BA sessions were closed847* in suspend state848* @station_id: station id849* @num_mlo_link_keys: number of &struct iwl_wowlan_mlo_gtk structs850* following this notif851* @tid_offloaded_tx: tid used by the firmware to transmit data packets852* while in wowlan853* @mlo_gtks: array of GTKs of size num_mlo_link_keys854*/855struct iwl_wowlan_info_notif {856struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];857struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];858struct iwl_wowlan_igtk_status bigtk[WOWLAN_BIGTK_KEYS_NUM];859__le64 replay_ctr;860__le16 pattern_number;861__le16 qos_seq_ctr;862__le32 wakeup_reasons;863__le32 num_of_gtk_rekeys;864__le32 transmitted_ndps;865__le32 received_beacons;866u8 tid_tear_down;867u8 station_id;868u8 num_mlo_link_keys;869u8 tid_offloaded_tx;870struct iwl_wowlan_mlo_gtk mlo_gtks[];871} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_5 */872873/**874* struct iwl_wowlan_wake_pkt_notif - WoWLAN wake packet notification875* @wake_packet_length: wakeup packet length876* @station_id: station id877* @reserved: unused878* @wake_packet: wakeup packet879*/880struct iwl_wowlan_wake_pkt_notif {881__le32 wake_packet_length;882u8 station_id;883u8 reserved[3];884u8 wake_packet[1];885} __packed; /* WOWLAN_WAKE_PKT_NTFY_API_S_VER_1 */886887/**888* struct iwl_mvm_d3_end_notif - d3 end notification889* @flags: See &enum iwl_d0i3_flags890*/891struct iwl_d3_end_notif {892__le32 flags;893} __packed;894895/* TODO: NetDetect API */896897#endif /* __iwl_fw_api_d3_h__ */898899900