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