mac80211: update to wireless-testing 2016-05-12
[openwrt/openwrt.git] / package / network / utils / iw / patches / 001-nl80211_h_sync.patch
1 --- a/nl80211.h
2 +++ b/nl80211.h
3 @@ -10,6 +10,7 @@
4 * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
5 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
6 * Copyright 2008 Colin McCabe <colin@cozybit.com>
7 + * Copyright 2015 Intel Deutschland GmbH
8 *
9 * Permission to use, copy, modify, and/or distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 @@ -321,14 +322,24 @@
12 * @NL80211_CMD_GET_SCAN: get scan results
13 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
14 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
15 - * probe requests at CCK rate or not.
16 + * probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
17 + * specify a BSSID to scan for; if not included, the wildcard BSSID will
18 + * be used.
19 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
20 * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
21 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
22 * partial scan results may be available
23 *
24 * @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
25 - * intervals, as specified by %NL80211_ATTR_SCHED_SCAN_INTERVAL.
26 + * intervals and certain number of cycles, as specified by
27 + * %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is
28 + * not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified,
29 + * scheduled scan will run in an infinite loop with the specified interval.
30 + * These attributes are mutually exculsive,
31 + * i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if
32 + * NL80211_ATTR_SCHED_SCAN_PLANS is defined.
33 + * If for some reason scheduled scan is aborted by the driver, all scan
34 + * plans are canceled (including scan plans that did not start yet).
35 * Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
36 * are passed, they are used in the probe requests. For
37 * broadcast, a broadcast SSID must be passed (ie. an empty
38 @@ -418,7 +429,11 @@
39 * @NL80211_CMD_ASSOCIATE: association request and notification; like
40 * NL80211_CMD_AUTHENTICATE but for Association and Reassociation
41 * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
42 - * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
43 + * MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). The
44 + * %NL80211_ATTR_PREV_BSSID attribute is used to specify whether the
45 + * request is for the initial association to an ESS (that attribute not
46 + * included) or for reassociation within the ESS (that attribute is
47 + * included).
48 * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
49 * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
50 * MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
51 @@ -468,6 +483,9 @@
52 * set of BSSID,frequency parameters is used (i.e., either the enforcing
53 * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
54 * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
55 + * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within
56 + * the ESS in case the device is already associated and an association with
57 + * a different BSS is desired.
58 * Background scan period can optionally be
59 * specified in %NL80211_ATTR_BG_SCAN_PERIOD,
60 * if not specified default background scan configuration
61 @@ -811,6 +829,10 @@
62 * as an event to indicate changes for devices with wiphy-specific regdom
63 * management.
64 *
65 + * @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is
66 + * not running. The driver indicates the status of the scan through
67 + * cfg80211_scan_done().
68 + *
69 * @NL80211_CMD_MAX: highest used command number
70 * @__NL80211_CMD_AFTER_LAST: internal use
71 */
72 @@ -997,6 +1019,8 @@ enum nl80211_commands {
73
74 NL80211_CMD_WIPHY_REG_CHANGE,
75
76 + NL80211_CMD_ABORT_SCAN,
77 +
78 /* add new commands above here */
79
80 /* used to define NL80211_CMD_MAX below */
81 @@ -1270,8 +1294,11 @@ enum nl80211_commands {
82 * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
83 * sent by peer, for ROAM and successful CONNECT events.
84 *
85 - * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
86 - * commands to specify using a reassociate frame
87 + * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT
88 + * commands to specify a request to reassociate within an ESS, i.e., to use
89 + * Reassociate Request frame (with the value of this attribute in the
90 + * Current AP address field) instead of Association Request frame which is
91 + * used for the initial association to an ESS.
92 *
93 * @NL80211_ATTR_KEY: key information in a nested attribute with
94 * %NL80211_KEY_* sub-attributes
95 @@ -1712,6 +1739,8 @@ enum nl80211_commands {
96 * underlying device supports these minimal RRM features:
97 * %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
98 * %NL80211_FEATURE_QUIET,
99 + * Or, if global RRM is supported, see:
100 + * %NL80211_EXT_FEATURE_RRM
101 * If this flag is used, driver must add the Power Capabilities IE to the
102 * association request. In addition, it must also set the RRM capability
103 * flag in the association request's Capability Info field.
104 @@ -1755,12 +1784,44 @@ enum nl80211_commands {
105 * over all channels.
106 *
107 * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before the first cycle of a
108 - * scheduled scan (or a WoWLAN net-detect scan) is started, u32
109 - * in seconds.
110 + * scheduled scan is started. Or the delay before a WoWLAN
111 + * net-detect scan is started, counting from the moment the
112 + * system is suspended. This value is a u32, in seconds.
113
114 * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
115 * is operating in an indoor environment.
116 *
117 + * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS: maximum number of scan plans for
118 + * scheduled scan supported by the device (u32), a wiphy attribute.
119 + * @NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL: maximum interval (in seconds) for
120 + * a scan plan (u32), a wiphy attribute.
121 + * @NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS: maximum number of iterations in
122 + * a scan plan (u32), a wiphy attribute.
123 + * @NL80211_ATTR_SCHED_SCAN_PLANS: a list of scan plans for scheduled scan.
124 + * Each scan plan defines the number of scan iterations and the interval
125 + * between scans. The last scan plan will always run infinitely,
126 + * thus it must not specify the number of iterations, only the interval
127 + * between scans. The scan plans are executed sequentially.
128 + * Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan.
129 + * @NL80211_ATTR_PBSS: flag attribute. If set it means operate
130 + * in a PBSS. Specified in %NL80211_CMD_CONNECT to request
131 + * connecting to a PCP, and in %NL80211_CMD_START_AP to start
132 + * a PCP instead of AP. Relevant for DMG networks only.
133 + * @NL80211_ATTR_BSS_SELECT: nested attribute for driver supporting the
134 + * BSS selection feature. When used with %NL80211_CMD_GET_WIPHY it contains
135 + * attributes according &enum nl80211_bss_select_attr to indicate what
136 + * BSS selection behaviours are supported. When used with %NL80211_CMD_CONNECT
137 + * it contains the behaviour-specific attribute containing the parameters for
138 + * BSS selection to be done by driver and/or firmware.
139 + *
140 + * @NL80211_ATTR_STA_SUPPORT_P2P_PS: whether P2P PS mechanism supported
141 + * or not. u8, one of the values of &enum nl80211_sta_p2p_ps_status
142 + *
143 + * @NL80211_ATTR_PAD: attribute used for padding for 64-bit alignment
144 + *
145 + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
146 + * transmit power to stay within regulatory limits. u32, dBi.
147 + *
148 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
149 * @NL80211_ATTR_MAX: highest attribute number currently defined
150 * @__NL80211_ATTR_AFTER_LAST: internal use
151 @@ -2130,6 +2191,21 @@ enum nl80211_attrs {
152
153 NL80211_ATTR_REG_INDOOR,
154
155 + NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS,
156 + NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL,
157 + NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
158 + NL80211_ATTR_SCHED_SCAN_PLANS,
159 +
160 + NL80211_ATTR_PBSS,
161 +
162 + NL80211_ATTR_BSS_SELECT,
163 +
164 + NL80211_ATTR_STA_SUPPORT_P2P_PS,
165 +
166 + NL80211_ATTR_PAD,
167 +
168 + NL80211_ATTR_WIPHY_ANTENNA_GAIN,
169 +
170 /* add attributes here, update the policy in nl80211.c */
171
172 __NL80211_ATTR_AFTER_LAST,
173 @@ -2273,6 +2349,20 @@ enum nl80211_sta_flags {
174 NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
175 };
176
177 +/**
178 + * enum nl80211_sta_p2p_ps_status - station support of P2P PS
179 + *
180 + * @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism
181 + * @@NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism
182 + * @NUM_NL80211_P2P_PS_STATUS: number of values
183 + */
184 +enum nl80211_sta_p2p_ps_status {
185 + NL80211_P2P_PS_UNSUPPORTED = 0,
186 + NL80211_P2P_PS_SUPPORTED,
187 +
188 + NUM_NL80211_P2P_PS_STATUS,
189 +};
190 +
191 #define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
192
193 /**
194 @@ -2430,6 +2520,9 @@ enum nl80211_sta_bss_param {
195 * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames;
196 * each one of those is again nested with &enum nl80211_tid_stats
197 * attributes carrying the actual values.
198 + * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames
199 + * received from the station (u64, usec)
200 + * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment
201 * @__NL80211_STA_INFO_AFTER_LAST: internal
202 * @NL80211_STA_INFO_MAX: highest possible station info attribute
203 */
204 @@ -2466,6 +2559,8 @@ enum nl80211_sta_info {
205 NL80211_STA_INFO_BEACON_RX,
206 NL80211_STA_INFO_BEACON_SIGNAL_AVG,
207 NL80211_STA_INFO_TID_STATS,
208 + NL80211_STA_INFO_RX_DURATION,
209 + NL80211_STA_INFO_PAD,
210
211 /* keep last */
212 __NL80211_STA_INFO_AFTER_LAST,
213 @@ -2482,6 +2577,7 @@ enum nl80211_sta_info {
214 * transmitted MSDUs (not counting the first attempt; u64)
215 * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted
216 * MSDUs (u64)
217 + * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment
218 * @NUM_NL80211_TID_STATS: number of attributes here
219 * @NL80211_TID_STATS_MAX: highest numbered attribute here
220 */
221 @@ -2491,6 +2587,7 @@ enum nl80211_tid_stats {
222 NL80211_TID_STATS_TX_MSDU,
223 NL80211_TID_STATS_TX_MSDU_RETRIES,
224 NL80211_TID_STATS_TX_MSDU_FAILED,
225 + NL80211_TID_STATS_PAD,
226
227 /* keep last */
228 NUM_NL80211_TID_STATS,
229 @@ -2927,6 +3024,7 @@ enum nl80211_user_reg_hint_type {
230 * transmitting data (on channel or globally)
231 * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
232 * (on this channel or globally)
233 + * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment
234 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
235 * currently defined
236 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
237 @@ -2942,6 +3040,7 @@ enum nl80211_survey_info {
238 NL80211_SURVEY_INFO_TIME_RX,
239 NL80211_SURVEY_INFO_TIME_TX,
240 NL80211_SURVEY_INFO_TIME_SCAN,
241 + NL80211_SURVEY_INFO_PAD,
242
243 /* keep last */
244 __NL80211_SURVEY_INFO_AFTER_LAST,
245 @@ -3364,6 +3463,10 @@ enum nl80211_bss_scan_width {
246 * (not present if no beacon frame has been received yet)
247 * @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
248 * @NL80211_BSS_TSF is known to be from a probe response (flag attribute)
249 + * @NL80211_BSS_LAST_SEEN_BOOTTIME: CLOCK_BOOTTIME timestamp when this entry
250 + * was last updated by a received frame. The value is expected to be
251 + * accurate to about 10ms. (u64, nanoseconds)
252 + * @NL80211_BSS_PAD: attribute used for padding for 64-bit alignment
253 * @__NL80211_BSS_AFTER_LAST: internal
254 * @NL80211_BSS_MAX: highest BSS attribute
255 */
256 @@ -3383,6 +3486,8 @@ enum nl80211_bss {
257 NL80211_BSS_CHAN_WIDTH,
258 NL80211_BSS_BEACON_TSF,
259 NL80211_BSS_PRESP_DATA,
260 + NL80211_BSS_LAST_SEEN_BOOTTIME,
261 + NL80211_BSS_PAD,
262
263 /* keep last */
264 __NL80211_BSS_AFTER_LAST,
265 @@ -3568,11 +3673,15 @@ enum nl80211_txrate_gi {
266 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
267 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
268 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
269 + * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
270 + * since newer kernel versions may support more bands
271 */
272 enum nl80211_band {
273 NL80211_BAND_2GHZ,
274 NL80211_BAND_5GHZ,
275 NL80211_BAND_60GHZ,
276 +
277 + NUM_NL80211_BANDS,
278 };
279
280 /**
281 @@ -4358,12 +4467,18 @@ enum nl80211_feature_flags {
282 /**
283 * enum nl80211_ext_feature_index - bit index of extended features.
284 * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
285 + * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can
286 + * can request to use RRM (see %NL80211_ATTR_USE_RRM) with
287 + * %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
288 + * the ASSOC_REQ_USE_RRM flag in the association request even if
289 + * NL80211_FEATURE_QUIET is not advertized.
290 *
291 * @NUM_NL80211_EXT_FEATURES: number of extended features.
292 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
293 */
294 enum nl80211_ext_feature_index {
295 NL80211_EXT_FEATURE_VHT_IBSS,
296 + NL80211_EXT_FEATURE_RRM,
297
298 /* add new features before the definition below */
299 NUM_NL80211_EXT_FEATURES,
300 @@ -4589,4 +4704,72 @@ enum nl80211_tdls_peer_capability {
301 NL80211_TDLS_PEER_WMM = 1<<2,
302 };
303
304 +/**
305 + * enum nl80211_sched_scan_plan - scanning plan for scheduled scan
306 + * @__NL80211_SCHED_SCAN_PLAN_INVALID: attribute number 0 is reserved
307 + * @NL80211_SCHED_SCAN_PLAN_INTERVAL: interval between scan iterations. In
308 + * seconds (u32).
309 + * @NL80211_SCHED_SCAN_PLAN_ITERATIONS: number of scan iterations in this
310 + * scan plan (u32). The last scan plan must not specify this attribute
311 + * because it will run infinitely. A value of zero is invalid as it will
312 + * make the scan plan meaningless.
313 + * @NL80211_SCHED_SCAN_PLAN_MAX: highest scheduled scan plan attribute number
314 + * currently defined
315 + * @__NL80211_SCHED_SCAN_PLAN_AFTER_LAST: internal use
316 + */
317 +enum nl80211_sched_scan_plan {
318 + __NL80211_SCHED_SCAN_PLAN_INVALID,
319 + NL80211_SCHED_SCAN_PLAN_INTERVAL,
320 + NL80211_SCHED_SCAN_PLAN_ITERATIONS,
321 +
322 + /* keep last */
323 + __NL80211_SCHED_SCAN_PLAN_AFTER_LAST,
324 + NL80211_SCHED_SCAN_PLAN_MAX =
325 + __NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1
326 +};
327 +
328 +/**
329 + * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters.
330 + *
331 + * @band: band of BSS that must match for RSSI value adjustment.
332 + * @delta: value used to adjust the RSSI value of matching BSS.
333 + */
334 +struct nl80211_bss_select_rssi_adjust {
335 + __u8 band;
336 + __s8 delta;
337 +} __attribute__((packed));
338 +
339 +/**
340 + * enum nl80211_bss_select_attr - attributes for bss selection.
341 + *
342 + * @__NL80211_BSS_SELECT_ATTR_INVALID: reserved.
343 + * @NL80211_BSS_SELECT_ATTR_RSSI: Flag indicating only RSSI-based BSS selection
344 + * is requested.
345 + * @NL80211_BSS_SELECT_ATTR_BAND_PREF: attribute indicating BSS
346 + * selection should be done such that the specified band is preferred.
347 + * When there are multiple BSS-es in the preferred band, the driver
348 + * shall use RSSI-based BSS selection as a second step. The value of
349 + * this attribute is according to &enum nl80211_band (u32).
350 + * @NL80211_BSS_SELECT_ATTR_RSSI_ADJUST: When present the RSSI level for
351 + * BSS-es in the specified band is to be adjusted before doing
352 + * RSSI-based BSS selection. The attribute value is a packed structure
353 + * value as specified by &struct nl80211_bss_select_rssi_adjust.
354 + * @NL80211_BSS_SELECT_ATTR_MAX: highest bss select attribute number.
355 + * @__NL80211_BSS_SELECT_ATTR_AFTER_LAST: internal use.
356 + *
357 + * One and only one of these attributes are found within %NL80211_ATTR_BSS_SELECT
358 + * for %NL80211_CMD_CONNECT. It specifies the required BSS selection behaviour
359 + * which the driver shall use.
360 + */
361 +enum nl80211_bss_select_attr {
362 + __NL80211_BSS_SELECT_ATTR_INVALID,
363 + NL80211_BSS_SELECT_ATTR_RSSI,
364 + NL80211_BSS_SELECT_ATTR_BAND_PREF,
365 + NL80211_BSS_SELECT_ATTR_RSSI_ADJUST,
366 +
367 + /* keep last */
368 + __NL80211_BSS_SELECT_ATTR_AFTER_LAST,
369 + NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1
370 +};
371 +
372 #endif /* __LINUX_NL80211_H */