linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h

// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012 Broadcom Corporation
 */


#ifndef FWIL_TYPES_H_
#define FWIL_TYPES_H_

#include <linux/if_ether.h>


#define BRCMF_FIL_ACTION_FRAME_SIZE

/* ARP Offload feature flags for arp_ol iovar */
#define BRCMF_ARP_OL_AGENT
#define BRCMF_ARP_OL_SNOOP
#define BRCMF_ARP_OL_HOST_AUTO_REPLY
#define BRCMF_ARP_OL_PEER_AUTO_REPLY

#define BRCMF_BSS_INFO_VERSION
#define BRCMF_BSS_RSSI_ON_CHANNEL

#define BRCMF_STA_BRCM
#define BRCMF_STA_WME
#define BRCMF_STA_NONERP
#define BRCMF_STA_AUTHE
#define BRCMF_STA_ASSOC
#define BRCMF_STA_AUTHO
#define BRCMF_STA_WDS
#define BRCMF_STA_WDS_LINKUP
#define BRCMF_STA_PS
#define BRCMF_STA_APSD_BE
#define BRCMF_STA_APSD_BK
#define BRCMF_STA_APSD_VI
#define BRCMF_STA_APSD_VO
#define BRCMF_STA_N_CAP
#define BRCMF_STA_SCBSTATS
#define BRCMF_STA_AMPDU_CAP
#define BRCMF_STA_AMSDU_CAP
#define BRCMF_STA_MIMO_PS
#define BRCMF_STA_MIMO_RTS
#define BRCMF_STA_RIFS_CAP
#define BRCMF_STA_VHT_CAP
#define BRCMF_STA_WPS
#define BRCMF_STA_DWDS_CAP
#define BRCMF_STA_DWDS

/* size of brcmf_scan_params not including variable length array */
#define BRCMF_SCAN_PARAMS_FIXED_SIZE
#define BRCMF_SCAN_PARAMS_V2_FIXED_SIZE

/* version of brcmf_scan_params structure */
#define BRCMF_SCAN_PARAMS_VERSION_V2

/* masks for channel and ssid count */
#define BRCMF_SCAN_PARAMS_COUNT_MASK
#define BRCMF_SCAN_PARAMS_NSSID_SHIFT

/* scan type definitions */
#define BRCMF_SCANTYPE_DEFAULT
#define BRCMF_SCANTYPE_ACTIVE
#define BRCMF_SCANTYPE_PASSIVE

#define BRCMF_WSEC_MAX_PSK_LEN
#define BRCMF_WSEC_PASSPHRASE

#define BRCMF_WSEC_MAX_SAE_PASSWORD_LEN

/* primary (ie tx) key */
#define BRCMF_PRIMARY_KEY
#define DOT11_BSSTYPE_ANY
#define BRCMF_ESCAN_REQ_VERSION
#define BRCMF_ESCAN_REQ_VERSION_V2

#define BRCMF_MAXRATES_IN_SET

/* OBSS Coex Auto/On/Off */
#define BRCMF_OBSS_COEX_AUTO
#define BRCMF_OBSS_COEX_OFF
#define BRCMF_OBSS_COEX_ON

