]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/compat/linuxkpi/common/include/net/cfg80211.h
net80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*
[FreeBSD/FreeBSD.git] / sys / compat / linuxkpi / common / include / net / cfg80211.h
1 /*-
2  * Copyright (c) 2020-2021 The FreeBSD Foundation
3  * Copyright (c) 2021-2022 Bjoern A. Zeeb
4  *
5  * This software was developed by Björn Zeeb under sponsorship from
6  * the FreeBSD Foundation.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * $FreeBSD$
30  */
31
32 #ifndef _LINUXKPI_NET_CFG80211_H
33 #define _LINUXKPI_NET_CFG80211_H
34
35 #include <linux/types.h>
36 #include <linux/nl80211.h>
37 #include <linux/ieee80211.h>
38 #include <linux/if_ether.h>
39 #include <linux/ethtool.h>
40 #include <linux/device.h>
41 #include <linux/netdevice.h>
42 #include <linux/random.h>
43 #include <linux/skbuff.h>
44 #include <net/regulatory.h>
45
46 /* linux_80211.c */
47 extern int linuxkpi_debug_80211;
48 #ifndef D80211_TODO
49 #define D80211_TODO             0x1
50 #endif
51 #ifndef D80211_IMPROVE
52 #define D80211_IMPROVE          0x2
53 #endif
54 #define TODO()          if (linuxkpi_debug_80211 & D80211_TODO)         \
55     printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__)
56 #define IMPROVE(...)    if (linuxkpi_debug_80211 & D80211_IMPROVE)      \
57     printf("%s:%d: XXX LKPI80211 IMPROVE\n", __func__, __LINE__)
58
59 enum rfkill_hard_block_reasons {
60         RFKILL_HARD_BLOCK_NOT_OWNER             = BIT(0),
61 };
62
63 #define WIPHY_PARAM_FRAG_THRESHOLD                      __LINE__ /* TODO FIXME brcmfmac */
64 #define WIPHY_PARAM_RETRY_LONG                          __LINE__ /* TODO FIXME brcmfmac */
65 #define WIPHY_PARAM_RETRY_SHORT                         __LINE__ /* TODO FIXME brcmfmac */
66 #define WIPHY_PARAM_RTS_THRESHOLD                       __LINE__ /* TODO FIXME brcmfmac */
67
68 #define CFG80211_SIGNAL_TYPE_MBM                        __LINE__ /* TODO FIXME brcmfmac */
69
70 #define UPDATE_ASSOC_IES        1
71
72 #define IEEE80211_MAX_CHAINS    4               /* net80211: IEEE80211_MAX_CHAINS copied */
73
74 enum cfg80211_rate_info_flags {
75         RATE_INFO_FLAGS_SHORT_GI        = BIT(0),
76         RATE_INFO_FLAGS_MCS             = BIT(1),
77         RATE_INFO_FLAGS_VHT_MCS         = BIT(2),
78         RATE_INFO_FLAGS_HE_MCS          = BIT(3),
79 };
80
81 extern const uint8_t rfc1042_header[6];
82 extern const uint8_t bridge_tunnel_header[6];
83
84 enum ieee80211_privacy {
85         IEEE80211_PRIVACY_ANY,
86 };
87
88 enum ieee80211_bss_type {
89         IEEE80211_BSS_TYPE_ANY,
90 };
91
92 enum cfg80211_bss_frame_type {
93         CFG80211_BSS_FTYPE_UNKNOWN,
94         CFG80211_BSS_FTYPE_BEACON,
95         CFG80211_BSS_FTYPE_PRESP,
96 };
97
98 enum ieee80211_channel_flags {
99         IEEE80211_CHAN_DISABLED                 = BIT(0),
100         IEEE80211_CHAN_INDOOR_ONLY              = BIT(1),
101         IEEE80211_CHAN_IR_CONCURRENT            = BIT(2),
102         IEEE80211_CHAN_RADAR                    = BIT(3),
103         IEEE80211_CHAN_NO_IR                    = BIT(4),
104         IEEE80211_CHAN_NO_HT40MINUS             = BIT(5),
105         IEEE80211_CHAN_NO_HT40PLUS              = BIT(6),
106         IEEE80211_CHAN_NO_80MHZ                 = BIT(7),
107         IEEE80211_CHAN_NO_160MHZ                = BIT(8),
108         IEEE80211_CHAN_NO_OFDM                  = BIT(9),
109 };
110 #define IEEE80211_CHAN_NO_HT40  (IEEE80211_CHAN_NO_HT40MINUS|IEEE80211_CHAN_NO_HT40PLUS)
111
112 struct ieee80211_txrx_stypes {
113         uint16_t        tx;
114         uint16_t        rx;
115 };
116
117 /* XXX net80211 has an ieee80211_channel as well. */
118 struct linuxkpi_ieee80211_channel {
119         /* TODO FIXME */
120         uint32_t                                hw_value;       /* ic_ieee */
121         uint32_t                                center_freq;    /* ic_freq */
122         enum ieee80211_channel_flags            flags;          /* ic_flags */
123         enum nl80211_band                       band;
124         int8_t                                  max_power;      /* ic_maxpower */
125         bool                                    beacon_found;
126         int     max_antenna_gain, max_reg_power;
127         int     orig_flags;
128         int     dfs_cac_ms, dfs_state;
129         int     orig_mpwr;
130 };
131
132 struct cfg80211_bitrate_mask {
133         /* TODO FIXME */
134         /* This is so weird but nothing else works out...*/
135         struct {
136                 uint64_t                        legacy;         /* XXX? */
137                 uint8_t                         ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
138                 uint16_t                        vht_mcs[16];    /* XXX? */
139                 uint16_t                        he_mcs[16];     /* XXX? */
140                 enum nl80211_txrate_gi          gi;
141                 enum nl80211_he_gi              he_gi;
142                 uint8_t                         he_ltf;
143         } control[NUM_NL80211_BANDS];
144 };
145
146 enum rate_info_bw {
147         RATE_INFO_BW_20         = 0,
148         RATE_INFO_BW_5,
149         RATE_INFO_BW_10,
150         RATE_INFO_BW_40,
151         RATE_INFO_BW_80,
152         RATE_INFO_BW_160,
153         RATE_INFO_BW_HE_RU,
154 };
155
156 struct rate_info {
157         /* TODO FIXME */
158         int     bw, flags, he_dcm, he_gi, he_ru_alloc, legacy, mcs, nss;
159 };
160
161 struct ieee80211_rate {
162         /* TODO FIXME */
163         uint32_t                bitrate;
164         uint32_t                hw_value;
165         uint32_t                hw_value_short;
166         uint32_t                flags;
167 };
168
169 struct ieee80211_sta_ht_cap {
170                 /* TODO FIXME */
171         int     ampdu_density, ampdu_factor;
172         bool                                    ht_supported;
173         uint16_t                                cap;
174         struct ieee80211_mcs_info               mcs;
175 };
176
177 /* XXX net80211 calls these IEEE80211_VHTCAP_* */
178 #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895  0x00000000      /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 */
179 #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991  0x00000001      /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 */
180 #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002      /* IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 */
181 #define IEEE80211_VHT_CAP_MAX_MPDU_MASK         0x00000003      /* IEEE80211_VHTCAP_MAX_MPDU_MASK */
182
183 #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ                (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S)
184 #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ       (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S)
185 #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK  0x0000000c      /* IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK */
186
187 #define IEEE80211_VHT_CAP_RXLDPC                0x00000010      /* IEEE80211_VHTCAP_RXLDPC */
188
189 #define IEEE80211_VHT_CAP_SHORT_GI_80           0x00000020      /* IEEE80211_VHTCAP_SHORT_GI_80 */
190 #define IEEE80211_VHT_CAP_SHORT_GI_160          0x00000040      /* IEEE80211_VHTCAP_SHORT_GI_160 */
191
192 #define IEEE80211_VHT_CAP_TXSTBC                0x00000080      /* IEEE80211_VHTCAP_TXSTBC */
193
194 #define IEEE80211_VHT_CAP_RXSTBC_1              0x00000100      /* IEEE80211_VHTCAP_RXSTBC_1 */
195 #define IEEE80211_VHT_CAP_RXSTBC_MASK           0x00000700      /* IEEE80211_VHTCAP_RXSTBC_MASK */
196
197 #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800      /* IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE */
198
199 #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000      /* IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE */
200
201 #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000      /* IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE */
202
203 #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000      /* IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE */
204
205 #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT          13      /* IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT */
206 #define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK           (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT)   /* IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK */
207
208 #define IEEE80211_VHT_CAP_HTC_VHT               0x00400000      /* IEEE80211_VHTCAP_HTC_VHT */
209
210 #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN    0x10000000      /* IEEE80211_VHTCAP_RX_ANTENNA_PATTERN */
211 #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN    0x20000000      /* IEEE80211_VHTCAP_TX_ANTENNA_PATTERN */
212
213 #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB       0x0c000000      /* IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB */
214
215 #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT     16      /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT */
216 #define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK              \
217         (7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT)       /* IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK */
218
219 #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT      23      /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT */
220 #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK       \
221         (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)       /* IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK */
222
223
224 struct ieee80211_sta_vht_cap {
225                 /* TODO FIXME */
226         bool                    vht_supported;
227         uint32_t                cap;
228         struct vht_mcs          vht_mcs;
229 };
230
231 enum ieee80211_vht_opmode {
232         IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT     = 4,
233 };
234
235 struct cfg80211_connect_resp_params {
236                 /* XXX TODO */
237         uint8_t                         *bssid;
238         const uint8_t                   *req_ie;
239         const uint8_t                   *resp_ie;
240         uint32_t                        req_ie_len;
241         uint32_t                        resp_ie_len;
242         int     status;
243 };
244
245 struct cfg80211_inform_bss {
246                 /* XXX TODO */
247         int     boottime_ns, scan_width, signal;
248         struct linuxkpi_ieee80211_channel       *chan;
249 };
250
251 struct cfg80211_roam_info {
252                 /* XXX TODO */
253         uint8_t                         *bssid;
254         const uint8_t                   *req_ie;
255         const uint8_t                   *resp_ie;
256         uint32_t                        req_ie_len;
257         uint32_t                        resp_ie_len;
258         struct linuxkpi_ieee80211_channel       *channel;
259 };
260
261 struct cfg80211_bss_ies {
262                 /* XXX TODO, type is best guess. Fix if more info. */
263         uint8_t                         *data;
264         int                             len;
265 };
266
267 struct cfg80211_bss {
268                 /* XXX TODO */
269         struct cfg80211_bss_ies         *ies;
270 };
271
272 struct cfg80211_chan_def {
273                 /* XXX TODO */
274         struct linuxkpi_ieee80211_channel       *chan;
275         enum nl80211_chan_width         width;
276         uint32_t                        center_freq1;
277         uint32_t                        center_freq2;
278 };
279
280 struct cfg80211_ftm_responder_stats {
281                 /* XXX TODO */
282         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;
283 };
284
285 struct cfg80211_pmsr_capabilities {
286                 /* XXX TODO */
287         int     max_peers, randomize_mac_addr, report_ap_tsf;
288         struct {
289                 int      asap, bandwidths, max_bursts_exponent, max_ftms_per_burst, non_asap, non_trigger_based, preambles, request_civicloc, request_lci, supported, trigger_based;
290         } ftm;
291 };
292
293 struct cfg80211_pmsr_ftm_request {
294                 /* XXX TODO */
295         int     asap, burst_period, ftmr_retries, ftms_per_burst, non_trigger_based, num_bursts_exp, request_civicloc, request_lci, trigger_based;
296         uint8_t                                 bss_color;
297         bool                                    lmr_feedback;
298 };
299
300 struct cfg80211_pmsr_request_peer {
301                 /* XXX TODO */
302         struct cfg80211_chan_def                chandef;
303         struct cfg80211_pmsr_ftm_request        ftm;
304         uint8_t                                 addr[ETH_ALEN];
305         int     report_ap_tsf;
306 };
307
308 struct cfg80211_pmsr_request {
309                 /* XXX TODO */
310         int     cookie, n_peers, timeout;
311         uint8_t                                 mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN];
312         struct cfg80211_pmsr_request_peer       peers[];
313 };
314
315 struct cfg80211_pmsr_ftm_result {
316                 /* XXX TODO */
317         int     burst_index, busy_retry_time, failure_reason;
318         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;
319         uint8_t                                 *lci;
320         uint8_t                                 *civicloc;
321         int                                     lci_len;
322         int                                     civicloc_len;
323 };
324
325 struct cfg80211_pmsr_result {
326                 /* XXX TODO */
327         int     ap_tsf, ap_tsf_valid, final, host_time, status, type;
328         uint8_t                                 addr[ETH_ALEN];
329         struct cfg80211_pmsr_ftm_result         ftm;
330 };
331
332 struct cfg80211_sar_freq_ranges {
333         uint32_t                                start_freq;
334         uint32_t                                end_freq;
335 };
336
337 struct cfg80211_sar_sub_specs {
338         uint32_t                                freq_range_index;
339         int                                     power;
340 };
341
342 struct cfg80211_sar_specs {
343         enum nl80211_sar_type                   type;
344         uint32_t                                num_sub_specs;
345         struct cfg80211_sar_sub_specs           sub_specs[];
346 };
347
348 struct cfg80211_sar_capa {
349         enum nl80211_sar_type                   type;
350         uint32_t                                num_freq_ranges;
351         const struct cfg80211_sar_freq_ranges   *freq_ranges;
352 };
353
354 struct cfg80211_ssid {
355         int     ssid_len;
356         uint8_t ssid[IEEE80211_MAX_SSID_LEN];
357 };
358
359 struct cfg80211_scan_6ghz_params {
360         /* XXX TODO */
361         uint8_t                         *bssid;
362         int     channel_idx, psc_no_listen, short_ssid, short_ssid_valid, unsolicited_probe;
363 };
364
365 struct cfg80211_match_set {
366         uint8_t                                 bssid[ETH_ALEN];
367         struct cfg80211_ssid    ssid;
368         int                     rssi_thold;
369 };
370
371 struct cfg80211_scan_request {
372                 /* XXX TODO */
373         int     duration, duration_mandatory, flags;
374         bool                                    no_cck;
375         bool                                    scan_6ghz;
376         struct wireless_dev                     *wdev;
377         struct wiphy                            *wiphy;
378         int                                     ie_len;
379         uint8_t                                 *ie;
380         uint8_t                                 mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN];
381         uint8_t                                 bssid[ETH_ALEN];
382         int                                     n_ssids;
383         int                                     n_6ghz_params;
384         int                                     n_channels;
385         struct cfg80211_ssid                    *ssids;
386         struct cfg80211_scan_6ghz_params        *scan_6ghz_params;
387         struct linuxkpi_ieee80211_channel       *channels[0];
388 };
389
390 struct cfg80211_sched_scan_plan {
391                 /* XXX TODO */
392         int     interval, iterations;
393 };
394
395 struct cfg80211_sched_scan_request {
396                 /* XXX TODO */
397         int     delay, flags;
398         uint8_t                                 mac_addr[ETH_ALEN], mac_addr_mask[ETH_ALEN];
399         uint64_t                                reqid;
400         int                                     n_match_sets;
401         int                                     n_scan_plans;
402         int                                     n_ssids;
403         int                                     n_channels;
404         int                                     ie_len;
405         uint8_t                                 *ie;
406         struct cfg80211_match_set               *match_sets;
407         struct cfg80211_sched_scan_plan         *scan_plans;
408         struct cfg80211_ssid                    *ssids;
409         struct linuxkpi_ieee80211_channel       *channels[0];
410 };
411
412 struct cfg80211_scan_info {
413         uint64_t                                scan_start_tsf;
414         uint8_t                                 tsf_bssid[ETH_ALEN];
415         bool                                    aborted;
416 };
417
418 struct cfg80211_beacon_data {
419         /* XXX TODO */
420         const uint8_t                           *head;
421         const uint8_t                           *tail;
422         uint32_t                                head_len;
423         uint32_t                                tail_len;
424         const uint8_t                           *proberesp_ies;
425         const uint8_t                           *assocresp_ies;
426         uint32_t                                proberesp_ies_len;
427         uint32_t                                assocresp_ies_len;
428 };
429
430 struct cfg80211_ap_settings {
431         /* XXX TODO */
432         int     auth_type, beacon_interval, dtim_period, hidden_ssid, inactivity_timeout;
433         const uint8_t                           *ssid;
434         size_t                                  ssid_len;
435         struct cfg80211_beacon_data             beacon;
436         struct cfg80211_chan_def                chandef;
437 };
438
439 struct cfg80211_bss_selection {
440         /* XXX TODO */
441         enum nl80211_bss_select_attr            behaviour;
442         union {
443                 enum nl80211_band               band_pref;
444                 struct {
445                         enum nl80211_band       band;
446                         uint8_t                 delta;
447                 } adjust;
448         } param;
449 };
450
451 struct cfg80211_crypto {                /* XXX made up name */
452         /* XXX TODO */
453         enum nl80211_wpa_versions               wpa_versions;
454         uint32_t                                cipher_group;   /* WLAN_CIPHER_SUITE_* */
455         uint32_t                                *akm_suites;
456         uint32_t                                *ciphers_pairwise;
457         const uint8_t                           *sae_pwd;
458         const uint8_t                           *psk;
459         int                                     n_akm_suites;
460         int                                     n_ciphers_pairwise;
461         int                                     sae_pwd_len;
462 };
463
464 struct cfg80211_connect_params {
465         /* XXX TODO */
466         struct linuxkpi_ieee80211_channel       *channel;
467         uint8_t                                 *bssid;
468         const uint8_t                           *ie;
469         const uint8_t                           *ssid;
470         uint32_t                                ie_len;
471         uint32_t                                ssid_len;
472         const void                              *key;
473         uint32_t                                key_len;
474         int     auth_type, key_idx, privacy, want_1x;
475         struct cfg80211_bss_selection           bss_select;
476         struct cfg80211_crypto                  crypto;
477 };
478
479 enum bss_param_flags {          /* Used as bitflags. XXX FIXME values? */
480         BSS_PARAM_FLAGS_CTS_PROT        = 0x01,
481         BSS_PARAM_FLAGS_SHORT_PREAMBLE  = 0x02,
482         BSS_PARAM_FLAGS_SHORT_SLOT_TIME = 0x04,
483 };
484
485 struct cfg80211_ibss_params {
486         /* XXX TODO */
487         int     basic_rates, beacon_interval;
488         int     channel_fixed, ie, ie_len, privacy;
489         int     dtim_period;
490         uint8_t                                 *ssid;
491         uint8_t                                 *bssid;
492         int                                     ssid_len;
493         struct cfg80211_chan_def                chandef;
494         enum bss_param_flags                    flags;
495 };
496
497 struct cfg80211_mgmt_tx_params {
498         /* XXX TODO */
499         struct linuxkpi_ieee80211_channel       *chan;
500         const uint8_t                           *buf;
501         size_t                                  len;
502         int     wait;
503 };
504
505 struct cfg80211_pmk_conf {
506         /* XXX TODO */
507         const uint8_t                   *pmk;
508         uint8_t                         pmk_len;
509 };
510
511 struct cfg80211_pmksa {
512         /* XXX TODO */
513         const uint8_t                   *bssid;
514         const uint8_t                   *pmkid;
515 };
516
517 struct cfg80211_wowlan_nd_match {
518         /* XXX TODO */
519         struct cfg80211_ssid            ssid;
520         int                             n_channels;
521         uint32_t                        channels[0];    /* freq! = ieee80211_channel_to_frequency() */
522 };
523
524 struct cfg80211_wowlan_nd_info {
525         /* XXX TODO */
526         int                             n_matches;
527         struct cfg80211_wowlan_nd_match *matches[0];
528 };
529
530 enum wiphy_wowlan_support_flags {
531         WIPHY_WOWLAN_DISCONNECT,
532         WIPHY_WOWLAN_GTK_REKEY_FAILURE,
533         WIPHY_WOWLAN_MAGIC_PKT,
534         WIPHY_WOWLAN_SUPPORTS_GTK_REKEY,
535         WIPHY_WOWLAN_NET_DETECT,
536 };
537
538 struct wiphy_wowlan_support {
539         /* XXX TODO */
540         enum wiphy_wowlan_support_flags         flags;
541         int     max_nd_match_sets, max_pkt_offset, n_patterns, pattern_max_len, pattern_min_len;
542 };
543
544 struct station_del_parameters {
545         /* XXX TODO */
546         const uint8_t                           *mac;
547         uint32_t                                reason_code;    /* elsewhere uint16_t? */
548 };
549
550 struct station_info {
551         /* TODO FIXME */
552         int     assoc_req_ies_len, connected_time;
553         int     generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets;
554         int     filled, rx_beacon, rx_beacon_signal_avg, signal_avg;
555         int     rx_duration, tx_failed, tx_retries;
556
557         int                                     chains;
558         uint8_t                                 chain_signal[IEEE80211_MAX_CHAINS];
559         uint8_t                                 chain_signal_avg[IEEE80211_MAX_CHAINS];
560
561         uint8_t                                 *assoc_req_ies;
562         struct rate_info                        rxrate;
563         struct rate_info                        txrate;
564         struct cfg80211_ibss_params             bss_param;
565         struct nl80211_sta_flag_update          sta_flags;
566 };
567
568 struct station_parameters {
569         /* XXX TODO */
570         int     sta_flags_mask, sta_flags_set;
571 };
572
573 struct key_params {
574         /* XXX TODO */
575         const uint8_t   *key;
576         const uint8_t   *seq;
577         int             key_len;
578         int             seq_len;
579         uint32_t        cipher;                 /* WLAN_CIPHER_SUITE_* */
580 };
581
582 struct mgmt_frame_regs {
583         /* XXX TODO */
584         int     interface_stypes;
585 };
586
587 struct vif_params {
588         /* XXX TODO */
589         uint8_t                 macaddr[ETH_ALEN];
590 };
591
592 /* That the world needs so many different structs for this is amazing. */
593 struct mac_address {
594         uint8_t addr[ETH_ALEN];
595 };
596
597 struct ieee80211_reg_rule {
598         /* TODO FIXME */
599         uint32_t        flags;
600         struct freq_range {
601                 int     start_freq_khz;
602                 int     end_freq_khz;
603                 int     max_bandwidth_khz;
604         } freq_range;
605         struct power_rule {
606                 int     max_antenna_gain;
607                 int     max_eirp;
608         } power_rule;
609 };
610
611 struct linuxkpi_ieee80211_regdomain {
612         /* TODO FIXME */
613         uint8_t                                 alpha2[2];
614         int     dfs_region;
615         int                                     n_reg_rules;
616         struct ieee80211_reg_rule               reg_rules[];
617 };
618
619 /* XXX-BZ this are insensible values probably ... */
620 #define IEEE80211_HE_MAC_CAP0_HTC_HE                    0x1
621 #define IEEE80211_HE_MAC_CAP0_TWT_REQ                   0x2
622 #define IEEE80211_HE_MAC_CAP0_TWT_RES                   0x4
623
624 #define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION           0x1
625 #define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8    0x2
626 #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US       0x4
627 #define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK       0x8
628
629 #define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP           0x1
630 #define IEEE80211_HE_MAC_CAP2_ACK_EN                    0x2
631 #define IEEE80211_HE_MAC_CAP2_BSR                       0x4
632 #define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION           0x8
633 #define IEEE80211_HE_MAC_CAP2_BCAST_TWT                 0x10
634 #define IEEE80211_HE_MAC_CAP2_ALL_ACK                   0x20
635 #define IEEE80211_HE_MAC_CAP2_MU_CASCADING              0x40
636 #define IEEE80211_HE_MAC_CAP2_TRS                       0x80
637
638 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_VHT_2   0x1
639 #define IEEE80211_HE_MAC_CAP3_OMI_CONTROL               0x2
640 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1   0x10
641 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2   0x20
642 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3   0x40
643 #define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK    0x70
644 #define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80
645 #define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED            0x80
646 #define IEEE80211_HE_MAC_CAP3_OFDMA_RA                  0x80
647
648 #define IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU            0x1
649 #define IEEE80211_HE_MAC_CAP4_BQR                       0x2
650 #define IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39  0x4
651 #define IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU            0x8
652 #define IEEE80211_HE_MAC_CAP4_OPS                       0x10
653 #define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG      0x20
654
655 #define IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS          0x1
656 #define IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX      0x2
657 #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40  0x4
658 #define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41  0x8
659 #define IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU          0x10
660 #define IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX 0x20
661 #define IEEE80211_HE_MAC_CAP5_PUNCTURED_SOUNDING        0x40
662 #define IEEE80211_HE_MAC_CAP5_SUBCHAN_SELECTIVE_TRANSMISSION    0x80
663
664 #define IEEE80211_HE_MCS_NOT_SUPPORTED                  0x0
665 #define IEEE80211_HE_MCS_SUPPORT_0_7                    0x1
666 #define IEEE80211_HE_MCS_SUPPORT_0_9                    0x2
667 #define IEEE80211_HE_MCS_SUPPORT_0_11                   0x4
668
669 #define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS            0x01
670 #define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS            0x02
671 #define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START            0x04
672 #define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN              0x08
673 #define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP         0x10
674 #define IEEE80211_HE_6GHZ_CAP_SM_PS                     0x20
675 #define IEEE80211_HE_6GHZ_MAX_AMPDU_FACTOR              0x40
676
677 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G            0x1
678 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G       0x2
679 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G             0x4
680 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G      0x8
681 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G        0x10
682 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G        0x20
683 #define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK                    0x40
684
685 #define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A            0x1
686 #define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD    0x2
687 #define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS   0x4
688 #define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK     0x8
689 #define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US  0x10
690
691 #define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS   0x1
692 #define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US      0x2
693 #define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ       0x4
694 #define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ       0x8
695 #define IEEE80211_HE_PHY_CAP2_DOPPLER_TX                0x10
696 #define IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO     0x20
697 #define IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO        0x40
698
699 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK     0x1
700 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM   0x2
701 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM   0x4
702 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1          0x8
703 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1          0x10
704 #define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER             0x20
705 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM   0x40
706 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM   0x80
707 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2          0x10
708 #define IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU      0x20
709 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK     0x40
710 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK     0x80
711 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK     0x80
712 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK     0x80
713 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK     0x80
714 #define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_2          0x80
715
716 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8  0x1
717 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8  0x2
718 #define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE                     0x4
719 #define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER                     0x8
720 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4  0x10
721 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4  0x20
722 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK       0x40
723 #define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK       0x80
724
725 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2      0x1
726 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2      0x2
727 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK   0x4
728 #define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK                          0x8
729 #define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK                          0x10
730 #define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK   0x20
731
732 #define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT     0x1
733 #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB     0x2
734 #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB     0x4
735 #define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB    0x8
736 #define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB 0x20
737 #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU       0x40
738 #define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU       0x80
739 #define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE      0x80
740 #define IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB               0x80
741 #define IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO       0x80
742
743 #define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI  0x1
744 #define IEEE80211_HE_PHY_CAP7_MAX_NC_1                          0x2
745 #define IEEE80211_HE_PHY_CAP7_MAX_NC_2                          0x4
746 #define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK                       0x6
747 #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR             0x8
748 #define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP           0x10
749 #define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ               0x20
750 #define IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ               0x40
751 #define IEEE80211_HE_PHY_CAP7_PSR_BASED_SR                      0x80
752
753 #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU           0x1
754 #define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G      0x2
755 #define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU           0x4
756 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242                    0x8
757 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_484                    0x10
758 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_996                    0x18
759 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996                  0x20
760 #define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_MASK                   0x28
761 #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI  0x40
762 #define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI       0x80
763
764 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US           0x1
765 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US          0x2
766 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US           0x4
767 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK          0x8
768 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED      0x10
769 #define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS           0x0
770 #define IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK        0x20
771 #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB     0x4
772 #define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB 0x8
773 #define IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU 0x10
774 #define IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU 0x20
775 #define IEEE80211_HE_PHY_CAP9_LONGER_THAN_16_SIGB_OFDM_SYM      0x40
776
777 #define IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF               0x1
778
779 #define VENDOR_CMD_RAW_DATA     (void *)(uintptr_t)(-ENOENT)
780
781 struct ieee80211_he_cap_elem {
782         u8 mac_cap_info[6];
783         u8 phy_cap_info[11];
784 } __packed;
785
786 struct ieee80211_he_mcs_nss_supp {
787         /* TODO FIXME */
788         uint32_t        rx_mcs_80;
789         uint32_t        tx_mcs_80;
790         uint32_t        rx_mcs_160;
791         uint32_t        tx_mcs_160;
792         uint32_t        rx_mcs_80p80;
793         uint32_t        tx_mcs_80p80;
794 };
795
796 #define IEEE80211_STA_HE_CAP_PPE_THRES_MAX      32
797 struct ieee80211_sta_he_cap {
798         /* TODO FIXME */
799         int                                     has_he;
800         struct ieee80211_he_cap_elem            he_cap_elem;
801         struct ieee80211_he_mcs_nss_supp        he_mcs_nss_supp;
802         uint8_t                                 ppe_thres[IEEE80211_STA_HE_CAP_PPE_THRES_MAX];
803 };
804
805 struct cfg80211_he_bss_color {
806         int     color, enabled;
807 };
808
809 struct ieee80211_he_obss_pd {
810         bool                                    enable;
811 };
812
813 struct ieee80211_sta_he_6ghz_capa {
814         /* TODO FIXME */
815         int     capa;
816 };
817
818 struct ieee80211_sband_iftype_data {
819         /* TODO FIXME */
820         enum nl80211_iftype                     types_mask;
821         struct ieee80211_sta_he_cap             he_cap;
822         struct ieee80211_sta_he_6ghz_capa       he_6ghz_capa;
823         struct {
824                 const uint8_t                   *data;
825                 size_t                          len;
826         } vendor_elems;
827 };
828
829 struct ieee80211_supported_band {
830         /* TODO FIXME */
831         struct linuxkpi_ieee80211_channel       *channels;
832         struct ieee80211_rate                   *bitrates;
833         struct ieee80211_sband_iftype_data      *iftype_data;
834         int                                     n_channels;
835         int                                     n_bitrates;
836         int                                     n_iftype_data;
837         enum nl80211_band                       band;
838         struct ieee80211_sta_ht_cap             ht_cap;
839         struct ieee80211_sta_vht_cap            vht_cap;
840 };
841
842 struct cfg80211_pkt_pattern {
843         /* XXX TODO */
844         uint8_t                                 *mask;
845         uint8_t                                 *pattern;
846         int                                     pattern_len;
847         int                                     pkt_offset;
848 };
849
850 struct cfg80211_wowlan {
851         /* XXX TODO */
852         int     disconnect, gtk_rekey_failure, magic_pkt;
853         int                                     n_patterns;
854         struct cfg80211_sched_scan_request      *nd_config;
855         struct cfg80211_pkt_pattern             *patterns;
856 };
857
858 struct cfg80211_gtk_rekey_data {
859         /* XXX TODO */
860         int     kck, kek, replay_ctr;
861 };
862
863 struct cfg80211_tid_cfg {
864         /* XXX TODO */
865         int     mask, noack, retry_long, rtscts, tids;
866         enum nl80211_tx_rate_setting            txrate_type;
867         struct cfg80211_bitrate_mask            txrate_mask;
868 };
869
870 struct cfg80211_tid_config {
871         /* XXX TODO */
872         int     n_tid_conf;
873         struct cfg80211_tid_cfg                 tid_conf[0];
874 };
875
876 struct ieee80211_iface_limit {
877         /* TODO FIXME */
878         int             max, types;
879 };
880
881 struct ieee80211_iface_combination {
882         /* TODO FIXME */
883         const struct ieee80211_iface_limit      *limits;
884         int                                     n_limits;
885         int             max_interfaces, num_different_channels;
886         int             beacon_int_infra_match, beacon_int_min_gcd;
887         int             radar_detect_widths;
888 };
889
890 struct iface_combination_params {
891         int num_different_channels;
892         int iftype_num[NUM_NL80211_IFTYPES];
893 };
894
895 struct regulatory_request {
896                 /* XXX TODO */
897         uint8_t                                 alpha2[2];
898         int     initiator, dfs_region;
899 };
900
901 enum wiphy_vendor_cmd_need_flags {
902         WIPHY_VENDOR_CMD_NEED_NETDEV            = 0x01,
903         WIPHY_VENDOR_CMD_NEED_RUNNING           = 0x02,
904         WIPHY_VENDOR_CMD_NEED_WDEV              = 0x04,
905 };
906
907 struct wiphy_vendor_command {
908         struct {
909                 uint32_t        vendor_id;
910                 uint32_t        subcmd;
911         };
912         uint32_t                flags;
913         void                    *policy;
914         int (*doit)(struct wiphy *, struct wireless_dev *, const void *, int);
915 };
916
917 struct wiphy_iftype_ext_capab {
918         /* TODO FIXME */
919         enum nl80211_iftype                     iftype;
920         const uint8_t                           *extended_capabilities;
921         const uint8_t                           *extended_capabilities_mask;
922         uint8_t                                 extended_capabilities_len;
923
924 };
925
926 struct tid_config_support {
927         /* TODO FIXME */
928         uint64_t                                vif;    /* enum nl80211_tid_cfg_attr */
929         uint64_t                                peer;   /* enum nl80211_tid_cfg_attr */
930 };
931
932 enum cfg80211_regulatory {
933         REGULATORY_CUSTOM_REG                   = BIT(0),
934         REGULATORY_STRICT_REG                   = BIT(1),
935         REGULATORY_DISABLE_BEACON_HINTS         = BIT(2),
936         REGULATORY_ENABLE_RELAX_NO_IR           = BIT(3),
937         REGULATORY_WIPHY_SELF_MANAGED           = BIT(4),
938         REGULATORY_COUNTRY_IE_IGNORE            = BIT(5),
939         REGULATORY_COUNTRY_IE_FOLLOW_POWER      = BIT(6),
940 };
941
942 enum wiphy_flags {
943         WIPHY_FLAG_AP_UAPSD                     = BIT(0),
944         WIPHY_FLAG_HAS_CHANNEL_SWITCH           = BIT(1),
945         WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL        = BIT(2),
946         WIPHY_FLAG_HAVE_AP_SME                  = BIT(3),
947         WIPHY_FLAG_IBSS_RSN                     = BIT(4),
948         WIPHY_FLAG_NETNS_OK                     = BIT(5),
949         WIPHY_FLAG_OFFCHAN_TX                   = BIT(6),
950         WIPHY_FLAG_PS_ON_BY_DEFAULT             = BIT(7),
951         WIPHY_FLAG_SPLIT_SCAN_6GHZ              = BIT(8),
952         WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK         = BIT(9),
953         WIPHY_FLAG_SUPPORTS_FW_ROAM             = BIT(10),
954         WIPHY_FLAG_SUPPORTS_TDLS                = BIT(11),
955         WIPHY_FLAG_TDLS_EXTERNAL_SETUP          = BIT(12),
956         WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD        = BIT(13),
957         WIPHY_FLAG_4ADDR_AP                     = BIT(14),
958         WIPHY_FLAG_4ADDR_STATION                = BIT(15),
959 };
960
961 struct wiphy {
962
963         struct device                           *dev;
964         struct mac_address                      *addresses;
965         int                                     n_addresses;
966         uint32_t                                flags;
967         struct ieee80211_supported_band         *bands[NUM_NL80211_BANDS];
968         uint8_t                                 perm_addr[ETH_ALEN];
969
970         /* XXX TODO */
971         const struct cfg80211_pmsr_capabilities *pmsr_capa;
972         const struct cfg80211_sar_capa          *sar_capa;
973         const struct wiphy_iftype_ext_capab     *iftype_ext_capab;
974         const struct linuxkpi_ieee80211_regdomain *regd;
975         char                                    fw_version[ETHTOOL_FWVERS_LEN];
976         const struct ieee80211_iface_combination *iface_combinations;
977         const uint32_t                          *cipher_suites;
978         int                                     n_iface_combinations;
979         int                                     n_cipher_suites;
980         void(*reg_notifier)(struct wiphy *, struct regulatory_request *);
981         enum cfg80211_regulatory                regulatory_flags;
982         int                                     n_vendor_commands;
983         const struct wiphy_vendor_command       *vendor_commands;
984         const struct ieee80211_txrx_stypes      *mgmt_stypes;
985         uint32_t                                rts_threshold;
986         uint32_t                                frag_threshold;
987         struct tid_config_support               tid_config_support;
988
989         int     available_antennas_rx, available_antennas_tx;
990         int     features, hw_version;
991         int     interface_modes, max_match_sets, max_remain_on_channel_duration, max_scan_ie_len, 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;
992         int     num_iftype_ext_capab;
993         int     max_ap_assoc_sta, probe_resp_offload, software_iftypes;
994         int     bss_select_support, max_num_pmkids, retry_long, retry_short, signal_type;
995         int     max_data_retry_count;
996         int     tx_queue_len, rfkill;
997         int     mbssid_max_interfaces;
998
999         unsigned long                           ext_features[BITS_TO_LONGS(NUM_NL80211_EXT_FEATURES)];
1000         struct dentry                           *debugfsdir;
1001         struct cfg80211_wowlan_support          *wowlan;
1002         /* Lower layer (driver/mac80211) specific data. */
1003         /* Must stay last. */
1004         uint8_t                                 priv[0] __aligned(CACHE_LINE_SIZE);
1005 };
1006
1007 struct wireless_dev {
1008                 /* XXX TODO, like ic? */
1009         int             iftype;
1010         int     address;
1011         struct net_device                       *netdev;
1012         struct wiphy                            *wiphy;
1013 };
1014
1015 struct cfg80211_ops {
1016         /* XXX TODO */
1017         struct wireless_dev *(*add_virtual_intf)(struct wiphy *, const char *, unsigned char, enum nl80211_iftype, struct vif_params *);
1018         int (*del_virtual_intf)(struct wiphy *,  struct wireless_dev *);
1019         s32 (*change_virtual_intf)(struct wiphy *,  struct net_device *, enum nl80211_iftype, struct vif_params *);
1020         s32 (*scan)(struct wiphy *,  struct cfg80211_scan_request *);
1021         s32 (*set_wiphy_params)(struct wiphy *,  u32);
1022         s32 (*join_ibss)(struct wiphy *,  struct net_device *, struct cfg80211_ibss_params *);
1023         s32 (*leave_ibss)(struct wiphy *,  struct net_device *);
1024         s32 (*get_station)(struct wiphy *, struct net_device *, const u8 *, struct station_info *);
1025         int (*dump_station)(struct wiphy *,  struct net_device *, int,  u8 *,  struct station_info *);
1026         s32 (*set_tx_power)(struct wiphy *,  struct wireless_dev *, enum nl80211_tx_power_setting,  s32);
1027         s32 (*get_tx_power)(struct wiphy *,  struct wireless_dev *, s32 *);
1028         s32 (*add_key)(struct wiphy *,  struct net_device *, u8,  bool,  const u8 *, struct key_params *);
1029         s32 (*del_key)(struct wiphy *,  struct net_device *, u8,  bool,  const u8 *);
1030         s32 (*get_key)(struct wiphy *,  struct net_device *,  u8, bool,  const u8 *,  void *, void(*)(void *, struct key_params *));
1031         s32 (*set_default_key)(struct wiphy *,  struct net_device *, u8,  bool,  bool);
1032         s32 (*set_default_mgmt_key)(struct wiphy *, struct net_device *,  u8);
1033         s32 (*set_power_mgmt)(struct wiphy *,  struct net_device *, bool,  s32);
1034         s32 (*connect)(struct wiphy *,  struct net_device *, struct cfg80211_connect_params *);
1035         s32 (*disconnect)(struct wiphy *,  struct net_device *, u16);
1036         s32 (*suspend)(struct wiphy *, struct cfg80211_wowlan *);
1037         s32 (*resume)(struct wiphy *);
1038         s32 (*set_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *);
1039         s32 (*del_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *);
1040         s32 (*flush_pmksa)(struct wiphy *,  struct net_device *);
1041         s32 (*start_ap)(struct wiphy *,  struct net_device *, struct cfg80211_ap_settings *);
1042         int (*stop_ap)(struct wiphy *,  struct net_device *);
1043         s32 (*change_beacon)(struct wiphy *,  struct net_device *, struct cfg80211_beacon_data *);
1044         int (*del_station)(struct wiphy *,  struct net_device *, struct station_del_parameters *);
1045         int (*change_station)(struct wiphy *,  struct net_device *, const u8 *,  struct station_parameters *);
1046         int (*sched_scan_start)(struct wiphy *, struct net_device *, struct cfg80211_sched_scan_request *);
1047         int (*sched_scan_stop)(struct wiphy *, struct net_device *,  u64);
1048         void (*update_mgmt_frame_registrations)(struct wiphy *, struct wireless_dev *, struct mgmt_frame_regs *);
1049         int (*mgmt_tx)(struct wiphy *,  struct wireless_dev *, struct cfg80211_mgmt_tx_params *,  u64 *);
1050         int (*cancel_remain_on_channel)(struct wiphy *, struct wireless_dev *, u64);
1051         int (*get_channel)(struct wiphy *, struct wireless_dev *, struct cfg80211_chan_def *);
1052         int (*crit_proto_start)(struct wiphy *, struct wireless_dev *, enum nl80211_crit_proto_id, u16);
1053         void (*crit_proto_stop)(struct wiphy *, struct wireless_dev *);
1054         int (*tdls_oper)(struct wiphy *, struct net_device *,  const u8 *, enum nl80211_tdls_operation);
1055         int (*update_connect_params)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *, u32);
1056         int (*set_pmk)(struct wiphy *,  struct net_device *, const struct cfg80211_pmk_conf *);
1057         int (*del_pmk)(struct wiphy *,  struct net_device *, const u8 *);
1058         int (*remain_on_channel)(struct wiphy *,  struct wireless_dev *, struct linuxkpi_ieee80211_channel *, unsigned int,  u64 *);
1059         int (*start_p2p_device)(struct wiphy *,  struct wireless_dev *);
1060         void (*stop_p2p_device)(struct wiphy *,  struct wireless_dev *);
1061 };
1062
1063
1064 /* -------------------------------------------------------------------------- */
1065
1066 /* linux_80211.c */
1067
1068 struct wiphy *linuxkpi_wiphy_new(const struct cfg80211_ops *, size_t);
1069 void linuxkpi_wiphy_free(struct wiphy *wiphy);
1070
1071 int linuxkpi_regulatory_set_wiphy_regd_sync(struct wiphy *wiphy,
1072     struct linuxkpi_ieee80211_regdomain *regd);
1073 uint32_t linuxkpi_ieee80211_channel_to_frequency(uint32_t, enum nl80211_band);
1074 uint32_t linuxkpi_ieee80211_frequency_to_channel(uint32_t, uint32_t);
1075 struct linuxkpi_ieee80211_channel *
1076     linuxkpi_ieee80211_get_channel(struct wiphy *, uint32_t);
1077 void linuxkpi_cfg80211_bss_flush(struct wiphy *);
1078
1079 /* -------------------------------------------------------------------------- */
1080
1081 static __inline struct wiphy *
1082 wiphy_new(const struct cfg80211_ops *ops, size_t priv_len)
1083 {
1084
1085         return (linuxkpi_wiphy_new(ops, priv_len));
1086 }
1087
1088 static __inline void
1089 wiphy_free(struct wiphy *wiphy)
1090 {
1091
1092         linuxkpi_wiphy_free(wiphy);
1093 }
1094
1095 static __inline void *
1096 wiphy_priv(struct wiphy *wiphy)
1097 {
1098
1099         return (wiphy->priv);
1100 }
1101
1102 static __inline void
1103 set_wiphy_dev(struct wiphy *wiphy, struct device *dev)
1104 {
1105
1106         wiphy->dev = dev;
1107 }
1108
1109 static __inline struct device *
1110 wiphy_dev(struct wiphy *wiphy)
1111 {
1112
1113         return (wiphy->dev);
1114 }
1115
1116 #define wiphy_err(_wiphy, _fmt, ...)                                    \
1117     dev_err((_wiphy)->dev, _fmt, __VA_ARGS__)
1118
1119 static __inline const struct linuxkpi_ieee80211_regdomain *
1120 wiphy_dereference(struct wiphy *wiphy,
1121     const struct linuxkpi_ieee80211_regdomain *regd)
1122 {
1123         TODO();
1124         return (NULL);
1125 }
1126
1127 static __inline void
1128 wiphy_lock(struct wiphy *wiphy)
1129 {
1130         TODO();
1131 }
1132
1133 static __inline void
1134 wiphy_unlock(struct wiphy *wiphy)
1135 {
1136         TODO();
1137 }
1138
1139 static __inline void
1140 wiphy_rfkill_set_hw_state_reason(struct wiphy *wiphy, bool blocked,
1141     enum rfkill_hard_block_reasons reason)
1142 {
1143         TODO();
1144 }
1145
1146 /* -------------------------------------------------------------------------- */
1147
1148 static __inline bool
1149 rfkill_blocked(int rfkill)              /* argument type? */
1150 {
1151         TODO();
1152         return (false);
1153 }
1154
1155 static __inline bool
1156 rfkill_soft_blocked(int rfkill)
1157 {
1158         TODO();
1159         return (false);
1160 }
1161
1162 static __inline int
1163 reg_query_regdb_wmm(uint8_t *alpha2, uint32_t center_freq,
1164     struct ieee80211_reg_rule *rule)
1165 {
1166
1167         /* ETSI has special rules. FreeBSD regdb needs to learn about them. */
1168         TODO();
1169
1170         return (-ENXIO);
1171 }
1172
1173 static __inline const u8 *
1174 cfg80211_find_ie_match(uint32_t f, const u8 *ies, size_t ies_len,
1175     const u8 *match, int x, int y)
1176 {
1177         TODO();
1178         return (NULL);
1179 }
1180
1181 static __inline const u8 *
1182 cfg80211_find_ie(uint8_t eid, const uint8_t *ie, uint32_t ielen)
1183 {
1184         TODO();
1185         return (NULL);
1186 }
1187
1188 static __inline void
1189 cfg80211_pmsr_complete(struct wireless_dev *wdev,
1190     struct cfg80211_pmsr_request *req, gfp_t gfp)
1191 {
1192         TODO();
1193 }
1194
1195 static __inline void
1196 cfg80211_pmsr_report(struct wireless_dev *wdev,
1197     struct cfg80211_pmsr_request *req,
1198     struct cfg80211_pmsr_result *result, gfp_t gfp)
1199 {
1200         TODO();
1201 }
1202
1203 static __inline void
1204 cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
1205     struct linuxkpi_ieee80211_channel *chan, enum nl80211_chan_flags chan_flag)
1206 {
1207
1208         KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__));
1209         KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__));
1210
1211         memset(chandef, 0, sizeof(*chandef));
1212         chandef->chan = chan;
1213         chandef->center_freq2 = 0;      /* Set here and only overwrite if needed. */
1214
1215         switch (chan_flag) {
1216         case NL80211_CHAN_NO_HT:
1217                 chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
1218                 chandef->center_freq1 = chan->center_freq;
1219                 break;
1220         default:
1221                 if (chan->flags & IEEE80211_CHAN_NO_HT40)
1222                         chandef->width = NL80211_CHAN_WIDTH_20;
1223                 else if (chan->flags & IEEE80211_CHAN_NO_80MHZ)
1224                         chandef->width = NL80211_CHAN_WIDTH_40;
1225                 else if (chan->flags & IEEE80211_CHAN_NO_160MHZ)
1226                         chandef->width = NL80211_CHAN_WIDTH_80;
1227                 else {
1228                         chandef->width = NL80211_CHAN_WIDTH_160;
1229                         IMPROVE("80P80 and 320 ...");
1230                 }
1231                 chandef->center_freq1 = chan->center_freq;
1232                 break;
1233         };
1234 }
1235
1236 static __inline void
1237 cfg80211_bss_iter(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
1238     void (*iterfunc)(struct wiphy *, struct cfg80211_bss *, void *), void *data)
1239 {
1240         TODO();
1241 }
1242
1243 struct element {
1244         uint8_t                                 id;
1245         uint8_t                                 datalen;
1246         uint8_t                                 data[0];
1247 } __packed;
1248
1249 static __inline const struct element *
1250 cfg80211_find_elem(enum ieee80211_eid eid, uint8_t *data, size_t len)
1251 {
1252         TODO();
1253         return (NULL);
1254 }
1255
1256 static __inline uint32_t
1257 cfg80211_calculate_bitrate(struct rate_info *rate)
1258 {
1259         TODO();
1260         return (-1);
1261 }
1262
1263 static __inline uint32_t
1264 ieee80211_channel_to_frequency(uint32_t channel, enum nl80211_band band)
1265 {
1266
1267         return (linuxkpi_ieee80211_channel_to_frequency(channel, band));
1268 }
1269
1270 static __inline uint32_t
1271 ieee80211_frequency_to_channel(uint32_t freq)
1272 {
1273
1274         return (linuxkpi_ieee80211_frequency_to_channel(freq, 0));
1275 }
1276
1277 static __inline int
1278 regulatory_set_wiphy_regd_sync(struct wiphy *wiphy,
1279     struct linuxkpi_ieee80211_regdomain *regd)
1280 {
1281         IMPROVE();
1282         return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd));
1283 }
1284
1285 static __inline int
1286 regulatory_set_wiphy_regd_sync_rtnl(struct wiphy *wiphy,
1287     struct linuxkpi_ieee80211_regdomain *regd)
1288 {
1289
1290         IMPROVE();
1291         return (linuxkpi_regulatory_set_wiphy_regd_sync(wiphy, regd));
1292 }
1293
1294 static __inline int
1295 regulatory_set_wiphy_regd(struct wiphy *wiphy,
1296     struct linuxkpi_ieee80211_regdomain *regd)
1297 {
1298
1299         IMPROVE();
1300         if (regd == NULL)
1301                 return (EINVAL);
1302
1303         /* XXX-BZ wild guessing here based on brcmfmac. */
1304         if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED)
1305                 wiphy->regd = regd;
1306         else
1307                 return (EPERM);
1308
1309         /* XXX FIXME, do we have to do anything with reg_notifier? */
1310         return (0);
1311 }
1312
1313 static __inline int
1314 regulatory_hint(struct wiphy *wiphy, const uint8_t *alpha2)
1315 {
1316         TODO();
1317         return (-ENXIO);
1318 }
1319
1320 static __inline const char *
1321 reg_initiator_name(enum nl80211_reg_initiator initiator)
1322 {
1323         TODO();
1324         return (NULL);
1325 }
1326
1327 static __inline struct linuxkpi_ieee80211_regdomain *
1328 rtnl_dereference(const struct linuxkpi_ieee80211_regdomain *regd)
1329 {
1330         TODO();
1331         return (NULL);
1332 }
1333
1334 static __inline struct ieee80211_reg_rule *
1335 freq_reg_info(struct wiphy *wiphy, uint32_t center_freq)
1336 {
1337         TODO();
1338         return (NULL);
1339 }
1340
1341 static __inline struct cfg80211_bss *
1342 cfg80211_get_bss(struct wiphy *wiphy, struct linuxkpi_ieee80211_channel *chan,
1343     uint8_t *bssid, void *p, int x, uint32_t f1, uint32_t f2)
1344 {
1345         TODO();
1346         return (NULL);
1347 }
1348
1349 static __inline void
1350 cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss)
1351 {
1352         TODO();
1353 }
1354
1355 static __inline void
1356 wiphy_apply_custom_regulatory(struct wiphy *wiphy,
1357     const struct linuxkpi_ieee80211_regdomain *regd)
1358 {
1359         TODO();
1360 }
1361
1362 static __inline char *
1363 wiphy_name(struct wiphy *wiphy)
1364 {
1365         if (wiphy != NULL && wiphy->dev != NULL)
1366                 return dev_name(wiphy->dev);
1367         else {
1368                 IMPROVE("wlanNA");
1369                 return ("wlanNA");
1370         }
1371 }
1372
1373 static __inline void
1374 wiphy_read_of_freq_limits(struct wiphy *wiphy)
1375 {
1376 #ifdef FDT
1377         TODO();
1378 #endif
1379 }
1380
1381 static __inline uint8_t *
1382 cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
1383     uint8_t *data, size_t len)
1384 {
1385         TODO();
1386         return (NULL);
1387 }
1388
1389 static __inline void
1390 wiphy_ext_feature_set(struct wiphy *wiphy, enum nl80211_ext_feature ef)
1391 {
1392
1393         set_bit(ef, wiphy->ext_features);
1394 }
1395
1396 static __inline void *
1397 wiphy_net(struct wiphy *wiphy)
1398 {
1399         TODO();
1400         return (NULL);  /* XXX passed to dev_net_set() */
1401 }
1402
1403 static __inline int
1404 wiphy_register(struct wiphy *wiphy)
1405 {
1406         TODO();
1407         return (0);
1408 }
1409
1410 static __inline void
1411 wiphy_unregister(struct wiphy *wiphy)
1412 {
1413         TODO();
1414 }
1415
1416 static __inline void
1417 wiphy_warn(struct wiphy *wiphy, const char *fmt, ...)
1418 {
1419         TODO();
1420 }
1421
1422 static __inline int
1423 cfg80211_check_combinations(struct wiphy *wiphy,
1424     struct iface_combination_params *params)
1425 {
1426         TODO();
1427         return (-ENOENT);
1428 }
1429
1430 static __inline uint8_t
1431 cfg80211_classify8021d(struct sk_buff *skb, void *p)
1432 {
1433         TODO();
1434         return (0);
1435 }
1436
1437 static __inline void
1438 cfg80211_connect_done(struct net_device *ndev,
1439     struct cfg80211_connect_resp_params *conn_params, gfp_t gfp)
1440 {
1441         TODO();
1442 }
1443
1444 static __inline void
1445 cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp)
1446 {
1447         TODO();
1448 }
1449
1450 static __inline void
1451 cfg80211_disconnected(struct net_device *ndev, uint16_t reason,
1452     void *p, int x, bool locally_generated, gfp_t gfp)
1453 {
1454         TODO();
1455 }
1456
1457 static __inline int
1458 cfg80211_get_p2p_attr(const u8 *ie, u32 ie_len,
1459     enum ieee80211_p2p_attr_ids attr, u8 *p, size_t p_len)
1460 {
1461         TODO();
1462         return (-1);
1463 }
1464
1465 static __inline void
1466 cfg80211_ibss_joined(struct net_device *ndev, const uint8_t *addr,
1467     struct linuxkpi_ieee80211_channel *chan, gfp_t gfp)
1468 {
1469         TODO();
1470 }
1471
1472 static __inline struct cfg80211_bss *
1473 cfg80211_inform_bss(struct wiphy *wiphy,
1474     struct linuxkpi_ieee80211_channel *channel,
1475     enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x,
1476     uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len,
1477     int signal, gfp_t gfp)
1478 {
1479         TODO();
1480         return (NULL);
1481 }
1482
1483 static __inline struct cfg80211_bss *
1484 cfg80211_inform_bss_data(struct wiphy *wiphy,
1485     struct cfg80211_inform_bss *bss_data,
1486     enum cfg80211_bss_frame_type bss_ftype, const uint8_t *bss, int _x,
1487     uint16_t cap, uint16_t intvl, const uint8_t *ie, size_t ie_len, gfp_t gfp)
1488 {
1489         TODO();
1490         return (NULL);
1491 }
1492
1493 static __inline void
1494 cfg80211_mgmt_tx_status(struct wireless_dev *wdev, uint64_t cookie,
1495     const u8 *buf, size_t len, bool ack, gfp_t gfp)
1496 {
1497         TODO();
1498 }
1499
1500 static __inline void
1501 cfg80211_michael_mic_failure(struct net_device *ndev, const uint8_t *addr,
1502     enum nl80211_key_type key_type, int _x, void *p, gfp_t gfp)
1503 {
1504         TODO();
1505 }
1506
1507 static __inline void
1508 cfg80211_new_sta(struct net_device *ndev, const uint8_t *addr,
1509     struct station_info *sinfo, gfp_t gfp)
1510 {
1511         TODO();
1512 }
1513
1514 static __inline void
1515 cfg80211_del_sta(struct net_device *ndev, const uint8_t *addr, gfp_t gfp)
1516 {
1517         TODO();
1518 }
1519
1520 static __inline void
1521 cfg80211_port_authorized(struct net_device *ndev, const uint8_t *bssid,
1522     gfp_t gfp)
1523 {
1524         TODO();
1525 }
1526
1527 static __inline void
1528 cfg80211_ready_on_channel(struct wireless_dev *wdev, uint64_t cookie,
1529     struct linuxkpi_ieee80211_channel *channel, unsigned int duration,
1530     gfp_t gfp)
1531 {
1532         TODO();
1533 }
1534
1535 static __inline void
1536 cfg80211_remain_on_channel_expired(struct wireless_dev *wdev,
1537     uint64_t cookie, struct linuxkpi_ieee80211_channel *channel, gfp_t gfp)
1538 {
1539         TODO();
1540 }
1541
1542 static __inline void
1543 cfg80211_report_wowlan_wakeup(void)
1544 {
1545         TODO();
1546 }
1547
1548 static __inline void
1549 cfg80211_roamed(struct net_device *ndev, struct cfg80211_roam_info *roam_info,
1550     gfp_t gfp)
1551 {
1552         TODO();
1553 }
1554
1555 static __inline void
1556 cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int _x,
1557     uint8_t *p, size_t p_len, int _x2)
1558 {
1559         TODO();
1560 }
1561
1562 static __inline void
1563 cfg80211_scan_done(struct cfg80211_scan_request *scan_request,
1564     struct cfg80211_scan_info *info)
1565 {
1566         TODO();
1567 }
1568
1569 static __inline void
1570 cfg80211_sched_scan_results(struct wiphy *wiphy, uint64_t reqid)
1571 {
1572         TODO();
1573 }
1574
1575 static __inline void
1576 cfg80211_sched_scan_stopped(struct wiphy *wiphy, int _x)
1577 {
1578         TODO();
1579 }
1580
1581 static __inline void
1582 cfg80211_unregister_wdev(struct wireless_dev *wdev)
1583 {
1584         TODO();
1585 }
1586
1587 static __inline struct sk_buff *
1588 cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, unsigned int len)
1589 {
1590         TODO();
1591         return (NULL);
1592 }
1593
1594 static __inline int
1595 cfg80211_vendor_cmd_reply(struct sk_buff *skb)
1596 {
1597         TODO();
1598         return (-ENXIO);
1599 }
1600
1601 static __inline struct linuxkpi_ieee80211_channel *
1602 ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq)
1603 {
1604
1605         return (linuxkpi_ieee80211_get_channel(wiphy, freq));
1606 }
1607
1608 static __inline size_t
1609 ieee80211_get_hdrlen_from_skb(struct sk_buff *skb)
1610 {
1611
1612         TODO();
1613         return (-1);
1614 }
1615
1616 static __inline void
1617 cfg80211_bss_flush(struct wiphy *wiphy)
1618 {
1619
1620         linuxkpi_cfg80211_bss_flush(wiphy);
1621 }
1622
1623 static __inline bool
1624 cfg80211_channel_is_psc(struct linuxkpi_ieee80211_channel *channel)
1625 {
1626
1627         /* Only 6Ghz. */
1628         if (channel->band != NL80211_BAND_6GHZ)
1629                 return (false);
1630
1631         TODO();
1632         return (false);
1633 }
1634
1635 static __inline int
1636 cfg80211_get_ies_channel_number(const uint8_t *ie, size_t len,
1637     enum nl80211_band band, enum cfg80211_bss_frame_type ftype)
1638 {
1639
1640         TODO();
1641         return (-1);
1642 }
1643
1644 /* Used for scanning at least. */
1645 static __inline void
1646 get_random_mask_addr(uint8_t *dst, const uint8_t *addr, const uint8_t *mask)
1647 {
1648         int i;
1649
1650         /* Get a completely random address and then overlay what we want. */
1651         get_random_bytes(dst, ETH_ALEN);
1652         for (i = 0; i < ETH_ALEN; i++)
1653                 dst[i] = (dst[i] & ~(mask[i])) | (addr[i] & mask[i]);
1654 }
1655
1656 static __inline void
1657 cfg80211_shutdown_all_interfaces(struct wiphy *wiphy)
1658 {
1659         TODO();
1660 }
1661
1662 static __inline bool
1663 cfg80211_reg_can_beacon(struct wiphy *wiphy, struct cfg80211_chan_def *chandef,
1664     enum nl80211_iftype iftype)
1665 {
1666         TODO();
1667         return (false);
1668 }
1669
1670 static __inline void
1671 cfg80211_background_radar_event(struct wiphy *wiphy,
1672     struct cfg80211_chan_def *chandef, gfp_t gfp)
1673 {
1674         TODO();
1675 }
1676
1677 static __inline const u8 *
1678 cfg80211_find_ext_ie(uint8_t eid, uint8_t *p, size_t len)
1679 {
1680         TODO();
1681         return (NULL);
1682 }
1683
1684 static __inline bool
1685 cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
1686 {
1687         TODO();
1688         return (false);
1689 }
1690
1691 #define wiphy_info(wiphy, fmt, ...)                                     \
1692         printf("%s:%d XXX TODO " fmt, __func__, __LINE__, __VA_ARGS__)
1693
1694 #ifndef LINUXKPI_NET80211
1695 #define ieee80211_channel               linuxkpi_ieee80211_channel
1696 #define ieee80211_regdomain             linuxkpi_ieee80211_regdomain
1697 #endif
1698
1699 #endif  /* _LINUXKPI_NET_CFG80211_H */