16b4cac81SBjoern A. Zeeb /*- 2*a3baca22SBjoern A. Zeeb * Copyright (c) 2020-2023 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 * $FreeBSD$ 306b4cac81SBjoern A. Zeeb */ 316b4cac81SBjoern A. Zeeb 326b4cac81SBjoern A. Zeeb #ifndef _LINUXKPI_NET_CFG80211_H 336b4cac81SBjoern A. Zeeb #define _LINUXKPI_NET_CFG80211_H 346b4cac81SBjoern A. Zeeb 356b4cac81SBjoern A. Zeeb #include <linux/types.h> 366b4cac81SBjoern A. Zeeb #include <linux/nl80211.h> 376b4cac81SBjoern A. Zeeb #include <linux/ieee80211.h> 386b4cac81SBjoern A. Zeeb #include <linux/if_ether.h> 392e183d99SBjoern A. Zeeb #include <linux/ethtool.h> 406b4cac81SBjoern A. Zeeb #include <linux/device.h> 416b4cac81SBjoern A. Zeeb #include <linux/netdevice.h> 426b4cac81SBjoern A. Zeeb #include <linux/random.h> 436b4cac81SBjoern A. Zeeb #include <linux/skbuff.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 54800aa9cdSBjoern A. Zeeb #define TODO(...) if (linuxkpi_debug_80211 & D80211_TODO) \ 556b4cac81SBjoern A. Zeeb printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) 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 { 756b4cac81SBjoern A. Zeeb RATE_INFO_FLAGS_SHORT_GI = BIT(0), 766b4cac81SBjoern A. Zeeb RATE_INFO_FLAGS_MCS = BIT(1), 776b4cac81SBjoern A. Zeeb RATE_INFO_FLAGS_VHT_MCS = BIT(2), 786b4cac81SBjoern A. Zeeb RATE_INFO_FLAGS_HE_MCS = BIT(3), 79800aa9cdSBjoern A. Zeeb /* Max 8 bits as used in struct rate_info. */ 806b4cac81SBjoern A. Zeeb }; 816b4cac81SBjoern A. Zeeb 826b4cac81SBjoern A. Zeeb extern const uint8_t rfc1042_header[6]; 83b0f73768SBjoern A. Zeeb extern const uint8_t bridge_tunnel_header[6]; 846b4cac81SBjoern A. Zeeb 852e183d99SBjoern A. Zeeb enum ieee80211_privacy { 862e183d99SBjoern A. Zeeb IEEE80211_PRIVACY_ANY, 872e183d99SBjoern A. Zeeb }; 882e183d99SBjoern A. Zeeb 892e183d99SBjoern A. Zeeb enum ieee80211_bss_type { 902e183d99SBjoern A. Zeeb IEEE80211_BSS_TYPE_ANY, 912e183d99SBjoern A. Zeeb }; 922e183d99SBjoern A. Zeeb 932e183d99SBjoern A. Zeeb enum cfg80211_bss_frame_type { 946b4cac81SBjoern A. Zeeb CFG80211_BSS_FTYPE_UNKNOWN, 952e183d99SBjoern A. Zeeb CFG80211_BSS_FTYPE_BEACON, 962e183d99SBjoern A. Zeeb CFG80211_BSS_FTYPE_PRESP, 976b4cac81SBjoern A. Zeeb }; 986b4cac81SBjoern A. Zeeb 996b4cac81SBjoern A. Zeeb enum ieee80211_channel_flags { 100d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_DISABLED = BIT(0), 101d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_INDOOR_ONLY = BIT(1), 102d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_IR_CONCURRENT = BIT(2), 103d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_RADAR = BIT(3), 104d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_IR = BIT(4), 105d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_HT40MINUS = BIT(5), 106d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_HT40PLUS = BIT(6), 107d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_80MHZ = BIT(7), 108d7ce88aaSBjoern A. Zeeb IEEE80211_CHAN_NO_160MHZ = BIT(8), 1092e183d99SBjoern A. Zeeb IEEE80211_CHAN_NO_OFDM = BIT(9), 1106b4cac81SBjoern A. Zeeb }; 1116b4cac81SBjoern A. Zeeb #define IEEE80211_CHAN_NO_HT40 (IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS) 1126b4cac81SBjoern A. Zeeb 1136b4cac81SBjoern A. Zeeb struct ieee80211_txrx_stypes { 1146b4cac81SBjoern A. Zeeb uint16_t tx; 1156b4cac81SBjoern A. Zeeb uint16_t rx; 1166b4cac81SBjoern A. Zeeb }; 1176b4cac81SBjoern A. Zeeb 1186b4cac81SBjoern A. Zeeb /* XXX net80211 has an ieee80211_channel as well. */ 1196b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel { 1206b4cac81SBjoern A. Zeeb /* TODO FIXME */ 1216b4cac81SBjoern A. Zeeb uint32_t hw_value; /* ic_ieee */ 1226b4cac81SBjoern A. Zeeb uint32_t center_freq; /* ic_freq */ 1236b4cac81SBjoern A. Zeeb enum ieee80211_channel_flags flags; /* ic_flags */ 1246b4cac81SBjoern A. Zeeb enum nl80211_band band; 1256b4cac81SBjoern A. Zeeb int8_t max_power; /* ic_maxpower */ 1266b4cac81SBjoern A. Zeeb bool beacon_found; 1276b4cac81SBjoern A. Zeeb int max_antenna_gain, max_reg_power; 1286b4cac81SBjoern A. Zeeb int orig_flags; 1292e183d99SBjoern A. Zeeb int dfs_cac_ms, dfs_state; 130b0f73768SBjoern A. Zeeb int orig_mpwr; 1316b4cac81SBjoern A. Zeeb }; 1326b4cac81SBjoern A. Zeeb 1336b4cac81SBjoern A. Zeeb struct cfg80211_bitrate_mask { 1346b4cac81SBjoern A. Zeeb /* TODO FIXME */ 1356b4cac81SBjoern A. Zeeb struct { 136800aa9cdSBjoern A. Zeeb uint32_t legacy; 1372e183d99SBjoern A. Zeeb uint8_t ht_mcs[IEEE80211_HT_MCS_MASK_LEN]; 138800aa9cdSBjoern A. Zeeb uint16_t vht_mcs[8]; 139800aa9cdSBjoern A. Zeeb uint16_t he_mcs[8]; 1402e183d99SBjoern A. Zeeb enum nl80211_txrate_gi gi; 141b0f73768SBjoern A. Zeeb enum nl80211_he_gi he_gi; 142800aa9cdSBjoern A. Zeeb uint8_t he_ltf; /* XXX enum? */ 1436b4cac81SBjoern A. Zeeb } control[NUM_NL80211_BANDS]; 1446b4cac81SBjoern A. Zeeb }; 1456b4cac81SBjoern A. Zeeb 146b0f73768SBjoern A. Zeeb enum rate_info_bw { 147b0f73768SBjoern A. Zeeb RATE_INFO_BW_20 = 0, 148b0f73768SBjoern A. Zeeb RATE_INFO_BW_5, 149b0f73768SBjoern A. Zeeb RATE_INFO_BW_10, 150b0f73768SBjoern A. Zeeb RATE_INFO_BW_40, 151b0f73768SBjoern A. Zeeb RATE_INFO_BW_80, 152b0f73768SBjoern A. Zeeb RATE_INFO_BW_160, 153b0f73768SBjoern A. Zeeb RATE_INFO_BW_HE_RU, 154b0f73768SBjoern A. Zeeb }; 155b0f73768SBjoern A. Zeeb 1566b4cac81SBjoern A. Zeeb struct rate_info { 157800aa9cdSBjoern A. Zeeb uint8_t flags; /* enum cfg80211_rate_info_flags */ 158800aa9cdSBjoern A. Zeeb uint8_t bw; 159800aa9cdSBjoern A. Zeeb uint16_t legacy; 160800aa9cdSBjoern A. Zeeb uint8_t mcs; 161800aa9cdSBjoern A. Zeeb uint8_t nss; 162800aa9cdSBjoern A. Zeeb uint8_t he_dcm; 163800aa9cdSBjoern A. Zeeb uint8_t he_gi; 164800aa9cdSBjoern A. Zeeb uint8_t he_ru_alloc; 1656b4cac81SBjoern A. Zeeb }; 1666b4cac81SBjoern A. Zeeb 1676b4cac81SBjoern A. Zeeb struct ieee80211_rate { 1686b4cac81SBjoern A. Zeeb /* TODO FIXME */ 1696b4cac81SBjoern A. Zeeb uint32_t bitrate; 1706b4cac81SBjoern A. Zeeb uint32_t hw_value; 1716b4cac81SBjoern A. Zeeb uint32_t hw_value_short; 1726b4cac81SBjoern A. Zeeb uint32_t flags; 1736b4cac81SBjoern A. Zeeb }; 1746b4cac81SBjoern A. Zeeb 1756b4cac81SBjoern A. Zeeb struct ieee80211_sta_ht_cap { 1766b4cac81SBjoern A. Zeeb bool ht_supported; 17705e640dcSBjoern A. Zeeb uint8_t ampdu_density; 17805e640dcSBjoern A. Zeeb uint8_t ampdu_factor; 1796b4cac81SBjoern A. Zeeb uint16_t cap; 180b0f73768SBjoern A. Zeeb struct ieee80211_mcs_info mcs; 1816b4cac81SBjoern A. Zeeb }; 1826b4cac81SBjoern A. Zeeb 1836b4cac81SBjoern A. Zeeb /* XXX net80211 calls these IEEE80211_VHTCAP_* */ 1846b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 */ 1856b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 */ 1866b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 */ 1876b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_MPDU_MASK 0x00000003 /* IEEE80211_VHTCAP_MAX_MPDU_MASK */ 1886b4cac81SBjoern A. Zeeb 1896b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) 1902e183d99SBjoern 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) 1912e183d99SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000c /* IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK */ 1926b4cac81SBjoern A. Zeeb 1936b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 /* IEEE80211_VHTCAP_RXLDPC */ 1946b4cac81SBjoern A. Zeeb 1956b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 /* IEEE80211_VHTCAP_SHORT_GI_80 */ 1966b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 /* IEEE80211_VHTCAP_SHORT_GI_160 */ 1976b4cac81SBjoern A. Zeeb 1986b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_TXSTBC 0x00000080 /* IEEE80211_VHTCAP_TXSTBC */ 1996b4cac81SBjoern A. Zeeb 2006b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 /* IEEE80211_VHTCAP_RXSTBC_1 */ 2016b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 /* IEEE80211_VHTCAP_RXSTBC_MASK */ 2026b4cac81SBjoern A. Zeeb 2036b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 /* IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE */ 2046b4cac81SBjoern A. Zeeb 2056b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 /* IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE */ 2066b4cac81SBjoern A. Zeeb 2076b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 /* IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE */ 2086b4cac81SBjoern A. Zeeb 2096b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 /* IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE */ 2106b4cac81SBjoern A. Zeeb 2116b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13 /* IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT */ 2122e183d99SBjoern A. Zeeb #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT) /* IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK */ 2136b4cac81SBjoern A. Zeeb 2146b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 /* IEEE80211_VHTCAP_HTC_VHT */ 2156b4cac81SBjoern A. Zeeb 2166b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 /* IEEE80211_VHTCAP_RX_ANTENNA_PATTERN */ 2176b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 /* IEEE80211_VHTCAP_TX_ANTENNA_PATTERN */ 2186b4cac81SBjoern A. Zeeb 2196b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 /* IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB */ 2206b4cac81SBjoern A. Zeeb 2216b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16 /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT */ 2226b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \ 2236b4cac81SBjoern A. Zeeb (7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT) /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK */ 2246b4cac81SBjoern A. Zeeb 2256b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT */ 2266b4cac81SBjoern A. Zeeb #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ 2276b4cac81SBjoern A. Zeeb (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */ 2286b4cac81SBjoern A. Zeeb 2292e183d99SBjoern A. Zeeb 2306b4cac81SBjoern A. Zeeb struct ieee80211_sta_vht_cap { 2316b4cac81SBjoern A. Zeeb /* TODO FIXME */ 2326b4cac81SBjoern A. Zeeb bool vht_supported; 2336b4cac81SBjoern A. Zeeb uint32_t cap; 234800aa9cdSBjoern A. Zeeb struct ieee80211_vht_mcs_info vht_mcs; 2356b4cac81SBjoern A. Zeeb }; 2366b4cac81SBjoern A. Zeeb 237b0f73768SBjoern A. Zeeb enum ieee80211_vht_opmode { 238b0f73768SBjoern A. Zeeb IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT = 4, 239b0f73768SBjoern A. Zeeb }; 240b0f73768SBjoern A. Zeeb 2416b4cac81SBjoern A. Zeeb struct cfg80211_connect_resp_params { 2426b4cac81SBjoern A. Zeeb /* XXX TODO */ 2436b4cac81SBjoern A. Zeeb uint8_t *bssid; 2446b4cac81SBjoern A. Zeeb const uint8_t *req_ie; 2456b4cac81SBjoern A. Zeeb const uint8_t *resp_ie; 2466b4cac81SBjoern A. Zeeb uint32_t req_ie_len; 2476b4cac81SBjoern A. Zeeb uint32_t resp_ie_len; 2486b4cac81SBjoern A. Zeeb int status; 2496b4cac81SBjoern A. Zeeb }; 2506b4cac81SBjoern A. Zeeb 2516b4cac81SBjoern A. Zeeb struct cfg80211_inform_bss { 2526b4cac81SBjoern A. Zeeb /* XXX TODO */ 2536b4cac81SBjoern A. Zeeb int boottime_ns, scan_width, signal; 2546b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan; 2556b4cac81SBjoern A. Zeeb }; 2566b4cac81SBjoern A. Zeeb 2576b4cac81SBjoern A. Zeeb struct cfg80211_roam_info { 2586b4cac81SBjoern A. Zeeb /* XXX TODO */ 2596b4cac81SBjoern A. Zeeb uint8_t *bssid; 2606b4cac81SBjoern A. Zeeb const uint8_t *req_ie; 2616b4cac81SBjoern A. Zeeb const uint8_t *resp_ie; 2626b4cac81SBjoern A. Zeeb uint32_t req_ie_len; 2636b4cac81SBjoern A. Zeeb uint32_t resp_ie_len; 2646b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel; 2656b4cac81SBjoern A. Zeeb }; 2666b4cac81SBjoern A. Zeeb 2676b4cac81SBjoern A. Zeeb struct cfg80211_bss_ies { 2686b4cac81SBjoern A. Zeeb uint8_t *data; 269*a3baca22SBjoern A. Zeeb size_t len; 2706b4cac81SBjoern A. Zeeb }; 2716b4cac81SBjoern A. Zeeb 2726b4cac81SBjoern A. Zeeb struct cfg80211_bss { 2736b4cac81SBjoern A. Zeeb /* XXX TODO */ 2746b4cac81SBjoern A. Zeeb struct cfg80211_bss_ies *ies; 2756b4cac81SBjoern A. Zeeb }; 2766b4cac81SBjoern A. Zeeb 2776b4cac81SBjoern A. Zeeb struct cfg80211_chan_def { 2786b4cac81SBjoern A. Zeeb /* XXX TODO */ 2796b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan; 2806b4cac81SBjoern A. Zeeb enum nl80211_chan_width width; 2816b4cac81SBjoern A. Zeeb uint32_t center_freq1; 2826b4cac81SBjoern A. Zeeb uint32_t center_freq2; 2836b4cac81SBjoern A. Zeeb }; 2846b4cac81SBjoern A. Zeeb 2856b4cac81SBjoern A. Zeeb struct cfg80211_ftm_responder_stats { 2866b4cac81SBjoern A. Zeeb /* XXX TODO */ 2876b4cac81SBjoern 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; 2886b4cac81SBjoern A. Zeeb }; 2896b4cac81SBjoern A. Zeeb 2906b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_capabilities { 2916b4cac81SBjoern A. Zeeb /* XXX TODO */ 2926b4cac81SBjoern A. Zeeb int max_peers, randomize_mac_addr, report_ap_tsf; 2936b4cac81SBjoern A. Zeeb struct { 2946b4cac81SBjoern 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; 2956b4cac81SBjoern A. Zeeb } ftm; 2966b4cac81SBjoern A. Zeeb }; 2976b4cac81SBjoern A. Zeeb 2986b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_request { 2996b4cac81SBjoern A. Zeeb /* XXX TODO */ 3006b4cac81SBjoern A. Zeeb int asap, burst_period, ftmr_retries, ftms_per_burst, non_trigger_based, num_bursts_exp, request_civicloc, request_lci, trigger_based; 3016b4cac81SBjoern A. Zeeb uint8_t bss_color; 3026b4cac81SBjoern A. Zeeb bool lmr_feedback; 3036b4cac81SBjoern A. Zeeb }; 3046b4cac81SBjoern A. Zeeb 3056b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request_peer { 3066b4cac81SBjoern A. Zeeb /* XXX TODO */ 3076b4cac81SBjoern A. Zeeb struct cfg80211_chan_def chandef; 3086b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_request ftm; 3096b4cac81SBjoern A. Zeeb uint8_t addr[ETH_ALEN]; 3106b4cac81SBjoern A. Zeeb int report_ap_tsf; 3116b4cac81SBjoern A. Zeeb }; 3126b4cac81SBjoern A. Zeeb 3136b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request { 3146b4cac81SBjoern A. Zeeb /* XXX TODO */ 3156b4cac81SBjoern A. Zeeb int cookie, n_peers, timeout; 3166b4cac81SBjoern A. Zeeb uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 3176b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request_peer peers[]; 3186b4cac81SBjoern A. Zeeb }; 3196b4cac81SBjoern A. Zeeb 3206b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_result { 3216b4cac81SBjoern A. Zeeb /* XXX TODO */ 3226b4cac81SBjoern A. Zeeb int burst_index, busy_retry_time, failure_reason; 3236b4cac81SBjoern 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; 3246b4cac81SBjoern A. Zeeb uint8_t *lci; 3256b4cac81SBjoern A. Zeeb uint8_t *civicloc; 3266b4cac81SBjoern A. Zeeb int lci_len; 3276b4cac81SBjoern A. Zeeb int civicloc_len; 3286b4cac81SBjoern A. Zeeb }; 3296b4cac81SBjoern A. Zeeb 3306b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_result { 3316b4cac81SBjoern A. Zeeb /* XXX TODO */ 3326b4cac81SBjoern A. Zeeb int ap_tsf, ap_tsf_valid, final, host_time, status, type; 3336b4cac81SBjoern A. Zeeb uint8_t addr[ETH_ALEN]; 3346b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_ftm_result ftm; 3356b4cac81SBjoern A. Zeeb }; 3366b4cac81SBjoern A. Zeeb 33751b461b3SBjoern A. Zeeb struct cfg80211_sar_freq_ranges { 33851b461b3SBjoern A. Zeeb uint32_t start_freq; 33951b461b3SBjoern A. Zeeb uint32_t end_freq; 34051b461b3SBjoern A. Zeeb }; 34151b461b3SBjoern A. Zeeb 34251b461b3SBjoern A. Zeeb struct cfg80211_sar_sub_specs { 34351b461b3SBjoern A. Zeeb uint32_t freq_range_index; 34451b461b3SBjoern A. Zeeb int power; 34551b461b3SBjoern A. Zeeb }; 34651b461b3SBjoern A. Zeeb 34751b461b3SBjoern A. Zeeb struct cfg80211_sar_specs { 34851b461b3SBjoern A. Zeeb enum nl80211_sar_type type; 34951b461b3SBjoern A. Zeeb uint32_t num_sub_specs; 35051b461b3SBjoern A. Zeeb struct cfg80211_sar_sub_specs sub_specs[]; 35151b461b3SBjoern A. Zeeb }; 35251b461b3SBjoern A. Zeeb 35351b461b3SBjoern A. Zeeb struct cfg80211_sar_capa { 35451b461b3SBjoern A. Zeeb enum nl80211_sar_type type; 35551b461b3SBjoern A. Zeeb uint32_t num_freq_ranges; 35651b461b3SBjoern A. Zeeb const struct cfg80211_sar_freq_ranges *freq_ranges; 35751b461b3SBjoern A. Zeeb }; 35851b461b3SBjoern A. Zeeb 3596b4cac81SBjoern A. Zeeb struct cfg80211_ssid { 3606b4cac81SBjoern A. Zeeb int ssid_len; 3616b4cac81SBjoern A. Zeeb uint8_t ssid[IEEE80211_MAX_SSID_LEN]; 3626b4cac81SBjoern A. Zeeb }; 3636b4cac81SBjoern A. Zeeb 3646b4cac81SBjoern A. Zeeb struct cfg80211_scan_6ghz_params { 3656b4cac81SBjoern A. Zeeb /* XXX TODO */ 3666b4cac81SBjoern A. Zeeb uint8_t *bssid; 3676b4cac81SBjoern A. Zeeb int channel_idx, psc_no_listen, short_ssid, short_ssid_valid, unsolicited_probe; 3686b4cac81SBjoern A. Zeeb }; 3696b4cac81SBjoern A. Zeeb 3706b4cac81SBjoern A. Zeeb struct cfg80211_match_set { 3716b4cac81SBjoern A. Zeeb uint8_t bssid[ETH_ALEN]; 3726b4cac81SBjoern A. Zeeb struct cfg80211_ssid ssid; 3736b4cac81SBjoern A. Zeeb int rssi_thold; 3746b4cac81SBjoern A. Zeeb }; 3756b4cac81SBjoern A. Zeeb 3766b4cac81SBjoern A. Zeeb struct cfg80211_scan_request { 3776b4cac81SBjoern A. Zeeb /* XXX TODO */ 3786b4cac81SBjoern A. Zeeb int duration, duration_mandatory, flags; 3796b4cac81SBjoern A. Zeeb bool no_cck; 3806b4cac81SBjoern A. Zeeb bool scan_6ghz; 3816b4cac81SBjoern A. Zeeb struct wireless_dev *wdev; 3826b4cac81SBjoern A. Zeeb struct wiphy *wiphy; 3836b4cac81SBjoern A. Zeeb int ie_len; 3846b4cac81SBjoern A. Zeeb uint8_t *ie; 3856b4cac81SBjoern A. Zeeb uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 386b0f73768SBjoern A. Zeeb uint8_t bssid[ETH_ALEN]; 3876b4cac81SBjoern A. Zeeb int n_ssids; 3886b4cac81SBjoern A. Zeeb int n_6ghz_params; 3896b4cac81SBjoern A. Zeeb int n_channels; 3906b4cac81SBjoern A. Zeeb struct cfg80211_ssid *ssids; 3916b4cac81SBjoern A. Zeeb struct cfg80211_scan_6ghz_params *scan_6ghz_params; 3926b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channels[0]; 3936b4cac81SBjoern A. Zeeb }; 3946b4cac81SBjoern A. Zeeb 3956b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_plan { 3966b4cac81SBjoern A. Zeeb /* XXX TODO */ 3976b4cac81SBjoern A. Zeeb int interval, iterations; 3986b4cac81SBjoern A. Zeeb }; 3996b4cac81SBjoern A. Zeeb 4006b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_request { 4016b4cac81SBjoern A. Zeeb /* XXX TODO */ 4026b4cac81SBjoern A. Zeeb int delay, flags; 4036b4cac81SBjoern A. Zeeb uint8_t mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN]; 4046b4cac81SBjoern A. Zeeb uint64_t reqid; 4056b4cac81SBjoern A. Zeeb int n_match_sets; 4066b4cac81SBjoern A. Zeeb int n_scan_plans; 4076b4cac81SBjoern A. Zeeb int n_ssids; 4086b4cac81SBjoern A. Zeeb int n_channels; 409b0f73768SBjoern A. Zeeb int ie_len; 410b0f73768SBjoern A. Zeeb uint8_t *ie; 4116b4cac81SBjoern A. Zeeb struct cfg80211_match_set *match_sets; 4126b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_plan *scan_plans; 4136b4cac81SBjoern A. Zeeb struct cfg80211_ssid *ssids; 4146b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channels[0]; 4156b4cac81SBjoern A. Zeeb }; 4166b4cac81SBjoern A. Zeeb 4176b4cac81SBjoern A. Zeeb struct cfg80211_scan_info { 4186b4cac81SBjoern A. Zeeb uint64_t scan_start_tsf; 4196b4cac81SBjoern A. Zeeb uint8_t tsf_bssid[ETH_ALEN]; 4206b4cac81SBjoern A. Zeeb bool aborted; 4216b4cac81SBjoern A. Zeeb }; 4226b4cac81SBjoern A. Zeeb 4236b4cac81SBjoern A. Zeeb struct cfg80211_beacon_data { 4246b4cac81SBjoern A. Zeeb /* XXX TODO */ 4256b4cac81SBjoern A. Zeeb const uint8_t *head; 4266b4cac81SBjoern A. Zeeb const uint8_t *tail; 4276b4cac81SBjoern A. Zeeb uint32_t head_len; 4286b4cac81SBjoern A. Zeeb uint32_t tail_len; 4296b4cac81SBjoern A. Zeeb const uint8_t *proberesp_ies; 4306b4cac81SBjoern A. Zeeb const uint8_t *assocresp_ies; 4316b4cac81SBjoern A. Zeeb uint32_t proberesp_ies_len; 4326b4cac81SBjoern A. Zeeb uint32_t assocresp_ies_len; 4336b4cac81SBjoern A. Zeeb }; 4346b4cac81SBjoern A. Zeeb 4356b4cac81SBjoern A. Zeeb struct cfg80211_ap_settings { 4366b4cac81SBjoern A. Zeeb /* XXX TODO */ 4376b4cac81SBjoern A. Zeeb int auth_type, beacon_interval, dtim_period, hidden_ssid, inactivity_timeout; 4386b4cac81SBjoern A. Zeeb const uint8_t *ssid; 4396b4cac81SBjoern A. Zeeb size_t ssid_len; 4406b4cac81SBjoern A. Zeeb struct cfg80211_beacon_data beacon; 4416b4cac81SBjoern A. Zeeb struct cfg80211_chan_def chandef; 4426b4cac81SBjoern A. Zeeb }; 4436b4cac81SBjoern A. Zeeb 4446b4cac81SBjoern A. Zeeb struct cfg80211_bss_selection { 4456b4cac81SBjoern A. Zeeb /* XXX TODO */ 4466b4cac81SBjoern A. Zeeb enum nl80211_bss_select_attr behaviour; 4476b4cac81SBjoern A. Zeeb union { 4486b4cac81SBjoern A. Zeeb enum nl80211_band band_pref; 4496b4cac81SBjoern A. Zeeb struct { 4506b4cac81SBjoern A. Zeeb enum nl80211_band band; 4516b4cac81SBjoern A. Zeeb uint8_t delta; 4526b4cac81SBjoern A. Zeeb } adjust; 4536b4cac81SBjoern A. Zeeb } param; 4546b4cac81SBjoern A. Zeeb }; 4556b4cac81SBjoern A. Zeeb 4566b4cac81SBjoern A. Zeeb struct cfg80211_crypto { /* XXX made up name */ 4576b4cac81SBjoern A. Zeeb /* XXX TODO */ 4586b4cac81SBjoern A. Zeeb enum nl80211_wpa_versions wpa_versions; 4596b4cac81SBjoern A. Zeeb uint32_t cipher_group; /* WLAN_CIPHER_SUITE_* */ 4606b4cac81SBjoern A. Zeeb uint32_t *akm_suites; 4616b4cac81SBjoern A. Zeeb uint32_t *ciphers_pairwise; 4626b4cac81SBjoern A. Zeeb const uint8_t *sae_pwd; 4636b4cac81SBjoern A. Zeeb const uint8_t *psk; 4646b4cac81SBjoern A. Zeeb int n_akm_suites; 4656b4cac81SBjoern A. Zeeb int n_ciphers_pairwise; 4666b4cac81SBjoern A. Zeeb int sae_pwd_len; 4676b4cac81SBjoern A. Zeeb }; 4686b4cac81SBjoern A. Zeeb 4696b4cac81SBjoern A. Zeeb struct cfg80211_connect_params { 4706b4cac81SBjoern A. Zeeb /* XXX TODO */ 4716b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel; 4726b4cac81SBjoern A. Zeeb uint8_t *bssid; 4736b4cac81SBjoern A. Zeeb const uint8_t *ie; 4746b4cac81SBjoern A. Zeeb const uint8_t *ssid; 4756b4cac81SBjoern A. Zeeb uint32_t ie_len; 4766b4cac81SBjoern A. Zeeb uint32_t ssid_len; 4776b4cac81SBjoern A. Zeeb const void *key; 4786b4cac81SBjoern A. Zeeb uint32_t key_len; 4796b4cac81SBjoern A. Zeeb int auth_type, key_idx, privacy, want_1x; 4806b4cac81SBjoern A. Zeeb struct cfg80211_bss_selection bss_select; 4816b4cac81SBjoern A. Zeeb struct cfg80211_crypto crypto; 4826b4cac81SBjoern A. Zeeb }; 4836b4cac81SBjoern A. Zeeb 4846b4cac81SBjoern A. Zeeb enum bss_param_flags { /* Used as bitflags. XXX FIXME values? */ 4856b4cac81SBjoern A. Zeeb BSS_PARAM_FLAGS_CTS_PROT = 0x01, 4866b4cac81SBjoern A. Zeeb BSS_PARAM_FLAGS_SHORT_PREAMBLE = 0x02, 4876b4cac81SBjoern A. Zeeb BSS_PARAM_FLAGS_SHORT_SLOT_TIME = 0x04, 4886b4cac81SBjoern A. Zeeb }; 4896b4cac81SBjoern A. Zeeb 4906b4cac81SBjoern A. Zeeb struct cfg80211_ibss_params { 4916b4cac81SBjoern A. Zeeb /* XXX TODO */ 4926b4cac81SBjoern A. Zeeb int basic_rates, beacon_interval; 4936b4cac81SBjoern A. Zeeb int channel_fixed, ie, ie_len, privacy; 4946b4cac81SBjoern A. Zeeb int dtim_period; 4956b4cac81SBjoern A. Zeeb uint8_t *ssid; 4966b4cac81SBjoern A. Zeeb uint8_t *bssid; 4976b4cac81SBjoern A. Zeeb int ssid_len; 4986b4cac81SBjoern A. Zeeb struct cfg80211_chan_def chandef; 4996b4cac81SBjoern A. Zeeb enum bss_param_flags flags; 5006b4cac81SBjoern A. Zeeb }; 5016b4cac81SBjoern A. Zeeb 5026b4cac81SBjoern A. Zeeb struct cfg80211_mgmt_tx_params { 5036b4cac81SBjoern A. Zeeb /* XXX TODO */ 5046b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan; 5056b4cac81SBjoern A. Zeeb const uint8_t *buf; 5066b4cac81SBjoern A. Zeeb size_t len; 5076b4cac81SBjoern A. Zeeb int wait; 5086b4cac81SBjoern A. Zeeb }; 5096b4cac81SBjoern A. Zeeb 5106b4cac81SBjoern A. Zeeb struct cfg80211_pmk_conf { 5116b4cac81SBjoern A. Zeeb /* XXX TODO */ 5126b4cac81SBjoern A. Zeeb const uint8_t *pmk; 5136b4cac81SBjoern A. Zeeb uint8_t pmk_len; 5146b4cac81SBjoern A. Zeeb }; 5156b4cac81SBjoern A. Zeeb 5166b4cac81SBjoern A. Zeeb struct cfg80211_pmksa { 5176b4cac81SBjoern A. Zeeb /* XXX TODO */ 5186b4cac81SBjoern A. Zeeb const uint8_t *bssid; 5196b4cac81SBjoern A. Zeeb const uint8_t *pmkid; 5206b4cac81SBjoern A. Zeeb }; 5216b4cac81SBjoern A. Zeeb 5226b4cac81SBjoern A. Zeeb struct station_del_parameters { 5236b4cac81SBjoern A. Zeeb /* XXX TODO */ 5246b4cac81SBjoern A. Zeeb const uint8_t *mac; 5256b4cac81SBjoern A. Zeeb uint32_t reason_code; /* elsewhere uint16_t? */ 5266b4cac81SBjoern A. Zeeb }; 5276b4cac81SBjoern A. Zeeb 5286b4cac81SBjoern A. Zeeb struct station_info { 5296b4cac81SBjoern A. Zeeb /* TODO FIXME */ 5306b4cac81SBjoern A. Zeeb int assoc_req_ies_len, connected_time; 5316b4cac81SBjoern A. Zeeb int generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets; 5326b4cac81SBjoern A. Zeeb int filled, rx_beacon, rx_beacon_signal_avg, signal_avg; 5331d70218eSBjoern A. Zeeb int rx_duration, tx_duration, tx_failed, tx_retries; 5346b4cac81SBjoern A. Zeeb 5356b4cac81SBjoern A. Zeeb int chains; 5366b4cac81SBjoern A. Zeeb uint8_t chain_signal[IEEE80211_MAX_CHAINS]; 5376b4cac81SBjoern A. Zeeb uint8_t chain_signal_avg[IEEE80211_MAX_CHAINS]; 5386b4cac81SBjoern A. Zeeb 5396b4cac81SBjoern A. Zeeb uint8_t *assoc_req_ies; 5406b4cac81SBjoern A. Zeeb struct rate_info rxrate; 5416b4cac81SBjoern A. Zeeb struct rate_info txrate; 5426b4cac81SBjoern A. Zeeb struct cfg80211_ibss_params bss_param; 5436b4cac81SBjoern A. Zeeb struct nl80211_sta_flag_update sta_flags; 5446b4cac81SBjoern A. Zeeb }; 5456b4cac81SBjoern A. Zeeb 5466b4cac81SBjoern A. Zeeb struct station_parameters { 5476b4cac81SBjoern A. Zeeb /* XXX TODO */ 5486b4cac81SBjoern A. Zeeb int sta_flags_mask, sta_flags_set; 5496b4cac81SBjoern A. Zeeb }; 5506b4cac81SBjoern A. Zeeb 5516b4cac81SBjoern A. Zeeb struct key_params { 5526b4cac81SBjoern A. Zeeb /* XXX TODO */ 5536b4cac81SBjoern A. Zeeb const uint8_t *key; 5546b4cac81SBjoern A. Zeeb const uint8_t *seq; 5556b4cac81SBjoern A. Zeeb int key_len; 5566b4cac81SBjoern A. Zeeb int seq_len; 5576b4cac81SBjoern A. Zeeb uint32_t cipher; /* WLAN_CIPHER_SUITE_* */ 5586b4cac81SBjoern A. Zeeb }; 5596b4cac81SBjoern A. Zeeb 5606b4cac81SBjoern A. Zeeb struct mgmt_frame_regs { 5616b4cac81SBjoern A. Zeeb /* XXX TODO */ 5626b4cac81SBjoern A. Zeeb int interface_stypes; 5636b4cac81SBjoern A. Zeeb }; 5646b4cac81SBjoern A. Zeeb 5656b4cac81SBjoern A. Zeeb struct vif_params { 5666b4cac81SBjoern A. Zeeb /* XXX TODO */ 5676b4cac81SBjoern A. Zeeb uint8_t macaddr[ETH_ALEN]; 5686b4cac81SBjoern A. Zeeb }; 5696b4cac81SBjoern A. Zeeb 5706b4cac81SBjoern A. Zeeb /* That the world needs so many different structs for this is amazing. */ 5716b4cac81SBjoern A. Zeeb struct mac_address { 5726b4cac81SBjoern A. Zeeb uint8_t addr[ETH_ALEN]; 5736b4cac81SBjoern A. Zeeb }; 5746b4cac81SBjoern A. Zeeb 5756b4cac81SBjoern A. Zeeb struct ieee80211_reg_rule { 5766b4cac81SBjoern A. Zeeb /* TODO FIXME */ 5776b4cac81SBjoern A. Zeeb uint32_t flags; 578f02e2115SBjoern A. Zeeb int dfs_cac_ms; 5796b4cac81SBjoern A. Zeeb struct freq_range { 5806b4cac81SBjoern A. Zeeb int start_freq_khz; 5816b4cac81SBjoern A. Zeeb int end_freq_khz; 5826b4cac81SBjoern A. Zeeb int max_bandwidth_khz; 5836b4cac81SBjoern A. Zeeb } freq_range; 5846b4cac81SBjoern A. Zeeb struct power_rule { 5856b4cac81SBjoern A. Zeeb int max_antenna_gain; 5866b4cac81SBjoern A. Zeeb int max_eirp; 5876b4cac81SBjoern A. Zeeb } power_rule; 5886b4cac81SBjoern A. Zeeb }; 5896b4cac81SBjoern A. Zeeb 5906b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain { 5916b4cac81SBjoern A. Zeeb /* TODO FIXME */ 5926b4cac81SBjoern A. Zeeb uint8_t alpha2[2]; 5932e183d99SBjoern A. Zeeb int dfs_region; 5946b4cac81SBjoern A. Zeeb int n_reg_rules; 5956b4cac81SBjoern A. Zeeb struct ieee80211_reg_rule reg_rules[]; 5966b4cac81SBjoern A. Zeeb }; 5976b4cac81SBjoern A. Zeeb 5986b4cac81SBjoern A. Zeeb /* XXX-BZ this are insensible values probably ... */ 5996b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP0_HTC_HE 0x1 6006b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP0_TWT_REQ 0x2 601b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP0_TWT_RES 0x4 6026b4cac81SBjoern A. Zeeb 6036b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION 0x1 6046b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 0x2 6056b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US 0x4 606b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK 0x8 6076b4cac81SBjoern A. Zeeb 6086b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP 0x1 6096b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_ACK_EN 0x2 6106b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_BSR 0x4 6116b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION 0x8 6126b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_BCAST_TWT 0x10 61351b461b3SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_ALL_ACK 0x20 614b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_MU_CASCADING 0x40 615b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP2_TRS 0x80 6166b4cac81SBjoern A. Zeeb 6176b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2 0x1 6186b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_OMI_CONTROL 0x2 6196b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1 0x10 62051b461b3SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2 0x20 62151b461b3SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3 0x40 62251b461b3SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK 0x70 6236b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80 624b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED 0x80 625b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP3_OFDMA_RA 0x80 6266b4cac81SBjoern A. Zeeb 6276b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU 0x1 6286b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_BQR 0x2 6296b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39 0x4 6306b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU 0x8 63151b461b3SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_OPS 0x10 632b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG 0x20 6336b4cac81SBjoern A. Zeeb 6346b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS 0x1 6356b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX 0x2 6366b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 0x4 6376b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 0x8 6386b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU 0x10 639b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX 0x20 640b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_PUNCTURED_SOUNDING 0x40 641b0f73768SBjoern A. Zeeb #define IEEE80211_HE_MAC_CAP5_SUBCHAN_SELECTIVE_TRANSMISSION 0x80 6426b4cac81SBjoern A. Zeeb 6436b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_NOT_SUPPORTED 0x0 6446b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_SUPPORT_0_7 0x1 6456b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_SUPPORT_0_9 0x2 6466b4cac81SBjoern A. Zeeb #define IEEE80211_HE_MCS_SUPPORT_0_11 0x4 6476b4cac81SBjoern A. Zeeb 6486b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS 0x01 6496b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS 0x02 6506b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START 0x04 6516b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN 0x08 6526b4cac81SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP 0x10 653b0f73768SBjoern A. Zeeb #define IEEE80211_HE_6GHZ_CAP_SM_PS 0x20 6546b4cac81SBjoern A. Zeeb 6556b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G 0x1 6566b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G 0x2 6576b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G 0x4 65851b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G 0x8 659b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G 0x10 660b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G 0x20 661b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK 0x40 6626b4cac81SBjoern A. Zeeb 6636b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A 0x1 6646b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD 0x2 6656b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS 0x4 6666b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK 0x8 66751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US 0x10 6686b4cac81SBjoern A. Zeeb 6696b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS 0x1 6706b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US 0x2 6716b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ 0x4 6726b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ 0x8 67351b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_DOPPLER_TX 0x10 674b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO 0x20 675b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO 0x40 6766b4cac81SBjoern A. Zeeb 6776b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK 0x1 6786b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM 0x2 6796b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM 0x4 6806b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 0x8 6816b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 0x10 68251b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER 0x20 68351b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM 0x40 68451b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM 0x80 685d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2 0x10 686d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU 0x20 687d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK 0x40 688d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK 0x80 689d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK 0x80 690b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK 0x80 691b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK 0x80 692b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_2 0x80 6936b4cac81SBjoern A. Zeeb 6946b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8 0x1 6956b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 0x2 6966b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE 0x4 69751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER 0x8 69851b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 0x10 699b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 0x20 700b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK 0x40 701b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK 0x80 7026b4cac81SBjoern A. Zeeb 7036b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 0x1 7046b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 0x2 70551b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK 0x4 70651b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK 0x8 70751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK 0x10 708b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK 0x20 7096b4cac81SBjoern A. Zeeb 7106b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT 0x1 7116b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB 0x2 7126b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB 0x4 71351b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB 0x8 7146b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB 0x20 71551b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU 0x40 71651b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU 0x80 71751b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE 0x80 718b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB 0x80 719b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO 0x80 7206b4cac81SBjoern A. Zeeb 7216b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI 0x1 7226b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_MAX_NC_1 0x2 7236b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_MAX_NC_2 0x4 7246b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK 0x6 7256b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR 0x8 7266b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP 0x10 7276b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ 0x20 728b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ 0x40 729b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP7_PSR_BASED_SR 0x80 7306b4cac81SBjoern A. Zeeb 7316b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU 0x1 7326b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G 0x2 7336b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU 0x4 734b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242 0x8 735b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_484 0x10 736b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_996 0x18 737b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996 0x20 738b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_MASK 0x28 739b0f73768SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI 0x40 74051b461b3SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI 0x80 7416b4cac81SBjoern A. Zeeb 742e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US 0x1 743e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US 0x2 744e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US 0x4 745e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK 0x8 746e2008091SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 0x10 747d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS 0x0 7486b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK 0x20 749d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB 0x4 750d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB 0x8 751d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU 0x10 752d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU 0x20 753d875aa15SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP9_LONGER_THAN_16_SIGB_OFDM_SYM 0x40 7546b4cac81SBjoern A. Zeeb 7556b4cac81SBjoern A. Zeeb #define IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF 0x1 7566b4cac81SBjoern A. Zeeb 7571d70218eSBjoern A. Zeeb #define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED 0x1 7581d70218eSBjoern A. Zeeb #define IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET 0x2 7591d70218eSBjoern A. Zeeb 7601d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED 0x01 7611d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED 0x02 7621d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT 0x04 7631d70218eSBjoern A. Zeeb #define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT 0x08 7641d70218eSBjoern A. Zeeb 7656b4cac81SBjoern A. Zeeb #define VENDOR_CMD_RAW_DATA (void *)(uintptr_t)(-ENOENT) 7666b4cac81SBjoern A. Zeeb 7676b4cac81SBjoern A. Zeeb struct ieee80211_he_cap_elem { 7686b4cac81SBjoern A. Zeeb u8 mac_cap_info[6]; 7696b4cac81SBjoern A. Zeeb u8 phy_cap_info[11]; 7706b4cac81SBjoern A. Zeeb } __packed; 7716b4cac81SBjoern A. Zeeb 7726b4cac81SBjoern A. Zeeb struct ieee80211_he_mcs_nss_supp { 7736b4cac81SBjoern A. Zeeb /* TODO FIXME */ 7746b4cac81SBjoern A. Zeeb uint32_t rx_mcs_80; 7756b4cac81SBjoern A. Zeeb uint32_t tx_mcs_80; 7766b4cac81SBjoern A. Zeeb uint32_t rx_mcs_160; 7776b4cac81SBjoern A. Zeeb uint32_t tx_mcs_160; 7786b4cac81SBjoern A. Zeeb uint32_t rx_mcs_80p80; 7796b4cac81SBjoern A. Zeeb uint32_t tx_mcs_80p80; 7806b4cac81SBjoern A. Zeeb }; 7816b4cac81SBjoern A. Zeeb 7826b4cac81SBjoern A. Zeeb #define IEEE80211_STA_HE_CAP_PPE_THRES_MAX 32 7836b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_cap { 7846b4cac81SBjoern A. Zeeb /* TODO FIXME */ 7856b4cac81SBjoern A. Zeeb int has_he; 7866b4cac81SBjoern A. Zeeb struct ieee80211_he_cap_elem he_cap_elem; 7876b4cac81SBjoern A. Zeeb struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp; 7886b4cac81SBjoern A. Zeeb uint8_t ppe_thres[IEEE80211_STA_HE_CAP_PPE_THRES_MAX]; 7896b4cac81SBjoern A. Zeeb }; 7906b4cac81SBjoern A. Zeeb 791b0f73768SBjoern A. Zeeb struct cfg80211_he_bss_color { 792b0f73768SBjoern A. Zeeb int color, enabled; 793b0f73768SBjoern A. Zeeb }; 794b0f73768SBjoern A. Zeeb 795b0f73768SBjoern A. Zeeb struct ieee80211_he_obss_pd { 796b0f73768SBjoern A. Zeeb bool enable; 797f02e2115SBjoern A. Zeeb uint8_t min_offset; 798f02e2115SBjoern A. Zeeb uint8_t max_offset; 799f02e2115SBjoern A. Zeeb uint8_t non_srg_max_offset; 800f02e2115SBjoern A. Zeeb uint8_t sr_ctrl; 8011d70218eSBjoern A. Zeeb uint8_t bss_color_bitmap[8]; 8021d70218eSBjoern A. Zeeb uint8_t partial_bssid_bitmap[8]; 803b0f73768SBjoern A. Zeeb }; 804b0f73768SBjoern A. Zeeb 8056b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_6ghz_capa { 8066b4cac81SBjoern A. Zeeb /* TODO FIXME */ 8076b4cac81SBjoern A. Zeeb int capa; 8086b4cac81SBjoern A. Zeeb }; 8096b4cac81SBjoern A. Zeeb 8106b4cac81SBjoern A. Zeeb struct ieee80211_sband_iftype_data { 8116b4cac81SBjoern A. Zeeb /* TODO FIXME */ 8126b4cac81SBjoern A. Zeeb enum nl80211_iftype types_mask; 8136b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_cap he_cap; 8146b4cac81SBjoern A. Zeeb struct ieee80211_sta_he_6ghz_capa he_6ghz_capa; 8156b4cac81SBjoern A. Zeeb struct { 8166b4cac81SBjoern A. Zeeb const uint8_t *data; 8176b4cac81SBjoern A. Zeeb size_t len; 8186b4cac81SBjoern A. Zeeb } vendor_elems; 8196b4cac81SBjoern A. Zeeb }; 8206b4cac81SBjoern A. Zeeb 8216b4cac81SBjoern A. Zeeb struct ieee80211_supported_band { 8226b4cac81SBjoern A. Zeeb /* TODO FIXME */ 8236b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channels; 8246b4cac81SBjoern A. Zeeb struct ieee80211_rate *bitrates; 8256b4cac81SBjoern A. Zeeb struct ieee80211_sband_iftype_data *iftype_data; 8266b4cac81SBjoern A. Zeeb int n_channels; 8276b4cac81SBjoern A. Zeeb int n_bitrates; 8286b4cac81SBjoern A. Zeeb int n_iftype_data; 8296b4cac81SBjoern A. Zeeb enum nl80211_band band; 8306b4cac81SBjoern A. Zeeb struct ieee80211_sta_ht_cap ht_cap; 8316b4cac81SBjoern A. Zeeb struct ieee80211_sta_vht_cap vht_cap; 8326b4cac81SBjoern A. Zeeb }; 8336b4cac81SBjoern A. Zeeb 8346b4cac81SBjoern A. Zeeb struct cfg80211_pkt_pattern { 8356b4cac81SBjoern A. Zeeb /* XXX TODO */ 8366b4cac81SBjoern A. Zeeb uint8_t *mask; 8376b4cac81SBjoern A. Zeeb uint8_t *pattern; 8386b4cac81SBjoern A. Zeeb int pattern_len; 8396b4cac81SBjoern A. Zeeb int pkt_offset; 8406b4cac81SBjoern A. Zeeb }; 8416b4cac81SBjoern A. Zeeb 842800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_match { 843800aa9cdSBjoern A. Zeeb /* XXX TODO */ 844800aa9cdSBjoern A. Zeeb struct cfg80211_ssid ssid; 845800aa9cdSBjoern A. Zeeb int n_channels; 846800aa9cdSBjoern A. Zeeb uint32_t channels[0]; /* freq! = ieee80211_channel_to_frequency() */ 847800aa9cdSBjoern A. Zeeb }; 848800aa9cdSBjoern A. Zeeb 849800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_info { 850800aa9cdSBjoern A. Zeeb /* XXX TODO */ 851800aa9cdSBjoern A. Zeeb int n_matches; 852800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_match *matches[0]; 853800aa9cdSBjoern A. Zeeb }; 854800aa9cdSBjoern A. Zeeb 855800aa9cdSBjoern A. Zeeb enum wiphy_wowlan_support_flags { 856800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_DISCONNECT, 857800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_GTK_REKEY_FAILURE, 858800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_MAGIC_PKT, 859800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_SUPPORTS_GTK_REKEY, 860800aa9cdSBjoern A. Zeeb WIPHY_WOWLAN_NET_DETECT, 861800aa9cdSBjoern A. Zeeb }; 862800aa9cdSBjoern A. Zeeb 863800aa9cdSBjoern A. Zeeb struct wiphy_wowlan_support { 864800aa9cdSBjoern A. Zeeb /* XXX TODO */ 865800aa9cdSBjoern A. Zeeb enum wiphy_wowlan_support_flags flags; 866800aa9cdSBjoern A. Zeeb int max_nd_match_sets, max_pkt_offset, n_patterns, pattern_max_len, pattern_min_len; 867800aa9cdSBjoern A. Zeeb }; 868800aa9cdSBjoern A. Zeeb 869800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_wakeup { 870800aa9cdSBjoern A. Zeeb /* XXX TODO */ 871800aa9cdSBjoern A. Zeeb uint16_t pattern_idx; 872800aa9cdSBjoern A. Zeeb bool disconnect; 873800aa9cdSBjoern A. Zeeb bool eap_identity_req; 874800aa9cdSBjoern A. Zeeb bool four_way_handshake; 875800aa9cdSBjoern A. Zeeb bool gtk_rekey_failure; 876800aa9cdSBjoern A. Zeeb bool magic_pkt; 877800aa9cdSBjoern A. Zeeb bool rfkill_release; 878800aa9cdSBjoern A. Zeeb bool tcp_connlost; 879800aa9cdSBjoern A. Zeeb bool tcp_nomoretokens; 880800aa9cdSBjoern A. Zeeb bool tcp_match; 881800aa9cdSBjoern A. Zeeb bool packet_80211; 882800aa9cdSBjoern A. Zeeb struct cfg80211_wowlan_nd_info *net_detect; 883800aa9cdSBjoern A. Zeeb uint8_t *packet; 884800aa9cdSBjoern A. Zeeb uint16_t packet_len; 885800aa9cdSBjoern A. Zeeb uint16_t packet_present_len; 886800aa9cdSBjoern A. Zeeb }; 887800aa9cdSBjoern A. Zeeb 8886b4cac81SBjoern A. Zeeb struct cfg80211_wowlan { 8896b4cac81SBjoern A. Zeeb /* XXX TODO */ 8906b4cac81SBjoern A. Zeeb int disconnect, gtk_rekey_failure, magic_pkt; 891800aa9cdSBjoern A. Zeeb int eap_identity_req, four_way_handshake, rfkill_release, tcp, any; 8926b4cac81SBjoern A. Zeeb int n_patterns; 8936b4cac81SBjoern A. Zeeb struct cfg80211_sched_scan_request *nd_config; 8946b4cac81SBjoern A. Zeeb struct cfg80211_pkt_pattern *patterns; 8956b4cac81SBjoern A. Zeeb }; 8966b4cac81SBjoern A. Zeeb 8976b4cac81SBjoern A. Zeeb struct cfg80211_gtk_rekey_data { 8986b4cac81SBjoern A. Zeeb /* XXX TODO */ 899800aa9cdSBjoern A. Zeeb const uint8_t *kck, *kek, *replay_ctr; 900800aa9cdSBjoern A. Zeeb uint32_t akm; 901800aa9cdSBjoern A. Zeeb uint8_t kck_len, kek_len; 9026b4cac81SBjoern A. Zeeb }; 9036b4cac81SBjoern A. Zeeb 9042e183d99SBjoern A. Zeeb struct cfg80211_tid_cfg { 9052e183d99SBjoern A. Zeeb /* XXX TODO */ 9062e183d99SBjoern A. Zeeb int mask, noack, retry_long, rtscts, tids; 9072e183d99SBjoern A. Zeeb enum nl80211_tx_rate_setting txrate_type; 9082e183d99SBjoern A. Zeeb struct cfg80211_bitrate_mask txrate_mask; 9092e183d99SBjoern A. Zeeb }; 9102e183d99SBjoern A. Zeeb 9112e183d99SBjoern A. Zeeb struct cfg80211_tid_config { 9122e183d99SBjoern A. Zeeb /* XXX TODO */ 9132e183d99SBjoern A. Zeeb int n_tid_conf; 9142e183d99SBjoern A. Zeeb struct cfg80211_tid_cfg tid_conf[0]; 9152e183d99SBjoern A. Zeeb }; 9162e183d99SBjoern A. Zeeb 9176b4cac81SBjoern A. Zeeb struct ieee80211_iface_limit { 9186b4cac81SBjoern A. Zeeb /* TODO FIXME */ 9196b4cac81SBjoern A. Zeeb int max, types; 9206b4cac81SBjoern A. Zeeb }; 9216b4cac81SBjoern A. Zeeb 9226b4cac81SBjoern A. Zeeb struct ieee80211_iface_combination { 9236b4cac81SBjoern A. Zeeb /* TODO FIXME */ 9246b4cac81SBjoern A. Zeeb const struct ieee80211_iface_limit *limits; 9256b4cac81SBjoern A. Zeeb int n_limits; 9266b4cac81SBjoern A. Zeeb int max_interfaces, num_different_channels; 9276b4cac81SBjoern A. Zeeb int beacon_int_infra_match, beacon_int_min_gcd; 928b0f73768SBjoern A. Zeeb int radar_detect_widths; 9296b4cac81SBjoern A. Zeeb }; 9306b4cac81SBjoern A. Zeeb 9316b4cac81SBjoern A. Zeeb struct iface_combination_params { 9326b4cac81SBjoern A. Zeeb int num_different_channels; 9336b4cac81SBjoern A. Zeeb int iftype_num[NUM_NL80211_IFTYPES]; 9346b4cac81SBjoern A. Zeeb }; 9356b4cac81SBjoern A. Zeeb 9366b4cac81SBjoern A. Zeeb struct regulatory_request { 9376b4cac81SBjoern A. Zeeb /* XXX TODO */ 9386b4cac81SBjoern A. Zeeb uint8_t alpha2[2]; 939*a3baca22SBjoern A. Zeeb enum environment_cap country_ie_env; 9406b4cac81SBjoern A. Zeeb int initiator, dfs_region; 9411d70218eSBjoern A. Zeeb int user_reg_hint_type; 9426b4cac81SBjoern A. Zeeb }; 9436b4cac81SBjoern A. Zeeb 9446b4cac81SBjoern A. Zeeb enum wiphy_vendor_cmd_need_flags { 9456b4cac81SBjoern A. Zeeb WIPHY_VENDOR_CMD_NEED_NETDEV = 0x01, 9466b4cac81SBjoern A. Zeeb WIPHY_VENDOR_CMD_NEED_RUNNING = 0x02, 9476b4cac81SBjoern A. Zeeb WIPHY_VENDOR_CMD_NEED_WDEV = 0x04, 9486b4cac81SBjoern A. Zeeb }; 9496b4cac81SBjoern A. Zeeb 9506b4cac81SBjoern A. Zeeb struct wiphy_vendor_command { 9516b4cac81SBjoern A. Zeeb struct { 9526b4cac81SBjoern A. Zeeb uint32_t vendor_id; 9536b4cac81SBjoern A. Zeeb uint32_t subcmd; 9546b4cac81SBjoern A. Zeeb }; 9556b4cac81SBjoern A. Zeeb uint32_t flags; 9566b4cac81SBjoern A. Zeeb void *policy; 9576b4cac81SBjoern A. Zeeb int (*doit)(struct wiphy *, struct wireless_dev *, const void *, int); 9586b4cac81SBjoern A. Zeeb }; 9596b4cac81SBjoern A. Zeeb 9606b4cac81SBjoern A. Zeeb struct wiphy_iftype_ext_capab { 9616b4cac81SBjoern A. Zeeb /* TODO FIXME */ 9626b4cac81SBjoern A. Zeeb enum nl80211_iftype iftype; 9636b4cac81SBjoern A. Zeeb const uint8_t *extended_capabilities; 9646b4cac81SBjoern A. Zeeb const uint8_t *extended_capabilities_mask; 9656b4cac81SBjoern A. Zeeb uint8_t extended_capabilities_len; 9666b4cac81SBjoern A. Zeeb 9676b4cac81SBjoern A. Zeeb }; 9686b4cac81SBjoern A. Zeeb 9692e183d99SBjoern A. Zeeb struct tid_config_support { 9702e183d99SBjoern A. Zeeb /* TODO FIXME */ 9712e183d99SBjoern A. Zeeb uint64_t vif; /* enum nl80211_tid_cfg_attr */ 9722e183d99SBjoern A. Zeeb uint64_t peer; /* enum nl80211_tid_cfg_attr */ 9732e183d99SBjoern A. Zeeb }; 9742e183d99SBjoern A. Zeeb 9756b4cac81SBjoern A. Zeeb enum cfg80211_regulatory { 9766b4cac81SBjoern A. Zeeb REGULATORY_CUSTOM_REG = BIT(0), 9776b4cac81SBjoern A. Zeeb REGULATORY_STRICT_REG = BIT(1), 9786b4cac81SBjoern A. Zeeb REGULATORY_DISABLE_BEACON_HINTS = BIT(2), 9796b4cac81SBjoern A. Zeeb REGULATORY_ENABLE_RELAX_NO_IR = BIT(3), 9806b4cac81SBjoern A. Zeeb REGULATORY_WIPHY_SELF_MANAGED = BIT(4), 9816b4cac81SBjoern A. Zeeb REGULATORY_COUNTRY_IE_IGNORE = BIT(5), 9822e183d99SBjoern A. Zeeb REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(6), 9836b4cac81SBjoern A. Zeeb }; 9846b4cac81SBjoern A. Zeeb 985b0f73768SBjoern A. Zeeb enum wiphy_flags { 986b0f73768SBjoern A. Zeeb WIPHY_FLAG_AP_UAPSD = BIT(0), 987b0f73768SBjoern A. Zeeb WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(1), 988b0f73768SBjoern A. Zeeb WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(2), 989b0f73768SBjoern A. Zeeb WIPHY_FLAG_HAVE_AP_SME = BIT(3), 990b0f73768SBjoern A. Zeeb WIPHY_FLAG_IBSS_RSN = BIT(4), 991b0f73768SBjoern A. Zeeb WIPHY_FLAG_NETNS_OK = BIT(5), 992b0f73768SBjoern A. Zeeb WIPHY_FLAG_OFFCHAN_TX = BIT(6), 993b0f73768SBjoern A. Zeeb WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(7), 994b0f73768SBjoern A. Zeeb WIPHY_FLAG_SPLIT_SCAN_6GHZ = BIT(8), 995b0f73768SBjoern A. Zeeb WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(9), 996b0f73768SBjoern A. Zeeb WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(10), 997b0f73768SBjoern A. Zeeb WIPHY_FLAG_SUPPORTS_TDLS = BIT(11), 998b0f73768SBjoern A. Zeeb WIPHY_FLAG_TDLS_EXTERNAL_SETUP = BIT(12), 999b0f73768SBjoern A. Zeeb WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = BIT(13), 1000b0f73768SBjoern A. Zeeb WIPHY_FLAG_4ADDR_AP = BIT(14), 1001b0f73768SBjoern A. Zeeb WIPHY_FLAG_4ADDR_STATION = BIT(15), 1002b0f73768SBjoern A. Zeeb }; 10036b4cac81SBjoern A. Zeeb 10046b4cac81SBjoern A. Zeeb struct wiphy { 10056b4cac81SBjoern A. Zeeb 10066b4cac81SBjoern A. Zeeb struct device *dev; 10076b4cac81SBjoern A. Zeeb struct mac_address *addresses; 10086b4cac81SBjoern A. Zeeb int n_addresses; 10096b4cac81SBjoern A. Zeeb uint32_t flags; 10106b4cac81SBjoern A. Zeeb struct ieee80211_supported_band *bands[NUM_NL80211_BANDS]; 10116b4cac81SBjoern A. Zeeb uint8_t perm_addr[ETH_ALEN]; 1012800aa9cdSBjoern A. Zeeb uint16_t max_scan_ie_len; 10136b4cac81SBjoern A. Zeeb 10146b4cac81SBjoern A. Zeeb /* XXX TODO */ 10156b4cac81SBjoern A. Zeeb const struct cfg80211_pmsr_capabilities *pmsr_capa; 101651b461b3SBjoern A. Zeeb const struct cfg80211_sar_capa *sar_capa; 10176b4cac81SBjoern A. Zeeb const struct wiphy_iftype_ext_capab *iftype_ext_capab; 10186b4cac81SBjoern A. Zeeb const struct linuxkpi_ieee80211_regdomain *regd; 10192e183d99SBjoern A. Zeeb char fw_version[ETHTOOL_FWVERS_LEN]; 10206b4cac81SBjoern A. Zeeb const struct ieee80211_iface_combination *iface_combinations; 10216b4cac81SBjoern A. Zeeb const uint32_t *cipher_suites; 10226b4cac81SBjoern A. Zeeb int n_iface_combinations; 10236b4cac81SBjoern A. Zeeb int n_cipher_suites; 10246b4cac81SBjoern A. Zeeb void(*reg_notifier)(struct wiphy *, struct regulatory_request *); 10256b4cac81SBjoern A. Zeeb enum cfg80211_regulatory regulatory_flags; 10266b4cac81SBjoern A. Zeeb int n_vendor_commands; 10276b4cac81SBjoern A. Zeeb const struct wiphy_vendor_command *vendor_commands; 10286b4cac81SBjoern A. Zeeb const struct ieee80211_txrx_stypes *mgmt_stypes; 10296b4cac81SBjoern A. Zeeb uint32_t rts_threshold; 10306b4cac81SBjoern A. Zeeb uint32_t frag_threshold; 10312e183d99SBjoern A. Zeeb struct tid_config_support tid_config_support; 1032*a3baca22SBjoern A. Zeeb uint8_t available_antennas_rx; 1033*a3baca22SBjoern A. Zeeb uint8_t available_antennas_tx; 10346b4cac81SBjoern A. Zeeb 10356b4cac81SBjoern A. Zeeb int features, hw_version; 1036800aa9cdSBjoern 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; 10376b4cac81SBjoern A. Zeeb int num_iftype_ext_capab; 10386b4cac81SBjoern A. Zeeb int max_ap_assoc_sta, probe_resp_offload, software_iftypes; 10396b4cac81SBjoern A. Zeeb int bss_select_support, max_num_pmkids, retry_long, retry_short, signal_type; 10402e183d99SBjoern A. Zeeb int max_data_retry_count; 1041d875aa15SBjoern A. Zeeb int tx_queue_len, rfkill; 1042b0f73768SBjoern A. Zeeb int mbssid_max_interfaces; 10436b4cac81SBjoern A. Zeeb 10446b4cac81SBjoern A. Zeeb unsigned long ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)]; 10456b4cac81SBjoern A. Zeeb struct dentry *debugfsdir; 10466b4cac81SBjoern A. Zeeb struct cfg80211_wowlan_support *wowlan; 10476b4cac81SBjoern A. Zeeb /* Lower layer (driver/mac80211) specific data. */ 10486b4cac81SBjoern A. Zeeb /* Must stay last. */ 10496b4cac81SBjoern A. Zeeb uint8_t priv[0] __aligned(CACHE_LINE_SIZE); 10506b4cac81SBjoern A. Zeeb }; 10516b4cac81SBjoern A. Zeeb 10526b4cac81SBjoern A. Zeeb struct wireless_dev { 10536b4cac81SBjoern A. Zeeb /* XXX TODO, like ic? */ 10546b4cac81SBjoern A. Zeeb int iftype; 10556b4cac81SBjoern A. Zeeb int address; 10566b4cac81SBjoern A. Zeeb struct net_device *netdev; 10576b4cac81SBjoern A. Zeeb struct wiphy *wiphy; 10586b4cac81SBjoern A. Zeeb }; 10596b4cac81SBjoern A. Zeeb 10606b4cac81SBjoern A. Zeeb struct cfg80211_ops { 10616b4cac81SBjoern A. Zeeb /* XXX TODO */ 10626b4cac81SBjoern A. Zeeb struct wireless_dev *(*add_virtual_intf)(struct wiphy *, const char *, unsigned char, enum nl80211_iftype, struct vif_params *); 10636b4cac81SBjoern A. Zeeb int (*del_virtual_intf)(struct wiphy *, struct wireless_dev *); 10646b4cac81SBjoern A. Zeeb s32 (*change_virtual_intf)(struct wiphy *, struct net_device *, enum nl80211_iftype, struct vif_params *); 10656b4cac81SBjoern A. Zeeb s32 (*scan)(struct wiphy *, struct cfg80211_scan_request *); 10666b4cac81SBjoern A. Zeeb s32 (*set_wiphy_params)(struct wiphy *, u32); 10676b4cac81SBjoern A. Zeeb s32 (*join_ibss)(struct wiphy *, struct net_device *, struct cfg80211_ibss_params *); 10686b4cac81SBjoern A. Zeeb s32 (*leave_ibss)(struct wiphy *, struct net_device *); 10696b4cac81SBjoern A. Zeeb s32 (*get_station)(struct wiphy *, struct net_device *, const u8 *, struct station_info *); 10706b4cac81SBjoern A. Zeeb int (*dump_station)(struct wiphy *, struct net_device *, int, u8 *, struct station_info *); 10716b4cac81SBjoern A. Zeeb s32 (*set_tx_power)(struct wiphy *, struct wireless_dev *, enum nl80211_tx_power_setting, s32); 10726b4cac81SBjoern A. Zeeb s32 (*get_tx_power)(struct wiphy *, struct wireless_dev *, s32 *); 10736b4cac81SBjoern A. Zeeb s32 (*add_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, struct key_params *); 10746b4cac81SBjoern A. Zeeb s32 (*del_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *); 10756b4cac81SBjoern A. Zeeb s32 (*get_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, void *, void(*)(void *, struct key_params *)); 10766b4cac81SBjoern A. Zeeb s32 (*set_default_key)(struct wiphy *, struct net_device *, u8, bool, bool); 10776b4cac81SBjoern A. Zeeb s32 (*set_default_mgmt_key)(struct wiphy *, struct net_device *, u8); 10786b4cac81SBjoern A. Zeeb s32 (*set_power_mgmt)(struct wiphy *, struct net_device *, bool, s32); 10796b4cac81SBjoern A. Zeeb s32 (*connect)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *); 10806b4cac81SBjoern A. Zeeb s32 (*disconnect)(struct wiphy *, struct net_device *, u16); 10816b4cac81SBjoern A. Zeeb s32 (*suspend)(struct wiphy *, struct cfg80211_wowlan *); 10826b4cac81SBjoern A. Zeeb s32 (*resume)(struct wiphy *); 10836b4cac81SBjoern A. Zeeb s32 (*set_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); 10846b4cac81SBjoern A. Zeeb s32 (*del_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); 10856b4cac81SBjoern A. Zeeb s32 (*flush_pmksa)(struct wiphy *, struct net_device *); 10866b4cac81SBjoern A. Zeeb s32 (*start_ap)(struct wiphy *, struct net_device *, struct cfg80211_ap_settings *); 10876b4cac81SBjoern A. Zeeb int (*stop_ap)(struct wiphy *, struct net_device *); 10886b4cac81SBjoern A. Zeeb s32 (*change_beacon)(struct wiphy *, struct net_device *, struct cfg80211_beacon_data *); 10896b4cac81SBjoern A. Zeeb int (*del_station)(struct wiphy *, struct net_device *, struct station_del_parameters *); 10906b4cac81SBjoern A. Zeeb int (*change_station)(struct wiphy *, struct net_device *, const u8 *, struct station_parameters *); 10916b4cac81SBjoern A. Zeeb int (*sched_scan_start)(struct wiphy *, struct net_device *, struct cfg80211_sched_scan_request *); 10926b4cac81SBjoern A. Zeeb int (*sched_scan_stop)(struct wiphy *, struct net_device *, u64); 10936b4cac81SBjoern A. Zeeb void (*update_mgmt_frame_registrations)(struct wiphy *, struct wireless_dev *, struct mgmt_frame_regs *); 10946b4cac81SBjoern A. Zeeb int (*mgmt_tx)(struct wiphy *, struct wireless_dev *, struct cfg80211_mgmt_tx_params *, u64 *); 10956b4cac81SBjoern A. Zeeb int (*cancel_remain_on_channel)(struct wiphy *, struct wireless_dev *, u64); 10966b4cac81SBjoern A. Zeeb int (*get_channel)(struct wiphy *, struct wireless_dev *, struct cfg80211_chan_def *); 10976b4cac81SBjoern A. Zeeb int (*crit_proto_start)(struct wiphy *, struct wireless_dev *, enum nl80211_crit_proto_id, u16); 10986b4cac81SBjoern A. Zeeb void (*crit_proto_stop)(struct wiphy *, struct wireless_dev *); 10996b4cac81SBjoern A. Zeeb int (*tdls_oper)(struct wiphy *, struct net_device *, const u8 *, enum nl80211_tdls_operation); 11006b4cac81SBjoern A. Zeeb int (*update_connect_params)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *, u32); 11016b4cac81SBjoern A. Zeeb int (*set_pmk)(struct wiphy *, struct net_device *, const struct cfg80211_pmk_conf *); 11026b4cac81SBjoern A. Zeeb int (*del_pmk)(struct wiphy *, struct net_device *, const u8 *); 11036b4cac81SBjoern A. Zeeb int (*remain_on_channel)(struct wiphy *, struct wireless_dev *, struct linuxkpi_ieee80211_channel *, unsigned int, u64 *); 11046b4cac81SBjoern A. Zeeb int (*start_p2p_device)(struct wiphy *, struct wireless_dev *); 11056b4cac81SBjoern A. Zeeb void (*stop_p2p_device)(struct wiphy *, struct wireless_dev *); 11066b4cac81SBjoern A. Zeeb }; 11076b4cac81SBjoern A. Zeeb 11086b4cac81SBjoern A. Zeeb 11096b4cac81SBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 11106b4cac81SBjoern A. Zeeb 11116b4cac81SBjoern A. Zeeb /* linux_80211.c */ 11126b4cac81SBjoern A. Zeeb 11136b4cac81SBjoern A. Zeeb struct wiphy *linuxkpi_wiphy_new(const struct cfg80211_ops *, size_t); 11146b4cac81SBjoern A. Zeeb void linuxkpi_wiphy_free(struct wiphy *wiphy); 11156b4cac81SBjoern A. Zeeb 11166b4cac81SBjoern A. Zeeb int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, 11176b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd); 11186b4cac81SBjoern A. Zeeb uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band); 11196b4cac81SBjoern A. Zeeb uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t); 11202e183d99SBjoern A. Zeeb struct linuxkpi_ieee80211_channel * 11212e183d99SBjoern A. Zeeb linuxkpi_ieee80211_get_channel(struct wiphy *, uint32_t); 11225edde07cSBjoern A. Zeeb struct cfg80211_bss *linuxkpi_cfg80211_get_bss(struct wiphy *, 11235edde07cSBjoern A. Zeeb struct linuxkpi_ieee80211_channel *, const uint8_t *, 11245edde07cSBjoern A. Zeeb const uint8_t *, size_t, enum ieee80211_bss_type, enum ieee80211_privacy); 11255edde07cSBjoern A. Zeeb void linuxkpi_cfg80211_put_bss(struct wiphy *, struct cfg80211_bss *); 1126b0f73768SBjoern A. Zeeb void linuxkpi_cfg80211_bss_flush(struct wiphy *); 11276b4cac81SBjoern A. Zeeb 11286b4cac81SBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 11296b4cac81SBjoern A. Zeeb 11306b4cac81SBjoern A. Zeeb static __inline struct wiphy * 11316b4cac81SBjoern A. Zeeb wiphy_new(const struct cfg80211_ops *ops, size_t priv_len) 11326b4cac81SBjoern A. Zeeb { 11336b4cac81SBjoern A. Zeeb 11346b4cac81SBjoern A. Zeeb return (linuxkpi_wiphy_new(ops, priv_len)); 11356b4cac81SBjoern A. Zeeb } 11366b4cac81SBjoern A. Zeeb 11376b4cac81SBjoern A. Zeeb static __inline void 11386b4cac81SBjoern A. Zeeb wiphy_free(struct wiphy *wiphy) 11396b4cac81SBjoern A. Zeeb { 11406b4cac81SBjoern A. Zeeb 11416b4cac81SBjoern A. Zeeb linuxkpi_wiphy_free(wiphy); 11426b4cac81SBjoern A. Zeeb } 11436b4cac81SBjoern A. Zeeb 11446b4cac81SBjoern A. Zeeb static __inline void * 11456b4cac81SBjoern A. Zeeb wiphy_priv(struct wiphy *wiphy) 11466b4cac81SBjoern A. Zeeb { 11476b4cac81SBjoern A. Zeeb 11486b4cac81SBjoern A. Zeeb return (wiphy->priv); 11496b4cac81SBjoern A. Zeeb } 11506b4cac81SBjoern A. Zeeb 11516b4cac81SBjoern A. Zeeb static __inline void 11526b4cac81SBjoern A. Zeeb set_wiphy_dev(struct wiphy *wiphy, struct device *dev) 11536b4cac81SBjoern A. Zeeb { 11546b4cac81SBjoern A. Zeeb 11556b4cac81SBjoern A. Zeeb wiphy->dev = dev; 11566b4cac81SBjoern A. Zeeb } 11576b4cac81SBjoern A. Zeeb 11586b4cac81SBjoern A. Zeeb static __inline struct device * 11596b4cac81SBjoern A. Zeeb wiphy_dev(struct wiphy *wiphy) 11606b4cac81SBjoern A. Zeeb { 11616b4cac81SBjoern A. Zeeb 11626b4cac81SBjoern A. Zeeb return (wiphy->dev); 11636b4cac81SBjoern A. Zeeb } 11646b4cac81SBjoern A. Zeeb 11656b4cac81SBjoern A. Zeeb #define wiphy_err(_wiphy, _fmt, ...) \ 11666b4cac81SBjoern A. Zeeb dev_err((_wiphy)->dev, _fmt, __VA_ARGS__) 11676b4cac81SBjoern A. Zeeb 11686b4cac81SBjoern A. Zeeb static __inline const struct linuxkpi_ieee80211_regdomain * 11696b4cac81SBjoern A. Zeeb wiphy_dereference(struct wiphy *wiphy, 11706b4cac81SBjoern A. Zeeb const struct linuxkpi_ieee80211_regdomain *regd) 11716b4cac81SBjoern A. Zeeb { 11726b4cac81SBjoern A. Zeeb TODO(); 11736b4cac81SBjoern A. Zeeb return (NULL); 11746b4cac81SBjoern A. Zeeb } 11756b4cac81SBjoern A. Zeeb 1176d875aa15SBjoern A. Zeeb static __inline void 1177d875aa15SBjoern A. Zeeb wiphy_lock(struct wiphy *wiphy) 1178d875aa15SBjoern A. Zeeb { 1179d875aa15SBjoern A. Zeeb TODO(); 1180d875aa15SBjoern A. Zeeb } 1181d875aa15SBjoern A. Zeeb 1182d875aa15SBjoern A. Zeeb static __inline void 1183d875aa15SBjoern A. Zeeb wiphy_unlock(struct wiphy *wiphy) 1184d875aa15SBjoern A. Zeeb { 1185d875aa15SBjoern A. Zeeb TODO(); 1186d875aa15SBjoern A. Zeeb } 1187d875aa15SBjoern A. Zeeb 1188d875aa15SBjoern A. Zeeb static __inline void 1189d875aa15SBjoern A. Zeeb wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked, 1190d875aa15SBjoern A. Zeeb enum rfkill_hard_block_reasons reason) 1191d875aa15SBjoern A. Zeeb { 1192d875aa15SBjoern A. Zeeb TODO(); 1193d875aa15SBjoern A. Zeeb } 1194d875aa15SBjoern A. Zeeb 11956b4cac81SBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 11966b4cac81SBjoern A. Zeeb 11975edde07cSBjoern A. Zeeb static inline struct cfg80211_bss * 11985edde07cSBjoern A. Zeeb cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan, 11995edde07cSBjoern A. Zeeb const uint8_t *bssid, const uint8_t *ssid, size_t ssid_len, 12005edde07cSBjoern A. Zeeb enum ieee80211_bss_type bss_type, enum ieee80211_privacy privacy) 12015edde07cSBjoern A. Zeeb { 12025edde07cSBjoern A. Zeeb 12035edde07cSBjoern A. Zeeb return (linuxkpi_cfg80211_get_bss(wiphy, chan, bssid, ssid, ssid_len, 12045edde07cSBjoern A. Zeeb bss_type, privacy)); 12055edde07cSBjoern A. Zeeb } 12065edde07cSBjoern A. Zeeb 12075edde07cSBjoern A. Zeeb static inline void 12085edde07cSBjoern A. Zeeb cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss) 12095edde07cSBjoern A. Zeeb { 12105edde07cSBjoern A. Zeeb 12115edde07cSBjoern A. Zeeb linuxkpi_cfg80211_put_bss(wiphy, bss); 12125edde07cSBjoern A. Zeeb } 12135edde07cSBjoern A. Zeeb 12145edde07cSBjoern A. Zeeb static inline void 12155edde07cSBjoern A. Zeeb cfg80211_bss_flush(struct wiphy *wiphy) 12165edde07cSBjoern A. Zeeb { 12175edde07cSBjoern A. Zeeb 12185edde07cSBjoern A. Zeeb linuxkpi_cfg80211_bss_flush(wiphy); 12195edde07cSBjoern A. Zeeb } 12205edde07cSBjoern A. Zeeb 12215edde07cSBjoern A. Zeeb /* -------------------------------------------------------------------------- */ 12225edde07cSBjoern A. Zeeb 1223d875aa15SBjoern A. Zeeb static __inline bool 1224d875aa15SBjoern A. Zeeb rfkill_blocked(int rfkill) /* argument type? */ 1225d875aa15SBjoern A. Zeeb { 1226d875aa15SBjoern A. Zeeb TODO(); 1227d875aa15SBjoern A. Zeeb return (false); 1228d875aa15SBjoern A. Zeeb } 1229d875aa15SBjoern A. Zeeb 123005d6f4d6SBjoern A. Zeeb static __inline bool 123105d6f4d6SBjoern A. Zeeb rfkill_soft_blocked(int rfkill) 123205d6f4d6SBjoern A. Zeeb { 123305d6f4d6SBjoern A. Zeeb TODO(); 123405d6f4d6SBjoern A. Zeeb return (false); 123505d6f4d6SBjoern A. Zeeb } 123605d6f4d6SBjoern A. Zeeb 12376b4cac81SBjoern A. Zeeb static __inline int 12386b4cac81SBjoern A. Zeeb reg_query_regdb_wmm(uint8_t *alpha2, uint32_t center_freq, 12396b4cac81SBjoern A. Zeeb struct ieee80211_reg_rule *rule) 12406b4cac81SBjoern A. Zeeb { 12416b4cac81SBjoern A. Zeeb 12426b4cac81SBjoern A. Zeeb /* ETSI has special rules. FreeBSD regdb needs to learn about them. */ 12436b4cac81SBjoern A. Zeeb TODO(); 12446b4cac81SBjoern A. Zeeb 12456b4cac81SBjoern A. Zeeb return (-ENXIO); 12466b4cac81SBjoern A. Zeeb } 12476b4cac81SBjoern A. Zeeb 12486b4cac81SBjoern A. Zeeb static __inline const u8 * 12496b4cac81SBjoern A. Zeeb cfg80211_find_ie_match(uint32_t f, const u8 *ies, size_t ies_len, 12506b4cac81SBjoern A. Zeeb const u8 *match, int x, int y) 12516b4cac81SBjoern A. Zeeb { 12526b4cac81SBjoern A. Zeeb TODO(); 12536b4cac81SBjoern A. Zeeb return (NULL); 12546b4cac81SBjoern A. Zeeb } 12556b4cac81SBjoern A. Zeeb 12566b4cac81SBjoern A. Zeeb static __inline const u8 * 1257b0f73768SBjoern A. Zeeb cfg80211_find_ie(uint8_t eid, const uint8_t *ie, uint32_t ielen) 12586b4cac81SBjoern A. Zeeb { 12596b4cac81SBjoern A. Zeeb TODO(); 12606b4cac81SBjoern A. Zeeb return (NULL); 12616b4cac81SBjoern A. Zeeb } 12626b4cac81SBjoern A. Zeeb 12636b4cac81SBjoern A. Zeeb static __inline void 12646b4cac81SBjoern A. Zeeb cfg80211_pmsr_complete(struct wireless_dev *wdev, 12656b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request *req, gfp_t gfp) 12666b4cac81SBjoern A. Zeeb { 12676b4cac81SBjoern A. Zeeb TODO(); 12686b4cac81SBjoern A. Zeeb } 12696b4cac81SBjoern A. Zeeb 12706b4cac81SBjoern A. Zeeb static __inline void 12716b4cac81SBjoern A. Zeeb cfg80211_pmsr_report(struct wireless_dev *wdev, 12726b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_request *req, 12736b4cac81SBjoern A. Zeeb struct cfg80211_pmsr_result *result, gfp_t gfp) 12746b4cac81SBjoern A. Zeeb { 12756b4cac81SBjoern A. Zeeb TODO(); 12766b4cac81SBjoern A. Zeeb } 12776b4cac81SBjoern A. Zeeb 12786b4cac81SBjoern A. Zeeb static __inline void 12796b4cac81SBjoern A. Zeeb cfg80211_chandef_create(struct cfg80211_chan_def *chandef, 12806b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan, enum nl80211_chan_flags chan_flag) 12816b4cac81SBjoern A. Zeeb { 12826b4cac81SBjoern A. Zeeb 12836b4cac81SBjoern A. Zeeb KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__)); 12846b4cac81SBjoern A. Zeeb KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__)); 12856b4cac81SBjoern A. Zeeb 12864a07abdeSBjoern A. Zeeb memset(chandef, 0, sizeof(*chandef)); 12876b4cac81SBjoern A. Zeeb chandef->chan = chan; 12886b4cac81SBjoern A. Zeeb chandef->center_freq2 = 0; /* Set here and only overwrite if needed. */ 12896b4cac81SBjoern A. Zeeb 12906b4cac81SBjoern A. Zeeb switch (chan_flag) { 12916b4cac81SBjoern A. Zeeb case NL80211_CHAN_NO_HT: 12926b4cac81SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_20_NOHT; 12936b4cac81SBjoern A. Zeeb chandef->center_freq1 = chan->center_freq; 12946b4cac81SBjoern A. Zeeb break; 12956b4cac81SBjoern A. Zeeb default: 1296800aa9cdSBjoern A. Zeeb IMPROVE("Also depends on our manual settings"); 1297b0f73768SBjoern A. Zeeb if (chan->flags & IEEE80211_CHAN_NO_HT40) 12986b4cac81SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_20; 1299b0f73768SBjoern A. Zeeb else if (chan->flags & IEEE80211_CHAN_NO_80MHZ) 1300b0f73768SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_40; 1301b0f73768SBjoern A. Zeeb else if (chan->flags & IEEE80211_CHAN_NO_160MHZ) 1302b0f73768SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_80; 1303b0f73768SBjoern A. Zeeb else { 1304b0f73768SBjoern A. Zeeb chandef->width = NL80211_CHAN_WIDTH_160; 1305b0f73768SBjoern A. Zeeb IMPROVE("80P80 and 320 ..."); 1306b0f73768SBjoern A. Zeeb } 13076b4cac81SBjoern A. Zeeb chandef->center_freq1 = chan->center_freq; 13086b4cac81SBjoern A. Zeeb break; 13096b4cac81SBjoern A. Zeeb }; 13106b4cac81SBjoern A. Zeeb } 13116b4cac81SBjoern A. Zeeb 13126b4cac81SBjoern A. Zeeb static __inline void 13136b4cac81SBjoern A. Zeeb cfg80211_bss_iter(struct wiphy *wiphy, struct cfg80211_chan_def *chandef, 13146b4cac81SBjoern A. Zeeb void (*iterfunc)(struct wiphy *, struct cfg80211_bss *, void *), void *data) 13156b4cac81SBjoern A. Zeeb { 13166b4cac81SBjoern A. Zeeb TODO(); 13176b4cac81SBjoern A. Zeeb } 13186b4cac81SBjoern A. Zeeb 13196b4cac81SBjoern A. Zeeb struct element { 13206b4cac81SBjoern A. Zeeb uint8_t id; 13216b4cac81SBjoern A. Zeeb uint8_t datalen; 13226b4cac81SBjoern A. Zeeb uint8_t data[0]; 1323b0f73768SBjoern A. Zeeb } __packed; 13246b4cac81SBjoern A. Zeeb 13255db817d8SBjoern A. Zeeb static inline const struct element * 13265db817d8SBjoern A. Zeeb lkpi_cfg80211_find_elem_pattern(enum ieee80211_eid eid, 13275db817d8SBjoern A. Zeeb const uint8_t *data, size_t len, uint8_t *pattern, size_t plen) 13286b4cac81SBjoern A. Zeeb { 13295db817d8SBjoern A. Zeeb const struct element *elem; 13305db817d8SBjoern A. Zeeb const uint8_t *p; 13315db817d8SBjoern A. Zeeb size_t ielen; 13325db817d8SBjoern A. Zeeb 13335db817d8SBjoern A. Zeeb p = data; 13345db817d8SBjoern A. Zeeb elem = (const struct element *)p; 13355db817d8SBjoern A. Zeeb ielen = len; 13365db817d8SBjoern A. Zeeb while (elem != NULL && ielen > 1) { 13375db817d8SBjoern A. Zeeb if ((2 + elem->datalen) > ielen) 13385db817d8SBjoern A. Zeeb /* Element overruns our memory. */ 13396b4cac81SBjoern A. Zeeb return (NULL); 13405db817d8SBjoern A. Zeeb if (elem->id == eid) { 13415db817d8SBjoern A. Zeeb if (pattern == NULL) 13425db817d8SBjoern A. Zeeb return (elem); 13435db817d8SBjoern A. Zeeb if (elem->datalen >= plen && 13445db817d8SBjoern A. Zeeb memcmp(elem->data, pattern, plen) == 0) 13455db817d8SBjoern A. Zeeb return (elem); 13465db817d8SBjoern A. Zeeb } 13475db817d8SBjoern A. Zeeb ielen -= 2 + elem->datalen; 13485db817d8SBjoern A. Zeeb p += 2 + elem->datalen; 13495db817d8SBjoern A. Zeeb elem = (const struct element *)p; 13505db817d8SBjoern A. Zeeb } 13515db817d8SBjoern A. Zeeb 13525db817d8SBjoern A. Zeeb return (NULL); 13535db817d8SBjoern A. Zeeb } 13545db817d8SBjoern A. Zeeb 13555db817d8SBjoern A. Zeeb static inline const struct element * 13565db817d8SBjoern A. Zeeb cfg80211_find_elem(enum ieee80211_eid eid, const uint8_t *data, size_t len) 13575db817d8SBjoern A. Zeeb { 13585db817d8SBjoern A. Zeeb 13595db817d8SBjoern A. Zeeb return (lkpi_cfg80211_find_elem_pattern(eid, data, len, NULL, 0)); 13605db817d8SBjoern A. Zeeb } 13615db817d8SBjoern A. Zeeb 13625db817d8SBjoern A. Zeeb static inline const struct element * 13635db817d8SBjoern A. Zeeb ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid) 13645db817d8SBjoern A. Zeeb { 13655db817d8SBjoern A. Zeeb 13665db817d8SBjoern A. Zeeb if (bss->ies == NULL) 13675db817d8SBjoern A. Zeeb return (NULL); 13685db817d8SBjoern A. Zeeb return (cfg80211_find_elem(eid, bss->ies->data, bss->ies->len)); 13695db817d8SBjoern A. Zeeb } 13705db817d8SBjoern A. Zeeb 13715db817d8SBjoern A. Zeeb static inline const uint8_t * 13725db817d8SBjoern A. Zeeb ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid) 13735db817d8SBjoern A. Zeeb { 13745db817d8SBjoern A. Zeeb 13755db817d8SBjoern A. Zeeb return ((const uint8_t *)ieee80211_bss_get_elem(bss, eid)); 13765db817d8SBjoern A. Zeeb } 13775db817d8SBjoern A. Zeeb 13785db817d8SBjoern A. Zeeb static inline uint8_t * 13795db817d8SBjoern A. Zeeb cfg80211_find_vendor_ie(unsigned int oui, int oui_type, 13805db817d8SBjoern A. Zeeb uint8_t *data, size_t len) 13815db817d8SBjoern A. Zeeb { 13825db817d8SBjoern A. Zeeb const struct element *elem; 13835db817d8SBjoern A. Zeeb uint8_t pattern[4] = { oui << 16, oui << 8, oui, oui_type }; 13845db817d8SBjoern A. Zeeb uint8_t plen = 4; /* >= 3? oui_type always part of this? */ 13855db817d8SBjoern A. Zeeb IMPROVE("plen currently always incl. oui_type"); 13865db817d8SBjoern A. Zeeb 13875db817d8SBjoern A. Zeeb elem = lkpi_cfg80211_find_elem_pattern(IEEE80211_ELEMID_VENDOR, 13885db817d8SBjoern A. Zeeb data, len, pattern, plen); 13895db817d8SBjoern A. Zeeb if (elem == NULL) 13905db817d8SBjoern A. Zeeb return (NULL); 13915db817d8SBjoern A. Zeeb return (__DECONST(uint8_t *, elem)); 13926b4cac81SBjoern A. Zeeb } 13936b4cac81SBjoern A. Zeeb 13946b4cac81SBjoern A. Zeeb static __inline uint32_t 13956b4cac81SBjoern A. Zeeb cfg80211_calculate_bitrate(struct rate_info *rate) 13966b4cac81SBjoern A. Zeeb { 13976b4cac81SBjoern A. Zeeb TODO(); 13986b4cac81SBjoern A. Zeeb return (-1); 13996b4cac81SBjoern A. Zeeb } 14006b4cac81SBjoern A. Zeeb 14016b4cac81SBjoern A. Zeeb static __inline uint32_t 14026b4cac81SBjoern A. Zeeb ieee80211_channel_to_frequency(uint32_t channel, enum nl80211_band band) 14036b4cac81SBjoern A. Zeeb { 14046b4cac81SBjoern A. Zeeb 14056b4cac81SBjoern A. Zeeb return (linuxkpi_ieee80211_channel_to_frequency(channel, band)); 14066b4cac81SBjoern A. Zeeb } 14076b4cac81SBjoern A. Zeeb 14086b4cac81SBjoern A. Zeeb static __inline uint32_t 14096b4cac81SBjoern A. Zeeb ieee80211_frequency_to_channel(uint32_t freq) 14106b4cac81SBjoern A. Zeeb { 14116b4cac81SBjoern A. Zeeb 14126b4cac81SBjoern A. Zeeb return (linuxkpi_ieee80211_frequency_to_channel(freq, 0)); 14136b4cac81SBjoern A. Zeeb } 14146b4cac81SBjoern A. Zeeb 14156b4cac81SBjoern A. Zeeb static __inline int 14166b4cac81SBjoern A. Zeeb regulatory_set_wiphy_regd_sync(struct wiphy *wiphy, 14176b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd) 14186b4cac81SBjoern A. Zeeb { 14196b4cac81SBjoern A. Zeeb IMPROVE(); 14206b4cac81SBjoern A. Zeeb return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd)); 14216b4cac81SBjoern A. Zeeb } 14226b4cac81SBjoern A. Zeeb 14236b4cac81SBjoern A. Zeeb static __inline int 14246b4cac81SBjoern A. Zeeb regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy, 14256b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd) 14266b4cac81SBjoern A. Zeeb { 14276b4cac81SBjoern A. Zeeb 14286b4cac81SBjoern A. Zeeb IMPROVE(); 14296b4cac81SBjoern A. Zeeb return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd)); 14306b4cac81SBjoern A. Zeeb } 14316b4cac81SBjoern A. Zeeb 14326b4cac81SBjoern A. Zeeb static __inline int 14336b4cac81SBjoern A. Zeeb regulatory_set_wiphy_regd(struct wiphy *wiphy, 14346b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_regdomain *regd) 14356b4cac81SBjoern A. Zeeb { 14366b4cac81SBjoern A. Zeeb 14376b4cac81SBjoern A. Zeeb IMPROVE(); 14386b4cac81SBjoern A. Zeeb if (regd == NULL) 14396b4cac81SBjoern A. Zeeb return (EINVAL); 14406b4cac81SBjoern A. Zeeb 14416b4cac81SBjoern A. Zeeb /* XXX-BZ wild guessing here based on brcmfmac. */ 14426b4cac81SBjoern A. Zeeb if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) 14436b4cac81SBjoern A. Zeeb wiphy->regd = regd; 14446b4cac81SBjoern A. Zeeb else 14456b4cac81SBjoern A. Zeeb return (EPERM); 14466b4cac81SBjoern A. Zeeb 14476b4cac81SBjoern A. Zeeb /* XXX FIXME, do we have to do anything with reg_notifier? */ 14486b4cac81SBjoern A. Zeeb return (0); 14496b4cac81SBjoern A. Zeeb } 14506b4cac81SBjoern A. Zeeb 14516b4cac81SBjoern A. Zeeb static __inline int 145251b461b3SBjoern A. Zeeb regulatory_hint(struct wiphy *wiphy, const uint8_t *alpha2) 14536b4cac81SBjoern A. Zeeb { 14546b4cac81SBjoern A. Zeeb TODO(); 14556b4cac81SBjoern A. Zeeb return (-ENXIO); 14566b4cac81SBjoern A. Zeeb } 14576b4cac81SBjoern A. Zeeb 14582e183d99SBjoern A. Zeeb static __inline const char * 14592e183d99SBjoern A. Zeeb reg_initiator_name(enum nl80211_reg_initiator initiator) 14602e183d99SBjoern A. Zeeb { 14612e183d99SBjoern A. Zeeb TODO(); 14622e183d99SBjoern A. Zeeb return (NULL); 14632e183d99SBjoern A. Zeeb } 14642e183d99SBjoern A. Zeeb 14656b4cac81SBjoern A. Zeeb static __inline struct linuxkpi_ieee80211_regdomain * 14666b4cac81SBjoern A. Zeeb rtnl_dereference(const struct linuxkpi_ieee80211_regdomain *regd) 14676b4cac81SBjoern A. Zeeb { 14686b4cac81SBjoern A. Zeeb TODO(); 14696b4cac81SBjoern A. Zeeb return (NULL); 14706b4cac81SBjoern A. Zeeb } 14716b4cac81SBjoern A. Zeeb 14726b4cac81SBjoern A. Zeeb static __inline struct ieee80211_reg_rule * 14736b4cac81SBjoern A. Zeeb freq_reg_info(struct wiphy *wiphy, uint32_t center_freq) 14746b4cac81SBjoern A. Zeeb { 14756b4cac81SBjoern A. Zeeb TODO(); 14766b4cac81SBjoern A. Zeeb return (NULL); 14776b4cac81SBjoern A. Zeeb } 14786b4cac81SBjoern A. Zeeb 14796b4cac81SBjoern A. Zeeb static __inline void 14806b4cac81SBjoern A. Zeeb wiphy_apply_custom_regulatory(struct wiphy *wiphy, 14816b4cac81SBjoern A. Zeeb const struct linuxkpi_ieee80211_regdomain *regd) 14826b4cac81SBjoern A. Zeeb { 14836b4cac81SBjoern A. Zeeb TODO(); 14846b4cac81SBjoern A. Zeeb } 14856b4cac81SBjoern A. Zeeb 14866b4cac81SBjoern A. Zeeb static __inline char * 14876b4cac81SBjoern A. Zeeb wiphy_name(struct wiphy *wiphy) 14886b4cac81SBjoern A. Zeeb { 14896b4cac81SBjoern A. Zeeb if (wiphy != NULL && wiphy->dev != NULL) 14906b4cac81SBjoern A. Zeeb return dev_name(wiphy->dev); 14912e183d99SBjoern A. Zeeb else { 14922e183d99SBjoern A. Zeeb IMPROVE("wlanNA"); 14936b4cac81SBjoern A. Zeeb return ("wlanNA"); 14946b4cac81SBjoern A. Zeeb } 14952e183d99SBjoern A. Zeeb } 14966b4cac81SBjoern A. Zeeb 14976b4cac81SBjoern A. Zeeb static __inline void 14986b4cac81SBjoern A. Zeeb wiphy_read_of_freq_limits(struct wiphy *wiphy) 14996b4cac81SBjoern A. Zeeb { 15006b4cac81SBjoern A. Zeeb #ifdef FDT 15016b4cac81SBjoern A. Zeeb TODO(); 15026b4cac81SBjoern A. Zeeb #endif 15036b4cac81SBjoern A. Zeeb } 15046b4cac81SBjoern A. Zeeb 15056b4cac81SBjoern A. Zeeb static __inline void 15066b4cac81SBjoern A. Zeeb wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef) 15076b4cac81SBjoern A. Zeeb { 15086b4cac81SBjoern A. Zeeb 15096b4cac81SBjoern A. Zeeb set_bit(ef, wiphy->ext_features); 15106b4cac81SBjoern A. Zeeb } 15116b4cac81SBjoern A. Zeeb 15126b4cac81SBjoern A. Zeeb static __inline void * 15136b4cac81SBjoern A. Zeeb wiphy_net(struct wiphy *wiphy) 15146b4cac81SBjoern A. Zeeb { 15156b4cac81SBjoern A. Zeeb TODO(); 15166b4cac81SBjoern A. Zeeb return (NULL); /* XXX passed to dev_net_set() */ 15176b4cac81SBjoern A. Zeeb } 15186b4cac81SBjoern A. Zeeb 15196b4cac81SBjoern A. Zeeb static __inline int 15206b4cac81SBjoern A. Zeeb wiphy_register(struct wiphy *wiphy) 15216b4cac81SBjoern A. Zeeb { 15226b4cac81SBjoern A. Zeeb TODO(); 15236b4cac81SBjoern A. Zeeb return (0); 15246b4cac81SBjoern A. Zeeb } 15256b4cac81SBjoern A. Zeeb 15266b4cac81SBjoern A. Zeeb static __inline void 15276b4cac81SBjoern A. Zeeb wiphy_unregister(struct wiphy *wiphy) 15286b4cac81SBjoern A. Zeeb { 15296b4cac81SBjoern A. Zeeb TODO(); 15306b4cac81SBjoern A. Zeeb } 15316b4cac81SBjoern A. Zeeb 15326b4cac81SBjoern A. Zeeb static __inline void 15336b4cac81SBjoern A. Zeeb wiphy_warn(struct wiphy *wiphy, const char *fmt, ...) 15346b4cac81SBjoern A. Zeeb { 15356b4cac81SBjoern A. Zeeb TODO(); 15366b4cac81SBjoern A. Zeeb } 15376b4cac81SBjoern A. Zeeb 15386b4cac81SBjoern A. Zeeb static __inline int 15396b4cac81SBjoern A. Zeeb cfg80211_check_combinations(struct wiphy *wiphy, 15406b4cac81SBjoern A. Zeeb struct iface_combination_params *params) 15416b4cac81SBjoern A. Zeeb { 15426b4cac81SBjoern A. Zeeb TODO(); 15436b4cac81SBjoern A. Zeeb return (-ENOENT); 15446b4cac81SBjoern A. Zeeb } 15456b4cac81SBjoern A. Zeeb 15466b4cac81SBjoern A. Zeeb static __inline uint8_t 15476b4cac81SBjoern A. Zeeb cfg80211_classify8021d(struct sk_buff *skb, void *p) 15486b4cac81SBjoern A. Zeeb { 15496b4cac81SBjoern A. Zeeb TODO(); 15506b4cac81SBjoern A. Zeeb return (0); 15516b4cac81SBjoern A. Zeeb } 15526b4cac81SBjoern A. Zeeb 15536b4cac81SBjoern A. Zeeb static __inline void 15546b4cac81SBjoern A. Zeeb cfg80211_connect_done(struct net_device *ndev, 15556b4cac81SBjoern A. Zeeb struct cfg80211_connect_resp_params *conn_params, gfp_t gfp) 15566b4cac81SBjoern A. Zeeb { 15576b4cac81SBjoern A. Zeeb TODO(); 15586b4cac81SBjoern A. Zeeb } 15596b4cac81SBjoern A. Zeeb 15606b4cac81SBjoern A. Zeeb static __inline void 15616b4cac81SBjoern A. Zeeb cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp) 15626b4cac81SBjoern A. Zeeb { 15636b4cac81SBjoern A. Zeeb TODO(); 15646b4cac81SBjoern A. Zeeb } 15656b4cac81SBjoern A. Zeeb 15666b4cac81SBjoern A. Zeeb static __inline void 15676b4cac81SBjoern A. Zeeb cfg80211_disconnected(struct net_device *ndev, uint16_t reason, 15686b4cac81SBjoern A. Zeeb void *p, int x, bool locally_generated, gfp_t gfp) 15696b4cac81SBjoern A. Zeeb { 15706b4cac81SBjoern A. Zeeb TODO(); 15716b4cac81SBjoern A. Zeeb } 15726b4cac81SBjoern A. Zeeb 15736b4cac81SBjoern A. Zeeb static __inline int 15746b4cac81SBjoern A. Zeeb cfg80211_get_p2p_attr(const u8 *ie, u32 ie_len, 15756b4cac81SBjoern A. Zeeb enum ieee80211_p2p_attr_ids attr, u8 *p, size_t p_len) 15766b4cac81SBjoern A. Zeeb { 15776b4cac81SBjoern A. Zeeb TODO(); 15786b4cac81SBjoern A. Zeeb return (-1); 15796b4cac81SBjoern A. Zeeb } 15806b4cac81SBjoern A. Zeeb 15816b4cac81SBjoern A. Zeeb static __inline void 15826b4cac81SBjoern A. Zeeb cfg80211_ibss_joined(struct net_device *ndev, const uint8_t *addr, 15836b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *chan, gfp_t gfp) 15846b4cac81SBjoern A. Zeeb { 15856b4cac81SBjoern A. Zeeb TODO(); 15866b4cac81SBjoern A. Zeeb } 15876b4cac81SBjoern A. Zeeb 15886b4cac81SBjoern A. Zeeb static __inline struct cfg80211_bss * 15896b4cac81SBjoern A. Zeeb cfg80211_inform_bss(struct wiphy *wiphy, 15906b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel, 15912e183d99SBjoern A. Zeeb enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x, 15926b4cac81SBjoern A. Zeeb uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, 15936b4cac81SBjoern A. Zeeb int signal, gfp_t gfp) 15946b4cac81SBjoern A. Zeeb { 15956b4cac81SBjoern A. Zeeb TODO(); 15966b4cac81SBjoern A. Zeeb return (NULL); 15976b4cac81SBjoern A. Zeeb } 15986b4cac81SBjoern A. Zeeb 15996b4cac81SBjoern A. Zeeb static __inline struct cfg80211_bss * 16006b4cac81SBjoern A. Zeeb cfg80211_inform_bss_data(struct wiphy *wiphy, 16016b4cac81SBjoern A. Zeeb struct cfg80211_inform_bss *bss_data, 16022e183d99SBjoern A. Zeeb enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x, 16036b4cac81SBjoern A. Zeeb uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, gfp_t gfp) 16046b4cac81SBjoern A. Zeeb { 16056b4cac81SBjoern A. Zeeb TODO(); 16066b4cac81SBjoern A. Zeeb return (NULL); 16076b4cac81SBjoern A. Zeeb } 16086b4cac81SBjoern A. Zeeb 16096b4cac81SBjoern A. Zeeb static __inline void 16106b4cac81SBjoern A. Zeeb cfg80211_mgmt_tx_status(struct wireless_dev *wdev, uint64_t cookie, 16116b4cac81SBjoern A. Zeeb const u8 *buf, size_t len, bool ack, gfp_t gfp) 16126b4cac81SBjoern A. Zeeb { 16136b4cac81SBjoern A. Zeeb TODO(); 16146b4cac81SBjoern A. Zeeb } 16156b4cac81SBjoern A. Zeeb 16166b4cac81SBjoern A. Zeeb static __inline void 16176b4cac81SBjoern A. Zeeb cfg80211_michael_mic_failure(struct net_device *ndev, const uint8_t *addr, 16186b4cac81SBjoern A. Zeeb enum nl80211_key_type key_type, int _x, void *p, gfp_t gfp) 16196b4cac81SBjoern A. Zeeb { 16206b4cac81SBjoern A. Zeeb TODO(); 16216b4cac81SBjoern A. Zeeb } 16226b4cac81SBjoern A. Zeeb 16236b4cac81SBjoern A. Zeeb static __inline void 16246b4cac81SBjoern A. Zeeb cfg80211_new_sta(struct net_device *ndev, const uint8_t *addr, 16256b4cac81SBjoern A. Zeeb struct station_info *sinfo, gfp_t gfp) 16266b4cac81SBjoern A. Zeeb { 16276b4cac81SBjoern A. Zeeb TODO(); 16286b4cac81SBjoern A. Zeeb } 16296b4cac81SBjoern A. Zeeb 16306b4cac81SBjoern A. Zeeb static __inline void 16316b4cac81SBjoern A. Zeeb cfg80211_del_sta(struct net_device *ndev, const uint8_t *addr, gfp_t gfp) 16326b4cac81SBjoern A. Zeeb { 16336b4cac81SBjoern A. Zeeb TODO(); 16346b4cac81SBjoern A. Zeeb } 16356b4cac81SBjoern A. Zeeb 16366b4cac81SBjoern A. Zeeb static __inline void 16376b4cac81SBjoern A. Zeeb cfg80211_port_authorized(struct net_device *ndev, const uint8_t *bssid, 16386b4cac81SBjoern A. Zeeb gfp_t gfp) 16396b4cac81SBjoern A. Zeeb { 16406b4cac81SBjoern A. Zeeb TODO(); 16416b4cac81SBjoern A. Zeeb } 16426b4cac81SBjoern A. Zeeb 16436b4cac81SBjoern A. Zeeb static __inline void 16446b4cac81SBjoern A. Zeeb cfg80211_ready_on_channel(struct wireless_dev *wdev, uint64_t cookie, 16456b4cac81SBjoern A. Zeeb struct linuxkpi_ieee80211_channel *channel, unsigned int duration, 16466b4cac81SBjoern A. Zeeb gfp_t gfp) 16476b4cac81SBjoern A. Zeeb { 16486b4cac81SBjoern A. Zeeb TODO(); 16496b4cac81SBjoern A. Zeeb } 16506b4cac81SBjoern A. Zeeb 16516b4cac81SBjoern A. Zeeb static __inline void 16526b4cac81SBjoern A. Zeeb cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, 16536b4cac81SBjoern A. Zeeb uint64_t cookie, struct linuxkpi_ieee80211_channel *channel, gfp_t gfp) 16546b4cac81SBjoern A. Zeeb { 16556b4cac81SBjoern A. Zeeb TODO(); 16566b4cac81SBjoern A. Zeeb } 16576b4cac81SBjoern A. Zeeb 16586b4cac81SBjoern A. Zeeb static __inline void 16596b4cac81SBjoern A. Zeeb cfg80211_report_wowlan_wakeup(void) 16606b4cac81SBjoern A. Zeeb { 16616b4cac81SBjoern A. Zeeb TODO(); 16626b4cac81SBjoern A. Zeeb } 16636b4cac81SBjoern A. Zeeb 16646b4cac81SBjoern A. Zeeb static __inline void 16656b4cac81SBjoern A. Zeeb cfg80211_roamed(struct net_device *ndev, struct cfg80211_roam_info *roam_info, 16666b4cac81SBjoern A. Zeeb gfp_t gfp) 16676b4cac81SBjoern A. Zeeb { 16686b4cac81SBjoern A. Zeeb TODO(); 16696b4cac81SBjoern A. Zeeb } 16706b4cac81SBjoern A. Zeeb 16716b4cac81SBjoern A. Zeeb static __inline void 16726b4cac81SBjoern A. Zeeb cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int _x, 16736b4cac81SBjoern A. Zeeb uint8_t *p, size_t p_len, int _x2) 16746b4cac81SBjoern A. Zeeb { 16756b4cac81SBjoern A. Zeeb TODO(); 16766b4cac81SBjoern A. Zeeb } 16776b4cac81SBjoern A. Zeeb 16786b4cac81SBjoern A. Zeeb static __inline void 16796b4cac81SBjoern A. Zeeb cfg80211_scan_done(struct cfg80211_scan_request *scan_request, 16806b4cac81SBjoern A. Zeeb struct cfg80211_scan_info *info) 16816b4cac81SBjoern A. Zeeb { 16826b4cac81SBjoern A. Zeeb TODO(); 16836b4cac81SBjoern A. Zeeb } 16846b4cac81SBjoern A. Zeeb 16856b4cac81SBjoern A. Zeeb static __inline void 16866b4cac81SBjoern A. Zeeb cfg80211_sched_scan_results(struct wiphy *wiphy, uint64_t reqid) 16876b4cac81SBjoern A. Zeeb { 16886b4cac81SBjoern A. Zeeb TODO(); 16896b4cac81SBjoern A. Zeeb } 16906b4cac81SBjoern A. Zeeb 16916b4cac81SBjoern A. Zeeb static __inline void 16926b4cac81SBjoern A. Zeeb cfg80211_sched_scan_stopped(struct wiphy *wiphy, int _x) 16936b4cac81SBjoern A. Zeeb { 16946b4cac81SBjoern A. Zeeb TODO(); 16956b4cac81SBjoern A. Zeeb } 16966b4cac81SBjoern A. Zeeb 16976b4cac81SBjoern A. Zeeb static __inline void 16986b4cac81SBjoern A. Zeeb cfg80211_unregister_wdev(struct wireless_dev *wdev) 16996b4cac81SBjoern A. Zeeb { 17006b4cac81SBjoern A. Zeeb TODO(); 17016b4cac81SBjoern A. Zeeb } 17026b4cac81SBjoern A. Zeeb 17036b4cac81SBjoern A. Zeeb static __inline struct sk_buff * 17046b4cac81SBjoern A. Zeeb cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, unsigned int len) 17056b4cac81SBjoern A. Zeeb { 17066b4cac81SBjoern A. Zeeb TODO(); 17076b4cac81SBjoern A. Zeeb return (NULL); 17086b4cac81SBjoern A. Zeeb } 17096b4cac81SBjoern A. Zeeb 17106b4cac81SBjoern A. Zeeb static __inline int 17116b4cac81SBjoern A. Zeeb cfg80211_vendor_cmd_reply(struct sk_buff *skb) 17126b4cac81SBjoern A. Zeeb { 17136b4cac81SBjoern A. Zeeb TODO(); 17146b4cac81SBjoern A. Zeeb return (-ENXIO); 17156b4cac81SBjoern A. Zeeb } 17166b4cac81SBjoern A. Zeeb 17176b4cac81SBjoern A. Zeeb static __inline struct linuxkpi_ieee80211_channel * 17186b4cac81SBjoern A. Zeeb ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) 17196b4cac81SBjoern A. Zeeb { 17202e183d99SBjoern A. Zeeb 17212e183d99SBjoern A. Zeeb return (linuxkpi_ieee80211_get_channel(wiphy, freq)); 17226b4cac81SBjoern A. Zeeb } 17236b4cac81SBjoern A. Zeeb 172433911994SBjoern A. Zeeb static inline size_t 17256b4cac81SBjoern A. Zeeb ieee80211_get_hdrlen_from_skb(struct sk_buff *skb) 17266b4cac81SBjoern A. Zeeb { 172733911994SBjoern A. Zeeb const struct ieee80211_hdr *hdr; 172833911994SBjoern A. Zeeb size_t len; 17296b4cac81SBjoern A. Zeeb 173033911994SBjoern A. Zeeb if (skb->len < 10) /* sizeof(ieee80211_frame_[ack,cts]) */ 173133911994SBjoern A. Zeeb return (0); 173233911994SBjoern A. Zeeb 173333911994SBjoern A. Zeeb hdr = (const struct ieee80211_hdr *)skb->data; 173433911994SBjoern A. Zeeb len = ieee80211_hdrlen(hdr->frame_control); 173533911994SBjoern A. Zeeb 173633911994SBjoern A. Zeeb /* If larger than what is in the skb return. */ 173733911994SBjoern A. Zeeb if (len > skb->len) 173833911994SBjoern A. Zeeb return (0); 173933911994SBjoern A. Zeeb 174033911994SBjoern A. Zeeb return (len); 17416b4cac81SBjoern A. Zeeb } 17426b4cac81SBjoern A. Zeeb 17436b4cac81SBjoern A. Zeeb static __inline bool 17446b4cac81SBjoern A. Zeeb cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel) 17456b4cac81SBjoern A. Zeeb { 17466b4cac81SBjoern A. Zeeb 17476b4cac81SBjoern A. Zeeb /* Only 6Ghz. */ 17486b4cac81SBjoern A. Zeeb if (channel->band != NL80211_BAND_6GHZ) 17496b4cac81SBjoern A. Zeeb return (false); 17506b4cac81SBjoern A. Zeeb 17516b4cac81SBjoern A. Zeeb TODO(); 17526b4cac81SBjoern A. Zeeb return (false); 17536b4cac81SBjoern A. Zeeb } 17546b4cac81SBjoern A. Zeeb 175513d87d92SBjoern A. Zeeb static inline int 17562e183d99SBjoern A. Zeeb cfg80211_get_ies_channel_number(const uint8_t *ie, size_t len, 17572e183d99SBjoern A. Zeeb enum nl80211_band band, enum cfg80211_bss_frame_type ftype) 17582e183d99SBjoern A. Zeeb { 175913d87d92SBjoern A. Zeeb const struct element *elem; 17602e183d99SBjoern A. Zeeb 176113d87d92SBjoern A. Zeeb switch (band) { 176213d87d92SBjoern A. Zeeb case NL80211_BAND_6GHZ: 17632e183d99SBjoern A. Zeeb TODO(); 176413d87d92SBjoern A. Zeeb break; 176513d87d92SBjoern A. Zeeb case NL80211_BAND_5GHZ: 176613d87d92SBjoern A. Zeeb case NL80211_BAND_2GHZ: 176713d87d92SBjoern A. Zeeb /* DSPARAMS has the channel number. */ 176813d87d92SBjoern A. Zeeb elem = cfg80211_find_elem(IEEE80211_ELEMID_DSPARMS, ie, len); 176913d87d92SBjoern A. Zeeb if (elem != NULL && elem->datalen == 1) 177013d87d92SBjoern A. Zeeb return (elem->data[0]); 177113d87d92SBjoern A. Zeeb /* HTINFO has the primary center channel. */ 177213d87d92SBjoern A. Zeeb elem = cfg80211_find_elem(IEEE80211_ELEMID_HTINFO, ie, len); 177313d87d92SBjoern A. Zeeb if (elem != NULL && 177413d87d92SBjoern A. Zeeb elem->datalen >= (sizeof(struct ieee80211_ie_htinfo) - 2)) { 177513d87d92SBjoern A. Zeeb const struct ieee80211_ie_htinfo *htinfo; 177613d87d92SBjoern A. Zeeb htinfo = (const struct ieee80211_ie_htinfo *)elem; 177713d87d92SBjoern A. Zeeb return (htinfo->hi_ctrlchannel); 177813d87d92SBjoern A. Zeeb } 177913d87d92SBjoern A. Zeeb /* What else? */ 178013d87d92SBjoern A. Zeeb break; 178113d87d92SBjoern A. Zeeb default: 178213d87d92SBjoern A. Zeeb IMPROVE("Unsupported"); 178313d87d92SBjoern A. Zeeb break; 178413d87d92SBjoern A. Zeeb } 17852e183d99SBjoern A. Zeeb return (-1); 17862e183d99SBjoern A. Zeeb } 17876b4cac81SBjoern A. Zeeb 17886b4cac81SBjoern A. Zeeb /* Used for scanning at least. */ 17896b4cac81SBjoern A. Zeeb static __inline void 17906b4cac81SBjoern A. Zeeb get_random_mask_addr(uint8_t *dst, const uint8_t *addr, const uint8_t *mask) 17916b4cac81SBjoern A. Zeeb { 17926b4cac81SBjoern A. Zeeb int i; 17936b4cac81SBjoern A. Zeeb 17946b4cac81SBjoern A. Zeeb /* Get a completely random address and then overlay what we want. */ 17956b4cac81SBjoern A. Zeeb get_random_bytes(dst, ETH_ALEN); 17966b4cac81SBjoern A. Zeeb for (i = 0; i < ETH_ALEN; i++) 17976b4cac81SBjoern A. Zeeb dst[i] = (dst[i] & ~(mask[i])) | (addr[i] & mask[i]); 17986b4cac81SBjoern A. Zeeb } 17996b4cac81SBjoern A. Zeeb 1800d875aa15SBjoern A. Zeeb static __inline void 1801d875aa15SBjoern A. Zeeb cfg80211_shutdown_all_interfaces(struct wiphy *wiphy) 1802d875aa15SBjoern A. Zeeb { 1803d875aa15SBjoern A. Zeeb TODO(); 1804d875aa15SBjoern A. Zeeb } 1805d875aa15SBjoern A. Zeeb 1806b0f73768SBjoern A. Zeeb static __inline bool 1807b0f73768SBjoern A. Zeeb cfg80211_reg_can_beacon(struct wiphy *wiphy, struct cfg80211_chan_def *chandef, 1808b0f73768SBjoern A. Zeeb enum nl80211_iftype iftype) 1809b0f73768SBjoern A. Zeeb { 1810b0f73768SBjoern A. Zeeb TODO(); 1811b0f73768SBjoern A. Zeeb return (false); 1812b0f73768SBjoern A. Zeeb } 1813b0f73768SBjoern A. Zeeb 1814b0f73768SBjoern A. Zeeb static __inline void 1815b0f73768SBjoern A. Zeeb cfg80211_background_radar_event(struct wiphy *wiphy, 1816b0f73768SBjoern A. Zeeb struct cfg80211_chan_def *chandef, gfp_t gfp) 1817b0f73768SBjoern A. Zeeb { 1818b0f73768SBjoern A. Zeeb TODO(); 1819b0f73768SBjoern A. Zeeb } 1820b0f73768SBjoern A. Zeeb 1821b0f73768SBjoern A. Zeeb static __inline const u8 * 1822b0f73768SBjoern A. Zeeb cfg80211_find_ext_ie(uint8_t eid, uint8_t *p, size_t len) 1823b0f73768SBjoern A. Zeeb { 1824b0f73768SBjoern A. Zeeb TODO(); 1825b0f73768SBjoern A. Zeeb return (NULL); 1826b0f73768SBjoern A. Zeeb } 1827b0f73768SBjoern A. Zeeb 1828b0f73768SBjoern A. Zeeb static __inline bool 1829b0f73768SBjoern A. Zeeb cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) 1830b0f73768SBjoern A. Zeeb { 1831b0f73768SBjoern A. Zeeb TODO(); 1832b0f73768SBjoern A. Zeeb return (false); 1833b0f73768SBjoern A. Zeeb } 1834b0f73768SBjoern A. Zeeb 1835b0f73768SBjoern A. Zeeb #define wiphy_info(wiphy, fmt, ...) \ 1836b0f73768SBjoern A. Zeeb printf("%s:%d XXX TODO " fmt, __func__, __LINE__, __VA_ARGS__) 1837b0f73768SBjoern A. Zeeb 18386b4cac81SBjoern A. Zeeb #ifndef LINUXKPI_NET80211 18396b4cac81SBjoern A. Zeeb #define ieee80211_channel linuxkpi_ieee80211_channel 18406b4cac81SBjoern A. Zeeb #define ieee80211_regdomain linuxkpi_ieee80211_regdomain 18416b4cac81SBjoern A. Zeeb #endif 18426b4cac81SBjoern A. Zeeb 1843800aa9cdSBjoern A. Zeeb #include <net/mac80211.h> 1844800aa9cdSBjoern A. Zeeb 18456b4cac81SBjoern A. Zeeb #endif /* _LINUXKPI_NET_CFG80211_H */ 1846