linux/drivers/net/wireless/intel/iwlwifi/fw/api/d3.h

/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
 * Copyright (C) 2015-2017 Intel Deutschland GmbH
 */
#ifndef __iwl_fw_api_d3_h__
#define __iwl_fw_api_d3_h__
#include <iwl-trans.h>

/**
 * enum iwl_d0i3_flags - d0i3 flags
 * @IWL_D0I3_RESET_REQUIRE: FW require reset upon resume
 */
enum iwl_d0i3_flags {};

/**
 * enum iwl_d3_wakeup_flags - D3 manager wakeup flags
 * @IWL_WAKEUP_D3_CONFIG_FW_ERROR: wake up on firmware sysassert
 */
enum iwl_d3_wakeup_flags {}; /* D3_MANAGER_WAKEUP_CONFIG_API_E_VER_3 */

/**
 * struct iwl_d3_manager_config - D3 manager configuration command
 * @min_sleep_time: minimum sleep time (in usec)
 * @wakeup_flags: wakeup flags, see &enum iwl_d3_wakeup_flags
 * @wakeup_host_timer: force wakeup after this many seconds
 *
 * The structure is used for the D3_CONFIG_CMD command.
 */
struct iwl_d3_manager_config {} __packed; /* D3_MANAGER_CONFIG_CMD_S_VER_4 */


/* TODO: OFFLOADS_QUERY_API_S_VER_1 */

/**
 * enum iwl_proto_offloads - enabled protocol offloads
 * @IWL_D3_PROTO_OFFLOAD_ARP: ARP data is enabled
 * @IWL_D3_PROTO_OFFLOAD_NS: NS (Neighbor Solicitation) is enabled
 * @IWL_D3_PROTO_IPV4_VALID: IPv4 data is valid
 * @IWL_D3_PROTO_IPV6_VALID: IPv6 data is valid
 * @IWL_D3_PROTO_OFFLOAD_BTM: BTM offload is enabled
 */
enum iwl_proto_offloads {};

#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V1
#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V2
#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3L
#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_V3S
#define IWL_PROTO_OFFLOAD_NUM_IPV6_ADDRS_MAX

#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3L
#define IWL_PROTO_OFFLOAD_NUM_NS_CONFIG_V3S

/**
 * struct iwl_proto_offload_cmd_common - ARP/NS offload common part
 * @enabled: enable flags
 * @remote_ipv4_addr: remote address to answer to (or zero if all)
 * @host_ipv4_addr: our IPv4 address to respond to queries for
 * @arp_mac_addr: our MAC address for ARP responses
 * @reserved: unused
 */
struct iwl_proto_offload_cmd_common {} __packed;

/**
 * struct iwl_proto_offload_cmd_v1 - ARP/NS offload configuration
 * @common: common/IPv4 configuration
 * @remote_ipv6_addr: remote address to answer to (or zero if all)
 * @solicited_node_ipv6_addr: broken -- solicited node address exists
 *	for each target address
 * @target_ipv6_addr: our target addresses
 * @ndp_mac_addr: neighbor solicitation response MAC address
 * @reserved2: reserved
 */
struct iwl_proto_offload_cmd_v1 {} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_1 */

/**
 * struct iwl_proto_offload_cmd_v2 - ARP/NS offload configuration
 * @common: common/IPv4 configuration
 * @remote_ipv6_addr: remote address to answer to (or zero if all)
 * @solicited_node_ipv6_addr: broken -- solicited node address exists
 *	for each target address
 * @target_ipv6_addr: our target addresses
 * @ndp_mac_addr: neighbor solicitation response MAC address
 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 * @reserved2: reserved
 */
struct iwl_proto_offload_cmd_v2 {} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_2 */

struct iwl_ns_config {} __packed; /* NS_OFFLOAD_CONFIG */

struct iwl_targ_addr {} __packed; /* TARGET_IPV6_ADDRESS */

/**
 * struct iwl_proto_offload_cmd_v3_small - ARP/NS offload configuration
 * @common: common/IPv4 configuration
 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 * @targ_addrs: target IPv6 addresses
 * @ns_config: NS offload configurations
 */
struct iwl_proto_offload_cmd_v3_small {} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */

/**
 * struct iwl_proto_offload_cmd_v3_large - ARP/NS offload configuration
 * @common: common/IPv4 configuration
 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 * @targ_addrs: target IPv6 addresses
 * @ns_config: NS offload configurations
 */
struct iwl_proto_offload_cmd_v3_large {} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_3 */

