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