16b4cac81SBjoern A. Zeeb /*- 2*ac1d519cSBjoern A. Zeeb * Copyright (c) 2020-2024 The FreeBSD Foundation 351b461b3SBjoern A. Zeeb * Copyright (c) 2021-2022 Bjoern A. Zeeb 46b4cac81SBjoern A. Zeeb * 56b4cac81SBjoern A. Zeeb * This software was developed by Björn Zeeb under sponsorship from 66b4cac81SBjoern A. Zeeb * the FreeBSD Foundation. 76b4cac81SBjoern A. Zeeb * 86b4cac81SBjoern A. Zeeb * Redistribution and use in source and binary forms, with or without 96b4cac81SBjoern A. Zeeb * modification, are permitted provided that the following conditions 106b4cac81SBjoern A. Zeeb * are met: 116b4cac81SBjoern A. Zeeb * 1. Redistributions of source code must retain the above copyright 126b4cac81SBjoern A. Zeeb * notice, this list of conditions and the following disclaimer. 136b4cac81SBjoern A. Zeeb * 2. Redistributions in binary form must reproduce the above copyright 146b4cac81SBjoern A. Zeeb * notice, this list of conditions and the following disclaimer in the 156b4cac81SBjoern A. Zeeb * documentation and/or other materials provided with the distribution. 166b4cac81SBjoern A. Zeeb * 176b4cac81SBjoern A. Zeeb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 186b4cac81SBjoern A. Zeeb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 196b4cac81SBjoern A. Zeeb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 206b4cac81SBjoern A. Zeeb * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 216b4cac81SBjoern A. Zeeb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 226b4cac81SBjoern A. Zeeb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 236b4cac81SBjoern A. Zeeb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 246b4cac81SBjoern A. Zeeb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 256b4cac81SBjoern A. Zeeb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 266b4cac81SBjoern A. Zeeb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 276b4cac81SBjoern A. Zeeb * SUCH DAMAGE. 286b4cac81SBjoern A. Zeeb */ 296b4cac81SBjoern A. Zeeb 306b4cac81SBjoern A. Zeeb #ifndef _LINUXKPI_NET_CFG80211_H 316b4cac81SBjoern A. Zeeb #define _LINUXKPI_NET_CFG80211_H 326b4cac81SBjoern A. Zeeb 336b4cac81SBjoern A. Zeeb #include <linux/types.h> 346b4cac81SBjoern A. Zeeb #include <linux/nl80211.h> 356b4cac81SBjoern A. Zeeb #include <linux/ieee80211.h> 366b4cac81SBjoern A. Zeeb #include <linux/if_ether.h> 372e183d99SBjoern A. Zeeb #include <linux/ethtool.h> 386b4cac81SBjoern A. Zeeb #include <linux/device.h> 396b4cac81SBjoern A. Zeeb #include <linux/netdevice.h> 406b4cac81SBjoern A. Zeeb #include <linux/random.h> 416b4cac81SBjoern A. Zeeb #include <linux/skbuff.h> 42*ac1d519cSBjoern A. Zeeb #include <linux/timer.h> 43*ac1d519cSBjoern A. Zeeb #include <linux/workqueue.h> 442e183d99SBjoern A. Zeeb #include <net/regulatory.h> 456b4cac81SBjoern A. Zeeb 466b4cac81SBjoern A. Zeeb /* linux_80211.c */ 479d9ba2b7SBjoern A. Zeeb extern int linuxkpi_debug_80211; 486b4cac81SBjoern A. Zeeb #ifndef D80211_TODO 496b4cac81SBjoern A. Zeeb #define D80211_TODO 0x1 506b4cac81SBjoern A. Zeeb #endif 516b4cac81SBjoern A. Zeeb #ifndef D80211_IMPROVE 526b4cac81SBjoern A. Zeeb #define D80211_IMPROVE 0x2 536b4cac81SBjoern A. Zeeb #endif 54*ac1d519cSBjoern A. Zeeb #define TODO(fmt, ...) if (linuxkpi_debug_80211 & D80211_TODO) \ 55*ac1d519cSBjoern A. Zeeb printf("%s:%d: XXX LKPI80211 TODO " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) 569d9ba2b7SBjoern A. Zeeb #define IMPROVE(...) if (linuxkpi_debug_80211 & D80211_IMPROVE) \ 576b4cac81SBjoern A. Zeeb printf("%s:%d: XXX LKPI80211 IMPROVE\n", __func__, __LINE__) 586b4cac81SBjoern A. Zeeb 59d875aa15SBjoern A. Zeeb enum rfkill_hard_block_reasons { 60d875aa15SBjoern A. Zeeb RFKILL_HARD_BLOCK_NOT_OWNER = BIT(0), 61d875aa15SBjoern A. Zeeb }; 62d875aa15SBjoern A. Zeeb 636b4cac81SBjoern A. Zeeb #define WIPHY_PARAM_FRAG_THRESHOLD __LINE__ /* TODO FIXME brcmfmac */ 646b4cac81SBjoern A. Zeeb #define WIPHY_PARAM_RETRY_LONG __LINE__ /* TODO FIXME brcmfmac */ 656b4cac81SBjoern A. Zeeb #define WIPHY_PARAM_RETRY_SHORT __LINE__ /* TODO FIXME brcmfmac */ 666b4cac81SBjoern A. Zeeb #define WIPHY_PARAM_RTS_THRESHOLD __LINE__ /* TODO FIXME brcmfmac */ 676b4cac81SBjoern A. Zeeb 686b4cac81SBjoern A. Zeeb #define CFG80211_SIGNAL_TYPE_MBM __LINE__ /* TODO FIXME brcmfmac */ 696b4cac81SBjoern A. Zeeb 706b4cac81SBjoern A. Zeeb #define UPDATE_ASSOC_IES 1 716b4cac81SBjoern A. Zeeb 726b4cac81SBjoern A. Zeeb #define IEEE80211_MAX_CHAINS 4 /* net80211: IEEE80211_MAX_CHAINS copied */ 736b4cac81SBjoern A. Zeeb 746b4cac81SBjoern A. Zeeb enum cfg80211_rate_info_flags { 75adff403fSBjoern A. Zeeb RATE_INFO_FLAGS_MCS = BIT(0), 76adff403fSBjoern A. Zeeb RATE_INFO_FLAGS_VHT_MCS = BIT(1), 77adff403fSBjoern A. Zeeb RATE_INFO_FLAGS_SHORT_GI = BIT(2), 78adff403fSBjoern A. Zeeb RATE_INFO_FLAGS_HE_MCS = BIT(4), 79adff403fSBjoern A. Zeeb RATE_INFO_FLAGS_EHT_MCS = BIT(7), 80800aa9cdSBjoern A. Zeeb /* Max 8 bits as used in struct rate_info. */ 816b4cac81SBjoern A. Zeeb }; 826b4cac81SBjoern A. Zeeb 836b4cac81SBjoern A. Zeeb extern const uint8_t rfc1042_header[6]; 84b0f73768SBjoern A. Zeeb extern const uint8_t bridge_tunnel_header[6]; 856b4cac81SBjoern A. Zeeb 862e183d99SBjoern A. Zeeb enum ieee80211_privacy { 872e183d99SBjoern A. Zeeb IEEE80211_PRIVACY_ANY, 882e183d99SBjoern A. Zeeb }; 892e183d99SBjoern A. Zeeb 902e183d99SBjoern A. Zeeb enum ieee80211_bss_type { 912e183d99SBjoern A. Zeeb IEEE80211_BSS_TYPE_ANY, 922e183d99SBjoern A. Zeeb }; 932e183d99SBjoern A. Zeeb 942e183d99SBjoern A. Zeeb enum cfg80211_bss_frame_type { 956b4cac81SBjoern A. Zeeb CFG80211_BSS_FTYPE_UNKNOWN, 962e183d99SBjoern A. Zeeb CFG80211_BSS_FTYPE_BEACON, 972e183d99SBjoern A. Zeeb CFG80211_BSS_FTYPE_PRESP, 986b4cac81SBjoern A. Zeeb }; 996b4cac81SBjoern A. Zeeb 1006b4cac81SBjoern A. Zeeb enum ieee80211_channel_flags { 101d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_DISABLED = BIT(0), 102d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_INDOOR_ONLY = BIT(1), 103d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_IR_CONCURRENT = BIT(2), 104d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_RADAR = BIT(3), 105d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_IR = BIT(4), 106d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_HT40MINUS = BIT(5), 107d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_HT40PLUS = BIT(6), 108d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_80MHZ = BIT(7), 109d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_160MHZ = BIT(8), 1102e183d99SBjoern A. Zeeb IEEE80211_CHAN_NO_OFDM = BIT(9), 111*ac1d519cSBjoern A. Zeeb IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT = BIT(10), 112*ac1d519cSBjoern A. Zeeb IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT = BIT(11), 113*ac1d519cSBjoern A. Zeeb IEEE80211_CHAN_PSD = BIT(12), 114*ac1d519cSBjoern A. Zeeb IEEE80211_CHAN_ALLOW_6GHZ_VLP_AP = BIT(13), 115*ac1d519cSBjoern A. Zeeb IEEE80211_CHAN_CAN_MONITOR = BIT(14), 1166b4cac81SBjoern A. Zeeb }; 1176b4cac81SBjoern A. Zeeb #define IEEE80211_CHAN_NO_HT40 (IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS) 1186b4cac81SBjoern A. Zeeb 1196b4cac81SBjoern A. Zeeb struct ieee80211_txrx_stypes { 1206b4cac81SBjoern A. Zeeb uint16_t tx; 1216b4cac81SBjoern A. Zeeb uint16_t rx; 1226b4cac81SBjoern A. Zeeb }; 1236b4cac81SBjoern A. Zeeb 1246b4cac81SBjoern A. Zeeb /* XXX net80211 has an ieee80211_channel as well. */ 1256b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel { 1266b4cac81SBjoern A. Zeeb /* TODO FIXME */ 1276b4cac81SBjoern A. Zeeb uint32_t hw_value; /* ic_ieee */ 1286b4cac81SBjoern A. Zeeb uint32_t center_freq; /* ic_freq */ 1296b4cac81SBjoern A. Zeeb enum ieee80211_channel_flags flags; /* ic_flags */ 1306b4cac81SBjoern A. Zeeb enum nl80211_band band; 1316b4cac81SBjoern A. Zeeb int8_t max_power; /* ic_maxpower */ 1326b4cac81SBjoern A. Zeeb bool beacon_found; 1336b4cac81SBjoern A. Zeeb int max_antenna_gain, max_reg_power; 1346b4cac81SBjoern A. Zeeb int orig_flags; 1352e183d99SBjoern A. Zeeb int dfs_cac_ms, dfs_state; 136b0f73768SBjoern A. Zeeb int orig_mpwr; 1376b4cac81SBjoern A. Zeeb }; 1386b4cac81SBjoern A. Zeeb 1396b4cac81SBjoern A. Zeeb struct cfg80211_bitrate_mask { 1406b4cac81SBjoern A. Zeeb /* TODO FIXME */ 1416b4cac81SBjoern A. Zeeb struct { 142800aa9cdSBjoern A. Zeeb uint32_t legacy; 1432e183d99SBjoern A. Zeeb uint8_t ht_mcs[IEEE80211_HT_MCS_MASK_LEN]; 144800aa9cdSBjoern A. Zeeb uint16_t vht_mcs[8]; 145800aa9cdSBjoern A. Zeeb uint16_t he_mcs[8]; 1462e183d99SBjoern A. Zeeb enum nl80211_txrate_gi gi; 147b0f73768SBjoern A. Zeeb enum nl80211_he_gi he_gi; 148800aa9cdSBjoern A. Zeeb uint8_t he_ltf; /* XXX enum? */ 1496b4cac81SBjoern A. Zeeb } control[NUM_NL80211_BANDS]; 1506b4cac81SBjoern A. Zeeb }; 1516b4cac81SBjoern A. Zeeb 152b0f73768SBjoern A. Zeeb enum rate_info_bw { 153b0f73768SBjoern A. Zeeb RATE_INFO_BW_20 = 0, 154b0f73768SBjoern A. Zeeb RATE_INFO_BW_5, 155b0f73768SBjoern A. Zeeb RATE_INFO_BW_10, 156b0f73768SBjoern A. Zeeb RATE_INFO_BW_40, 157b0f73768SBjoern A. Zeeb RATE_INFO_BW_80, 158b0f73768SBjoern A. Zeeb RATE_INFO_BW_160, 159b0f73768SBjoern A. Zeeb RATE_INFO_BW_HE_RU, 160adff403fSBjoern A. Zeeb RATE_INFO_BW_320, 161adff403fSBjoern A. Zeeb RATE_INFO_BW_EHT_RU, 162b0f73768SBjoern A. Zeeb }; 163b0f73768SBjoern A. Zeeb 1646b4cac81SBjoern A. Zeeb struct rate_info { 165800aa9cdSBjoern A. Zeeb uint8_t flags; /* enum cfg80211_rate_info_flags */ 166800aa9cdSBjoern A. Zeeb uint8_t bw; 167800aa9cdSBjoern A. Zeeb uint16_t legacy; 168800aa9cdSBjoern A. Zeeb uint8_t mcs; 169800aa9cdSBjoern A. Zeeb uint8_t nss; 170800aa9cdSBjoern A. Zeeb uint8_t he_dcm; 171800aa9cdSBjoern A. Zeeb uint8_t he_gi; 172800aa9cdSBjoern A. Zeeb uint8_t he_ru_alloc; 173adff403fSBjoern A. Zeeb uint8_t eht_gi; 1746b4cac81SBjoern A. Zeeb }; 1756b4cac81SBjoern A. Zeeb 1766b4cac81SBjoern A. Zeeb struct ieee80211_rate { 1776b4cac81SBjoern A. Zeeb /* TODO FIXME */ 1786b4cac81SBjoern A. Zeeb uint32_t bitrate; 1796b4cac81SBjoern A. Zeeb uint32_t hw_value; 1806b4cac81SBjoern A. Zeeb uint32_t hw_value_short; 1816b4cac81SBjoern A. Zeeb uint32_t flags; 1826b4cac81SBjoern A. Zeeb }; 1836b4cac81SBjoern A. Zeeb 1846b4cac81SBjoern A. Zeeb struct ieee80211_sta_ht_cap { 1856b4cac81SBjoern A. Zeeb bool ht_supported; 18605e640dcSBjoern A. Zeeb uint8_t ampdu_density; 18705e640dcSBjoern A. Zeeb uint8_t ampdu_factor; 1886b4cac81SBjoern A. Zeeb uint16_t cap; 189b0f73768SBjoern A. Zeeb struct ieee80211_mcs_info mcs; 1906b4cac81SBjoern A. Zeeb }; 1916b4cac81SBjoern A. Zeeb 1926b4cac81SBjoern A. Zeeb /* XXX net80211 calls these IEEE80211_VHTCAP_* */ 1936b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 */ 1946b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 */ 1956b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 */ 1966b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_MASK 0x00000003 /* IEEE80211_VHTCAP_MAX_MPDU_MASK */ 1976b4cac81SBjoern A. Zeeb 1986b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) 1992e183d99SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) 2002e183d99SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000c /* IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK */ 2016b4cac81SBjoern A. Zeeb 2026b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 /* IEEE80211_VHTCAP_RXLDPC */ 2036b4cac81SBjoern A. Zeeb 2046b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 /* IEEE80211_VHTCAP_SHORT_GI_80 */ 2056b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 /* IEEE80211_VHTCAP_SHORT_GI_160 */ 2066b4cac81SBjoern A. Zeeb 2076b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_TXSTBC 0x00000080 /* IEEE80211_VHTCAP_TXSTBC */ 2086b4cac81SBjoern A. Zeeb 2096b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 /* IEEE80211_VHTCAP_RXSTBC_1 */ 2106b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 /* IEEE80211_VHTCAP_RXSTBC_MASK */ 2116b4cac81SBjoern A. Zeeb 2126b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 /* IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE */ 2136b4cac81SBjoern A. Zeeb 2146b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 /* IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE */ 2156b4cac81SBjoern A. Zeeb 2166b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 /* IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE */ 2176b4cac81SBjoern A. Zeeb 2186b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 /* IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE */ 2196b4cac81SBjoern A. Zeeb 2206b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13 /* IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT */ 2212e183d99SBjoern A. Zeeb #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT) /* IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK */ 2226b4cac81SBjoern A. Zeeb 2236b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 /* IEEE80211_VHTCAP_HTC_VHT */ 2246b4cac81SBjoern A. Zeeb 2256b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 /* IEEE80211_VHTCAP_RX_ANTENNA_PATTERN */ 2266b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 /* IEEE80211_VHTCAP_TX_ANTENNA_PATTERN */ 2276b4cac81SBjoern A. Zeeb 2286b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 /* IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB */ 2296b4cac81SBjoern A. Zeeb 2306b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16 /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT */ 2316b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \ 2326b4cac81SBjoern A. Zeeb (7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT) /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK */ 2336b4cac81SBjoern A. Zeeb 2346b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT */ 2356b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ 2366b4cac81SBjoern A. Zeeb (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */ 2376b4cac81SBjoern A. Zeeb 238adff403fSBjoern A. Zeeb #define IEEE80211_VHT_CAP_EXT_NSS_BW_MASK 0xc0000000 2392e183d99SBjoern A. Zeeb 2406b4cac81SBjoern A. Zeeb struct ieee80211_sta_vht_cap { 2416b4cac81SBjoern A. Zeeb /* TODO FIXME */ 2426b4cac81SBjoern A. Zeeb bool vht_supported; 2436b4cac81SBjoern A. Zeeb uint32_t cap; 244800aa9cdSBjoern A. Zeeb struct ieee80211_vht_mcs_info vht_mcs; 2456b4cac81SBjoern A. Zeeb }; 2466b4cac81SBjoern A. Zeeb 247b0f73768SBjoern A. Zeeb enum ieee80211_vht_opmode { 248b0f73768SBjoern A. Zeeb IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT = 4, 249b0f73768SBjoern A. Zeeb }; 250b0f73768SBjoern A. Zeeb 2516b4cac81SBjoern A. Zeeb struct cfg80211_connect_resp_params { 2526b4cac81SBjoern A. Zeeb /* XXX TODO */ 2536b4cac81SBjoern A. Zeeb uint8_t *bssid; 2546b4cac81SBjoern A. Zeeb const uint8_t *req_ie; 2556b4cac81SBjoern A. Zeeb const uint8_t *resp_ie; 2566b4cac81SBjoern A. Zeeb uint32_t req_ie_len; 2576b4cac81SBjoern A. Zeeb uint32_t resp_ie_len; 2586b4cac81SBjoern A. Zeeb int status; 2596b4cac81SBjoern A. Zeeb }; 2606b4cac81SBjoern A. Zeeb 2616b4cac81SBjoern A. Zeeb struct cfg80211_inform_bss { 2626b4cac81SBjoern A. Zeeb /* XXX TODO */ 2636b4cac81SBjoern A. Zeeb int boottime_ns, scan_width, signal; 2646b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan; 2656b4cac81SBjoern A. Zeeb }; 2666b4cac81SBjoern A. Zeeb 2676b4cac81SBjoern A. Zeeb struct cfg80211_roam_info { 2686b4cac81SBjoern A. Zeeb /* XXX TODO */ 2696b4cac81SBjoern A. Zeeb uint8_t *bssid; 2706b4cac81SBjoern A. Zeeb const uint8_t *req_ie; 2716b4cac81SBjoern A. Zeeb const uint8_t *resp_ie; 2726b4cac81SBjoern A. Zeeb uint32_t req_ie_len; 2736b4cac81SBjoern A. Zeeb uint32_t resp_ie_len; 2746b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel; 2756b4cac81SBjoern A. Zeeb }; 2766b4cac81SBjoern A. Zeeb 2776b4cac81SBjoern A. Zeeb struct cfg80211_bss_ies { 2786b4cac81SBjoern A. Zeeb uint8_t *data; 279a3baca22SBjoern A. Zeeb size_t len; 2806b4cac81SBjoern A. Zeeb }; 2816b4cac81SBjoern A. Zeeb 2826b4cac81SBjoern A. Zeeb struct cfg80211_bss { 2836b4cac81SBjoern A. Zeeb /* XXX TODO */ 2846b4cac81SBjoern A. Zeeb struct cfg80211_bss_ies *ies; 285*ac1d519cSBjoern A. Zeeb struct cfg80211_bss_ies *beacon_ies; 286*ac1d519cSBjoern A. Zeeb 287*ac1d519cSBjoern A. Zeeb int32_t signal; 2886b4cac81SBjoern A. Zeeb }; 2896b4cac81SBjoern A. Zeeb 2906b4cac81SBjoern A. Zeeb struct cfg80211_chan_def { 2916b4cac81SBjoern A. Zeeb /* XXX TODO */ 2926b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan; 2936b4cac81SBjoern A. Zeeb enum nl80211_chan_width width; 2946b4cac81SBjoern A. Zeeb uint32_t center_freq1; 2956b4cac81SBjoern A. Zeeb uint32_t center_freq2; 296*ac1d519cSBjoern A. Zeeb uint16_t punctured; 2976b4cac81SBjoern A. Zeeb }; 2986b4cac81SBjoern A. Zeeb 2996b4cac81SBjoern A. Zeeb struct cfg80211_ftm_responder_stats { 3006b4cac81SBjoern A. Zeeb /* XXX TODO */ 3016b4cac81SBjoern A. Zeeb int 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; 3026b4cac81SBjoern A. Zeeb }; 3036b4cac81SBjoern A. Zeeb 3046b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_capabilities { 3056b4cac81SBjoern A. Zeeb /* XXX TODO */ 3066b4cac81SBjoern A. Zeeb int max_peers, randomize_mac_addr, report_ap_tsf; 3076b4cac81SBjoern A. Zeeb struct { 3086b4cac81SBjoern A. Zeeb int asap, bandwidths, max_bursts_exponent, max_ftms_per_burst, non_asap, non_trigger_based, preambles, request_civicloc, request_lci, supported, trigger_based; 3096b4cac81SBjoern A. Zeeb } ftm; 3106b4cac81SBjoern A. Zeeb }; 3116b4cac81SBjoern A. Zeeb 3126b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_request { 3136b4cac81SBjoern A. Zeeb /* XXX TODO */ 3146b4cac81SBjoern A. Zeeb int asap, burst_period, ftmr_retries, ftms_per_burst, non_trigger_based, num_bursts_exp, request_civicloc, request_lci, trigger_based; 3156b4cac81SBjoern A. Zeeb uint8_t bss_color; 3166b4cac81SBjoern A. Zeeb bool lmr_feedback; 3176b4cac81SBjoern A. Zeeb }; 3186b4cac81SBjoern A. Zeeb 3196b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request_peer { 3206b4cac81SBjoern A. Zeeb /* XXX TODO */ 3216b4cac81SBjoern A. Zeeb struct cfg80211_chan_def chandef; 3226b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_request ftm; 3236b4cac81SBjoern A. Zeeb uint8_t addr[ETH_ALEN]; 3246b4cac81SBjoern A. Zeeb int report_ap_tsf; 3256b4cac81SBjoern A. Zeeb }; 3266b4cac81SBjoern A. Zeeb 3276b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request { 3286b4cac81SBjoern A. Zeeb /* XXX TODO */ 3296b4cac81SBjoern A. Zeeb int cookie, n_peers, timeout; 3306b4cac81SBjoern A. Zeeb uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 3316b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request_peer peers[]; 3326b4cac81SBjoern A. Zeeb }; 3336b4cac81SBjoern A. Zeeb 3346b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_result { 3356b4cac81SBjoern A. Zeeb /* XXX TODO */ 3366b4cac81SBjoern A. Zeeb int burst_index, busy_retry_time, failure_reason; 3376b4cac81SBjoern A. Zeeb int 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; 3386b4cac81SBjoern A. Zeeb uint8_t *lci; 3396b4cac81SBjoern A. Zeeb uint8_t *civicloc; 3406b4cac81SBjoern A. Zeeb int lci_len; 3416b4cac81SBjoern A. Zeeb int civicloc_len; 3426b4cac81SBjoern A. Zeeb }; 3436b4cac81SBjoern A. Zeeb 3446b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_result { 3456b4cac81SBjoern A. Zeeb /* XXX TODO */ 3466b4cac81SBjoern A. Zeeb int ap_tsf, ap_tsf_valid, final, host_time, status, type; 3476b4cac81SBjoern A. Zeeb uint8_t addr[ETH_ALEN]; 3486b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_result ftm; 3496b4cac81SBjoern A. Zeeb }; 3506b4cac81SBjoern A. Zeeb 35151b461b3SBjoern A. Zeeb struct cfg80211_sar_freq_ranges { 35251b461b3SBjoern A. Zeeb uint32_t start_freq; 35351b461b3SBjoern A. Zeeb uint32_t end_freq; 35451b461b3SBjoern A. Zeeb }; 35551b461b3SBjoern A. Zeeb 35651b461b3SBjoern A. Zeeb struct cfg80211_sar_sub_specs { 35751b461b3SBjoern A. Zeeb uint32_t freq_range_index; 35851b461b3SBjoern A. Zeeb int power; 35951b461b3SBjoern A. Zeeb }; 36051b461b3SBjoern A. Zeeb 36151b461b3SBjoern A. Zeeb struct cfg80211_sar_specs { 36251b461b3SBjoern A. Zeeb enum nl80211_sar_type type; 36351b461b3SBjoern A. Zeeb uint32_t num_sub_specs; 36451b461b3SBjoern A. Zeeb struct cfg80211_sar_sub_specs sub_specs[]; 36551b461b3SBjoern A. Zeeb }; 36651b461b3SBjoern A. Zeeb 36751b461b3SBjoern A. Zeeb struct cfg80211_sar_capa { 36851b461b3SBjoern A. Zeeb enum nl80211_sar_type type; 36951b461b3SBjoern A. Zeeb uint32_t num_freq_ranges; 37051b461b3SBjoern A. Zeeb const struct cfg80211_sar_freq_ranges *freq_ranges; 37151b461b3SBjoern A. Zeeb }; 37251b461b3SBjoern A. Zeeb 3736b4cac81SBjoern A. Zeeb struct cfg80211_ssid { 3746b4cac81SBjoern A. Zeeb int ssid_len; 3756b4cac81SBjoern A. Zeeb uint8_t ssid[IEEE80211_MAX_SSID_LEN]; 3766b4cac81SBjoern A. Zeeb }; 3776b4cac81SBjoern A. Zeeb 3786b4cac81SBjoern A. Zeeb struct cfg80211_scan_6ghz_params { 3796b4cac81SBjoern A. Zeeb /* XXX TODO */ 3806b4cac81SBjoern A. Zeeb uint8_t *bssid; 381adff403fSBjoern A. Zeeb int channel_idx, psc_no_listen, short_ssid, short_ssid_valid, unsolicited_probe, psd_20; 3826b4cac81SBjoern A. Zeeb }; 3836b4cac81SBjoern A. Zeeb 3846b4cac81SBjoern A. Zeeb struct cfg80211_match_set { 3856b4cac81SBjoern A. Zeeb uint8_t bssid[ETH_ALEN]; 3866b4cac81SBjoern A. Zeeb struct cfg80211_ssid ssid; 3876b4cac81SBjoern A. Zeeb int rssi_thold; 3886b4cac81SBjoern A. Zeeb }; 3896b4cac81SBjoern A. Zeeb 3906b4cac81SBjoern A. Zeeb struct cfg80211_scan_request { 3916b4cac81SBjoern A. Zeeb /* XXX TODO */ 3926b4cac81SBjoern A. Zeeb bool no_cck; 3936b4cac81SBjoern A. Zeeb bool scan_6ghz; 394*ac1d519cSBjoern A. Zeeb bool duration_mandatory; 395*ac1d519cSBjoern A. Zeeb int8_t tsf_report_link_id; 396*ac1d519cSBjoern A. Zeeb uint16_t duration; 397*ac1d519cSBjoern A. Zeeb uint32_t flags; 3986b4cac81SBjoern A. Zeeb struct wireless_dev *wdev; 3996b4cac81SBjoern A. Zeeb struct wiphy *wiphy; 400*ac1d519cSBjoern A. Zeeb uint64_t scan_start; 401*ac1d519cSBjoern A. Zeeb uint32_t rates[NUM_NL80211_BANDS]; 4026b4cac81SBjoern A. Zeeb int ie_len; 4036b4cac81SBjoern A. Zeeb uint8_t *ie; 4046b4cac81SBjoern A. Zeeb uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 405b0f73768SBjoern A. Zeeb uint8_t bssid[ETH_ALEN]; 4066b4cac81SBjoern A. Zeeb int n_ssids; 4076b4cac81SBjoern A. Zeeb int n_6ghz_params; 4086b4cac81SBjoern A. Zeeb int n_channels; 4096b4cac81SBjoern A. Zeeb struct cfg80211_ssid *ssids; 4106b4cac81SBjoern A. Zeeb struct cfg80211_scan_6ghz_params *scan_6ghz_params; 4116b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channels[0]; 4126b4cac81SBjoern A. Zeeb }; 4136b4cac81SBjoern A. Zeeb 4146b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_plan { 4156b4cac81SBjoern A. Zeeb /* XXX TODO */ 4166b4cac81SBjoern A. Zeeb int interval, iterations; 4176b4cac81SBjoern A. Zeeb }; 4186b4cac81SBjoern A. Zeeb 4196b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_request { 4206b4cac81SBjoern A. Zeeb /* XXX TODO */ 4216b4cac81SBjoern A. Zeeb int delay, flags; 4226b4cac81SBjoern A. Zeeb uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 4236b4cac81SBjoern A. Zeeb uint64_t reqid; 4246b4cac81SBjoern A. Zeeb int n_match_sets; 4256b4cac81SBjoern A. Zeeb int n_scan_plans; 4266b4cac81SBjoern A. Zeeb int n_ssids; 4276b4cac81SBjoern A. Zeeb int n_channels; 428b0f73768SBjoern A. Zeeb int ie_len; 429b0f73768SBjoern A. Zeeb uint8_t *ie; 4306b4cac81SBjoern A. Zeeb struct cfg80211_match_set *match_sets; 4316b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_plan *scan_plans; 4326b4cac81SBjoern A. Zeeb struct cfg80211_ssid *ssids; 4336b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channels[0]; 4346b4cac81SBjoern A. Zeeb }; 4356b4cac81SBjoern A. Zeeb 4366b4cac81SBjoern A. Zeeb struct cfg80211_scan_info { 4376b4cac81SBjoern A. Zeeb uint64_t scan_start_tsf; 4386b4cac81SBjoern A. Zeeb uint8_t tsf_bssid[ETH_ALEN]; 4396b4cac81SBjoern A. Zeeb bool aborted; 4406b4cac81SBjoern A. Zeeb }; 4416b4cac81SBjoern A. Zeeb 4426b4cac81SBjoern A. Zeeb struct cfg80211_beacon_data { 4436b4cac81SBjoern A. Zeeb /* XXX TODO */ 4446b4cac81SBjoern A. Zeeb const uint8_t *head; 4456b4cac81SBjoern A. Zeeb const uint8_t *tail; 4466b4cac81SBjoern A. Zeeb uint32_t head_len; 4476b4cac81SBjoern A. Zeeb uint32_t tail_len; 4486b4cac81SBjoern A. Zeeb const uint8_t *proberesp_ies; 4496b4cac81SBjoern A. Zeeb const uint8_t *assocresp_ies; 4506b4cac81SBjoern A. Zeeb uint32_t proberesp_ies_len; 4516b4cac81SBjoern A. Zeeb uint32_t assocresp_ies_len; 4526b4cac81SBjoern A. Zeeb }; 4536b4cac81SBjoern A. Zeeb 4546b4cac81SBjoern A. Zeeb struct cfg80211_ap_settings { 4556b4cac81SBjoern A. Zeeb /* XXX TODO */ 4566b4cac81SBjoern A. Zeeb int auth_type, beacon_interval, dtim_period, hidden_ssid, inactivity_timeout; 4576b4cac81SBjoern A. Zeeb const uint8_t *ssid; 4586b4cac81SBjoern A. Zeeb size_t ssid_len; 4596b4cac81SBjoern A. Zeeb struct cfg80211_beacon_data beacon; 4606b4cac81SBjoern A. Zeeb struct cfg80211_chan_def chandef; 4616b4cac81SBjoern A. Zeeb }; 4626b4cac81SBjoern A. Zeeb 4636b4cac81SBjoern A. Zeeb struct cfg80211_bss_selection { 4646b4cac81SBjoern A. Zeeb /* XXX TODO */ 4656b4cac81SBjoern A. Zeeb enum nl80211_bss_select_attr behaviour; 4666b4cac81SBjoern A. Zeeb union { 4676b4cac81SBjoern A. Zeeb enum nl80211_band band_pref; 4686b4cac81SBjoern A. Zeeb struct { 4696b4cac81SBjoern A. Zeeb enum nl80211_band band; 4706b4cac81SBjoern A. Zeeb uint8_t delta; 4716b4cac81SBjoern A. Zeeb } adjust; 4726b4cac81SBjoern A. Zeeb } param; 4736b4cac81SBjoern A. Zeeb }; 4746b4cac81SBjoern A. Zeeb 4756b4cac81SBjoern A. Zeeb struct cfg80211_crypto { /* XXX made up name */ 4766b4cac81SBjoern A. Zeeb /* XXX TODO */ 4776b4cac81SBjoern A. Zeeb enum nl80211_wpa_versions wpa_versions; 4786b4cac81SBjoern A. Zeeb uint32_t cipher_group; /* WLAN_CIPHER_SUITE_* */ 4796b4cac81SBjoern A. Zeeb uint32_t *akm_suites; 4806b4cac81SBjoern A. Zeeb uint32_t *ciphers_pairwise; 4816b4cac81SBjoern A. Zeeb const uint8_t *sae_pwd; 4826b4cac81SBjoern A. Zeeb const uint8_t *psk; 4836b4cac81SBjoern A. Zeeb int n_akm_suites; 4846b4cac81SBjoern A. Zeeb int n_ciphers_pairwise; 4856b4cac81SBjoern A. Zeeb int sae_pwd_len; 4866b4cac81SBjoern A. Zeeb }; 4876b4cac81SBjoern A. Zeeb 4886b4cac81SBjoern A. Zeeb struct cfg80211_connect_params { 4896b4cac81SBjoern A. Zeeb /* XXX TODO */ 4906b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel; 4916b4cac81SBjoern A. Zeeb uint8_t *bssid; 4926b4cac81SBjoern A. Zeeb const uint8_t *ie; 4936b4cac81SBjoern A. Zeeb const uint8_t *ssid; 4946b4cac81SBjoern A. Zeeb uint32_t ie_len; 4956b4cac81SBjoern A. Zeeb uint32_t ssid_len; 4966b4cac81SBjoern A. Zeeb const void *key; 4976b4cac81SBjoern A. Zeeb uint32_t key_len; 4986b4cac81SBjoern A. Zeeb int auth_type, key_idx, privacy, want_1x; 4996b4cac81SBjoern A. Zeeb struct cfg80211_bss_selection bss_select; 5006b4cac81SBjoern A. Zeeb struct cfg80211_crypto crypto; 5016b4cac81SBjoern A. Zeeb }; 5026b4cac81SBjoern A. Zeeb 5036b4cac81SBjoern A. Zeeb enum bss_param_flags { /* Used as bitflags. XXX FIXME values? */ 5046b4cac81SBjoern A. Zeeb BSS_PARAM_FLAGS_CTS_PROT = 0x01, 5056b4cac81SBjoern A. Zeeb BSS_PARAM_FLAGS_SHORT_PREAMBLE = 0x02, 5066b4cac81SBjoern A. Zeeb BSS_PARAM_FLAGS_SHORT_SLOT_TIME = 0x04, 5076b4cac81SBjoern A. Zeeb }; 5086b4cac81SBjoern A. Zeeb 5096b4cac81SBjoern A. Zeeb struct cfg80211_ibss_params { 5106b4cac81SBjoern A. Zeeb /* XXX TODO */ 5116b4cac81SBjoern A. Zeeb int basic_rates, beacon_interval; 5126b4cac81SBjoern A. Zeeb int channel_fixed, ie, ie_len, privacy; 5136b4cac81SBjoern A. Zeeb int dtim_period; 5146b4cac81SBjoern A. Zeeb uint8_t *ssid; 5156b4cac81SBjoern A. Zeeb uint8_t *bssid; 5166b4cac81SBjoern A. Zeeb int ssid_len; 5176b4cac81SBjoern A. Zeeb struct cfg80211_chan_def chandef; 5186b4cac81SBjoern A. Zeeb enum bss_param_flags flags; 5196b4cac81SBjoern A. Zeeb }; 5206b4cac81SBjoern A. Zeeb 5216b4cac81SBjoern A. Zeeb struct cfg80211_mgmt_tx_params { 5226b4cac81SBjoern A. Zeeb /* XXX TODO */ 5236b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan; 5246b4cac81SBjoern A. Zeeb const uint8_t *buf; 5256b4cac81SBjoern A. Zeeb size_t len; 5266b4cac81SBjoern A. Zeeb int wait; 5276b4cac81SBjoern A. Zeeb }; 5286b4cac81SBjoern A. Zeeb 5296b4cac81SBjoern A. Zeeb struct cfg80211_pmk_conf { 5306b4cac81SBjoern A. Zeeb /* XXX TODO */ 5316b4cac81SBjoern A. Zeeb const uint8_t *pmk; 5326b4cac81SBjoern A. Zeeb uint8_t pmk_len; 5336b4cac81SBjoern A. Zeeb }; 5346b4cac81SBjoern A. Zeeb 5356b4cac81SBjoern A. Zeeb struct cfg80211_pmksa { 5366b4cac81SBjoern A. Zeeb /* XXX TODO */ 5376b4cac81SBjoern A. Zeeb const uint8_t *bssid; 5386b4cac81SBjoern A. Zeeb const uint8_t *pmkid; 5396b4cac81SBjoern A. Zeeb }; 5406b4cac81SBjoern A. Zeeb 5416b4cac81SBjoern A. Zeeb struct station_del_parameters { 5426b4cac81SBjoern A. Zeeb /* XXX TODO */ 5436b4cac81SBjoern A. Zeeb const uint8_t *mac; 5446b4cac81SBjoern A. Zeeb uint32_t reason_code; /* elsewhere uint16_t? */ 5456b4cac81SBjoern A. Zeeb }; 5466b4cac81SBjoern A. Zeeb 5476b4cac81SBjoern A. Zeeb struct station_info { 5486b4cac81SBjoern A. Zeeb /* TODO FIXME */ 5496b4cac81SBjoern A. Zeeb int assoc_req_ies_len, connected_time; 5506b4cac81SBjoern A. Zeeb int generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets; 5516b4cac81SBjoern A. Zeeb int filled, rx_beacon, rx_beacon_signal_avg, signal_avg; 5521d70218eSBjoern A. Zeeb int rx_duration, tx_duration, tx_failed, tx_retries; 553adff403fSBjoern A. Zeeb int ack_signal, avg_ack_signal; 5546b4cac81SBjoern A. Zeeb 5556b4cac81SBjoern A. Zeeb int chains; 5566b4cac81SBjoern A. Zeeb uint8_t chain_signal[IEEE80211_MAX_CHAINS]; 5576b4cac81SBjoern A. Zeeb uint8_t chain_signal_avg[IEEE80211_MAX_CHAINS]; 5586b4cac81SBjoern A. Zeeb 5596b4cac81SBjoern A. Zeeb uint8_t *assoc_req_ies; 5606b4cac81SBjoern A. Zeeb struct rate_info rxrate; 5616b4cac81SBjoern A. Zeeb struct rate_info txrate; 5626b4cac81SBjoern A. Zeeb struct cfg80211_ibss_params bss_param; 5636b4cac81SBjoern A. Zeeb struct nl80211_sta_flag_update sta_flags; 5646b4cac81SBjoern A. Zeeb }; 5656b4cac81SBjoern A. Zeeb 5666b4cac81SBjoern A. Zeeb struct station_parameters { 5676b4cac81SBjoern A. Zeeb /* XXX TODO */ 5686b4cac81SBjoern A. Zeeb int sta_flags_mask, sta_flags_set; 5696b4cac81SBjoern A. Zeeb }; 5706b4cac81SBjoern A. Zeeb 5716b4cac81SBjoern A. Zeeb struct key_params { 5726b4cac81SBjoern A. Zeeb /* XXX TODO */ 5736b4cac81SBjoern A. Zeeb const uint8_t *key; 5746b4cac81SBjoern A. Zeeb const uint8_t *seq; 5756b4cac81SBjoern A. Zeeb int key_len; 5766b4cac81SBjoern A. Zeeb int seq_len; 5776b4cac81SBjoern A. Zeeb uint32_t cipher; /* WLAN_CIPHER_SUITE_* */ 5786b4cac81SBjoern A. Zeeb }; 5796b4cac81SBjoern A. Zeeb 5806b4cac81SBjoern A. Zeeb struct mgmt_frame_regs { 5816b4cac81SBjoern A. Zeeb /* XXX TODO */ 5826b4cac81SBjoern A. Zeeb int interface_stypes; 5836b4cac81SBjoern A. Zeeb }; 5846b4cac81SBjoern A. Zeeb 5856b4cac81SBjoern A. Zeeb struct vif_params { 5866b4cac81SBjoern A. Zeeb /* XXX TODO */ 5876b4cac81SBjoern A. Zeeb uint8_t macaddr[ETH_ALEN]; 5886b4cac81SBjoern A. Zeeb }; 5896b4cac81SBjoern A. Zeeb 5906b4cac81SBjoern A. Zeeb /* That the world needs so many different structs for this is amazing. */ 5916b4cac81SBjoern A. Zeeb struct mac_address { 5926b4cac81SBjoern A. Zeeb uint8_t addr[ETH_ALEN]; 5936b4cac81SBjoern A. Zeeb }; 5946b4cac81SBjoern A. Zeeb 5956b4cac81SBjoern A. Zeeb struct ieee80211_reg_rule { 5966b4cac81SBjoern A. Zeeb /* TODO FIXME */ 5976b4cac81SBjoern A. Zeeb uint32_t flags; 598f02e2115SBjoern A. Zeeb int dfs_cac_ms; 5996b4cac81SBjoern A. Zeeb struct freq_range { 6006b4cac81SBjoern A. Zeeb int start_freq_khz; 6016b4cac81SBjoern A. Zeeb int end_freq_khz; 6026b4cac81SBjoern A. Zeeb int max_bandwidth_khz; 6036b4cac81SBjoern A. Zeeb } freq_range; 6046b4cac81SBjoern A. Zeeb struct power_rule { 6056b4cac81SBjoern A. Zeeb int max_antenna_gain; 6066b4cac81SBjoern A. Zeeb int max_eirp; 6076b4cac81SBjoern A. Zeeb } power_rule; 6086b4cac81SBjoern A. Zeeb }; 6096b4cac81SBjoern A. Zeeb 6106b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain { 6116b4cac81SBjoern A. Zeeb /* TODO FIXME */ 6126b4cac81SBjoern A. Zeeb uint8_t alpha2[2]; 6132e183d99SBjoern A. Zeeb int dfs_region; 6146b4cac81SBjoern A. Zeeb int n_reg_rules; 6156b4cac81SBjoern A. Zeeb struct ieee80211_reg_rule reg_rules[]; 6166b4cac81SBjoern A. Zeeb }; 6176b4cac81SBjoern A. Zeeb 6186b4cac81SBjoern A. Zeeb /* XXX-BZ this are insensible values probably ... */ 6196b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP0_HTC_HE 0x1 6206b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP0_TWT_REQ 0x2 621b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP0_TWT_RES 0x4 6226b4cac81SBjoern A. Zeeb 6236b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION 0x1 6246b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 0x2 6256b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US 0x4 626b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK 0x8 6276b4cac81SBjoern A. Zeeb 6286b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP 0x1 6296b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_ACK_EN 0x2 6306b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_BSR 0x4 6316b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION 0x8 6326b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_BCAST_TWT 0x10 63351b461b3SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_ALL_ACK 0x20 634b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_MU_CASCADING 0x40 635b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_TRS 0x80 6366b4cac81SBjoern A. Zeeb 63751117ed1SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_OMI_CONTROL 0x02 63851117ed1SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_OFDMA_RA 0x04 63951117ed1SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1 0x08 64051117ed1SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2 0x10 64151117ed1SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3 0x18 64251117ed1SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK 0x18 64351117ed1SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED 0x40 6446b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80 6456b4cac81SBjoern A. Zeeb 6466b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU 0x1 6476b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_BQR 0x2 6486b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39 0x4 6496b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU 0x8 65051b461b3SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_OPS 0x10 651b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG 0x20 6526b4cac81SBjoern A. Zeeb 6536b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS 0x1 6546b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX 0x2 6556b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 0x4 6566b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 0x8 6576b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU 0x10 658b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX 0x20 659b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_PUNCTURED_SOUNDING 0x40 660b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_SUBCHAN_SELECTIVE_TRANSMISSION 0x80 6616b4cac81SBjoern A. Zeeb 6626b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_NOT_SUPPORTED 0x0 6636b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_SUPPORT_0_7 0x1 6646b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_SUPPORT_0_9 0x2 6656b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_SUPPORT_0_11 0x4 6666b4cac81SBjoern A. Zeeb 6676b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS 0x01 6686b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS 0x02 6696b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START 0x04 6706b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN 0x08 6716b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP 0x10 672b0f73768SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_SM_PS 0x20 6736b4cac81SBjoern A. Zeeb 6746b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G 0x1 6756b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G 0x2 6766b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G 0x4 67751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G 0x8 678b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G 0x10 679b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G 0x20 680b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK 0x40 681adff403fSBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK_ALL 0xff 6826b4cac81SBjoern A. Zeeb 6836b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A 0x1 6846b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD 0x2 6856b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS 0x4 6866b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK 0x8 68751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US 0x10 6886b4cac81SBjoern A. Zeeb 6896b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS 0x1 6906b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US 0x2 6916b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ 0x4 6926b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ 0x8 69351b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_DOPPLER_TX 0x10 694b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO 0x20 695b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO 0x40 6966b4cac81SBjoern A. Zeeb 6976b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK 0x1 6986b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM 0x2 6996b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM 0x4 7006b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 0x8 7016b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 0x10 70251b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER 0x20 70351b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM 0x40 70451b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM 0x80 705d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2 0x10 706d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU 0x20 707d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK 0x40 708d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK 0x80 709d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK 0x80 710b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK 0x80 711b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK 0x80 712b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_2 0x80 7136b4cac81SBjoern A. Zeeb 7146b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8 0x1 7156b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 0x2 7166b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE 0x4 71751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER 0x8 71851b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 0x10 719b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 0x20 720b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK 0x40 721b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK 0x80 7226b4cac81SBjoern A. Zeeb 7236b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 0x1 7246b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 0x2 72551b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK 0x4 72651b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK 0x8 72751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK 0x10 728b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK 0x20 7296b4cac81SBjoern A. Zeeb 7306b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT 0x1 7316b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB 0x2 7326b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB 0x4 73351b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB 0x8 7346b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB 0x20 73551b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU 0x40 73651b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU 0x80 73751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE 0x80 738b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB 0x80 739b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO 0x80 7406b4cac81SBjoern A. Zeeb 7416b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI 0x1 7426b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_MAX_NC_1 0x2 7436b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_MAX_NC_2 0x4 7446b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK 0x6 7456b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR 0x8 7466b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP 0x10 7476b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ 0x20 748b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ 0x40 749b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_PSR_BASED_SR 0x80 7506b4cac81SBjoern A. Zeeb 7516b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU 0x1 7526b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G 0x2 7536b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU 0x4 754b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242 0x8 755b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_484 0x10 756b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_996 0x18 757b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996 0x20 758b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_MASK 0x28 759b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI 0x40 76051b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI 0x80 7616b4cac81SBjoern A. Zeeb 762e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US 0x1 763e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US 0x2 764e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US 0x4 765e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK 0x8 766e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 0x10 767d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS 0x0 7686b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK 0x20 769d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB 0x4 770d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB 0x8 771d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU 0x10 772d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU 0x20 773d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_LONGER_THAN_16_SIGB_OFDM_SYM 0x40 7746b4cac81SBjoern A. Zeeb 7756b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF 0x1 7766b4cac81SBjoern A. Zeeb 7771d70218eSBjoern A. Zeeb #define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED 0x1 7781d70218eSBjoern A. Zeeb #define IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET 0x2 779adff403fSBjoern A. Zeeb #define IEEE80211_HE_OPERATION_ER_SU_DISABLE 0x4 7801d70218eSBjoern A. Zeeb 7811d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED 0x01 7821d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED 0x02 7831d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT 0x04 7841d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT 0x08 7851d70218eSBjoern A. Zeeb 786adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS 0x01 787adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454 0x02 788adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK 0x03 789adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_OM_CONTROL 0x04 790adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 0x05 791adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2 0x06 792adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991 0x07 793*ac1d519cSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC 0x08 794adff403fSBjoern A. Zeeb 795adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MAC_CAP1_MAX_AMPDU_LEN_MASK 0x01 796adff403fSBjoern A. Zeeb 797adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MCS_NSS_RX 0x01 798adff403fSBjoern A. Zeeb #define IEEE80211_EHT_MCS_NSS_TX 0x02 799adff403fSBjoern A. Zeeb 800adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ 0x01 801adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ 0x02 802adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK 0x03 803adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI 0x04 804adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP0_PARTIAL_BW_UL_MU_MIMO 0x05 805adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE 0x06 806adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER 0x07 807adff403fSBjoern A. Zeeb 808adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_160MHZ_MASK 0x01 809adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_320MHZ_MASK 0x02 810adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP1_BEAMFORMEE_SS_80MHZ_MASK 0x03 811adff403fSBjoern A. Zeeb 812adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_80MHZ_MASK 0x01 813adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_160MHZ_MASK 0x02 814adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_320MHZ_MASK 0x03 815adff403fSBjoern A. Zeeb 816adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_CODEBOOK_4_2_SU_FDBK 0x01 817adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_CODEBOOK_7_5_MU_FDBK 0x02 818adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_NG_16_MU_FEEDBACK 0x03 819adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_NG_16_SU_FEEDBACK 0x04 820adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_TRIG_CQI_FDBK 0x05 821adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_TRIG_MU_BF_PART_BW_FDBK 0x06 822adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_TRIG_SU_BF_FDBK 0x07 823adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP3_SOUNDING_DIM_320MHZ_MASK 0x08 824adff403fSBjoern A. Zeeb 825adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP4_EHT_MU_PPDU_4_EHT_LTF_08_GI 0x01 826adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP4_PART_BW_DL_MU_MIMO 0x02 827adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP4_POWER_BOOST_FACT_SUPP 0x03 828adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP4_MAX_NC_MASK 0x04 829adff403fSBjoern A. Zeeb 830adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_0US 0x01 831adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_16US 0x02 832adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_20US 0x03 833adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_8US 0x04 834adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_COMMON_NOMINAL_PKT_PAD_MASK 0x05 835adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_NON_TRIG_CQI_FEEDBACK 0x06 836adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_PPE_THRESHOLD_PRESENT 0x07 837adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_RX_LESS_242_TONE_RU_SUPP 0x08 838adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_TX_LESS_242_TONE_RU_SUPP 0x09 839adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_MAX_NUM_SUPP_EHT_LTF_MASK 0x0a 840adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP5_SUPP_EXTRA_EHT_LTF 0x0b 841adff403fSBjoern A. Zeeb 842adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP6_EHT_DUP_6GHZ_SUPP 0x01 843adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP6_MCS15_SUPP_MASK 0x02 844adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP6_MAX_NUM_SUPP_EHT_LTF_MASK 0x03 845adff403fSBjoern A. Zeeb 846adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_80MHZ 0x01 847adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_160MHZ 0x02 848adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP7_MU_BEAMFORMER_320MHZ 0x03 849adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_80MHZ 0x04 850adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_160MHZ 0x05 851adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP7_NON_OFDMA_UL_MU_MIMO_320MHZ 0x06 852adff403fSBjoern A. Zeeb 853adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP8_RX_1024QAM_WIDER_BW_DL_OFDMA 0x01 854adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PHY_CAP8_RX_4096QAM_WIDER_BW_DL_OFDMA 0x02 855adff403fSBjoern A. Zeeb 856adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PPE_THRES_INFO_HEADER_SIZE 0x01 857adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PPE_THRES_NSS_MASK 0x02 858adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PPE_THRES_RU_INDEX_BITMASK_MASK 0x03 859adff403fSBjoern A. Zeeb #define IEEE80211_EHT_PPE_THRES_INFO_PPET_SIZE 0x04 860adff403fSBjoern A. Zeeb 861adff403fSBjoern A. Zeeb #define IEEE80211_EML_CAP_EMLSR_SUPP 0x01 862adff403fSBjoern A. Zeeb #define IEEE80211_EML_CAP_TRANSITION_TIMEOUT 0x02 863adff403fSBjoern A. Zeeb #define IEEE80211_EML_CAP_TRANSITION_TIMEOUT_128TU 0x04 864adff403fSBjoern A. Zeeb #define IEEE80211_EML_CAP_EMLSR_PADDING_DELAY 0x08 865adff403fSBjoern A. Zeeb #define IEEE80211_EML_CAP_EMLSR_PADDING_DELAY_32US 0x10 866adff403fSBjoern A. Zeeb #define IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY 0x20 867adff403fSBjoern A. Zeeb #define IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY_64US 0x40 868adff403fSBjoern A. Zeeb 8696b4cac81SBjoern A. Zeeb #define VENDOR_CMD_RAW_DATA (void *)(uintptr_t)(-ENOENT) 8706b4cac81SBjoern A. Zeeb 8716b4cac81SBjoern A. Zeeb struct ieee80211_he_cap_elem { 8726b4cac81SBjoern A. Zeeb u8 mac_cap_info[6]; 8736b4cac81SBjoern A. Zeeb u8 phy_cap_info[11]; 8746b4cac81SBjoern A. Zeeb } __packed; 8756b4cac81SBjoern A. Zeeb 8766b4cac81SBjoern A. Zeeb struct ieee80211_he_mcs_nss_supp { 8776b4cac81SBjoern A. Zeeb /* TODO FIXME */ 8786b4cac81SBjoern A. Zeeb uint32_t rx_mcs_80; 8796b4cac81SBjoern A. Zeeb uint32_t tx_mcs_80; 8806b4cac81SBjoern A. Zeeb uint32_t rx_mcs_160; 8816b4cac81SBjoern A. Zeeb uint32_t tx_mcs_160; 8826b4cac81SBjoern A. Zeeb uint32_t rx_mcs_80p80; 8836b4cac81SBjoern A. Zeeb uint32_t tx_mcs_80p80; 8846b4cac81SBjoern A. Zeeb }; 8856b4cac81SBjoern A. Zeeb 8866b4cac81SBjoern A. Zeeb #define IEEE80211_STA_HE_CAP_PPE_THRES_MAX 32 8876b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_cap { 8886b4cac81SBjoern A. Zeeb /* TODO FIXME */ 8896b4cac81SBjoern A. Zeeb int has_he; 8906b4cac81SBjoern A. Zeeb struct ieee80211_he_cap_elem he_cap_elem; 8916b4cac81SBjoern A. Zeeb struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp; 8926b4cac81SBjoern A. Zeeb uint8_t ppe_thres[IEEE80211_STA_HE_CAP_PPE_THRES_MAX]; 8936b4cac81SBjoern A. Zeeb }; 8946b4cac81SBjoern A. Zeeb 895b0f73768SBjoern A. Zeeb struct cfg80211_he_bss_color { 896b0f73768SBjoern A. Zeeb int color, enabled; 897b0f73768SBjoern A. Zeeb }; 898b0f73768SBjoern A. Zeeb 899b0f73768SBjoern A. Zeeb struct ieee80211_he_obss_pd { 900b0f73768SBjoern A. Zeeb bool enable; 901f02e2115SBjoern A. Zeeb uint8_t min_offset; 902f02e2115SBjoern A. Zeeb uint8_t max_offset; 903f02e2115SBjoern A. Zeeb uint8_t non_srg_max_offset; 904f02e2115SBjoern A. Zeeb uint8_t sr_ctrl; 9051d70218eSBjoern A. Zeeb uint8_t bss_color_bitmap[8]; 9061d70218eSBjoern A. Zeeb uint8_t partial_bssid_bitmap[8]; 907b0f73768SBjoern A. Zeeb }; 908b0f73768SBjoern A. Zeeb 9096b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_6ghz_capa { 9106b4cac81SBjoern A. Zeeb /* TODO FIXME */ 9116b4cac81SBjoern A. Zeeb int capa; 9126b4cac81SBjoern A. Zeeb }; 9136b4cac81SBjoern A. Zeeb 914adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp_20mhz_only { 915*ac1d519cSBjoern A. Zeeb union { 916*ac1d519cSBjoern A. Zeeb struct { 917adff403fSBjoern A. Zeeb uint8_t rx_tx_mcs7_max_nss; 918adff403fSBjoern A. Zeeb uint8_t rx_tx_mcs9_max_nss; 919adff403fSBjoern A. Zeeb uint8_t rx_tx_mcs11_max_nss; 920adff403fSBjoern A. Zeeb uint8_t rx_tx_mcs13_max_nss; 921adff403fSBjoern A. Zeeb }; 922*ac1d519cSBjoern A. Zeeb uint8_t rx_tx_max_nss[4]; 923*ac1d519cSBjoern A. Zeeb }; 924*ac1d519cSBjoern A. Zeeb }; 925adff403fSBjoern A. Zeeb 926adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp_bw { 927*ac1d519cSBjoern A. Zeeb union { 928*ac1d519cSBjoern A. Zeeb struct { 929adff403fSBjoern A. Zeeb uint8_t rx_tx_mcs9_max_nss; 930adff403fSBjoern A. Zeeb uint8_t rx_tx_mcs11_max_nss; 931adff403fSBjoern A. Zeeb uint8_t rx_tx_mcs13_max_nss; 932adff403fSBjoern A. Zeeb }; 933*ac1d519cSBjoern A. Zeeb uint8_t rx_tx_max_nss[3]; 934*ac1d519cSBjoern A. Zeeb }; 935*ac1d519cSBjoern A. Zeeb }; 936adff403fSBjoern A. Zeeb 937adff403fSBjoern A. Zeeb struct ieee80211_eht_cap_elem_fixed { 938adff403fSBjoern A. Zeeb uint8_t mac_cap_info[2]; 939adff403fSBjoern A. Zeeb uint8_t phy_cap_info[9]; 940adff403fSBjoern A. Zeeb }; 941adff403fSBjoern A. Zeeb 942adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp { 943adff403fSBjoern A. Zeeb /* TODO FIXME */ 944adff403fSBjoern A. Zeeb /* Can only have either or... */ 945adff403fSBjoern A. Zeeb union { 946adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp_20mhz_only only_20mhz; 947adff403fSBjoern A. Zeeb struct { 948adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp_bw _80; 949adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp_bw _160; 950adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp_bw _320; 951adff403fSBjoern A. Zeeb } bw; 952adff403fSBjoern A. Zeeb }; 953adff403fSBjoern A. Zeeb }; 954adff403fSBjoern A. Zeeb 955adff403fSBjoern A. Zeeb #define IEEE80211_STA_EHT_PPE_THRES_MAX 32 956adff403fSBjoern A. Zeeb struct ieee80211_sta_eht_cap { 957adff403fSBjoern A. Zeeb bool has_eht; 958adff403fSBjoern A. Zeeb struct ieee80211_eht_cap_elem_fixed eht_cap_elem; 959adff403fSBjoern A. Zeeb struct ieee80211_eht_mcs_nss_supp eht_mcs_nss_supp; 960adff403fSBjoern A. Zeeb uint8_t eht_ppe_thres[IEEE80211_STA_EHT_PPE_THRES_MAX]; 961adff403fSBjoern A. Zeeb }; 962adff403fSBjoern A. Zeeb 9636b4cac81SBjoern A. Zeeb struct ieee80211_sband_iftype_data { 9646b4cac81SBjoern A. Zeeb /* TODO FIXME */ 9656b4cac81SBjoern A. Zeeb enum nl80211_iftype types_mask; 9666b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_cap he_cap; 9676b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_6ghz_capa he_6ghz_capa; 968adff403fSBjoern A. Zeeb struct ieee80211_sta_eht_cap eht_cap; 9696b4cac81SBjoern A. Zeeb struct { 9706b4cac81SBjoern A. Zeeb const uint8_t *data; 9716b4cac81SBjoern A. Zeeb size_t len; 9726b4cac81SBjoern A. Zeeb } vendor_elems; 9736b4cac81SBjoern A. Zeeb }; 9746b4cac81SBjoern A. Zeeb 9756b4cac81SBjoern A. Zeeb struct ieee80211_supported_band { 9766b4cac81SBjoern A. Zeeb /* TODO FIXME */ 9776b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channels; 9786b4cac81SBjoern A. Zeeb struct ieee80211_rate *bitrates; 9796b4cac81SBjoern A. Zeeb struct ieee80211_sband_iftype_data *iftype_data; 9806b4cac81SBjoern A. Zeeb int n_channels; 9816b4cac81SBjoern A. Zeeb int n_bitrates; 9826b4cac81SBjoern A. Zeeb int n_iftype_data; 9836b4cac81SBjoern A. Zeeb enum nl80211_band band; 9846b4cac81SBjoern A. Zeeb struct ieee80211_sta_ht_cap ht_cap; 9856b4cac81SBjoern A. Zeeb struct ieee80211_sta_vht_cap vht_cap; 9866b4cac81SBjoern A. Zeeb }; 9876b4cac81SBjoern A. Zeeb 9886b4cac81SBjoern A. Zeeb struct cfg80211_pkt_pattern { 9896b4cac81SBjoern A. Zeeb /* XXX TODO */ 9906b4cac81SBjoern A. Zeeb uint8_t *mask; 9916b4cac81SBjoern A. Zeeb uint8_t *pattern; 9926b4cac81SBjoern A. Zeeb int pattern_len; 9936b4cac81SBjoern A. Zeeb int pkt_offset; 9946b4cac81SBjoern A. Zeeb }; 9956b4cac81SBjoern A. Zeeb 996800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_match { 997800aa9cdSBjoern A. Zeeb /* XXX TODO */ 998800aa9cdSBjoern A. Zeeb struct cfg80211_ssid ssid; 999800aa9cdSBjoern A. Zeeb int n_channels; 1000800aa9cdSBjoern A. Zeeb uint32_t channels[0]; /* freq! = ieee80211_channel_to_frequency() */ 1001800aa9cdSBjoern A. Zeeb }; 1002800aa9cdSBjoern A. Zeeb 1003800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_info { 1004800aa9cdSBjoern A. Zeeb /* XXX TODO */ 1005800aa9cdSBjoern A. Zeeb int n_matches; 1006800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_match *matches[0]; 1007800aa9cdSBjoern A. Zeeb }; 1008800aa9cdSBjoern A. Zeeb 1009800aa9cdSBjoern A. Zeeb enum wiphy_wowlan_support_flags { 1010800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_DISCONNECT, 1011800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_GTK_REKEY_FAILURE, 1012800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_MAGIC_PKT, 1013800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_SUPPORTS_GTK_REKEY, 1014800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_NET_DETECT, 1015800aa9cdSBjoern A. Zeeb }; 1016800aa9cdSBjoern A. Zeeb 1017800aa9cdSBjoern A. Zeeb struct wiphy_wowlan_support { 1018800aa9cdSBjoern A. Zeeb /* XXX TODO */ 1019800aa9cdSBjoern A. Zeeb enum wiphy_wowlan_support_flags flags; 1020800aa9cdSBjoern A. Zeeb int max_nd_match_sets, max_pkt_offset, n_patterns, pattern_max_len, pattern_min_len; 1021800aa9cdSBjoern A. Zeeb }; 1022800aa9cdSBjoern A. Zeeb 1023800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_wakeup { 1024800aa9cdSBjoern A. Zeeb /* XXX TODO */ 1025800aa9cdSBjoern A. Zeeb uint16_t pattern_idx; 1026800aa9cdSBjoern A. Zeeb bool disconnect; 1027800aa9cdSBjoern A. Zeeb bool eap_identity_req; 1028800aa9cdSBjoern A. Zeeb bool four_way_handshake; 1029800aa9cdSBjoern A. Zeeb bool gtk_rekey_failure; 1030800aa9cdSBjoern A. Zeeb bool magic_pkt; 1031800aa9cdSBjoern A. Zeeb bool rfkill_release; 1032800aa9cdSBjoern A. Zeeb bool tcp_connlost; 1033800aa9cdSBjoern A. Zeeb bool tcp_nomoretokens; 1034800aa9cdSBjoern A. Zeeb bool tcp_match; 1035800aa9cdSBjoern A. Zeeb bool packet_80211; 1036800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_info *net_detect; 1037800aa9cdSBjoern A. Zeeb uint8_t *packet; 1038800aa9cdSBjoern A. Zeeb uint16_t packet_len; 1039800aa9cdSBjoern A. Zeeb uint16_t packet_present_len; 1040800aa9cdSBjoern A. Zeeb }; 1041800aa9cdSBjoern A. Zeeb 10426b4cac81SBjoern A. Zeeb struct cfg80211_wowlan { 10436b4cac81SBjoern A. Zeeb /* XXX TODO */ 10446b4cac81SBjoern A. Zeeb int disconnect, gtk_rekey_failure, magic_pkt; 1045800aa9cdSBjoern A. Zeeb int eap_identity_req, four_way_handshake, rfkill_release, tcp, any; 10466b4cac81SBjoern A. Zeeb int n_patterns; 10476b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_request *nd_config; 10486b4cac81SBjoern A. Zeeb struct cfg80211_pkt_pattern *patterns; 10496b4cac81SBjoern A. Zeeb }; 10506b4cac81SBjoern A. Zeeb 10516b4cac81SBjoern A. Zeeb struct cfg80211_gtk_rekey_data { 10526b4cac81SBjoern A. Zeeb /* XXX TODO */ 1053800aa9cdSBjoern A. Zeeb const uint8_t *kck, *kek, *replay_ctr; 1054800aa9cdSBjoern A. Zeeb uint32_t akm; 1055800aa9cdSBjoern A. Zeeb uint8_t kck_len, kek_len; 10566b4cac81SBjoern A. Zeeb }; 10576b4cac81SBjoern A. Zeeb 10582e183d99SBjoern A. Zeeb struct cfg80211_tid_cfg { 10592e183d99SBjoern A. Zeeb /* XXX TODO */ 1060adff403fSBjoern A. Zeeb int mask, noack, retry_long, rtscts, tids, amsdu, ampdu; 10612e183d99SBjoern A. Zeeb enum nl80211_tx_rate_setting txrate_type; 10622e183d99SBjoern A. Zeeb struct cfg80211_bitrate_mask txrate_mask; 10632e183d99SBjoern A. Zeeb }; 10642e183d99SBjoern A. Zeeb 10652e183d99SBjoern A. Zeeb struct cfg80211_tid_config { 10662e183d99SBjoern A. Zeeb /* XXX TODO */ 10672e183d99SBjoern A. Zeeb int n_tid_conf; 10682e183d99SBjoern A. Zeeb struct cfg80211_tid_cfg tid_conf[0]; 10692e183d99SBjoern A. Zeeb }; 10702e183d99SBjoern A. Zeeb 10716b4cac81SBjoern A. Zeeb struct ieee80211_iface_limit { 10726b4cac81SBjoern A. Zeeb /* TODO FIXME */ 10736b4cac81SBjoern A. Zeeb int max, types; 10746b4cac81SBjoern A. Zeeb }; 10756b4cac81SBjoern A. Zeeb 10766b4cac81SBjoern A. Zeeb struct ieee80211_iface_combination { 10776b4cac81SBjoern A. Zeeb /* TODO FIXME */ 10786b4cac81SBjoern A. Zeeb const struct ieee80211_iface_limit *limits; 10796b4cac81SBjoern A. Zeeb int n_limits; 10806b4cac81SBjoern A. Zeeb int max_interfaces, num_different_channels; 10816b4cac81SBjoern A. Zeeb int beacon_int_infra_match, beacon_int_min_gcd; 1082b0f73768SBjoern A. Zeeb int radar_detect_widths; 10836b4cac81SBjoern A. Zeeb }; 10846b4cac81SBjoern A. Zeeb 10856b4cac81SBjoern A. Zeeb struct iface_combination_params { 10866b4cac81SBjoern A. Zeeb int num_different_channels; 10876b4cac81SBjoern A. Zeeb int iftype_num[NUM_NL80211_IFTYPES]; 10886b4cac81SBjoern A. Zeeb }; 10896b4cac81SBjoern A. Zeeb 10906b4cac81SBjoern A. Zeeb struct regulatory_request { 10916b4cac81SBjoern A. Zeeb /* XXX TODO */ 10926b4cac81SBjoern A. Zeeb uint8_t alpha2[2]; 1093a3baca22SBjoern A. Zeeb enum environment_cap country_ie_env; 10946b4cac81SBjoern A. Zeeb int initiator, dfs_region; 10951d70218eSBjoern A. Zeeb int user_reg_hint_type; 10966b4cac81SBjoern A. Zeeb }; 10976b4cac81SBjoern A. Zeeb 1098adff403fSBjoern A. Zeeb struct cfg80211_set_hw_timestamp { 1099adff403fSBjoern A. Zeeb const uint8_t *macaddr; 1100adff403fSBjoern A. Zeeb bool enable; 1101adff403fSBjoern A. Zeeb }; 1102adff403fSBjoern A. Zeeb 11036b4cac81SBjoern A. Zeeb enum wiphy_vendor_cmd_need_flags { 11046b4cac81SBjoern A. Zeeb WIPHY_VENDOR_CMD_NEED_NETDEV = 0x01, 11056b4cac81SBjoern A. Zeeb WIPHY_VENDOR_CMD_NEED_RUNNING = 0x02, 11066b4cac81SBjoern A. Zeeb WIPHY_VENDOR_CMD_NEED_WDEV = 0x04, 11076b4cac81SBjoern A. Zeeb }; 11086b4cac81SBjoern A. Zeeb 11096b4cac81SBjoern A. Zeeb struct wiphy_vendor_command { 11106b4cac81SBjoern A. Zeeb struct { 11116b4cac81SBjoern A. Zeeb uint32_t vendor_id; 11126b4cac81SBjoern A. Zeeb uint32_t subcmd; 11136b4cac81SBjoern A. Zeeb }; 11146b4cac81SBjoern A. Zeeb uint32_t flags; 11156b4cac81SBjoern A. Zeeb void *policy; 11166b4cac81SBjoern A. Zeeb int (*doit)(struct wiphy *, struct wireless_dev *, const void *, int); 11176b4cac81SBjoern A. Zeeb }; 11186b4cac81SBjoern A. Zeeb 11196b4cac81SBjoern A. Zeeb struct wiphy_iftype_ext_capab { 11206b4cac81SBjoern A. Zeeb /* TODO FIXME */ 11216b4cac81SBjoern A. Zeeb enum nl80211_iftype iftype; 11226b4cac81SBjoern A. Zeeb const uint8_t *extended_capabilities; 11236b4cac81SBjoern A. Zeeb const uint8_t *extended_capabilities_mask; 11246b4cac81SBjoern A. Zeeb uint8_t extended_capabilities_len; 1125adff403fSBjoern A. Zeeb uint16_t eml_capabilities; 1126*ac1d519cSBjoern A. Zeeb uint16_t mld_capa_and_ops; 11276b4cac81SBjoern A. Zeeb }; 11286b4cac81SBjoern A. Zeeb 11292e183d99SBjoern A. Zeeb struct tid_config_support { 11302e183d99SBjoern A. Zeeb /* TODO FIXME */ 11312e183d99SBjoern A. Zeeb uint64_t vif; /* enum nl80211_tid_cfg_attr */ 11322e183d99SBjoern A. Zeeb uint64_t peer; /* enum nl80211_tid_cfg_attr */ 11332e183d99SBjoern A. Zeeb }; 11342e183d99SBjoern A. Zeeb 11356b4cac81SBjoern A. Zeeb enum cfg80211_regulatory { 11366b4cac81SBjoern A. Zeeb REGULATORY_CUSTOM_REG = BIT(0), 11376b4cac81SBjoern A. Zeeb REGULATORY_STRICT_REG = BIT(1), 11386b4cac81SBjoern A. Zeeb REGULATORY_DISABLE_BEACON_HINTS = BIT(2), 11396b4cac81SBjoern A. Zeeb REGULATORY_ENABLE_RELAX_NO_IR = BIT(3), 11406b4cac81SBjoern A. Zeeb REGULATORY_WIPHY_SELF_MANAGED = BIT(4), 11416b4cac81SBjoern A. Zeeb REGULATORY_COUNTRY_IE_IGNORE = BIT(5), 11422e183d99SBjoern A. Zeeb REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(6), 11436b4cac81SBjoern A. Zeeb }; 11446b4cac81SBjoern A. Zeeb 1145b0f73768SBjoern A. Zeeb enum wiphy_flags { 1146b0f73768SBjoern A. Zeeb WIPHY_FLAG_AP_UAPSD = BIT(0), 1147b0f73768SBjoern A. Zeeb WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(1), 1148b0f73768SBjoern A. Zeeb WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(2), 1149b0f73768SBjoern A. Zeeb WIPHY_FLAG_HAVE_AP_SME = BIT(3), 1150b0f73768SBjoern A. Zeeb WIPHY_FLAG_IBSS_RSN = BIT(4), 1151b0f73768SBjoern A. Zeeb WIPHY_FLAG_NETNS_OK = BIT(5), 1152b0f73768SBjoern A. Zeeb WIPHY_FLAG_OFFCHAN_TX = BIT(6), 1153b0f73768SBjoern A. Zeeb WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(7), 1154b0f73768SBjoern A. Zeeb WIPHY_FLAG_SPLIT_SCAN_6GHZ = BIT(8), 1155b0f73768SBjoern A. Zeeb WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(9), 1156b0f73768SBjoern A. Zeeb WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(10), 1157b0f73768SBjoern A. Zeeb WIPHY_FLAG_SUPPORTS_TDLS = BIT(11), 1158b0f73768SBjoern A. Zeeb WIPHY_FLAG_TDLS_EXTERNAL_SETUP = BIT(12), 1159b0f73768SBjoern A. Zeeb WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = BIT(13), 1160b0f73768SBjoern A. Zeeb WIPHY_FLAG_4ADDR_AP = BIT(14), 1161b0f73768SBjoern A. Zeeb WIPHY_FLAG_4ADDR_STATION = BIT(15), 1162adff403fSBjoern A. Zeeb WIPHY_FLAG_SUPPORTS_MLO = BIT(16), 1163*ac1d519cSBjoern A. Zeeb WIPHY_FLAG_DISABLE_WEXT = BIT(17), 1164*ac1d519cSBjoern A. Zeeb }; 1165*ac1d519cSBjoern A. Zeeb 1166*ac1d519cSBjoern A. Zeeb struct wiphy_work; 1167*ac1d519cSBjoern A. Zeeb typedef void (*wiphy_work_fn)(struct wiphy *, struct wiphy_work *); 1168*ac1d519cSBjoern A. Zeeb struct wiphy_work { 1169*ac1d519cSBjoern A. Zeeb struct list_head entry; 1170*ac1d519cSBjoern A. Zeeb wiphy_work_fn fn; 1171*ac1d519cSBjoern A. Zeeb }; 1172*ac1d519cSBjoern A. Zeeb struct wiphy_delayed_work { 1173*ac1d519cSBjoern A. Zeeb struct wiphy_work work; 1174*ac1d519cSBjoern A. Zeeb struct wiphy *wiphy; 1175*ac1d519cSBjoern A. Zeeb struct timer_list timer; 1176b0f73768SBjoern A. Zeeb }; 11776b4cac81SBjoern A. Zeeb 11786b4cac81SBjoern A. Zeeb struct wiphy { 1179*ac1d519cSBjoern A. Zeeb struct mutex mtx; 11806b4cac81SBjoern A. Zeeb struct device *dev; 11816b4cac81SBjoern A. Zeeb struct mac_address *addresses; 11826b4cac81SBjoern A. Zeeb int n_addresses; 11836b4cac81SBjoern A. Zeeb uint32_t flags; 11846b4cac81SBjoern A. Zeeb struct ieee80211_supported_band *bands[NUM_NL80211_BANDS]; 11856b4cac81SBjoern A. Zeeb uint8_t perm_addr[ETH_ALEN]; 1186800aa9cdSBjoern A. Zeeb uint16_t max_scan_ie_len; 11876b4cac81SBjoern A. Zeeb 11886b4cac81SBjoern A. Zeeb /* XXX TODO */ 11896b4cac81SBjoern A. Zeeb const struct cfg80211_pmsr_capabilities *pmsr_capa; 119051b461b3SBjoern A. Zeeb const struct cfg80211_sar_capa *sar_capa; 11916b4cac81SBjoern A. Zeeb const struct wiphy_iftype_ext_capab *iftype_ext_capab; 11926b4cac81SBjoern A. Zeeb const struct linuxkpi_ieee80211_regdomain *regd; 11932e183d99SBjoern A. Zeeb char fw_version[ETHTOOL_FWVERS_LEN]; 11946b4cac81SBjoern A. Zeeb const struct ieee80211_iface_combination *iface_combinations; 11956b4cac81SBjoern A. Zeeb const uint32_t *cipher_suites; 11966b4cac81SBjoern A. Zeeb int n_iface_combinations; 11976b4cac81SBjoern A. Zeeb int n_cipher_suites; 11986b4cac81SBjoern A. Zeeb void(*reg_notifier)(struct wiphy *, struct regulatory_request *); 11996b4cac81SBjoern A. Zeeb enum cfg80211_regulatory regulatory_flags; 12006b4cac81SBjoern A. Zeeb int n_vendor_commands; 12016b4cac81SBjoern A. Zeeb const struct wiphy_vendor_command *vendor_commands; 12026b4cac81SBjoern A. Zeeb const struct ieee80211_txrx_stypes *mgmt_stypes; 12036b4cac81SBjoern A. Zeeb uint32_t rts_threshold; 12046b4cac81SBjoern A. Zeeb uint32_t frag_threshold; 12052e183d99SBjoern A. Zeeb struct tid_config_support tid_config_support; 1206a3baca22SBjoern A. Zeeb uint8_t available_antennas_rx; 1207a3baca22SBjoern A. Zeeb uint8_t available_antennas_tx; 12086b4cac81SBjoern A. Zeeb 12096b4cac81SBjoern A. Zeeb int features, hw_version; 1210800aa9cdSBjoern A. Zeeb int 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; 12116b4cac81SBjoern A. Zeeb int num_iftype_ext_capab; 12126b4cac81SBjoern A. Zeeb int max_ap_assoc_sta, probe_resp_offload, software_iftypes; 12136b4cac81SBjoern A. Zeeb int bss_select_support, max_num_pmkids, retry_long, retry_short, signal_type; 12142e183d99SBjoern A. Zeeb int max_data_retry_count; 1215d875aa15SBjoern A. Zeeb int tx_queue_len, rfkill; 1216b0f73768SBjoern A. Zeeb int mbssid_max_interfaces; 1217adff403fSBjoern A. Zeeb int hw_timestamp_max_peers; 1218adff403fSBjoern A. Zeeb int ema_max_profile_periodicity; 12196b4cac81SBjoern A. Zeeb 12206b4cac81SBjoern A. Zeeb unsigned long ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)]; 12216b4cac81SBjoern A. Zeeb struct dentry *debugfsdir; 12226b4cac81SBjoern A. Zeeb struct cfg80211_wowlan_support *wowlan; 12236b4cac81SBjoern A. Zeeb /* Lower layer (driver/mac80211) specific data. */ 12246b4cac81SBjoern A. Zeeb /* Must stay last. */ 12256b4cac81SBjoern A. Zeeb uint8_t priv[0] __aligned(CACHE_LINE_SIZE); 12266b4cac81SBjoern A. Zeeb }; 12276b4cac81SBjoern A. Zeeb 1228*ac1d519cSBjoern A. Zeeb #define lockdep_assert_wiphy(wiphy) \ 1229*ac1d519cSBjoern A. Zeeb lockdep_assert_held(&(wiphy)->mtx) 1230*ac1d519cSBjoern A. Zeeb 12316b4cac81SBjoern A. Zeeb struct wireless_dev { 12326b4cac81SBjoern A. Zeeb /* XXX TODO, like ic? */ 12336b4cac81SBjoern A. Zeeb int iftype; 12346b4cac81SBjoern A. Zeeb int address; 12356b4cac81SBjoern A. Zeeb struct net_device *netdev; 12366b4cac81SBjoern A. Zeeb struct wiphy *wiphy; 12376b4cac81SBjoern A. Zeeb }; 12386b4cac81SBjoern A. Zeeb 12396b4cac81SBjoern A. Zeeb struct cfg80211_ops { 12406b4cac81SBjoern A. Zeeb /* XXX TODO */ 12416b4cac81SBjoern A. Zeeb struct wireless_dev *(*add_virtual_intf)(struct wiphy *, const char *, unsigned char, enum nl80211_iftype, struct vif_params *); 12426b4cac81SBjoern A. Zeeb int (*del_virtual_intf)(struct wiphy *, struct wireless_dev *); 12436b4cac81SBjoern A. Zeeb s32 (*change_virtual_intf)(struct wiphy *, struct net_device *, enum nl80211_iftype, struct vif_params *); 12446b4cac81SBjoern A. Zeeb s32 (*scan)(struct wiphy *, struct cfg80211_scan_request *); 12456b4cac81SBjoern A. Zeeb s32 (*set_wiphy_params)(struct wiphy *, u32); 12466b4cac81SBjoern A. Zeeb s32 (*join_ibss)(struct wiphy *, struct net_device *, struct cfg80211_ibss_params *); 12476b4cac81SBjoern A. Zeeb s32 (*leave_ibss)(struct wiphy *, struct net_device *); 12486b4cac81SBjoern A. Zeeb s32 (*get_station)(struct wiphy *, struct net_device *, const u8 *, struct station_info *); 12496b4cac81SBjoern A. Zeeb int (*dump_station)(struct wiphy *, struct net_device *, int, u8 *, struct station_info *); 12506b4cac81SBjoern A. Zeeb s32 (*set_tx_power)(struct wiphy *, struct wireless_dev *, enum nl80211_tx_power_setting, s32); 12516b4cac81SBjoern A. Zeeb s32 (*get_tx_power)(struct wiphy *, struct wireless_dev *, s32 *); 12526b4cac81SBjoern A. Zeeb s32 (*add_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, struct key_params *); 12536b4cac81SBjoern A. Zeeb s32 (*del_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *); 12546b4cac81SBjoern A. Zeeb s32 (*get_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, void *, void(*)(void *, struct key_params *)); 12556b4cac81SBjoern A. Zeeb s32 (*set_default_key)(struct wiphy *, struct net_device *, u8, bool, bool); 12566b4cac81SBjoern A. Zeeb s32 (*set_default_mgmt_key)(struct wiphy *, struct net_device *, u8); 12576b4cac81SBjoern A. Zeeb s32 (*set_power_mgmt)(struct wiphy *, struct net_device *, bool, s32); 12586b4cac81SBjoern A. Zeeb s32 (*connect)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *); 12596b4cac81SBjoern A. Zeeb s32 (*disconnect)(struct wiphy *, struct net_device *, u16); 12606b4cac81SBjoern A. Zeeb s32 (*suspend)(struct wiphy *, struct cfg80211_wowlan *); 12616b4cac81SBjoern A. Zeeb s32 (*resume)(struct wiphy *); 12626b4cac81SBjoern A. Zeeb s32 (*set_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); 12636b4cac81SBjoern A. Zeeb s32 (*del_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); 12646b4cac81SBjoern A. Zeeb s32 (*flush_pmksa)(struct wiphy *, struct net_device *); 12656b4cac81SBjoern A. Zeeb s32 (*start_ap)(struct wiphy *, struct net_device *, struct cfg80211_ap_settings *); 12666b4cac81SBjoern A. Zeeb int (*stop_ap)(struct wiphy *, struct net_device *); 12676b4cac81SBjoern A. Zeeb s32 (*change_beacon)(struct wiphy *, struct net_device *, struct cfg80211_beacon_data *); 12686b4cac81SBjoern A. Zeeb int (*del_station)(struct wiphy *, struct net_device *, struct station_del_parameters *); 12696b4cac81SBjoern A. Zeeb int (*change_station)(struct wiphy *, struct net_device *, const u8 *, struct station_parameters *); 12706b4cac81SBjoern A. Zeeb int (*sched_scan_start)(struct wiphy *, struct net_device *, struct cfg80211_sched_scan_request *); 12716b4cac81SBjoern A. Zeeb int (*sched_scan_stop)(struct wiphy *, struct net_device *, u64); 12726b4cac81SBjoern A. Zeeb void (*update_mgmt_frame_registrations)(struct wiphy *, struct wireless_dev *, struct mgmt_frame_regs *); 12736b4cac81SBjoern A. Zeeb int (*mgmt_tx)(struct wiphy *, struct wireless_dev *, struct cfg80211_mgmt_tx_params *, u64 *); 12746b4cac81SBjoern A. Zeeb int (*cancel_remain_on_channel)(struct wiphy *, struct wireless_dev *, u64); 12756b4cac81SBjoern A. Zeeb int (*get_channel)(struct wiphy *, struct wireless_dev *, struct cfg80211_chan_def *); 12766b4cac81SBjoern A. Zeeb int (*crit_proto_start)(struct wiphy *, struct wireless_dev *, enum nl80211_crit_proto_id, u16); 12776b4cac81SBjoern A. Zeeb void (*crit_proto_stop)(struct wiphy *, struct wireless_dev *); 12786b4cac81SBjoern A. Zeeb int (*tdls_oper)(struct wiphy *, struct net_device *, const u8 *, enum nl80211_tdls_operation); 12796b4cac81SBjoern A. Zeeb int (*update_connect_params)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *, u32); 12806b4cac81SBjoern A. Zeeb int (*set_pmk)(struct wiphy *, struct net_device *, const struct cfg80211_pmk_conf *); 12816b4cac81SBjoern A. Zeeb int (*del_pmk)(struct wiphy *, struct net_device *, const u8 *); 12826b4cac81SBjoern A. Zeeb int (*remain_on_channel)(struct wiphy *, struct wireless_dev *, struct linuxkpi_ieee80211_channel *, unsigned int, u64 *); 12836b4cac81SBjoern A. Zeeb int (*start_p2p_device)(struct wiphy *, struct wireless_dev *); 12846b4cac81SBjoern A. Zeeb void (*stop_p2p_device)(struct wiphy *, struct wireless_dev *); 12856b4cac81SBjoern A. Zeeb }; 12866b4cac81SBjoern A. Zeeb 12876b4cac81SBjoern A. Zeeb 12886b4cac81SBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 12896b4cac81SBjoern A. Zeeb 12906b4cac81SBjoern A. Zeeb /* linux_80211.c */ 12916b4cac81SBjoern A. Zeeb 12926b4cac81SBjoern A. Zeeb struct wiphy *linuxkpi_wiphy_new(const struct cfg80211_ops *, size_t); 12936b4cac81SBjoern A. Zeeb void linuxkpi_wiphy_free(struct wiphy *wiphy); 12946b4cac81SBjoern A. Zeeb 1295*ac1d519cSBjoern A. Zeeb void linuxkpi_wiphy_work_queue(struct wiphy *, struct wiphy_work *); 1296*ac1d519cSBjoern A. Zeeb void linuxkpi_wiphy_work_cancel(struct wiphy *, struct wiphy_work *); 1297*ac1d519cSBjoern A. Zeeb void linuxkpi_wiphy_work_flush(struct wiphy *, struct wiphy_work *); 1298*ac1d519cSBjoern A. Zeeb void lkpi_wiphy_delayed_work_timer(struct timer_list *); 1299*ac1d519cSBjoern A. Zeeb void linuxkpi_wiphy_delayed_work_queue(struct wiphy *, 1300*ac1d519cSBjoern A. Zeeb struct wiphy_delayed_work *, unsigned long); 1301*ac1d519cSBjoern A. Zeeb void linuxkpi_wiphy_delayed_work_cancel(struct wiphy *, 1302*ac1d519cSBjoern A. Zeeb struct wiphy_delayed_work *); 1303*ac1d519cSBjoern A. Zeeb 13046b4cac81SBjoern A. Zeeb int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, 13056b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd); 13066b4cac81SBjoern A. Zeeb uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); 13076b4cac81SBjoern A. Zeeb uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t); 13082e183d99SBjoern A. Zeeb struct linuxkpi_ieee80211_channel * 13092e183d99SBjoern A. Zeeb linuxkpi_ieee80211_get_channel(struct wiphy *, uint32_t); 13105edde07cSBjoern A. Zeeb struct cfg80211_bss *linuxkpi_cfg80211_get_bss(struct wiphy *, 13115edde07cSBjoern A. Zeeb struct linuxkpi_ieee80211_channel *, const uint8_t *, 13125edde07cSBjoern A. Zeeb const uint8_t *, size_t, enum ieee80211_bss_type, enum ieee80211_privacy); 13135edde07cSBjoern A. Zeeb void linuxkpi_cfg80211_put_bss(struct wiphy *, struct cfg80211_bss *); 1314b0f73768SBjoern A. Zeeb void linuxkpi_cfg80211_bss_flush(struct wiphy *); 1315673d62fcSBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain * 1316673d62fcSBjoern A. Zeeb lkpi_get_linuxkpi_ieee80211_regdomain(size_t); 13176b4cac81SBjoern A. Zeeb 13186b4cac81SBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 13196b4cac81SBjoern A. Zeeb 13206b4cac81SBjoern A. Zeeb static __inline struct wiphy * 13216b4cac81SBjoern A. Zeeb wiphy_new(const struct cfg80211_ops *ops, size_t priv_len) 13226b4cac81SBjoern A. Zeeb { 13236b4cac81SBjoern A. Zeeb 13246b4cac81SBjoern A. Zeeb return (linuxkpi_wiphy_new(ops, priv_len)); 13256b4cac81SBjoern A. Zeeb } 13266b4cac81SBjoern A. Zeeb 13276b4cac81SBjoern A. Zeeb static __inline void 13286b4cac81SBjoern A. Zeeb wiphy_free(struct wiphy *wiphy) 13296b4cac81SBjoern A. Zeeb { 13306b4cac81SBjoern A. Zeeb 13316b4cac81SBjoern A. Zeeb linuxkpi_wiphy_free(wiphy); 13326b4cac81SBjoern A. Zeeb } 13336b4cac81SBjoern A. Zeeb 13346b4cac81SBjoern A. Zeeb static __inline void * 13356b4cac81SBjoern A. Zeeb wiphy_priv(struct wiphy *wiphy) 13366b4cac81SBjoern A. Zeeb { 13376b4cac81SBjoern A. Zeeb 13386b4cac81SBjoern A. Zeeb return (wiphy->priv); 13396b4cac81SBjoern A. Zeeb } 13406b4cac81SBjoern A. Zeeb 13416b4cac81SBjoern A. Zeeb static __inline void 13426b4cac81SBjoern A. Zeeb set_wiphy_dev(struct wiphy *wiphy, struct device *dev) 13436b4cac81SBjoern A. Zeeb { 13446b4cac81SBjoern A. Zeeb 13456b4cac81SBjoern A. Zeeb wiphy->dev = dev; 13466b4cac81SBjoern A. Zeeb } 13476b4cac81SBjoern A. Zeeb 13486b4cac81SBjoern A. Zeeb static __inline struct device * 13496b4cac81SBjoern A. Zeeb wiphy_dev(struct wiphy *wiphy) 13506b4cac81SBjoern A. Zeeb { 13516b4cac81SBjoern A. Zeeb 13526b4cac81SBjoern A. Zeeb return (wiphy->dev); 13536b4cac81SBjoern A. Zeeb } 13546b4cac81SBjoern A. Zeeb 1355*ac1d519cSBjoern A. Zeeb #define wiphy_dereference(wiphy, p) \ 1356*ac1d519cSBjoern A. Zeeb rcu_dereference_check(p, lockdep_is_held(&(wiphy)->mtx)) 13576b4cac81SBjoern A. Zeeb 1358d875aa15SBjoern A. Zeeb static __inline void 1359d875aa15SBjoern A. Zeeb wiphy_lock(struct wiphy *wiphy) 1360d875aa15SBjoern A. Zeeb { 1361d875aa15SBjoern A. Zeeb TODO(); 1362d875aa15SBjoern A. Zeeb } 1363d875aa15SBjoern A. Zeeb 1364d875aa15SBjoern A. Zeeb static __inline void 1365d875aa15SBjoern A. Zeeb wiphy_unlock(struct wiphy *wiphy) 1366d875aa15SBjoern A. Zeeb { 1367d875aa15SBjoern A. Zeeb TODO(); 1368d875aa15SBjoern A. Zeeb } 1369d875aa15SBjoern A. Zeeb 1370d875aa15SBjoern A. Zeeb static __inline void 1371d875aa15SBjoern A. Zeeb wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked, 1372d875aa15SBjoern A. Zeeb enum rfkill_hard_block_reasons reason) 1373d875aa15SBjoern A. Zeeb { 1374d875aa15SBjoern A. Zeeb TODO(); 1375d875aa15SBjoern A. Zeeb } 1376d875aa15SBjoern A. Zeeb 13776b4cac81SBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 13786b4cac81SBjoern A. Zeeb 13795edde07cSBjoern A. Zeeb static inline struct cfg80211_bss * 13805edde07cSBjoern A. Zeeb cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan, 13815edde07cSBjoern A. Zeeb const uint8_t *bssid, const uint8_t *ssid, size_t ssid_len, 13825edde07cSBjoern A. Zeeb enum ieee80211_bss_type bss_type, enum ieee80211_privacy privacy) 13835edde07cSBjoern A. Zeeb { 13845edde07cSBjoern A. Zeeb 13855edde07cSBjoern A. Zeeb return (linuxkpi_cfg80211_get_bss(wiphy, chan, bssid, ssid, ssid_len, 13865edde07cSBjoern A. Zeeb bss_type, privacy)); 13875edde07cSBjoern A. Zeeb } 13885edde07cSBjoern A. Zeeb 13895edde07cSBjoern A. Zeeb static inline void 13905edde07cSBjoern A. Zeeb cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss) 13915edde07cSBjoern A. Zeeb { 13925edde07cSBjoern A. Zeeb 13935edde07cSBjoern A. Zeeb linuxkpi_cfg80211_put_bss(wiphy, bss); 13945edde07cSBjoern A. Zeeb } 13955edde07cSBjoern A. Zeeb 13965edde07cSBjoern A. Zeeb static inline void 13975edde07cSBjoern A. Zeeb cfg80211_bss_flush(struct wiphy *wiphy) 13985edde07cSBjoern A. Zeeb { 13995edde07cSBjoern A. Zeeb 14005edde07cSBjoern A. Zeeb linuxkpi_cfg80211_bss_flush(wiphy); 14015edde07cSBjoern A. Zeeb } 14025edde07cSBjoern A. Zeeb 14035edde07cSBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 14045edde07cSBjoern A. Zeeb 1405d875aa15SBjoern A. Zeeb static __inline bool 1406d875aa15SBjoern A. Zeeb rfkill_blocked(int rfkill) /* argument type? */ 1407d875aa15SBjoern A. Zeeb { 1408d875aa15SBjoern A. Zeeb TODO(); 1409d875aa15SBjoern A. Zeeb return (false); 1410d875aa15SBjoern A. Zeeb } 1411d875aa15SBjoern A. Zeeb 141205d6f4d6SBjoern A. Zeeb static __inline bool 141305d6f4d6SBjoern A. Zeeb rfkill_soft_blocked(int rfkill) 141405d6f4d6SBjoern A. Zeeb { 141505d6f4d6SBjoern A. Zeeb TODO(); 141605d6f4d6SBjoern A. Zeeb return (false); 141705d6f4d6SBjoern A. Zeeb } 141805d6f4d6SBjoern A. Zeeb 14196b4cac81SBjoern A. Zeeb static __inline int 14206b4cac81SBjoern A. Zeeb reg_query_regdb_wmm(uint8_t *alpha2, uint32_t center_freq, 14216b4cac81SBjoern A. Zeeb struct ieee80211_reg_rule *rule) 14226b4cac81SBjoern A. Zeeb { 14236b4cac81SBjoern A. Zeeb 14246b4cac81SBjoern A. Zeeb /* ETSI has special rules. FreeBSD regdb needs to learn about them. */ 14256b4cac81SBjoern A. Zeeb TODO(); 14266b4cac81SBjoern A. Zeeb 14276b4cac81SBjoern A. Zeeb return (-ENXIO); 14286b4cac81SBjoern A. Zeeb } 14296b4cac81SBjoern A. Zeeb 14306b4cac81SBjoern A. Zeeb static __inline const u8 * 14316b4cac81SBjoern A. Zeeb cfg80211_find_ie_match(uint32_t f, const u8 *ies, size_t ies_len, 14326b4cac81SBjoern A. Zeeb const u8 *match, int x, int y) 14336b4cac81SBjoern A. Zeeb { 14346b4cac81SBjoern A. Zeeb TODO(); 14356b4cac81SBjoern A. Zeeb return (NULL); 14366b4cac81SBjoern A. Zeeb } 14376b4cac81SBjoern A. Zeeb 14386b4cac81SBjoern A. Zeeb static __inline const u8 * 1439b0f73768SBjoern A. Zeeb cfg80211_find_ie(uint8_t eid, const uint8_t *ie, uint32_t ielen) 14406b4cac81SBjoern A. Zeeb { 14416b4cac81SBjoern A. Zeeb TODO(); 14426b4cac81SBjoern A. Zeeb return (NULL); 14436b4cac81SBjoern A. Zeeb } 14446b4cac81SBjoern A. Zeeb 14456b4cac81SBjoern A. Zeeb static __inline void 14466b4cac81SBjoern A. Zeeb cfg80211_pmsr_complete(struct wireless_dev *wdev, 14476b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request *req, gfp_t gfp) 14486b4cac81SBjoern A. Zeeb { 14496b4cac81SBjoern A. Zeeb TODO(); 14506b4cac81SBjoern A. Zeeb } 14516b4cac81SBjoern A. Zeeb 14526b4cac81SBjoern A. Zeeb static __inline void 14536b4cac81SBjoern A. Zeeb cfg80211_pmsr_report(struct wireless_dev *wdev, 14546b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request *req, 14556b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_result *result, gfp_t gfp) 14566b4cac81SBjoern A. Zeeb { 14576b4cac81SBjoern A. Zeeb TODO(); 14586b4cac81SBjoern A. Zeeb } 14596b4cac81SBjoern A. Zeeb 14606b4cac81SBjoern A. Zeeb static __inline void 14616b4cac81SBjoern A. Zeeb cfg80211_chandef_create(struct cfg80211_chan_def *chandef, 14626b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan, enum nl80211_chan_flags chan_flag) 14636b4cac81SBjoern A. Zeeb { 14646b4cac81SBjoern A. Zeeb 14656b4cac81SBjoern A. Zeeb KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__)); 14666b4cac81SBjoern A. Zeeb KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__)); 14676b4cac81SBjoern A. Zeeb 14684a07abdeSBjoern A. Zeeb memset(chandef, 0, sizeof(*chandef)); 14696b4cac81SBjoern A. Zeeb chandef->chan = chan; 14706b4cac81SBjoern A. Zeeb chandef->center_freq2 = 0; /* Set here and only overwrite if needed. */ 14716b4cac81SBjoern A. Zeeb 14726b4cac81SBjoern A. Zeeb switch (chan_flag) { 14736b4cac81SBjoern A. Zeeb case NL80211_CHAN_NO_HT: 14746b4cac81SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_20_NOHT; 14756b4cac81SBjoern A. Zeeb chandef->center_freq1 = chan->center_freq; 14766b4cac81SBjoern A. Zeeb break; 14776b4cac81SBjoern A. Zeeb default: 1478800aa9cdSBjoern A. Zeeb IMPROVE("Also depends on our manual settings"); 1479b0f73768SBjoern A. Zeeb if (chan->flags & IEEE80211_CHAN_NO_HT40) 14806b4cac81SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_20; 1481b0f73768SBjoern A. Zeeb else if (chan->flags & IEEE80211_CHAN_NO_80MHZ) 1482b0f73768SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_40; 1483b0f73768SBjoern A. Zeeb else if (chan->flags & IEEE80211_CHAN_NO_160MHZ) 1484b0f73768SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_80; 1485b0f73768SBjoern A. Zeeb else { 1486b0f73768SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_160; 1487b0f73768SBjoern A. Zeeb IMPROVE("80P80 and 320 ..."); 1488b0f73768SBjoern A. Zeeb } 14896b4cac81SBjoern A. Zeeb chandef->center_freq1 = chan->center_freq; 14906b4cac81SBjoern A. Zeeb break; 14916b4cac81SBjoern A. Zeeb }; 14926b4cac81SBjoern A. Zeeb } 14936b4cac81SBjoern A. Zeeb 14946b4cac81SBjoern A. Zeeb static __inline void 14956b4cac81SBjoern A. Zeeb cfg80211_bss_iter(struct wiphy *wiphy, struct cfg80211_chan_def *chandef, 14966b4cac81SBjoern A. Zeeb void (*iterfunc)(struct wiphy *, struct cfg80211_bss *, void *), void *data) 14976b4cac81SBjoern A. Zeeb { 14986b4cac81SBjoern A. Zeeb TODO(); 14996b4cac81SBjoern A. Zeeb } 15006b4cac81SBjoern A. Zeeb 15016b4cac81SBjoern A. Zeeb struct element { 15026b4cac81SBjoern A. Zeeb uint8_t id; 15036b4cac81SBjoern A. Zeeb uint8_t datalen; 15046b4cac81SBjoern A. Zeeb uint8_t data[0]; 1505b0f73768SBjoern A. Zeeb } __packed; 15066b4cac81SBjoern A. Zeeb 15075db817d8SBjoern A. Zeeb static inline const struct element * 15085db817d8SBjoern A. Zeeb lkpi_cfg80211_find_elem_pattern(enum ieee80211_eid eid, 15095db817d8SBjoern A. Zeeb const uint8_t *data, size_t len, uint8_t *pattern, size_t plen) 15106b4cac81SBjoern A. Zeeb { 15115db817d8SBjoern A. Zeeb const struct element *elem; 15125db817d8SBjoern A. Zeeb const uint8_t *p; 15135db817d8SBjoern A. Zeeb size_t ielen; 15145db817d8SBjoern A. Zeeb 15155db817d8SBjoern A. Zeeb p = data; 15165db817d8SBjoern A. Zeeb elem = (const struct element *)p; 15175db817d8SBjoern A. Zeeb ielen = len; 15185db817d8SBjoern A. Zeeb while (elem != NULL && ielen > 1) { 15195db817d8SBjoern A. Zeeb if ((2 + elem->datalen) > ielen) 15205db817d8SBjoern A. Zeeb /* Element overruns our memory. */ 15216b4cac81SBjoern A. Zeeb return (NULL); 15225db817d8SBjoern A. Zeeb if (elem->id == eid) { 15235db817d8SBjoern A. Zeeb if (pattern == NULL) 15245db817d8SBjoern A. Zeeb return (elem); 15255db817d8SBjoern A. Zeeb if (elem->datalen >= plen && 15265db817d8SBjoern A. Zeeb memcmp(elem->data, pattern, plen) == 0) 15275db817d8SBjoern A. Zeeb return (elem); 15285db817d8SBjoern A. Zeeb } 15295db817d8SBjoern A. Zeeb ielen -= 2 + elem->datalen; 15305db817d8SBjoern A. Zeeb p += 2 + elem->datalen; 15315db817d8SBjoern A. Zeeb elem = (const struct element *)p; 15325db817d8SBjoern A. Zeeb } 15335db817d8SBjoern A. Zeeb 15345db817d8SBjoern A. Zeeb return (NULL); 15355db817d8SBjoern A. Zeeb } 15365db817d8SBjoern A. Zeeb 15375db817d8SBjoern A. Zeeb static inline const struct element * 15385db817d8SBjoern A. Zeeb cfg80211_find_elem(enum ieee80211_eid eid, const uint8_t *data, size_t len) 15395db817d8SBjoern A. Zeeb { 15405db817d8SBjoern A. Zeeb 15415db817d8SBjoern A. Zeeb return (lkpi_cfg80211_find_elem_pattern(eid, data, len, NULL, 0)); 15425db817d8SBjoern A. Zeeb } 15435db817d8SBjoern A. Zeeb 15445db817d8SBjoern A. Zeeb static inline const struct element * 15455db817d8SBjoern A. Zeeb ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid) 15465db817d8SBjoern A. Zeeb { 15475db817d8SBjoern A. Zeeb 15485db817d8SBjoern A. Zeeb if (bss->ies == NULL) 15495db817d8SBjoern A. Zeeb return (NULL); 15505db817d8SBjoern A. Zeeb return (cfg80211_find_elem(eid, bss->ies->data, bss->ies->len)); 15515db817d8SBjoern A. Zeeb } 15525db817d8SBjoern A. Zeeb 15535db817d8SBjoern A. Zeeb static inline const uint8_t * 15545db817d8SBjoern A. Zeeb ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid) 15555db817d8SBjoern A. Zeeb { 15565db817d8SBjoern A. Zeeb 15575db817d8SBjoern A. Zeeb return ((const uint8_t *)ieee80211_bss_get_elem(bss, eid)); 15585db817d8SBjoern A. Zeeb } 15595db817d8SBjoern A. Zeeb 15605db817d8SBjoern A. Zeeb static inline uint8_t * 15615db817d8SBjoern A. Zeeb cfg80211_find_vendor_ie(unsigned int oui, int oui_type, 15625db817d8SBjoern A. Zeeb uint8_t *data, size_t len) 15635db817d8SBjoern A. Zeeb { 15645db817d8SBjoern A. Zeeb const struct element *elem; 15655db817d8SBjoern A. Zeeb uint8_t pattern[4] = { oui << 16, oui << 8, oui, oui_type }; 15665db817d8SBjoern A. Zeeb uint8_t plen = 4; /* >= 3? oui_type always part of this? */ 15675db817d8SBjoern A. Zeeb IMPROVE("plen currently always incl. oui_type"); 15685db817d8SBjoern A. Zeeb 15695db817d8SBjoern A. Zeeb elem = lkpi_cfg80211_find_elem_pattern(IEEE80211_ELEMID_VENDOR, 15705db817d8SBjoern A. Zeeb data, len, pattern, plen); 15715db817d8SBjoern A. Zeeb if (elem == NULL) 15725db817d8SBjoern A. Zeeb return (NULL); 15735db817d8SBjoern A. Zeeb return (__DECONST(uint8_t *, elem)); 15746b4cac81SBjoern A. Zeeb } 15756b4cac81SBjoern A. Zeeb 15766b4cac81SBjoern A. Zeeb static __inline uint32_t 15776b4cac81SBjoern A. Zeeb cfg80211_calculate_bitrate(struct rate_info *rate) 15786b4cac81SBjoern A. Zeeb { 15796b4cac81SBjoern A. Zeeb TODO(); 15806b4cac81SBjoern A. Zeeb return (-1); 15816b4cac81SBjoern A. Zeeb } 15826b4cac81SBjoern A. Zeeb 15836b4cac81SBjoern A. Zeeb static __inline uint32_t 15846b4cac81SBjoern A. Zeeb ieee80211_channel_to_frequency(uint32_t channel, enum nl80211_band band) 15856b4cac81SBjoern A. Zeeb { 15866b4cac81SBjoern A. Zeeb 15876b4cac81SBjoern A. Zeeb return (linuxkpi_ieee80211_channel_to_frequency(channel, band)); 15886b4cac81SBjoern A. Zeeb } 15896b4cac81SBjoern A. Zeeb 15906b4cac81SBjoern A. Zeeb static __inline uint32_t 15916b4cac81SBjoern A. Zeeb ieee80211_frequency_to_channel(uint32_t freq) 15926b4cac81SBjoern A. Zeeb { 15936b4cac81SBjoern A. Zeeb 15946b4cac81SBjoern A. Zeeb return (linuxkpi_ieee80211_frequency_to_channel(freq, 0)); 15956b4cac81SBjoern A. Zeeb } 15966b4cac81SBjoern A. Zeeb 15976b4cac81SBjoern A. Zeeb static __inline int 15986b4cac81SBjoern A. Zeeb regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, 15996b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd) 16006b4cac81SBjoern A. Zeeb { 16016b4cac81SBjoern A. Zeeb IMPROVE(); 16026b4cac81SBjoern A. Zeeb return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd)); 16036b4cac81SBjoern A. Zeeb } 16046b4cac81SBjoern A. Zeeb 16056b4cac81SBjoern A. Zeeb static __inline int 16066b4cac81SBjoern A. Zeeb regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy, 16076b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd) 16086b4cac81SBjoern A. Zeeb { 16096b4cac81SBjoern A. Zeeb 16106b4cac81SBjoern A. Zeeb IMPROVE(); 16116b4cac81SBjoern A. Zeeb return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd)); 16126b4cac81SBjoern A. Zeeb } 16136b4cac81SBjoern A. Zeeb 16146b4cac81SBjoern A. Zeeb static __inline int 16156b4cac81SBjoern A. Zeeb regulatory_set_wiphy_regd(struct wiphy *wiphy, 16166b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd) 16176b4cac81SBjoern A. Zeeb { 16186b4cac81SBjoern A. Zeeb 16196b4cac81SBjoern A. Zeeb IMPROVE(); 16206b4cac81SBjoern A. Zeeb if (regd == NULL) 16216b4cac81SBjoern A. Zeeb return (EINVAL); 16226b4cac81SBjoern A. Zeeb 16236b4cac81SBjoern A. Zeeb /* XXX-BZ wild guessing here based on brcmfmac. */ 16246b4cac81SBjoern A. Zeeb if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) 16256b4cac81SBjoern A. Zeeb wiphy->regd = regd; 16266b4cac81SBjoern A. Zeeb else 16276b4cac81SBjoern A. Zeeb return (EPERM); 16286b4cac81SBjoern A. Zeeb 16296b4cac81SBjoern A. Zeeb /* XXX FIXME, do we have to do anything with reg_notifier? */ 16306b4cac81SBjoern A. Zeeb return (0); 16316b4cac81SBjoern A. Zeeb } 16326b4cac81SBjoern A. Zeeb 16336b4cac81SBjoern A. Zeeb static __inline int 163451b461b3SBjoern A. Zeeb regulatory_hint(struct wiphy *wiphy, const uint8_t *alpha2) 16356b4cac81SBjoern A. Zeeb { 1636673d62fcSBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd; 1637673d62fcSBjoern A. Zeeb 1638673d62fcSBjoern A. Zeeb if (wiphy->regd != NULL) 1639673d62fcSBjoern A. Zeeb return (-EBUSY); 1640673d62fcSBjoern A. Zeeb 1641673d62fcSBjoern A. Zeeb regd = lkpi_get_linuxkpi_ieee80211_regdomain(0); 1642673d62fcSBjoern A. Zeeb if (regd == NULL) 1643673d62fcSBjoern A. Zeeb return (-ENOMEM); 1644673d62fcSBjoern A. Zeeb 1645673d62fcSBjoern A. Zeeb regd->alpha2[0] = alpha2[0]; 1646673d62fcSBjoern A. Zeeb regd->alpha2[1] = alpha2[1]; 1647673d62fcSBjoern A. Zeeb wiphy->regd = regd; 1648673d62fcSBjoern A. Zeeb 1649673d62fcSBjoern A. Zeeb IMPROVE("are there flags who is managing? update net8011?"); 1650673d62fcSBjoern A. Zeeb 1651673d62fcSBjoern A. Zeeb return (0); 16526b4cac81SBjoern A. Zeeb } 16536b4cac81SBjoern A. Zeeb 16542e183d99SBjoern A. Zeeb static __inline const char * 16552e183d99SBjoern A. Zeeb reg_initiator_name(enum nl80211_reg_initiator initiator) 16562e183d99SBjoern A. Zeeb { 16572e183d99SBjoern A. Zeeb TODO(); 16582e183d99SBjoern A. Zeeb return (NULL); 16592e183d99SBjoern A. Zeeb } 16602e183d99SBjoern A. Zeeb 16616b4cac81SBjoern A. Zeeb static __inline struct linuxkpi_ieee80211_regdomain * 16626b4cac81SBjoern A. Zeeb rtnl_dereference(const struct linuxkpi_ieee80211_regdomain *regd) 16636b4cac81SBjoern A. Zeeb { 16646b4cac81SBjoern A. Zeeb TODO(); 16656b4cac81SBjoern A. Zeeb return (NULL); 16666b4cac81SBjoern A. Zeeb } 16676b4cac81SBjoern A. Zeeb 16686b4cac81SBjoern A. Zeeb static __inline struct ieee80211_reg_rule * 16696b4cac81SBjoern A. Zeeb freq_reg_info(struct wiphy *wiphy, uint32_t center_freq) 16706b4cac81SBjoern A. Zeeb { 16716b4cac81SBjoern A. Zeeb TODO(); 16726b4cac81SBjoern A. Zeeb return (NULL); 16736b4cac81SBjoern A. Zeeb } 16746b4cac81SBjoern A. Zeeb 16756b4cac81SBjoern A. Zeeb static __inline void 16766b4cac81SBjoern A. Zeeb wiphy_apply_custom_regulatory(struct wiphy *wiphy, 16776b4cac81SBjoern A. Zeeb const struct linuxkpi_ieee80211_regdomain *regd) 16786b4cac81SBjoern A. Zeeb { 16796b4cac81SBjoern A. Zeeb TODO(); 16806b4cac81SBjoern A. Zeeb } 16816b4cac81SBjoern A. Zeeb 16826b4cac81SBjoern A. Zeeb static __inline char * 16836b4cac81SBjoern A. Zeeb wiphy_name(struct wiphy *wiphy) 16846b4cac81SBjoern A. Zeeb { 16856b4cac81SBjoern A. Zeeb if (wiphy != NULL && wiphy->dev != NULL) 16866b4cac81SBjoern A. Zeeb return dev_name(wiphy->dev); 16872e183d99SBjoern A. Zeeb else { 16882e183d99SBjoern A. Zeeb IMPROVE("wlanNA"); 16896b4cac81SBjoern A. Zeeb return ("wlanNA"); 16906b4cac81SBjoern A. Zeeb } 16912e183d99SBjoern A. Zeeb } 16926b4cac81SBjoern A. Zeeb 16936b4cac81SBjoern A. Zeeb static __inline void 16946b4cac81SBjoern A. Zeeb wiphy_read_of_freq_limits(struct wiphy *wiphy) 16956b4cac81SBjoern A. Zeeb { 16966b4cac81SBjoern A. Zeeb #ifdef FDT 16976b4cac81SBjoern A. Zeeb TODO(); 16986b4cac81SBjoern A. Zeeb #endif 16996b4cac81SBjoern A. Zeeb } 17006b4cac81SBjoern A. Zeeb 17016b4cac81SBjoern A. Zeeb static __inline void 17026b4cac81SBjoern A. Zeeb wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef) 17036b4cac81SBjoern A. Zeeb { 17046b4cac81SBjoern A. Zeeb 17056b4cac81SBjoern A. Zeeb set_bit(ef, wiphy->ext_features); 17066b4cac81SBjoern A. Zeeb } 17076b4cac81SBjoern A. Zeeb 1708*ac1d519cSBjoern A. Zeeb static inline bool 1709*ac1d519cSBjoern A. Zeeb wiphy_ext_feature_isset(struct wiphy *wiphy, enum nl80211_ext_feature ef) 1710*ac1d519cSBjoern A. Zeeb { 1711*ac1d519cSBjoern A. Zeeb return (test_bit(ef, wiphy->ext_features)); 1712*ac1d519cSBjoern A. Zeeb } 1713*ac1d519cSBjoern A. Zeeb 17146b4cac81SBjoern A. Zeeb static __inline void * 17156b4cac81SBjoern A. Zeeb wiphy_net(struct wiphy *wiphy) 17166b4cac81SBjoern A. Zeeb { 17176b4cac81SBjoern A. Zeeb TODO(); 17186b4cac81SBjoern A. Zeeb return (NULL); /* XXX passed to dev_net_set() */ 17196b4cac81SBjoern A. Zeeb } 17206b4cac81SBjoern A. Zeeb 17216b4cac81SBjoern A. Zeeb static __inline int 17226b4cac81SBjoern A. Zeeb wiphy_register(struct wiphy *wiphy) 17236b4cac81SBjoern A. Zeeb { 17246b4cac81SBjoern A. Zeeb TODO(); 17256b4cac81SBjoern A. Zeeb return (0); 17266b4cac81SBjoern A. Zeeb } 17276b4cac81SBjoern A. Zeeb 17286b4cac81SBjoern A. Zeeb static __inline void 17296b4cac81SBjoern A. Zeeb wiphy_unregister(struct wiphy *wiphy) 17306b4cac81SBjoern A. Zeeb { 17316b4cac81SBjoern A. Zeeb TODO(); 17326b4cac81SBjoern A. Zeeb } 17336b4cac81SBjoern A. Zeeb 17346b4cac81SBjoern A. Zeeb static __inline void 17356b4cac81SBjoern A. Zeeb wiphy_warn(struct wiphy *wiphy, const char *fmt, ...) 17366b4cac81SBjoern A. Zeeb { 17376b4cac81SBjoern A. Zeeb TODO(); 17386b4cac81SBjoern A. Zeeb } 17396b4cac81SBjoern A. Zeeb 17406b4cac81SBjoern A. Zeeb static __inline int 17416b4cac81SBjoern A. Zeeb cfg80211_check_combinations(struct wiphy *wiphy, 17426b4cac81SBjoern A. Zeeb struct iface_combination_params *params) 17436b4cac81SBjoern A. Zeeb { 17446b4cac81SBjoern A. Zeeb TODO(); 17456b4cac81SBjoern A. Zeeb return (-ENOENT); 17466b4cac81SBjoern A. Zeeb } 17476b4cac81SBjoern A. Zeeb 17486b4cac81SBjoern A. Zeeb static __inline uint8_t 17496b4cac81SBjoern A. Zeeb cfg80211_classify8021d(struct sk_buff *skb, void *p) 17506b4cac81SBjoern A. Zeeb { 17516b4cac81SBjoern A. Zeeb TODO(); 17526b4cac81SBjoern A. Zeeb return (0); 17536b4cac81SBjoern A. Zeeb } 17546b4cac81SBjoern A. Zeeb 17556b4cac81SBjoern A. Zeeb static __inline void 17566b4cac81SBjoern A. Zeeb cfg80211_connect_done(struct net_device *ndev, 17576b4cac81SBjoern A. Zeeb struct cfg80211_connect_resp_params *conn_params, gfp_t gfp) 17586b4cac81SBjoern A. Zeeb { 17596b4cac81SBjoern A. Zeeb TODO(); 17606b4cac81SBjoern A. Zeeb } 17616b4cac81SBjoern A. Zeeb 17626b4cac81SBjoern A. Zeeb static __inline void 17636b4cac81SBjoern A. Zeeb cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp) 17646b4cac81SBjoern A. Zeeb { 17656b4cac81SBjoern A. Zeeb TODO(); 17666b4cac81SBjoern A. Zeeb } 17676b4cac81SBjoern A. Zeeb 17686b4cac81SBjoern A. Zeeb static __inline void 17696b4cac81SBjoern A. Zeeb cfg80211_disconnected(struct net_device *ndev, uint16_t reason, 17706b4cac81SBjoern A. Zeeb void *p, int x, bool locally_generated, gfp_t gfp) 17716b4cac81SBjoern A. Zeeb { 17726b4cac81SBjoern A. Zeeb TODO(); 17736b4cac81SBjoern A. Zeeb } 17746b4cac81SBjoern A. Zeeb 17756b4cac81SBjoern A. Zeeb static __inline int 17766b4cac81SBjoern A. Zeeb cfg80211_get_p2p_attr(const u8 *ie, u32 ie_len, 17776b4cac81SBjoern A. Zeeb enum ieee80211_p2p_attr_ids attr, u8 *p, size_t p_len) 17786b4cac81SBjoern A. Zeeb { 17796b4cac81SBjoern A. Zeeb TODO(); 17806b4cac81SBjoern A. Zeeb return (-1); 17816b4cac81SBjoern A. Zeeb } 17826b4cac81SBjoern A. Zeeb 17836b4cac81SBjoern A. Zeeb static __inline void 17846b4cac81SBjoern A. Zeeb cfg80211_ibss_joined(struct net_device *ndev, const uint8_t *addr, 17856b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan, gfp_t gfp) 17866b4cac81SBjoern A. Zeeb { 17876b4cac81SBjoern A. Zeeb TODO(); 17886b4cac81SBjoern A. Zeeb } 17896b4cac81SBjoern A. Zeeb 17906b4cac81SBjoern A. Zeeb static __inline struct cfg80211_bss * 17916b4cac81SBjoern A. Zeeb cfg80211_inform_bss(struct wiphy *wiphy, 17926b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel, 17932e183d99SBjoern A. Zeeb enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x, 17946b4cac81SBjoern A. Zeeb uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, 17956b4cac81SBjoern A. Zeeb int signal, gfp_t gfp) 17966b4cac81SBjoern A. Zeeb { 17976b4cac81SBjoern A. Zeeb TODO(); 17986b4cac81SBjoern A. Zeeb return (NULL); 17996b4cac81SBjoern A. Zeeb } 18006b4cac81SBjoern A. Zeeb 18016b4cac81SBjoern A. Zeeb static __inline struct cfg80211_bss * 18026b4cac81SBjoern A. Zeeb cfg80211_inform_bss_data(struct wiphy *wiphy, 18036b4cac81SBjoern A. Zeeb struct cfg80211_inform_bss *bss_data, 18042e183d99SBjoern A. Zeeb enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x, 18056b4cac81SBjoern A. Zeeb uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, gfp_t gfp) 18066b4cac81SBjoern A. Zeeb { 18076b4cac81SBjoern A. Zeeb TODO(); 18086b4cac81SBjoern A. Zeeb return (NULL); 18096b4cac81SBjoern A. Zeeb } 18106b4cac81SBjoern A. Zeeb 18116b4cac81SBjoern A. Zeeb static __inline void 18126b4cac81SBjoern A. Zeeb cfg80211_mgmt_tx_status(struct wireless_dev *wdev, uint64_t cookie, 18136b4cac81SBjoern A. Zeeb const u8 *buf, size_t len, bool ack, gfp_t gfp) 18146b4cac81SBjoern A. Zeeb { 18156b4cac81SBjoern A. Zeeb TODO(); 18166b4cac81SBjoern A. Zeeb } 18176b4cac81SBjoern A. Zeeb 18186b4cac81SBjoern A. Zeeb static __inline void 18196b4cac81SBjoern A. Zeeb cfg80211_michael_mic_failure(struct net_device *ndev, const uint8_t *addr, 18206b4cac81SBjoern A. Zeeb enum nl80211_key_type key_type, int _x, void *p, gfp_t gfp) 18216b4cac81SBjoern A. Zeeb { 18226b4cac81SBjoern A. Zeeb TODO(); 18236b4cac81SBjoern A. Zeeb } 18246b4cac81SBjoern A. Zeeb 18256b4cac81SBjoern A. Zeeb static __inline void 18266b4cac81SBjoern A. Zeeb cfg80211_new_sta(struct net_device *ndev, const uint8_t *addr, 18276b4cac81SBjoern A. Zeeb struct station_info *sinfo, gfp_t gfp) 18286b4cac81SBjoern A. Zeeb { 18296b4cac81SBjoern A. Zeeb TODO(); 18306b4cac81SBjoern A. Zeeb } 18316b4cac81SBjoern A. Zeeb 18326b4cac81SBjoern A. Zeeb static __inline void 18336b4cac81SBjoern A. Zeeb cfg80211_del_sta(struct net_device *ndev, const uint8_t *addr, gfp_t gfp) 18346b4cac81SBjoern A. Zeeb { 18356b4cac81SBjoern A. Zeeb TODO(); 18366b4cac81SBjoern A. Zeeb } 18376b4cac81SBjoern A. Zeeb 18386b4cac81SBjoern A. Zeeb static __inline void 18396b4cac81SBjoern A. Zeeb cfg80211_port_authorized(struct net_device *ndev, const uint8_t *bssid, 18406b4cac81SBjoern A. Zeeb gfp_t gfp) 18416b4cac81SBjoern A. Zeeb { 18426b4cac81SBjoern A. Zeeb TODO(); 18436b4cac81SBjoern A. Zeeb } 18446b4cac81SBjoern A. Zeeb 18456b4cac81SBjoern A. Zeeb static __inline void 18466b4cac81SBjoern A. Zeeb cfg80211_ready_on_channel(struct wireless_dev *wdev, uint64_t cookie, 18476b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel, unsigned int duration, 18486b4cac81SBjoern A. Zeeb gfp_t gfp) 18496b4cac81SBjoern A. Zeeb { 18506b4cac81SBjoern A. Zeeb TODO(); 18516b4cac81SBjoern A. Zeeb } 18526b4cac81SBjoern A. Zeeb 18536b4cac81SBjoern A. Zeeb static __inline void 18546b4cac81SBjoern A. Zeeb cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, 18556b4cac81SBjoern A. Zeeb uint64_t cookie, struct linuxkpi_ieee80211_channel *channel, gfp_t gfp) 18566b4cac81SBjoern A. Zeeb { 18576b4cac81SBjoern A. Zeeb TODO(); 18586b4cac81SBjoern A. Zeeb } 18596b4cac81SBjoern A. Zeeb 18606b4cac81SBjoern A. Zeeb static __inline void 18616b4cac81SBjoern A. Zeeb cfg80211_report_wowlan_wakeup(void) 18626b4cac81SBjoern A. Zeeb { 18636b4cac81SBjoern A. Zeeb TODO(); 18646b4cac81SBjoern A. Zeeb } 18656b4cac81SBjoern A. Zeeb 18666b4cac81SBjoern A. Zeeb static __inline void 18676b4cac81SBjoern A. Zeeb cfg80211_roamed(struct net_device *ndev, struct cfg80211_roam_info *roam_info, 18686b4cac81SBjoern A. Zeeb gfp_t gfp) 18696b4cac81SBjoern A. Zeeb { 18706b4cac81SBjoern A. Zeeb TODO(); 18716b4cac81SBjoern A. Zeeb } 18726b4cac81SBjoern A. Zeeb 18736b4cac81SBjoern A. Zeeb static __inline void 18746b4cac81SBjoern A. Zeeb cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int _x, 18756b4cac81SBjoern A. Zeeb uint8_t *p, size_t p_len, int _x2) 18766b4cac81SBjoern A. Zeeb { 18776b4cac81SBjoern A. Zeeb TODO(); 18786b4cac81SBjoern A. Zeeb } 18796b4cac81SBjoern A. Zeeb 18806b4cac81SBjoern A. Zeeb static __inline void 18816b4cac81SBjoern A. Zeeb cfg80211_scan_done(struct cfg80211_scan_request *scan_request, 18826b4cac81SBjoern A. Zeeb struct cfg80211_scan_info *info) 18836b4cac81SBjoern A. Zeeb { 18846b4cac81SBjoern A. Zeeb TODO(); 18856b4cac81SBjoern A. Zeeb } 18866b4cac81SBjoern A. Zeeb 18876b4cac81SBjoern A. Zeeb static __inline void 18886b4cac81SBjoern A. Zeeb cfg80211_sched_scan_results(struct wiphy *wiphy, uint64_t reqid) 18896b4cac81SBjoern A. Zeeb { 18906b4cac81SBjoern A. Zeeb TODO(); 18916b4cac81SBjoern A. Zeeb } 18926b4cac81SBjoern A. Zeeb 18936b4cac81SBjoern A. Zeeb static __inline void 18946b4cac81SBjoern A. Zeeb cfg80211_sched_scan_stopped(struct wiphy *wiphy, int _x) 18956b4cac81SBjoern A. Zeeb { 18966b4cac81SBjoern A. Zeeb TODO(); 18976b4cac81SBjoern A. Zeeb } 18986b4cac81SBjoern A. Zeeb 18996b4cac81SBjoern A. Zeeb static __inline void 19006b4cac81SBjoern A. Zeeb cfg80211_unregister_wdev(struct wireless_dev *wdev) 19016b4cac81SBjoern A. Zeeb { 19026b4cac81SBjoern A. Zeeb TODO(); 19036b4cac81SBjoern A. Zeeb } 19046b4cac81SBjoern A. Zeeb 19056b4cac81SBjoern A. Zeeb static __inline struct sk_buff * 19066b4cac81SBjoern A. Zeeb cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, unsigned int len) 19076b4cac81SBjoern A. Zeeb { 19086b4cac81SBjoern A. Zeeb TODO(); 19096b4cac81SBjoern A. Zeeb return (NULL); 19106b4cac81SBjoern A. Zeeb } 19116b4cac81SBjoern A. Zeeb 19126b4cac81SBjoern A. Zeeb static __inline int 19136b4cac81SBjoern A. Zeeb cfg80211_vendor_cmd_reply(struct sk_buff *skb) 19146b4cac81SBjoern A. Zeeb { 19156b4cac81SBjoern A. Zeeb TODO(); 19166b4cac81SBjoern A. Zeeb return (-ENXIO); 19176b4cac81SBjoern A. Zeeb } 19186b4cac81SBjoern A. Zeeb 19196b4cac81SBjoern A. Zeeb static __inline struct linuxkpi_ieee80211_channel * 19206b4cac81SBjoern A. Zeeb ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) 19216b4cac81SBjoern A. Zeeb { 19222e183d99SBjoern A. Zeeb 19232e183d99SBjoern A. Zeeb return (linuxkpi_ieee80211_get_channel(wiphy, freq)); 19246b4cac81SBjoern A. Zeeb } 19256b4cac81SBjoern A. Zeeb 192633911994SBjoern A. Zeeb static inline size_t 19276b4cac81SBjoern A. Zeeb ieee80211_get_hdrlen_from_skb(struct sk_buff *skb) 19286b4cac81SBjoern A. Zeeb { 192933911994SBjoern A. Zeeb const struct ieee80211_hdr *hdr; 193033911994SBjoern A. Zeeb size_t len; 19316b4cac81SBjoern A. Zeeb 193233911994SBjoern A. Zeeb if (skb->len < 10) /* sizeof(ieee80211_frame_[ack,cts]) */ 193333911994SBjoern A. Zeeb return (0); 193433911994SBjoern A. Zeeb 193533911994SBjoern A. Zeeb hdr = (const struct ieee80211_hdr *)skb->data; 193633911994SBjoern A. Zeeb len = ieee80211_hdrlen(hdr->frame_control); 193733911994SBjoern A. Zeeb 193833911994SBjoern A. Zeeb /* If larger than what is in the skb return. */ 193933911994SBjoern A. Zeeb if (len > skb->len) 194033911994SBjoern A. Zeeb return (0); 194133911994SBjoern A. Zeeb 194233911994SBjoern A. Zeeb return (len); 19436b4cac81SBjoern A. Zeeb } 19446b4cac81SBjoern A. Zeeb 19456b4cac81SBjoern A. Zeeb static __inline bool 19466b4cac81SBjoern A. Zeeb cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel) 19476b4cac81SBjoern A. Zeeb { 19486b4cac81SBjoern A. Zeeb 19496b4cac81SBjoern A. Zeeb /* Only 6Ghz. */ 19506b4cac81SBjoern A. Zeeb if (channel->band != NL80211_BAND_6GHZ) 19516b4cac81SBjoern A. Zeeb return (false); 19526b4cac81SBjoern A. Zeeb 19536b4cac81SBjoern A. Zeeb TODO(); 19546b4cac81SBjoern A. Zeeb return (false); 19556b4cac81SBjoern A. Zeeb } 19566b4cac81SBjoern A. Zeeb 195713d87d92SBjoern A. Zeeb static inline int 19582e183d99SBjoern A. Zeeb cfg80211_get_ies_channel_number(const uint8_t *ie, size_t len, 19592e183d99SBjoern A. Zeeb enum nl80211_band band, enum cfg80211_bss_frame_type ftype) 19602e183d99SBjoern A. Zeeb { 196113d87d92SBjoern A. Zeeb const struct element *elem; 19622e183d99SBjoern A. Zeeb 196313d87d92SBjoern A. Zeeb switch (band) { 196413d87d92SBjoern A. Zeeb case NL80211_BAND_6GHZ: 19652e183d99SBjoern A. Zeeb TODO(); 196613d87d92SBjoern A. Zeeb break; 196713d87d92SBjoern A. Zeeb case NL80211_BAND_5GHZ: 196813d87d92SBjoern A. Zeeb case NL80211_BAND_2GHZ: 196913d87d92SBjoern A. Zeeb /* DSPARAMS has the channel number. */ 197013d87d92SBjoern A. Zeeb elem = cfg80211_find_elem(IEEE80211_ELEMID_DSPARMS, ie, len); 197113d87d92SBjoern A. Zeeb if (elem != NULL && elem->datalen == 1) 197213d87d92SBjoern A. Zeeb return (elem->data[0]); 197313d87d92SBjoern A. Zeeb /* HTINFO has the primary center channel. */ 197413d87d92SBjoern A. Zeeb elem = cfg80211_find_elem(IEEE80211_ELEMID_HTINFO, ie, len); 197513d87d92SBjoern A. Zeeb if (elem != NULL && 197613d87d92SBjoern A. Zeeb elem->datalen >= (sizeof(struct ieee80211_ie_htinfo) - 2)) { 197713d87d92SBjoern A. Zeeb const struct ieee80211_ie_htinfo *htinfo; 197813d87d92SBjoern A. Zeeb htinfo = (const struct ieee80211_ie_htinfo *)elem; 197913d87d92SBjoern A. Zeeb return (htinfo->hi_ctrlchannel); 198013d87d92SBjoern A. Zeeb } 198113d87d92SBjoern A. Zeeb /* What else? */ 198213d87d92SBjoern A. Zeeb break; 198313d87d92SBjoern A. Zeeb default: 198413d87d92SBjoern A. Zeeb IMPROVE("Unsupported"); 198513d87d92SBjoern A. Zeeb break; 198613d87d92SBjoern A. Zeeb } 19872e183d99SBjoern A. Zeeb return (-1); 19882e183d99SBjoern A. Zeeb } 19896b4cac81SBjoern A. Zeeb 19906b4cac81SBjoern A. Zeeb /* Used for scanning at least. */ 19916b4cac81SBjoern A. Zeeb static __inline void 19926b4cac81SBjoern A. Zeeb get_random_mask_addr(uint8_t *dst, const uint8_t *addr, const uint8_t *mask) 19936b4cac81SBjoern A. Zeeb { 19946b4cac81SBjoern A. Zeeb int i; 19956b4cac81SBjoern A. Zeeb 19966b4cac81SBjoern A. Zeeb /* Get a completely random address and then overlay what we want. */ 19976b4cac81SBjoern A. Zeeb get_random_bytes(dst, ETH_ALEN); 19986b4cac81SBjoern A. Zeeb for (i = 0; i < ETH_ALEN; i++) 19996b4cac81SBjoern A. Zeeb dst[i] = (dst[i] & ~(mask[i])) | (addr[i] & mask[i]); 20006b4cac81SBjoern A. Zeeb } 20016b4cac81SBjoern A. Zeeb 2002d875aa15SBjoern A. Zeeb static __inline void 2003d875aa15SBjoern A. Zeeb cfg80211_shutdown_all_interfaces(struct wiphy *wiphy) 2004d875aa15SBjoern A. Zeeb { 2005d875aa15SBjoern A. Zeeb TODO(); 2006d875aa15SBjoern A. Zeeb } 2007d875aa15SBjoern A. Zeeb 2008b0f73768SBjoern A. Zeeb static __inline bool 2009b0f73768SBjoern A. Zeeb cfg80211_reg_can_beacon(struct wiphy *wiphy, struct cfg80211_chan_def *chandef, 2010b0f73768SBjoern A. Zeeb enum nl80211_iftype iftype) 2011b0f73768SBjoern A. Zeeb { 2012b0f73768SBjoern A. Zeeb TODO(); 2013b0f73768SBjoern A. Zeeb return (false); 2014b0f73768SBjoern A. Zeeb } 2015b0f73768SBjoern A. Zeeb 2016b0f73768SBjoern A. Zeeb static __inline void 2017b0f73768SBjoern A. Zeeb cfg80211_background_radar_event(struct wiphy *wiphy, 2018b0f73768SBjoern A. Zeeb struct cfg80211_chan_def *chandef, gfp_t gfp) 2019b0f73768SBjoern A. Zeeb { 2020b0f73768SBjoern A. Zeeb TODO(); 2021b0f73768SBjoern A. Zeeb } 2022b0f73768SBjoern A. Zeeb 2023b0f73768SBjoern A. Zeeb static __inline const u8 * 2024adff403fSBjoern A. Zeeb cfg80211_find_ext_ie(uint8_t eid, const uint8_t *p, size_t len) 2025b0f73768SBjoern A. Zeeb { 2026b0f73768SBjoern A. Zeeb TODO(); 2027b0f73768SBjoern A. Zeeb return (NULL); 2028b0f73768SBjoern A. Zeeb } 2029b0f73768SBjoern A. Zeeb 2030b0f73768SBjoern A. Zeeb static __inline bool 2031b0f73768SBjoern A. Zeeb cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) 2032b0f73768SBjoern A. Zeeb { 2033b0f73768SBjoern A. Zeeb TODO(); 2034b0f73768SBjoern A. Zeeb return (false); 2035b0f73768SBjoern A. Zeeb } 2036b0f73768SBjoern A. Zeeb 2037*ac1d519cSBjoern A. Zeeb static __inline bool 2038*ac1d519cSBjoern A. Zeeb cfg80211_chandef_dfs_usable(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef) 2039*ac1d519cSBjoern A. Zeeb { 2040*ac1d519cSBjoern A. Zeeb TODO(); 2041*ac1d519cSBjoern A. Zeeb return (false); 2042*ac1d519cSBjoern A. Zeeb } 2043*ac1d519cSBjoern A. Zeeb 2044*ac1d519cSBjoern A. Zeeb static __inline unsigned int 2045*ac1d519cSBjoern A. Zeeb cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, const struct cfg80211_chan_def *chandef) 2046*ac1d519cSBjoern A. Zeeb { 2047*ac1d519cSBjoern A. Zeeb TODO(); 2048*ac1d519cSBjoern A. Zeeb return (0); 2049*ac1d519cSBjoern A. Zeeb } 2050*ac1d519cSBjoern A. Zeeb 2051*ac1d519cSBjoern A. Zeeb static inline void 2052*ac1d519cSBjoern A. Zeeb _ieee80211_set_sband_iftype_data(struct ieee80211_supported_band *band, 2053*ac1d519cSBjoern A. Zeeb struct ieee80211_sband_iftype_data *iftype_data, size_t nitems) 2054*ac1d519cSBjoern A. Zeeb { 2055*ac1d519cSBjoern A. Zeeb band->iftype_data = iftype_data; 2056*ac1d519cSBjoern A. Zeeb band->n_iftype_data = nitems; 2057*ac1d519cSBjoern A. Zeeb } 2058*ac1d519cSBjoern A. Zeeb 2059*ac1d519cSBjoern A. Zeeb static inline const struct ieee80211_sband_iftype_data * 2060*ac1d519cSBjoern A. Zeeb ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *band, 2061*ac1d519cSBjoern A. Zeeb enum nl80211_iftype iftype) 2062*ac1d519cSBjoern A. Zeeb { 2063*ac1d519cSBjoern A. Zeeb const struct ieee80211_sband_iftype_data *iftype_data; 2064*ac1d519cSBjoern A. Zeeb int i; 2065*ac1d519cSBjoern A. Zeeb 2066*ac1d519cSBjoern A. Zeeb for (i = 0; i < band->n_iftype_data; i++) { 2067*ac1d519cSBjoern A. Zeeb iftype_data = (const void *)&band->iftype_data[i]; 2068*ac1d519cSBjoern A. Zeeb if (iftype_data->types_mask & BIT(iftype)) 2069*ac1d519cSBjoern A. Zeeb return (iftype_data); 2070*ac1d519cSBjoern A. Zeeb } 2071*ac1d519cSBjoern A. Zeeb 2072*ac1d519cSBjoern A. Zeeb return (NULL); 2073*ac1d519cSBjoern A. Zeeb } 2074*ac1d519cSBjoern A. Zeeb 2075adff403fSBjoern A. Zeeb static __inline const struct ieee80211_sta_eht_cap * 2076adff403fSBjoern A. Zeeb ieee80211_get_eht_iftype_cap(const struct ieee80211_supported_band *band, 2077adff403fSBjoern A. Zeeb enum nl80211_iftype iftype) 2078adff403fSBjoern A. Zeeb { 2079adff403fSBjoern A. Zeeb TODO(); 2080adff403fSBjoern A. Zeeb return (NULL); 2081adff403fSBjoern A. Zeeb } 2082adff403fSBjoern A. Zeeb 2083*ac1d519cSBjoern A. Zeeb static inline bool 2084*ac1d519cSBjoern A. Zeeb cfg80211_ssid_eq(struct cfg80211_ssid *ssid1, struct cfg80211_ssid *ssid2) 2085*ac1d519cSBjoern A. Zeeb { 2086*ac1d519cSBjoern A. Zeeb int error; 2087*ac1d519cSBjoern A. Zeeb 2088*ac1d519cSBjoern A. Zeeb if (ssid1 == NULL || ssid2 == NULL) /* Can we KASSERT this? */ 2089*ac1d519cSBjoern A. Zeeb return (false); 2090*ac1d519cSBjoern A. Zeeb 2091*ac1d519cSBjoern A. Zeeb if (ssid1->ssid_len != ssid2->ssid_len) 2092*ac1d519cSBjoern A. Zeeb return (false); 2093*ac1d519cSBjoern A. Zeeb error = memcmp(ssid1->ssid, ssid2->ssid, ssid2->ssid_len); 2094*ac1d519cSBjoern A. Zeeb if (error != 0) 2095*ac1d519cSBjoern A. Zeeb return (false); 2096*ac1d519cSBjoern A. Zeeb return (true); 2097*ac1d519cSBjoern A. Zeeb } 2098*ac1d519cSBjoern A. Zeeb 2099*ac1d519cSBjoern A. Zeeb static inline void 2100*ac1d519cSBjoern A. Zeeb cfg80211_rx_unprot_mlme_mgmt(struct net_device *ndev, const uint8_t *hdr, 2101*ac1d519cSBjoern A. Zeeb uint32_t len) 2102*ac1d519cSBjoern A. Zeeb { 2103*ac1d519cSBjoern A. Zeeb TODO(); 2104*ac1d519cSBjoern A. Zeeb } 2105*ac1d519cSBjoern A. Zeeb 2106*ac1d519cSBjoern A. Zeeb static inline const struct wiphy_iftype_ext_capab * 2107*ac1d519cSBjoern A. Zeeb cfg80211_get_iftype_ext_capa(struct wiphy *wiphy, enum nl80211_iftype iftype) 2108*ac1d519cSBjoern A. Zeeb { 2109*ac1d519cSBjoern A. Zeeb 2110*ac1d519cSBjoern A. Zeeb TODO(); 2111*ac1d519cSBjoern A. Zeeb return (NULL); 2112*ac1d519cSBjoern A. Zeeb } 2113*ac1d519cSBjoern A. Zeeb 2114*ac1d519cSBjoern A. Zeeb static inline int 2115*ac1d519cSBjoern A. Zeeb nl80211_chan_width_to_mhz(enum nl80211_chan_width width) 2116*ac1d519cSBjoern A. Zeeb { 2117*ac1d519cSBjoern A. Zeeb switch (width) { 2118*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_5: 2119*ac1d519cSBjoern A. Zeeb return (5); 2120*ac1d519cSBjoern A. Zeeb break; 2121*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_10: 2122*ac1d519cSBjoern A. Zeeb return (10); 2123*ac1d519cSBjoern A. Zeeb break; 2124*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_20_NOHT: 2125*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_20: 2126*ac1d519cSBjoern A. Zeeb return (20); 2127*ac1d519cSBjoern A. Zeeb break; 2128*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_40: 2129*ac1d519cSBjoern A. Zeeb return (40); 2130*ac1d519cSBjoern A. Zeeb break; 2131*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_80: 2132*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_80P80: 2133*ac1d519cSBjoern A. Zeeb return (80); 2134*ac1d519cSBjoern A. Zeeb break; 2135*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_160: 2136*ac1d519cSBjoern A. Zeeb return (160); 2137*ac1d519cSBjoern A. Zeeb break; 2138*ac1d519cSBjoern A. Zeeb case NL80211_CHAN_WIDTH_320: 2139*ac1d519cSBjoern A. Zeeb return (320); 2140*ac1d519cSBjoern A. Zeeb break; 2141*ac1d519cSBjoern A. Zeeb } 2142*ac1d519cSBjoern A. Zeeb } 2143*ac1d519cSBjoern A. Zeeb 2144*ac1d519cSBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 2145*ac1d519cSBjoern A. Zeeb 2146*ac1d519cSBjoern A. Zeeb static inline void 2147*ac1d519cSBjoern A. Zeeb wiphy_work_init(struct wiphy_work *wwk, wiphy_work_fn fn) 2148*ac1d519cSBjoern A. Zeeb { 2149*ac1d519cSBjoern A. Zeeb INIT_LIST_HEAD(&wwk->entry); 2150*ac1d519cSBjoern A. Zeeb wwk->fn = fn; 2151*ac1d519cSBjoern A. Zeeb } 2152*ac1d519cSBjoern A. Zeeb 2153*ac1d519cSBjoern A. Zeeb static inline void 2154*ac1d519cSBjoern A. Zeeb wiphy_work_queue(struct wiphy *wiphy, struct wiphy_work *wwk) 2155*ac1d519cSBjoern A. Zeeb { 2156*ac1d519cSBjoern A. Zeeb linuxkpi_wiphy_work_queue(wiphy, wwk); 2157*ac1d519cSBjoern A. Zeeb } 2158*ac1d519cSBjoern A. Zeeb 2159*ac1d519cSBjoern A. Zeeb static inline void 2160*ac1d519cSBjoern A. Zeeb wiphy_work_cancel(struct wiphy *wiphy, struct wiphy_work *wwk) 2161*ac1d519cSBjoern A. Zeeb { 2162*ac1d519cSBjoern A. Zeeb linuxkpi_wiphy_work_cancel(wiphy, wwk); 2163*ac1d519cSBjoern A. Zeeb } 2164*ac1d519cSBjoern A. Zeeb 2165*ac1d519cSBjoern A. Zeeb static inline void 2166*ac1d519cSBjoern A. Zeeb wiphy_work_flush(struct wiphy *wiphy, struct wiphy_work *wwk) 2167*ac1d519cSBjoern A. Zeeb { 2168*ac1d519cSBjoern A. Zeeb linuxkpi_wiphy_work_flush(wiphy, wwk); 2169*ac1d519cSBjoern A. Zeeb } 2170*ac1d519cSBjoern A. Zeeb 2171*ac1d519cSBjoern A. Zeeb static inline void 2172*ac1d519cSBjoern A. Zeeb wiphy_delayed_work_init(struct wiphy_delayed_work *wdwk, wiphy_work_fn fn) 2173*ac1d519cSBjoern A. Zeeb { 2174*ac1d519cSBjoern A. Zeeb wiphy_work_init(&wdwk->work, fn); 2175*ac1d519cSBjoern A. Zeeb timer_setup(&wdwk->timer, lkpi_wiphy_delayed_work_timer, 0); 2176*ac1d519cSBjoern A. Zeeb } 2177*ac1d519cSBjoern A. Zeeb 2178*ac1d519cSBjoern A. Zeeb static inline void 2179*ac1d519cSBjoern A. Zeeb wiphy_delayed_work_queue(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk, 2180*ac1d519cSBjoern A. Zeeb unsigned long delay) 2181*ac1d519cSBjoern A. Zeeb { 2182*ac1d519cSBjoern A. Zeeb linuxkpi_wiphy_delayed_work_queue(wiphy, wdwk, delay); 2183*ac1d519cSBjoern A. Zeeb } 2184*ac1d519cSBjoern A. Zeeb 2185*ac1d519cSBjoern A. Zeeb static inline void 2186*ac1d519cSBjoern A. Zeeb wiphy_delayed_work_cancel(struct wiphy *wiphy, struct wiphy_delayed_work *wdwk) 2187*ac1d519cSBjoern A. Zeeb { 2188*ac1d519cSBjoern A. Zeeb linuxkpi_wiphy_delayed_work_cancel(wiphy, wdwk); 2189*ac1d519cSBjoern A. Zeeb } 2190*ac1d519cSBjoern A. Zeeb 2191*ac1d519cSBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 2192*ac1d519cSBjoern A. Zeeb 2193*ac1d519cSBjoern A. Zeeb #define wiphy_err(_wiphy, _fmt, ...) \ 2194*ac1d519cSBjoern A. Zeeb dev_err((_wiphy)->dev, _fmt, __VA_ARGS__) 2195b0f73768SBjoern A. Zeeb #define wiphy_info(wiphy, fmt, ...) \ 2196*ac1d519cSBjoern A. Zeeb dev_info(&(wiphy)->dev, fmt, ##__VA_ARGS__) 2197*ac1d519cSBjoern A. Zeeb #define wiphy_info_once(wiphy, fmt, ...) \ 2198*ac1d519cSBjoern A. Zeeb dev_info_once(&(wiphy)->dev, fmt, ##__VA_ARGS__) 2199b0f73768SBjoern A. Zeeb 22006b4cac81SBjoern A. Zeeb #ifndef LINUXKPI_NET80211 22016b4cac81SBjoern A. Zeeb #define ieee80211_channel linuxkpi_ieee80211_channel 22026b4cac81SBjoern A. Zeeb #define ieee80211_regdomain linuxkpi_ieee80211_regdomain 22036b4cac81SBjoern A. Zeeb #endif 22046b4cac81SBjoern A. Zeeb 2205800aa9cdSBjoern A. Zeeb #include <net/mac80211.h> 2206800aa9cdSBjoern A. Zeeb 22076b4cac81SBjoern A. Zeeb #endif /* _LINUXKPI_NET_CFG80211_H */ 2208