/* WOWL bits */
/* Wakeup on Magic packet: */
#define BRCMF_WOWL_MAGIC
/* Wakeup on Netpattern */
#define BRCMF_WOWL_NET
/* Wakeup on loss-of-link due to Disassoc/Deauth: */
#define BRCMF_WOWL_DIS
/* Wakeup on retrograde TSF: */
#define BRCMF_WOWL_RETR
/* Wakeup on loss of beacon: */
#define BRCMF_WOWL_BCN
/* Wakeup after test: */
#define BRCMF_WOWL_TST
/* Wakeup after PTK refresh: */
#define BRCMF_WOWL_M1
/* Wakeup after receipt of EAP-Identity Req: */
#define BRCMF_WOWL_EAPID
/* Wakeind via PME(0) or GPIO(1): */
#define BRCMF_WOWL_PME_GPIO
/* need tkip phase 1 key to be updated by the driver: */
#define BRCMF_WOWL_NEEDTKIP1
/* enable wakeup if GTK fails: */
#define BRCMF_WOWL_GTK_FAILURE
/* support extended magic packets: */
#define BRCMF_WOWL_EXTMAGPAT
/* support ARP/NS/keepalive offloading: */
#define BRCMF_WOWL_ARPOFFLOAD
/* read protocol version for EAPOL frames: */
#define BRCMF_WOWL_WPA2
/* If the bit is set, use key rotaton: */
#define BRCMF_WOWL_KEYROT
/* If the bit is set, frm received was bcast frame: */
#define BRCMF_WOWL_BCAST
/* If the bit is set, scan offload is enabled: */
#define BRCMF_WOWL_SCANOL
/* Wakeup on tcpkeep alive timeout: */
#define BRCMF_WOWL_TCPKEEP_TIME
/* Wakeup on mDNS Conflict Resolution: */
#define BRCMF_WOWL_MDNS_CONFLICT
/* Wakeup on mDNS Service Connect: */
#define BRCMF_WOWL_MDNS_SERVICE
/* tcp keepalive got data: */
#define BRCMF_WOWL_TCPKEEP_DATA
/* Firmware died in wowl mode: */
#define BRCMF_WOWL_FW_HALT
/* Enable detection of radio button changes: */
#define BRCMF_WOWL_ENAB_HWRADIO
/* Offloads detected MIC failure(s): */
#define BRCMF_WOWL_MIC_FAIL
/* Wakeup in Unassociated state (Net/Magic Pattern): */
#define BRCMF_WOWL_UNASSOC
/* Wakeup if received matched secured pattern: */
#define BRCMF_WOWL_SECURE
/* Wakeup on finding preferred network */
#define BRCMF_WOWL_PFN_FOUND
/* Wakeup on receiving pairwise key EAP packets: */
#define WIPHY_WOWL_EAP_PK
/* Link Down indication in WoWL mode: */
#define BRCMF_WOWL_LINKDOWN

#define BRCMF_WOWL_MAXPATTERNS
#define BRCMF_WOWL_MAXPATTERNSIZE

#define BRCMF_COUNTRY_BUF_SZ
#define BRCMF_ANT_MAX

#define BRCMF_MAX_ASSOCLIST

#define BRCMF_TXBF_SU_BFE_CAP
#define BRCMF_TXBF_MU_BFE_CAP
#define BRCMF_TXBF_SU_BFR_CAP
#define BRCMF_TXBF_MU_BFR_CAP

#define BRCMF_MAXPMKID
#define BRCMF_NUMCHANNELS

#define BRCMF_PFN_MACADDR_CFG_VER
#define BRCMF_PFN_MAC_OUI_ONLY
#define BRCMF_PFN_SET_MAC_UNASSOC

#define BRCMF_MCSSET_LEN

#define BRCMF_RSN_KCK_LENGTH
#define BRCMF_RSN_KEK_LENGTH
#define BRCMF_RSN_REPLAY_LEN

#define BRCMF_MFP_NONE
#define BRCMF_MFP_CAPABLE
#define BRCMF_MFP_REQUIRED

#define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX

#define BRCMF_HE_CAP_MCS_MAP_NSS_MAX

#define BRCMF_PMKSA_VER_2
#define BRCMF_PMKSA_VER_3
#define BRCMF_PMKSA_NO_EXPIRY

/* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each
 * ioctl. It is relatively small because firmware has small maximum size input
 * playload restriction for ioctls.
 */
#define MAX_CHUNK_LEN

#define DLOAD_HANDLER_VER
#define DLOAD_FLAG_VER_MASK
#define DLOAD_FLAG_VER_SHIFT

#define DL_BEGIN
#define DL_END

#define DL_TYPE_CLM

/* join preference types for join_pref iovar */
enum brcmf_join_pref_types {};

enum brcmf_fil_p2p_if_types {};

enum brcmf_wowl_pattern_type {};

struct brcmf_fil_p2p_if_le {};

struct brcmf_fil_chan_info_le {};

struct brcmf_fil_action_frame_le {};

struct brcmf_fil_af_params_le {};

struct brcmf_fil_bss_enable_le {};

struct brcmf_fil_bwcap_le {};

/**
 * struct tdls_iovar - common structure for tdls iovars.
 *
 * @ea: ether address of peer station.
 * @mode: mode value depending on specific tdls iovar.
 * @chanspec: channel specification.
 * @pad: unused (for future use).
 */
struct brcmf_tdls_iovar_le {};

enum brcmf_tdls_manual_ep_ops {};

/* Pattern matching filter. Specifies an offset within received packets to
 * start matching, the pattern to match, the size of the pattern, and a bitmask
 * that indicates which bits within the pattern should be matched.
 */
struct brcmf_pkt_filter_pattern_le {};

/* IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
struct brcmf_pkt_filter_le {};

/* IOVAR "pkt_filter_enable" parameter. */
struct brcmf_pkt_filter_enable_le {};

