3a263686a96dda5837b52cea2eb7b98132316f6e
[openwrt.git] / package / network / utils / iw / patches / 001-nl80211_h_sync.patch
1 --- a/nl80211.h
2 +++ b/nl80211.h
3 @@ -303,8 +303,9 @@
4   *     passed, all channels allowed for the current regulatory domain
5   *     are used.  Extra IEs can also be passed from the userspace by
6   *     using the %NL80211_ATTR_IE attribute.
7 - * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan.  Returns -ENOENT
8 - *     if scheduled scan is not running.
9 + * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
10 + *     scheduled scan is not running. The caller may assume that as soon
11 + *     as the call returns, it is safe to start a new scheduled scan again.
12   * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
13   *     results available.
14   * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
15 @@ -418,8 +419,18 @@
16   *     %NL80211_ATTR_SSID attribute, and can optionally specify the association
17   *     IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_USE_MFP,
18   *     %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
19 - *     %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
20 - *     %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
21 + *     %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
22 + *     %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, %NL80211_ATTR_MAC_HINT, and
23 + *     %NL80211_ATTR_WIPHY_FREQ_HINT.
24 + *     If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are
25 + *     restrictions on BSS selection, i.e., they effectively prevent roaming
26 + *     within the ESS. %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT
27 + *     can be included to provide a recommendation of the initial BSS while
28 + *     allowing the driver to roam to other BSSes within the ESS and also to
29 + *     ignore this recommendation if the indicated BSS is not ideal. Only one
30 + *     set of BSSID,frequency parameters is used (i.e., either the enforcing
31 + *     %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
32 + *     %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
33   *     Background scan period can optionally be
34   *     specified in %NL80211_ATTR_BG_SCAN_PERIOD,
35   *     if not specified default background scan configuration
36 @@ -492,6 +503,9 @@
37   *     TX status event pertaining to the TX request.
38   *     %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
39   *     management frames at CCK rate or not in 2GHz band.
40 + *     %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
41 + *     counters which will be updated to the current value. This attribute
42 + *     is used during CSA period.
43   * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
44   *     command may be used with the corresponding cookie to cancel the wait
45   *     time if it is known that it is no longer necessary.
46 @@ -1514,10 +1528,10 @@ enum nl80211_commands {
47   *     operation).
48   * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
49   *     for the time while performing a channel switch.
50 - * @NL80211_ATTR_CSA_C_OFF_BEACON: Offset of the channel switch counter
51 - *     field in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
52 - * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter
53 - *     field in the probe response (%NL80211_ATTR_PROBE_RESP).
54 + * @NL80211_ATTR_CSA_C_OFF_BEACON: An array of offsets (u16) to the channel
55 + *     switch counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
56 + * @NL80211_ATTR_CSA_C_OFF_PRESP: An array of offsets (u16) to the channel
57 + *     switch counters in the probe response (%NL80211_ATTR_PROBE_RESP).
58   *
59   * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
60   *     As specified in the &enum nl80211_rxmgmt_flags.
61 @@ -1555,6 +1569,31 @@ enum nl80211_commands {
62   *     data is in the format defined for the payload of the QoS Map Set element
63   *     in IEEE Std 802.11-2012, 8.4.2.97.
64   *
65 + * @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS
66 + * @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS
67 + *
68 + * @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many
69 + *     associated stations are supported in AP mode (including P2P GO); u32.
70 + *     Since drivers may not have a fixed limit on the maximum number (e.g.,
71 + *     other concurrent operations may affect this), drivers are allowed to
72 + *     advertise values that cannot always be met. In such cases, an attempt
73 + *     to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
74 + *
75 + * @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which
76 + *     should be updated when the frame is transmitted.
77 + * @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum
78 + *     supported number of csa counters.
79 + *
80 + * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
81 + *     As specified in the &enum nl80211_tdls_peer_capability.
82 + *
83 + * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
84 + *     creation then the new interface will be owned by the netlink socket
85 + *     that created it and will be destroyed when the socket is closed
86 + *
87 + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
88 + *     transmit power to stay within regulatory limits. u32, dBi.
89 + *
90   * @NL80211_ATTR_MAX: highest attribute number currently defined
91   * @__NL80211_ATTR_AFTER_LAST: internal use
92   */
93 @@ -1883,6 +1922,20 @@ enum nl80211_attrs {
94  
95         NL80211_ATTR_QOS_MAP,
96  
97 +       NL80211_ATTR_MAC_HINT,
98 +       NL80211_ATTR_WIPHY_FREQ_HINT,
99 +
100 +       NL80211_ATTR_MAX_AP_ASSOC_STA,
101 +
102 +       NL80211_ATTR_TDLS_PEER_CAPABILITY,
103 +
104 +       NL80211_ATTR_IFACE_SOCKET_OWNER,
105 +
106 +       NL80211_ATTR_CSA_C_OFFSETS_TX,
107 +       NL80211_ATTR_MAX_CSA_COUNTERS,
108 +
109 +       NL80211_ATTR_WIPHY_ANTENNA_GAIN,
110 +
111         /* add attributes here, update the policy in nl80211.c */
112  
113         __NL80211_ATTR_AFTER_LAST,
114 @@ -2304,9 +2357,35 @@ enum nl80211_band_attr {
115   * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
116   *     using this channel as the primary or any of the secondary channels
117   *     isn't possible
118 + * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
119 + * @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this
120 + *     channel. A channel that has the INDOOR_ONLY attribute can only be
121 + *     used when there is a clear assessment that the device is operating in
122 + *     an indoor surroundings, i.e., it is connected to AC power (and not
123 + *     through portable DC inverters) or is under the control of a master
124 + *     that is acting as an AP and is connected to AC power.
125 + * @NL80211_FREQUENCY_ATTR_GO_CONCURRENT: GO operation is allowed on this
126 + *     channel if it's connected concurrently to a BSS on the same channel on
127 + *     the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
128 + *     band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO on a
129 + *     channel that has the GO_CONCURRENT attribute set can be done when there
130 + *     is a clear assessment that the device is operating under the guidance of
131 + *     an authorized master, i.e., setting up a GO while the device is also
132 + *     connected to an AP with DFS and radar detection on the UNII band (it is
133 + *     up to user-space, i.e., wpa_supplicant to perform the required
134 + *     verifications)
135 + * @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
136 + *     on this channel in current regulatory domain.
137 + * @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
138 + *     on this channel in current regulatory domain.
139   * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
140   *     currently defined
141   * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
142 + *
143 + * See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
144 + * for more information on the FCC description of the relaxations allowed
145 + * by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
146 + * NL80211_FREQUENCY_ATTR_GO_CONCURRENT.
147   */
148  enum nl80211_frequency_attr {
149         __NL80211_FREQUENCY_ATTR_INVALID,
150 @@ -2322,6 +2401,11 @@ enum nl80211_frequency_attr {
151         NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
152         NL80211_FREQUENCY_ATTR_NO_80MHZ,
153         NL80211_FREQUENCY_ATTR_NO_160MHZ,
154 +       NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
155 +       NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
156 +       NL80211_FREQUENCY_ATTR_GO_CONCURRENT,
157 +       NL80211_FREQUENCY_ATTR_NO_20MHZ,
158 +       NL80211_FREQUENCY_ATTR_NO_10MHZ,
159  
160         /* keep last */
161         __NL80211_FREQUENCY_ATTR_AFTER_LAST,
162 @@ -2412,12 +2496,14 @@ enum nl80211_reg_type {
163   *     in KHz. This is not a center a frequency but an actual regulatory
164   *     band edge.
165   * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
166 - *     frequency range, in KHz.
167 + *     frequency range, in KHz.
168   * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
169   *     for a given frequency range. The value is in mBi (100 * dBi).
170   *     If you don't have one then don't send this.
171   * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
172   *     a given frequency range. The value is in mBm (100 * dBm).
173 + * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
174 + *     If not present or 0 default CAC time will be used.
175   * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
176   *     currently defined
177   * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
178 @@ -2433,6 +2519,8 @@ enum nl80211_reg_rule_attr {
179         NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
180         NL80211_ATTR_POWER_RULE_MAX_EIRP,
181  
182 +       NL80211_ATTR_DFS_CAC_TIME,
183 +
184         /* keep last */
185         __NL80211_REG_RULE_ATTR_AFTER_LAST,
186         NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
187 @@ -2442,9 +2530,15 @@ enum nl80211_reg_rule_attr {
188   * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
189   * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
190   * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
191 - * only report BSS with matching SSID.
192 + *     only report BSS with matching SSID.
193   * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
194 - *     BSS in scan results. Filtering is turned off if not specified.
195 + *     BSS in scan results. Filtering is turned off if not specified. Note that
196 + *     if this attribute is in a match set of its own, then it is treated as
197 + *     the default value for all matchsets with an SSID, rather than being a
198 + *     matchset of its own without an RSSI filter. This is due to problems with
199 + *     how this API was implemented in the past. Also, due to the same problem,
200 + *     the only way to create a matchset with only an RSSI filter (with this
201 + *     attribute) is if there's only a single matchset with the RSSI attribute.
202   * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
203   *     attribute number currently defined
204   * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
205 @@ -2477,6 +2571,9 @@ enum nl80211_sched_scan_match_attr {
206   * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
207   *     this includes probe requests or modes of operation that require
208   *     beaconing.
209 + * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
210 + *     base on contiguous rules and wider channels will be allowed to cross
211 + *     multiple contiguous/overlapping frequency ranges.
212   */
213  enum nl80211_reg_rule_flags {
214         NL80211_RRF_NO_OFDM             = 1<<0,
215 @@ -2488,6 +2585,7 @@ enum nl80211_reg_rule_flags {
216         NL80211_RRF_PTMP_ONLY           = 1<<6,
217         NL80211_RRF_NO_IR               = 1<<7,
218         __NL80211_RRF_NO_IBSS           = 1<<8,
219 +       NL80211_RRF_AUTO_BW             = 1<<11,
220  };
221  
222  #define NL80211_RRF_PASSIVE_SCAN       NL80211_RRF_NO_IR
223 @@ -2526,10 +2624,13 @@ enum nl80211_dfs_regions {
224   *     present has been registered with the wireless core that
225   *     has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
226   *     supported feature.
227 + * @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the
228 + *     platform is operating in an indoor environment.
229   */
230  enum nl80211_user_reg_hint_type {
231         NL80211_USER_REG_HINT_USER      = 0,
232         NL80211_USER_REG_HINT_CELL_BASE = 1,
233 +       NL80211_USER_REG_HINT_INDOOR    = 2,
234  };
235  
236  /**
237 @@ -3131,6 +3232,7 @@ enum nl80211_key_attributes {
238   *     in an array of MCS numbers.
239   * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
240   *     see &struct nl80211_txrate_vht
241 + * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi
242   * @__NL80211_TXRATE_AFTER_LAST: internal
243   * @NL80211_TXRATE_MAX: highest TX rate attribute
244   */
245 @@ -3139,6 +3241,7 @@ enum nl80211_tx_rate_attributes {
246         NL80211_TXRATE_LEGACY,
247         NL80211_TXRATE_HT,
248         NL80211_TXRATE_VHT,
249 +       NL80211_TXRATE_GI,
250  
251         /* keep last */
252         __NL80211_TXRATE_AFTER_LAST,
253 @@ -3156,6 +3259,12 @@ struct nl80211_txrate_vht {
254         __u16 mcs[NL80211_VHT_NSS_MAX];
255  };
256  
257 +enum nl80211_txrate_gi {
258 +       NL80211_TXRATE_DEFAULT_GI,
259 +       NL80211_TXRATE_FORCE_SGI,
260 +       NL80211_TXRATE_FORCE_LGI,
261 +};
262 +
263  /**
264   * enum nl80211_band - Frequency band
265   * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
266 @@ -3595,6 +3704,8 @@ enum nl80211_iface_limit_attrs {
267   *     different channels may be used within this group.
268   * @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap
269   *     of supported channel widths for radar detection.
270 + * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap
271 + *     of supported regulatory regions for radar detection.
272   * @NUM_NL80211_IFACE_COMB: number of attributes
273   * @MAX_NL80211_IFACE_COMB: highest attribute number
274   *
275 @@ -3628,6 +3739,7 @@ enum nl80211_if_combination_attrs {
276         NL80211_IFACE_COMB_STA_AP_BI_MATCH,
277         NL80211_IFACE_COMB_NUM_CHANNELS,
278         NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
279 +       NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
280  
281         /* keep last */
282         NUM_NL80211_IFACE_COMB,
283 @@ -3801,11 +3913,8 @@ enum nl80211_ap_sme_features {
284   * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
285   *     to work properly to suppport receiving regulatory hints from
286   *     cellular base stations.
287 - * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active
288 - *     P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel
289 - *     in the interface combinations, even when it's only used for scan
290 - *     and remain-on-channel. This could be due to, for example, the
291 - *     remain-on-channel implementation requiring a channel context.
292 + * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
293 + *     here to reserve the value for API/ABI compatibility)
294   * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
295   *     equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
296   *     mode
297 @@ -3841,6 +3950,9 @@ enum nl80211_ap_sme_features {
298   *     interface. An active monitor interface behaves like a normal monitor
299   *     interface, but gets added to the driver. It ensures that incoming
300   *     unicast packets directed at the configured interface address get ACKed.
301 + * @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
302 + *     channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
303 + *     lifetime of a BSS.
304   */
305  enum nl80211_feature_flags {
306         NL80211_FEATURE_SK_TX_STATUS                    = 1 << 0,
307 @@ -3861,6 +3973,7 @@ enum nl80211_feature_flags {
308         NL80211_FEATURE_FULL_AP_CLIENT_STATE            = 1 << 15,
309         NL80211_FEATURE_USERSPACE_MPM                   = 1 << 16,
310         NL80211_FEATURE_ACTIVE_MONITOR                  = 1 << 17,
311 +       NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE       = 1 << 18,
312  };
313  
314  /**
315 @@ -4037,4 +4150,20 @@ struct nl80211_vendor_cmd_info {
316         __u32 subcmd;
317  };
318  
319 +/**
320 + * enum nl80211_tdls_peer_capability - TDLS peer flags.
321 + *
322 + * Used by tdls_mgmt() to determine which conditional elements need
323 + * to be added to TDLS Setup frames.
324 + *
325 + * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
326 + * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
327 + * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
328 + */
329 +enum nl80211_tdls_peer_capability {
330 +       NL80211_TDLS_PEER_HT = 1<<0,
331 +       NL80211_TDLS_PEER_VHT = 1<<1,
332 +       NL80211_TDLS_PEER_WMM = 1<<2,
333 +};
334 +
335  #endif /* __LINUX_NL80211_H */