iw: sync nl80211.h (fixes settting antenna_gain)
[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 @@ -1555,6 +1566,22 @@ enum nl80211_commands {
37   *     data is in the format defined for the payload of the QoS Map Set element
38   *     in IEEE Std 802.11-2012, 8.4.2.97.
39   *
40 + * @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS
41 + * @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS
42 + *
43 + * @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many
44 + *     associated stations are supported in AP mode (including P2P GO); u32.
45 + *     Since drivers may not have a fixed limit on the maximum number (e.g.,
46 + *     other concurrent operations may affect this), drivers are allowed to
47 + *     advertise values that cannot always be met. In such cases, an attempt
48 + *     to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
49 + *
50 + * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
51 + *     As specified in the &enum nl80211_tdls_peer_capability.
52 + *
53 + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
54 + *     transmit power to stay within regulatory limits. u32, dBi.
55 + *
56   * @NL80211_ATTR_MAX: highest attribute number currently defined
57   * @__NL80211_ATTR_AFTER_LAST: internal use
58   */
59 @@ -1883,6 +1910,15 @@ enum nl80211_attrs {
60  
61         NL80211_ATTR_QOS_MAP,
62  
63 +       NL80211_ATTR_MAC_HINT,
64 +       NL80211_ATTR_WIPHY_FREQ_HINT,
65 +
66 +       NL80211_ATTR_MAX_AP_ASSOC_STA,
67 +
68 +       NL80211_ATTR_TDLS_PEER_CAPABILITY,
69 +
70 +       NL80211_ATTR_WIPHY_ANTENNA_GAIN,
71 +
72         /* add attributes here, update the policy in nl80211.c */
73  
74         __NL80211_ATTR_AFTER_LAST,
75 @@ -2304,6 +2340,7 @@ enum nl80211_band_attr {
76   * @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
77   *     using this channel as the primary or any of the secondary channels
78   *     isn't possible
79 + * @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
80   * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
81   *     currently defined
82   * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
83 @@ -2322,6 +2359,7 @@ enum nl80211_frequency_attr {
84         NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
85         NL80211_FREQUENCY_ATTR_NO_80MHZ,
86         NL80211_FREQUENCY_ATTR_NO_160MHZ,
87 +       NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
88  
89         /* keep last */
90         __NL80211_FREQUENCY_ATTR_AFTER_LAST,
91 @@ -2412,12 +2450,14 @@ enum nl80211_reg_type {
92   *     in KHz. This is not a center a frequency but an actual regulatory
93   *     band edge.
94   * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
95 - *     frequency range, in KHz.
96 + *     frequency range, in KHz.
97   * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
98   *     for a given frequency range. The value is in mBi (100 * dBi).
99   *     If you don't have one then don't send this.
100   * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
101   *     a given frequency range. The value is in mBm (100 * dBm).
102 + * @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
103 + *     If not present or 0 default CAC time will be used.
104   * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
105   *     currently defined
106   * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
107 @@ -2433,6 +2473,8 @@ enum nl80211_reg_rule_attr {
108         NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
109         NL80211_ATTR_POWER_RULE_MAX_EIRP,
110  
111 +       NL80211_ATTR_DFS_CAC_TIME,
112 +
113         /* keep last */
114         __NL80211_REG_RULE_ATTR_AFTER_LAST,
115         NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
116 @@ -2442,9 +2484,15 @@ enum nl80211_reg_rule_attr {
117   * enum nl80211_sched_scan_match_attr - scheduled scan match attributes
118   * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
119   * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
120 - * only report BSS with matching SSID.
121 + *     only report BSS with matching SSID.
122   * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
123 - *     BSS in scan results. Filtering is turned off if not specified.
124 + *     BSS in scan results. Filtering is turned off if not specified. Note that
125 + *     if this attribute is in a match set of its own, then it is treated as
126 + *     the default value for all matchsets with an SSID, rather than being a
127 + *     matchset of its own without an RSSI filter. This is due to problems with
128 + *     how this API was implemented in the past. Also, due to the same problem,
129 + *     the only way to create a matchset with only an RSSI filter (with this
130 + *     attribute) is if there's only a single matchset with the RSSI attribute.
131   * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
132   *     attribute number currently defined
133   * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
134 @@ -2477,6 +2525,9 @@ enum nl80211_sched_scan_match_attr {
135   * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
136   *     this includes probe requests or modes of operation that require
137   *     beaconing.
138 + * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
139 + *     base on contiguous rules and wider channels will be allowed to cross
140 + *     multiple contiguous/overlapping frequency ranges.
141   */
142  enum nl80211_reg_rule_flags {
143         NL80211_RRF_NO_OFDM             = 1<<0,
144 @@ -2488,6 +2539,7 @@ enum nl80211_reg_rule_flags {
145         NL80211_RRF_PTMP_ONLY           = 1<<6,
146         NL80211_RRF_NO_IR               = 1<<7,
147         __NL80211_RRF_NO_IBSS           = 1<<8,
148 +       NL80211_RRF_AUTO_BW             = 1<<11,
149  };
150  
151  #define NL80211_RRF_PASSIVE_SCAN       NL80211_RRF_NO_IR
152 @@ -3131,6 +3183,7 @@ enum nl80211_key_attributes {
153   *     in an array of MCS numbers.
154   * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
155   *     see &struct nl80211_txrate_vht
156 + * @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi
157   * @__NL80211_TXRATE_AFTER_LAST: internal
158   * @NL80211_TXRATE_MAX: highest TX rate attribute
159   */
160 @@ -3139,6 +3192,7 @@ enum nl80211_tx_rate_attributes {
161         NL80211_TXRATE_LEGACY,
162         NL80211_TXRATE_HT,
163         NL80211_TXRATE_VHT,
164 +       NL80211_TXRATE_GI,
165  
166         /* keep last */
167         __NL80211_TXRATE_AFTER_LAST,
168 @@ -3156,6 +3210,12 @@ struct nl80211_txrate_vht {
169         __u16 mcs[NL80211_VHT_NSS_MAX];
170  };
171  
172 +enum nl80211_txrate_gi {
173 +       NL80211_TXRATE_DEFAULT_GI,
174 +       NL80211_TXRATE_FORCE_SGI,
175 +       NL80211_TXRATE_FORCE_LGI,
176 +};
177 +
178  /**
179   * enum nl80211_band - Frequency band
180   * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
181 @@ -3801,11 +3861,6 @@ enum nl80211_ap_sme_features {
182   * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
183   *     to work properly to suppport receiving regulatory hints from
184   *     cellular base stations.
185 - * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active
186 - *     P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel
187 - *     in the interface combinations, even when it's only used for scan
188 - *     and remain-on-channel. This could be due to, for example, the
189 - *     remain-on-channel implementation requiring a channel context.
190   * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
191   *     equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
192   *     mode
193 @@ -3847,7 +3902,7 @@ enum nl80211_feature_flags {
194         NL80211_FEATURE_HT_IBSS                         = 1 << 1,
195         NL80211_FEATURE_INACTIVITY_TIMER                = 1 << 2,
196         NL80211_FEATURE_CELL_BASE_REG_HINTS             = 1 << 3,
197 -       NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL        = 1 << 4,
198 +       /* bit 4 is reserved - don't use */
199         NL80211_FEATURE_SAE                             = 1 << 5,
200         NL80211_FEATURE_LOW_PRIORITY_SCAN               = 1 << 6,
201         NL80211_FEATURE_SCAN_FLUSH                      = 1 << 7,
202 @@ -4037,4 +4092,20 @@ struct nl80211_vendor_cmd_info {
203         __u32 subcmd;
204  };
205  
206 +/**
207 + * enum nl80211_tdls_peer_capability - TDLS peer flags.
208 + *
209 + * Used by tdls_mgmt() to determine which conditional elements need
210 + * to be added to TDLS Setup frames.
211 + *
212 + * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
213 + * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
214 + * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
215 + */
216 +enum nl80211_tdls_peer_capability {
217 +       NL80211_TDLS_PEER_HT = 1<<0,
218 +       NL80211_TDLS_PEER_VHT = 1<<1,
219 +       NL80211_TDLS_PEER_WMM = 1<<2,
220 +};
221 +
222  #endif /* __LINUX_NL80211_H */