/**
 * struct iwl_proto_offload_cmd_v4 - ARP/NS offload configuration
 * @sta_id: station id
 * @common: common/IPv4 configuration
 * @num_valid_ipv6_addrs: number of valid IPv6 addresses
 * @targ_addrs: target IPv6 addresses
 * @ns_config: NS offload configurations
 */
struct iwl_proto_offload_cmd_v4 {} __packed; /* PROT_OFFLOAD_CONFIG_CMD_DB_S_VER_4 */

/*
 * WOWLAN_PATTERNS
 */
#define IWL_WOWLAN_MIN_PATTERN_LEN
#define IWL_WOWLAN_MAX_PATTERN_LEN

struct iwl_wowlan_pattern_v1 {} __packed; /* WOWLAN_PATTERN_API_S_VER_1 */

#define IWL_WOWLAN_MAX_PATTERNS

/**
 * struct iwl_wowlan_patterns_cmd_v1 - WoWLAN wakeup patterns
 */
struct iwl_wowlan_patterns_cmd_v1 {} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */

#define IPV4_ADDR_SIZE
#define IPV6_ADDR_SIZE

enum iwl_wowlan_pattern_type {}; /* WOWLAN_PATTERN_TYPE_API_E_VER_1 */

/**
 * struct iwl_wowlan_ipv4_tcp_syn - WoWLAN IPv4 TCP SYN pattern data
 */
struct iwl_wowlan_ipv4_tcp_syn {} __packed; /* WOWLAN_IPV4_TCP_SYN_API_S_VER_1 */

/**
 * struct iwl_wowlan_ipv6_tcp_syn - WoWLAN Ipv6 TCP SYN pattern data
 */
struct iwl_wowlan_ipv6_tcp_syn {} __packed; /* WOWLAN_IPV6_TCP_SYN_API_S_VER_1 */

/**
 * union iwl_wowlan_pattern_data - Data for the different pattern types
 *
 * If wildcard addresses/ports are to be used, the union can be left
 * undefined.
 */
iwl_wowlan_pattern_data; /* WOWLAN_PATTERN_API_U_VER_1 */

/**
 * struct iwl_wowlan_pattern_v2 - Pattern entry for the WoWLAN wakeup patterns
 */
struct iwl_wowlan_pattern_v2 {} __packed; /* WOWLAN_PATTERN_API_S_VER_2 */

/**
 * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns command
 */
struct iwl_wowlan_patterns_cmd {} __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_3 */

enum iwl_wowlan_wakeup_filters {}; /* WOWLAN_WAKEUP_FILTER_API_E_VER_4 */

enum iwl_wowlan_flags {};

/**
 * struct iwl_wowlan_config_cmd - WoWLAN configuration (versions 5 and 6)
 * @wakeup_filter: filter from &enum iwl_wowlan_wakeup_filters
 * @non_qos_seq: non-QoS sequence counter to use next.
 *               Reserved if the struct has version >= 6.
 * @qos_seq: QoS sequence counters to use next
 * @wowlan_ba_teardown_tids: bitmap of BA sessions to tear down
 * @is_11n_connection: indicates HT connection
 * @offloading_tid: TID reserved for firmware use
 * @flags: extra flags, see &enum iwl_wowlan_flags
 * @sta_id: station ID for wowlan.
 * @reserved: reserved
 */
struct iwl_wowlan_config_cmd {} __packed; /* WOWLAN_CONFIG_API_S_VER_5 */

#define IWL_NUM_RSC
#define WOWLAN_KEY_MAX_SIZE
#define WOWLAN_GTK_KEYS_NUM
#define WOWLAN_IGTK_KEYS_NUM
#define WOWLAN_IGTK_MIN_INDEX
#define WOWLAN_BIGTK_KEYS_NUM
#define WOWLAN_BIGTK_MIN_INDEX

/*
 * WOWLAN_TSC_RSC_PARAMS
 */
struct tkip_sc {} __packed; /* TKIP_SC_API_U_VER_1 */

struct iwl_tkip_rsc_tsc {} __packed; /* TKIP_TSC_RSC_API_S_VER_1 */

struct aes_sc {} __packed; /* TKIP_AES_SC_API_U_VER_1 */

struct iwl_aes_rsc_tsc {} __packed; /* AES_TSC_RSC_API_S_VER_1 */

iwl_all_tsc_rsc; /* ALL_TSC_RSC_API_S_VER_2 */

