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