Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
0002 /*
0003  * Copyright (C) 2012-2014, 2018-2021 Intel Corporation
0004  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
0005  * Copyright (C) 2015-2017 Intel Deutschland GmbH
0006  */
0007 #ifndef __iwl_fw_api_d3_h__
0008 #define __iwl_fw_api_d3_h__
0009 #include <iwl-trans.h>
0010 
0011 /**
0012  * enum iwl_d0i3_flags - d0i3 flags
0013  * @IWL_D0I3_RESET_REQUIRE: FW require reset upon resume
0014  */
0015 enum iwl_d0i3_flags {
0016     IWL_D0I3_RESET_REQUIRE = BIT(0),
0017 };
0018 
0019 /**
0020  * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
0021  * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
0022  */
0023 enum iwl_d3_wakeup_flags {
0024     IWL_WAKEUP_D3_CONFIG_FW_ERROR = BIT(0),
0025 }; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */
0026 
0027 /**
0028  * struct iwl_d3_manager_config - D3 manager configuration command
0029  * @min_sleep_time: minimum sleep time (in usec)
0030  * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
0031  * @wakeup_host_timer: force wakeup after this many seconds
0032  *
0033  * The structure is used for the D3_CONFIG_CMD command.
0034  */
0035 struct iwl_d3_manager_config {
0036     __le32 min_sleep_time;
0037     __le32 wakeup_flags;
0038     __le32 wakeup_host_timer;
0039 } __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */
0040 
0041 
0042 /* TODO: OFFLOADS_QUERY_API_S_VER_1 */
0043 
0044 /**
0045  * enum iwl_d3_proto_offloads - enabled protocol offloads
0046  * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
0047  * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
0048  * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
0049  * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
0050  */
0051 enum iwl_proto_offloads {
0052     IWL_D3_PROTO_OFFLOAD_ARP = BIT(0),
0053     IWL_D3_PROTO_OFFLOAD_NS = BIT(1),
0054     IWL_D3_PROTO_IPV4_VALID = BIT(2),
0055     IWL_D3_PROTO_IPV6_VALID = BIT(3),
0056 };
0057 
0058 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1 2
0059 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2 6
0060 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L    12
0061 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S    4
0062 #define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX    12
0063 
0064 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L 4
0065 #define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S 2
0066 
0067 /**
0068  * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
0069  * @enabled: enable flags
0070  * @remote_ipv4_addr: remote address to answer to (or zero if all)
0071  * @host_ipv4_addr: our IPv4 address to respond to queries for
0072  * @arp_mac_addr: our MAC address for ARP responses
0073  * @reserved: unused
0074  */
0075 struct iwl_proto_offload_cmd_common {
0076     __le32 enabled;
0077     __be32 remote_ipv4_addr;
0078     __be32 host_ipv4_addr;
0079     u8 arp_mac_addr[ETH_ALEN];
0080     __le16 reserved;
0081 } __packed;
0082 
0083 /**
0084  * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
0085  * @common: common/IPv4 configuration
0086  * @remote_ipv6_addr: remote address to answer to (or zero if all)
0087  * @solicited_node_ipv6_addr: broken -- solicited node address exists
0088  *  for each target address
0089  * @target_ipv6_addr: our target addresses
0090  * @ndp_mac_addr: neighbor solicitation response MAC address
0091  * @reserved2: reserved
0092  */
0093 struct iwl_proto_offload_cmd_v1 {
0094     struct iwl_proto_offload_cmd_common common;
0095     u8 remote_ipv6_addr[16];
0096     u8 solicited_node_ipv6_addr[16];
0097     u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1][16];
0098     u8 ndp_mac_addr[ETH_ALEN];
0099     __le16 reserved2;
0100 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */
0101 
0102 /**
0103  * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
0104  * @common: common/IPv4 configuration
0105  * @remote_ipv6_addr: remote address to answer to (or zero if all)
0106  * @solicited_node_ipv6_addr: broken -- solicited node address exists
0107  *  for each target address
0108  * @target_ipv6_addr: our target addresses
0109  * @ndp_mac_addr: neighbor solicitation response MAC address
0110  * @num_valid_ipv6_addrs: number of valid IPv6 addresses
0111  * @reserved2: reserved
0112  */
0113 struct iwl_proto_offload_cmd_v2 {
0114     struct iwl_proto_offload_cmd_common common;
0115     u8 remote_ipv6_addr[16];
0116     u8 solicited_node_ipv6_addr[16];
0117     u8 target_ipv6_addr[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2][16];
0118     u8 ndp_mac_addr[ETH_ALEN];
0119     u8 num_valid_ipv6_addrs;
0120     u8 reserved2[3];
0121 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */
0122 
0123 struct iwl_ns_config {
0124     struct in6_addr source_ipv6_addr;
0125     struct in6_addr dest_ipv6_addr;
0126     u8 target_mac_addr[ETH_ALEN];
0127     __le16 reserved;
0128 } __packed; /* NS_OFFLOAD_CONFIG */
0129 
0130 struct iwl_targ_addr {
0131     struct in6_addr addr;
0132     __le32 config_num;
0133 } __packed; /* TARGET_IPV6_ADDRESS */
0134 
0135 /**
0136  * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
0137  * @common: common/IPv4 configuration
0138  * @num_valid_ipv6_addrs: number of valid IPv6 addresses
0139  * @targ_addrs: target IPv6 addresses
0140  * @ns_config: NS offload configurations
0141  */
0142 struct iwl_proto_offload_cmd_v3_small {
0143     struct iwl_proto_offload_cmd_common common;
0144     __le32 num_valid_ipv6_addrs;
0145     struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S];
0146     struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S];
0147 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
0148 
0149 /**
0150  * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
0151  * @common: common/IPv4 configuration
0152  * @num_valid_ipv6_addrs: number of valid IPv6 addresses
0153  * @targ_addrs: target IPv6 addresses
0154  * @ns_config: NS offload configurations
0155  */
0156 struct iwl_proto_offload_cmd_v3_large {
0157     struct iwl_proto_offload_cmd_common common;
0158     __le32 num_valid_ipv6_addrs;
0159     struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
0160     struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
0161 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */
0162 
0163 /**
0164  * struct iwl_proto_offload_cmd_v4 - ARP/NS offload configuration
0165  * @sta_id: station id
0166  * @common: common/IPv4 configuration
0167  * @num_valid_ipv6_addrs: number of valid IPv6 addresses
0168  * @targ_addrs: target IPv6 addresses
0169  * @ns_config: NS offload configurations
0170  */
0171 struct iwl_proto_offload_cmd_v4 {
0172     __le32 sta_id;
0173     struct iwl_proto_offload_cmd_common common;
0174     __le32 num_valid_ipv6_addrs;
0175     struct iwl_targ_addr targ_addrs[IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L];
0176     struct iwl_ns_config ns_config[IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L];
0177 } __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_4 */
0178 
0179 /*
0180  * WOWLAN_PATTERNS
0181  */
0182 #define IWL_WOWLAN_MIN_PATTERN_LEN  16
0183 #define IWL_WOWLAN_MAX_PATTERN_LEN  128
0184 
0185 struct iwl_wowlan_pattern_v1 {
0186     u8 mask[IWL_WOWLAN_MAX_PATTERN_LEN / 8];
0187     u8 pattern[IWL_WOWLAN_MAX_PATTERN_LEN];
0188     u8 mask_size;
0189     u8 pattern_size;
0190     __le16 reserved;
0191 } __packed; /* WOWLAN_PATTERN_API_S_VER_1 */
0192 
0193 #define IWL_WOWLAN_MAX_PATTERNS 20
0194 
0195 /**
0196  * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns
0197  */
0198 struct iwl_wowlan_patterns_cmd_v1 {
0199     /**
0200      * @n_patterns: number of patterns
0201      */
0202     __le32 n_patterns;
0203 
0204     /**
0205      * @patterns: the patterns, array length in @n_patterns
0206      */
0207     struct iwl_wowlan_pattern_v1 patterns[];
0208 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */
0209 
0210 #define IPV4_ADDR_SIZE  4
0211 #define IPV6_ADDR_SIZE  16
0212 
0213 enum iwl_wowlan_pattern_type {
0214     WOWLAN_PATTERN_TYPE_BITMASK,
0215     WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN,
0216     WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN,
0217     WOWLAN_PATTERN_TYPE_IPV4_TCP_SYN_WILDCARD,
0218     WOWLAN_PATTERN_TYPE_IPV6_TCP_SYN_WILDCARD,
0219 }; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */
0220 
0221 /**
0222  * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data
0223  */
0224 struct iwl_wowlan_ipv4_tcp_syn {
0225     /**
0226      * @src_addr: source IP address to match
0227      */
0228     u8 src_addr[IPV4_ADDR_SIZE];
0229 
0230     /**
0231      * @dst_addr: destination IP address to match
0232      */
0233     u8 dst_addr[IPV4_ADDR_SIZE];
0234 
0235     /**
0236      * @src_port: source TCP port to match
0237      */
0238     __le16 src_port;
0239 
0240     /**
0241      * @dst_port: destination TCP port to match
0242      */
0243     __le16 dst_port;
0244 } __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */
0245 
0246 /**
0247  * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data
0248  */
0249 struct iwl_wowlan_ipv6_tcp_syn {
0250     /**
0251      * @src_addr: source IP address to match
0252      */
0253     u8 src_addr[IPV6_ADDR_SIZE];
0254 
0255     /**
0256      * @dst_addr: destination IP address to match
0257      */
0258     u8 dst_addr[IPV6_ADDR_SIZE];
0259 
0260     /**
0261      * @src_port: source TCP port to match
0262      */
0263     __le16 src_port;
0264 
0265     /**
0266      * @dst_port: destination TCP port to match
0267      */
0268     __le16 dst_port;
0269 } __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */
0270 
0271 /**
0272  * union iwl_wowlan_pattern_data - Data for the different pattern types
0273  *
0274  * If wildcard addresses/ports are to be used, the union can be left
0275  * undefined.
0276  */
0277 union iwl_wowlan_pattern_data {
0278     /**
0279      * @bitmask: bitmask pattern data
0280      */
0281     struct iwl_wowlan_pattern_v1 bitmask;
0282 
0283     /**
0284      * @ipv4_tcp_syn: IPv4 TCP SYN pattern data
0285      */
0286     struct iwl_wowlan_ipv4_tcp_syn ipv4_tcp_syn;
0287 
0288     /**
0289      * @ipv6_tcp_syn: IPv6 TCP SYN pattern data
0290      */
0291     struct iwl_wowlan_ipv6_tcp_syn ipv6_tcp_syn;
0292 }; /* WOWLAN_PATTERN_API_U_VER_1 */
0293 
0294 /**
0295  * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns
0296  */
0297 struct iwl_wowlan_pattern_v2 {
0298     /**
0299      * @pattern_type: defines the struct type to be used in the union
0300      */
0301     u8 pattern_type;
0302 
0303     /**
0304      * @reserved: reserved for alignment
0305      */
0306     u8 reserved[3];
0307 
0308     /**
0309      * @u: the union containing the match data, or undefined for
0310      *     wildcard matches
0311      */
0312     union iwl_wowlan_pattern_data u;
0313 } __packed; /* WOWLAN_PATTERN_API_S_VER_2 */
0314 
0315 /**
0316  * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command
0317  */
0318 struct iwl_wowlan_patterns_cmd {
0319     /**
0320      * @n_patterns: number of patterns
0321      */
0322     u8 n_patterns;
0323 
0324     /**
0325      * @n_patterns: sta_id
0326      */
0327     u8 sta_id;
0328 
0329     /**
0330      * @reserved: reserved for alignment
0331      */
0332     __le16 reserved;
0333 
0334     /**
0335      * @patterns: the patterns, array length in @n_patterns
0336      */
0337     struct iwl_wowlan_pattern_v2 patterns[];
0338 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_3 */
0339 
0340 enum iwl_wowlan_wakeup_filters {
0341     IWL_WOWLAN_WAKEUP_MAGIC_PACKET          = BIT(0),
0342     IWL_WOWLAN_WAKEUP_PATTERN_MATCH         = BIT(1),
0343     IWL_WOWLAN_WAKEUP_BEACON_MISS           = BIT(2),
0344     IWL_WOWLAN_WAKEUP_LINK_CHANGE           = BIT(3),
0345     IWL_WOWLAN_WAKEUP_GTK_REKEY_FAIL        = BIT(4),
0346     IWL_WOWLAN_WAKEUP_EAP_IDENT_REQ         = BIT(5),
0347     IWL_WOWLAN_WAKEUP_4WAY_HANDSHAKE        = BIT(6),
0348     IWL_WOWLAN_WAKEUP_ENABLE_NET_DETECT     = BIT(7),
0349     IWL_WOWLAN_WAKEUP_RF_KILL_DEASSERT      = BIT(8),
0350     IWL_WOWLAN_WAKEUP_REMOTE_LINK_LOSS      = BIT(9),
0351     IWL_WOWLAN_WAKEUP_REMOTE_SIGNATURE_TABLE    = BIT(10),
0352     IWL_WOWLAN_WAKEUP_REMOTE_TCP_EXTERNAL       = BIT(11),
0353     IWL_WOWLAN_WAKEUP_REMOTE_WAKEUP_PACKET      = BIT(12),
0354     IWL_WOWLAN_WAKEUP_IOAC_MAGIC_PACKET     = BIT(13),
0355     IWL_WOWLAN_WAKEUP_HOST_TIMER            = BIT(14),
0356     IWL_WOWLAN_WAKEUP_RX_FRAME          = BIT(15),
0357     IWL_WOWLAN_WAKEUP_BCN_FILTERING         = BIT(16),
0358 }; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */
0359 
0360 enum iwl_wowlan_flags {
0361     IS_11W_ASSOC        = BIT(0),
0362     ENABLE_L3_FILTERING = BIT(1),
0363     ENABLE_NBNS_FILTERING   = BIT(2),
0364     ENABLE_DHCP_FILTERING   = BIT(3),
0365     ENABLE_STORE_BEACON = BIT(4),
0366 };
0367 
0368 /**
0369  * struct iwl_wowlan_config_cmd - WoWLAN configuration (versions 5 and 6)
0370  * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
0371  * @non_qos_seq: non-QoS sequence counter to use next.
0372  *               Reserved if the struct has version >= 6.
0373  * @qos_seq: QoS sequence counters to use next
0374  * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
0375  * @is_11n_connection: indicates HT connection
0376  * @offloading_tid: TID reserved for firmware use
0377  * @flags: extra flags, see &enum iwl_wowlan_flags
0378  * @sta_id: station ID for wowlan.
0379  * @reserved: reserved
0380  */
0381 struct iwl_wowlan_config_cmd {
0382     __le32 wakeup_filter;
0383     __le16 non_qos_seq;
0384     __le16 qos_seq[8];
0385     u8 wowlan_ba_teardown_tids;
0386     u8 is_11n_connection;
0387     u8 offloading_tid;
0388     u8 flags;
0389     u8 sta_id;
0390     u8 reserved;
0391 } __packed; /* WOWLAN_CONFIG_API_S_VER_5 */
0392 
0393 #define IWL_NUM_RSC 16
0394 #define WOWLAN_KEY_MAX_SIZE 32
0395 #define WOWLAN_GTK_KEYS_NUM     2
0396 #define WOWLAN_IGTK_KEYS_NUM    2
0397 
0398 /*
0399  * WOWLAN_TSC_RSC_PARAMS
0400  */
0401 struct tkip_sc {
0402     __le16 iv16;
0403     __le16 pad;
0404     __le32 iv32;
0405 } __packed; /* TKIP_SC_API_U_VER_1 */
0406 
0407 struct iwl_tkip_rsc_tsc {
0408     struct tkip_sc unicast_rsc[IWL_NUM_RSC];
0409     struct tkip_sc multicast_rsc[IWL_NUM_RSC];
0410     struct tkip_sc tsc;
0411 } __packed; /* TKIP_TSC_RSC_API_S_VER_1 */
0412 
0413 struct aes_sc {
0414     __le64 pn;
0415 } __packed; /* TKIP_AES_SC_API_U_VER_1 */
0416 
0417 struct iwl_aes_rsc_tsc {
0418     struct aes_sc unicast_rsc[IWL_NUM_RSC];
0419     struct aes_sc multicast_rsc[IWL_NUM_RSC];
0420     struct aes_sc tsc;
0421 } __packed; /* AES_TSC_RSC_API_S_VER_1 */
0422 
0423 union iwl_all_tsc_rsc {
0424     struct iwl_tkip_rsc_tsc tkip;
0425     struct iwl_aes_rsc_tsc aes;
0426 }; /* ALL_TSC_RSC_API_S_VER_2 */
0427 
0428 struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 {
0429     union iwl_all_tsc_rsc all_tsc_rsc;
0430 } __packed; /* ALL_TSC_RSC_API_S_VER_2 */
0431 
0432 struct iwl_wowlan_rsc_tsc_params_cmd_v4 {
0433     struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 params;
0434     __le32 sta_id;
0435 } __packed; /* ALL_TSC_RSC_API_S_VER_4 */
0436 
0437 struct iwl_wowlan_rsc_tsc_params_cmd {
0438     __le64 ucast_rsc[IWL_MAX_TID_COUNT];
0439     __le64 mcast_rsc[WOWLAN_GTK_KEYS_NUM][IWL_MAX_TID_COUNT];
0440     __le32 sta_id;
0441 #define IWL_MCAST_KEY_MAP_INVALID   0xff
0442     u8 mcast_key_id_map[4];
0443 } __packed; /* ALL_TSC_RSC_API_S_VER_5 */
0444 
0445 #define IWL_MIC_KEY_SIZE    8
0446 struct iwl_mic_keys {
0447     u8 tx[IWL_MIC_KEY_SIZE];
0448     u8 rx_unicast[IWL_MIC_KEY_SIZE];
0449     u8 rx_mcast[IWL_MIC_KEY_SIZE];
0450 } __packed; /* MIC_KEYS_API_S_VER_1 */
0451 
0452 #define IWL_P1K_SIZE        5
0453 struct iwl_p1k_cache {
0454     __le16 p1k[IWL_P1K_SIZE];
0455 } __packed;
0456 
0457 #define IWL_NUM_RX_P1K_CACHE    2
0458 
0459 struct iwl_wowlan_tkip_params_cmd_ver_1 {
0460     struct iwl_mic_keys mic_keys;
0461     struct iwl_p1k_cache tx;
0462     struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
0463     struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
0464 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */
0465 
0466 struct iwl_wowlan_tkip_params_cmd {
0467     struct iwl_mic_keys mic_keys;
0468     struct iwl_p1k_cache tx;
0469     struct iwl_p1k_cache rx_uni[IWL_NUM_RX_P1K_CACHE];
0470     struct iwl_p1k_cache rx_multi[IWL_NUM_RX_P1K_CACHE];
0471     u8     reversed[2];
0472     __le32 sta_id;
0473 } __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */
0474 
0475 #define IWL_KCK_MAX_SIZE    32
0476 #define IWL_KEK_MAX_SIZE    32
0477 
0478 struct iwl_wowlan_kek_kck_material_cmd_v2 {
0479     u8  kck[IWL_KCK_MAX_SIZE];
0480     u8  kek[IWL_KEK_MAX_SIZE];
0481     __le16  kck_len;
0482     __le16  kek_len;
0483     __le64  replay_ctr;
0484 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */
0485 
0486 struct iwl_wowlan_kek_kck_material_cmd_v3 {
0487     u8  kck[IWL_KCK_MAX_SIZE];
0488     u8  kek[IWL_KEK_MAX_SIZE];
0489     __le16  kck_len;
0490     __le16  kek_len;
0491     __le64  replay_ctr;
0492     __le32  akm;
0493     __le32  gtk_cipher;
0494     __le32  igtk_cipher;
0495     __le32  bigtk_cipher;
0496 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_3 */
0497 
0498 struct iwl_wowlan_kek_kck_material_cmd_v4 {
0499     __le32  sta_id;
0500     u8  kck[IWL_KCK_MAX_SIZE];
0501     u8  kek[IWL_KEK_MAX_SIZE];
0502     __le16  kck_len;
0503     __le16  kek_len;
0504     __le64  replay_ctr;
0505     __le32  akm;
0506     __le32  gtk_cipher;
0507     __le32  igtk_cipher;
0508     __le32  bigtk_cipher;
0509 } __packed; /* KEK_KCK_MATERIAL_API_S_VER_4 */
0510 
0511 struct iwl_wowlan_get_status_cmd {
0512     __le32  sta_id;
0513 } __packed; /* WOWLAN_GET_STATUSES_CMD_API_S_VER_1 */
0514 
0515 #define RF_KILL_INDICATOR_FOR_WOWLAN    0x87
0516 
0517 enum iwl_wowlan_rekey_status {
0518     IWL_WOWLAN_REKEY_POST_REKEY = 0,
0519     IWL_WOWLAN_REKEY_WHILE_REKEY = 1,
0520 }; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */
0521 
0522 enum iwl_wowlan_wakeup_reason {
0523     IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS           = 0,
0524     IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET           = BIT(0),
0525     IWL_WOWLAN_WAKEUP_BY_PATTERN                = BIT(1),
0526     IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON = BIT(2),
0527     IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH        = BIT(3),
0528     IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE          = BIT(4),
0529     IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED          = BIT(5),
0530     IWL_WOWLAN_WAKEUP_BY_UCODE_ERROR            = BIT(6),
0531     IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST          = BIT(7),
0532     IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE         = BIT(8),
0533     IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS         = BIT(9),
0534     IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE       = BIT(10),
0535     IWL_WOWLAN_WAKEUP_BY_REM_WAKE_TCP_EXTERNAL      = BIT(11),
0536     IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET     = BIT(12),
0537     IWL_WOWLAN_WAKEUP_BY_IOAC_MAGIC_PACKET          = BIT(13),
0538     IWL_WOWLAN_WAKEUP_BY_D3_WAKEUP_HOST_TIMER       = BIT(14),
0539     IWL_WOWLAN_WAKEUP_BY_RXFRAME_FILTERED_IN        = BIT(15),
0540     IWL_WOWLAN_WAKEUP_BY_BEACON_FILTERED_IN         = BIT(16),
0541     IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC    = BIT(17),
0542     IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN          = BIT(18),
0543     IWL_WAKEUP_BY_PATTERN_IPV4_TCP_SYN_WILDCARD     = BIT(19),
0544     IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN          = BIT(20),
0545     IWL_WAKEUP_BY_PATTERN_IPV6_TCP_SYN_WILDCARD     = BIT(21),
0546 }; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */
0547 
0548 struct iwl_wowlan_gtk_status_v1 {
0549     u8 key_index;
0550     u8 reserved[3];
0551     u8 decrypt_key[16];
0552     u8 tkip_mic_key[8];
0553     struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
0554 } __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */
0555 
0556 /**
0557  * struct iwl_wowlan_gtk_status_v2 - GTK status
0558  * @key: GTK material
0559  * @key_len: GTK legth, if set to 0, the key is not available
0560  * @key_flags: information about the key:
0561  *  bits[0:1]:  key index assigned by the AP
0562  *  bits[2:6]:  GTK index of the key in the internal DB
0563  *  bit[7]:     Set iff this is the currently used GTK
0564  * @reserved: padding
0565  * @tkip_mic_key: TKIP RX MIC key
0566  * @rsc: TSC RSC counters
0567  */
0568 struct iwl_wowlan_gtk_status_v2 {
0569     u8 key[WOWLAN_KEY_MAX_SIZE];
0570     u8 key_len;
0571     u8 key_flags;
0572     u8 reserved[2];
0573     u8 tkip_mic_key[8];
0574     struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 rsc;
0575 } __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */
0576 
0577 /**
0578  * struct iwl_wowlan_all_rsc_tsc_v5 - key counters
0579  * @ucast_rsc: unicast RSC values
0580  * @mcast_rsc: multicast RSC values (per key map value)
0581  * @sta_id: station ID
0582  * @mcast_key_id_map: map of key id to @mcast_rsc entry
0583  */
0584 struct iwl_wowlan_all_rsc_tsc_v5 {
0585     __le64 ucast_rsc[IWL_MAX_TID_COUNT];
0586     __le64 mcast_rsc[2][IWL_MAX_TID_COUNT];
0587     __le32 sta_id;
0588     u8 mcast_key_id_map[4];
0589 } __packed; /* ALL_TSC_RSC_API_S_VER_5 */
0590 
0591 /**
0592  * struct iwl_wowlan_gtk_status_v3 - GTK status
0593  * @key: GTK material
0594  * @key_len: GTK length, if set to 0, the key is not available
0595  * @key_flags: information about the key:
0596  *  bits[0:1]:  key index assigned by the AP
0597  *  bits[2:6]:  GTK index of the key in the internal DB
0598  *  bit[7]:     Set iff this is the currently used GTK
0599  * @reserved: padding
0600  * @tkip_mic_key: TKIP RX MIC key
0601  * @sc: RSC/TSC counters
0602  */
0603 struct iwl_wowlan_gtk_status_v3 {
0604     u8 key[WOWLAN_KEY_MAX_SIZE];
0605     u8 key_len;
0606     u8 key_flags;
0607     u8 reserved[2];
0608     u8 tkip_mic_key[IWL_MIC_KEY_SIZE];
0609     struct iwl_wowlan_all_rsc_tsc_v5 sc;
0610 } __packed; /* WOWLAN_GTK_MATERIAL_VER_3 */
0611 
0612 #define IWL_WOWLAN_GTK_IDX_MASK     (BIT(0) | BIT(1))
0613 
0614 /**
0615  * struct iwl_wowlan_igtk_status - IGTK status
0616  * @key: IGTK material
0617  * @ipn: the IGTK packet number (replay counter)
0618  * @key_len: IGTK length, if set to 0, the key is not available
0619  * @key_flags: information about the key:
0620  *  bits[0]:    key index assigned by the AP (0: index 4, 1: index 5)
0621  *  bits[1:5]:  IGTK index of the key in the internal DB
0622  *  bit[6]:     Set iff this is the currently used IGTK
0623  */
0624 struct iwl_wowlan_igtk_status {
0625     u8 key[WOWLAN_KEY_MAX_SIZE];
0626     u8 ipn[6];
0627     u8 key_len;
0628     u8 key_flags;
0629 } __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */
0630 
0631 /**
0632  * struct iwl_wowlan_status_v6 - WoWLAN status
0633  * @gtk: GTK data
0634  * @replay_ctr: GTK rekey replay counter
0635  * @pattern_number: number of the matched pattern
0636  * @non_qos_seq_ctr: non-QoS sequence counter to use next
0637  * @qos_seq_ctr: QoS sequence counters to use next
0638  * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
0639  * @num_of_gtk_rekeys: number of GTK rekeys
0640  * @transmitted_ndps: number of transmitted neighbor discovery packets
0641  * @received_beacons: number of received beacons
0642  * @wake_packet_length: wakeup packet length
0643  * @wake_packet_bufsize: wakeup packet buffer size
0644  * @wake_packet: wakeup packet
0645  */
0646 struct iwl_wowlan_status_v6 {
0647     struct iwl_wowlan_gtk_status_v1 gtk;
0648     __le64 replay_ctr;
0649     __le16 pattern_number;
0650     __le16 non_qos_seq_ctr;
0651     __le16 qos_seq_ctr[8];
0652     __le32 wakeup_reasons;
0653     __le32 num_of_gtk_rekeys;
0654     __le32 transmitted_ndps;
0655     __le32 received_beacons;
0656     __le32 wake_packet_length;
0657     __le32 wake_packet_bufsize;
0658     u8 wake_packet[]; /* can be truncated from _length to _bufsize */
0659 } __packed; /* WOWLAN_STATUSES_API_S_VER_6 */
0660 
0661 /**
0662  * struct iwl_wowlan_status_v7 - WoWLAN status
0663  * @gtk: GTK data
0664  * @igtk: IGTK data
0665  * @replay_ctr: GTK rekey replay counter
0666  * @pattern_number: number of the matched pattern
0667  * @non_qos_seq_ctr: non-QoS sequence counter to use next
0668  * @qos_seq_ctr: QoS sequence counters to use next
0669  * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
0670  * @num_of_gtk_rekeys: number of GTK rekeys
0671  * @transmitted_ndps: number of transmitted neighbor discovery packets
0672  * @received_beacons: number of received beacons
0673  * @wake_packet_length: wakeup packet length
0674  * @wake_packet_bufsize: wakeup packet buffer size
0675  * @wake_packet: wakeup packet
0676  */
0677 struct iwl_wowlan_status_v7 {
0678     struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
0679     struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
0680     __le64 replay_ctr;
0681     __le16 pattern_number;
0682     __le16 non_qos_seq_ctr;
0683     __le16 qos_seq_ctr[8];
0684     __le32 wakeup_reasons;
0685     __le32 num_of_gtk_rekeys;
0686     __le32 transmitted_ndps;
0687     __le32 received_beacons;
0688     __le32 wake_packet_length;
0689     __le32 wake_packet_bufsize;
0690     u8 wake_packet[]; /* can be truncated from _length to _bufsize */
0691 } __packed; /* WOWLAN_STATUSES_API_S_VER_7 */
0692 
0693 /**
0694  * struct iwl_wowlan_status_v9 - WoWLAN status (versions 9 and 10)
0695  * @gtk: GTK data
0696  * @igtk: IGTK data
0697  * @replay_ctr: GTK rekey replay counter
0698  * @pattern_number: number of the matched pattern
0699  * @non_qos_seq_ctr: non-QoS sequence counter to use next.
0700  *                   Reserved if the struct has version >= 10.
0701  * @qos_seq_ctr: QoS sequence counters to use next
0702  * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
0703  * @num_of_gtk_rekeys: number of GTK rekeys
0704  * @transmitted_ndps: number of transmitted neighbor discovery packets
0705  * @received_beacons: number of received beacons
0706  * @wake_packet_length: wakeup packet length
0707  * @wake_packet_bufsize: wakeup packet buffer size
0708  * @tid_tear_down: bit mask of tids whose BA sessions were closed
0709  *         in suspend state
0710  * @reserved: unused
0711  * @wake_packet: wakeup packet
0712  */
0713 struct iwl_wowlan_status_v9 {
0714     struct iwl_wowlan_gtk_status_v2 gtk[WOWLAN_GTK_KEYS_NUM];
0715     struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
0716     __le64 replay_ctr;
0717     __le16 pattern_number;
0718     __le16 non_qos_seq_ctr;
0719     __le16 qos_seq_ctr[8];
0720     __le32 wakeup_reasons;
0721     __le32 num_of_gtk_rekeys;
0722     __le32 transmitted_ndps;
0723     __le32 received_beacons;
0724     __le32 wake_packet_length;
0725     __le32 wake_packet_bufsize;
0726     u8 tid_tear_down;
0727     u8 reserved[3];
0728     u8 wake_packet[]; /* can be truncated from _length to _bufsize */
0729 } __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_9 */
0730 
0731 /**
0732  * struct iwl_wowlan_status_v12 - WoWLAN status
0733  * @gtk: GTK data
0734  * @igtk: IGTK data
0735  * @replay_ctr: GTK rekey replay counter
0736  * @pattern_number: number of the matched pattern
0737  * @non_qos_seq_ctr: non-QoS sequence counter to use next.
0738  *                   Reserved if the struct has version >= 10.
0739  * @qos_seq_ctr: QoS sequence counters to use next
0740  * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
0741  * @num_of_gtk_rekeys: number of GTK rekeys
0742  * @transmitted_ndps: number of transmitted neighbor discovery packets
0743  * @received_beacons: number of received beacons
0744  * @wake_packet_length: wakeup packet length
0745  * @wake_packet_bufsize: wakeup packet buffer size
0746  * @tid_tear_down: bit mask of tids whose BA sessions were closed
0747  *         in suspend state
0748  * @reserved: unused
0749  * @wake_packet: wakeup packet
0750  */
0751 struct iwl_wowlan_status_v12 {
0752     struct iwl_wowlan_gtk_status_v3 gtk[WOWLAN_GTK_KEYS_NUM];
0753     struct iwl_wowlan_igtk_status igtk[WOWLAN_IGTK_KEYS_NUM];
0754     __le64 replay_ctr;
0755     __le16 pattern_number;
0756     __le16 non_qos_seq_ctr;
0757     __le16 qos_seq_ctr[8];
0758     __le32 wakeup_reasons;
0759     __le32 num_of_gtk_rekeys;
0760     __le32 transmitted_ndps;
0761     __le32 received_beacons;
0762     __le32 wake_packet_length;
0763     __le32 wake_packet_bufsize;
0764     u8 tid_tear_down;
0765     u8 reserved[3];
0766     u8 wake_packet[]; /* can be truncated from _length to _bufsize */
0767 } __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_12 */
0768 
0769 /* TODO: NetDetect API */
0770 
0771 #endif /* __iwl_fw_api_d3_h__ */