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