/* BSS info structure
 * Applications MUST CHECK ie_offset field and length field to access IEs and
 * next bss_info structure in a vector (in struct brcmf_scan_results)
 */
struct brcmf_bss_info_le {};

struct brcm_rateset_le {};

struct brcmf_ssid_le {};

/* Alternate SSID structure used in some places... */
struct brcmf_ssid8_le {};

struct brcmf_scan_params_le {};

struct brcmf_scan_params_v2_le {};

struct brcmf_scan_results {};

struct brcmf_escan_params_le {};

struct brcmf_escan_result_le {};

#define WL_ESCAN_RESULTS_FIXED_SIZE

/* used for association with a specific BSSID and chanspec list */
struct brcmf_assoc_params_le {};

/**
 * struct join_pref params - parameters for preferred join selection.
 *
 * @type: preference type (see enum brcmf_join_pref_types).
 * @len: length of bytes following (currently always 2).
 * @rssi_gain: signal gain for selection (only when @type is RSSI_DELTA).
 * @band: band to which selection preference applies.
 *	This is used if @type is BAND or RSSI_DELTA.
 */
struct brcmf_join_pref_params {};

/* used for join with or without a specific bssid and channel list */
struct brcmf_join_params {};

/* scan params for extended join */
struct brcmf_join_scan_params_le {};

/* extended join params */
struct brcmf_ext_join_params_le {};

struct brcmf_wsec_key {};

/*
 * dongle requires same struct as above but with fields in little endian order
 */
struct brcmf_wsec_key_le {};

/**
 * struct brcmf_wsec_pmk_le - firmware pmk material.
 *
 * @key_len: number of octets in key material.
 * @flags: key handling qualifiers.
 * @key: PMK key material.
 */
struct brcmf_wsec_pmk_le {};

/**
 * struct brcmf_wsec_sae_pwd_le - firmware SAE password material.
 *
 * @key_len: number of octets in key materials.
 * @key: SAE password material.
 */
struct brcmf_wsec_sae_pwd_le {};

/* Used to get specific STA parameters */
struct brcmf_scb_val_le {};

/* channel encoding */
struct brcmf_channel_info_le {};

struct brcmf_sta_info_le {};

struct brcmf_chanspec_list {};

/*
 * WLC_E_PROBRESP_MSG
 * WLC_E_P2P_PROBREQ_MSG
 * WLC_E_ACTION_FRAME_RX
 */
struct brcmf_rx_mgmt_data {};

/**
 * struct brcmf_fil_wowl_pattern_le - wowl pattern configuration struct.
 *
 * @cmd: "add", "del" or "clr".
 * @masksize: Size of the mask in #of bytes
 * @offset: Pattern byte offset in packet
 * @patternoffset: Offset of start of pattern. Starting from field masksize.
 * @patternsize: Size of the pattern itself in #of bytes
 * @id: id
 * @reasonsize: Size of the wakeup reason code
 * @type: Type of pattern (enum brcmf_wowl_pattern_type)
 */
struct brcmf_fil_wowl_pattern_le {};

struct brcmf_mbss_ssid_le {};

/**
 * struct brcmf_fil_country_le - country configuration structure.
 *
 * @country_abbrev: null-terminated country code used in the country IE.
 * @rev: revision specifier for ccode. on set, -1 indicates unspecified.
 * @ccode: null-terminated built-in country code.
 */
struct brcmf_fil_country_le {};

/**
 * struct brcmf_rev_info_le - device revision info.
 *
 * @vendorid: PCI vendor id.
 * @deviceid: device id of chip.
 * @radiorev: radio revision.
 * @chiprev: chip revision.
 * @corerev: core revision.
 * @boardid: board identifier (usu. PCI sub-device id).
 * @boardvendor: board vendor (usu. PCI sub-vendor id).
 * @boardrev: board revision.
 * @driverrev: driver version.
 * @ucoderev: microcode version.
 * @bus: bus type.
 * @chipnum: chip number.
 * @phytype: phy type.
 * @phyrev: phy revision.
 * @anarev: anacore rev.
 * @chippkg: chip package info.
 * @nvramrev: nvram revision number.
 */
struct brcmf_rev_info_le {};

/**
 * struct brcmf_wlc_version_le - firmware revision info.
 *
 * @version: structure version.
 * @length: structure length.
 * @epi_ver_major: EPI major version
 * @epi_ver_minor: EPI minor version
 * @epi_ver_rc: EPI rc version
 * @epi_ver_incr: EPI increment version
 * @wlc_ver_major: WLC major version
 * @wlc_ver_minor: WLC minor version
 */
struct brcmf_wlc_version_le {};