struct iwl_wowlan_rsc_tsc_params_cmd_ver_2 {} __packed; /* ALL_TSC_RSC_API_S_VER_2 */

struct iwl_wowlan_rsc_tsc_params_cmd_v4 {} __packed; /* ALL_TSC_RSC_API_S_VER_4 */

struct iwl_wowlan_rsc_tsc_params_cmd {} __packed; /* ALL_TSC_RSC_API_S_VER_5 */

#define IWL_MIC_KEY_SIZE
struct iwl_mic_keys {} __packed; /* MIC_KEYS_API_S_VER_1 */

#define IWL_P1K_SIZE
struct iwl_p1k_cache {} __packed;

#define IWL_NUM_RX_P1K_CACHE

struct iwl_wowlan_tkip_params_cmd_ver_1 {} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_1 */

struct iwl_wowlan_tkip_params_cmd {} __packed; /* WOWLAN_TKIP_SETTING_API_S_VER_2 */

#define IWL_KCK_MAX_SIZE
#define IWL_KEK_MAX_SIZE

struct iwl_wowlan_kek_kck_material_cmd_v2 {} __packed; /* KEK_KCK_MATERIAL_API_S_VER_2 */

struct iwl_wowlan_kek_kck_material_cmd_v3 {} __packed; /* KEK_KCK_MATERIAL_API_S_VER_3 */

struct iwl_wowlan_kek_kck_material_cmd_v4 {} __packed; /* KEK_KCK_MATERIAL_API_S_VER_4 */

struct iwl_wowlan_get_status_cmd {} __packed; /* WOWLAN_GET_STATUSES_CMD_API_S_VER_1 */

#define RF_KILL_INDICATOR_FOR_WOWLAN

enum iwl_wowlan_rekey_status {}; /* WOWLAN_REKEY_STATUS_API_E_VER_1 */

enum iwl_wowlan_wakeup_reason {}; /* WOWLAN_WAKE_UP_REASON_API_E_VER_2 */

struct iwl_wowlan_gtk_status_v1 {} __packed; /* WOWLAN_GTK_MATERIAL_VER_1 */

/**
 * struct iwl_wowlan_gtk_status_v2 - GTK status
 * @key: GTK material
 * @key_len: GTK legth, if set to 0, the key is not available
 * @key_flags: information about the key:
 *	bits[0:1]:  key index assigned by the AP
 *	bits[2:6]:  GTK index of the key in the internal DB
 *	bit[7]:     Set iff this is the currently used GTK
 * @reserved: padding
 * @tkip_mic_key: TKIP RX MIC key
 * @rsc: TSC RSC counters
 */
struct iwl_wowlan_gtk_status_v2 {} __packed; /* WOWLAN_GTK_MATERIAL_VER_2 */

/**
 * struct iwl_wowlan_all_rsc_tsc_v5 - key counters
 * @ucast_rsc: unicast RSC values
 * @mcast_rsc: multicast RSC values (per key map value)
 * @sta_id: station ID
 * @mcast_key_id_map: map of key id to @mcast_rsc entry
 */
struct iwl_wowlan_all_rsc_tsc_v5 {} __packed; /* ALL_TSC_RSC_API_S_VER_5 */

/**
 * struct iwl_wowlan_gtk_status_v3 - GTK status
 * @key: GTK material
 * @key_len: GTK length, if set to 0, the key is not available
 * @key_flags: information about the key:
 *	bits[0:1]:  key index assigned by the AP
 *	bits[2:6]:  GTK index of the key in the internal DB
 *	bit[7]:     Set iff this is the currently used GTK
 * @reserved: padding
 * @tkip_mic_key: TKIP RX MIC key
 * @sc: RSC/TSC counters
 */
struct iwl_wowlan_gtk_status_v3 {} __packed; /* WOWLAN_GTK_MATERIAL_VER_3 */

#define IWL_WOWLAN_GTK_IDX_MASK
#define IWL_WOWLAN_IGTK_BIGTK_IDX_MASK

/**
 * struct iwl_wowlan_igtk_status - IGTK status
 * @key: IGTK material
 * @ipn: the IGTK packet number (replay counter)
 * @key_len: IGTK length, if set to 0, the key is not available
 * @key_flags: information about the key:
 *	bits[0]: key index assigned by the AP (0: index 4, 1: index 5)
 *	(0: index 6, 1: index 7 with bigtk)
 *	bits[1:5]: IGTK index of the key in the internal DB
 *	bit[6]: Set iff this is the currently used IGTK
 */
