-+/**
- * enum nl80211_mpath_flags - nl80211 mesh path flags
- *
- * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
-@@ -2631,6 +2834,11 @@ enum nl80211_sched_scan_match_attr {
- * @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
- * base on contiguous rules and wider channels will be allowed to cross
- * multiple contiguous/overlapping frequency ranges.
-+ * @NL80211_RRF_GO_CONCURRENT: See &NL80211_FREQUENCY_ATTR_GO_CONCURRENT
-+ * @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation
-+ * @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
-+ * @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
-+ * @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
- */
- enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_OFDM = 1<<0,
-@@ -2643,11 +2851,18 @@ enum nl80211_reg_rule_flags {
- NL80211_RRF_NO_IR = 1<<7,
- __NL80211_RRF_NO_IBSS = 1<<8,
- NL80211_RRF_AUTO_BW = 1<<11,
-+ NL80211_RRF_GO_CONCURRENT = 1<<12,
-+ NL80211_RRF_NO_HT40MINUS = 1<<13,
-+ NL80211_RRF_NO_HT40PLUS = 1<<14,
-+ NL80211_RRF_NO_80MHZ = 1<<15,
-+ NL80211_RRF_NO_160MHZ = 1<<16,
- };
-
- #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
- #define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
- #define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
-+#define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\
-+ NL80211_RRF_NO_HT40PLUS)
-
- /* For backport compatibility with older userspace */
- #define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
-@@ -2700,16 +2915,18 @@ enum nl80211_user_reg_hint_type {
- * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
- * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
- * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
-- * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
-- * spent on this channel
-- * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
-+ * @NL80211_SURVEY_INFO_TIME: amount of time (in ms) that the radio
-+ * was turned on (on channel or globally)
-+ * @NL80211_SURVEY_INFO_TIME_BUSY: amount of the time the primary
- * channel was sensed busy (either due to activity or energy detect)
-- * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
-+ * @NL80211_SURVEY_INFO_TIME_EXT_BUSY: amount of time the extension
- * channel was sensed busy
-- * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
-- * receiving data
-- * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
-- * transmitting data
-+ * @NL80211_SURVEY_INFO_TIME_RX: amount of time the radio spent
-+ * receiving data (on channel or globally)
-+ * @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent
-+ * transmitting data (on channel or globally)
-+ * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
-+ * (on this channel or globally)
- * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
- * currently defined
- * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
-@@ -2719,17 +2936,25 @@ enum nl80211_survey_info {
- NL80211_SURVEY_INFO_FREQUENCY,
- NL80211_SURVEY_INFO_NOISE,
- NL80211_SURVEY_INFO_IN_USE,
-- NL80211_SURVEY_INFO_CHANNEL_TIME,
-- NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
-- NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
-- NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
-- NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
-+ NL80211_SURVEY_INFO_TIME,
-+ NL80211_SURVEY_INFO_TIME_BUSY,
-+ NL80211_SURVEY_INFO_TIME_EXT_BUSY,
-+ NL80211_SURVEY_INFO_TIME_RX,
-+ NL80211_SURVEY_INFO_TIME_TX,
-+ NL80211_SURVEY_INFO_TIME_SCAN,
-
- /* keep last */
- __NL80211_SURVEY_INFO_AFTER_LAST,
- NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
- };
-
-+/* keep old names for compatibility */
-+#define NL80211_SURVEY_INFO_CHANNEL_TIME NL80211_SURVEY_INFO_TIME
-+#define NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY NL80211_SURVEY_INFO_TIME_BUSY
-+#define NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY NL80211_SURVEY_INFO_TIME_EXT_BUSY
-+#define NL80211_SURVEY_INFO_CHANNEL_TIME_RX NL80211_SURVEY_INFO_TIME_RX
-+#define NL80211_SURVEY_INFO_CHANNEL_TIME_TX NL80211_SURVEY_INFO_TIME_TX
-+
- /**
- * enum nl80211_mntr_flags - monitor configuration flags
- *
-@@ -2894,7 +3119,8 @@ enum nl80211_mesh_power_mode {
- *
- * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
- * established peering with for longer than this time (in seconds), then
-- * remove it from the STA's list of peers. Default is 30 minutes.
-+ * remove it from the STA's list of peers. You may set this to 0 to disable
-+ * the removal of the STA. Default is 30 minutes.
- *
- * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
- */
-@@ -3166,6 +3392,9 @@ enum nl80211_bss {
- /**
- * enum nl80211_bss_status - BSS "status"
- * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
-+ * Note that this is no longer used since cfg80211 no longer
-+ * keeps track of whether or not authentication was done with
-+ * a given BSS.
- * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
- * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
- *
-@@ -3379,6 +3608,8 @@ enum nl80211_ps_state {
- * interval in which %NL80211_ATTR_CQM_TXE_PKTS and
- * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
- * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
-+ * @NL80211_ATTR_CQM_BEACON_LOSS_EVENT: flag attribute that's set in a beacon
-+ * loss event
- * @__NL80211_ATTR_CQM_AFTER_LAST: internal
- * @NL80211_ATTR_CQM_MAX: highest key attribute
- */
-@@ -3391,6 +3622,7 @@ enum nl80211_attr_cqm {
- NL80211_ATTR_CQM_TXE_RATE,
- NL80211_ATTR_CQM_TXE_PKTS,
- NL80211_ATTR_CQM_TXE_INTVL,
-+ NL80211_ATTR_CQM_BEACON_LOSS_EVENT,
-
- /* keep last */
- __NL80211_ATTR_CQM_AFTER_LAST,
-@@ -3403,9 +3635,7 @@ enum nl80211_attr_cqm {
- * configured threshold
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
- * configured threshold
-- * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss.
-- * (Note that deauth/disassoc will still follow if the AP is not
-- * available. This event might get used as roaming event, etc.)
-+ * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: (reserved, never sent)
- */
- enum nl80211_cqm_rssi_threshold_event {
- NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
-@@ -3492,6 +3722,8 @@ struct nl80211_pattern_support {
- * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
- * the chip into a special state -- works best with chips that have
- * support for low-power operation already (flag)
-+ * Note that this mode is incompatible with all of the others, if
-+ * any others are even supported by the device.
- * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
- * is detected is implementation-specific (flag)
- * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
-@@ -3545,6 +3777,28 @@ struct nl80211_pattern_support {
- * @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only,
- * the TCP connection ran out of tokens to use for data to send to the
- * service
-+ * @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network
-+ * is detected. This is a nested attribute that contains the
-+ * same attributes used with @NL80211_CMD_START_SCHED_SCAN. It
-+ * specifies how the scan is performed (e.g. the interval, the
-+ * channels to scan and the initial delay) as well as the scan
-+ * results that will trigger a wake (i.e. the matchsets). This
-+ * attribute is also sent in a response to
-+ * @NL80211_CMD_GET_WIPHY, indicating the number of match sets
-+ * supported by the driver (u32).
-+ * @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute
-+ * containing an array with information about what triggered the
-+ * wake up. If no elements are present in the array, it means
-+ * that the information is not available. If more than one
-+ * element is present, it means that more than one match
-+ * occurred.
-+ * Each element in the array is a nested attribute that contains
-+ * one optional %NL80211_ATTR_SSID attribute and one optional
-+ * %NL80211_ATTR_SCAN_FREQUENCIES attribute. At least one of
-+ * these attributes must be present. If
-+ * %NL80211_ATTR_SCAN_FREQUENCIES contains more than one
-+ * frequency, it means that the match occurred in more than one
-+ * channel.
- * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
- * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
- *
-@@ -3570,6 +3824,8 @@ enum nl80211_wowlan_triggers {
- NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
- NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
- NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
-+ NL80211_WOWLAN_TRIG_NET_DETECT,
-+ NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS,
-
- /* keep last */
- NUM_NL80211_WOWLAN_TRIG,
-@@ -4042,6 +4298,27 @@ enum nl80211_ap_sme_features {
- * multiplexing powersave, ie. can turn off all but one chain
- * and then wake the rest up as required after, for example,
- * rts/cts handshake.
-+ * @NL80211_FEATURE_SUPPORTS_WMM_ADMISSION: the device supports setting up WMM
-+ * TSPEC sessions (TID aka TSID 0-7) with the %NL80211_CMD_ADD_TX_TS
-+ * command. Standard IEEE 802.11 TSPEC setup is not yet supported, it
-+ * needs to be able to handle Block-Ack agreements and other things.
-+ * @NL80211_FEATURE_MAC_ON_CREATE: Device supports configuring
-+ * the vif's MAC address upon creation.
-+ * See 'macaddr' field in the vif_params (cfg80211.h).
-+ * @NL80211_FEATURE_TDLS_CHANNEL_SWITCH: Driver supports channel switching when
-+ * operating as a TDLS peer.
-+ * @NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR: This device/driver supports using a
-+ * random MAC address during scan (if the device is unassociated); the
-+ * %NL80211_SCAN_FLAG_RANDOM_ADDR flag may be set for scans and the MAC
-+ * address mask/value will be used.
-+ * @NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR: This device/driver supports
-+ * using a random MAC address for every scan iteration during scheduled
-+ * scan (while not associated), the %NL80211_SCAN_FLAG_RANDOM_ADDR may
-+ * be set for scheduled scan and the MAC address mask/value will be used.
-+ * @NL80211_FEATURE_ND_RANDOM_MAC_ADDR: This device/driver supports using a
-+ * random MAC address for every scan iteration during "net detect", i.e.
-+ * scan in unassociated WoWLAN, the %NL80211_SCAN_FLAG_RANDOM_ADDR may
-+ * be set for scheduled scan and the MAC address mask/value will be used.
- */
- enum nl80211_feature_flags {
- NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
-@@ -4070,6 +4347,27 @@ enum nl80211_feature_flags {
- NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23,
- NL80211_FEATURE_STATIC_SMPS = 1 << 24,
- NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25,
-+ NL80211_FEATURE_SUPPORTS_WMM_ADMISSION = 1 << 26,
-+ NL80211_FEATURE_MAC_ON_CREATE = 1 << 27,
-+ NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28,
-+ NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29,
-+ NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30,
-+ NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1 << 31,
-+};
-+
-+/**
-+ * enum nl80211_ext_feature_index - bit index of extended features.
-+ * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
-+ *
-+ * @NUM_NL80211_EXT_FEATURES: number of extended features.
-+ * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
-+ */
-+enum nl80211_ext_feature_index {
-+ NL80211_EXT_FEATURE_VHT_IBSS,
-+
-+ /* add new features before the definition below */
-+ NUM_NL80211_EXT_FEATURES,
-+ MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
- };
-
- /**
-@@ -4118,11 +4416,21 @@ enum nl80211_connect_failed_reason {
- * dangerous because will destroy stations performance as a lot of frames
- * will be lost while scanning off-channel, therefore it must be used only
- * when really needed
-+ * @NL80211_SCAN_FLAG_RANDOM_ADDR: use a random MAC address for this scan (or
-+ * for scheduled scan: a different one for every scan iteration). When the
-+ * flag is set, depending on device capabilities the @NL80211_ATTR_MAC and
-+ * @NL80211_ATTR_MAC_MASK attributes may also be given in which case only
-+ * the masked bits will be preserved from the MAC address and the remainder
-+ * randomised. If the attributes are not given full randomisation (46 bits,
-+ * locally administered 1, multicast 0) is assumed.
-+ * This flag must not be requested when the feature isn't supported, check
-+ * the nl80211 feature flags for the device.
- */
- enum nl80211_scan_flags {
- NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
- NL80211_SCAN_FLAG_FLUSH = 1<<1,
- NL80211_SCAN_FLAG_AP = 1<<2,
-+ NL80211_SCAN_FLAG_RANDOM_ADDR = 1<<3,
- };
-
- /**