/**
 * struct brcmf_assoclist_le - request assoc list.
 *
 * @count: indicates number of stations.
 * @mac: MAC addresses of stations.
 */
struct brcmf_assoclist_le {};

/**
 * struct brcmf_rssi_be - RSSI threshold event format
 *
 * @rssi: receive signal strength (in dBm)
 * @snr: signal-noise ratio
 * @noise: noise (in dBm)
 */
struct brcmf_rssi_be {};

#define BRCMF_MAX_RSSI_LEVELS

/**
 * struct brcm_rssi_event_le - rssi_event IOVAR format
 *
 * @rate_limit_msec: RSSI event rate limit
 * @rssi_level_num: number of supplied RSSI levels
 * @rssi_levels: RSSI levels in ascending order
 */
struct brcmf_rssi_event_le {};

/**
 * struct brcmf_wowl_wakeind_le - Wakeup indicators
 *	Note: note both fields contain same information.
 *
 * @pci_wakeind: Whether PCI PMECSR PMEStatus bit was set.
 * @ucode_wakeind: What wakeup-event indication was set by ucode
 */
struct brcmf_wowl_wakeind_le {};

/**
 * struct brcmf_pmksa - PMK Security Association
 *
 * @bssid: The AP's BSSID.
 * @pmkid: he PMK material itself.
 */
struct brcmf_pmksa {};

/**
 * struct brcmf_pmksa_v2 - PMK Security Association
 *
 * @length: Length of the structure.
 * @bssid: The AP's BSSID.
 * @pmkid: The PMK ID.
 * @pmk: PMK material for FILS key derivation.
 * @pmk_len: Length of PMK data.
 * @ssid: The AP's SSID.
 * @fils_cache_id: FILS cache identifier
 */
struct brcmf_pmksa_v2 {};

/**
 * struct brcmf_pmksa_v3 - PMK Security Association
 *
 * @bssid: The AP's BSSID.
 * @pmkid: The PMK ID.
 * @pmkid_len: The length of the PMK ID.
 * @pmk: PMK material for FILS key derivation.
 * @pmk_len: Length of PMK data.
 * @fils_cache_id: FILS cache identifier
 * @ssid: The AP's SSID.
 * @time_left: Remaining time until expiry. 0 = expired, ~0 = no expiry.
 */
struct brcmf_pmksa_v3 {};

/**
 * struct brcmf_pmk_list_le - List of pmksa's.
 *
 * @npmk: Number of pmksa's.
 * @pmk: PMK SA information.
 */
struct brcmf_pmk_list_le {};

/**
 * struct brcmf_pmk_list_v2_le - List of pmksa's.
 *
 * @version: Request version.
 * @length: Length of this structure.
 * @pmk: PMK SA information.
 */
struct brcmf_pmk_list_v2_le {};

/**
 * struct brcmf_pmk_op_v3_le - Operation on PMKSA list.
 *
 * @version: Request version.
 * @length: Length of this structure.
 * @pmk: PMK SA information.
 */
struct brcmf_pmk_op_v3_le {};

/**
 * struct brcmf_pno_param_le - PNO scan configuration parameters
 *
 * @version: PNO parameters version.
 * @scan_freq: scan frequency.
 * @lost_network_timeout: #sec. to declare discovered network as lost.
 * @flags: Bit field to control features of PFN such as sort criteria auto
 *	enable switch and background scan.
 * @rssi_margin: Margin to avoid jitter for choosing a PFN based on RSSI sort
 *	criteria.
 * @bestn: number of best networks in each scan.
 * @mscan: number of scans recorded.
 * @repeat: minimum number of scan intervals before scan frequency changes
 *	in adaptive scan.
 * @exp: exponent of 2 for maximum scan interval.
 * @slow_freq: slow scan period.
 */
struct brcmf_pno_param_le {};

/**
 * struct brcmf_pno_config_le - PNO channel configuration.
 *
 * @reporttype: determines what is reported.
 * @channel_num: number of channels specified in @channel_list.
 * @channel_list: channels to use in PNO scan.
 * @flags: reserved.
 */
struct brcmf_pno_config_le {};

/**
 * struct brcmf_pno_net_param_le - scan parameters per preferred network.
 *
 * @ssid: ssid name and its length.
 * @flags: bit2: hidden.
 * @infra: BSS vs IBSS.
 * @auth: Open vs Closed.
 * @wpa_auth: WPA type.
 * @wsec: wsec value.
 */
struct brcmf_pno_net_param_le {};