struct iwl_wowlan_igtk_status {} __packed; /* WOWLAN_IGTK_MATERIAL_VER_1 */

/**
 * struct iwl_wowlan_status_v6 - WoWLAN status
 * @gtk: GTK data
 * @replay_ctr: GTK rekey replay counter
 * @pattern_number: number of the matched pattern
 * @non_qos_seq_ctr: non-QoS sequence counter to use next
 * @qos_seq_ctr: QoS sequence counters to use next
 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 * @num_of_gtk_rekeys: number of GTK rekeys
 * @transmitted_ndps: number of transmitted neighbor discovery packets
 * @received_beacons: number of received beacons
 * @wake_packet_length: wakeup packet length
 * @wake_packet_bufsize: wakeup packet buffer size
 * @wake_packet: wakeup packet
 */
struct iwl_wowlan_status_v6 {} __packed; /* WOWLAN_STATUSES_API_S_VER_6 */

/**
 * struct iwl_wowlan_status_v7 - WoWLAN status
 * @gtk: GTK data
 * @igtk: IGTK data
 * @replay_ctr: GTK rekey replay counter
 * @pattern_number: number of the matched pattern
 * @non_qos_seq_ctr: non-QoS sequence counter to use next
 * @qos_seq_ctr: QoS sequence counters to use next
 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 * @num_of_gtk_rekeys: number of GTK rekeys
 * @transmitted_ndps: number of transmitted neighbor discovery packets
 * @received_beacons: number of received beacons
 * @wake_packet_length: wakeup packet length
 * @wake_packet_bufsize: wakeup packet buffer size
 * @wake_packet: wakeup packet
 */
struct iwl_wowlan_status_v7 {} __packed; /* WOWLAN_STATUSES_API_S_VER_7 */

/**
 * struct iwl_wowlan_status_v9 - WoWLAN status (versions 9 and 10)
 * @gtk: GTK data
 * @igtk: IGTK data
 * @replay_ctr: GTK rekey replay counter
 * @pattern_number: number of the matched pattern
 * @non_qos_seq_ctr: non-QoS sequence counter to use next.
 *                   Reserved if the struct has version >= 10.
 * @qos_seq_ctr: QoS sequence counters to use next
 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 * @num_of_gtk_rekeys: number of GTK rekeys
 * @transmitted_ndps: number of transmitted neighbor discovery packets
 * @received_beacons: number of received beacons
 * @wake_packet_length: wakeup packet length
 * @wake_packet_bufsize: wakeup packet buffer size
 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 *		   in suspend state
 * @reserved: unused
 * @wake_packet: wakeup packet
 */
struct iwl_wowlan_status_v9 {} __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_9 */

/**
 * struct iwl_wowlan_status_v12 - WoWLAN status
 * @gtk: GTK data
 * @igtk: IGTK data
 * @replay_ctr: GTK rekey replay counter
 * @pattern_number: number of the matched pattern
 * @non_qos_seq_ctr: non-QoS sequence counter to use next.
 *                   Reserved if the struct has version >= 10.
 * @qos_seq_ctr: QoS sequence counters to use next
 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 * @num_of_gtk_rekeys: number of GTK rekeys
 * @transmitted_ndps: number of transmitted neighbor discovery packets
 * @received_beacons: number of received beacons
 * @wake_packet_length: wakeup packet length
 * @wake_packet_bufsize: wakeup packet buffer size
 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 *		   in suspend state
 * @reserved: unused
 * @wake_packet: wakeup packet
 */
struct iwl_wowlan_status_v12 {} __packed; /* WOWLAN_STATUSES_RSP_API_S_VER_12 */

/**
 * struct iwl_wowlan_info_notif_v1 - WoWLAN information notification
 * @gtk: GTK data
 * @igtk: IGTK data
 * @replay_ctr: GTK rekey replay counter
 * @pattern_number: number of the matched patterns
 * @reserved1: reserved
 * @qos_seq_ctr: QoS sequence counters to use next
 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 * @num_of_gtk_rekeys: number of GTK rekeys
 * @transmitted_ndps: number of transmitted neighbor discovery packets
 * @received_beacons: number of received beacons
 * @wake_packet_length: wakeup packet length
 * @wake_packet_bufsize: wakeup packet buffer size
 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 *	in suspend state
 * @station_id: station id
 * @reserved2: reserved
 */
struct iwl_wowlan_info_notif_v1 {} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_1 */

