xref: /freebsd/sys/compat/linuxkpi/common/include/linux/nl80211.h (revision 963f5dc7a30624e95d72fb7f87b8892651164e46)
1 /*-
2  * Copyright (c) 2020-2021 The FreeBSD Foundation
3  *
4  * This software was developed by Björn Zeeb under sponsorship from
5  * the FreeBSD Foundation.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30 
31 #ifndef	_LINUXKPI_LINUX_NL80211_H
32 #define	_LINUXKPI_LINUX_NL80211_H
33 
34 #include <linux/bitops.h>
35 
36 enum nl80211_feature_flags {
37 	NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE	= BIT(0),
38 	NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES	= BIT(1),
39 	NL80211_FEATURE_HT_IBSS				= BIT(2),
40 	NL80211_FEATURE_LOW_PRIORITY_SCAN		= BIT(3),
41 	NL80211_FEATURE_ND_RANDOM_MAC_ADDR		= BIT(4),
42 	NL80211_FEATURE_P2P_GO_CTWIN			= BIT(5),
43 	NL80211_FEATURE_P2P_GO_OPPPS			= BIT(6),
44 	NL80211_FEATURE_QUIET				= BIT(7),
45 	NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR		= BIT(8),
46 	NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR	= BIT(9),
47 	NL80211_FEATURE_DYNAMIC_SMPS			= BIT(10),
48 	NL80211_FEATURE_STATIC_SMPS			= BIT(11),
49 	NL80211_FEATURE_SUPPORTS_WMM_ADMISSION		= BIT(12),
50 	NL80211_FEATURE_TDLS_CHANNEL_SWITCH		= BIT(13),
51 	NL80211_FEATURE_TX_POWER_INSERTION		= BIT(14),
52 	NL80211_FEATURE_WFA_TPC_IE_IN_PROBES		= BIT(15),
53 };
54 
55 enum nl80211_pmsr_ftm_failure_flags {
56 	NL80211_PMSR_FTM_FAILURE_NO_RESPONSE		= BIT(0),
57 	NL80211_PMSR_FTM_FAILURE_PEER_BUSY		= BIT(1),
58 	NL80211_PMSR_FTM_FAILURE_UNSPECIFIED		= BIT(2),
59 };
60 
61 enum nl80211_pmsr_status_flags {
62 	NL80211_PMSR_STATUS_FAILURE			= BIT(0),
63 	NL80211_PMSR_STATUS_SUCCESS			= BIT(1),
64 	NL80211_PMSR_STATUS_TIMEOUT			= BIT(2),
65 };
66 
67 #define	NL80211_PMSR_TYPE_FTM				1
68 
69 enum nl80211_reg_rule_flags {
70 	NL80211_RRF_AUTO_BW				= BIT(0),
71 	NL80211_RRF_DFS					= BIT(1),
72 	NL80211_RRF_GO_CONCURRENT			= BIT(2),
73 	NL80211_RRF_NO_IR				= BIT(3),
74 	NL80211_RRF_NO_OUTDOOR				= BIT(4),
75 	NL80211_RRF_NO_HT40MINUS			= BIT(5),
76 	NL80211_RRF_NO_HT40PLUS				= BIT(6),
77 	NL80211_RRF_NO_80MHZ				= BIT(7),
78 	NL80211_RRF_NO_160MHZ				= BIT(8),
79 	NL80211_RRF_NO_HE				= BIT(9),
80 };
81 #define	NL80211_RRF_NO_HT40	(NL80211_RRF_NO_HT40MINUS|NL80211_RRF_NO_HT40PLUS)
82 
83 enum nl80211_scan_flags {
84 	NL80211_SCAN_FLAG_FILS_MAX_CHANNEL_TIME		= BIT(0),
85 	NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION	= BIT(1),
86 	NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE	= BIT(2),
87 	NL80211_SCAN_FLAG_RANDOM_ADDR			= BIT(3),
88 	NL80211_SCAN_FLAG_COLOCATED_6GHZ		= BIT(4),
89 };
90 
91 #define	NL80211_REGDOM_SET_BY_USER			1
92 #define	NL80211_REGDOM_SET_BY_DRIVER			2
93 
94 #define	NL80211_MAX_SUPP_REG_RULES			512	/* TODO FIXME, random */
95 
96 #define	NL80211_BSS_CHAN_WIDTH_20			__LINE__ /* TODO FIXME, brcmfmac */
97 
98 enum nl80211_wpa_versions {
99 	NL80211_WPA_VERSION_1	= 1,
100 	NL80211_WPA_VERSION_2,
101 	NL80211_WPA_VERSION_3,
102 };
103 
104 enum nl80211_bss_select_attr {
105 	__NL80211_BSS_SELECT_ATTR_INVALID	= 0,
106 	NL80211_BSS_SELECT_ATTR_BAND_PREF,
107 	NL80211_BSS_SELECT_ATTR_RSSI,
108 	NL80211_BSS_SELECT_ATTR_RSSI_ADJUST,
109 };
110 
111 enum nl80211_sta_flag {
112 	/* XXX TODO */
113 	NL80211_STA_FLAG_ASSOCIATED,
114 	NL80211_STA_FLAG_AUTHENTICATED,
115 	NL80211_STA_FLAG_AUTHORIZED,
116 	NL80211_STA_FLAG_TDLS_PEER,
117 	NL80211_STA_FLAG_WME,
118 };
119 
120 enum nl80211_band {
121 	/* XXX TODO */
122 	NL80211_BAND_2GHZ	= 0,
123 	NL80211_BAND_5GHZ,
124 	NL80211_BAND_60GHZ,
125 	NL80211_BAND_6GHZ,
126 
127 	/* Keep this last. */
128 	NUM_NL80211_BANDS
129 };
130 
131 enum nl80211_chan_flags {
132 	/* XXX TODO */
133 	NL80211_CHAN_NO_HT,
134 };
135 
136 enum nl80211_chan_width {
137 	/* XXX TODO */
138 	NL80211_CHAN_WIDTH_20_NOHT,
139 	NL80211_CHAN_WIDTH_20,
140 	NL80211_CHAN_WIDTH_40,
141 	NL80211_CHAN_WIDTH_80,
142 	NL80211_CHAN_WIDTH_80P80,
143 	NL80211_CHAN_WIDTH_160,
144 	NL80211_CHAN_WIDTH_5,
145 	NL80211_CHAN_WIDTH_10,
146 };
147 
148 enum nl80211_iftype {
149 	/* XXX TODO */
150 	NL80211_IFTYPE_UNSPECIFIED,
151 	NL80211_IFTYPE_ADHOC,
152 	NL80211_IFTYPE_STATION,
153 	NL80211_IFTYPE_AP,
154 	NL80211_IFTYPE_AP_VLAN,
155 	NL80211_IFTYPE_MONITOR,
156 	NL80211_IFTYPE_P2P_CLIENT,
157 	NL80211_IFTYPE_P2P_DEVICE,
158 	NL80211_IFTYPE_P2P_GO,
159 	NL80211_IFTYPE_MESH_POINT,
160 	NL80211_IFTYPE_WDS,
161 
162 	/* Keep this last. */
163 	NUM_NL80211_IFTYPES
164 };
165 
166 enum nl80211_preamble {
167 	/* XXX TODO */
168 	NL80211_PREAMBLE_LEGACY,
169 	NL80211_PREAMBLE_HT,
170 	NL80211_PREAMBLE_VHT,
171 	NL80211_PREAMBLE_HE,
172 };
173 
174 enum nl80211_tdls_operation {
175 	/* XXX TODO */
176 	NL80211_TDLS_SETUP,
177 	NL80211_TDLS_TEARDOWN,
178 	NL80211_TDLS_ENABLE_LINK,
179 	NL80211_TDLS_DISABLE_LINK,
180 	NL80211_TDLS_DISCOVERY_REQ,
181 	NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY,
182 	NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY,
183 };
184 
185 enum nl80211_cqm_rssi_threshold_event {
186 	/* XXX TODO */
187 	NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
188 	NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
189 };
190 
191 enum nl80211_ext_feature {
192 	/* XXX TODO */
193 	NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP,
194 	NL80211_EXT_FEATURE_BSS_PARENT_TSF,
195 	NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
196 	NL80211_EXT_FEATURE_DFS_OFFLOAD,
197 	NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
198 	NL80211_EXT_FEATURE_EXT_KEY_ID,
199 	NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME,
200 	NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER,
201 	NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION,
202 	NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE,
203 	NL80211_EXT_FEATURE_PROTECTED_TWT,
204 	NL80211_EXT_FEATURE_SAE_OFFLOAD,
205 	NL80211_EXT_FEATURE_SCAN_START_TIME,
206 	NL80211_EXT_FEATURE_SET_SCAN_DWELL,
207 	NL80211_EXT_FEATURE_VHT_IBSS,
208 	NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X,
209 	NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK,
210 	NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT,
211 
212 	/* Keep this last. */
213 	NUM_NL80211_EXT_FEATURES
214 };
215 
216 enum nl80211_sta_info {
217 	/* XXX TODO */
218 	NL80211_STA_INFO_BEACON_RX,
219 	NL80211_STA_INFO_BEACON_SIGNAL_AVG,
220 	NL80211_STA_INFO_BSS_PARAM,
221 	NL80211_STA_INFO_CHAIN_SIGNAL,
222 	NL80211_STA_INFO_CONNECTED_TIME,
223 	NL80211_STA_INFO_INACTIVE_TIME,
224 	NL80211_STA_INFO_SIGNAL,
225 	NL80211_STA_INFO_SIGNAL_AVG,
226 	NL80211_STA_INFO_STA_FLAGS,
227 	NL80211_STA_INFO_RX_BITRATE,
228 	NL80211_STA_INFO_RX_PACKETS,
229 	NL80211_STA_INFO_RX_BYTES,
230 	NL80211_STA_INFO_RX_DROP_MISC,
231 	NL80211_STA_INFO_TX_BITRATE,
232 	NL80211_STA_INFO_TX_PACKETS,
233 	NL80211_STA_INFO_TX_BYTES,
234 	NL80211_STA_INFO_TX_FAILED,
235 };
236 
237 enum nl80211_ftm_stats {
238 	/* XXX TODO */
239 	NL80211_FTM_STATS_ASAP_NUM,
240 	NL80211_FTM_STATS_FAILED_NUM,
241 	NL80211_FTM_STATS_NON_ASAP_NUM,
242 	NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM,
243 	NL80211_FTM_STATS_PARTIAL_NUM,
244 	NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM,
245 	NL80211_FTM_STATS_SUCCESS_NUM,
246 	NL80211_FTM_STATS_TOTAL_DURATION_MSEC,
247 	NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM,
248 };
249 
250 enum nl80211_reg_initiator {
251 	/* XXX TODO */
252 	_XXX_FXIME_RTW88_USES_ENUM,
253 };
254 
255 struct nl80211_sta_flag_update {
256 	/* XXX TODO */
257 	int     mask, set;
258 
259 };
260 
261 enum nl80211_tx_power_setting {
262 	/* XXX TODO */
263 	NL80211_TX_POWER_AUTOMATIC,
264 	NL80211_TX_POWER_FIXED,
265 	NL80211_TX_POWER_LIMITED,
266 };
267 
268 enum nl80211_crit_proto_id {
269 	/* XXX TODO */
270 	NL80211_CRIT_PROTO_DHCP,
271 };
272 
273 enum nl80211_auth_type {
274 	NL80211_AUTHTYPE_AUTOMATIC,
275 	NL80211_AUTHTYPE_OPEN_SYSTEM,
276 	NL80211_AUTHTYPE_SHARED_KEY,
277 	NL80211_AUTHTYPE_SAE,
278 };
279 
280 enum nl80211_key_type {
281 	NL80211_KEYTYPE_GROUP,
282 	NL80211_KEYTYPE_PAIRWISE,
283 };
284 
285 enum nl80211_rate_info_he_ru_alloc {
286 	NL80211_RATE_INFO_HE_RU_ALLOC_26,
287 	NL80211_RATE_INFO_HE_RU_ALLOC_52,
288 	NL80211_RATE_INFO_HE_RU_ALLOC_106,
289 	NL80211_RATE_INFO_HE_RU_ALLOC_242,
290 	NL80211_RATE_INFO_HE_RU_ALLOC_484,
291 	NL80211_RATE_INFO_HE_RU_ALLOC_996,
292 	NL80211_RATE_INFO_HE_RU_ALLOC_2x996,
293 };
294 
295 enum nl80211_rate_info_he_gi {
296 	NL80211_RATE_INFO_HE_GI_0_8,
297 	NL80211_RATE_INFO_HE_GI_1_6,
298 	NL80211_RATE_INFO_HE_GI_3_2,
299 };
300 
301 enum nl80211_dfs_regions {
302 	NL80211_DFS_UNSET,
303 	NL80211_DFS_FCC,
304 	NL80211_DFS_ETSI,
305 	NL80211_DFS_JP,
306 };
307 
308 #endif	/* _LINUXKPI_LINUX_NL80211_H */
309