aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/iw
diff options
context:
space:
mode:
Diffstat (limited to 'package/network/utils/iw')
-rw-r--r--package/network/utils/iw/.svn/entries65
-rw-r--r--package/network/utils/iw/.svn/prop-base/Makefile.svn-base5
-rw-r--r--package/network/utils/iw/.svn/text-base/Makefile.svn-base56
-rw-r--r--package/network/utils/iw/Makefile56
-rw-r--r--package/network/utils/iw/patches/.svn/entries198
-rw-r--r--package/network/utils/iw/patches/.svn/text-base/001-nl80211_h_sync.patch.svn-base416
-rw-r--r--package/network/utils/iw/patches/.svn/text-base/100-rx_rate.patch.svn-base105
-rw-r--r--package/network/utils/iw/patches/.svn/text-base/110-per_chain_signal_strength.patch.svn-base71
-rw-r--r--package/network/utils/iw/patches/.svn/text-base/120-tdls_peer_indentation.patch.svn-base11
-rw-r--r--package/network/utils/iw/patches/.svn/text-base/130-antenna_gain.patch.svn-base34
-rw-r--r--package/network/utils/iw/patches/001-nl80211_h_sync.patch416
-rw-r--r--package/network/utils/iw/patches/100-rx_rate.patch105
-rw-r--r--package/network/utils/iw/patches/110-per_chain_signal_strength.patch71
-rw-r--r--package/network/utils/iw/patches/120-tdls_peer_indentation.patch11
-rw-r--r--package/network/utils/iw/patches/130-antenna_gain.patch34
15 files changed, 1654 insertions, 0 deletions
diff --git a/package/network/utils/iw/.svn/entries b/package/network/utils/iw/.svn/entries
new file mode 100644
index 0000000..63068ce
--- /dev/null
+++ b/package/network/utils/iw/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/utils/iw
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-01-02T11:28:11.029037Z
+34968
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:17.000000Z
+b5628907806a98d6f7b4ef17370f0fbe
+2013-01-02T11:28:11.029037Z
+34968
+blogic
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1348
+
diff --git a/package/network/utils/iw/.svn/prop-base/Makefile.svn-base b/package/network/utils/iw/.svn/prop-base/Makefile.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/package/network/utils/iw/.svn/prop-base/Makefile.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/package/network/utils/iw/.svn/text-base/Makefile.svn-base b/package/network/utils/iw/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..91167d8
--- /dev/null
+++ b/package/network/utils/iw/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2007-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=iw
+PKG_VERSION:=3.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://wireless.kernel.org/download/iw/
+PKG_MD5SUM:=1c18bfbbc8773629e5e8ac733a39540c
+
+PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/iw
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=cfg80211 interface configuration utility
+ URL:=http://wireless.kernel.org/en/users/Documentation/iw
+ DEPENDS:= +libnl-tiny @(!TARGET_avr32||BROKEN)
+endef
+
+define Build/Configure
+ echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c
+ rm -f $(PKG_BUILD_DIR)/version.sh
+ touch $(PKG_BUILD_DIR)/version.sh
+ chmod +x $(PKG_BUILD_DIR)/version.sh
+endef
+
+TARGET_CPPFLAGS:= \
+ -I$(STAGING_DIR)/usr/include/libnl-tiny \
+ $(TARGET_CPPFLAGS) \
+ -DCONFIG_LIBNL20 \
+ -D_GNU_SOURCE
+
+MAKE_FLAGS += \
+ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ NL1FOUND="" NL2FOUND=Y \
+ NLLIBNAME="libnl-tiny" \
+ LIBS="-lm -lnl-tiny" \
+ V=1
+
+define Package/iw/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,iw))
diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile
new file mode 100644
index 0000000..91167d8
--- /dev/null
+++ b/package/network/utils/iw/Makefile
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2007-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=iw
+PKG_VERSION:=3.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://wireless.kernel.org/download/iw/
+PKG_MD5SUM:=1c18bfbbc8773629e5e8ac733a39540c
+
+PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/iw
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=cfg80211 interface configuration utility
+ URL:=http://wireless.kernel.org/en/users/Documentation/iw
+ DEPENDS:= +libnl-tiny @(!TARGET_avr32||BROKEN)
+endef
+
+define Build/Configure
+ echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c
+ rm -f $(PKG_BUILD_DIR)/version.sh
+ touch $(PKG_BUILD_DIR)/version.sh
+ chmod +x $(PKG_BUILD_DIR)/version.sh
+endef
+
+TARGET_CPPFLAGS:= \
+ -I$(STAGING_DIR)/usr/include/libnl-tiny \
+ $(TARGET_CPPFLAGS) \
+ -DCONFIG_LIBNL20 \
+ -D_GNU_SOURCE
+
+MAKE_FLAGS += \
+ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ NL1FOUND="" NL2FOUND=Y \
+ NLLIBNAME="libnl-tiny" \
+ LIBS="-lm -lnl-tiny" \
+ V=1
+
+define Package/iw/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,iw))
diff --git a/package/network/utils/iw/patches/.svn/entries b/package/network/utils/iw/patches/.svn/entries
new file mode 100644
index 0000000..8875257
--- /dev/null
+++ b/package/network/utils/iw/patches/.svn/entries
@@ -0,0 +1,198 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/package/network/utils/iw/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-12-10T13:51:06.143934Z
+34593
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+100-rx_rate.patch
+file
+
+
+
+
+2013-03-17T12:13:17.000000Z
+751518b0e533dfed4b1235607e5a5060
+2012-09-28T18:29:16.238072Z
+33586
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3969
+
+110-per_chain_signal_strength.patch
+file
+
+
+
+
+2013-03-17T12:13:17.000000Z
+8c915111ed6a3df4e3926f520648b0db
+2012-09-28T18:29:16.238072Z
+33586
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2124
+
+130-antenna_gain.patch
+file
+
+
+
+
+2013-03-17T12:13:17.000000Z
+8ed2c733f59f909f09acc4ea81e1d23a
+2012-09-28T18:29:16.238072Z
+33586
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+872
+
+001-nl80211_h_sync.patch
+file
+
+
+
+
+2013-03-17T12:13:17.000000Z
+a02fcb25b178e86b9a7af9d583bf5b49
+2012-12-10T13:51:06.143934Z
+34593
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+18502
+
+120-tdls_peer_indentation.patch
+file
+
+
+
+
+2013-03-17T12:13:17.000000Z
+aaadc0d834cc12c170c94331dc0f0742
+2012-09-28T18:29:16.238072Z
+33586
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+313
+
diff --git a/package/network/utils/iw/patches/.svn/text-base/001-nl80211_h_sync.patch.svn-base b/package/network/utils/iw/patches/.svn/text-base/001-nl80211_h_sync.patch.svn-base
new file mode 100644
index 0000000..fc28a65
--- /dev/null
+++ b/package/network/utils/iw/patches/.svn/text-base/001-nl80211_h_sync.patch.svn-base
@@ -0,0 +1,416 @@
+--- a/nl80211.h
++++ b/nl80211.h
+@@ -118,8 +118,9 @@
+ * to get a list of all present wiphys.
+ * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
+ * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
+- * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,
+- * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
++ * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
++ * attributes determining the channel width; this is used for setting
++ * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT,
+ * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
+ * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
+ * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
+@@ -171,7 +172,7 @@
+ * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
+ * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
+ * The channel to use can be set on the interface or be given using the
+- * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs.
++ * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
+ * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
+ * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
+ * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
+@@ -401,8 +402,7 @@
+ * a response while being associated to an AP on another channel.
+ * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
+ * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
+- * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
+- * optionally used to specify additional channel parameters.
++ * frequency for the operation.
+ * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
+ * to remain on the channel. This command is also used as an event to
+ * notify when the requested duration starts (it may take a while for the
+@@ -440,12 +440,11 @@
+ * as an event indicating reception of a frame that was not processed in
+ * kernel code, but is for us (i.e., which may need to be processed in a
+ * user space application). %NL80211_ATTR_FRAME is used to specify the
+- * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
+- * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on
+- * which channel the frame is to be transmitted or was received. If this
+- * channel is not the current channel (remain-on-channel or the
+- * operational channel) the device will switch to the given channel and
+- * transmit the frame, optionally waiting for a response for the time
++ * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
++ * to indicate on which channel the frame is to be transmitted or was
++ * received. If this channel is not the current channel (remain-on-channel
++ * or the operational channel) the device will switch to the given channel
++ * and transmit the frame, optionally waiting for a response for the time
+ * specified using %NL80211_ATTR_DURATION. When called, this operation
+ * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
+ * TX status event pertaining to the TX request.
+@@ -473,8 +472,8 @@
+ * command is used as an event to indicate the that a trigger level was
+ * reached.
+ * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
+- * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed
+- * by %NL80211_ATTR_IFINDEX) shall operate on.
++ * and the attributes determining channel width) the given interface
++ * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
+ * In case multiple channels are supported by the device, the mechanism
+ * with which it switches channels is implementation-defined.
+ * When a monitor interface is given, it can only switch channel while
+@@ -526,6 +525,12 @@
+ * of PMKSA caching dandidates.
+ *
+ * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
++ * In addition, this can be used as an event to request userspace to take
++ * actions on TDLS links (set up a new link or tear down an existing one).
++ * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
++ * operation, %NL80211_ATTR_MAC contains the peer MAC address, and
++ * %NL80211_ATTR_REASON_CODE the reason code to be used (only with
++ * %NL80211_TDLS_TEARDOWN).
+ * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
+ *
+ * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
+@@ -562,8 +567,24 @@
+ *
+ * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
+ * independently of the userspace SME, send this event indicating
+- * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with
+- * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.
++ * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
++ * attributes determining channel width.
++ *
++ * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
++ * its %NL80211_ATTR_WDEV identifier. It must have been created with
++ * %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
++ * P2P Device can be used for P2P operations, e.g. remain-on-channel and
++ * public action frame TX.
++ * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
++ * its %NL80211_ATTR_WDEV identifier.
++ *
++ * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
++ * notify userspace that AP has rejected the connection request from a
++ * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
++ * is used for this.
++ *
++ * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
++ * for IBSS or MESH vif.
+ *
+ * @NL80211_CMD_MAX: highest used command number
+ * @__NL80211_CMD_AFTER_LAST: internal use
+@@ -708,6 +729,13 @@ enum nl80211_commands {
+
+ NL80211_CMD_CH_SWITCH_NOTIFY,
+
++ NL80211_CMD_START_P2P_DEVICE,
++ NL80211_CMD_STOP_P2P_DEVICE,
++
++ NL80211_CMD_CONN_FAILED,
++
++ NL80211_CMD_SET_MCAST_RATE,
++
+ /* add new commands above here */
+
+ /* used to define NL80211_CMD_MAX below */
+@@ -744,14 +772,26 @@ enum nl80211_commands {
+ * /sys/class/ieee80211/<phyname>/index
+ * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
+ * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
+- * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz
++ * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
++ * defines the channel together with the (deprecated)
++ * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
++ * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
++ * and %NL80211_ATTR_CENTER_FREQ2
++ * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
++ * of &enum nl80211_chan_width, describing the channel width. See the
++ * documentation of the enum for more information.
++ * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
++ * channel, used for anything but 20 MHz bandwidth
++ * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
++ * channel, used only for 80+80 MHz bandwidth
+ * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
+- * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included):
++ * if HT20 or HT40 are to be used (i.e., HT disabled if not included):
+ * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
+ * this attribute)
+ * NL80211_CHAN_HT20 = HT20 only
+ * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
+ * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
++ * This attribute is now deprecated.
+ * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
+ * less than or equal to the RTS threshold; allowed range: 1..255;
+ * dot11ShortRetryLimit; u8
+@@ -1251,6 +1291,25 @@ enum nl80211_commands {
+ * was used to provide the hint. For the different types of
+ * allowed user regulatory hints see nl80211_user_reg_hint_type.
+ *
++ * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
++ * the connection request from a station. nl80211_connect_failed_reason
++ * enum has different reasons of connection failure.
++ *
++ * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
++ * with the Authentication transaction sequence number field.
++ *
++ * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
++ * association request when used with NL80211_CMD_NEW_STATION)
++ *
++ * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
++ *
++ * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
++ * the START_AP and SET_BSS commands
++ * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
++ * START_AP and SET_BSS commands. This can have the values 0 or 1;
++ * if not given in START_AP 0 is assumed, if not given in SET_BSS
++ * no change is made.
++ *
+ * @NL80211_ATTR_MAX: highest attribute number currently defined
+ * @__NL80211_ATTR_AFTER_LAST: internal use
+ */
+@@ -1506,6 +1565,23 @@ enum nl80211_attrs {
+
+ NL80211_ATTR_USER_REG_HINT_TYPE,
+
++ NL80211_ATTR_CONN_FAILED_REASON,
++
++ NL80211_ATTR_SAE_DATA,
++
++ NL80211_ATTR_VHT_CAPABILITY,
++
++ NL80211_ATTR_SCAN_FLAGS,
++
++ NL80211_ATTR_CHANNEL_WIDTH,
++ NL80211_ATTR_CENTER_FREQ1,
++ NL80211_ATTR_CENTER_FREQ2,
++
++ NL80211_ATTR_P2P_CTWINDOW,
++ NL80211_ATTR_P2P_OPPPS,
++
++ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
++
+ /* add attributes here, update the policy in nl80211.c */
+
+ __NL80211_ATTR_AFTER_LAST,
+@@ -1549,6 +1625,7 @@ enum nl80211_attrs {
+ #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_MAX_NR_CIPHER_SUITES 5
+ #define NL80211_MAX_NR_AKM_SUITES 2
+@@ -1575,6 +1652,10 @@ enum nl80211_attrs {
+ * @NL80211_IFTYPE_MESH_POINT: mesh point
+ * @NL80211_IFTYPE_P2P_CLIENT: P2P client
+ * @NL80211_IFTYPE_P2P_GO: P2P group owner
++ * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev
++ * and therefore can't be created in the normal ways, use the
++ * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
++ * commands to create and destroy one
+ * @NL80211_IFTYPE_MAX: highest interface type number currently defined
+ * @NUM_NL80211_IFTYPES: number of defined interface types
+ *
+@@ -1593,6 +1674,7 @@ enum nl80211_iftype {
+ NL80211_IFTYPE_MESH_POINT,
+ NL80211_IFTYPE_P2P_CLIENT,
+ NL80211_IFTYPE_P2P_GO,
++ NL80211_IFTYPE_P2P_DEVICE,
+
+ /* keep last */
+ NUM_NL80211_IFTYPES,
+@@ -1664,10 +1746,15 @@ struct nl80211_sta_flag_update {
+ * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
+ * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
+- * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate
++ * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
+ * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
+ * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
+ * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
++ * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
++ * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
++ * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
++ * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
++ * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
+ * @__NL80211_RATE_INFO_AFTER_LAST: internal use
+ */
+ enum nl80211_rate_info {
+@@ -1677,6 +1764,11 @@ enum nl80211_rate_info {
+ NL80211_RATE_INFO_40_MHZ_WIDTH,
+ NL80211_RATE_INFO_SHORT_GI,
+ NL80211_RATE_INFO_BITRATE32,
++ NL80211_RATE_INFO_VHT_MCS,
++ NL80211_RATE_INFO_VHT_NSS,
++ NL80211_RATE_INFO_80_MHZ_WIDTH,
++ NL80211_RATE_INFO_80P80_MHZ_WIDTH,
++ NL80211_RATE_INFO_160_MHZ_WIDTH,
+
+ /* keep last */
+ __NL80211_RATE_INFO_AFTER_LAST,
+@@ -1744,6 +1836,8 @@ enum nl80211_sta_bss_param {
+ * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
+ * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
+ * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
++ * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU
++ * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
+ * @__NL80211_STA_INFO_AFTER_LAST: internal
+ * @NL80211_STA_INFO_MAX: highest possible station info attribute
+ */
+@@ -1768,6 +1862,8 @@ enum nl80211_sta_info {
+ NL80211_STA_INFO_STA_FLAGS,
+ NL80211_STA_INFO_BEACON_LOSS,
+ NL80211_STA_INFO_T_OFFSET,
++ NL80211_STA_INFO_CHAIN_SIGNAL,
++ NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
+
+ /* keep last */
+ __NL80211_STA_INFO_AFTER_LAST,
+@@ -2385,6 +2481,15 @@ enum nl80211_ac {
+ #define NL80211_TXQ_Q_BE NL80211_AC_BE
+ #define NL80211_TXQ_Q_BK NL80211_AC_BK
+
++/**
++ * enum nl80211_channel_type - channel type
++ * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
++ * @NL80211_CHAN_HT20: 20 MHz HT channel
++ * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
++ * below the control channel
++ * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
++ * above the control channel
++ */
+ enum nl80211_channel_type {
+ NL80211_CHAN_NO_HT,
+ NL80211_CHAN_HT20,
+@@ -2393,6 +2498,32 @@ enum nl80211_channel_type {
+ };
+
+ /**
++ * enum nl80211_chan_width - channel width definitions
++ *
++ * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
++ * attribute.
++ *
++ * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
++ * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
++ * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * attribute must be provided as well
++ * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * attribute must be provided as well
++ * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
++ * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * attribute must be provided as well
++ */
++enum nl80211_chan_width {
++ NL80211_CHAN_WIDTH_20_NOHT,
++ NL80211_CHAN_WIDTH_20,
++ NL80211_CHAN_WIDTH_40,
++ NL80211_CHAN_WIDTH_80,
++ NL80211_CHAN_WIDTH_80P80,
++ NL80211_CHAN_WIDTH_160,
++};
++
++/**
+ * enum nl80211_bss - netlink attributes for a BSS
+ *
+ * @__NL80211_BSS_INVALID: invalid
+@@ -2460,6 +2591,7 @@ enum nl80211_bss_status {
+ * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
+ * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
+ * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
++ * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
+ * @__NL80211_AUTHTYPE_NUM: internal
+ * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
+ * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
+@@ -2471,6 +2603,7 @@ enum nl80211_auth_type {
+ NL80211_AUTHTYPE_SHARED_KEY,
+ NL80211_AUTHTYPE_FT,
+ NL80211_AUTHTYPE_NETWORK_EAP,
++ NL80211_AUTHTYPE_SAE,
+
+ /* keep last */
+ __NL80211_AUTHTYPE_NUM,
+@@ -2994,12 +3127,40 @@ enum nl80211_ap_sme_features {
+ * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
+ * to work properly to suppport receiving regulatory hints from
+ * cellular base stations.
++ * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active
++ * P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel
++ * in the interface combinations, even when it's only used for scan
++ * and remain-on-channel. This could be due to, for example, the
++ * remain-on-channel implementation requiring a channel context.
++ * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
++ * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
++ * mode
++ * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
++ * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
++ * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
++ * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
++ * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
++ * OBSS scans and generate 20/40 BSS coex reports. This flag is used only
++ * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
++ * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
++ * setting
++ * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
++ * powersave
+ */
+ enum nl80211_feature_flags {
+- NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
+- NL80211_FEATURE_HT_IBSS = 1 << 1,
+- NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
+- NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
++ NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
++ NL80211_FEATURE_HT_IBSS = 1 << 1,
++ NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
++ NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
++ NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
++ NL80211_FEATURE_SAE = 1 << 5,
++ NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
++ NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
++ NL80211_FEATURE_AP_SCAN = 1 << 8,
++ NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
++ NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
++ NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
++ NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
+ };
+
+ /**
+@@ -3023,4 +3184,36 @@ enum nl80211_probe_resp_offload_support_
+ NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3,
+ };
+
++/**
++ * enum nl80211_connect_failed_reason - connection request failed reasons
++ * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
++ * handled by the AP is reached.
++ * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist.
++ */
++enum nl80211_connect_failed_reason {
++ NL80211_CONN_FAIL_MAX_CLIENTS,
++ NL80211_CONN_FAIL_BLOCKED_CLIENT,
++};
++
++/**
++ * enum nl80211_scan_flags - scan request control flags
++ *
++ * Scan request control flags are used to control the handling
++ * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
++ * requests.
++ *
++ * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
++ * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
++ * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
++ * as AP and the beaconing has already been configured. This attribute is
++ * 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
++ */
++enum nl80211_scan_flags {
++ NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
++ NL80211_SCAN_FLAG_FLUSH = 1<<1,
++ NL80211_SCAN_FLAG_AP = 1<<2,
++};
++
+ #endif /* __LINUX_NL80211_H */
diff --git a/package/network/utils/iw/patches/.svn/text-base/100-rx_rate.patch.svn-base b/package/network/utils/iw/patches/.svn/text-base/100-rx_rate.patch.svn-base
new file mode 100644
index 0000000..642b9f3
--- /dev/null
+++ b/package/network/utils/iw/patches/.svn/text-base/100-rx_rate.patch.svn-base
@@ -0,0 +1,105 @@
+--- a/station.c
++++ b/station.c
+@@ -29,13 +29,47 @@ enum plink_actions {
+ PLINK_ACTION_BLOCK,
+ };
+
++static void print_sta_bitrate(struct nlattr *nla, const char *name)
++{
++ struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1];
++
++ static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
++ [NL80211_RATE_INFO_BITRATE] = { .type = NLA_U16 },
++ [NL80211_RATE_INFO_BITRATE32] = { .type = NLA_U32 },
++ [NL80211_RATE_INFO_MCS] = { .type = NLA_U8 },
++ [NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG },
++ [NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG },
++ };
++
++ if (!nla)
++ return;
++
++ if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX, nla, rate_policy)) {
++ fprintf(stderr, "failed to parse nested rate attributes!\n");
++ } else {
++ int rate = 0;
++ printf("\n\t%s:\t", name);
++ if (rinfo[NL80211_RATE_INFO_BITRATE32])
++ rate = nla_get_u32(rinfo[NL80211_RATE_INFO_BITRATE32]);
++ else if (rinfo[NL80211_RATE_INFO_BITRATE])
++ rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]);
++ if (rate > 0)
++ printf("%d.%d MBit/s", rate / 10, rate % 10);
++
++ if (rinfo[NL80211_RATE_INFO_MCS])
++ printf(" MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_MCS]));
++ if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH])
++ printf(" 40Mhz");
++ if (rinfo[NL80211_RATE_INFO_SHORT_GI])
++ printf(" short GI");
++ }
++}
+
+ static int print_sta_handler(struct nl_msg *msg, void *arg)
+ {
+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+ struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1];
+- struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1];
+ char mac_addr[20], state_name[10], dev[20];
+ struct nl80211_sta_flag_update *sta_flags;
+ static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = {
+@@ -47,6 +81,7 @@ static int print_sta_handler(struct nl_m
+ [NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
+ [NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 },
+ [NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
++ [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED },
+ [NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
+ [NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
+ [NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 },
+@@ -56,14 +91,6 @@ static int print_sta_handler(struct nl_m
+ { .minlen = sizeof(struct nl80211_sta_flag_update) },
+ };
+
+- static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
+- [NL80211_RATE_INFO_BITRATE] = { .type = NLA_U16 },
+- [NL80211_RATE_INFO_BITRATE32] = { .type = NLA_U32 },
+- [NL80211_RATE_INFO_MCS] = { .type = NLA_U8 },
+- [NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG },
+- [NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG },
+- };
+-
+ nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL);
+
+@@ -119,28 +146,8 @@ static int print_sta_handler(struct nl_m
+ printf("\n\tToffset:\t%lld us",
+ (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));
+
+- if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
+- if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX,
+- sinfo[NL80211_STA_INFO_TX_BITRATE], rate_policy)) {
+- fprintf(stderr, "failed to parse nested rate attributes!\n");
+- } else {
+- int rate = 0;
+- printf("\n\ttx bitrate:\t");
+- if (rinfo[NL80211_RATE_INFO_BITRATE32])
+- rate = nla_get_u32(rinfo[NL80211_RATE_INFO_BITRATE32]);
+- else if (rinfo[NL80211_RATE_INFO_BITRATE])
+- rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]);
+- if (rate > 0)
+- printf("%d.%d MBit/s", rate / 10, rate % 10);
+-
+- if (rinfo[NL80211_RATE_INFO_MCS])
+- printf(" MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_MCS]));
+- if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH])
+- printf(" 40Mhz");
+- if (rinfo[NL80211_RATE_INFO_SHORT_GI])
+- printf(" short GI");
+- }
+- }
++ print_sta_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], "tx bitrate");
++ print_sta_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE], "rx bitrate");
+
+ if (sinfo[NL80211_STA_INFO_LLID])
+ printf("\n\tmesh llid:\t%d",
diff --git a/package/network/utils/iw/patches/.svn/text-base/110-per_chain_signal_strength.patch.svn-base b/package/network/utils/iw/patches/.svn/text-base/110-per_chain_signal_strength.patch.svn-base
new file mode 100644
index 0000000..813a7d9
--- /dev/null
+++ b/package/network/utils/iw/patches/.svn/text-base/110-per_chain_signal_strength.patch.svn-base
@@ -0,0 +1,71 @@
+--- a/station.c
++++ b/station.c
+@@ -65,6 +65,33 @@ static void print_sta_bitrate(struct nla
+ }
+ }
+
++static char *get_chain_signal(struct nlattr *attr_list)
++{
++ struct nlattr *attr;
++ static char buf[64];
++ char *cur = buf;
++ int i = 0, rem;
++ const char *prefix;
++
++ if (!attr_list)
++ return "";
++
++ nla_for_each_nested(attr, attr_list, rem) {
++ if (i++ > 0)
++ prefix = ", ";
++ else
++ prefix = "[";
++
++ cur += snprintf(cur, sizeof(buf) - (cur - buf), "%s%d", prefix,
++ (int8_t) nla_get_u8(attr));
++ }
++
++ if (i)
++ snprintf(cur, sizeof(buf) - (cur - buf), "] ");
++
++ return buf;
++}
++
+ static int print_sta_handler(struct nl_msg *msg, void *arg)
+ {
+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
+@@ -89,7 +116,10 @@ static int print_sta_handler(struct nl_m
+ [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 },
+ [NL80211_STA_INFO_STA_FLAGS] =
+ { .minlen = sizeof(struct nl80211_sta_flag_update) },
++ [NL80211_STA_INFO_CHAIN_SIGNAL] = { .type = NLA_NESTED },
++ [NL80211_STA_INFO_CHAIN_SIGNAL_AVG] = { .type = NLA_NESTED },
+ };
++ char *chain;
+
+ nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL);
+@@ -136,12 +166,19 @@ static int print_sta_handler(struct nl_m
+ if (sinfo[NL80211_STA_INFO_TX_FAILED])
+ printf("\n\ttx failed:\t%u",
+ nla_get_u32(sinfo[NL80211_STA_INFO_TX_FAILED]));
++
++ chain = get_chain_signal(sinfo[NL80211_STA_INFO_CHAIN_SIGNAL]);
+ if (sinfo[NL80211_STA_INFO_SIGNAL])
+- printf("\n\tsignal: \t%d dBm",
+- (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]));
++ printf("\n\tsignal: \t%d %sdBm",
++ (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]),
++ chain);
++
++ chain = get_chain_signal(sinfo[NL80211_STA_INFO_CHAIN_SIGNAL_AVG]);
+ if (sinfo[NL80211_STA_INFO_SIGNAL_AVG])
+- printf("\n\tsignal avg:\t%d dBm",
+- (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]));
++ printf("\n\tsignal avg:\t%d %sdBm",
++ (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]),
++ chain);
++
+ if (sinfo[NL80211_STA_INFO_T_OFFSET])
+ printf("\n\tToffset:\t%lld us",
+ (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));
diff --git a/package/network/utils/iw/patches/.svn/text-base/120-tdls_peer_indentation.patch.svn-base b/package/network/utils/iw/patches/.svn/text-base/120-tdls_peer_indentation.patch.svn-base
new file mode 100644
index 0000000..6836873
--- /dev/null
+++ b/package/network/utils/iw/patches/.svn/text-base/120-tdls_peer_indentation.patch.svn-base
@@ -0,0 +1,11 @@
+--- a/station.c
++++ b/station.c
+@@ -267,7 +267,7 @@ static int print_sta_handler(struct nl_m
+ }
+
+ if (sta_flags->mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
+- printf("\n\tTDLS peer:\t\t");
++ printf("\n\tTDLS peer:\t");
+ if (sta_flags->set & BIT(NL80211_STA_FLAG_TDLS_PEER))
+ printf("yes");
+ else
diff --git a/package/network/utils/iw/patches/.svn/text-base/130-antenna_gain.patch.svn-base b/package/network/utils/iw/patches/.svn/text-base/130-antenna_gain.patch.svn-base
new file mode 100644
index 0000000..f3ca691
--- /dev/null
+++ b/package/network/utils/iw/patches/.svn/text-base/130-antenna_gain.patch.svn-base
@@ -0,0 +1,34 @@
+--- a/phy.c
++++ b/phy.c
+@@ -359,3 +359,31 @@ COMMAND(set, antenna, "<bitmap> | all |
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna,
+ "Set a bitmap of allowed antennas to use for TX and RX.\n"
+ "The driver may reject antenna configurations it cannot support.");
++
++static int handle_antenna_gain(struct nl80211_state *state,
++ struct nl_cb *cb,
++ struct nl_msg *msg,
++ int argc, char **argv,
++ enum id_input id)
++{
++ char *endptr;
++ int dbm;
++
++ /* get the required args */
++ if (argc != 1)
++ return 1;
++
++ dbm = strtol(argv[0], &endptr, 10);
++ if (*endptr)
++ return 2;
++
++ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_GAIN, dbm);
++
++ return 0;
++
++ nla_put_failure:
++ return -ENOBUFS;
++}
++COMMAND(set, antenna_gain, "<antenna gain in dBm>",
++ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna_gain,
++ "Specify antenna gain.");
diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch
new file mode 100644
index 0000000..fc28a65
--- /dev/null
+++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch
@@ -0,0 +1,416 @@
+--- a/nl80211.h
++++ b/nl80211.h
+@@ -118,8 +118,9 @@
+ * to get a list of all present wiphys.
+ * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
+ * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
+- * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,
+- * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
++ * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
++ * attributes determining the channel width; this is used for setting
++ * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT,
+ * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
+ * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
+ * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
+@@ -171,7 +172,7 @@
+ * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
+ * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
+ * The channel to use can be set on the interface or be given using the
+- * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs.
++ * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
+ * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
+ * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
+ * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
+@@ -401,8 +402,7 @@
+ * a response while being associated to an AP on another channel.
+ * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
+ * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
+- * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
+- * optionally used to specify additional channel parameters.
++ * frequency for the operation.
+ * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
+ * to remain on the channel. This command is also used as an event to
+ * notify when the requested duration starts (it may take a while for the
+@@ -440,12 +440,11 @@
+ * as an event indicating reception of a frame that was not processed in
+ * kernel code, but is for us (i.e., which may need to be processed in a
+ * user space application). %NL80211_ATTR_FRAME is used to specify the
+- * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
+- * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on
+- * which channel the frame is to be transmitted or was received. If this
+- * channel is not the current channel (remain-on-channel or the
+- * operational channel) the device will switch to the given channel and
+- * transmit the frame, optionally waiting for a response for the time
++ * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
++ * to indicate on which channel the frame is to be transmitted or was
++ * received. If this channel is not the current channel (remain-on-channel
++ * or the operational channel) the device will switch to the given channel
++ * and transmit the frame, optionally waiting for a response for the time
+ * specified using %NL80211_ATTR_DURATION. When called, this operation
+ * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
+ * TX status event pertaining to the TX request.
+@@ -473,8 +472,8 @@
+ * command is used as an event to indicate the that a trigger level was
+ * reached.
+ * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
+- * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed
+- * by %NL80211_ATTR_IFINDEX) shall operate on.
++ * and the attributes determining channel width) the given interface
++ * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
+ * In case multiple channels are supported by the device, the mechanism
+ * with which it switches channels is implementation-defined.
+ * When a monitor interface is given, it can only switch channel while
+@@ -526,6 +525,12 @@
+ * of PMKSA caching dandidates.
+ *
+ * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
++ * In addition, this can be used as an event to request userspace to take
++ * actions on TDLS links (set up a new link or tear down an existing one).
++ * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
++ * operation, %NL80211_ATTR_MAC contains the peer MAC address, and
++ * %NL80211_ATTR_REASON_CODE the reason code to be used (only with
++ * %NL80211_TDLS_TEARDOWN).
+ * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
+ *
+ * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
+@@ -562,8 +567,24 @@
+ *
+ * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
+ * independently of the userspace SME, send this event indicating
+- * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with
+- * %NL80211_ATTR_WIPHY_CHANNEL_TYPE.
++ * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
++ * attributes determining channel width.
++ *
++ * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
++ * its %NL80211_ATTR_WDEV identifier. It must have been created with
++ * %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
++ * P2P Device can be used for P2P operations, e.g. remain-on-channel and
++ * public action frame TX.
++ * @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
++ * its %NL80211_ATTR_WDEV identifier.
++ *
++ * @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
++ * notify userspace that AP has rejected the connection request from a
++ * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
++ * is used for this.
++ *
++ * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
++ * for IBSS or MESH vif.
+ *
+ * @NL80211_CMD_MAX: highest used command number
+ * @__NL80211_CMD_AFTER_LAST: internal use
+@@ -708,6 +729,13 @@ enum nl80211_commands {
+
+ NL80211_CMD_CH_SWITCH_NOTIFY,
+
++ NL80211_CMD_START_P2P_DEVICE,
++ NL80211_CMD_STOP_P2P_DEVICE,
++
++ NL80211_CMD_CONN_FAILED,
++
++ NL80211_CMD_SET_MCAST_RATE,
++
+ /* add new commands above here */
+
+ /* used to define NL80211_CMD_MAX below */
+@@ -744,14 +772,26 @@ enum nl80211_commands {
+ * /sys/class/ieee80211/<phyname>/index
+ * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
+ * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
+- * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz
++ * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
++ * defines the channel together with the (deprecated)
++ * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
++ * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
++ * and %NL80211_ATTR_CENTER_FREQ2
++ * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
++ * of &enum nl80211_chan_width, describing the channel width. See the
++ * documentation of the enum for more information.
++ * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
++ * channel, used for anything but 20 MHz bandwidth
++ * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
++ * channel, used only for 80+80 MHz bandwidth
+ * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
+- * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included):
++ * if HT20 or HT40 are to be used (i.e., HT disabled if not included):
+ * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
+ * this attribute)
+ * NL80211_CHAN_HT20 = HT20 only
+ * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
+ * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
++ * This attribute is now deprecated.
+ * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
+ * less than or equal to the RTS threshold; allowed range: 1..255;
+ * dot11ShortRetryLimit; u8
+@@ -1251,6 +1291,25 @@ enum nl80211_commands {
+ * was used to provide the hint. For the different types of
+ * allowed user regulatory hints see nl80211_user_reg_hint_type.
+ *
++ * @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
++ * the connection request from a station. nl80211_connect_failed_reason
++ * enum has different reasons of connection failure.
++ *
++ * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
++ * with the Authentication transaction sequence number field.
++ *
++ * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
++ * association request when used with NL80211_CMD_NEW_STATION)
++ *
++ * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
++ *
++ * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
++ * the START_AP and SET_BSS commands
++ * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
++ * START_AP and SET_BSS commands. This can have the values 0 or 1;
++ * if not given in START_AP 0 is assumed, if not given in SET_BSS
++ * no change is made.
++ *
+ * @NL80211_ATTR_MAX: highest attribute number currently defined
+ * @__NL80211_ATTR_AFTER_LAST: internal use
+ */
+@@ -1506,6 +1565,23 @@ enum nl80211_attrs {
+
+ NL80211_ATTR_USER_REG_HINT_TYPE,
+
++ NL80211_ATTR_CONN_FAILED_REASON,
++
++ NL80211_ATTR_SAE_DATA,
++
++ NL80211_ATTR_VHT_CAPABILITY,
++
++ NL80211_ATTR_SCAN_FLAGS,
++
++ NL80211_ATTR_CHANNEL_WIDTH,
++ NL80211_ATTR_CENTER_FREQ1,
++ NL80211_ATTR_CENTER_FREQ2,
++
++ NL80211_ATTR_P2P_CTWINDOW,
++ NL80211_ATTR_P2P_OPPPS,
++
++ NL80211_ATTR_WIPHY_ANTENNA_GAIN,
++
+ /* add attributes here, update the policy in nl80211.c */
+
+ __NL80211_ATTR_AFTER_LAST,
+@@ -1549,6 +1625,7 @@ enum nl80211_attrs {
+ #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_MAX_NR_CIPHER_SUITES 5
+ #define NL80211_MAX_NR_AKM_SUITES 2
+@@ -1575,6 +1652,10 @@ enum nl80211_attrs {
+ * @NL80211_IFTYPE_MESH_POINT: mesh point
+ * @NL80211_IFTYPE_P2P_CLIENT: P2P client
+ * @NL80211_IFTYPE_P2P_GO: P2P group owner
++ * @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev
++ * and therefore can't be created in the normal ways, use the
++ * %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
++ * commands to create and destroy one
+ * @NL80211_IFTYPE_MAX: highest interface type number currently defined
+ * @NUM_NL80211_IFTYPES: number of defined interface types
+ *
+@@ -1593,6 +1674,7 @@ enum nl80211_iftype {
+ NL80211_IFTYPE_MESH_POINT,
+ NL80211_IFTYPE_P2P_CLIENT,
+ NL80211_IFTYPE_P2P_GO,
++ NL80211_IFTYPE_P2P_DEVICE,
+
+ /* keep last */
+ NUM_NL80211_IFTYPES,
+@@ -1664,10 +1746,15 @@ struct nl80211_sta_flag_update {
+ * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
+ * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
+- * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate
++ * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
+ * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
+ * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
+ * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
++ * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
++ * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
++ * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
++ * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
++ * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
+ * @__NL80211_RATE_INFO_AFTER_LAST: internal use
+ */
+ enum nl80211_rate_info {
+@@ -1677,6 +1764,11 @@ enum nl80211_rate_info {
+ NL80211_RATE_INFO_40_MHZ_WIDTH,
+ NL80211_RATE_INFO_SHORT_GI,
+ NL80211_RATE_INFO_BITRATE32,
++ NL80211_RATE_INFO_VHT_MCS,
++ NL80211_RATE_INFO_VHT_NSS,
++ NL80211_RATE_INFO_80_MHZ_WIDTH,
++ NL80211_RATE_INFO_80P80_MHZ_WIDTH,
++ NL80211_RATE_INFO_160_MHZ_WIDTH,
+
+ /* keep last */
+ __NL80211_RATE_INFO_AFTER_LAST,
+@@ -1744,6 +1836,8 @@ enum nl80211_sta_bss_param {
+ * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
+ * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
+ * @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
++ * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU
++ * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
+ * @__NL80211_STA_INFO_AFTER_LAST: internal
+ * @NL80211_STA_INFO_MAX: highest possible station info attribute
+ */
+@@ -1768,6 +1862,8 @@ enum nl80211_sta_info {
+ NL80211_STA_INFO_STA_FLAGS,
+ NL80211_STA_INFO_BEACON_LOSS,
+ NL80211_STA_INFO_T_OFFSET,
++ NL80211_STA_INFO_CHAIN_SIGNAL,
++ NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
+
+ /* keep last */
+ __NL80211_STA_INFO_AFTER_LAST,
+@@ -2385,6 +2481,15 @@ enum nl80211_ac {
+ #define NL80211_TXQ_Q_BE NL80211_AC_BE
+ #define NL80211_TXQ_Q_BK NL80211_AC_BK
+
++/**
++ * enum nl80211_channel_type - channel type
++ * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
++ * @NL80211_CHAN_HT20: 20 MHz HT channel
++ * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
++ * below the control channel
++ * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
++ * above the control channel
++ */
+ enum nl80211_channel_type {
+ NL80211_CHAN_NO_HT,
+ NL80211_CHAN_HT20,
+@@ -2393,6 +2498,32 @@ enum nl80211_channel_type {
+ };
+
+ /**
++ * enum nl80211_chan_width - channel width definitions
++ *
++ * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
++ * attribute.
++ *
++ * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
++ * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
++ * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * attribute must be provided as well
++ * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * attribute must be provided as well
++ * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
++ * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
++ * attribute must be provided as well
++ */
++enum nl80211_chan_width {
++ NL80211_CHAN_WIDTH_20_NOHT,
++ NL80211_CHAN_WIDTH_20,
++ NL80211_CHAN_WIDTH_40,
++ NL80211_CHAN_WIDTH_80,
++ NL80211_CHAN_WIDTH_80P80,
++ NL80211_CHAN_WIDTH_160,
++};
++
++/**
+ * enum nl80211_bss - netlink attributes for a BSS
+ *
+ * @__NL80211_BSS_INVALID: invalid
+@@ -2460,6 +2591,7 @@ enum nl80211_bss_status {
+ * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
+ * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
+ * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
++ * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
+ * @__NL80211_AUTHTYPE_NUM: internal
+ * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
+ * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
+@@ -2471,6 +2603,7 @@ enum nl80211_auth_type {
+ NL80211_AUTHTYPE_SHARED_KEY,
+ NL80211_AUTHTYPE_FT,
+ NL80211_AUTHTYPE_NETWORK_EAP,
++ NL80211_AUTHTYPE_SAE,
+
+ /* keep last */
+ __NL80211_AUTHTYPE_NUM,
+@@ -2994,12 +3127,40 @@ enum nl80211_ap_sme_features {
+ * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
+ * to work properly to suppport receiving regulatory hints from
+ * cellular base stations.
++ * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active
++ * P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel
++ * in the interface combinations, even when it's only used for scan
++ * and remain-on-channel. This could be due to, for example, the
++ * remain-on-channel implementation requiring a channel context.
++ * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
++ * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
++ * mode
++ * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
++ * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
++ * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
++ * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
++ * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
++ * OBSS scans and generate 20/40 BSS coex reports. This flag is used only
++ * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
++ * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
++ * setting
++ * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
++ * powersave
+ */
+ enum nl80211_feature_flags {
+- NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
+- NL80211_FEATURE_HT_IBSS = 1 << 1,
+- NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
+- NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
++ NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
++ NL80211_FEATURE_HT_IBSS = 1 << 1,
++ NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
++ NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
++ NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
++ NL80211_FEATURE_SAE = 1 << 5,
++ NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
++ NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
++ NL80211_FEATURE_AP_SCAN = 1 << 8,
++ NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
++ NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
++ NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
++ NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
+ };
+
+ /**
+@@ -3023,4 +3184,36 @@ enum nl80211_probe_resp_offload_support_
+ NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3,
+ };
+
++/**
++ * enum nl80211_connect_failed_reason - connection request failed reasons
++ * @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
++ * handled by the AP is reached.
++ * @NL80211_CONN_FAIL_BLOCKED_CLIENT: Client's MAC is in the AP's blocklist.
++ */
++enum nl80211_connect_failed_reason {
++ NL80211_CONN_FAIL_MAX_CLIENTS,
++ NL80211_CONN_FAIL_BLOCKED_CLIENT,
++};
++
++/**
++ * enum nl80211_scan_flags - scan request control flags
++ *
++ * Scan request control flags are used to control the handling
++ * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
++ * requests.
++ *
++ * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
++ * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
++ * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
++ * as AP and the beaconing has already been configured. This attribute is
++ * 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
++ */
++enum nl80211_scan_flags {
++ NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
++ NL80211_SCAN_FLAG_FLUSH = 1<<1,
++ NL80211_SCAN_FLAG_AP = 1<<2,
++};
++
+ #endif /* __LINUX_NL80211_H */
diff --git a/package/network/utils/iw/patches/100-rx_rate.patch b/package/network/utils/iw/patches/100-rx_rate.patch
new file mode 100644
index 0000000..642b9f3
--- /dev/null
+++ b/package/network/utils/iw/patches/100-rx_rate.patch
@@ -0,0 +1,105 @@
+--- a/station.c
++++ b/station.c
+@@ -29,13 +29,47 @@ enum plink_actions {
+ PLINK_ACTION_BLOCK,
+ };
+
++static void print_sta_bitrate(struct nlattr *nla, const char *name)
++{
++ struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1];
++
++ static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
++ [NL80211_RATE_INFO_BITRATE] = { .type = NLA_U16 },
++ [NL80211_RATE_INFO_BITRATE32] = { .type = NLA_U32 },
++ [NL80211_RATE_INFO_MCS] = { .type = NLA_U8 },
++ [NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG },
++ [NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG },
++ };
++
++ if (!nla)
++ return;
++
++ if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX, nla, rate_policy)) {
++ fprintf(stderr, "failed to parse nested rate attributes!\n");
++ } else {
++ int rate = 0;
++ printf("\n\t%s:\t", name);
++ if (rinfo[NL80211_RATE_INFO_BITRATE32])
++ rate = nla_get_u32(rinfo[NL80211_RATE_INFO_BITRATE32]);
++ else if (rinfo[NL80211_RATE_INFO_BITRATE])
++ rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]);
++ if (rate > 0)
++ printf("%d.%d MBit/s", rate / 10, rate % 10);
++
++ if (rinfo[NL80211_RATE_INFO_MCS])
++ printf(" MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_MCS]));
++ if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH])
++ printf(" 40Mhz");
++ if (rinfo[NL80211_RATE_INFO_SHORT_GI])
++ printf(" short GI");
++ }
++}
+
+ static int print_sta_handler(struct nl_msg *msg, void *arg)
+ {
+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
+ struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
+ struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1];
+- struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1];
+ char mac_addr[20], state_name[10], dev[20];
+ struct nl80211_sta_flag_update *sta_flags;
+ static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = {
+@@ -47,6 +81,7 @@ static int print_sta_handler(struct nl_m
+ [NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
+ [NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 },
+ [NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
++ [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED },
+ [NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
+ [NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
+ [NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 },
+@@ -56,14 +91,6 @@ static int print_sta_handler(struct nl_m
+ { .minlen = sizeof(struct nl80211_sta_flag_update) },
+ };
+
+- static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
+- [NL80211_RATE_INFO_BITRATE] = { .type = NLA_U16 },
+- [NL80211_RATE_INFO_BITRATE32] = { .type = NLA_U32 },
+- [NL80211_RATE_INFO_MCS] = { .type = NLA_U8 },
+- [NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG },
+- [NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG },
+- };
+-
+ nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL);
+
+@@ -119,28 +146,8 @@ static int print_sta_handler(struct nl_m
+ printf("\n\tToffset:\t%lld us",
+ (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));
+
+- if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
+- if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX,
+- sinfo[NL80211_STA_INFO_TX_BITRATE], rate_policy)) {
+- fprintf(stderr, "failed to parse nested rate attributes!\n");
+- } else {
+- int rate = 0;
+- printf("\n\ttx bitrate:\t");
+- if (rinfo[NL80211_RATE_INFO_BITRATE32])
+- rate = nla_get_u32(rinfo[NL80211_RATE_INFO_BITRATE32]);
+- else if (rinfo[NL80211_RATE_INFO_BITRATE])
+- rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]);
+- if (rate > 0)
+- printf("%d.%d MBit/s", rate / 10, rate % 10);
+-
+- if (rinfo[NL80211_RATE_INFO_MCS])
+- printf(" MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_MCS]));
+- if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH])
+- printf(" 40Mhz");
+- if (rinfo[NL80211_RATE_INFO_SHORT_GI])
+- printf(" short GI");
+- }
+- }
++ print_sta_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], "tx bitrate");
++ print_sta_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE], "rx bitrate");
+
+ if (sinfo[NL80211_STA_INFO_LLID])
+ printf("\n\tmesh llid:\t%d",
diff --git a/package/network/utils/iw/patches/110-per_chain_signal_strength.patch b/package/network/utils/iw/patches/110-per_chain_signal_strength.patch
new file mode 100644
index 0000000..813a7d9
--- /dev/null
+++ b/package/network/utils/iw/patches/110-per_chain_signal_strength.patch
@@ -0,0 +1,71 @@
+--- a/station.c
++++ b/station.c
+@@ -65,6 +65,33 @@ static void print_sta_bitrate(struct nla
+ }
+ }
+
++static char *get_chain_signal(struct nlattr *attr_list)
++{
++ struct nlattr *attr;
++ static char buf[64];
++ char *cur = buf;
++ int i = 0, rem;
++ const char *prefix;
++
++ if (!attr_list)
++ return "";
++
++ nla_for_each_nested(attr, attr_list, rem) {
++ if (i++ > 0)
++ prefix = ", ";
++ else
++ prefix = "[";
++
++ cur += snprintf(cur, sizeof(buf) - (cur - buf), "%s%d", prefix,
++ (int8_t) nla_get_u8(attr));
++ }
++
++ if (i)
++ snprintf(cur, sizeof(buf) - (cur - buf), "] ");
++
++ return buf;
++}
++
+ static int print_sta_handler(struct nl_msg *msg, void *arg)
+ {
+ struct nlattr *tb[NL80211_ATTR_MAX + 1];
+@@ -89,7 +116,10 @@ static int print_sta_handler(struct nl_m
+ [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 },
+ [NL80211_STA_INFO_STA_FLAGS] =
+ { .minlen = sizeof(struct nl80211_sta_flag_update) },
++ [NL80211_STA_INFO_CHAIN_SIGNAL] = { .type = NLA_NESTED },
++ [NL80211_STA_INFO_CHAIN_SIGNAL_AVG] = { .type = NLA_NESTED },
+ };
++ char *chain;
+
+ nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
+ genlmsg_attrlen(gnlh, 0), NULL);
+@@ -136,12 +166,19 @@ static int print_sta_handler(struct nl_m
+ if (sinfo[NL80211_STA_INFO_TX_FAILED])
+ printf("\n\ttx failed:\t%u",
+ nla_get_u32(sinfo[NL80211_STA_INFO_TX_FAILED]));
++
++ chain = get_chain_signal(sinfo[NL80211_STA_INFO_CHAIN_SIGNAL]);
+ if (sinfo[NL80211_STA_INFO_SIGNAL])
+- printf("\n\tsignal: \t%d dBm",
+- (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]));
++ printf("\n\tsignal: \t%d %sdBm",
++ (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]),
++ chain);
++
++ chain = get_chain_signal(sinfo[NL80211_STA_INFO_CHAIN_SIGNAL_AVG]);
+ if (sinfo[NL80211_STA_INFO_SIGNAL_AVG])
+- printf("\n\tsignal avg:\t%d dBm",
+- (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]));
++ printf("\n\tsignal avg:\t%d %sdBm",
++ (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]),
++ chain);
++
+ if (sinfo[NL80211_STA_INFO_T_OFFSET])
+ printf("\n\tToffset:\t%lld us",
+ (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));
diff --git a/package/network/utils/iw/patches/120-tdls_peer_indentation.patch b/package/network/utils/iw/patches/120-tdls_peer_indentation.patch
new file mode 100644
index 0000000..6836873
--- /dev/null
+++ b/package/network/utils/iw/patches/120-tdls_peer_indentation.patch
@@ -0,0 +1,11 @@
+--- a/station.c
++++ b/station.c
+@@ -267,7 +267,7 @@ static int print_sta_handler(struct nl_m
+ }
+
+ if (sta_flags->mask & BIT(NL80211_STA_FLAG_TDLS_PEER)) {
+- printf("\n\tTDLS peer:\t\t");
++ printf("\n\tTDLS peer:\t");
+ if (sta_flags->set & BIT(NL80211_STA_FLAG_TDLS_PEER))
+ printf("yes");
+ else
diff --git a/package/network/utils/iw/patches/130-antenna_gain.patch b/package/network/utils/iw/patches/130-antenna_gain.patch
new file mode 100644
index 0000000..f3ca691
--- /dev/null
+++ b/package/network/utils/iw/patches/130-antenna_gain.patch
@@ -0,0 +1,34 @@
+--- a/phy.c
++++ b/phy.c
+@@ -359,3 +359,31 @@ COMMAND(set, antenna, "<bitmap> | all |
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna,
+ "Set a bitmap of allowed antennas to use for TX and RX.\n"
+ "The driver may reject antenna configurations it cannot support.");
++
++static int handle_antenna_gain(struct nl80211_state *state,
++ struct nl_cb *cb,
++ struct nl_msg *msg,
++ int argc, char **argv,
++ enum id_input id)
++{
++ char *endptr;
++ int dbm;
++
++ /* get the required args */
++ if (argc != 1)
++ return 1;
++
++ dbm = strtol(argv[0], &endptr, 10);
++ if (*endptr)
++ return 2;
++
++ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_GAIN, dbm);
++
++ return 0;
++
++ nla_put_failure:
++ return -ENOBUFS;
++}
++COMMAND(set, antenna_gain, "<antenna gain in dBm>",
++ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna_gain,
++ "Specify antenna gain.");