--- a/nl80211.h
+++ b/nl80211.h
-@@ -11,7 +11,7 @@
- * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
- * Copyright 2008 Colin McCabe <colin@cozybit.com>
- * Copyright 2015-2017 Intel Deutschland GmbH
-- * Copyright (C) 2018 Intel Corporation
-+ * Copyright (C) 2018-2019 Intel Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
-@@ -235,6 +235,15 @@
- */
-
- /**
-+ * DOC: SAE authentication offload
-+ *
-+ * By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they
-+ * support offloading SAE authentication for WPA3-Personal networks. In
-+ * %NL80211_CMD_CONNECT the password for SAE should be specified using
-+ * %NL80211_ATTR_SAE_PASSWORD.
-+ */
-+
-+/**
- * enum nl80211_commands - supported nl80211 commands
- *
- * @NL80211_CMD_UNSPEC: unspecified command to catch errors
-@@ -1065,6 +1074,26 @@
- * indicated by %NL80211_ATTR_WIPHY_FREQ and other attributes
- * determining the width and type.
- *
-+ * @NL80211_CMD_UPDATE_OWE_INFO: This interface allows the host driver to
-+ * offload OWE processing to user space. This intends to support
-+ * OWE AKM by the host drivers that implement SME but rely
-+ * on the user space for the cryptographic/DH IE processing in AP mode.
-+ *
-+ * @NL80211_CMD_PROBE_MESH_LINK: The requirement for mesh link metric
-+ * refreshing, is that from one mesh point we be able to send some data
-+ * frames to other mesh points which are not currently selected as a
-+ * primary traffic path, but which are only 1 hop away. The absence of
-+ * the primary path to the chosen node makes it necessary to apply some
-+ * form of marking on a chosen packet stream so that the packets can be
-+ * properly steered to the selected node for testing, and not by the
-+ * regular mesh path lookup. Further, the packets must be of type data
-+ * so that the rate control (often embedded in firmware) is used for
-+ * rate selection.
-+ *
-+ * Here attribute %NL80211_ATTR_MAC is used to specify connected mesh
-+ * peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame
-+ * content. The frame is ethernet data.
-+ *
- * @NL80211_CMD_MAX: highest used command number
- * @__NL80211_CMD_AFTER_LAST: internal use
- */
-@@ -1285,6 +1314,10 @@ enum nl80211_commands {
-
- NL80211_CMD_NOTIFY_RADAR,
-
-+ NL80211_CMD_UPDATE_OWE_INFO,
-+
-+ NL80211_CMD_PROBE_MESH_LINK,
+@@ -52,6 +52,11 @@
+ #define NL80211_MULTICAST_GROUP_NAN "nan"
+ #define NL80211_MULTICAST_GROUP_TESTMODE "testmode"
+
++#define NL80211_EDMG_BW_CONFIG_MIN 4
++#define NL80211_EDMG_BW_CONFIG_MAX 15
++#define NL80211_EDMG_CHANNELS_MIN 1
++#define NL80211_EDMG_CHANNELS_MAX 0x3c /* 0b00111100 */
+
- /* add new commands above here */
-
- /* used to define NL80211_CMD_MAX below */
-@@ -1565,6 +1598,12 @@ enum nl80211_commands {
- * (a u32 with flags from &enum nl80211_wpa_versions).
- * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
- * indicate which key management algorithm(s) to use (an array of u32).
-+ * This attribute is also sent in response to @NL80211_CMD_GET_WIPHY,
-+ * indicating the supported AKM suites, intended for specific drivers which
-+ * implement SME and have constraints on which AKMs are supported and also
-+ * the cases where an AKM support is offloaded to the driver/firmware.
-+ * If there is no such notification from the driver, user space should
-+ * assume the driver supports all the AKM suites.
- *
- * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
- * sent out by the card, for ROAM and successful CONNECT events.
-@@ -2260,10 +2299,10 @@ enum nl80211_commands {
- * &enum nl80211_external_auth_action value). This is used with the
- * %NL80211_CMD_EXTERNAL_AUTH request event.
- * @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user
-- * space supports external authentication. This attribute shall be used
-- * only with %NL80211_CMD_CONNECT request. The driver may offload
-- * authentication processing to user space if this capability is indicated
-- * in NL80211_CMD_CONNECT requests from the user space.
-+ * space supports external authentication. This attribute shall be used
-+ * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
-+ * may offload authentication processing to user space if this capability
-+ * is indicated in the respective requests from the user space.
+ /**
+ * DOC: Station handling
*
- * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
- * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
-@@ -2299,6 +2338,27 @@ enum nl80211_commands {
- * This is also used for capability advertisement in the wiphy information,
- * with the appropriate sub-attributes.
+@@ -2361,6 +2366,16 @@ enum nl80211_commands {
+ * @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection
+ * functionality.
*
-+ * @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime
-+ * scheduler.
-+ *
-+ * @NL80211_ATTR_STA_TX_POWER_SETTING: Transmit power setting type (u8) for
-+ * station associated with the AP. See &enum nl80211_tx_power_setting for
-+ * possible values.
-+ * @NL80211_ATTR_STA_TX_POWER: Transmit power level (s16) in dBm units. This
-+ * allows to set Tx power for a station. If this attribute is not included,
-+ * the default per-interface tx power setting will be overriding. Driver
-+ * should be picking up the lowest tx power, either tx power per-interface
-+ * or per-station.
-+ *
-+ * @NL80211_ATTR_SAE_PASSWORD: attribute for passing SAE password material. It
-+ * is used with %NL80211_CMD_CONNECT to provide password for offloading
-+ * SAE authentication for WPA3-Personal networks.
-+ *
-+ * @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support.
++ * @NL80211_ATTR_WIPHY_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
++ * channel(s) that are allowed to be used for EDMG transmissions.
++ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251. (u8 attribute)
++ * @NL80211_ATTR_WIPHY_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
++ * the allowed channel bandwidth configurations. (u8 attribute)
++ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
+ *
+ * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce
+ * transmit power to stay within regulatory limits. u32, dBi.
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -2748,6 +2808,16 @@ enum nl80211_attrs {
+@@ -2820,6 +2835,11 @@ enum nl80211_attrs {
- NL80211_ATTR_PEER_MEASUREMENTS,
+ NL80211_ATTR_HE_OBSS_PD,
-+ NL80211_ATTR_AIRTIME_WEIGHT,
-+ NL80211_ATTR_STA_TX_POWER_SETTING,
-+ NL80211_ATTR_STA_TX_POWER,
-+
-+ NL80211_ATTR_SAE_PASSWORD,
-+
-+ NL80211_ATTR_TWT_RESPONDER,
++ NL80211_ATTR_WIPHY_EDMG_CHANNELS,
++ NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,
+
+ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
-@@ -2791,14 +2861,14 @@ enum nl80211_attrs {
-
- #define NL80211_MAX_SUPP_RATES 32
- #define NL80211_MAX_SUPP_HT_RATES 77
--#define NL80211_MAX_SUPP_REG_RULES 64
-+#define NL80211_MAX_SUPP_REG_RULES 128
- #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
- #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
- #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
- #define NL80211_HT_CAPABILITY_LEN 26
- #define NL80211_VHT_CAPABILITY_LEN 12
- #define NL80211_HE_MIN_CAPABILITY_LEN 16
--#define NL80211_HE_MAX_CAPABILITY_LEN 51
-+#define NL80211_HE_MAX_CAPABILITY_LEN 54
- #define NL80211_MAX_NR_CIPHER_SUITES 5
- #define NL80211_MAX_NR_AKM_SUITES 2
-
-@@ -3125,6 +3195,10 @@ enum nl80211_sta_bss_param {
- * might not be fully accurate.
- * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a
- * mesh gate (u8, 0 or 1)
-+ * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
-+ * sent to the station (u64, usec)
-+ * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
-+ * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
+@@ -3201,6 +3221,8 @@ enum nl80211_sta_bss_param {
+ * sent to the station (u64, usec)
+ * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
+ * @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
++ * @NL80211_STA_INFO_ASSOC_AT_BOOTTIME: Timestamp (CLOCK_BOOTTIME, nanoseconds)
++ * of STA's association
* @__NL80211_STA_INFO_AFTER_LAST: internal
* @NL80211_STA_INFO_MAX: highest possible station info attribute
*/
-@@ -3168,6 +3242,9 @@ enum nl80211_sta_info {
- NL80211_STA_INFO_RX_MPDUS,
- NL80211_STA_INFO_FCS_ERROR_COUNT,
- NL80211_STA_INFO_CONNECTED_TO_GATE,
-+ NL80211_STA_INFO_TX_DURATION,
-+ NL80211_STA_INFO_AIRTIME_WEIGHT,
-+ NL80211_STA_INFO_AIRTIME_LINK_METRIC,
+@@ -3247,6 +3269,7 @@ enum nl80211_sta_info {
+ NL80211_STA_INFO_TX_DURATION,
+ NL80211_STA_INFO_AIRTIME_WEIGHT,
+ NL80211_STA_INFO_AIRTIME_LINK_METRIC,
++ NL80211_STA_INFO_ASSOC_AT_BOOTTIME,
/* keep last */
__NL80211_STA_INFO_AFTER_LAST,
-@@ -3277,8 +3354,10 @@ enum nl80211_mpath_flags {
- * &enum nl80211_mpath_flags;
- * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
- * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
-+ * @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination
-+ * @NL80211_MPATH_INFO_PATH_CHANGE: total number of path changes to destination
- * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
-- * currently defind
-+ * currently defined
- * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
+@@ -3428,6 +3451,12 @@ enum nl80211_band_iftype_attr {
+ * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
+ * @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using
+ * attributes from &enum nl80211_band_iftype_attr
++ * @NL80211_BAND_ATTR_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
++ * channel(s) that are allowed to be used for EDMG transmissions.
++ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251.
++ * @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
++ * the allowed channel bandwidth configurations.
++ * Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
+ * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
+ * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
*/
- enum nl80211_mpath_info {
-@@ -3290,6 +3369,8 @@ enum nl80211_mpath_info {
- NL80211_MPATH_INFO_FLAGS,
- NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
- NL80211_MPATH_INFO_DISCOVERY_RETRIES,
-+ NL80211_MPATH_INFO_HOP_COUNT,
-+ NL80211_MPATH_INFO_PATH_CHANGE,
+@@ -3445,6 +3474,9 @@ enum nl80211_band_attr {
+ NL80211_BAND_ATTR_VHT_CAPA,
+ NL80211_BAND_ATTR_IFTYPE_DATA,
++ NL80211_BAND_ATTR_EDMG_CHANNELS,
++ NL80211_BAND_ATTR_EDMG_BW_CONFIG,
++
/* keep last */
- __NL80211_MPATH_INFO_AFTER_LAST,
-@@ -3618,6 +3699,14 @@ enum nl80211_reg_rule_attr {
- * value as specified by &struct nl80211_bss_select_rssi_adjust.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
- * (this cannot be used together with SSID).
-+ * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the
-+ * band specific minimum rssi thresholds for the bands defined in
-+ * enum nl80211_band. The minimum rssi threshold value(s32) specific to a
-+ * band shall be encapsulated in attribute with type value equals to one
-+ * of the NL80211_BAND_* defined in enum nl80211_band. For example, the
-+ * minimum rssi threshold value for 2.4GHZ band shall be encapsulated
-+ * within an attribute of type NL80211_BAND_2GHZ. And one or more of such
-+ * attributes will be nested within this attribute.
- * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
- * attribute number currently defined
- * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
-@@ -3630,6 +3719,7 @@ enum nl80211_sched_scan_match_attr {
- NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
- NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
- NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
-+ NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI,
+ __NL80211_BAND_ATTR_AFTER_LAST,
+ NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
+@@ -3843,6 +3875,8 @@ enum nl80211_user_reg_hint_type {
+ * @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
+ * (on this channel or globally)
+ * @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment
++ * @NL80211_SURVEY_INFO_TIME_BSS_RX: amount of time the radio spent
++ * receiving frames destined to the local BSS
+ * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
+ * currently defined
+ * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
+@@ -3859,6 +3893,7 @@ enum nl80211_survey_info {
+ NL80211_SURVEY_INFO_TIME_TX,
+ NL80211_SURVEY_INFO_TIME_SCAN,
+ NL80211_SURVEY_INFO_PAD,
++ NL80211_SURVEY_INFO_TIME_BSS_RX,
/* keep last */
- __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
-@@ -4115,6 +4205,27 @@ enum nl80211_channel_type {
- };
-
- /**
-+ * enum nl80211_key_mode - Key mode
-+ *
-+ * @NL80211_KEY_RX_TX: (Default)
-+ * Key can be used for Rx and Tx immediately
-+ *
-+ * The following modes can only be selected for unicast keys and when the
-+ * driver supports @NL80211_EXT_FEATURE_EXT_KEY_ID:
-+ *
-+ * @NL80211_KEY_NO_TX: Only allowed in combination with @NL80211_CMD_NEW_KEY:
-+ * Unicast key can only be used for Rx, Tx not allowed, yet
-+ * @NL80211_KEY_SET_TX: Only allowed in combination with @NL80211_CMD_SET_KEY:
-+ * The unicast key identified by idx and mac is cleared for Tx and becomes
-+ * the preferred Tx key for the station.
-+ */
-+enum nl80211_key_mode {
-+ NL80211_KEY_RX_TX,
-+ NL80211_KEY_NO_TX,
-+ NL80211_KEY_SET_TX
-+};
-+
-+/**
- * enum nl80211_chan_width - channel width definitions
- *
- * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
-@@ -4319,6 +4430,7 @@ enum nl80211_mfp {
- enum nl80211_wpa_versions {
- NL80211_WPA_VERSION_1 = 1 << 0,
- NL80211_WPA_VERSION_2 = 1 << 1,
-+ NL80211_WPA_VERSION_3 = 1 << 2,
- };
-
- /**
-@@ -4357,6 +4469,9 @@ enum nl80211_key_default_types {
- * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
- * attributes, specifying what a key should be set as default as.
- * See &enum nl80211_key_default_types.
-+ * @NL80211_KEY_MODE: the mode from enum nl80211_key_mode.
-+ * Defaults to @NL80211_KEY_RX_TX.
-+ *
- * @__NL80211_KEY_AFTER_LAST: internal
- * @NL80211_KEY_MAX: highest key attribute
+ __NL80211_SURVEY_INFO_AFTER_LAST,
+@@ -4543,6 +4578,7 @@ enum nl80211_txrate_gi {
+ * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
+ * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
+ * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
++ * @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
+ * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
+ * since newer kernel versions may support more bands
*/
-@@ -4370,6 +4485,7 @@ enum nl80211_key_attributes {
- NL80211_KEY_DEFAULT_MGMT,
- NL80211_KEY_TYPE,
- NL80211_KEY_DEFAULT_TYPES,
-+ NL80211_KEY_MODE,
-
- /* keep last */
- __NL80211_KEY_AFTER_LAST,
-@@ -5223,7 +5339,7 @@ enum nl80211_feature_flags {
- 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,
-+ NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 1U << 31,
- };
+@@ -4550,6 +4586,7 @@ enum nl80211_band {
+ NL80211_BAND_2GHZ,
+ NL80211_BAND_5GHZ,
+ NL80211_BAND_60GHZ,
++ NL80211_BAND_6GHZ,
- /**
-@@ -5315,6 +5431,24 @@ enum nl80211_feature_flags {
- * able to rekey an in-use key correctly. Userspace must not rekey PTK keys
- * if this flag is not set. Ignoring this can leak clear text packets and/or
- * freeze the connection.
-+ * @NL80211_EXT_FEATURE_EXT_KEY_ID: Driver supports "Extended Key ID for
-+ * Individually Addressed Frames" from IEEE802.11-2016.
-+ *
-+ * @NL80211_EXT_FEATURE_AIRTIME_FAIRNESS: Driver supports getting airtime
-+ * fairness for transmitted packets and has enabled airtime fairness
-+ * scheduling.
-+ *
-+ * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
-+ * (set/del PMKSA operations) in AP mode.
-+ *
-+ * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports
-+ * filtering of sched scan results using band specific RSSI thresholds.
-+ *
-+ * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
-+ * to a station.
-+ *
-+ * @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in
-+ * station mode (SAE password is passed as part of the connect command).
- *
- * @NUM_NL80211_EXT_FEATURES: number of extended features.
- * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
-@@ -5355,6 +5489,12 @@ enum nl80211_ext_feature_index {
- NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
- NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
- NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
-+ NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
-+ NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
-+ NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
-+ NL80211_EXT_FEATURE_EXT_KEY_ID,
-+ NL80211_EXT_FEATURE_STA_TX_PWR,
-+ NL80211_EXT_FEATURE_SAE_OFFLOAD,
-
- /* add new features before the definition below */
- NUM_NL80211_EXT_FEATURES,
-@@ -5606,9 +5746,14 @@ enum nl80211_crit_proto_id {
- * Used by cfg80211_rx_mgmt()
- *
- * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
-+ * @NL80211_RXMGMT_FLAG_EXTERNAL_AUTH: Host driver intends to offload
-+ * the authentication. Exclusively defined for host drivers that
-+ * advertises the SME functionality but would like the userspace
-+ * to handle certain authentication algorithms (e.g. SAE).
- */
- enum nl80211_rxmgmt_flags {
- NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
-+ NL80211_RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
+ NUM_NL80211_BANDS,
};
-
- /*