]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
update nl80211.h
authorJohannes Berg <johannes.berg@intel.com>
Thu, 14 Apr 2016 09:12:38 +0000 (11:12 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 14 Apr 2016 09:12:38 +0000 (11:12 +0200)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
nl80211.h
util.c

index 5b7b5ebe7ca8731868e38bfab6218c166cb0317d..9baa20b763f5303d605935d9b5b6e7a68353139e 100644 (file)
--- a/nl80211.h
+++ b/nl80211.h
  * @NL80211_CMD_GET_SCAN: get scan results
  * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
  *     %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- *     probe requests at CCK rate or not.
+ *     probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
+ *     specify a BSSID to scan for; if not included, the wildcard BSSID will
+ *     be used.
  * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
  *     NL80211_CMD_GET_SCAN and on the "scan" multicast group)
  * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
  * @NL80211_CMD_ASSOCIATE: association request and notification; like
  *     NL80211_CMD_AUTHENTICATE but for Association and Reassociation
  *     (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
- *     MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
+ *     MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). The
+ *     %NL80211_ATTR_PREV_BSSID attribute is used to specify whether the
+ *     request is for the initial association to an ESS (that attribute not
+ *     included) or for reassociation within the ESS (that attribute is
+ *     included).
  * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
  *     NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
  *     MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
  *     set of BSSID,frequency parameters is used (i.e., either the enforcing
  *     %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
  *     %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
+ *     %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within
+ *     the ESS in case the device is already associated and an association with
+ *     a different BSS is desired.
  *     Background scan period can optionally be
  *     specified in %NL80211_ATTR_BG_SCAN_PERIOD,
  *     if not specified default background scan configuration
@@ -1285,8 +1294,11 @@ enum nl80211_commands {
  * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
  *     sent by peer, for ROAM and successful CONNECT events.
  *
- * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
- *     commands to specify using a reassociate frame
+ * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT
+ *     commands to specify a request to reassociate within an ESS, i.e., to use
+ *     Reassociate Request frame (with the value of this attribute in the
+ *     Current AP address field) instead of Association Request frame which is
+ *     used for the initial association to an ESS.
  *
  * @NL80211_ATTR_KEY: key information in a nested attribute with
  *     %NL80211_KEY_* sub-attributes
@@ -1727,6 +1739,8 @@ enum nl80211_commands {
  *     underlying device supports these minimal RRM features:
  *             %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
  *             %NL80211_FEATURE_QUIET,
+ *     Or, if global RRM is supported, see:
+ *             %NL80211_EXT_FEATURE_RRM
  *     If this flag is used, driver must add the Power Capabilities IE to the
  *     association request. In addition, it must also set the RRM capability
  *     flag in the association request's Capability Info field.
@@ -1789,6 +1803,19 @@ enum nl80211_commands {
  *     thus it must not specify the number of iterations, only the interval
  *     between scans. The scan plans are executed sequentially.
  *     Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan.
+ * @NL80211_ATTR_PBSS: flag attribute. If set it means operate
+ *     in a PBSS. Specified in %NL80211_CMD_CONNECT to request
+ *     connecting to a PCP, and in %NL80211_CMD_START_AP to start
+ *     a PCP instead of AP. Relevant for DMG networks only.
+ * @NL80211_ATTR_BSS_SELECT: nested attribute for driver supporting the
+ *     BSS selection feature. When used with %NL80211_CMD_GET_WIPHY it contains
+ *     attributes according &enum nl80211_bss_select_attr to indicate what
+ *     BSS selection behaviours are supported. When used with %NL80211_CMD_CONNECT
+ *     it contains the behaviour-specific attribute containing the parameters for
+ *     BSS selection to be done by driver and/or firmware.
+ *
+ * @NL80211_ATTR_STA_SUPPORT_P2P_PS: whether P2P PS mechanism supported
+ *     or not. u8, one of the values of &enum nl80211_sta_p2p_ps_status
  *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -2164,6 +2191,12 @@ enum nl80211_attrs {
        NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
        NL80211_ATTR_SCHED_SCAN_PLANS,
 
+       NL80211_ATTR_PBSS,
+
+       NL80211_ATTR_BSS_SELECT,
+
+       NL80211_ATTR_STA_SUPPORT_P2P_PS,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,
@@ -2307,6 +2340,20 @@ enum nl80211_sta_flags {
        NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
 };
 
+/**
+ * enum nl80211_sta_p2p_ps_status - station support of P2P PS
+ *
+ * @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism
+ * @@NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism
+ * @NUM_NL80211_P2P_PS_STATUS: number of values
+ */
+enum nl80211_sta_p2p_ps_status {
+       NL80211_P2P_PS_UNSUPPORTED = 0,
+       NL80211_P2P_PS_SUPPORTED,
+
+       NUM_NL80211_P2P_PS_STATUS,
+};
+
 #define NL80211_STA_FLAG_MAX_OLD_API   NL80211_STA_FLAG_TDLS_PEER
 
 /**
@@ -2464,6 +2511,8 @@ enum nl80211_sta_bss_param {
  *     TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames;
  *     each one of those is again nested with &enum nl80211_tid_stats
  *     attributes carrying the actual values.
+ * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames
+ *     received from the station (u64, usec)
  * @__NL80211_STA_INFO_AFTER_LAST: internal
  * @NL80211_STA_INFO_MAX: highest possible station info attribute
  */
@@ -2500,6 +2549,7 @@ enum nl80211_sta_info {
        NL80211_STA_INFO_BEACON_RX,
        NL80211_STA_INFO_BEACON_SIGNAL_AVG,
        NL80211_STA_INFO_TID_STATS,
+       NL80211_STA_INFO_RX_DURATION,
 
        /* keep last */
        __NL80211_STA_INFO_AFTER_LAST,
@@ -3606,11 +3656,15 @@ 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 - 64.80 GHz)
+ * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
+ *     since newer kernel versions may support more bands
  */
 enum nl80211_band {
        NL80211_BAND_2GHZ,
        NL80211_BAND_5GHZ,
        NL80211_BAND_60GHZ,
+
+       NUM_NL80211_BANDS,
 };
 
 /**
@@ -4396,12 +4450,18 @@ enum nl80211_feature_flags {
 /**
  * enum nl80211_ext_feature_index - bit index of extended features.
  * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
+ * @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can
+ *     can request to use RRM (see %NL80211_ATTR_USE_RRM) with
+ *     %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
+ *     the ASSOC_REQ_USE_RRM flag in the association request even if
+ *     NL80211_FEATURE_QUIET is not advertized.
  *
  * @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,
+       NL80211_EXT_FEATURE_RRM,
 
        /* add new features before the definition below */
        NUM_NL80211_EXT_FEATURES,
@@ -4651,4 +4711,48 @@ enum nl80211_sched_scan_plan {
                __NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1
 };
 
+/**
+ * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters.
+ *
+ * @band: band of BSS that must match for RSSI value adjustment.
+ * @delta: value used to adjust the RSSI value of matching BSS.
+ */
+struct nl80211_bss_select_rssi_adjust {
+       __u8 band;
+       __s8 delta;
+} __attribute__((packed));
+
+/**
+ * enum nl80211_bss_select_attr - attributes for bss selection.
+ *
+ * @__NL80211_BSS_SELECT_ATTR_INVALID: reserved.
+ * @NL80211_BSS_SELECT_ATTR_RSSI: Flag indicating only RSSI-based BSS selection
+ *     is requested.
+ * @NL80211_BSS_SELECT_ATTR_BAND_PREF: attribute indicating BSS
+ *     selection should be done such that the specified band is preferred.
+ *     When there are multiple BSS-es in the preferred band, the driver
+ *     shall use RSSI-based BSS selection as a second step. The value of
+ *     this attribute is according to &enum nl80211_band (u32).
+ * @NL80211_BSS_SELECT_ATTR_RSSI_ADJUST: When present the RSSI level for
+ *     BSS-es in the specified band is to be adjusted before doing
+ *     RSSI-based BSS selection. The attribute value is a packed structure
+ *     value as specified by &struct nl80211_bss_select_rssi_adjust.
+ * @NL80211_BSS_SELECT_ATTR_MAX: highest bss select attribute number.
+ * @__NL80211_BSS_SELECT_ATTR_AFTER_LAST: internal use.
+ *
+ * One and only one of these attributes are found within %NL80211_ATTR_BSS_SELECT
+ * for %NL80211_CMD_CONNECT. It specifies the required BSS selection behaviour
+ * which the driver shall use.
+ */
+enum nl80211_bss_select_attr {
+       __NL80211_BSS_SELECT_ATTR_INVALID,
+       NL80211_BSS_SELECT_ATTR_RSSI,
+       NL80211_BSS_SELECT_ATTR_BAND_PREF,
+       NL80211_BSS_SELECT_ATTR_RSSI_ADJUST,
+
+       /* keep last */
+       __NL80211_BSS_SELECT_ATTR_AFTER_LAST,
+       NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1
+};
+
 #endif /* __LINUX_NL80211_H */
diff --git a/util.c b/util.c
index b02e2e8bd193fdd878bf0aa0d176050ee9115bdd..dd960e0d27e70045a04c9e9f48aa1e490ad6b376 100644 (file)
--- a/util.c
+++ b/util.c
@@ -148,7 +148,7 @@ const char *iftype_name(enum nl80211_iftype iftype)
 
 static const char *commands[NL80211_CMD_MAX + 1] = {
 /*
- * sed 's/^\tNL80211_CMD_//;t n;d;:n s%^\([^=]*\),.*%\t[NL80211_CMD_\1] = \"\L\1\",%;t;d' nl80211.h
+ * sed 's%^\tNL80211_CMD_%%;t n;d;:n s%^\([^=]*\),.*%\t[NL80211_CMD_\1] = \"\L\1\",%;t;d' nl80211.h | grep -v "reserved"
  */
        [NL80211_CMD_UNSPEC] = "unspec",
        [NL80211_CMD_GET_WIPHY] = "get_wiphy",