884261621efc298f2c9b9584c51cdb9fb467b666
[openwrt/openwrt.git] / package / network / utils / iw / patches / 001-nl80211_h_sync.patch
1 --- a/nl80211.h
2 +++ b/nl80211.h
3 @@ -11,7 +11,7 @@
4 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
5 * Copyright 2008 Colin McCabe <colin@cozybit.com>
6 * Copyright 2015-2017 Intel Deutschland GmbH
7 - * Copyright (C) 2018 Intel Corporation
8 + * Copyright (C) 2018-2019 Intel Corporation
9 *
10 * Permission to use, copy, modify, and/or distribute this software for any
11 * purpose with or without fee is hereby granted, provided that the above
12 @@ -235,6 +235,15 @@
13 */
14
15 /**
16 + * DOC: SAE authentication offload
17 + *
18 + * By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they
19 + * support offloading SAE authentication for WPA3-Personal networks. In
20 + * %NL80211_CMD_CONNECT the password for SAE should be specified using
21 + * %NL80211_ATTR_SAE_PASSWORD.
22 + */
23 +
24 +/**
25 * enum nl80211_commands - supported nl80211 commands
26 *
27 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
28 @@ -1065,6 +1074,26 @@
29 * indicated by %NL80211_ATTR_WIPHY_FREQ and other attributes
30 * determining the width and type.
31 *
32 + * @NL80211_CMD_UPDATE_OWE_INFO: This interface allows the host driver to
33 + * offload OWE processing to user space. This intends to support
34 + * OWE AKM by the host drivers that implement SME but rely
35 + * on the user space for the cryptographic/DH IE processing in AP mode.
36 + *
37 + * @NL80211_CMD_PROBE_MESH_LINK: The requirement for mesh link metric
38 + * refreshing, is that from one mesh point we be able to send some data
39 + * frames to other mesh points which are not currently selected as a
40 + * primary traffic path, but which are only 1 hop away. The absence of
41 + * the primary path to the chosen node makes it necessary to apply some
42 + * form of marking on a chosen packet stream so that the packets can be
43 + * properly steered to the selected node for testing, and not by the
44 + * regular mesh path lookup. Further, the packets must be of type data
45 + * so that the rate control (often embedded in firmware) is used for
46 + * rate selection.
47 + *
48 + * Here attribute %NL80211_ATTR_MAC is used to specify connected mesh
49 + * peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame
50 + * content. The frame is ethernet data.
51 + *
52 * @NL80211_CMD_MAX: highest used command number
53 * @__NL80211_CMD_AFTER_LAST: internal use
54 */
55 @@ -1285,6 +1314,10 @@ enum nl80211_commands {
56
57 NL80211_CMD_NOTIFY_RADAR,
58
59 + NL80211_CMD_UPDATE_OWE_INFO,
60 +
61 + NL80211_CMD_PROBE_MESH_LINK,
62 +
63 /* add new commands above here */
64
65 /* used to define NL80211_CMD_MAX below */
66 @@ -1565,6 +1598,12 @@ enum nl80211_commands {
67 * (a u32 with flags from &enum nl80211_wpa_versions).
68 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
69 * indicate which key management algorithm(s) to use (an array of u32).
70 + * This attribute is also sent in response to @NL80211_CMD_GET_WIPHY,
71 + * indicating the supported AKM suites, intended for specific drivers which
72 + * implement SME and have constraints on which AKMs are supported and also
73 + * the cases where an AKM support is offloaded to the driver/firmware.
74 + * If there is no such notification from the driver, user space should
75 + * assume the driver supports all the AKM suites.
76 *
77 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
78 * sent out by the card, for ROAM and successful CONNECT events.
79 @@ -2260,10 +2299,10 @@ enum nl80211_commands {
80 * &enum nl80211_external_auth_action value). This is used with the
81 * %NL80211_CMD_EXTERNAL_AUTH request event.
82 * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user
83 - * space supports external authentication. This attribute shall be used
84 - * only with %NL80211_CMD_CONNECT request. The driver may offload
85 - * authentication processing to user space if this capability is indicated
86 - * in NL80211_CMD_CONNECT requests from the user space.
87 + * space supports external authentication. This attribute shall be used
88 + * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
89 + * may offload authentication processing to user space if this capability
90 + * is indicated in the respective requests from the user space.
91 *
92 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
93 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
94 @@ -2299,6 +2338,27 @@ enum nl80211_commands {
95 * This is also used for capability advertisement in the wiphy information,
96 * with the appropriate sub-attributes.
97 *
98 + * @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime
99 + * scheduler.
100 + *
101 + * @NL80211_ATTR_STA_TX_POWER_SETTING: Transmit power setting type (u8) for
102 + * station associated with the AP. See &enum nl80211_tx_power_setting for
103 + * possible values.
104 + * @NL80211_ATTR_STA_TX_POWER: Transmit power level (s16) in dBm units. This
105 + * allows to set Tx power for a station. If this attribute is not included,
106 + * the default per-interface tx power setting will be overriding. Driver
107 + * should be picking up the lowest tx power, either tx power per-interface
108 + * or per-station.
109 + *
110 + * @NL80211_ATTR_SAE_PASSWORD: attribute for passing SAE password material. It
111 + * is used with %NL80211_CMD_CONNECT to provide password for offloading
112 + * SAE authentication for WPA3-Personal networks.
113 + *
114 + * @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support.
115 + *
116 + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
117 + * transmit power to stay within regulatory limits. u32, dBi.
118 + *
119 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
120 * @NL80211_ATTR_MAX: highest attribute number currently defined
121 * @__NL80211_ATTR_AFTER_LAST: internal use
122 @@ -2748,6 +2808,16 @@ enum nl80211_attrs {
123
124 NL80211_ATTR_PEER_MEASUREMENTS,
125
126 + NL80211_ATTR_AIRTIME_WEIGHT,
127 + NL80211_ATTR_STA_TX_POWER_SETTING,
128 + NL80211_ATTR_STA_TX_POWER,
129 +
130 + NL80211_ATTR_SAE_PASSWORD,
131 +
132 + NL80211_ATTR_TWT_RESPONDER,
133 +
134 + NL80211_ATTR_WIPHY_ANTENNA_GAIN,
135 +
136 /* add attributes here, update the policy in nl80211.c */
137
138 __NL80211_ATTR_AFTER_LAST,
139 @@ -2791,14 +2861,14 @@ enum nl80211_attrs {
140
141 #define NL80211_MAX_SUPP_RATES 32
142 #define NL80211_MAX_SUPP_HT_RATES 77
143 -#define NL80211_MAX_SUPP_REG_RULES 64
144 +#define NL80211_MAX_SUPP_REG_RULES 128
145 #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
146 #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
147 #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
148 #define NL80211_HT_CAPABILITY_LEN 26
149 #define NL80211_VHT_CAPABILITY_LEN 12
150 #define NL80211_HE_MIN_CAPABILITY_LEN 16
151 -#define NL80211_HE_MAX_CAPABILITY_LEN 51
152 +#define NL80211_HE_MAX_CAPABILITY_LEN 54
153 #define NL80211_MAX_NR_CIPHER_SUITES 5
154 #define NL80211_MAX_NR_AKM_SUITES 2
155
156 @@ -3125,6 +3195,10 @@ enum nl80211_sta_bss_param {
157 * might not be fully accurate.
158 * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a
159 * mesh gate (u8, 0 or 1)
160 + * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
161 + * sent to the station (u64, usec)
162 + * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
163 + * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
164 * @__NL80211_STA_INFO_AFTER_LAST: internal
165 * @NL80211_STA_INFO_MAX: highest possible station info attribute
166 */
167 @@ -3168,6 +3242,9 @@ enum nl80211_sta_info {
168 NL80211_STA_INFO_RX_MPDUS,
169 NL80211_STA_INFO_FCS_ERROR_COUNT,
170 NL80211_STA_INFO_CONNECTED_TO_GATE,
171 + NL80211_STA_INFO_TX_DURATION,
172 + NL80211_STA_INFO_AIRTIME_WEIGHT,
173 + NL80211_STA_INFO_AIRTIME_LINK_METRIC,
174
175 /* keep last */
176 __NL80211_STA_INFO_AFTER_LAST,
177 @@ -3277,8 +3354,10 @@ enum nl80211_mpath_flags {
178 * &enum nl80211_mpath_flags;
179 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
180 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
181 + * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination
182 + * @NL80211_MPATH_INFO_PATH_CHANGE: total number of path changes to destination
183 * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
184 - * currently defind
185 + * currently defined
186 * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
187 */
188 enum nl80211_mpath_info {
189 @@ -3290,6 +3369,8 @@ enum nl80211_mpath_info {
190 NL80211_MPATH_INFO_FLAGS,
191 NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
192 NL80211_MPATH_INFO_DISCOVERY_RETRIES,
193 + NL80211_MPATH_INFO_HOP_COUNT,
194 + NL80211_MPATH_INFO_PATH_CHANGE,
195
196 /* keep last */
197 __NL80211_MPATH_INFO_AFTER_LAST,
198 @@ -3618,6 +3699,14 @@ enum nl80211_reg_rule_attr {
199 * value as specified by &struct nl80211_bss_select_rssi_adjust.
200 * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
201 * (this cannot be used together with SSID).
202 + * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the
203 + * band specific minimum rssi thresholds for the bands defined in
204 + * enum nl80211_band. The minimum rssi threshold value(s32) specific to a
205 + * band shall be encapsulated in attribute with type value equals to one
206 + * of the NL80211_BAND_* defined in enum nl80211_band. For example, the
207 + * minimum rssi threshold value for 2.4GHZ band shall be encapsulated
208 + * within an attribute of type NL80211_BAND_2GHZ. And one or more of such
209 + * attributes will be nested within this attribute.
210 * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
211 * attribute number currently defined
212 * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
213 @@ -3630,6 +3719,7 @@ enum nl80211_sched_scan_match_attr {
214 NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
215 NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
216 NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
217 + NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI,
218
219 /* keep last */
220 __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
221 @@ -4115,6 +4205,27 @@ enum nl80211_channel_type {
222 };
223
224 /**
225 + * enum nl80211_key_mode - Key mode
226 + *
227 + * @NL80211_KEY_RX_TX: (Default)
228 + * Key can be used for Rx and Tx immediately
229 + *
230 + * The following modes can only be selected for unicast keys and when the
231 + * driver supports @NL80211_EXT_FEATURE_EXT_KEY_ID:
232 + *
233 + * @NL80211_KEY_NO_TX: Only allowed in combination with @NL80211_CMD_NEW_KEY:
234 + * Unicast key can only be used for Rx, Tx not allowed, yet
235 + * @NL80211_KEY_SET_TX: Only allowed in combination with @NL80211_CMD_SET_KEY:
236 + * The unicast key identified by idx and mac is cleared for Tx and becomes
237 + * the preferred Tx key for the station.
238 + */
239 +enum nl80211_key_mode {
240 + NL80211_KEY_RX_TX,
241 + NL80211_KEY_NO_TX,
242 + NL80211_KEY_SET_TX
243 +};
244 +
245 +/**
246 * enum nl80211_chan_width - channel width definitions
247 *
248 * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
249 @@ -4319,6 +4430,7 @@ enum nl80211_mfp {
250 enum nl80211_wpa_versions {
251 NL80211_WPA_VERSION_1 = 1 << 0,
252 NL80211_WPA_VERSION_2 = 1 << 1,
253 + NL80211_WPA_VERSION_3 = 1 << 2,
254 };
255
256 /**
257 @@ -4357,6 +4469,9 @@ enum nl80211_key_default_types {
258 * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
259 * attributes, specifying what a key should be set as default as.
260 * See &enum nl80211_key_default_types.
261 + * @NL80211_KEY_MODE: the mode from enum nl80211_key_mode.
262 + * Defaults to @NL80211_KEY_RX_TX.
263 + *
264 * @__NL80211_KEY_AFTER_LAST: internal
265 * @NL80211_KEY_MAX: highest key attribute
266 */
267 @@ -4370,6 +4485,7 @@ enum nl80211_key_attributes {
268 NL80211_KEY_DEFAULT_MGMT,
269 NL80211_KEY_TYPE,
270 NL80211_KEY_DEFAULT_TYPES,
271 + NL80211_KEY_MODE,
272
273 /* keep last */
274 __NL80211_KEY_AFTER_LAST,
275 @@ -5223,7 +5339,7 @@ enum nl80211_feature_flags {
276 NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28,
277 NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29,
278 NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30,
279 - NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1 << 31,
280 + NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1U << 31,
281 };
282
283 /**
284 @@ -5315,6 +5431,24 @@ enum nl80211_feature_flags {
285 * able to rekey an in-use key correctly. Userspace must not rekey PTK keys
286 * if this flag is not set. Ignoring this can leak clear text packets and/or
287 * freeze the connection.
288 + * @NL80211_EXT_FEATURE_EXT_KEY_ID: Driver supports "Extended Key ID for
289 + * Individually Addressed Frames" from IEEE802.11-2016.
290 + *
291 + * @NL80211_EXT_FEATURE_AIRTIME_FAIRNESS: Driver supports getting airtime
292 + * fairness for transmitted packets and has enabled airtime fairness
293 + * scheduling.
294 + *
295 + * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
296 + * (set/del PMKSA operations) in AP mode.
297 + *
298 + * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports
299 + * filtering of sched scan results using band specific RSSI thresholds.
300 + *
301 + * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
302 + * to a station.
303 + *
304 + * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in
305 + * station mode (SAE password is passed as part of the connect command).
306 *
307 * @NUM_NL80211_EXT_FEATURES: number of extended features.
308 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
309 @@ -5355,6 +5489,12 @@ enum nl80211_ext_feature_index {
310 NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
311 NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
312 NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
313 + NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
314 + NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
315 + NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
316 + NL80211_EXT_FEATURE_EXT_KEY_ID,
317 + NL80211_EXT_FEATURE_STA_TX_PWR,
318 + NL80211_EXT_FEATURE_SAE_OFFLOAD,
319
320 /* add new features before the definition below */
321 NUM_NL80211_EXT_FEATURES,
322 @@ -5606,9 +5746,14 @@ enum nl80211_crit_proto_id {
323 * Used by cfg80211_rx_mgmt()
324 *
325 * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
326 + * @NL80211_RXMGMT_FLAG_EXTERNAL_AUTH: Host driver intends to offload
327 + * the authentication. Exclusively defined for host drivers that
328 + * advertises the SME functionality but would like the userspace
329 + * to handle certain authentication algorithms (e.g. SAE).
330 */
331 enum nl80211_rxmgmt_flags {
332 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
333 + NL80211_RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
334 };
335
336 /*