/**
 * struct iwl_wowlan_info_notif_v2 - WoWLAN information notification
 * @gtk: GTK data
 * @igtk: IGTK data
 * @replay_ctr: GTK rekey replay counter
 * @pattern_number: number of the matched patterns
 * @reserved1: reserved
 * @qos_seq_ctr: QoS sequence counters to use next
 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 * @num_of_gtk_rekeys: number of GTK rekeys
 * @transmitted_ndps: number of transmitted neighbor discovery packets
 * @received_beacons: number of received beacons
 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 *	in suspend state
 * @station_id: station id
 * @reserved2: reserved
 */
struct iwl_wowlan_info_notif_v2 {} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_2 */

/* MAX MLO keys of non-active links that can arrive in the notification */
#define WOWLAN_MAX_MLO_KEYS

/**
 * enum iwl_wowlan_mlo_gtk_type - GTK types
 * @WOWLAN_MLO_GTK_KEY_TYPE_GTK: GTK
 * @WOWLAN_MLO_GTK_KEY_TYPE_IGTK: IGTK
 * @WOWLAN_MLO_GTK_KEY_TYPE_BIGTK: BIGTK
 * @WOWLAN_MLO_GTK_KEY_NUM_TYPES: number of key types
 */
enum iwl_wowlan_mlo_gtk_type {}; /* WOWLAN_MLO_GTK_KEY_TYPE_API_E_VER_1 */

/**
 * enum iwl_wowlan_mlo_gtk_flag - MLO GTK flags
 * @WOWLAN_MLO_GTK_FLAG_KEY_LEN_MSK: 0 for len 16, 1 for len 32
 * @WOWLAN_MLO_GTK_FLAG_KEY_ID_MSK: key id (ranges from 0 to 7)
 * @WOWLAN_MLO_GTK_FLAG_LINK_ID_MSK: spec link id of the key
 * @WOWLAN_MLO_GTK_FLAG_KEY_TYPE_MSK: &enum iwl_wowlan_mlo_gtk_type
 * @WOWLAN_MLO_GTK_FLAG_LAST_KEY_MSK: is this the last given key per
 *	key-type / link-id - the currently used key
 */
enum iwl_wowlan_mlo_gtk_flag {}; /* WOWLAN_MLO_GTK_FLAG_API_E_VER_1 */

/**
 * struct iwl_wowlan_mlo_gtk - MLO GTK info
 * @key: key material
 * @flags: &enum iwl_wowlan_mlo_gtk_flag
 * @pn: packet number
 */
struct iwl_wowlan_mlo_gtk {} __packed; /* WOWLAN_MLO_GTK_KEY_API_S_VER_1 */

/**
 * struct iwl_wowlan_info_notif - WoWLAN information notification
 * @gtk: GTK data
 * @igtk: IGTK data
 * @bigtk: BIGTK data
 * @replay_ctr: GTK rekey replay counter
 * @pattern_number: number of the matched patterns
 * @reserved1: reserved
 * @qos_seq_ctr: QoS sequence counters to use next
 * @wakeup_reasons: wakeup reasons, see &enum iwl_wowlan_wakeup_reason
 * @num_of_gtk_rekeys: number of GTK rekeys
 * @transmitted_ndps: number of transmitted neighbor discovery packets
 * @received_beacons: number of received beacons
 * @tid_tear_down: bit mask of tids whose BA sessions were closed
 *	in suspend state
 * @station_id: station id
 * @num_mlo_link_keys: number of &struct iwl_wowlan_mlo_gtk structs
 *	following this notif, or reserved in version < 4
 * @reserved2: reserved
 * @mlo_gtks: array of GTKs of size num_mlo_link_keys for version >= 4
 */
struct iwl_wowlan_info_notif {} __packed; /* WOWLAN_INFO_NTFY_API_S_VER_3, _VER_4 */

/**
 * struct iwl_wowlan_wake_pkt_notif - WoWLAN wake packet notification
 * @wake_packet_length: wakeup packet length
 * @station_id: station id
 * @reserved: unused
 * @wake_packet: wakeup packet
 */
struct iwl_wowlan_wake_pkt_notif {} __packed; /* WOWLAN_WAKE_PKT_NTFY_API_S_VER_1 */

/**
 * struct iwl_mvm_d3_end_notif -  d3 end notification
 * @flags: See &enum iwl_d0i3_flags
 */
struct iwl_mvm_d3_end_notif {} __packed;

/* TODO: NetDetect API */

#endif /* __iwl_fw_api_d3_h__ */