xref: /freebsd/sys/compat/linuxkpi/common/include/net/mac80211.h (revision 657729a89dd578d8cfc70d6616f5c65a48a8b33a)
1 /*-
2  * Copyright (c) 2020-2022 The FreeBSD Foundation
3  * Copyright (c) 2020-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_MAC80211_H
33 #define	_LINUXKPI_NET_MAC80211_H
34 
35 #include <sys/types.h>
36 
37 #include <asm/atomic64.h>
38 #include <linux/bitops.h>
39 #include <linux/etherdevice.h>
40 #include <linux/ethtool.h>
41 #include <linux/netdevice.h>
42 #include <linux/skbuff.h>
43 #include <linux/workqueue.h>
44 #include <linux/dcache.h>
45 #include <net/cfg80211.h>
46 
47 #define	ARPHRD_IEEE80211_RADIOTAP		__LINE__ /* XXX TODO brcmfmac */
48 
49 #define	WLAN_OUI_MICROSOFT			(0x0050F2)
50 #define	WLAN_OUI_TYPE_MICROSOFT_WPA		(1)
51 #define	WLAN_OUI_TYPE_MICROSOFT_TPC		(8)
52 #define	WLAN_OUI_TYPE_WFA_P2P			(9)
53 #define	WLAN_OUI_WFA				(0x506F9A)
54 
55 /* hw->conf.flags */
56 enum ieee80211_hw_conf_flags {
57 	IEEE80211_CONF_IDLE			= BIT(0),
58 	IEEE80211_CONF_PS			= BIT(1),
59 	IEEE80211_CONF_MONITOR			= BIT(2),
60 	IEEE80211_CONF_OFFCHANNEL		= BIT(3),
61 };
62 
63 /* (*ops->config()) */
64 enum ieee80211_hw_conf_changed_flags {
65 	IEEE80211_CONF_CHANGE_CHANNEL		= BIT(0),
66 	IEEE80211_CONF_CHANGE_IDLE		= BIT(1),
67 	IEEE80211_CONF_CHANGE_PS		= BIT(2),
68 	IEEE80211_CONF_CHANGE_MONITOR		= BIT(3),
69 	IEEE80211_CONF_CHANGE_POWER		= BIT(4),
70 };
71 
72 #define	CFG80211_TESTMODE_CMD(_x)	/* XXX TODO */
73 #define	CFG80211_TESTMODE_DUMP(_x)	/* XXX TODO */
74 
75 #define	FCS_LEN				4
76 
77 /* ops.configure_filter() */
78 enum mcast_filter_flags {
79 	FIF_ALLMULTI			= BIT(0),
80 	FIF_PROBE_REQ			= BIT(1),
81 	FIF_BCN_PRBRESP_PROMISC		= BIT(2),
82 	FIF_FCSFAIL			= BIT(3),
83 	FIF_OTHER_BSS			= BIT(4),
84 	FIF_PSPOLL			= BIT(5),
85 	FIF_CONTROL			= BIT(6),
86 };
87 
88 enum ieee80211_bss_changed {
89 	BSS_CHANGED_ARP_FILTER		= BIT(0),
90 	BSS_CHANGED_ASSOC		= BIT(1),
91 	BSS_CHANGED_BANDWIDTH		= BIT(2),
92 	BSS_CHANGED_BEACON		= BIT(3),
93 	BSS_CHANGED_BEACON_ENABLED	= BIT(4),
94 	BSS_CHANGED_BEACON_INFO		= BIT(5),
95 	BSS_CHANGED_BEACON_INT		= BIT(6),
96 	BSS_CHANGED_BSSID		= BIT(7),
97 	BSS_CHANGED_CQM			= BIT(8),
98 	BSS_CHANGED_ERP_CTS_PROT	= BIT(9),
99 	BSS_CHANGED_ERP_SLOT		= BIT(10),
100 	BSS_CHANGED_FTM_RESPONDER	= BIT(11),
101 	BSS_CHANGED_HT			= BIT(12),
102 	BSS_CHANGED_IDLE		= BIT(13),
103 	BSS_CHANGED_MU_GROUPS		= BIT(14),
104 	BSS_CHANGED_P2P_PS		= BIT(15),
105 	BSS_CHANGED_PS			= BIT(16),
106 	BSS_CHANGED_QOS			= BIT(17),
107 	BSS_CHANGED_TXPOWER		= BIT(18),
108 	BSS_CHANGED_HE_BSS_COLOR	= BIT(19),
109 	BSS_CHANGED_AP_PROBE_RESP	= BIT(20),
110 	BSS_CHANGED_BASIC_RATES		= BIT(21),
111 	BSS_CHANGED_ERP_PREAMBLE	= BIT(22),
112 	BSS_CHANGED_IBSS		= BIT(23),
113 	BSS_CHANGED_MCAST_RATE		= BIT(24),
114 	BSS_CHANGED_SSID		= BIT(25),
115 	BSS_CHANGED_FILS_DISCOVERY	= BIT(26),
116 	BSS_CHANGED_HE_OBSS_PD		= BIT(27),
117 	BSS_CHANGED_TWT			= BIT(28),
118 	BSS_CHANGED_UNSOL_BCAST_PROBE_RESP = BIT(30),
119 };
120 
121 /* 802.11 Figure 9-256 Suite selector format. [OUI(3), SUITE TYPE(1)] */
122 #define	WLAN_CIPHER_SUITE_OUI(_oui, _x)	(((_oui) << 8) | ((_x) & 0xff))
123 
124 /* 802.11 Table 9-131 Cipher suite selectors. */
125 /* 802.1x suite B			11 */
126 #define	WLAN_CIPHER_SUITE(_x)		WLAN_CIPHER_SUITE_OUI(0x000fac, _x)
127 /* Use group				0 */
128 #define	WLAN_CIPHER_SUITE_WEP40		WLAN_CIPHER_SUITE(1)
129 #define	WLAN_CIPHER_SUITE_TKIP		WLAN_CIPHER_SUITE(2)
130 /* Reserved				3 */
131 #define	WLAN_CIPHER_SUITE_CCMP		WLAN_CIPHER_SUITE(4)	/* CCMP-128 */
132 #define	WLAN_CIPHER_SUITE_WEP104	WLAN_CIPHER_SUITE(5)
133 #define	WLAN_CIPHER_SUITE_AES_CMAC	WLAN_CIPHER_SUITE(6)	/* BIP-CMAC-128 */
134 /* Group addressed traffic not allowed	7 */
135 #define	WLAN_CIPHER_SUITE_GCMP		WLAN_CIPHER_SUITE(8)
136 #define	WLAN_CIPHER_SUITE_GCMP_256	WLAN_CIPHER_SUITE(9)
137 #define	WLAN_CIPHER_SUITE_CCMP_256	WLAN_CIPHER_SUITE(10)
138 #define	WLAN_CIPHER_SUITE_BIP_GMAC_128	WLAN_CIPHER_SUITE(11)
139 #define	WLAN_CIPHER_SUITE_BIP_GMAC_256	WLAN_CIPHER_SUITE(12)
140 #define	WLAN_CIPHER_SUITE_BIP_CMAC_256	WLAN_CIPHER_SUITE(13)
141 /* Reserved				14-255 */
142 
143 /* See ISO/IEC JTC 1 N 9880 Table 11 */
144 #define	WLAN_CIPHER_SUITE_SMS4		WLAN_CIPHER_SUITE_OUI(0x001472, 1)
145 
146 
147 /* 802.11 Table 9-133 AKM suite selectors. */
148 #define	WLAN_AKM_SUITE(_x)		WLAN_CIPHER_SUITE_OUI(0x000fac, _x)
149 /* Reserved				0 */
150 #define	WLAN_AKM_SUITE_8021X		WLAN_AKM_SUITE(1)
151 #define	WLAN_AKM_SUITE_PSK		WLAN_AKM_SUITE(2)
152 #define	WLAN_AKM_SUITE_FT_8021X		WLAN_AKM_SUITE(3)
153 #define	WLAN_AKM_SUITE_FT_PSK		WLAN_AKM_SUITE(4)
154 #define	WLAN_AKM_SUITE_8021X_SHA256	WLAN_AKM_SUITE(5)
155 #define	WLAN_AKM_SUITE_PSK_SHA256	WLAN_AKM_SUITE(6)
156 /* TDLS					7 */
157 #define	WLAN_AKM_SUITE_SAE		WLAN_AKM_SUITE(8)
158 /* FToSAE				9 */
159 /* AP peer key				10 */
160 /* 802.1x suite B			11 */
161 /* 802.1x suite B 384			12 */
162 /* FTo802.1x 384			13 */
163 /* Reserved				14-255 */
164 /* Apparently 11ax defines more. Seen (19,20) mentioned. */
165 
166 #define	TKIP_PN_TO_IV16(_x)		((uint16_t)(_x & 0xffff))
167 #define	TKIP_PN_TO_IV32(_x)		((uint32_t)((_x >> 16) & 0xffffffff))
168 
169 struct ieee80211_sta;
170 
171 /* 802.11-2020 9.4.2.55.3 A-MPDU Parameters field */
172 #define	IEEE80211_HT_AMPDU_PARM_FACTOR		0x3
173 #define	IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT	2
174 #define	IEEE80211_HT_AMPDU_PARM_DENSITY		(0x7 << IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT)
175 
176 struct ieee80211_ampdu_params {
177 	/* TODO FIXME */
178 	struct ieee80211_sta			*sta;
179 	uint8_t					tid;
180 	uint16_t				ssn;
181 	int		action, amsdu, buf_size, timeout;
182 };
183 
184 struct ieee80211_bar {
185 	/* TODO FIXME */
186 	int		control, start_seq_num;
187 	uint8_t		*ra;
188 	uint16_t	frame_control;
189 };
190 
191 struct ieee80211_p2p_noa_desc {
192 	uint32_t				count;		/* uint8_t ? */
193 	uint32_t				duration;
194 	uint32_t				interval;
195 	uint32_t				start_time;
196 };
197 
198 struct ieee80211_p2p_noa_attr {
199 	uint8_t					index;
200 	uint8_t					oppps_ctwindow;
201 	struct ieee80211_p2p_noa_desc		desc[4];
202 };
203 
204 struct ieee80211_mutable_offsets {
205 	/* TODO FIXME */
206 	uint16_t				tim_offset;
207 	uint16_t				cntdwn_counter_offs[2];
208 
209 	int	mbssid_off;
210 };
211 
212 struct mac80211_fils_discovery {
213 	uint32_t				max_interval;
214 };
215 
216 struct ieee80211_chanctx_conf {
217 	/* TODO FIXME */
218 	int		rx_chains_dynamic, rx_chains_static;
219 	bool					radar_enabled;
220 	struct cfg80211_chan_def		def;
221 	struct cfg80211_chan_def		min_def;
222 
223 	/* Must stay last. */
224 	uint8_t					drv_priv[0] __aligned(CACHE_LINE_SIZE);
225 };
226 
227 #define	WLAN_MEMBERSHIP_LEN			(8)
228 #define	WLAN_USER_POSITION_LEN			(16)
229 
230 struct ieee80211_bss_conf {
231 	/* TODO FIXME */
232 	const uint8_t				*bssid;
233 	uint8_t					transmitter_bssid[ETH_ALEN];
234 	struct ieee80211_ftm_responder_params	*ftmr_params;
235 	struct ieee80211_p2p_noa_attr		p2p_noa_attr;
236 	struct cfg80211_chan_def		chandef;
237 	__be32					arp_addr_list[1];	/* XXX TODO */
238 	struct ieee80211_rate			*beacon_rate;
239 	struct {
240 		uint8_t membership[WLAN_MEMBERSHIP_LEN];
241 		uint8_t position[WLAN_USER_POSITION_LEN];
242 	}  mu_group;
243 	struct {
244 		uint32_t			params;
245 		/* single field struct? */
246 	} he_oper;
247 	struct cfg80211_he_bss_color		he_bss_color;
248 	struct ieee80211_he_obss_pd		he_obss_pd;
249 	size_t					ssid_len;
250 	uint8_t					ssid[IEEE80211_NWID_LEN];
251 	uint16_t				aid;
252 	uint16_t				ht_operation_mode;
253 	int					arp_addr_cnt;
254 
255 	uint8_t					dtim_period;
256 	uint8_t					sync_dtim_count;
257 	bool					assoc;
258 	bool					idle;
259 	bool					qos;
260 	bool					ps;
261 	bool					twt_broadcast;
262 	bool					use_cts_prot;
263 	bool					use_short_preamble;
264 	bool					use_short_slot;
265 	bool					he_support;
266 	bool					csa_active;
267 	uint32_t				sync_device_ts;
268 	uint64_t				sync_tsf;
269 	uint16_t				beacon_int;
270 	int16_t					txpower;
271 	uint32_t				basic_rates;
272 	int					mcast_rate[NUM_NL80211_BANDS];
273 	struct cfg80211_bitrate_mask		beacon_tx_rate;
274 	struct mac80211_fils_discovery		fils_discovery;
275 	struct ieee80211_chanctx_conf		*chanctx_conf;
276 
277 	int		ack_enabled, bssid_index, bssid_indicator, cqm_rssi_hyst, cqm_rssi_thold, ema_ap, frame_time_rts_th, ftm_responder;
278 	int		htc_trig_based_pkt_ext;
279 	int		multi_sta_back_32bit, nontransmitted;
280 	int		profile_periodicity;
281 	int		twt_requester, uora_exists, uora_ocw_range;
282 	int		assoc_capability, enable_beacon, hidden_ssid, ibss_joined, twt_protected;
283 	int		twt_responder, unsol_bcast_probe_resp_interval;
284 	int		color_change_active;
285 };
286 
287 struct ieee80211_channel_switch {
288 	/* TODO FIXME */
289 	int		block_tx, count, delay, device_timestamp, timestamp;
290 	struct cfg80211_chan_def		chandef;
291 };
292 
293 struct ieee80211_cipher_scheme {
294 	uint32_t	cipher;
295 	uint8_t		iftype;		/* We do not know the size of this. */
296 	uint8_t		hdr_len;
297 	uint8_t		pn_len;
298 	uint8_t		pn_off;
299 	uint8_t		key_idx_off;
300 	uint8_t		key_idx_mask;
301 	uint8_t		key_idx_shift;
302 	uint8_t		mic_len;
303 };
304 
305 enum ieee80211_event_type {
306 	BA_FRAME_TIMEOUT,
307 	BAR_RX_EVENT,
308 	MLME_EVENT,
309 	RSSI_EVENT,
310 };
311 
312 enum ieee80211_rssi_event_data {
313 	RSSI_EVENT_LOW,
314 	RSSI_EVENT_HIGH,
315 };
316 
317 enum ieee80211_mlme_event_data {
318 	ASSOC_EVENT,
319 	AUTH_EVENT,
320 	DEAUTH_RX_EVENT,
321 	DEAUTH_TX_EVENT,
322 };
323 
324 enum ieee80211_mlme_event_status {
325 	MLME_DENIED,
326 	MLME_TIMEOUT,
327 };
328 
329 struct ieee80211_mlme_event {
330 	enum ieee80211_mlme_event_data		data;
331 	enum ieee80211_mlme_event_status	status;
332 	int					reason;
333 };
334 
335 struct ieee80211_event {
336 	/* TODO FIXME */
337 	enum ieee80211_event_type		type;
338 	union {
339 		struct {
340 			int     ssn;
341 			struct ieee80211_sta	*sta;
342 			uint8_t		 	tid;
343 		} ba;
344 		struct ieee80211_mlme_event	mlme;
345 	} u;
346 };
347 
348 struct ieee80211_ftm_responder_params {
349 	/* TODO FIXME */
350 	uint8_t					*lci;
351 	uint8_t					*civicloc;
352 	int					lci_len;
353 	int					civicloc_len;
354 };
355 
356 struct ieee80211_he_mu_edca_param_ac_rec {
357 	/* TODO FIXME */
358 	int		aifsn, ecw_min_max, mu_edca_timer;
359 };
360 
361 struct ieee80211_conf {
362 	int					dynamic_ps_timeout;
363 	int					power_level;
364 	uint32_t				listen_interval;
365 	bool					radar_enabled;
366 	enum ieee80211_hw_conf_flags		flags;
367 	struct cfg80211_chan_def		chandef;
368 };
369 
370 enum ieee80211_hw_flags {
371 	IEEE80211_HW_AMPDU_AGGREGATION,
372 	IEEE80211_HW_AP_LINK_PS,
373 	IEEE80211_HW_BUFF_MMPDU_TXQ,
374 	IEEE80211_HW_CHANCTX_STA_CSA,
375 	IEEE80211_HW_CONNECTION_MONITOR,
376 	IEEE80211_HW_DEAUTH_NEED_MGD_TX_PREP,
377 	IEEE80211_HW_HAS_RATE_CONTROL,
378 	IEEE80211_HW_MFP_CAPABLE,
379 	IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR,
380 	IEEE80211_HW_REPORTS_TX_ACK_STATUS,
381 	IEEE80211_HW_RX_INCLUDES_FCS,
382 	IEEE80211_HW_SIGNAL_DBM,
383 	IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS,
384 	IEEE80211_HW_SPECTRUM_MGMT,
385 	IEEE80211_HW_STA_MMPDU_TXQ,
386 	IEEE80211_HW_SUPPORTS_AMSDU_IN_AMPDU,
387 	IEEE80211_HW_SUPPORTS_CLONED_SKBS,
388 	IEEE80211_HW_SUPPORTS_DYNAMIC_PS,
389 	IEEE80211_HW_SUPPORTS_MULTI_BSSID,
390 	IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID,
391 	IEEE80211_HW_SUPPORTS_PS,
392 	IEEE80211_HW_SUPPORTS_REORDERING_BUFFER,
393 	IEEE80211_HW_SUPPORTS_VHT_EXT_NSS_BW,
394 	IEEE80211_HW_SUPPORT_FAST_XMIT,
395 	IEEE80211_HW_TDLS_WIDER_BW,
396 	IEEE80211_HW_TIMING_BEACON_ONLY,
397 	IEEE80211_HW_TX_AMPDU_SETUP_IN_HW,
398 	IEEE80211_HW_TX_AMSDU,
399 	IEEE80211_HW_TX_FRAG_LIST,
400 	IEEE80211_HW_USES_RSS,
401 	IEEE80211_HW_WANT_MONITOR_VIF,
402 	IEEE80211_HW_SW_CRYPTO_CONTROL,
403 	IEEE80211_HW_SUPPORTS_TX_FRAG,
404 	IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA,
405 	IEEE80211_HW_SUPPORTS_PER_STA_GTK,
406 	IEEE80211_HW_REPORTS_LOW_ACK,
407 	IEEE80211_HW_QUEUE_CONTROL,
408 	IEEE80211_HW_SUPPORTS_RX_DECAP_OFFLOAD,
409 	IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD,
410 	IEEE80211_HW_SUPPORTS_RC_TABLE,
411 
412 	/* Keep last. */
413 	NUM_IEEE80211_HW_FLAGS
414 };
415 
416 struct ieee80211_hw {
417 
418 	struct wiphy			*wiphy;
419 
420 	/* TODO FIXME */
421 	int		max_rx_aggregation_subframes, max_tx_aggregation_subframes;
422 	int		extra_tx_headroom, weight_multiplier;
423 	int		max_rate_tries, max_rates, max_report_rates;
424 	struct ieee80211_cipher_scheme	*cipher_schemes;
425 	int				n_cipher_schemes;
426 	const char			*rate_control_algorithm;
427 	struct {
428 		uint16_t units_pos;	/* radiotap "spec" is .. inconsistent. */
429 		uint16_t accuracy;
430 	} radiotap_timestamp;
431 	size_t				sta_data_size;
432 	size_t				vif_data_size;
433 	size_t				chanctx_data_size;
434 	size_t				txq_data_size;
435 	uint16_t			radiotap_mcs_details;
436 	uint16_t			radiotap_vht_details;
437 	uint16_t			queues;
438 	uint16_t			offchannel_tx_hw_queue;
439 	uint16_t			uapsd_max_sp_len;
440 	uint16_t			uapsd_queues;
441 	uint16_t			max_tx_fragments;
442 	uint16_t			max_listen_interval;
443 	uint32_t			extra_beacon_tailroom;
444 	netdev_features_t		netdev_features;
445 	unsigned long			flags[BITS_TO_LONGS(NUM_IEEE80211_HW_FLAGS)];
446 	struct ieee80211_conf		conf;
447 
448 #if 0	/* leave here for documentation purposes.  This does NOT work. */
449 	/* Must stay last. */
450 	uint8_t				priv[0] __aligned(CACHE_LINE_SIZE);
451 #else
452 	void				*priv;
453 #endif
454 };
455 
456 enum ieee802111_key_flag {
457 	IEEE80211_KEY_FLAG_GENERATE_IV		= BIT(0),
458 	IEEE80211_KEY_FLAG_GENERATE_MMIC	= BIT(1),
459 	IEEE80211_KEY_FLAG_PAIRWISE		= BIT(2),
460 	IEEE80211_KEY_FLAG_PUT_IV_SPACE		= BIT(3),
461 	IEEE80211_KEY_FLAG_PUT_MIC_SPACE	= BIT(4),
462 	IEEE80211_KEY_FLAG_SW_MGMT_TX		= BIT(5),
463 	IEEE80211_KEY_FLAG_GENERATE_IV_MGMT	= BIT(6),
464 	IEEE80211_KEY_FLAG_GENERATE_MMIE	= BIT(7),
465 	IEEE80211_KEY_FLAG_RESERVE_TAILROOM	= BIT(8),
466 };
467 
468 struct ieee80211_key_conf {
469 	atomic64_t			tx_pn;
470 	uint32_t			cipher;
471 	uint8_t				icv_len;	/* __unused nowadays? */
472 	uint8_t				iv_len;
473 	uint8_t				hw_key_idx;	/* Set by drv. */
474 	uint8_t				keyidx;
475 	uint16_t			flags;
476 	uint8_t				keylen;
477 	uint8_t				key[0];
478 };
479 
480 struct ieee80211_key_seq {
481 	/* TODO FIXME */
482 	union {
483 		struct {
484 			uint8_t		seq[IEEE80211_MAX_PN_LEN];
485 			uint8_t		seq_len;
486 		} hw;
487 		struct {
488 			uint8_t		pn[IEEE80211_CCMP_PN_LEN];
489 		} ccmp;
490 		struct {
491 			uint8_t		pn[IEEE80211_CCMP_PN_LEN];
492 		} aes_cmac;
493 		struct {
494 			uint32_t	iv32;
495 			uint16_t	iv16;
496 		} tkip;
497 	};
498 };
499 
500 
501 enum ieee80211_rx_status_flags {
502 	RX_FLAG_ALLOW_SAME_PN		= BIT(0),
503 	RX_FLAG_AMPDU_DETAILS		= BIT(1),
504 	RX_FLAG_AMPDU_EOF_BIT		= BIT(2),
505 	RX_FLAG_AMPDU_EOF_BIT_KNOWN	= BIT(3),
506 	RX_FLAG_DECRYPTED		= BIT(4),
507 	RX_FLAG_DUP_VALIDATED		= BIT(5),
508 	RX_FLAG_FAILED_FCS_CRC		= BIT(6),
509 	RX_FLAG_ICV_STRIPPED		= BIT(7),
510 	RX_FLAG_MACTIME_PLCP_START	= BIT(8),
511 	RX_FLAG_MACTIME_START		= BIT(9),
512 	RX_FLAG_MIC_STRIPPED		= BIT(10),
513 	RX_FLAG_MMIC_ERROR		= BIT(11),
514 	RX_FLAG_MMIC_STRIPPED		= BIT(12),
515 	RX_FLAG_NO_PSDU			= BIT(13),
516 	RX_FLAG_PN_VALIDATED		= BIT(14),
517 	RX_FLAG_RADIOTAP_HE		= BIT(15),
518 	RX_FLAG_RADIOTAP_HE_MU		= BIT(16),
519 	RX_FLAG_RADIOTAP_LSIG		= BIT(17),
520 	RX_FLAG_RADIOTAP_VENDOR_DATA	= BIT(18),
521 	RX_FLAG_NO_SIGNAL_VAL		= BIT(19),
522 	RX_FLAG_IV_STRIPPED		= BIT(20),
523 	RX_FLAG_AMPDU_IS_LAST		= BIT(21),
524 	RX_FLAG_AMPDU_LAST_KNOWN	= BIT(22),
525 	RX_FLAG_AMSDU_MORE		= BIT(23),
526 	RX_FLAG_MACTIME_END		= BIT(24),
527 	RX_FLAG_ONLY_MONITOR		= BIT(25),
528 	RX_FLAG_SKIP_MONITOR		= BIT(26),
529 	RX_FLAG_8023			= BIT(27),
530 };
531 
532 enum mac80211_rx_encoding {
533 	RX_ENC_LEGACY		= 0,
534 	RX_ENC_HT,
535 	RX_ENC_VHT,
536 	RX_ENC_HE
537 };
538 
539 struct ieee80211_rx_status {
540 	/* TODO FIXME, this is too large. Over-reduce types to u8 where possible. */
541 	uint64_t			boottime_ns;
542 	uint64_t			mactime;
543 	uint32_t			device_timestamp;
544 	enum ieee80211_rx_status_flags	flag;
545 	uint16_t			freq;
546 	uint8_t				encoding:2, bw:3, he_ru:3;	/* enum mac80211_rx_encoding, rate_info_bw */	/* See mt76.h */
547 	uint8_t				ampdu_reference;
548 	uint8_t				band;
549 	uint8_t				chains;
550 	int8_t				chain_signal[IEEE80211_MAX_CHAINS];
551 	int8_t				signal;
552 	uint8_t				enc_flags;
553 	uint8_t				he_dcm;
554 	uint8_t				he_gi;
555 	uint8_t				zero_length_psdu_type;
556 	uint8_t				nss;
557 	uint8_t				rate_idx;
558 };
559 
560 struct ieee80211_tx_rate_status {
561 };
562 
563 struct ieee80211_tx_status {
564 	struct ieee80211_sta		*sta;
565 	struct ieee80211_tx_info	*info;
566 
567 	u8				n_rates;
568 	struct ieee80211_tx_rate_status	*rates;
569 
570 	struct sk_buff			*skb;
571 	struct list_head		*free_list;
572 };
573 
574 struct ieee80211_scan_ies {
575 	/* TODO FIXME */
576 	int		common_ie_len;
577 	int		len[NUM_NL80211_BANDS];
578 	uint8_t		*common_ies;
579 	uint8_t		*ies[NUM_NL80211_BANDS];
580 };
581 
582 struct ieee80211_scan_request {
583 	struct ieee80211_scan_ies	ies;
584 	struct cfg80211_scan_request	req;
585 };
586 
587 struct ieee80211_txq {
588 	struct ieee80211_sta		*sta;
589 	struct ieee80211_vif		*vif;
590 	int				ac;
591 	uint8_t				tid;
592 
593 	/* Must stay last. */
594 	uint8_t				drv_priv[0] __aligned(CACHE_LINE_SIZE);
595 };
596 
597 struct ieee80211_sta_rates {
598 	/* XXX TODO */
599 	/* XXX some _rcu thing */
600 	struct {
601 		int	idx;
602 		int	flags;
603 	} rate[1];		/* XXX what is the real number? */
604 };
605 
606 struct ieee80211_sta_txpwr {
607 	/* XXX TODO */
608 	enum nl80211_tx_power_setting	type;
609 	short				power;
610 };
611 
612 struct ieee80211_link_sta {
613 	uint32_t				supp_rates[NUM_NL80211_BANDS];
614 	struct ieee80211_sta_ht_cap		ht_cap;
615 	struct ieee80211_sta_vht_cap		vht_cap;
616 	struct ieee80211_sta_he_cap		he_cap;
617 	struct ieee80211_sta_he_6ghz_capa	he_6ghz_capa;
618 	uint8_t					rx_nss;
619 	enum ieee80211_sta_rx_bw		bandwidth;
620 	struct ieee80211_sta_txpwr		txpwr;
621 };
622 
623 #define	IEEE80211_NUM_TIDS			16	/* net80211::WME_NUM_TID */
624 struct ieee80211_sta {
625 	/* TODO FIXME */
626 	int		max_amsdu_len, max_amsdu_subframes, max_rc_amsdu_len;
627 	int		mfp, smps_mode, tdls, tdls_initiator;
628 	struct ieee80211_txq			*txq[IEEE80211_NUM_TIDS + 1];	/* iwlwifi: 8 and adds +1 to tid_data, net80211::IEEE80211_TID_SIZE */
629 	struct ieee80211_sta_rates		*rates;	/* some rcu thing? */
630 	uint32_t				max_tid_amsdu_len[IEEE80211_NUM_TIDS];
631 	uint8_t					addr[ETH_ALEN];
632 	uint16_t				aid;
633 	bool					wme;
634 	uint8_t					max_sp;
635 	uint8_t					uapsd_queues;
636 
637 	struct ieee80211_link_sta		deflink;
638 
639 	/* Must stay last. */
640 	uint8_t					drv_priv[0] __aligned(CACHE_LINE_SIZE);
641 };
642 
643 struct ieee80211_tdls_ch_sw_params {
644 	/* TODO FIXME */
645 	int		action_code, ch_sw_tm_ie, status, switch_time, switch_timeout, timestamp;
646 	struct ieee80211_sta			*sta;
647 	struct cfg80211_chan_def		*chandef;
648 	struct sk_buff				*tmpl_skb;
649 };
650 
651 struct ieee80211_tx_control {
652 	/* TODO FIXME */
653 	struct ieee80211_sta			*sta;
654 };
655 
656 struct ieee80211_tx_queue_params {
657 	/* These types are based on iwlwifi FW structs. */
658 	uint16_t	cw_min;
659 	uint16_t	cw_max;
660 	uint16_t	txop;
661 	uint8_t		aifs;
662 
663 	/* TODO FIXME */
664 	int		acm, mu_edca, uapsd;
665 	struct ieee80211_he_mu_edca_param_ac_rec	mu_edca_param_rec;
666 };
667 
668 struct ieee80211_tx_rate {
669 	uint8_t		idx;
670 	uint16_t	count:5,
671 			flags:11;
672 };
673 
674 enum ieee80211_vif_driver_flags {
675 	IEEE80211_VIF_BEACON_FILTER		= BIT(0),
676 	IEEE80211_VIF_SUPPORTS_CQM_RSSI		= BIT(1),
677 	IEEE80211_VIF_SUPPORTS_UAPSD		= BIT(2),
678 };
679 
680 #define	IEEE80211_BSS_ARP_ADDR_LIST_LEN		4
681 
682 struct ieee80211_vif_cfg {
683 	uint16_t				aid;
684 	bool					assoc;
685 	int					arp_addr_cnt;
686 	uint32_t				arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];		/* big endian */
687 };
688 
689 struct ieee80211_vif {
690 	/* TODO FIXME */
691 	enum nl80211_iftype		type;
692 	int		csa_active, mu_mimo_owner;
693 	int		cab_queue;
694 	int     color_change_active, offload_flags;
695 	enum ieee80211_vif_driver_flags	driver_flags;
696 	bool				p2p;
697 	bool				probe_req_reg;
698 	uint8_t				addr[ETH_ALEN];
699 	struct ieee80211_vif_cfg	cfg;
700 	struct ieee80211_chanctx_conf	*chanctx_conf;
701 	struct ieee80211_txq		*txq;
702 	struct ieee80211_bss_conf	bss_conf;
703 	uint8_t				hw_queue[IEEE80211_NUM_ACS];
704 
705 /* #ifdef CONFIG_MAC80211_DEBUGFS */	/* Do not change structure depending on compile-time option. */
706 	struct dentry			*debugfs_dir;
707 /* #endif */
708 
709 	/* Must stay last. */
710 	uint8_t				drv_priv[0] __aligned(CACHE_LINE_SIZE);
711 };
712 
713 struct ieee80211_vif_chanctx_switch {
714 	struct ieee80211_chanctx_conf	*old_ctx, *new_ctx;
715 	struct ieee80211_vif		*vif;
716 };
717 
718 struct ieee80211_prep_tx_info {
719 	u16				duration;
720 	bool				success;
721 };
722 
723 /* XXX-BZ too big, over-reduce size to u8, and array sizes to minuimum to fit in skb->cb. */
724 /* Also warning: some sizes change by pointer size!  This is 64bit only. */
725 struct ieee80211_tx_info {
726 	enum ieee80211_tx_info_flags		flags;
727 	/* TODO FIXME */
728 	u8		band;
729 	u8		hw_queue;
730 	bool		tx_time_est;
731 	union {
732 		struct {
733 			struct ieee80211_tx_rate	rates[4];
734 			bool				use_rts;
735 			struct ieee80211_vif		*vif;
736 			struct ieee80211_key_conf	*hw_key;
737 			enum ieee80211_tx_control_flags	flags;
738 		} control;
739 		struct {
740 			struct ieee80211_tx_rate	rates[4];
741 			uint32_t			ack_signal;
742 			uint8_t				ampdu_ack_len;
743 			uint8_t				ampdu_len;
744 			uint8_t				antenna;
745 			uint16_t			tx_time;
746 			bool				is_valid_ack_signal;
747 			void				*status_driver_data[16 / sizeof(void *)];		/* XXX TODO */
748 		} status;
749 #define	IEEE80211_TX_INFO_DRIVER_DATA_SIZE	(5 * sizeof(void *))			/* XXX TODO 5? */
750 		void					*driver_data[IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)];
751 	};
752 };
753 
754 /* net80211 conflict */
755 struct linuxkpi_ieee80211_tim_ie {
756 	uint8_t				dtim_count;
757 	uint8_t				dtim_period;
758 	uint8_t				bitmap_ctrl;
759 	uint8_t				*virtual_map;
760 };
761 #define	ieee80211_tim_ie	linuxkpi_ieee80211_tim_ie
762 
763 struct survey_info {		/* net80211::struct ieee80211_channel_survey */
764 	/* TODO FIXME */
765 	uint32_t			filled;
766 #define	SURVEY_INFO_TIME		0x0001
767 #define	SURVEY_INFO_TIME_RX		0x0002
768 #define	SURVEY_INFO_TIME_SCAN		0x0004
769 #define	SURVEY_INFO_TIME_TX		0x0008
770 #define	SURVEY_INFO_TIME_BSS_RX		0x0010
771 #define	SURVEY_INFO_TIME_BUSY		0x0020
772 #define	SURVEY_INFO_IN_USE		0x0040
773 #define	SURVEY_INFO_NOISE_DBM		0x0080
774 	uint32_t			noise;
775 	uint64_t			time;
776 	uint64_t			time_bss_rx;
777 	uint64_t			time_busy;
778 	uint64_t			time_rx;
779 	uint64_t			time_scan;
780 	uint64_t			time_tx;
781 	struct ieee80211_channel	*channel;
782 };
783 
784 enum ieee80211_iface_iter {
785 	IEEE80211_IFACE_ITER_NORMAL	= BIT(0),
786 	IEEE80211_IFACE_ITER_RESUME_ALL	= BIT(1),
787 	IEEE80211_IFACE_SKIP_SDATA_NOT_IN_DRIVER = BIT(2),	/* seems to be an iter flag */
788 
789 	/* Internal flags only. */
790 	/* ieee80211_iterate_active_interfaces*(). */
791 	IEEE80211_IFACE_ITER__ATOMIC	= BIT(6),
792 	IEEE80211_IFACE_ITER__ACTIVE	= BIT(7),
793 	IEEE80211_IFACE_ITER__MTX	= BIT(8),
794 };
795 
796 enum set_key_cmd {
797 	SET_KEY,
798 	DISABLE_KEY,
799 };
800 
801 /* 802.11-2020, 9.4.2.55.2 HT Capability Information field. */
802 enum rx_enc_flags {
803 	RX_ENC_FLAG_SHORTPRE	=	BIT(0),
804 	RX_ENC_FLAG_SHORT_GI	=	BIT(2),
805 	RX_ENC_FLAG_HT_GF	=	BIT(3),
806 	RX_ENC_FLAG_STBC_MASK	=	BIT(4) | BIT(5),
807 #define	RX_ENC_FLAG_STBC_SHIFT		4
808 	RX_ENC_FLAG_LDPC	=	BIT(6),
809 	RX_ENC_FLAG_BF		=	BIT(7),
810 };
811 
812 enum sta_notify_cmd {
813 	STA_NOTIFY_AWAKE,
814 	STA_NOTIFY_SLEEP,
815 };
816 
817 struct ieee80211_low_level_stats {
818 	/* Can we make them uint64_t? */
819 	uint32_t dot11ACKFailureCount;
820 	uint32_t dot11FCSErrorCount;
821 	uint32_t dot11RTSFailureCount;
822 	uint32_t dot11RTSSuccessCount;
823 };
824 
825 enum ieee80211_offload_flags {
826 	IEEE80211_OFFLOAD_ENCAP_4ADDR,
827 	IEEE80211_OFFLOAD_ENCAP_ENABLED,
828 	IEEE80211_OFFLOAD_DECAP_ENABLED,
829 };
830 
831 struct ieee80211_ops {
832 	/* TODO FIXME */
833 	int  (*start)(struct ieee80211_hw *);
834 	void (*stop)(struct ieee80211_hw *);
835 
836 	int  (*config)(struct ieee80211_hw *, u32);
837 	void (*reconfig_complete)(struct ieee80211_hw *, enum ieee80211_reconfig_type);
838 
839 	int  (*add_interface)(struct ieee80211_hw *, struct ieee80211_vif *);
840 	void (*remove_interface)(struct ieee80211_hw *, struct ieee80211_vif *);
841 	int  (*change_interface)(struct ieee80211_hw *, struct ieee80211_vif *, enum nl80211_iftype, bool);
842 
843 	void (*sw_scan_start)(struct ieee80211_hw *, struct ieee80211_vif *, const u8 *);
844 	void (*sw_scan_complete)(struct ieee80211_hw *, struct ieee80211_vif *);
845 	int  (*sched_scan_start)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_sched_scan_request *, struct ieee80211_scan_ies *);
846 	int  (*sched_scan_stop)(struct ieee80211_hw *, struct ieee80211_vif *);
847 	int  (*hw_scan)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_scan_request *);
848 	void (*cancel_hw_scan)(struct ieee80211_hw *, struct ieee80211_vif *);
849 
850 	int  (*conf_tx)(struct ieee80211_hw *, struct ieee80211_vif *, u32, u16, const struct ieee80211_tx_queue_params *);
851 	void (*tx)(struct ieee80211_hw *, struct ieee80211_tx_control *, struct sk_buff *);
852 	int  (*tx_last_beacon)(struct ieee80211_hw *);
853 	void (*wake_tx_queue)(struct ieee80211_hw *, struct ieee80211_txq *);
854 
855 	void (*mgd_prepare_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *);
856 	void (*mgd_complete_tx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_prep_tx_info *);
857 	void (*mgd_protect_tdls_discover)(struct ieee80211_hw *, struct ieee80211_vif *);
858 
859 	void (*flush)(struct ieee80211_hw *, struct ieee80211_vif *, u32, bool);
860 
861 	int  (*set_frag_threshold)(struct ieee80211_hw *, u32);
862 
863 	void (*sync_rx_queues)(struct ieee80211_hw *);
864 
865 	void (*allow_buffered_frames)(struct ieee80211_hw *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool);
866 	void (*release_buffered_frames)(struct ieee80211_hw *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool);
867 
868 	int  (*sta_add)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
869 	int  (*sta_remove)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
870 	int  (*sta_set_txpwr)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
871 	void (*sta_statistics)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct station_info *);
872 	void (*sta_pre_rcu_remove)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
873 	int  (*sta_state)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, enum ieee80211_sta_state, enum ieee80211_sta_state);
874 	void (*sta_notify)(struct ieee80211_hw *, struct ieee80211_vif *, enum sta_notify_cmd, struct ieee80211_sta *);
875 	void (*sta_rc_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u32);
876 	void (*sta_rate_tbl_update)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
877 	void (*sta_set_4addr)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool);
878 	void (*sta_set_decap_offload)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, bool);
879 
880 	u64  (*prepare_multicast)(struct ieee80211_hw *, struct netdev_hw_addr_list *);
881 
882 	int  (*ampdu_action)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_ampdu_params *);
883 
884 	bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *, struct sk_buff *, struct sk_buff *);
885 
886 	int  (*pre_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *);
887 	int  (*post_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *);
888 	void (*channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *);
889 	void (*channel_switch_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_chan_def *);
890 	void (*abort_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *);
891 	void (*channel_switch_rx_beacon)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel_switch *);
892 	int  (*tdls_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8, struct cfg80211_chan_def *, struct sk_buff *, u32);
893 	void (*tdls_cancel_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *);
894 	void (*tdls_recv_channel_switch)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_tdls_ch_sw_params *);
895 
896 	int  (*add_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *);
897 	void (*remove_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *);
898 	void (*change_chanctx)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, u32);
899 	int  (*assign_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *);
900 	void (*unassign_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, struct ieee80211_chanctx_conf *);
901 	int  (*switch_vif_chanctx)(struct ieee80211_hw *, struct ieee80211_vif_chanctx_switch *, int, enum ieee80211_chanctx_switch_mode);
902 
903 	int  (*get_antenna)(struct ieee80211_hw *, u32 *, u32 *);
904 	int  (*set_antenna)(struct ieee80211_hw *, u32, u32);
905 
906 	int  (*remain_on_channel)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_channel *, int, enum ieee80211_roc_type);
907 	int  (*cancel_remain_on_channel)(struct ieee80211_hw *, struct ieee80211_vif *);
908 
909 	void (*configure_filter)(struct ieee80211_hw *, unsigned int, unsigned int *, u64);
910 	void (*config_iface_filter)(struct ieee80211_hw *, struct ieee80211_vif *, unsigned int, unsigned int);
911 
912 	void (*bss_info_changed)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *, u64);
913 	int  (*set_rts_threshold)(struct ieee80211_hw *, u32);
914 	void (*event_callback)(struct ieee80211_hw *, struct ieee80211_vif *, const struct ieee80211_event *);
915 	int  (*get_survey)(struct ieee80211_hw *, int, struct survey_info *);
916 	int  (*get_ftm_responder_stats)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_ftm_responder_stats *);
917 
918         uint64_t (*get_tsf)(struct ieee80211_hw *, struct ieee80211_vif *);
919         void (*set_tsf)(struct ieee80211_hw *, struct ieee80211_vif *, uint64_t);
920 	void (*offset_tsf)(struct ieee80211_hw *, struct ieee80211_vif *, s64);
921 
922 	int  (*set_bitrate_mask)(struct ieee80211_hw *, struct ieee80211_vif *, const struct cfg80211_bitrate_mask *);
923 	void (*set_coverage_class)(struct ieee80211_hw *, s16);
924 	int  (*set_tim)(struct ieee80211_hw *, struct ieee80211_sta *, bool);
925 
926 	int  (*set_key)(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *);
927 	void (*set_default_unicast_key)(struct ieee80211_hw *, struct ieee80211_vif *, int);
928 	void (*update_tkip_key)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_key_conf *, struct ieee80211_sta *, u32, u16 *);
929 
930 	int  (*start_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *);
931 	void (*abort_pmsr)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_pmsr_request *);
932 
933 	int  (*start_ap)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *link_conf);
934 	void (*stop_ap)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_bss_conf *link_conf);
935 	int  (*join_ibss)(struct ieee80211_hw *, struct ieee80211_vif *);
936 	void (*leave_ibss)(struct ieee80211_hw *, struct ieee80211_vif *);
937 
938 	int  (*set_sar_specs)(struct ieee80211_hw *, const struct cfg80211_sar_specs *);
939 
940 	int  (*set_tid_config)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct cfg80211_tid_config *);
941 	int  (*reset_tid_config)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, u8);
942 
943 	int  (*get_et_sset_count)(struct ieee80211_hw *, struct ieee80211_vif *, int);
944 	void (*get_et_stats)(struct ieee80211_hw *, struct ieee80211_vif *, struct ethtool_stats *, u64 *);
945 	void (*get_et_strings)(struct ieee80211_hw *, struct ieee80211_vif *, u32, u8 *);
946 
947 	void (*update_vif_offload)(struct ieee80211_hw *, struct ieee80211_vif *);
948 
949 	int  (*get_txpower)(struct ieee80211_hw *, struct ieee80211_vif *, int *);
950 	int  (*get_stats)(struct ieee80211_hw *, struct ieee80211_low_level_stats *);
951 
952 	int  (*set_radar_background)(struct ieee80211_hw *, struct cfg80211_chan_def *);
953 
954 	void (*add_twt_setup)(struct ieee80211_hw *, struct ieee80211_sta *, struct ieee80211_twt_setup *);
955 	void (*twt_teardown_request)(struct ieee80211_hw *, struct ieee80211_sta *, u8);
956 
957 /* #ifdef CONFIG_MAC80211_DEBUGFS */	/* Do not change depending on compile-time option. */
958 	void (*sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct dentry *);
959 /* #endif */
960 };
961 
962 
963 /* -------------------------------------------------------------------------- */
964 
965 /* linux_80211.c */
966 extern const struct cfg80211_ops linuxkpi_mac80211cfgops;
967 
968 struct ieee80211_hw *linuxkpi_ieee80211_alloc_hw(size_t,
969     const struct ieee80211_ops *);
970 void linuxkpi_ieee80211_iffree(struct ieee80211_hw *);
971 void linuxkpi_set_ieee80211_dev(struct ieee80211_hw *, char *);
972 int linuxkpi_ieee80211_ifattach(struct ieee80211_hw *);
973 void linuxkpi_ieee80211_ifdetach(struct ieee80211_hw *);
974 struct ieee80211_hw * linuxkpi_wiphy_to_ieee80211_hw(struct wiphy *);
975 void linuxkpi_ieee80211_iterate_interfaces(
976     struct ieee80211_hw *hw, enum ieee80211_iface_iter flags,
977     void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
978     void *);
979 void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *,
980     struct ieee80211_vif *,
981     void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *,
982         struct ieee80211_sta *, struct ieee80211_key_conf *, void *),
983     void *);
984 void linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *,
985     void(*iterfunc)(struct ieee80211_hw *,
986 	struct ieee80211_chanctx_conf *, void *),
987     void *);
988 void linuxkpi_ieee80211_iterate_stations_atomic(struct ieee80211_hw *,
989    void (*iterfunc)(void *, struct ieee80211_sta *), void *);
990 void linuxkpi_ieee80211_scan_completed(struct ieee80211_hw *,
991     struct cfg80211_scan_info *);
992 void linuxkpi_ieee80211_rx(struct ieee80211_hw *, struct sk_buff *,
993     struct ieee80211_sta *, struct napi_struct *);
994 uint8_t linuxkpi_ieee80211_get_tid(struct ieee80211_hdr *, bool);
995 struct ieee80211_sta *linuxkpi_ieee80211_find_sta(struct ieee80211_vif *,
996     const u8 *);
997 struct ieee80211_sta *linuxkpi_ieee80211_find_sta_by_ifaddr(
998     struct ieee80211_hw *, const uint8_t *, const uint8_t *);
999 struct sk_buff *linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *,
1000     struct ieee80211_txq *);
1001 bool linuxkpi_ieee80211_is_ie_id_in_ie_buf(const u8, const u8 *, size_t);
1002 bool linuxkpi_ieee80211_ie_advance(size_t *, const u8 *, size_t);
1003 void linuxkpi_ieee80211_free_txskb(struct ieee80211_hw *, struct sk_buff *,
1004     int);
1005 void linuxkpi_ieee80211_queue_delayed_work(struct ieee80211_hw *,
1006     struct delayed_work *, int);
1007 void linuxkpi_ieee80211_queue_work(struct ieee80211_hw *, struct work_struct *);
1008 struct sk_buff *linuxkpi_ieee80211_pspoll_get(struct ieee80211_hw *,
1009     struct ieee80211_vif *);
1010 struct sk_buff *linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *,
1011     struct ieee80211_vif *, bool);
1012 void linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *, unsigned long *,
1013     unsigned long *);
1014 struct wireless_dev *linuxkpi_ieee80211_vif_to_wdev(struct ieee80211_vif *);
1015 void linuxkpi_ieee80211_connection_loss(struct ieee80211_vif *);
1016 void linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *);
1017 struct sk_buff *linuxkpi_ieee80211_probereq_get(struct ieee80211_hw *,
1018     uint8_t *, uint8_t *, size_t, size_t);
1019 void linuxkpi_ieee80211_tx_status(struct ieee80211_hw *, struct sk_buff *);
1020 
1021 /* -------------------------------------------------------------------------- */
1022 
1023 static __inline void
1024 _ieee80211_hw_set(struct ieee80211_hw *hw, enum ieee80211_hw_flags flag)
1025 {
1026 
1027 	set_bit(flag, hw->flags);
1028 }
1029 
1030 static __inline bool
1031 __ieee80211_hw_check(struct ieee80211_hw *hw, enum ieee80211_hw_flags flag)
1032 {
1033 
1034 	return (test_bit(flag, hw->flags));
1035 }
1036 
1037 /* They pass in shortened flag names; how confusingly inconsistent. */
1038 #define	ieee80211_hw_set(_hw, _flag)					\
1039 	_ieee80211_hw_set(_hw, IEEE80211_HW_ ## _flag)
1040 #define	ieee80211_hw_check(_hw, _flag)					\
1041 	__ieee80211_hw_check(_hw, IEEE80211_HW_ ## _flag)
1042 
1043 /* XXX-BZ add CTASSERTS that size of struct is <= sizeof skb->cb. */
1044 CTASSERT(sizeof(struct ieee80211_tx_info) <= sizeof(((struct sk_buff *)0)->cb));
1045 #define	IEEE80211_SKB_CB(_skb)						\
1046 	((struct ieee80211_tx_info *)((_skb)->cb))
1047 
1048 CTASSERT(sizeof(struct ieee80211_rx_status) <= sizeof(((struct sk_buff *)0)->cb));
1049 #define	IEEE80211_SKB_RXCB(_skb)					\
1050 	((struct ieee80211_rx_status *)((_skb)->cb))
1051 
1052 static __inline void
1053 ieee80211_free_hw(struct ieee80211_hw *hw)
1054 {
1055 
1056 	linuxkpi_ieee80211_iffree(hw);
1057 
1058 	if (hw->wiphy != NULL)
1059 		wiphy_free(hw->wiphy);
1060 	/* Note that *hw is not valid any longer after this. */
1061 
1062 	IMPROVE();
1063 }
1064 
1065 static __inline struct ieee80211_hw *
1066 ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops)
1067 {
1068 
1069 	return (linuxkpi_ieee80211_alloc_hw(priv_len, ops));
1070 }
1071 
1072 static __inline void
1073 SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev)
1074 {
1075 
1076 	set_wiphy_dev(hw->wiphy, dev);
1077 	linuxkpi_set_ieee80211_dev(hw, dev_name(dev));
1078 
1079 	IMPROVE();
1080 }
1081 
1082 static __inline int
1083 ieee80211_register_hw(struct ieee80211_hw *hw)
1084 {
1085 	int error;
1086 
1087 	error = wiphy_register(hw->wiphy);
1088 	if (error != 0)
1089 		return (error);
1090 
1091 	/*
1092 	 * At this point the driver has set all the options, flags, bands,
1093 	 * ciphers, hw address(es), ... basically mac80211/cfg80211 hw/wiphy
1094 	 * setup is done.
1095 	 * We need to replicate a lot of information from here into net80211.
1096 	 */
1097 	error = linuxkpi_ieee80211_ifattach(hw);
1098 
1099 	IMPROVE();
1100 
1101 	return (error);
1102 }
1103 
1104 static __inline void
1105 ieee80211_unregister_hw(struct ieee80211_hw *hw)
1106 {
1107 
1108 	wiphy_unregister(hw->wiphy);
1109 	linuxkpi_ieee80211_ifdetach(hw);
1110 
1111 	IMPROVE();
1112 }
1113 
1114 static __inline struct ieee80211_hw *
1115 wiphy_to_ieee80211_hw(struct wiphy *wiphy)
1116 {
1117 
1118 	return (linuxkpi_wiphy_to_ieee80211_hw(wiphy));
1119 }
1120 
1121 /* -------------------------------------------------------------------------- */
1122 
1123 static __inline bool
1124 ieee80211_is_action(__le16 fc)
1125 {
1126 	__le16 v;
1127 
1128 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1129 	v = htole16(IEEE80211_FC0_SUBTYPE_ACTION | IEEE80211_FC0_TYPE_MGT);
1130 
1131 	return (fc == v);
1132 }
1133 
1134 static __inline bool
1135 ieee80211_is_probe_resp(__le16 fc)
1136 {
1137 	__le16 v;
1138 
1139 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1140 	v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_RESP | IEEE80211_FC0_TYPE_MGT);
1141 
1142 	return (fc == v);
1143 }
1144 
1145 static __inline bool
1146 ieee80211_is_auth(__le16 fc)
1147 {
1148 	__le16 v;
1149 
1150 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1151 	v = htole16(IEEE80211_FC0_SUBTYPE_AUTH | IEEE80211_FC0_TYPE_MGT);
1152 
1153 	return (fc == v);
1154 }
1155 
1156 static __inline bool
1157 ieee80211_is_assoc_req(__le16 fc)
1158 {
1159 	__le16 v;
1160 
1161 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1162 	v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_REQ | IEEE80211_FC0_TYPE_MGT);
1163 
1164 	return (fc == v);
1165 }
1166 
1167 static __inline bool
1168 ieee80211_is_assoc_resp(__le16 fc)
1169 {
1170 	__le16 v;
1171 
1172 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1173 	v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_RESP | IEEE80211_FC0_TYPE_MGT);
1174 
1175 	return (fc == v);
1176 }
1177 
1178 static __inline bool
1179 ieee80211_is_reassoc_req(__le16 fc)
1180 {
1181 	__le16 v;
1182 
1183 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1184 	v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_REQ | IEEE80211_FC0_TYPE_MGT);
1185 
1186 	return (fc == v);
1187 }
1188 
1189 static __inline bool
1190 ieee80211_is_reassoc_resp(__le16 fc)
1191 {
1192 	__le16 v;
1193 
1194 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1195 	v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_RESP | IEEE80211_FC0_TYPE_MGT);
1196 
1197 	return (fc == v);
1198 }
1199 
1200 static __inline bool
1201 ieee80211_is_disassoc(__le16 fc)
1202 {
1203 	__le16 v;
1204 
1205 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1206 	v = htole16(IEEE80211_FC0_SUBTYPE_DISASSOC | IEEE80211_FC0_TYPE_MGT);
1207 
1208 	return (fc == v);
1209 }
1210 
1211 static __inline bool
1212 ieee80211_is_data_present(__le16 fc)
1213 {
1214 	__le16 v;
1215 
1216 	/* If it is a data frame and NODATA is not present. */
1217 	fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA);
1218 	v = htole16(IEEE80211_FC0_TYPE_DATA);
1219 
1220 	return (fc == v);
1221 }
1222 
1223 static __inline bool
1224 ieee80211_is_deauth(__le16 fc)
1225 {
1226 	__le16 v;
1227 
1228 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1229 	v = htole16(IEEE80211_FC0_SUBTYPE_DEAUTH | IEEE80211_FC0_TYPE_MGT);
1230 
1231 	return (fc == v);
1232 }
1233 
1234 static __inline bool
1235 ieee80211_is_beacon(__le16 fc)
1236 {
1237 	__le16 v;
1238 
1239 	/*
1240 	 * For as much as I get it this comes in LE and unlike FreeBSD
1241 	 * where we get the entire frame header and u8[], here we get the
1242 	 * 9.2.4.1 Frame Control field only. Mask and compare.
1243 	 */
1244 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1245 	v = htole16(IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT);
1246 
1247 	return (fc == v);
1248 }
1249 
1250 
1251 static __inline bool
1252 ieee80211_is_probe_req(__le16 fc)
1253 {
1254 	__le16 v;
1255 
1256 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1257 	v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_REQ | IEEE80211_FC0_TYPE_MGT);
1258 
1259 	return (fc == v);
1260 }
1261 
1262 static __inline bool
1263 ieee80211_has_protected(__le16 fc)
1264 {
1265 
1266 	return (fc & htole16(IEEE80211_FC1_PROTECTED << 8));
1267 }
1268 
1269 static __inline bool
1270 ieee80211_is_back_req(__le16 fc)
1271 {
1272 	__le16 v;
1273 
1274 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1275 	v = htole16(IEEE80211_FC0_SUBTYPE_BAR | IEEE80211_FC0_TYPE_CTL);
1276 
1277 	return (fc == v);
1278 }
1279 
1280 static __inline bool
1281 ieee80211_is_bufferable_mmpdu(__le16 fc)
1282 {
1283 
1284 	/* 11.2.2 Bufferable MMPDUs, 80211-2020. */
1285 	/* XXX we do not care about IBSS yet. */
1286 
1287 	if (!ieee80211_is_mgmt(fc))
1288 		return (false);
1289 	if (ieee80211_is_action(fc))		/* XXX FTM? */
1290 		return (true);
1291 	if (ieee80211_is_disassoc(fc))
1292 		return (true);
1293 	if (ieee80211_is_deauth(fc))
1294 		return (true);
1295 
1296 	return (false);
1297 }
1298 
1299 static __inline bool
1300 ieee80211_is_nullfunc(__le16 fc)
1301 {
1302 	__le16 v;
1303 
1304 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1305 	v = htole16(IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA);
1306 
1307 	return (fc == v);
1308 }
1309 
1310 static __inline bool
1311 ieee80211_is_qos_nullfunc(__le16 fc)
1312 {
1313 	__le16 v;
1314 
1315 	fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK);
1316 	v = htole16(IEEE80211_FC0_SUBTYPE_QOS_NULL | IEEE80211_FC0_TYPE_DATA);
1317 
1318 	return (fc == v);
1319 }
1320 
1321 static __inline bool
1322 ieee80211_is_any_nullfunc(__le16 fc)
1323 {
1324 
1325 	return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc));
1326 }
1327 
1328 static __inline bool
1329 ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
1330 {
1331 	TODO();
1332 	return (false);
1333 }
1334 
1335 static __inline bool
1336 ieee80211_is_frag(struct ieee80211_hdr *hdr)
1337 {
1338 	TODO();
1339 	return (false);
1340 }
1341 
1342 static __inline bool
1343 ieee80211_is_first_frag(__le16 fc)
1344 {
1345 	TODO();
1346 	return (false);
1347 }
1348 
1349 static __inline bool
1350 ieee80211_is_pspoll(__le16 fc)
1351 {
1352 	TODO();
1353 	return (false);
1354 }
1355 
1356 static __inline bool
1357 ieee80211_is_robust_mgmt_frame(struct sk_buff *skb)
1358 {
1359 	TODO();
1360 	return (false);
1361 }
1362 
1363 static __inline bool
1364 ieee80211_has_pm(__le16 fc)
1365 {
1366 	TODO();
1367 	return (false);
1368 }
1369 
1370 static __inline bool
1371 ieee80211_has_a4(__le16 fc)
1372 {
1373 	__le16 v;
1374 
1375 	fc &= htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8);
1376 	v = htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8);
1377 
1378 	return (fc == v);
1379 }
1380 
1381 static __inline bool
1382 ieee80211_has_order(__le16 fc)
1383 {
1384 
1385 	return (fc & htole16(IEEE80211_FC1_ORDER << 8));
1386 }
1387 
1388 static __inline bool
1389 ieee80211_has_retry(__le16 fc)
1390 {
1391 
1392 	return (fc & htole16(IEEE80211_FC1_RETRY << 8));
1393 }
1394 
1395 
1396 static __inline bool
1397 ieee80211_has_fromds(__le16 fc)
1398 {
1399 
1400 	return (fc & htole16(IEEE80211_FC1_DIR_FROMDS << 8));
1401 }
1402 
1403 static __inline bool
1404 ieee80211_has_tods(__le16 fc)
1405 {
1406 
1407 	return (fc & htole16(IEEE80211_FC1_DIR_TODS << 8));
1408 }
1409 
1410 static __inline uint8_t *
1411 ieee80211_get_SA(struct ieee80211_hdr *hdr)
1412 {
1413 
1414 	if (ieee80211_has_a4(hdr->frame_control))
1415 		return (hdr->addr4);
1416 	if (ieee80211_has_fromds(hdr->frame_control))
1417 		return (hdr->addr3);
1418 	return (hdr->addr2);
1419 }
1420 
1421 static __inline uint8_t *
1422 ieee80211_get_DA(struct ieee80211_hdr *hdr)
1423 {
1424 
1425 	if (ieee80211_has_tods(hdr->frame_control))
1426 		return (hdr->addr3);
1427 	return (hdr->addr1);
1428 }
1429 
1430 static __inline bool
1431 ieee80211_has_morefrags(__le16 fc)
1432 {
1433 
1434 	fc &= htole16(IEEE80211_FC1_MORE_FRAG << 8);
1435 	return (fc != 0);
1436 }
1437 
1438 static __inline u8 *
1439 ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr)
1440 {
1441         if (ieee80211_has_a4(hdr->frame_control))
1442                 return (u8 *)hdr + 30;
1443         else
1444                 return (u8 *)hdr + 24;
1445 }
1446 
1447 /* -------------------------------------------------------------------------- */
1448 /* Receive functions (air/driver to mac80211/net80211). */
1449 
1450 
1451 static __inline void
1452 ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
1453     struct sk_buff *skb, struct napi_struct *napi)
1454 {
1455 
1456 	linuxkpi_ieee80211_rx(hw, skb, sta, napi);
1457 }
1458 
1459 static __inline void
1460 ieee80211_rx_ni(struct ieee80211_hw *hw, struct sk_buff *skb)
1461 {
1462 
1463 	linuxkpi_ieee80211_rx(hw, skb, NULL, NULL);
1464 }
1465 
1466 static __inline void
1467 ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb)
1468 {
1469 
1470 	linuxkpi_ieee80211_rx(hw, skb, NULL, NULL);
1471 }
1472 
1473 static __inline void
1474 ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
1475 {
1476 
1477 	linuxkpi_ieee80211_rx(hw, skb, NULL, NULL);
1478 }
1479 
1480 /* -------------------------------------------------------------------------- */
1481 
1482 static __inline uint8_t
1483 ieee80211_get_tid(struct ieee80211_hdr *hdr)
1484 {
1485 
1486 	return (linuxkpi_ieee80211_get_tid(hdr, false));
1487 }
1488 
1489 static __inline struct sk_buff *
1490 ieee80211_beacon_get_tim(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1491     uint16_t *tim_offset, uint16_t *tim_len, uint32_t link_id)
1492 {
1493 
1494 	if (tim_offset != NULL)
1495 		*tim_offset = 0;
1496 	if (tim_len != NULL)
1497 		*tim_len = 0;
1498 	TODO();
1499 	return (NULL);
1500 }
1501 
1502 static __inline void
1503 ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,
1504     enum ieee80211_iface_iter flags,
1505     void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
1506     void *arg)
1507 {
1508 
1509 	flags |= IEEE80211_IFACE_ITER__ATOMIC;
1510 	flags |= IEEE80211_IFACE_ITER__ACTIVE;
1511 	linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1512 }
1513 
1514 static __inline void
1515 ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
1516     enum ieee80211_iface_iter flags,
1517     void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
1518     void *arg)
1519 {
1520 
1521 	flags |= IEEE80211_IFACE_ITER__ACTIVE;
1522 	linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1523 }
1524 
1525 static __inline void
1526 ieee80211_iterate_active_interfaces_mtx(struct ieee80211_hw *hw,
1527     enum ieee80211_iface_iter flags,
1528     void(*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
1529     void *arg)
1530 {
1531 	flags |= IEEE80211_IFACE_ITER__ACTIVE;
1532 	flags |= IEEE80211_IFACE_ITER__MTX;
1533 	linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1534 }
1535 
1536 static __inline void
1537 ieee80211_iterate_interfaces(struct ieee80211_hw *hw,
1538    enum ieee80211_iface_iter flags,
1539    void (*iterfunc)(void *, uint8_t *, struct ieee80211_vif *),
1540    void *arg)
1541 {
1542 
1543 	linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg);
1544 }
1545 
1546 static __inline void
1547 ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1548     void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *,
1549         struct ieee80211_sta *, struct ieee80211_key_conf *, void *),
1550     void *arg)
1551 {
1552 
1553 	linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg);
1554 }
1555 
1556 static __inline void
1557 ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1558     void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *,
1559         struct ieee80211_sta *, struct ieee80211_key_conf *, void *),
1560     void *arg)
1561 {
1562 
1563 	IMPROVE();	/* "rcu" */
1564 	linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg);
1565 }
1566 
1567 static __inline void
1568 ieee80211_iter_chan_contexts_atomic(struct ieee80211_hw *hw,
1569     void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, void *),
1570     void *arg)
1571 {
1572 
1573 	linuxkpi_ieee80211_iterate_chan_contexts(hw, iterfunc, arg);
1574 }
1575 
1576 static __inline void
1577 ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
1578    void (*iterfunc)(void *, struct ieee80211_sta *), void *arg)
1579 {
1580 
1581 	linuxkpi_ieee80211_iterate_stations_atomic(hw, iterfunc, arg);
1582 }
1583 
1584 static __inline struct wireless_dev *
1585 ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
1586 {
1587 
1588 	return (linuxkpi_ieee80211_vif_to_wdev(vif));
1589 }
1590 
1591 static __inline struct sk_buff *
1592 ieee80211_beacon_get_template(struct ieee80211_hw *hw,
1593     struct ieee80211_vif *vif, struct ieee80211_mutable_offsets *offs,
1594     uint32_t link_id)
1595 {
1596 	TODO();
1597 	return (NULL);
1598 }
1599 
1600 static __inline void
1601 ieee80211_beacon_loss(struct ieee80211_vif *vif)
1602 {
1603 	linuxkpi_ieee80211_beacon_loss(vif);
1604 }
1605 
1606 static __inline void
1607 ieee80211_chswitch_done(struct ieee80211_vif *vif, bool t)
1608 {
1609 	TODO();
1610 }
1611 
1612 static __inline bool
1613 ieee80211_csa_is_complete(struct ieee80211_vif *vif)
1614 {
1615 	TODO();
1616 	return (false);
1617 }
1618 
1619 static __inline void
1620 ieee80211_csa_set_counter(struct ieee80211_vif *vif, uint8_t counter)
1621 {
1622 	TODO();
1623 }
1624 
1625 static __inline int
1626 ieee80211_csa_update_counter(struct ieee80211_vif *vif)
1627 {
1628 	TODO();
1629 	return (-1);
1630 }
1631 
1632 static __inline void
1633 ieee80211_csa_finish(struct ieee80211_vif *vif)
1634 {
1635 	TODO();
1636 }
1637 
1638 static __inline enum nl80211_iftype
1639 ieee80211_vif_type_p2p(struct ieee80211_vif *vif)
1640 {
1641 
1642 	/* If we are not p2p enabled, just return the type. */
1643 	if (!vif->p2p)
1644 		return (vif->type);
1645 
1646 	/* If we are p2p, depending on side, return type. */
1647 	switch (vif->type) {
1648 	case NL80211_IFTYPE_AP:
1649 		return (NL80211_IFTYPE_P2P_GO);
1650 	case NL80211_IFTYPE_STATION:
1651 		return (NL80211_IFTYPE_P2P_CLIENT);
1652 	default:
1653 		fallthrough;
1654 	}
1655 	return (vif->type);
1656 }
1657 
1658 static __inline unsigned long
1659 ieee80211_tu_to_usec(unsigned long tu)
1660 {
1661 
1662 	return (tu * IEEE80211_DUR_TU);
1663 }
1664 
1665 
1666 static __inline bool
1667 ieee80211_action_contains_tpc(struct sk_buff *skb)
1668 {
1669 	struct ieee80211_mgmt *mgmt;
1670 
1671 	mgmt = (struct ieee80211_mgmt *)skb->data;
1672 
1673 	/* Check that this is a mgmt/action frame? */
1674 	if (!ieee80211_is_action(mgmt->frame_control))
1675 		return (false);
1676 
1677 	/*
1678 	 * This is a bit convoluted but according to docs both actions
1679 	 * are checked for this.  Kind-of makes sense for the only consumer
1680 	 * (iwlwifi) I am aware off given the txpower fields are at the
1681 	 * same location so firmware can update the value.
1682 	 */
1683 	/* 80211-2020 9.6.2 Spectrum Management Action frames */
1684 	/* 80211-2020 9.6.2.5 TPC Report frame format */
1685 	/* 80211-2020 9.6.6 Radio Measurement action details */
1686 	/* 80211-2020 9.6.6.4 Link Measurement Report frame format */
1687 	/* Check that it is Spectrum Management or Radio Measurement? */
1688 	if (mgmt->u.action.category != IEEE80211_ACTION_CAT_SM &&
1689 	    mgmt->u.action.category != IEEE80211_ACTION_CAT_RADIO_MEASUREMENT)
1690 		return (false);
1691 
1692 	/* Check that it is TPC Report or Link Measurement Report? */
1693 	KASSERT(IEEE80211_ACTION_SM_TPCREP == IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP,
1694 	    ("%s: SM_TPCREP %d != RADIO_MEASUREMENT_LMREP %d\n", __func__,
1695 	    IEEE80211_ACTION_SM_TPCREP, IEEE80211_ACTION_RADIO_MEASUREMENT_LMREP));
1696 	if (mgmt->u.action.u.tpc_report.spec_mgmt != IEEE80211_ACTION_SM_TPCREP)
1697 		return (false);
1698 
1699 	/* 80211-2020 9.4.2.16 TPC Report element */
1700 	/* Check that the ELEMID and length are correct? */
1701 	if (mgmt->u.action.u.tpc_report.tpc_elem_id != IEEE80211_ELEMID_TPCREP ||
1702 	    mgmt->u.action.u.tpc_report.tpc_elem_length != 4)
1703 		return (false);
1704 
1705 	/* All the right fields in the right place. */
1706 	return (true);
1707 }
1708 
1709 static __inline void
1710 ieee80211_connection_loss(struct ieee80211_vif *vif)
1711 {
1712 
1713 	linuxkpi_ieee80211_connection_loss(vif);
1714 }
1715 
1716 static __inline struct ieee80211_sta *
1717 ieee80211_find_sta(struct ieee80211_vif *vif, const u8 *peer)
1718 {
1719 
1720 	return (linuxkpi_ieee80211_find_sta(vif, peer));
1721 }
1722 
1723 static __inline struct ieee80211_sta *
1724 ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw, const uint8_t *addr,
1725     const uint8_t *ourvifaddr)
1726 {
1727 
1728 	return (linuxkpi_ieee80211_find_sta_by_ifaddr(hw, addr, ourvifaddr));
1729 }
1730 
1731 
1732 static __inline void
1733 ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
1734     struct sk_buff *skb_frag, u8 *key)
1735 {
1736 	TODO();
1737 }
1738 
1739 static __inline void
1740 ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
1741     const u8 *addr, uint32_t iv32, u16 *p1k)
1742 {
1743 	TODO();
1744 }
1745 
1746 static __inline size_t
1747 ieee80211_ie_split(const u8 *ies, size_t ies_len,
1748     const u8 *ie_ids, size_t ie_ids_len, size_t start)
1749 {
1750 	size_t x;
1751 
1752 	x = start;
1753 
1754 	/* XXX FIXME, we need to deal with "Element ID Extension" */
1755 	while (x < ies_len) {
1756 
1757 		/* Is this IE[s] one of the ie_ids? */
1758 		if (!linuxkpi_ieee80211_is_ie_id_in_ie_buf(ies[x],
1759 		    ie_ids, ie_ids_len))
1760 			break;
1761 
1762 		if (!linuxkpi_ieee80211_ie_advance(&x, ies, ies_len))
1763 			break;
1764 	}
1765 
1766 	return (x);
1767 }
1768 
1769 static __inline void
1770 ieee80211_request_smps(struct ieee80211_vif *vif, enum ieee80211_smps_mode smps)
1771 {
1772 	static const char *smps_mode_name[] = {
1773 		"SMPS_OFF",
1774 		"SMPS_STATIC",
1775 		"SMPS_DYNAMIC",
1776 		"SMPS_AUTOMATIC",
1777 		"SMPS_NUM_MODES"
1778 	};
1779 
1780 	if (linuxkpi_debug_80211 & D80211_TODO)
1781 		printf("%s:%d: XXX LKPI80211 TODO smps %d %s\n",
1782 		    __func__, __LINE__, smps, smps_mode_name[smps]);
1783 }
1784 
1785 static __inline void
1786 ieee80211_tdls_oper_request(struct ieee80211_vif *vif, uint8_t *addr,
1787     enum nl80211_tdls_operation oper, enum ieee80211_reason_code code,
1788     gfp_t gfp)
1789 {
1790 	TODO();
1791 }
1792 
1793 static __inline void
1794 ieee80211_stop_queues(struct ieee80211_hw *hw)
1795 {
1796 	TODO();
1797 }
1798 
1799 static __inline void
1800 ieee80211_wake_queues(struct ieee80211_hw *hw)
1801 {
1802 	TODO();
1803 }
1804 
1805 static __inline void
1806 wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool state)
1807 {
1808 	TODO();
1809 }
1810 
1811 static __inline void
1812 ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb)
1813 {
1814 	IMPROVE();
1815 
1816 	/*
1817 	 * This is called on transmit failure.
1818 	 * Use a not-so-random random high status error so we can distinguish
1819 	 * it from normal low values flying around in net80211 ("ETX").
1820 	 */
1821 	linuxkpi_ieee80211_free_txskb(hw, skb, 0x455458);
1822 }
1823 
1824 static __inline void
1825 ieee80211_restart_hw(struct ieee80211_hw *hw)
1826 {
1827 	TODO();
1828 }
1829 
1830 static __inline void
1831 ieee80211_ready_on_channel(struct ieee80211_hw *hw)
1832 {
1833 	TODO();
1834 /* XXX-BZ We need to see that. */
1835 }
1836 
1837 static __inline void
1838 ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw)
1839 {
1840 	TODO();
1841 }
1842 
1843 static __inline void
1844 ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
1845     enum nl80211_cqm_rssi_threshold_event crte, int sig, gfp_t gfp)
1846 {
1847 	TODO();
1848 }
1849 
1850 static __inline void
1851 ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *sta, uint8_t tid,
1852     uint32_t ssn, uint64_t bitmap, uint16_t received_mpdu)
1853 {
1854 	TODO();
1855 }
1856 
1857 static __inline bool
1858 ieee80211_sn_less(uint16_t sn1, uint16_t sn2)
1859 {
1860 	TODO();
1861 	return (false);
1862 }
1863 
1864 static __inline uint16_t
1865 ieee80211_sn_inc(uint16_t sn)
1866 {
1867 	TODO();
1868 	return (sn + 1);
1869 }
1870 
1871 static __inline uint16_t
1872 ieee80211_sn_add(uint16_t sn, uint16_t a)
1873 {
1874 	TODO();
1875 	return (sn + a);
1876 }
1877 
1878 static __inline void
1879 ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, uint32_t x, uint8_t *addr)
1880 {
1881 	TODO();
1882 }
1883 
1884 static __inline void
1885 ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint32_t f1, uint32_t f2)
1886 {
1887 	TODO();
1888 }
1889 
1890 static __inline void
1891 ieee80211_reserve_tid(struct ieee80211_sta *sta, uint8_t tid)
1892 {
1893 	TODO();
1894 }
1895 
1896 static __inline void
1897 ieee80211_unreserve_tid(struct ieee80211_sta *sta, uint8_t tid)
1898 {
1899 	TODO();
1900 }
1901 
1902 static __inline void
1903 ieee80211_rx_ba_timer_expired(struct ieee80211_vif *vif, uint8_t *addr,
1904     uint8_t tid)
1905 {
1906 	TODO();
1907 }
1908 
1909 static __inline void
1910 ieee80211_send_eosp_nullfunc(struct ieee80211_sta *sta, uint8_t tid)
1911 {
1912 	TODO();
1913 }
1914 
1915 static __inline uint16_t
1916 ieee80211_sn_sub(uint16_t sa, uint16_t sb)
1917 {
1918 
1919 	return ((sa - sb) &
1920 	    (IEEE80211_SEQ_SEQ_MASK >> IEEE80211_SEQ_SEQ_SHIFT));
1921 }
1922 
1923 static __inline void
1924 ieee80211_sta_block_awake(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
1925     bool disable)
1926 {
1927 	TODO();
1928 }
1929 
1930 static __inline void
1931 ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool sleeping)
1932 {
1933 	TODO();
1934 }
1935 
1936 static __inline void
1937 ieee80211_sta_pspoll(struct ieee80211_sta *sta)
1938 {
1939 	TODO();
1940 }
1941 
1942 static __inline void
1943 ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, int ntids)
1944 {
1945 	TODO();
1946 }
1947 
1948 static __inline void
1949 ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf,
1950     uint64_t pn)
1951 {
1952 	TODO();
1953 }
1954 
1955 static __inline struct sk_buff *
1956 ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
1957 {
1958 
1959 	return (linuxkpi_ieee80211_tx_dequeue(hw, txq));
1960 }
1961 
1962 static __inline void
1963 ieee80211_update_mu_groups(struct ieee80211_vif *vif, uint8_t *ms, uint8_t *up)
1964 {
1965 	TODO();
1966 }
1967 
1968 static __inline void
1969 ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t)
1970 {
1971 	TODO();
1972 }
1973 
1974 static __inline void
1975 ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
1976 {
1977 
1978 	linuxkpi_ieee80211_tx_status(hw, skb);
1979 }
1980 
1981 static __inline void
1982 ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid,
1983     struct ieee80211_key_seq *seq)
1984 {
1985 	TODO();
1986 }
1987 
1988 static __inline void
1989 ieee80211_sched_scan_results(struct ieee80211_hw *hw)
1990 {
1991 	TODO();
1992 }
1993 
1994 static __inline void
1995 ieee80211_sta_eosp(struct ieee80211_sta *sta)
1996 {
1997 	TODO();
1998 }
1999 
2000 static __inline int
2001 ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid, int x)
2002 {
2003 	TODO("rtw8x");
2004 	return (-EINVAL);
2005 }
2006 
2007 static __inline int
2008 ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, uint8_t tid)
2009 {
2010 	TODO("rtw89");
2011 	return (-EINVAL);
2012 }
2013 
2014 static __inline void
2015 ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr,
2016     uint8_t tid)
2017 {
2018 	TODO("iwlwifi");
2019 }
2020 
2021 static __inline void
2022 ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, uint8_t *addr,
2023     uint8_t tid)
2024 {
2025 	TODO("iwlwifi/rtw8x/...");
2026 }
2027 
2028 static __inline void
2029 ieee80211_sched_scan_stopped(struct ieee80211_hw *hw)
2030 {
2031 	TODO();
2032 }
2033 
2034 static __inline void
2035 ieee80211_scan_completed(struct ieee80211_hw *hw,
2036     struct cfg80211_scan_info *info)
2037 {
2038 
2039 	linuxkpi_ieee80211_scan_completed(hw, info);
2040 }
2041 
2042 static __inline struct sk_buff *
2043 ieee80211_beacon_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2044     uint32_t link_id)
2045 {
2046 	TODO();
2047 	return (NULL);
2048 }
2049 
2050 static __inline struct sk_buff *
2051 ieee80211_pspoll_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
2052 {
2053 
2054 	/* Only STA needs this.  Otherwise return NULL and panic bad drivers. */
2055 	if (vif->type != NL80211_IFTYPE_STATION)
2056 		return (NULL);
2057 
2058 	return (linuxkpi_ieee80211_pspoll_get(hw, vif));
2059 }
2060 
2061 static __inline struct sk_buff *
2062 ieee80211_proberesp_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
2063 {
2064 	TODO();
2065 	return (NULL);
2066 }
2067 
2068 static __inline struct sk_buff *
2069 ieee80211_nullfunc_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2070     bool qos)
2071 {
2072 
2073 	/* Only STA needs this.  Otherwise return NULL and panic bad drivers. */
2074 	if (vif->type != NL80211_IFTYPE_STATION)
2075 		return (NULL);
2076 
2077 	return (linuxkpi_ieee80211_nullfunc_get(hw, vif, qos));
2078 }
2079 
2080 static __inline struct sk_buff *
2081 ieee80211_probereq_get(struct ieee80211_hw *hw, uint8_t *addr,
2082     uint8_t *ssid, size_t ssid_len, size_t tailroom)
2083 {
2084 
2085 	return (linuxkpi_ieee80211_probereq_get(hw, addr, ssid, ssid_len,
2086 	    tailroom));
2087 }
2088 
2089 static __inline void
2090 ieee80211_queue_delayed_work(struct ieee80211_hw *hw, struct delayed_work *w,
2091     int delay)
2092 {
2093 
2094 	linuxkpi_ieee80211_queue_delayed_work(hw, w, delay);
2095 }
2096 
2097 static __inline void
2098 ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *w)
2099 {
2100 
2101 	linuxkpi_ieee80211_queue_work(hw, w);
2102 }
2103 
2104 static __inline void
2105 ieee80211_stop_queue(struct ieee80211_hw *hw, uint16_t q)
2106 {
2107 	TODO();
2108 }
2109 
2110 static __inline void
2111 ieee80211_wake_queue(struct ieee80211_hw *hw, uint16_t q)
2112 {
2113 	TODO();
2114 }
2115 
2116 static __inline void
2117 ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb)
2118 {
2119 	IMPROVE();
2120 	ieee80211_tx_status(hw, skb);
2121 }
2122 
2123 static __inline void
2124 ieee80211_tx_status_ni(struct ieee80211_hw *hw, struct sk_buff *skb)
2125 {
2126 	IMPROVE();
2127 	ieee80211_tx_status(hw, skb);
2128 }
2129 
2130 static __inline void
2131 ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
2132 {
2133 	int i;
2134 
2135 	/*
2136 	 * Apparently clearing flags and some other fields is not right.
2137 	 * Given the function is called "status" we work on that part of
2138 	 * the union.
2139 	 */
2140 	for (i = 0; i < nitems(info->status.rates); i++)
2141 		info->status.rates[i].count = 0;
2142 	/*
2143 	 * Unclear if ack_signal should be included or not but we clear the
2144 	 * "valid" bool so this field is no longer valid.
2145 	 */
2146 	memset(&info->status.ack_signal, 0, sizeof(*info) -
2147 	    offsetof(struct ieee80211_tx_info, status.ack_signal));
2148 }
2149 
2150 static __inline void
2151 ieee80211_txq_get_depth(struct ieee80211_txq *txq, unsigned long *frame_cnt,
2152     unsigned long *byte_cnt)
2153 {
2154 
2155 	if (frame_cnt == NULL && byte_cnt == NULL)
2156 		return;
2157 
2158 	linuxkpi_ieee80211_txq_get_depth(txq, frame_cnt, byte_cnt);
2159 }
2160 
2161 static __inline int
2162 rate_lowest_index(struct ieee80211_supported_band *band,
2163     struct ieee80211_sta *sta)
2164 {
2165 	IMPROVE();
2166 	return (0);
2167 }
2168 
2169 
2170 static __inline void
2171 SET_IEEE80211_PERM_ADDR	(struct ieee80211_hw *hw, uint8_t *addr)
2172 {
2173 
2174 	ether_addr_copy(hw->wiphy->perm_addr, addr);
2175 }
2176 
2177 static __inline uint8_t *
2178 ieee80211_bss_get_ie(struct cfg80211_bss *bss, uint32_t eid)
2179 {
2180 	TODO();
2181 	return (NULL);
2182 }
2183 
2184 static __inline void
2185 ieee80211_report_low_ack(struct ieee80211_sta *sta, int x)
2186 {
2187 	TODO();
2188 }
2189 
2190 static __inline void
2191 ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr,
2192     uint8_t tid)
2193 {
2194 	TODO();
2195 }
2196 
2197 static __inline void
2198 ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr,
2199     uint8_t tid)
2200 {
2201 	TODO();
2202 }
2203 
2204 static __inline struct sk_buff *
2205 ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
2206 {
2207 	TODO();
2208 	return (NULL);
2209 }
2210 
2211 static __inline void
2212 ieee80211_tx_rate_update(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
2213     struct ieee80211_tx_info *info)
2214 {
2215 	TODO();
2216 }
2217 
2218 static __inline bool
2219 ieee80211_txq_may_transmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
2220 {
2221 	TODO();
2222 	return (false);
2223 }
2224 
2225 static __inline void
2226 ieee80211_radar_detected(struct ieee80211_hw *hw)
2227 {
2228 	TODO();
2229 }
2230 
2231 static __inline void
2232 ieee80211_sta_register_airtime(struct ieee80211_sta *sta,
2233     uint8_t tid, uint32_t duration, int x)
2234 {
2235 	TODO();
2236 }
2237 
2238 
2239 static __inline void
2240 ieee80211_txq_schedule_start(struct ieee80211_hw *hw, uint8_t ac)
2241 {
2242 	TODO();
2243 }
2244 
2245 static __inline void
2246 ieee80211_txq_schedule_end(struct ieee80211_hw *hw, uint8_t ac)
2247 {
2248 	/* DO_NADA; */
2249 }
2250 
2251 static __inline struct ieee80211_txq *
2252 ieee80211_next_txq(struct ieee80211_hw *hw, uint8_t ac)
2253 {
2254 
2255 	TODO();
2256 	return (NULL);
2257 }
2258 
2259 static __inline void
2260 ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
2261 {
2262 	TODO();
2263 }
2264 
2265 static __inline void
2266 ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq,
2267     bool withoutpkts)
2268 {
2269 	TODO();
2270 }
2271 
2272 
2273 static __inline void
2274 ieee80211_beacon_set_cntdwn(struct ieee80211_vif *vif, u8 counter)
2275 {
2276 	TODO();
2277 }
2278 
2279 static __inline int
2280 ieee80211_beacon_update_cntdwn(struct ieee80211_vif *vif)
2281 {
2282 	TODO();
2283 	return (-1);
2284 }
2285 
2286 static __inline int
2287 ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *vht_cap, uint32_t chanwidth,
2288     int x, bool t, int nss)
2289 {
2290 	TODO();
2291 	return (-1);
2292 }
2293 
2294 static __inline bool
2295 ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif)
2296 {
2297 	TODO();
2298 	return (true);
2299 }
2300 
2301 static __inline void
2302 ieee80211_disconnect(struct ieee80211_vif *vif, bool _x)
2303 {
2304 	TODO();
2305 }
2306 
2307 static __inline void
2308 ieee80211_channel_switch_disconnect(struct ieee80211_vif *vif, bool _x)
2309 {
2310 	TODO();
2311 }
2312 
2313 static __inline const struct ieee80211_sta_he_cap *
2314 ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *band,
2315     enum nl80211_iftype type)
2316 {
2317 	TODO();
2318         return (NULL);
2319 }
2320 
2321 static __inline void
2322 ieee80211_key_mic_failure(struct ieee80211_key_conf *key)
2323 {
2324 	TODO();
2325 }
2326 
2327 static __inline void
2328 ieee80211_key_replay(struct ieee80211_key_conf *key)
2329 {
2330 	TODO();
2331 }
2332 
2333 static __inline uint32_t
2334 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw,
2335     struct ieee80211_rx_status *rxstat, int len)
2336 {
2337 	TODO();
2338 	return (0);
2339 }
2340 
2341 static __inline void
2342 ieee80211_get_tx_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
2343     struct sk_buff *skb, struct ieee80211_tx_rate *txrate, int nrates)
2344 {
2345 	TODO();
2346 }
2347 
2348 static __inline void
2349 ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
2350     struct sk_buff *skb, struct list_head *list)
2351 {
2352 	TODO();
2353 }
2354 
2355 static __inline void
2356 ieee80211_tx_status_ext(struct ieee80211_hw *hw,
2357     struct ieee80211_tx_status *txstat)
2358 {
2359 	TODO();
2360 }
2361 
2362 static __inline const struct element *
2363 ieee80211_bss_get_elem(struct cfg80211_bss *bss, uint32_t eid)
2364 {
2365 	TODO();
2366 	return (NULL);
2367 }
2368 
2369 static __inline void
2370 ieee80211_color_change_finish(struct ieee80211_vif *vif)
2371 {
2372 	TODO();
2373 }
2374 
2375 static __inline struct sk_buff *
2376 ieee80211_get_fils_discovery_tmpl(struct ieee80211_hw *hw,
2377     struct ieee80211_vif *vif)
2378 {
2379 	TODO();
2380 	return (NULL);
2381 }
2382 
2383 static __inline struct sk_buff *
2384 ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw,
2385     struct ieee80211_vif *vif)
2386 {
2387 	TODO();
2388 	return (NULL);
2389 }
2390 
2391 static __inline void
2392 linuxkpi_ieee80211_send_bar(struct ieee80211_vif *vif, uint8_t *ra, uint16_t tid,
2393     uint16_t ssn)
2394 {
2395 	TODO();
2396 }
2397 
2398 static __inline void
2399 ieee80211_resume_disconnect(struct ieee80211_vif *vif)
2400 {
2401         TODO();
2402         return;
2403 }
2404 
2405 static __inline int
2406 ieee80211_data_to_8023(struct sk_buff *skb, const uint8_t *addr,
2407      enum nl80211_iftype iftype)
2408 {
2409         TODO();
2410         return (-1);
2411 }
2412 
2413 static __inline void
2414 ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *key,
2415     uint32_t iv32, uint16_t *p1k)
2416 {
2417         TODO();
2418         return;
2419 }
2420 
2421 static __inline struct ieee80211_key_conf *
2422 ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
2423     struct ieee80211_key_conf *key)
2424 {
2425         TODO();
2426         return (NULL);
2427 }
2428 
2429 static __inline void
2430 ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const uint8_t *bssid,
2431     const uint8_t *replay_ctr, gfp_t gfp)
2432 {
2433         TODO();
2434         return;
2435 }
2436 
2437 static __inline void
2438 ieee80211_remove_key(struct ieee80211_key_conf *key)
2439 {
2440         TODO();
2441         return;
2442 }
2443 
2444 static __inline void
2445 ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid,
2446     struct ieee80211_key_seq *seq)
2447 {
2448         TODO();
2449         return;
2450 }
2451 
2452 static __inline void
2453 ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif,
2454     struct cfg80211_wowlan_wakeup *wakeup, gfp_t gfp)
2455 {
2456         TODO();
2457         return;
2458 }
2459 
2460 static __inline void
2461 ieeee80211_obss_color_collision_notify(struct ieee80211_vif *vif,
2462     uint64_t obss_color_bitmap)
2463 {
2464 	TODO();
2465 }
2466 
2467 #define	ieee80211_send_bar(_v, _r, _t, _s)				\
2468     linuxkpi_ieee80211_send_bar(_v, _r, _t, _s)
2469 
2470 #endif	/* _LINUXKPI_NET_MAC80211_H */
2471