/**
 * struct brcmf_pno_net_info_le - information per found network.
 *
 * @bssid: BSS network identifier.
 * @channel: channel number only.
 * @SSID_len: length of ssid.
 * @SSID: ssid characters.
 * @RSSI: receive signal strength (in dBm).
 * @timestamp: age in seconds.
 */
struct brcmf_pno_net_info_le {};

/**
 * struct brcmf_pno_scanresults_le - result returned in PNO NET FOUND event.
 *
 * @version: PNO version identifier.
 * @status: indicates completion status of PNO scan.
 * @count: amount of brcmf_pno_net_info_le entries appended.
 */
struct brcmf_pno_scanresults_le {};

struct brcmf_pno_scanresults_v2_le {};

/**
 * struct brcmf_pno_macaddr_le - to configure PNO macaddr randomization.
 *
 * @version: PNO version identifier.
 * @flags: Flags defining how mac addrss should be used.
 * @mac: MAC address.
 */
struct brcmf_pno_macaddr_le {};

/**
 * struct brcmf_dload_data_le - data passing to firmware for downloading
 * @flag: flags related to download data.
 * @dload_type: type of download data.
 * @len: length in bytes of download data.
 * @crc: crc of download data.
 * @data: download data.
 */
struct brcmf_dload_data_le {};

/**
 * struct brcmf_pno_bssid_le - bssid configuration for PNO scan.
 *
 * @bssid: BSS network identifier.
 * @flags: flags for this BSSID.
 */
struct brcmf_pno_bssid_le {};

/**
 * struct brcmf_pktcnt_le - packet counters.
 *
 * @rx_good_pkt: packets (MSDUs & MMPDUs) received from this station
 * @rx_bad_pkt: failed rx packets
 * @tx_good_pkt: packets (MSDUs & MMPDUs) transmitted to this station
 * @tx_bad_pkt: failed tx packets
 * @rx_ocast_good_pkt: unicast packets destined for others
 */
struct brcmf_pktcnt_le {};

/**
 * struct brcmf_gtk_keyinfo_le - GTP rekey data
 *
 * @kck: key confirmation key.
 * @kek: key encryption key.
 * @replay_counter: replay counter.
 */
struct brcmf_gtk_keyinfo_le {};

#define BRCMF_PNO_REPORT_NO_BATCH

/**
 * struct brcmf_gscan_bucket_config - configuration data for channel bucket.
 *
 * @bucket_end_index: last channel index in @channel_list in
 *	@struct brcmf_pno_config_le.
 * @bucket_freq_multiple: scan interval expressed in N * @scan_freq.
 * @flag: channel bucket report flags.
 * @reserved: for future use.
 * @repeat: number of scan at interval for exponential scan.
 * @max_freq_multiple: maximum scan interval for exponential scan.
 */
struct brcmf_gscan_bucket_config {};

/* version supported which must match firmware */
#define BRCMF_GSCAN_CFG_VERSION

/**
 * enum brcmf_gscan_cfg_flags - bit values for gscan flags.
 *
 * @BRCMF_GSCAN_CFG_FLAGS_ALL_RESULTS: send probe responses/beacons to host.
 * @BRCMF_GSCAN_CFG_ALL_BUCKETS_IN_1ST_SCAN: all buckets will be included in
 *	first scan cycle.
 * @BRCMF_GSCAN_CFG_FLAGS_CHANGE_ONLY: indicated only flags member is changed.
 */
enum brcmf_gscan_cfg_flags {};

/**
 * struct brcmf_gscan_config - configuration data for gscan.
 *
 * @version: version of the api to match firmware.
 * @flags: flags according %enum brcmf_gscan_cfg_flags.
 * @buffer_threshold: percentage threshold of buffer to generate an event.
 * @swc_nbssid_threshold: number of BSSIDs with significant change that
 *	will generate an event.
 * @swc_rssi_window_size: size of rssi cache buffer (max=8).
 * @count_of_channel_buckets: number of array members in @bucket.
 * @retry_threshold: !unknown!
 * @lost_ap_window: !unknown!
 * @bucket: array of channel buckets.
 */
struct brcmf_gscan_config {};

/**
 * struct brcmf_mkeep_alive_pkt_le - configuration data for keep-alive frame.
 *
 * @version: version for mkeep_alive
 * @length: length of fixed parameters in the structure.
 * @period_msec: keep-alive period in milliseconds.
 * @len_bytes: size of the data.
 * @keep_alive_id: ID  (0 - 3).
 * @data: keep-alive frame data.
 */
struct brcmf_mkeep_alive_pkt_le {} __packed;

#endif /* FWIL_TYPES_H_ */