Path: blob/main/sys/compat/linuxkpi/common/include/net/cfg80211.h
105546 views
/*-1* Copyright (c) 2020-2025 The FreeBSD Foundation2* Copyright (c) 2021-2022 Bjoern A. Zeeb3*4* This software was developed by Björn Zeeb under sponsorship from5* the FreeBSD Foundation.6*7* Redistribution and use in source and binary forms, with or without8* modification, are permitted provided that the following conditions9* are met:10* 1. Redistributions of source code must retain the above copyright11* notice, this list of conditions and the following disclaimer.12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND17* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE18* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE19* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE20* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL21* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS22* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)23* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT24* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY25* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF26* SUCH DAMAGE.27*/2829#ifndef _LINUXKPI_NET_CFG80211_H30#define _LINUXKPI_NET_CFG80211_H3132#include <linux/types.h>33#include <linux/nl80211.h>34#include <linux/ieee80211.h>35#include <linux/mutex.h>36#include <linux/if_ether.h>37#include <linux/ethtool.h>38#include <linux/debugfs.h>39#include <linux/device.h>40#include <linux/netdevice.h>41#include <linux/random.h>42#include <linux/skbuff.h>43#include <linux/timer.h>44#include <linux/workqueue.h>45#include <net/regulatory.h>4647#include <net80211/ieee80211.h>4849/* linux_80211.c */50extern int linuxkpi_debug_80211;51#ifndef D80211_TODO52#define D80211_TODO 0x153#endif54#ifndef D80211_IMPROVE55#define D80211_IMPROVE 0x256#endif57#ifndef TODO58#define TODO(fmt, ...) if (linuxkpi_debug_80211 & D80211_TODO) \59printf("%s:%d: XXX LKPI80211 TODO " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)60#endif61#ifndef IMPROVE62#define IMPROVE(fmt, ...) if (linuxkpi_debug_80211 & D80211_IMPROVE) \63printf("%s:%d: XXX LKPI80211 IMPROVE " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)64#endif6566enum rfkill_hard_block_reasons {67RFKILL_HARD_BLOCK_NOT_OWNER = BIT(0),68};6970#define WIPHY_PARAM_FRAG_THRESHOLD __LINE__ /* TODO FIXME brcmfmac */71#define WIPHY_PARAM_RETRY_LONG __LINE__ /* TODO FIXME brcmfmac */72#define WIPHY_PARAM_RETRY_SHORT __LINE__ /* TODO FIXME brcmfmac */73#define WIPHY_PARAM_RTS_THRESHOLD __LINE__ /* TODO FIXME brcmfmac */7475#define CFG80211_SIGNAL_TYPE_MBM __LINE__ /* TODO FIXME brcmfmac */7677#define UPDATE_ASSOC_IES 17879#define IEEE80211_MAX_CHAINS 4 /* net80211: IEEE80211_MAX_CHAINS copied */8081enum cfg80211_rate_info_flags {82RATE_INFO_FLAGS_MCS = BIT(0),83RATE_INFO_FLAGS_VHT_MCS = BIT(1),84RATE_INFO_FLAGS_SHORT_GI = BIT(2),85RATE_INFO_FLAGS_HE_MCS = BIT(4),86RATE_INFO_FLAGS_EHT_MCS = BIT(7),87/* Max 8 bits as used in struct rate_info. */88};8990#define CFG80211_RATE_INFO_FLAGS_BITS \91"\20\1MCS\2VHT_MCS\3SGI\5HE_MCS\10EHT_MCS"9293extern const uint8_t rfc1042_header[6];94extern const uint8_t bridge_tunnel_header[6];9596enum ieee80211_privacy {97IEEE80211_PRIVACY_ANY,98};99100enum ieee80211_bss_type {101IEEE80211_BSS_TYPE_ANY,102};103104enum cfg80211_bss_frame_type {105CFG80211_BSS_FTYPE_UNKNOWN,106CFG80211_BSS_FTYPE_BEACON,107CFG80211_BSS_FTYPE_PRESP,108};109110enum ieee80211_channel_flags {111IEEE80211_CHAN_DISABLED = BIT(0),112IEEE80211_CHAN_INDOOR_ONLY = BIT(1),113IEEE80211_CHAN_IR_CONCURRENT = BIT(2),114IEEE80211_CHAN_RADAR = BIT(3),115IEEE80211_CHAN_NO_IR = BIT(4),116IEEE80211_CHAN_NO_HT40MINUS = BIT(5),117IEEE80211_CHAN_NO_HT40PLUS = BIT(6),118IEEE80211_CHAN_NO_80MHZ = BIT(7),119IEEE80211_CHAN_NO_160MHZ = BIT(8),120IEEE80211_CHAN_NO_OFDM = BIT(9),121IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT = BIT(10),122IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT = BIT(11),123IEEE80211_CHAN_PSD = BIT(12),124IEEE80211_CHAN_ALLOW_6GHZ_VLP_AP = BIT(13),125IEEE80211_CHAN_CAN_MONITOR = BIT(14),126IEEE80211_CHAN_NO_EHT = BIT(15),127};128#define IEEE80211_CHAN_NO_HT40 (IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS)129130struct ieee80211_txrx_stypes {131uint16_t tx;132uint16_t rx;133};134135/*136* net80211 has an ieee80211_channel as well; we use the linuxkpi_ version137* interally in LinuxKPI and re-define ieee80211_channel for the drivers138* at the end of the file.139*/140struct linuxkpi_ieee80211_channel {141uint32_t center_freq;142uint16_t hw_value;143enum ieee80211_channel_flags flags;144enum nl80211_band band;145bool beacon_found;146enum nl80211_dfs_state dfs_state;147unsigned int dfs_cac_ms;148int max_antenna_gain;149int max_power;150int max_reg_power;151uint32_t orig_flags;152int orig_mpwr;153};154155#define NL80211_EHT_NSS_MAX 16156157struct cfg80211_bitrate_mask {158/* TODO FIXME */159struct {160uint32_t legacy;161uint8_t ht_mcs[IEEE80211_HT_MCS_MASK_LEN];162uint16_t vht_mcs[8];163uint16_t he_mcs[8];164uint16_t eht_mcs[NL80211_EHT_NSS_MAX];165enum nl80211_txrate_gi gi;166enum nl80211_he_gi he_gi;167uint8_t he_ltf; /* XXX enum? */168} control[NUM_NL80211_BANDS];169};170171enum rate_info_bw {172RATE_INFO_BW_20 = 0,173RATE_INFO_BW_5,174RATE_INFO_BW_10,175RATE_INFO_BW_40,176RATE_INFO_BW_80,177RATE_INFO_BW_160,178RATE_INFO_BW_HE_RU,179RATE_INFO_BW_320,180RATE_INFO_BW_EHT_RU,181};182183struct rate_info {184uint8_t flags; /* enum cfg80211_rate_info_flags */185uint8_t bw; /* enum rate_info_bw */186uint16_t legacy;187uint8_t mcs;188uint8_t nss;189uint8_t he_dcm;190uint8_t he_gi;191uint8_t he_ru_alloc;192uint8_t eht_gi;193};194195struct ieee80211_rate {196uint32_t flags; /* enum ieee80211_rate_flags */197uint16_t bitrate;198uint16_t hw_value;199uint16_t hw_value_short;200};201202struct ieee80211_sta_ht_cap {203bool ht_supported;204uint8_t ampdu_density;205uint8_t ampdu_factor;206uint16_t cap;207struct ieee80211_mcs_info mcs;208};209210/* XXX net80211 calls these IEEE80211_VHTCAP_* */211#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 */212#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 */213#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 */214#define IEEE80211_VHT_CAP_MAX_MPDU_MASK 0x00000003 /* IEEE80211_VHTCAP_MAX_MPDU_MASK */215216#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S)217#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S)218#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK219220#define IEEE80211_VHT_CAP_RXLDPC 0x00000010 /* IEEE80211_VHTCAP_RXLDPC */221222#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 /* IEEE80211_VHTCAP_SHORT_GI_80 */223#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 /* IEEE80211_VHTCAP_SHORT_GI_160 */224225#define IEEE80211_VHT_CAP_TXSTBC 0x00000080 /* IEEE80211_VHTCAP_TXSTBC */226227#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 /* IEEE80211_VHTCAP_RXSTBC_1 */228#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 /* IEEE80211_VHTCAP_RXSTBC_MASK */229230#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 /* IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE */231232#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 /* IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE */233234#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 /* IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE */235236#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 /* IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE */237238#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13 /* IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT */239#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT) /* IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK */240241#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 /* IEEE80211_VHTCAP_HTC_VHT */242243#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 /* IEEE80211_VHTCAP_RX_ANTENNA_PATTERN */244#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 /* IEEE80211_VHTCAP_TX_ANTENNA_PATTERN */245246#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 /* IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB */247248#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16 /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT */249#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \250(7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT) /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK */251252#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT */253#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \254(7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */255256#define IEEE80211_VHT_CAP_EXT_NSS_BW_MASK IEEE80211_VHTCAP_EXT_NSS_BW257#define IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT IEEE80211_VHTCAP_EXT_NSS_BW_S258259struct ieee80211_sta_vht_cap {260/* TODO FIXME */261bool vht_supported;262uint32_t cap;263struct ieee80211_vht_mcs_info vht_mcs;264};265266enum ieee80211_vht_opmode {267IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT = 4,268};269270struct cfg80211_bss_ies {271uint8_t *data;272size_t len;273};274275struct cfg80211_bss {276/* XXX TODO */277struct cfg80211_bss_ies *ies;278struct cfg80211_bss_ies *beacon_ies;279uint64_t ts_boottime;280int32_t signal;281};282283struct cfg80211_connect_resp_params {284/* XXX TODO */285uint8_t *bssid;286const uint8_t *req_ie;287const uint8_t *resp_ie;288uint32_t req_ie_len;289uint32_t resp_ie_len;290int status;291struct {292const uint8_t *addr;293const uint8_t *bssid;294struct cfg80211_bss *bss;295uint16_t status;296} links[IEEE80211_MLD_MAX_NUM_LINKS];297};298299struct cfg80211_inform_bss {300/* XXX TODO */301int boottime_ns, scan_width, signal;302struct linuxkpi_ieee80211_channel *chan;303};304305struct cfg80211_roam_info {306/* XXX TODO */307uint8_t *bssid;308const uint8_t *req_ie;309const uint8_t *resp_ie;310uint32_t req_ie_len;311uint32_t resp_ie_len;312struct linuxkpi_ieee80211_channel *channel;313struct {314const uint8_t *addr;315const uint8_t *bssid;316struct cfg80211_bss *bss;317struct linuxkpi_ieee80211_channel *channel;318} links[IEEE80211_MLD_MAX_NUM_LINKS];319};320321struct cfg80211_chan_def {322/* XXX TODO */323struct linuxkpi_ieee80211_channel *chan;324enum nl80211_chan_width width;325uint32_t center_freq1;326uint32_t center_freq2;327uint16_t punctured;328};329330struct cfg80211_ftm_responder_stats {331/* XXX TODO */332int asap_num, failed_num, filled, non_asap_num, out_of_window_triggers_num, partial_num, reschedule_requests_num, success_num, total_duration_ms, unknown_triggers_num;333};334335struct cfg80211_pmsr_capabilities {336/* XXX TODO */337int max_peers, randomize_mac_addr, report_ap_tsf;338struct {339int asap, bandwidths, max_bursts_exponent, max_ftms_per_burst, non_asap, non_trigger_based, preambles, request_civicloc, request_lci, supported, trigger_based;340} ftm;341};342343struct cfg80211_pmsr_ftm_request {344/* XXX TODO */345int asap, burst_period, ftmr_retries, ftms_per_burst, non_trigger_based, num_bursts_exp, request_civicloc, request_lci, trigger_based;346uint8_t bss_color;347bool lmr_feedback;348};349350struct cfg80211_pmsr_request_peer {351/* XXX TODO */352struct cfg80211_chan_def chandef;353struct cfg80211_pmsr_ftm_request ftm;354uint8_t addr[ETH_ALEN];355int report_ap_tsf;356};357358struct cfg80211_pmsr_request {359/* XXX TODO */360int cookie, n_peers, timeout;361uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN];362struct cfg80211_pmsr_request_peer peers[];363};364365struct cfg80211_pmsr_ftm_result {366/* XXX TODO */367int burst_index, busy_retry_time, failure_reason;368int num_ftmr_successes, rssi_avg, rssi_avg_valid, rssi_spread, rssi_spread_valid, rtt_avg, rtt_avg_valid, rtt_spread, rtt_spread_valid, rtt_variance, rtt_variance_valid;369uint8_t *lci;370uint8_t *civicloc;371int lci_len;372int civicloc_len;373};374375struct cfg80211_pmsr_result {376/* XXX TODO */377int ap_tsf, ap_tsf_valid, final, host_time, status, type;378uint8_t addr[ETH_ALEN];379struct cfg80211_pmsr_ftm_result ftm;380};381382struct cfg80211_sar_freq_ranges {383uint32_t start_freq;384uint32_t end_freq;385};386387struct cfg80211_sar_sub_specs {388uint32_t freq_range_index;389int power;390};391392struct cfg80211_sar_specs {393enum nl80211_sar_type type;394uint32_t num_sub_specs;395struct cfg80211_sar_sub_specs sub_specs[];396};397398struct cfg80211_sar_capa {399enum nl80211_sar_type type;400uint32_t num_freq_ranges;401const struct cfg80211_sar_freq_ranges *freq_ranges;402};403404struct cfg80211_ssid {405int ssid_len;406uint8_t ssid[IEEE80211_MAX_SSID_LEN];407};408409struct cfg80211_scan_6ghz_params {410/* XXX TODO */411uint8_t *bssid;412int channel_idx, psc_no_listen, short_ssid, short_ssid_valid, unsolicited_probe, psd_20;413};414415struct cfg80211_match_set {416uint8_t bssid[ETH_ALEN];417struct cfg80211_ssid ssid;418int rssi_thold;419};420421struct cfg80211_scan_request {422/* XXX TODO */423bool no_cck;424bool scan_6ghz;425bool duration_mandatory;426bool first_part;427int8_t tsf_report_link_id;428uint16_t duration;429uint32_t flags;430struct wireless_dev *wdev;431struct wiphy *wiphy;432uint64_t scan_start;433uint32_t rates[NUM_NL80211_BANDS];434int ie_len;435uint8_t *ie;436uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN];437uint8_t bssid[ETH_ALEN];438int n_ssids;439int n_6ghz_params;440int n_channels;441struct cfg80211_ssid *ssids;442struct cfg80211_scan_6ghz_params *scan_6ghz_params;443struct linuxkpi_ieee80211_channel *channels[0];444};445446struct cfg80211_sched_scan_plan {447/* XXX TODO */448int interval, iterations;449};450451struct cfg80211_sched_scan_request {452/* XXX TODO */453int delay, flags;454uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN];455uint64_t reqid;456int n_match_sets;457int n_scan_plans;458int n_ssids;459int n_channels;460int ie_len;461uint8_t *ie;462struct cfg80211_match_set *match_sets;463struct cfg80211_sched_scan_plan *scan_plans;464struct cfg80211_ssid *ssids;465struct linuxkpi_ieee80211_channel *channels[0];466};467468struct cfg80211_scan_info {469uint64_t scan_start_tsf;470uint8_t tsf_bssid[ETH_ALEN];471bool aborted;472};473474struct cfg80211_beacon_data {475/* XXX TODO */476const uint8_t *head;477const uint8_t *tail;478uint32_t head_len;479uint32_t tail_len;480const uint8_t *proberesp_ies;481const uint8_t *assocresp_ies;482uint32_t proberesp_ies_len;483uint32_t assocresp_ies_len;484};485486struct cfg80211_ap_update {487/* XXX TODO */488struct cfg80211_beacon_data beacon;489};490491struct cfg80211_crypto_settings {492/* XXX TODO */493enum nl80211_wpa_versions wpa_versions;494uint32_t cipher_group; /* WLAN_CIPHER_SUITE_* */495uint32_t *akm_suites;496uint32_t *ciphers_pairwise;497const uint8_t *sae_pwd;498const uint8_t *psk;499int n_akm_suites;500int n_ciphers_pairwise;501int sae_pwd_len;502};503504struct cfg80211_ap_settings {505/* XXX TODO */506int auth_type, beacon_interval, dtim_period, hidden_ssid, inactivity_timeout;507const uint8_t *ssid;508size_t ssid_len;509struct cfg80211_beacon_data beacon;510struct cfg80211_chan_def chandef;511struct cfg80211_crypto_settings crypto;512};513514struct cfg80211_bss_selection {515/* XXX TODO */516enum nl80211_bss_select_attr behaviour;517union {518enum nl80211_band band_pref;519struct {520enum nl80211_band band;521uint8_t delta;522} adjust;523} param;524};525526struct cfg80211_connect_params {527/* XXX TODO */528struct linuxkpi_ieee80211_channel *channel;529struct linuxkpi_ieee80211_channel *channel_hint;530uint8_t *bssid;531uint8_t *bssid_hint;532const uint8_t *ie;533const uint8_t *ssid;534uint32_t ie_len;535uint32_t ssid_len;536const void *key;537uint32_t key_len;538int auth_type, key_idx, privacy, want_1x;539struct cfg80211_bss_selection bss_select;540struct cfg80211_crypto_settings crypto;541};542543enum bss_param_flags { /* Used as bitflags. XXX FIXME values? */544BSS_PARAM_FLAGS_CTS_PROT = 0x01,545BSS_PARAM_FLAGS_SHORT_PREAMBLE = 0x02,546BSS_PARAM_FLAGS_SHORT_SLOT_TIME = 0x04,547};548549struct cfg80211_ibss_params {550/* XXX TODO */551int basic_rates, beacon_interval;552int channel_fixed, ie, ie_len, privacy;553int dtim_period;554uint8_t *ssid;555uint8_t *bssid;556int ssid_len;557struct cfg80211_chan_def chandef;558enum bss_param_flags flags;559};560561struct cfg80211_mgmt_tx_params {562/* XXX TODO */563struct linuxkpi_ieee80211_channel *chan;564const uint8_t *buf;565size_t len;566int wait;567};568569struct cfg80211_external_auth_params {570uint8_t bssid[ETH_ALEN];571uint16_t status;572enum nl80211_external_auth_action action;573unsigned int key_mgmt_suite;574struct cfg80211_ssid ssid;575};576577struct cfg80211_pmk_conf {578/* XXX TODO */579const uint8_t *pmk;580uint8_t pmk_len;581};582583struct cfg80211_pmksa {584/* XXX TODO */585const uint8_t *bssid;586const uint8_t *pmkid;587const uint8_t *ssid;588size_t ssid_len;589};590591struct station_del_parameters {592/* XXX TODO */593const uint8_t *mac;594uint32_t reason_code; /* elsewhere uint16_t? */595};596597struct station_info {598uint64_t filled; /* enum nl80211_sta_info */599uint32_t connected_time;600uint32_t inactive_time;601602uint64_t rx_bytes;603uint32_t rx_packets;604uint32_t rx_dropped_misc;605606uint64_t rx_duration;607uint32_t rx_beacon;608uint8_t rx_beacon_signal_avg;609610int8_t signal;611int8_t signal_avg;612int8_t ack_signal;613int8_t avg_ack_signal;614615/* gap */616int generation;617618uint64_t tx_bytes;619uint32_t tx_packets;620uint32_t tx_failed;621uint64_t tx_duration;622uint32_t tx_retries;623624int chains;625uint8_t chain_signal[IEEE80211_MAX_CHAINS];626uint8_t chain_signal_avg[IEEE80211_MAX_CHAINS];627628uint8_t *assoc_req_ies;629size_t assoc_req_ies_len;630631struct rate_info rxrate;632struct rate_info txrate;633struct cfg80211_ibss_params bss_param;634struct nl80211_sta_flag_update sta_flags;635};636637struct station_parameters {638/* XXX TODO */639int sta_flags_mask, sta_flags_set;640};641642struct key_params {643/* XXX TODO */644const uint8_t *key;645const uint8_t *seq;646int key_len;647int seq_len;648uint32_t cipher; /* WLAN_CIPHER_SUITE_* */649};650651struct mgmt_frame_regs {652/* XXX TODO */653int interface_stypes;654};655656struct vif_params {657/* XXX TODO */658uint8_t macaddr[ETH_ALEN];659};660661/* That the world needs so many different structs for this is amazing. */662struct mac_address {663uint8_t addr[ETH_ALEN];664};665666struct ieee80211_reg_rule {667/* TODO FIXME */668uint32_t flags;669int dfs_cac_ms;670struct freq_range {671int start_freq_khz;672int end_freq_khz;673int max_bandwidth_khz;674} freq_range;675struct power_rule {676int max_antenna_gain;677int max_eirp;678} power_rule;679};680681struct linuxkpi_ieee80211_regdomain {682/* TODO FIXME */683uint8_t alpha2[2];684int dfs_region;685int n_reg_rules;686struct ieee80211_reg_rule reg_rules[];687};688689#define IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS 0x01690#define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454 0x02691#define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK 0x03692#define IEEE80211_EHT_MAC_CAP0_OM_CONTROL 0x04693#define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 0x05694#define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2 0x06695#define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991 0x07696#define IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC 0x08697698#define IEEE80211_EHT_MAC_CAP1_MAX_AMPDU_LEN_MASK 0x01699700#define IEEE80211_EHT_MCS_NSS_RX 0x01701#define IEEE80211_EHT_MCS_NSS_TX 0x02702703#define IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ 0x01704#define IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ 0x02705#define IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK 0x03706#define IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI 0x04707#define IEEE80211_EHT_PHY_CAP0_PARTIAL_BW_UL_MU_MIMO 0x05708#define IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE 0x06709#define IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER 0x07710711#define IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK 0x01712#define IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK 0x02713#define IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK 0x03714715#define IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_80MHZ_MASK 0x01716#define IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_160MHZ_MASK 0x02717#define IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_320MHZ_MASK 0x03718719#define IEEE80211_EHT_PHY_CAP3_CODEBOOK_4_2_SU_FDBK 0x01720#define IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK 0x02721#define IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK 0x03722#define IEEE80211_EHT_PHY_CAP3_NG_16_SU_FEEDBACK 0x04723#define IEEE80211_EHT_PHY_CAP3_TRIG_CQI_FDBK 0x05724#define IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK 0x06725#define IEEE80211_EHT_PHY_CAP3_TRIG_SU_BF_FDBK 0x07726#define IEEE80211_EHT_PHY_CAP3_SOUNDING_DIM_320MHZ_MASK 0x08727728#define IEEE80211_EHT_PHY_CAP4_EHT_MU_PPDU_4_EHT_LTF_08_GI 0x01729#define IEEE80211_EHT_PHY_CAP4_PART_BW_DL_MU_MIMO 0x02730#define IEEE80211_EHT_PHY_CAP4_POWER_BOOST_FACT_SUPP 0x03731#define IEEE80211_EHT_PHY_CAP4_MAX_NC_MASK 0x04732733#define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_0US 0x01734#define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_16US 0x02735#define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_20US 0x03736#define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_8US 0x04737#define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_MASK 0x05738#define IEEE80211_EHT_PHY_CAP5_NON_TRIG_CQI_FEEDBACK 0x06739#define IEEE80211_EHT_PHY_CAP5_PPE_THRESHOLD_PRESENT 0x07740#define IEEE80211_EHT_PHY_CAP5_RX_LESS_242_TONE_RU_SUPP 0x08741#define IEEE80211_EHT_PHY_CAP5_TX_LESS_242_TONE_RU_SUPP 0x09742#define IEEE80211_EHT_PHY_CAP5_MAX_NUM_SUPP_EHT_LTF_MASK 0x0a743#define IEEE80211_EHT_PHY_CAP5_SUPP_EXTRA_EHT_LTF 0x0b744745#define IEEE80211_EHT_PHY_CAP6_EHT_DUP_6GHZ_SUPP 0x01746#define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK 0x02747#define IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK 0x03748749#define IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ 0x01750#define IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ 0x02751#define IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_320MHZ 0x03752#define IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_80MHZ 0x04753#define IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_160MHZ 0x05754#define IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_320MHZ 0x06755756#define IEEE80211_EHT_PHY_CAP8_RX_1024QAM_WIDER_BW_DL_OFDMA 0x01757#define IEEE80211_EHT_PHY_CAP8_RX_4096QAM_WIDER_BW_DL_OFDMA 0x02758759#define IEEE80211_EHT_PPE_THRES_INFO_HEADER_SIZE 0x01760#define IEEE80211_EHT_PPE_THRES_NSS_MASK 0x02761#define IEEE80211_EHT_PPE_THRES_RU_INDEX_BITMASK_MASK 0x03762#define IEEE80211_EHT_PPE_THRES_INFO_PPET_SIZE 0x04763764#define IEEE80211_EML_CAP_EMLSR_SUPP 0x01765#define IEEE80211_EML_CAP_TRANSITION_TIMEOUT 0x02766#define IEEE80211_EML_CAP_TRANSITION_TIMEOUT_128TU 0x04767#define IEEE80211_EML_CAP_EMLSR_PADDING_DELAY 0x08768#define IEEE80211_EML_CAP_EMLSR_PADDING_DELAY_32US 0x10769#define IEEE80211_EML_CAP_EMLSR_PADDING_DELAY_256US 0x10770#define IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY 0x20771#define IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY_64US 0x40772#define IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY_256US 0x40773774#define VENDOR_CMD_RAW_DATA (void *)(uintptr_t)(-ENOENT)775776/* net80211::net80211_he_cap */777struct ieee80211_sta_he_cap {778bool has_he;779struct ieee80211_he_cap_elem he_cap_elem;780struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp;781uint8_t ppe_thres[IEEE80211_HE_CAP_PPE_THRES_MAX];782};783784struct cfg80211_he_bss_color {785int color, enabled;786};787788struct ieee80211_he_obss_pd {789bool enable;790uint8_t min_offset;791uint8_t max_offset;792uint8_t non_srg_max_offset;793uint8_t sr_ctrl;794uint8_t bss_color_bitmap[8];795uint8_t partial_bssid_bitmap[8];796};797798struct ieee80211_eht_mcs_nss_supp_20mhz_only {799union {800struct {801uint8_t rx_tx_mcs7_max_nss;802uint8_t rx_tx_mcs9_max_nss;803uint8_t rx_tx_mcs11_max_nss;804uint8_t rx_tx_mcs13_max_nss;805};806uint8_t rx_tx_max_nss[4];807};808};809810struct ieee80211_eht_mcs_nss_supp_bw {811union {812struct {813uint8_t rx_tx_mcs9_max_nss;814uint8_t rx_tx_mcs11_max_nss;815uint8_t rx_tx_mcs13_max_nss;816};817uint8_t rx_tx_max_nss[3];818};819};820821struct ieee80211_eht_cap_elem_fixed {822uint8_t mac_cap_info[2];823uint8_t phy_cap_info[9];824};825826struct ieee80211_eht_mcs_nss_supp {827/* TODO FIXME */828/* Can only have either or... */829union {830struct ieee80211_eht_mcs_nss_supp_20mhz_only only_20mhz;831struct {832struct ieee80211_eht_mcs_nss_supp_bw _80;833struct ieee80211_eht_mcs_nss_supp_bw _160;834struct ieee80211_eht_mcs_nss_supp_bw _320;835} bw;836};837};838839#define IEEE80211_STA_EHT_PPE_THRES_MAX 32840struct ieee80211_sta_eht_cap {841bool has_eht;842struct ieee80211_eht_cap_elem_fixed eht_cap_elem;843struct ieee80211_eht_mcs_nss_supp eht_mcs_nss_supp;844uint8_t eht_ppe_thres[IEEE80211_STA_EHT_PPE_THRES_MAX];845};846847struct ieee80211_sband_iftype_data {848/* TODO FIXME */849enum nl80211_iftype types_mask;850struct ieee80211_sta_he_cap he_cap;851struct ieee80211_he_6ghz_capa he_6ghz_capa;852struct ieee80211_sta_eht_cap eht_cap;853struct {854const uint8_t *data;855size_t len;856} vendor_elems;857};858859struct ieee80211_supported_band {860/* TODO FIXME */861struct linuxkpi_ieee80211_channel *channels;862struct ieee80211_rate *bitrates;863struct ieee80211_sband_iftype_data *iftype_data;864int n_channels;865int n_bitrates;866int n_iftype_data;867enum nl80211_band band;868struct ieee80211_sta_ht_cap ht_cap;869struct ieee80211_sta_vht_cap vht_cap;870};871872struct cfg80211_pkt_pattern {873/* XXX TODO */874uint8_t *mask;875uint8_t *pattern;876int pattern_len;877int pkt_offset;878};879880struct cfg80211_wowlan_nd_match {881/* XXX TODO */882struct cfg80211_ssid ssid;883int n_channels;884uint32_t channels[0]; /* freq! = ieee80211_channel_to_frequency() */885};886887struct cfg80211_wowlan_nd_info {888/* XXX TODO */889int n_matches;890struct cfg80211_wowlan_nd_match *matches[0];891};892893enum wiphy_wowlan_support_flags {894WIPHY_WOWLAN_DISCONNECT,895WIPHY_WOWLAN_MAGIC_PKT,896WIPHY_WOWLAN_SUPPORTS_GTK_REKEY,897WIPHY_WOWLAN_GTK_REKEY_FAILURE,898WIPHY_WOWLAN_EAP_IDENTITY_REQ,899WIPHY_WOWLAN_4WAY_HANDSHAKE,900WIPHY_WOWLAN_RFKILL_RELEASE,901WIPHY_WOWLAN_NET_DETECT,902};903904struct wiphy_wowlan_support {905/* XXX TODO */906enum wiphy_wowlan_support_flags flags;907int max_nd_match_sets, max_pkt_offset, n_patterns, pattern_max_len, pattern_min_len;908};909910struct cfg80211_wowlan_wakeup {911/* XXX TODO */912uint16_t pattern_idx;913bool disconnect;914bool unprot_deauth_disassoc;915bool eap_identity_req;916bool four_way_handshake;917bool gtk_rekey_failure;918bool magic_pkt;919bool rfkill_release;920bool tcp_connlost;921bool tcp_nomoretokens;922bool tcp_match;923bool packet_80211;924struct cfg80211_wowlan_nd_info *net_detect;925uint8_t *packet;926uint16_t packet_len;927uint16_t packet_present_len;928};929930struct cfg80211_wowlan {931/* XXX TODO */932bool any;933bool disconnect;934bool magic_pkt;935bool gtk_rekey_failure;936bool eap_identity_req;937bool four_way_handshake;938bool rfkill_release;939940/* Magic packet patterns. */941int n_patterns;942struct cfg80211_pkt_pattern *patterns;943944/* netdetect? if not assoc? */945struct cfg80211_sched_scan_request *nd_config;946947void *tcp; /* XXX ? */948};949950struct cfg80211_gtk_rekey_data {951/* XXX TODO */952const uint8_t *kck, *kek, *replay_ctr;953uint32_t akm;954uint8_t kck_len, kek_len;955};956957struct cfg80211_tid_cfg {958/* XXX TODO */959int mask, noack, retry_long, rtscts, tids, amsdu, ampdu;960enum nl80211_tx_rate_setting txrate_type;961struct cfg80211_bitrate_mask txrate_mask;962};963964struct cfg80211_tid_config {965/* XXX TODO */966int n_tid_conf;967struct cfg80211_tid_cfg tid_conf[0];968};969970struct ieee80211_iface_limit {971/* TODO FIXME */972int max, types;973};974975struct ieee80211_iface_combination {976/* TODO FIXME */977const struct ieee80211_iface_limit *limits;978int n_limits;979int max_interfaces, num_different_channels;980int beacon_int_infra_match, beacon_int_min_gcd;981int radar_detect_widths;982};983984struct iface_combination_params {985int num_different_channels;986int iftype_num[NUM_NL80211_IFTYPES];987};988989struct regulatory_request {990/* XXX TODO */991uint8_t alpha2[2];992enum environment_cap country_ie_env;993int initiator, dfs_region;994int user_reg_hint_type;995};996997struct cfg80211_set_hw_timestamp {998const uint8_t *macaddr;999bool enable;1000};10011002struct survey_info { /* net80211::struct ieee80211_channel_survey */1003/* TODO FIXME */1004uint32_t filled;1005#define SURVEY_INFO_TIME 0x00011006#define SURVEY_INFO_TIME_RX 0x00021007#define SURVEY_INFO_TIME_SCAN 0x00041008#define SURVEY_INFO_TIME_TX 0x00081009#define SURVEY_INFO_TIME_BSS_RX 0x00101010#define SURVEY_INFO_TIME_BUSY 0x00201011#define SURVEY_INFO_IN_USE 0x00401012#define SURVEY_INFO_NOISE_DBM 0x00801013uint32_t noise;1014uint64_t time;1015uint64_t time_bss_rx;1016uint64_t time_busy;1017uint64_t time_rx;1018uint64_t time_scan;1019uint64_t time_tx;1020struct linuxkpi_ieee80211_channel *channel;1021};10221023enum wiphy_bss_param_flags {1024WIPHY_BSS_PARAM_AP_ISOLATE = BIT(0),1025};10261027struct bss_parameters {1028int ap_isolate;1029};10301031enum wiphy_vendor_cmd_need_flags {1032WIPHY_VENDOR_CMD_NEED_NETDEV = 0x01,1033WIPHY_VENDOR_CMD_NEED_RUNNING = 0x02,1034WIPHY_VENDOR_CMD_NEED_WDEV = 0x04,1035};10361037struct wiphy_vendor_command {1038struct {1039uint32_t vendor_id;1040uint32_t subcmd;1041};1042uint32_t flags;1043void *policy;1044int (*doit)(struct wiphy *, struct wireless_dev *, const void *, int);1045};10461047struct wiphy_iftype_ext_capab {1048/* TODO FIXME */1049enum nl80211_iftype iftype;1050const uint8_t *extended_capabilities;1051const uint8_t *extended_capabilities_mask;1052uint8_t extended_capabilities_len;1053uint16_t eml_capabilities;1054uint16_t mld_capa_and_ops;1055};10561057struct tid_config_support {1058/* TODO FIXME */1059uint64_t vif; /* enum nl80211_tid_cfg_attr */1060uint64_t peer; /* enum nl80211_tid_cfg_attr */1061};10621063enum cfg80211_regulatory {1064REGULATORY_CUSTOM_REG = BIT(0),1065REGULATORY_STRICT_REG = BIT(1),1066REGULATORY_DISABLE_BEACON_HINTS = BIT(2),1067REGULATORY_ENABLE_RELAX_NO_IR = BIT(3),1068REGULATORY_WIPHY_SELF_MANAGED = BIT(4),1069REGULATORY_COUNTRY_IE_IGNORE = BIT(5),1070REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(6),1071};10721073struct wiphy_radio_freq_range {1074uint32_t start_freq;1075uint32_t end_freq;1076};10771078struct wiphy_radio {1079int n_freq_range;1080int n_iface_combinations;1081const struct wiphy_radio_freq_range *freq_range;1082const struct ieee80211_iface_combination *iface_combinations;1083};10841085enum wiphy_flags {1086WIPHY_FLAG_AP_UAPSD = BIT(0),1087WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(1),1088WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(2),1089WIPHY_FLAG_HAVE_AP_SME = BIT(3),1090WIPHY_FLAG_IBSS_RSN = BIT(4),1091WIPHY_FLAG_NETNS_OK = BIT(5),1092WIPHY_FLAG_OFFCHAN_TX = BIT(6),1093WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(7),1094WIPHY_FLAG_SPLIT_SCAN_6GHZ = BIT(8),1095WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(9),1096WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(10),1097WIPHY_FLAG_SUPPORTS_TDLS = BIT(11),1098WIPHY_FLAG_TDLS_EXTERNAL_SETUP = BIT(12),1099WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = BIT(13),1100WIPHY_FLAG_4ADDR_AP = BIT(14),1101WIPHY_FLAG_4ADDR_STATION = BIT(15),1102WIPHY_FLAG_SUPPORTS_MLO = BIT(16),1103WIPHY_FLAG_DISABLE_WEXT = BIT(17),1104};11051106struct wiphy_work;1107typedef void (*wiphy_work_fn)(struct wiphy *, struct wiphy_work *);1108struct wiphy_work {1109struct list_head entry;1110wiphy_work_fn fn;1111};1112struct wiphy_delayed_work {1113struct wiphy_work work;1114struct wiphy *wiphy;1115struct timer_list timer;1116};11171118struct wiphy {1119struct mutex mtx;1120struct device *dev;1121struct mac_address *addresses;1122int n_addresses;1123uint32_t flags;1124struct ieee80211_supported_band *bands[NUM_NL80211_BANDS];1125uint8_t perm_addr[ETH_ALEN];1126uint16_t max_scan_ie_len;11271128/* XXX TODO */1129const struct cfg80211_pmsr_capabilities *pmsr_capa;1130const struct cfg80211_sar_capa *sar_capa;1131const struct wiphy_iftype_ext_capab *iftype_ext_capab;1132const struct linuxkpi_ieee80211_regdomain *regd;1133char fw_version[ETHTOOL_FWVERS_LEN];1134const struct ieee80211_iface_combination *iface_combinations;1135const uint32_t *cipher_suites;1136int n_iface_combinations;1137int n_cipher_suites;1138void(*reg_notifier)(struct wiphy *, struct regulatory_request *);1139enum cfg80211_regulatory regulatory_flags;1140int n_vendor_commands;1141const struct wiphy_vendor_command *vendor_commands;1142const struct ieee80211_txrx_stypes *mgmt_stypes;1143uint32_t rts_threshold;1144uint32_t frag_threshold;1145struct tid_config_support tid_config_support;1146uint8_t available_antennas_rx;1147uint8_t available_antennas_tx;11481149int n_radio;1150const struct wiphy_radio *radio;11511152uint32_t bss_param_support; /* enum wiphy_bss_param_flags */11531154int features, hw_version;1155int interface_modes, max_match_sets, max_remain_on_channel_duration, max_scan_ssids, max_sched_scan_ie_len, max_sched_scan_plan_interval, max_sched_scan_plan_iterations, max_sched_scan_plans, max_sched_scan_reqs, max_sched_scan_ssids;1156int num_iftype_ext_capab;1157int max_ap_assoc_sta, probe_resp_offload, software_iftypes;1158int bss_select_support, max_num_pmkids, retry_long, retry_short, signal_type;1159int max_data_retry_count;1160int tx_queue_len, rfkill;1161int mbssid_max_interfaces;1162int hw_timestamp_max_peers;1163int ema_max_profile_periodicity;11641165unsigned long ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)];1166struct dentry *debugfsdir;11671168const struct wiphy_wowlan_support *wowlan;1169struct cfg80211_wowlan *wowlan_config;1170/* Lower layer (driver/mac80211) specific data. */1171/* Must stay last. */1172uint8_t priv[0] __aligned(CACHE_LINE_SIZE);1173};11741175#define lockdep_assert_wiphy(wiphy) \1176lockdep_assert_held(&(wiphy)->mtx)11771178struct wireless_dev {1179/* XXX TODO, like ic? */1180enum nl80211_iftype iftype;1181uint32_t radio_mask;1182uint8_t address[ETH_ALEN];1183struct net_device *netdev;1184struct wiphy *wiphy;1185};11861187struct cfg80211_ops {1188/* XXX TODO */1189struct wireless_dev *(*add_virtual_intf)(struct wiphy *, const char *, unsigned char, enum nl80211_iftype, struct vif_params *);1190int (*del_virtual_intf)(struct wiphy *, struct wireless_dev *);1191int (*change_virtual_intf)(struct wiphy *, struct net_device *, enum nl80211_iftype, struct vif_params *);1192int (*scan)(struct wiphy *, struct cfg80211_scan_request *);1193int (*set_wiphy_params)(struct wiphy *, int, uint32_t);1194int (*join_ibss)(struct wiphy *, struct net_device *, struct cfg80211_ibss_params *);1195int (*leave_ibss)(struct wiphy *, struct net_device *);1196int (*get_station)(struct wiphy *, struct net_device *, const uint8_t *, struct station_info *);1197int (*dump_station)(struct wiphy *, struct net_device *, int, uint8_t *, struct station_info *);1198int (*set_tx_power)(struct wiphy *, struct wireless_dev *, int, enum nl80211_tx_power_setting, int);1199int (*get_tx_power)(struct wiphy *, struct wireless_dev *, int, unsigned int, int *);1200int (*add_key)(struct wiphy *, struct net_device *, int, uint8_t, bool, const uint8_t *, struct key_params *);1201int (*del_key)(struct wiphy *, struct net_device *, int, uint8_t, bool, const uint8_t *);1202int (*get_key)(struct wiphy *, struct net_device *, int, uint8_t, bool, const uint8_t *, void *, void(*)(void *, struct key_params *));1203int (*set_default_key)(struct wiphy *, struct net_device *, int, uint8_t, bool, bool);1204int (*set_default_mgmt_key)(struct wiphy *, struct net_device *, int, uint8_t);1205int (*set_power_mgmt)(struct wiphy *, struct net_device *, bool, int);1206int (*connect)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *);1207int (*disconnect)(struct wiphy *, struct net_device *, uint16_t);1208int (*suspend)(struct wiphy *, struct cfg80211_wowlan *);1209int (*resume)(struct wiphy *);1210int (*set_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *);1211int (*del_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *);1212int (*flush_pmksa)(struct wiphy *, struct net_device *);1213int (*start_ap)(struct wiphy *, struct net_device *, struct cfg80211_ap_settings *);1214int (*stop_ap)(struct wiphy *, struct net_device *, unsigned int);1215int (*change_beacon)(struct wiphy *, struct net_device *, struct cfg80211_ap_update *);1216int (*del_station)(struct wiphy *, struct net_device *, struct station_del_parameters *);1217int (*change_station)(struct wiphy *, struct net_device *, const uint8_t *, struct station_parameters *);1218int (*sched_scan_start)(struct wiphy *, struct net_device *, struct cfg80211_sched_scan_request *);1219int (*sched_scan_stop)(struct wiphy *, struct net_device *, uint64_t);1220void (*update_mgmt_frame_registrations)(struct wiphy *, struct wireless_dev *, struct mgmt_frame_regs *);1221int (*mgmt_tx)(struct wiphy *, struct wireless_dev *, struct cfg80211_mgmt_tx_params *, uint64_t *);1222int (*cancel_remain_on_channel)(struct wiphy *, struct wireless_dev *, uint64_t);1223int (*get_channel)(struct wiphy *, struct wireless_dev *, unsigned int, struct cfg80211_chan_def *);1224int (*crit_proto_start)(struct wiphy *, struct wireless_dev *, enum nl80211_crit_proto_id, uint16_t);1225void (*crit_proto_stop)(struct wiphy *, struct wireless_dev *);1226int (*tdls_oper)(struct wiphy *, struct net_device *, const uint8_t *, enum nl80211_tdls_operation);1227int (*update_connect_params)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *, uint32_t);1228int (*set_pmk)(struct wiphy *, struct net_device *, const struct cfg80211_pmk_conf *);1229int (*del_pmk)(struct wiphy *, struct net_device *, const uint8_t *);1230int (*remain_on_channel)(struct wiphy *, struct wireless_dev *, struct linuxkpi_ieee80211_channel *, unsigned int, uint64_t *);1231int (*start_p2p_device)(struct wiphy *, struct wireless_dev *);1232void (*stop_p2p_device)(struct wiphy *, struct wireless_dev *);1233int (*dump_survey)(struct wiphy *, struct net_device *, int, struct survey_info *);1234int (*external_auth)(struct wiphy *, struct net_device *, struct cfg80211_external_auth_params *);1235int (*set_cqm_rssi_range_config)(struct wiphy *, struct net_device *, int, int);1236int (*change_bss)(struct wiphy *, struct net_device *, struct bss_parameters *);1237};123812391240/* -------------------------------------------------------------------------- */12411242/* linux_80211.c */12431244struct wiphy *linuxkpi_wiphy_new(const struct cfg80211_ops *, size_t);1245void linuxkpi_wiphy_free(struct wiphy *wiphy);1246int linuxkpi_80211_wiphy_register(struct wiphy *);12471248void linuxkpi_wiphy_work_queue(struct wiphy *, struct wiphy_work *);1249void linuxkpi_wiphy_work_cancel(struct wiphy *, struct wiphy_work *);1250void linuxkpi_wiphy_work_flush(struct wiphy *, struct wiphy_work *);1251void lkpi_wiphy_delayed_work_timer(struct timer_list *);1252void linuxkpi_wiphy_delayed_work_queue(struct wiphy *,1253struct wiphy_delayed_work *, unsigned long);1254void linuxkpi_wiphy_delayed_work_cancel(struct wiphy *,1255struct wiphy_delayed_work *);1256void linuxkpi_wiphy_delayed_work_flush(struct wiphy *,1257struct wiphy_delayed_work *);12581259int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy,1260struct linuxkpi_ieee80211_regdomain *regd);1261uint32_t linuxkpi_cfg80211_calculate_bitrate(struct rate_info *);1262uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band);1263uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t);1264struct linuxkpi_ieee80211_channel *1265linuxkpi_ieee80211_get_channel(struct wiphy *, uint32_t);1266struct cfg80211_bss *linuxkpi_cfg80211_get_bss(struct wiphy *,1267struct linuxkpi_ieee80211_channel *, const uint8_t *,1268const uint8_t *, size_t, enum ieee80211_bss_type, enum ieee80211_privacy);1269void linuxkpi_cfg80211_put_bss(struct wiphy *, struct cfg80211_bss *);1270void linuxkpi_cfg80211_bss_flush(struct wiphy *);1271struct linuxkpi_ieee80211_regdomain *1272lkpi_get_linuxkpi_ieee80211_regdomain(size_t);12731274/* -------------------------------------------------------------------------- */12751276static __inline struct wiphy *1277wiphy_new(const struct cfg80211_ops *ops, size_t priv_len)1278{12791280return (linuxkpi_wiphy_new(ops, priv_len));1281}12821283static __inline void1284wiphy_free(struct wiphy *wiphy)1285{12861287linuxkpi_wiphy_free(wiphy);1288}12891290static __inline void *1291wiphy_priv(struct wiphy *wiphy)1292{12931294return (wiphy->priv);1295}12961297static __inline void1298set_wiphy_dev(struct wiphy *wiphy, struct device *dev)1299{13001301wiphy->dev = dev;1302}13031304static __inline struct device *1305wiphy_dev(struct wiphy *wiphy)1306{13071308return (wiphy->dev);1309}13101311#define wiphy_dereference(_w, p) \1312rcu_dereference_check(p, lockdep_is_held(&(_w)->mtx))13131314#define wiphy_lock(_w) mutex_lock(&(_w)->mtx)1315#define wiphy_unlock(_w) mutex_unlock(&(_w)->mtx)13161317static __inline void1318wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked,1319enum rfkill_hard_block_reasons reason)1320{1321TODO();1322}13231324/* -------------------------------------------------------------------------- */13251326static inline int1327cfg80211_register_netdevice(struct net_device *ndev)1328{1329TODO();1330return (-ENXIO);1331}13321333static inline void1334cfg80211_unregister_netdevice(struct net_device *ndev)1335{1336TODO();1337}13381339/* -------------------------------------------------------------------------- */13401341static inline struct cfg80211_bss *1342cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan,1343const uint8_t *bssid, const uint8_t *ssid, size_t ssid_len,1344enum ieee80211_bss_type bss_type, enum ieee80211_privacy privacy)1345{13461347return (linuxkpi_cfg80211_get_bss(wiphy, chan, bssid, ssid, ssid_len,1348bss_type, privacy));1349}13501351static inline void1352cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss)1353{13541355linuxkpi_cfg80211_put_bss(wiphy, bss);1356}13571358static inline void1359cfg80211_bss_flush(struct wiphy *wiphy)1360{13611362linuxkpi_cfg80211_bss_flush(wiphy);1363}13641365/* -------------------------------------------------------------------------- */13661367static __inline bool1368rfkill_blocked(int rfkill) /* argument type? */1369{1370TODO();1371return (false);1372}13731374static __inline bool1375rfkill_soft_blocked(int rfkill)1376{1377TODO();1378return (false);1379}13801381static __inline void1382wiphy_rfkill_start_polling(struct wiphy *wiphy)1383{1384TODO();1385}13861387static __inline void1388wiphy_rfkill_stop_polling(struct wiphy *wiphy)1389{1390TODO();1391}13921393static __inline int1394reg_query_regdb_wmm(uint8_t *alpha2, uint32_t center_freq,1395struct ieee80211_reg_rule *rule)1396{13971398IMPROVE("regdomain.xml needs to grow wmm information for at least ETSI");13991400return (-ENODATA);1401}14021403static __inline const uint8_t *1404cfg80211_find_ie_match(uint32_t f, const uint8_t *ies, size_t ies_len,1405const uint8_t *match, int x, int y)1406{1407TODO();1408return (NULL);1409}14101411static __inline const uint8_t *1412cfg80211_find_ie(uint8_t eid, const uint8_t *ie, uint32_t ielen)1413{1414TODO();1415return (NULL);1416}14171418static __inline void1419cfg80211_pmsr_complete(struct wireless_dev *wdev,1420struct cfg80211_pmsr_request *req, gfp_t gfp)1421{1422TODO();1423}14241425static __inline void1426cfg80211_pmsr_report(struct wireless_dev *wdev,1427struct cfg80211_pmsr_request *req,1428struct cfg80211_pmsr_result *result, gfp_t gfp)1429{1430TODO();1431}14321433static inline int1434nl80211_chan_width_to_mhz(enum nl80211_chan_width width)1435{1436switch (width) {1437case NL80211_CHAN_WIDTH_5:1438return (5);1439break;1440case NL80211_CHAN_WIDTH_10:1441return (10);1442break;1443case NL80211_CHAN_WIDTH_20_NOHT:1444case NL80211_CHAN_WIDTH_20:1445return (20);1446break;1447case NL80211_CHAN_WIDTH_40:1448return (40);1449break;1450case NL80211_CHAN_WIDTH_80:1451case NL80211_CHAN_WIDTH_80P80:1452return (80);1453break;1454case NL80211_CHAN_WIDTH_160:1455return (160);1456break;1457case NL80211_CHAN_WIDTH_320:1458return (320);1459break;1460}1461}14621463static inline void1464cfg80211_chandef_create(struct cfg80211_chan_def *chandef,1465struct linuxkpi_ieee80211_channel *chan, enum nl80211_channel_type chan_type)1466{14671468KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__));1469KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__));14701471memset(chandef, 0, sizeof(*chandef));1472chandef->chan = chan;1473chandef->center_freq1 = chan->center_freq;1474/* chandef->width, center_freq2, punctured */14751476switch (chan_type) {1477case NL80211_CHAN_NO_HT:1478chandef->width = NL80211_CHAN_WIDTH_20_NOHT;1479break;1480case NL80211_CHAN_HT20:1481chandef->width = NL80211_CHAN_WIDTH_20;1482break;1483case NL80211_CHAN_HT40MINUS:1484chandef->width = NL80211_CHAN_WIDTH_40;1485chandef->center_freq1 -= 10;1486break;1487case NL80211_CHAN_HT40PLUS:1488chandef->width = NL80211_CHAN_WIDTH_40;1489chandef->center_freq1 += 10;1490break;1491};1492}14931494static __inline bool1495cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)1496{1497TODO();1498return (false);1499}15001501static inline int1502cfg80211_chandef_get_width(const struct cfg80211_chan_def *chandef)1503{1504return (nl80211_chan_width_to_mhz(chandef->width));1505}15061507static __inline bool1508cfg80211_chandef_dfs_usable(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef)1509{1510TODO();1511return (false);1512}15131514static __inline unsigned int1515cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef)1516{1517TODO();1518return (0);1519}15201521static __inline bool1522cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef_1,1523const struct cfg80211_chan_def *chandef_2)1524{1525TODO();1526return (false);1527}15281529static __inline bool1530cfg80211_chandef_usable(struct wiphy *wiphy,1531const struct cfg80211_chan_def *chandef, uint32_t flags)1532{1533TODO();1534return (false);1535}15361537static __inline void1538cfg80211_bss_iter(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,1539void (*iterfunc)(struct wiphy *, struct cfg80211_bss *, void *), void *data)1540{1541TODO();1542}15431544struct element {1545uint8_t id;1546uint8_t datalen;1547uint8_t data[0];1548} __packed;15491550static inline const struct element *1551lkpi_cfg80211_find_elem_pattern(enum ieee80211_eid eid,1552const uint8_t *data, size_t len, uint8_t *pattern, size_t plen)1553{1554const struct element *elem;1555const uint8_t *p;1556size_t ielen;15571558p = data;1559elem = (const struct element *)p;1560ielen = len;1561while (elem != NULL && ielen > 1) {1562if ((2 + elem->datalen) > ielen)1563/* Element overruns our memory. */1564return (NULL);1565if (elem->id == eid) {1566if (pattern == NULL)1567return (elem);1568if (elem->datalen >= plen &&1569memcmp(elem->data, pattern, plen) == 0)1570return (elem);1571}1572ielen -= 2 + elem->datalen;1573p += 2 + elem->datalen;1574elem = (const struct element *)p;1575}15761577return (NULL);1578}15791580static inline const struct element *1581cfg80211_find_elem(enum ieee80211_eid eid, const uint8_t *data, size_t len)1582{15831584return (lkpi_cfg80211_find_elem_pattern(eid, data, len, NULL, 0));1585}15861587static inline const struct element *1588ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid)1589{15901591if (bss->ies == NULL)1592return (NULL);1593return (cfg80211_find_elem(eid, bss->ies->data, bss->ies->len));1594}15951596static inline const uint8_t *1597ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid)1598{15991600return ((const uint8_t *)ieee80211_bss_get_elem(bss, eid));1601}16021603static inline uint8_t *1604cfg80211_find_vendor_ie(unsigned int oui, int oui_type,1605uint8_t *data, size_t len)1606{1607const struct element *elem;1608uint8_t pattern[4] = { oui << 16, oui << 8, oui, oui_type };1609uint8_t plen = 4; /* >= 3? oui_type always part of this? */1610IMPROVE("plen currently always incl. oui_type");16111612elem = lkpi_cfg80211_find_elem_pattern(IEEE80211_ELEMID_VENDOR,1613data, len, pattern, plen);1614if (elem == NULL)1615return (NULL);1616return (__DECONST(uint8_t *, elem));1617}16181619static inline uint32_t1620cfg80211_calculate_bitrate(struct rate_info *rate)1621{1622return (linuxkpi_cfg80211_calculate_bitrate(rate));1623}16241625static __inline uint32_t1626ieee80211_channel_to_frequency(uint32_t channel, enum nl80211_band band)1627{16281629return (linuxkpi_ieee80211_channel_to_frequency(channel, band));1630}16311632static __inline uint32_t1633ieee80211_frequency_to_channel(uint32_t freq)1634{16351636return (linuxkpi_ieee80211_frequency_to_channel(freq, 0));1637}16381639static __inline int1640regulatory_set_wiphy_regd_sync(struct wiphy *wiphy,1641struct linuxkpi_ieee80211_regdomain *regd)1642{1643IMPROVE();1644return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd));1645}16461647static __inline int1648regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy,1649struct linuxkpi_ieee80211_regdomain *regd)1650{16511652IMPROVE();1653return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd));1654}16551656static __inline int1657regulatory_set_wiphy_regd(struct wiphy *wiphy,1658struct linuxkpi_ieee80211_regdomain *regd)1659{16601661IMPROVE();1662if (regd == NULL)1663return (EINVAL);16641665/* XXX-BZ wild guessing here based on brcmfmac. */1666if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)1667wiphy->regd = regd;1668else1669return (EPERM);16701671/* XXX FIXME, do we have to do anything with reg_notifier? */1672return (0);1673}16741675static __inline int1676regulatory_hint(struct wiphy *wiphy, const uint8_t *alpha2)1677{1678struct linuxkpi_ieee80211_regdomain *regd;16791680if (wiphy->regd != NULL)1681return (-EBUSY);16821683regd = lkpi_get_linuxkpi_ieee80211_regdomain(0);1684if (regd == NULL)1685return (-ENOMEM);16861687regd->alpha2[0] = alpha2[0];1688regd->alpha2[1] = alpha2[1];1689wiphy->regd = regd;16901691IMPROVE("are there flags who is managing? update net8011?");16921693return (0);1694}16951696static __inline const char *1697reg_initiator_name(enum nl80211_reg_initiator initiator)1698{1699TODO();1700return (NULL);1701}17021703static __inline struct linuxkpi_ieee80211_regdomain *1704rtnl_dereference(const struct linuxkpi_ieee80211_regdomain *regd)1705{1706TODO();1707return (NULL);1708}17091710static __inline struct ieee80211_reg_rule *1711freq_reg_info(struct wiphy *wiphy, uint32_t center_freq)1712{1713TODO();1714return (NULL);1715}17161717static __inline void1718wiphy_apply_custom_regulatory(struct wiphy *wiphy,1719const struct linuxkpi_ieee80211_regdomain *regd)1720{1721TODO();1722}17231724static __inline char *1725wiphy_name(struct wiphy *wiphy)1726{1727if (wiphy != NULL && wiphy->dev != NULL)1728return dev_name(wiphy->dev);1729else {1730IMPROVE("wlanNA");1731return ("wlanNA");1732}1733}17341735static __inline void1736wiphy_read_of_freq_limits(struct wiphy *wiphy)1737{1738#ifdef FDT1739TODO();1740#endif1741}17421743static __inline void1744wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef)1745{17461747set_bit(ef, wiphy->ext_features);1748}17491750static inline bool1751wiphy_ext_feature_isset(struct wiphy *wiphy, enum nl80211_ext_feature ef)1752{1753return (test_bit(ef, wiphy->ext_features));1754}17551756static __inline void *1757wiphy_net(struct wiphy *wiphy)1758{1759TODO();1760return (NULL); /* XXX passed to dev_net_set() */1761}17621763static __inline int1764wiphy_register(struct wiphy *wiphy)1765{1766return (linuxkpi_80211_wiphy_register(wiphy));1767}17681769static __inline void1770wiphy_unregister(struct wiphy *wiphy)1771{1772TODO();1773}17741775static __inline void1776wiphy_warn(struct wiphy *wiphy, const char *fmt, ...)1777{1778TODO();1779}17801781static __inline int1782cfg80211_check_combinations(struct wiphy *wiphy,1783struct iface_combination_params *params)1784{1785TODO();1786return (-ENOENT);1787}17881789static __inline uint8_t1790cfg80211_classify8021d(struct sk_buff *skb, void *p)1791{1792TODO();1793return (0);1794}17951796static __inline void1797cfg80211_connect_done(struct net_device *ndev,1798struct cfg80211_connect_resp_params *conn_params, gfp_t gfp)1799{1800TODO();1801}18021803static __inline void1804cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)1805{1806TODO();1807}18081809static __inline void1810cfg80211_disconnected(struct net_device *ndev, uint16_t reason,1811void *p, int x, bool locally_generated, gfp_t gfp)1812{1813TODO();1814}18151816static __inline int1817cfg80211_get_p2p_attr(const uint8_t *ie, uint32_t ie_len,1818enum ieee80211_p2p_attr_ids attr, uint8_t *p, size_t p_len)1819{1820TODO();1821return (-1);1822}18231824static __inline void1825cfg80211_ibss_joined(struct net_device *ndev, const uint8_t *addr,1826struct linuxkpi_ieee80211_channel *chan, gfp_t gfp)1827{1828TODO();1829}18301831static __inline struct cfg80211_bss *1832cfg80211_inform_bss(struct wiphy *wiphy,1833struct linuxkpi_ieee80211_channel *channel,1834enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x,1835uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len,1836int signal, gfp_t gfp)1837{1838TODO();1839return (NULL);1840}18411842static __inline struct cfg80211_bss *1843cfg80211_inform_bss_data(struct wiphy *wiphy,1844struct cfg80211_inform_bss *bss_data,1845enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x,1846uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, gfp_t gfp)1847{1848TODO();1849return (NULL);1850}18511852static __inline void1853cfg80211_mgmt_tx_status(struct wireless_dev *wdev, uint64_t cookie,1854const uint8_t *buf, size_t len, bool ack, gfp_t gfp)1855{1856TODO();1857}18581859static __inline void1860cfg80211_michael_mic_failure(struct net_device *ndev, const uint8_t addr[ETH_ALEN],1861enum nl80211_key_type key_type, int _x, void *p, gfp_t gfp)1862{1863TODO();1864}18651866static __inline void1867cfg80211_new_sta(struct net_device *ndev, const uint8_t *addr,1868struct station_info *sinfo, gfp_t gfp)1869{1870TODO();1871}18721873static __inline void1874cfg80211_del_sta(struct net_device *ndev, const uint8_t *addr, gfp_t gfp)1875{1876TODO();1877}18781879static __inline void1880cfg80211_port_authorized(struct net_device *ndev, const uint8_t *addr,1881const uint8_t *bitmap, uint8_t len, gfp_t gfp)1882{1883TODO();1884}18851886static __inline void1887cfg80211_ready_on_channel(struct wireless_dev *wdev, uint64_t cookie,1888struct linuxkpi_ieee80211_channel *channel, unsigned int duration,1889gfp_t gfp)1890{1891TODO();1892}18931894static __inline void1895cfg80211_remain_on_channel_expired(struct wireless_dev *wdev,1896uint64_t cookie, struct linuxkpi_ieee80211_channel *channel, gfp_t gfp)1897{1898TODO();1899}19001901static __inline void1902cfg80211_report_wowlan_wakeup(void)1903{1904TODO();1905}19061907static __inline void1908cfg80211_roamed(struct net_device *ndev, struct cfg80211_roam_info *roam_info,1909gfp_t gfp)1910{1911TODO();1912}19131914static __inline void1915cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int _x,1916uint8_t *p, size_t p_len, int _x2)1917{1918TODO();1919}19201921static __inline void1922cfg80211_scan_done(struct cfg80211_scan_request *scan_request,1923struct cfg80211_scan_info *info)1924{1925TODO();1926}19271928static __inline void1929cfg80211_sched_scan_results(struct wiphy *wiphy, uint64_t reqid)1930{1931TODO();1932}19331934static __inline void1935cfg80211_sched_scan_stopped(struct wiphy *wiphy, int _x)1936{1937TODO();1938}19391940static __inline void1941cfg80211_unregister_wdev(struct wireless_dev *wdev)1942{1943TODO();1944}19451946static __inline struct sk_buff *1947cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, unsigned int len)1948{1949TODO();1950return (NULL);1951}19521953static __inline int1954cfg80211_vendor_cmd_reply(struct sk_buff *skb)1955{1956TODO();1957return (-ENXIO);1958}19591960static __inline struct linuxkpi_ieee80211_channel *1961ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq)1962{19631964return (linuxkpi_ieee80211_get_channel(wiphy, freq));1965}19661967static inline size_t1968ieee80211_get_hdrlen_from_skb(struct sk_buff *skb)1969{1970const struct ieee80211_hdr *hdr;1971size_t len;19721973if (skb->len < 10) /* sizeof(ieee80211_frame_[ack,cts]) */1974return (0);19751976hdr = (const struct ieee80211_hdr *)skb->data;1977len = ieee80211_hdrlen(hdr->frame_control);19781979/* If larger than what is in the skb return. */1980if (len > skb->len)1981return (0);19821983return (len);1984}19851986static __inline bool1987cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel)1988{19891990/* Only 6Ghz. */1991if (channel->band != NL80211_BAND_6GHZ)1992return (false);19931994TODO();1995return (false);1996}19971998static inline int1999cfg80211_get_ies_channel_number(const uint8_t *ie, size_t len,2000enum nl80211_band band)2001{2002const struct element *elem;20032004switch (band) {2005case NL80211_BAND_6GHZ:2006TODO();2007break;2008case NL80211_BAND_5GHZ:2009case NL80211_BAND_2GHZ:2010/* DSPARAMS has the channel number. */2011elem = cfg80211_find_elem(IEEE80211_ELEMID_DSPARMS, ie, len);2012if (elem != NULL && elem->datalen == 1)2013return (elem->data[0]);2014/* HTINFO has the primary center channel. */2015elem = cfg80211_find_elem(IEEE80211_ELEMID_HTINFO, ie, len);2016if (elem != NULL &&2017elem->datalen >= (sizeof(struct ieee80211_ie_htinfo) - 2)) {2018const struct ieee80211_ie_htinfo *htinfo;2019htinfo = (const struct ieee80211_ie_htinfo *)elem;2020return (htinfo->hi_ctrlchannel);2021}2022/* What else? */2023break;2024default:2025IMPROVE("Unsupported");2026break;2027}2028return (-1);2029}20302031/* Used for scanning at least. */2032static __inline void2033get_random_mask_addr(uint8_t *dst, const uint8_t *addr, const uint8_t *mask)2034{2035int i;20362037/* Get a completely random address and then overlay what we want. */2038get_random_bytes(dst, ETH_ALEN);2039for (i = 0; i < ETH_ALEN; i++)2040dst[i] = (dst[i] & ~(mask[i])) | (addr[i] & mask[i]);2041}20422043static __inline void2044cfg80211_shutdown_all_interfaces(struct wiphy *wiphy)2045{2046TODO();2047}20482049static __inline bool2050cfg80211_reg_can_beacon(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,2051enum nl80211_iftype iftype)2052{2053TODO();2054return (false);2055}20562057static __inline void2058cfg80211_background_radar_event(struct wiphy *wiphy,2059struct cfg80211_chan_def *chandef, gfp_t gfp)2060{2061TODO();2062}20632064static __inline const uint8_t *2065cfg80211_find_ext_ie(uint8_t eid, const uint8_t *p, size_t len)2066{2067TODO();2068return (NULL);2069}20702071static inline void2072_ieee80211_set_sband_iftype_data(struct ieee80211_supported_band *band,2073struct ieee80211_sband_iftype_data *iftype_data, size_t nitems)2074{2075band->iftype_data = iftype_data;2076band->n_iftype_data = nitems;2077}20782079static inline const struct ieee80211_sband_iftype_data *2080ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *band,2081enum nl80211_iftype iftype)2082{2083const struct ieee80211_sband_iftype_data *iftype_data;2084int i;20852086for (i = 0; i < band->n_iftype_data; i++) {2087iftype_data = (const void *)&band->iftype_data[i];2088if (iftype_data->types_mask & BIT(iftype))2089return (iftype_data);2090}20912092return (NULL);2093}20942095static inline const struct ieee80211_sta_he_cap *2096ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *band,2097enum nl80211_iftype iftype)2098{2099const struct ieee80211_sband_iftype_data *iftype_data;2100const struct ieee80211_sta_he_cap *he_cap;21012102iftype_data = ieee80211_get_sband_iftype_data(band, iftype);2103if (iftype_data == NULL)2104return (NULL);21052106he_cap = NULL;2107if (iftype_data->he_cap.has_he)2108he_cap = &iftype_data->he_cap;21092110return (he_cap);2111}21122113static inline const struct ieee80211_sta_eht_cap *2114ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band,2115enum nl80211_iftype iftype)2116{2117const struct ieee80211_sband_iftype_data *iftype_data;2118const struct ieee80211_sta_eht_cap *eht_cap;21192120iftype_data = ieee80211_get_sband_iftype_data(band, iftype);2121if (iftype_data == NULL)2122return (NULL);21232124eht_cap = NULL;2125if (iftype_data->eht_cap.has_eht)2126eht_cap = &iftype_data->eht_cap;21272128return (eht_cap);2129}21302131static inline bool2132cfg80211_ssid_eq(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2)2133{2134int error;21352136if (ssid1 == NULL || ssid2 == NULL) /* Can we KASSERT this? */2137return (false);21382139if (ssid1->ssid_len != ssid2->ssid_len)2140return (false);2141error = memcmp(ssid1->ssid, ssid2->ssid, ssid2->ssid_len);2142if (error != 0)2143return (false);2144return (true);2145}21462147static inline void2148cfg80211_rx_unprot_mlme_mgmt(struct net_device *ndev, const uint8_t *hdr,2149uint32_t len)2150{2151TODO();2152}21532154static inline const struct wiphy_iftype_ext_capab *2155cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype iftype)2156{21572158TODO();2159return (NULL);2160}21612162static inline int2163cfg80211_external_auth_request(struct net_device *ndev,2164struct cfg80211_external_auth_params *params, gfp_t gfp)2165{2166TODO();2167return (-ENXIO);2168}21692170static inline uint16_t2171ieee80211_get_he_6ghz_capa(const struct ieee80211_supported_band *sband,2172enum nl80211_iftype iftype)2173{2174TODO();2175return (0);2176}21772178static __inline ssize_t2179wiphy_locked_debugfs_read(struct wiphy *wiphy, struct file *file,2180char *buf, size_t bufsize, const char __user *userbuf, size_t count,2181loff_t *ppos,2182ssize_t (*handler)(struct wiphy *, struct file *, char *, size_t, void *),2183void *data)2184{2185TODO();2186return (-ENXIO);2187}218821892190static __inline ssize_t2191wiphy_locked_debugfs_write(struct wiphy *wiphy, struct file *file,2192char *buf, size_t bufsize, const char __user *userbuf, size_t count,2193ssize_t (*handler)(struct wiphy *, struct file *, char *, size_t, void *),2194void *data)2195{2196TODO();2197return (-ENXIO);2198}21992200static inline void2201cfg80211_cqm_rssi_notify(struct net_device *dev,2202enum nl80211_cqm_rssi_threshold_event rssi_te, int32_t rssi, gfp_t gfp)2203{2204TODO();2205}22062207/* -------------------------------------------------------------------------- */22082209static inline void2210wiphy_work_init(struct wiphy_work *wwk, wiphy_work_fn fn)2211{2212INIT_LIST_HEAD(&wwk->entry);2213wwk->fn = fn;2214}22152216static inline void2217wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *wwk)2218{2219linuxkpi_wiphy_work_queue(wiphy, wwk);2220}22212222static inline void2223wiphy_work_cancel(struct wiphy *wiphy, struct wiphy_work *wwk)2224{2225linuxkpi_wiphy_work_cancel(wiphy, wwk);2226}22272228static inline void2229wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *wwk)2230{2231linuxkpi_wiphy_work_flush(wiphy, wwk);2232}22332234static inline void2235wiphy_delayed_work_init(struct wiphy_delayed_work *wdwk, wiphy_work_fn fn)2236{2237wiphy_work_init(&wdwk->work, fn);2238timer_setup(&wdwk->timer, lkpi_wiphy_delayed_work_timer, 0);2239}22402241static inline void2242wiphy_delayed_work_queue(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk,2243unsigned long delay)2244{2245linuxkpi_wiphy_delayed_work_queue(wiphy, wdwk, delay);2246}22472248static inline void2249wiphy_delayed_work_cancel(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk)2250{2251linuxkpi_wiphy_delayed_work_cancel(wiphy, wdwk);2252}22532254static inline void2255wiphy_delayed_work_flush(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk)2256{2257linuxkpi_wiphy_delayed_work_flush(wiphy, wdwk);2258}22592260/* -------------------------------------------------------------------------- */22612262#define wiphy_err(_wiphy, _fmt, ...) \2263dev_err((_wiphy)->dev, _fmt, __VA_ARGS__)2264#define wiphy_info(wiphy, fmt, ...) \2265dev_info((wiphy)->dev, fmt, ##__VA_ARGS__)2266#define wiphy_info_once(wiphy, fmt, ...) \2267dev_info_once((wiphy)->dev, fmt, ##__VA_ARGS__)22682269#ifndef LINUXKPI_NET802112270#define ieee80211_channel linuxkpi_ieee80211_channel2271#define ieee80211_regdomain linuxkpi_ieee80211_regdomain2272#endif22732274#include <net/mac80211.h>22752276#endif /* _LINUXKPI_NET_CFG80211_H */227722782279