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