[pkg-wpa-devel] r1791 - in /iw/branches/upstream/current: Makefile ieee80211.h info.c interface.c iw.c iw.h mesh.c nl80211.h p2p.c phy.c roc.c scan.c util.c version.sh

slh-guest at users.alioth.debian.org slh-guest at users.alioth.debian.org
Mon Jan 14 23:51:58 UTC 2013


Author: slh-guest
Date: Mon Jan 14 23:51:58 2013
New Revision: 1791

URL: http://svn.debian.org/wsvn/?sc=1&rev=1791
Log:
[svn-upgrade] new version iw (3.8)

Added:
    iw/branches/upstream/current/p2p.c
Modified:
    iw/branches/upstream/current/Makefile
    iw/branches/upstream/current/ieee80211.h
    iw/branches/upstream/current/info.c
    iw/branches/upstream/current/interface.c
    iw/branches/upstream/current/iw.c
    iw/branches/upstream/current/iw.h
    iw/branches/upstream/current/mesh.c
    iw/branches/upstream/current/nl80211.h
    iw/branches/upstream/current/phy.c
    iw/branches/upstream/current/roc.c
    iw/branches/upstream/current/scan.c
    iw/branches/upstream/current/util.c
    iw/branches/upstream/current/version.sh

Modified: iw/branches/upstream/current/Makefile
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/Makefile?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/Makefile (original)
+++ iw/branches/upstream/current/Makefile Mon Jan 14 23:51:58 2013
@@ -18,7 +18,7 @@
 	interface.o ibss.o station.o survey.o util.o \
 	mesh.o mpath.o scan.o reg.o version.o \
 	reason.o status.o connect.o link.o offch.o ps.o cqm.o \
-	bitrate.o wowlan.o roc.o
+	bitrate.o wowlan.o roc.o p2p.o
 OBJS += sections.o
 
 OBJS-$(HWSIM) += hwsim.o

Modified: iw/branches/upstream/current/ieee80211.h
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/ieee80211.h?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/ieee80211.h (original)
+++ iw/branches/upstream/current/ieee80211.h Mon Jan 14 23:51:58 2013
@@ -46,4 +46,16 @@
 	__u8 antenna_selection_info;
 } __attribute__ ((packed));
 
+struct ieee80211_vht_mcs_info {
+	__u16 rx_vht_mcs;
+	__u16 rx_highest;
+	__u16 tx_vht_mcs;
+	__u16 tx_highest;
+} __attribute__ ((packed));
+
+struct ieee80211_vht_cap {
+	__u32 cap_info;
+	struct ieee80211_vht_mcs_info mcs;
+} __attribute__ ((packed));
+
 #endif /* __IEEE80211 */

Modified: iw/branches/upstream/current/info.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/info.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/info.c (original)
+++ iw/branches/upstream/current/info.c Mon Jan 14 23:51:58 2013
@@ -98,7 +98,6 @@
 		nla_parse(tb_band, NL80211_BAND_ATTR_MAX, nla_data(nl_band),
 			  nla_len(nl_band), NULL);
 
-#ifdef NL80211_BAND_ATTR_HT_CAPA
 		if (tb_band[NL80211_BAND_ATTR_HT_CAPA]) {
 			__u16 cap = nla_get_u16(tb_band[NL80211_BAND_ATTR_HT_CAPA]);
 			print_ht_capability(cap);
@@ -114,7 +113,10 @@
 		if (tb_band[NL80211_BAND_ATTR_HT_MCS_SET] &&
 		    nla_len(tb_band[NL80211_BAND_ATTR_HT_MCS_SET]) == 16)
 			print_ht_mcs(nla_data(tb_band[NL80211_BAND_ATTR_HT_MCS_SET]));
-#endif
+		if (tb_band[NL80211_BAND_ATTR_VHT_CAPA] &&
+		    tb_band[NL80211_BAND_ATTR_VHT_MCS_SET])
+			print_vht_info(nla_get_u32(tb_band[NL80211_BAND_ATTR_VHT_CAPA]),
+				       nla_data(tb_band[NL80211_BAND_ATTR_VHT_MCS_SET]));
 
 		printf("\t\tFrequencies:\n");
 
@@ -444,6 +446,12 @@
 			printf("\tDevice accepts cell base station regulatory hints.\n");
 		if (features & NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL)
 			printf("\tP2P Device uses a channel (of the concurrent ones)\n");
+		if (features & NL80211_FEATURE_LOW_PRIORITY_SCAN)
+			printf("\tDevice supports low priority scan.\n");
+		if (features & NL80211_FEATURE_SCAN_FLUSH)
+			printf("\tDevice supports scan flush.\n");
+		if (features & NL80211_FEATURE_AP_SCAN)
+			printf("\tDevice supports AP scan.\n");
 	}
 
 	return NL_SKIP;
@@ -464,3 +472,16 @@
 TOPLEVEL(list, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info,
 	 "List all wireless devices and their capabilities.");
 TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL);
+
+static int handle_commands(struct nl80211_state *state,
+			   struct nl_cb *cb, struct nl_msg *msg,
+			   int argc, char **argv, enum id_input id)
+{
+	int i;
+	for (i = 1; i < NL80211_CMD_MAX; i++)
+		printf("%d (0x%x): %s\n", i, i, command_name(i));
+	/* don't send netlink messages */
+	return 2;
+}
+TOPLEVEL(commands, NULL, NL80211_CMD_GET_WIPHY, 0, CIB_NONE, handle_commands,
+	 "list all known commands and their decimal & hex value");

Modified: iw/branches/upstream/current/interface.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/interface.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/interface.c (original)
+++ iw/branches/upstream/current/interface.c Mon Jan 14 23:51:58 2013
@@ -132,6 +132,9 @@
 		return 0;
 	} else if (strcmp(tpstr, "__p2pcl") == 0) {
 		*type = NL80211_IFTYPE_P2P_CLIENT;
+		return 0;
+	} else if (strcmp(tpstr, "__p2pdev") == 0) {
+		*type = NL80211_IFTYPE_P2P_DEVICE;
 		return 0;
 	} else if (strcmp(tpstr, "__p2pgo") == 0) {
 		*type = NL80211_IFTYPE_P2P_GO;
@@ -259,6 +262,26 @@
 	}
 }
 
+static char *channel_width_name(enum nl80211_chan_width width)
+{
+	switch (width) {
+	case NL80211_CHAN_WIDTH_20_NOHT:
+		return "20 MHz (no HT)";
+	case NL80211_CHAN_WIDTH_20:
+		return "20 MHz";
+	case NL80211_CHAN_WIDTH_40:
+		return "40 MHz";
+	case NL80211_CHAN_WIDTH_80:
+		return "80 MHz";
+	case NL80211_CHAN_WIDTH_80P80:
+		return "80+80 MHz";
+	case NL80211_CHAN_WIDTH_160:
+		return "160 MHz";
+	default:
+		return "unknown";
+	}
+}
+
 static int print_iface_handler(struct nl_msg *msg, void *arg)
 {
 	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
@@ -291,20 +314,39 @@
 		mac_addr_n2a(mac_addr, nla_data(tb_msg[NL80211_ATTR_MAC]));
 		printf("%s\taddr %s\n", indent, mac_addr);
 	}
+	if (tb_msg[NL80211_ATTR_SSID]) {
+		printf("%s\tssid ", indent);
+		print_ssid_escaped(nla_len(tb_msg[NL80211_ATTR_SSID]),
+				   nla_data(tb_msg[NL80211_ATTR_SSID]));
+		printf("\n");
+	}
 	if (tb_msg[NL80211_ATTR_IFTYPE])
 		printf("%s\ttype %s\n", indent, iftype_name(nla_get_u32(tb_msg[NL80211_ATTR_IFTYPE])));
 	if (!wiphy && tb_msg[NL80211_ATTR_WIPHY])
 		printf("%s\twiphy %d\n", indent, nla_get_u32(tb_msg[NL80211_ATTR_WIPHY]));
 	if (tb_msg[NL80211_ATTR_WIPHY_FREQ]) {
 		uint32_t freq = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_FREQ]);
-		enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
-
-		if (tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])
+
+		printf("%s\tchannel %d (%d MHz)", indent,
+		       ieee80211_frequency_to_channel(freq), freq);
+
+		if (tb_msg[NL80211_ATTR_CHANNEL_WIDTH]) {
+			printf(", width: %s",
+				channel_width_name(nla_get_u32(tb_msg[NL80211_ATTR_CHANNEL_WIDTH])));
+			if (tb_msg[NL80211_ATTR_CENTER_FREQ1])
+				printf(", center1: %d MHz",
+					nla_get_u32(tb_msg[NL80211_ATTR_CENTER_FREQ1]));
+			if (tb_msg[NL80211_ATTR_CENTER_FREQ2])
+				printf(", center2: %d MHz",
+					nla_get_u32(tb_msg[NL80211_ATTR_CENTER_FREQ2]));
+		} else if (tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
+			enum nl80211_channel_type channel_type;
+
 			channel_type = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
-
-		printf("%s\tchannel %d (%d MHz) %s\n", indent,
-		       ieee80211_frequency_to_channel(freq), freq,
-		       channel_type_name(channel_type));
+			printf(" %s", channel_type_name(channel_type));
+		}
+
+		printf("\n");
 	}
 
 	return NL_SKIP;
@@ -490,3 +532,32 @@
 COMMAND(set, peer, "<MAC address>",
 	NL80211_CMD_SET_WDS_PEER, 0, CIB_NETDEV, handle_interface_wds_peer,
 	"Set interface WDS peer.");
+
+static int set_mcast_rate(struct nl80211_state *state,
+			  struct nl_cb *cb,
+			  struct nl_msg *msg,
+			  int argc, char **argv,
+			  enum id_input id)
+{
+	float rate;
+	char *end;
+
+	if (argc != 1) {
+		printf("Invalid parameters!\n");
+		return 2;
+	}
+
+	rate = strtod(argv[0], &end);
+	if (*end != '\0')
+		return 1;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, (int)(rate * 10));
+
+	return 0;
+nla_put_failure:
+	return -ENOBUFS;
+}
+
+COMMAND(set, mcast_rate, "<rate in Mbps>",
+	NL80211_CMD_SET_MCAST_RATE, 0, CIB_NETDEV, set_mcast_rate,
+	"Set the multicast bitrate.");

Modified: iw/branches/upstream/current/iw.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/iw.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/iw.c (original)
+++ iw/branches/upstream/current/iw.c Mon Jan 14 23:51:58 2013
@@ -105,9 +105,40 @@
 	if (cmd->parent && cmd->parent->name)
 		printf("%s ", cmd->parent->name);
 	printf("%s", cmd->name);
-	if (cmd->args)
-		printf(" %s", cmd->args);
-	printf("\n");
+
+	if (cmd->args) {
+		/* print line by line */
+		start = cmd->args;
+		end = strchr(start, '\0');
+		printf(" ");
+		do {
+			lend = strchr(start, '\n');
+			if (!lend)
+				lend = end;
+			if (start != cmd->args) {
+				printf("\t");
+				switch (cmd->idby) {
+				case CIB_NONE:
+					break;
+				case CIB_PHY:
+					printf("phy <phyname> ");
+					break;
+				case CIB_NETDEV:
+					printf("dev <devname> ");
+					break;
+				case CIB_WDEV:
+					printf("wdev <idx> ");
+					break;
+				}
+				if (cmd->parent && cmd->parent->name)
+					printf("%s ", cmd->parent->name);
+				printf("%s ", cmd->name);
+			}
+			printf("%.*s\n", (int)(lend - start), start);
+			start = lend + 1;
+		} while (end != lend);
+	} else
+		printf("\n");
 
 	if (!full || !cmd->help)
 		return;

Modified: iw/branches/upstream/current/iw.h
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/iw.h?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/iw.h (original)
+++ iw/branches/upstream/current/iw.h Mon Jan 14 23:51:58 2013
@@ -143,6 +143,7 @@
 void print_ampdu_length(__u8 exponent);
 void print_ampdu_spacing(__u8 spacing);
 void print_ht_capability(__u16 cap);
+void print_vht_info(__u32 capa, const __u8 *mcs);
 
 const char *iftype_name(enum nl80211_iftype iftype);
 const char *command_name(enum nl80211_commands cmd);

Modified: iw/branches/upstream/current/mesh.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/mesh.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/mesh.c (original)
+++ iw/branches/upstream/current/mesh.c Mon Jan 14 23:51:58 2013
@@ -232,19 +232,15 @@
 static const struct mesh_param_descr *find_mesh_param(const char *name)
 {
 	int i;
-	const struct mesh_param_descr *mdescr = NULL;
 
 	/* Find out what mesh parameter we want to change. */
 	for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
-		if (!strcmp(_mesh_param_descrs[i].name, name))
+		if (strcmp(_mesh_param_descrs[i].name, name) == 0)
 			return _mesh_param_descrs + i;
 	}
 
-	if (!mdescr) {
-		print_all_mesh_param_descr();
-		return NULL;
-	}
-	return mdescr;
+	print_all_mesh_param_descr();
+	return NULL;
 }
 
 /* Setter */

Modified: iw/branches/upstream/current/nl80211.h
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/nl80211.h?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/nl80211.h (original)
+++ iw/branches/upstream/current/nl80211.h Mon Jan 14 23:51:58 2013
@@ -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,8 @@
  *
  * @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
@@ -578,6 +583,9 @@
  *	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
  */
@@ -725,6 +733,8 @@
 	NL80211_CMD_STOP_P2P_DEVICE,
 
 	NL80211_CMD_CONN_FAILED,
+
+	NL80211_CMD_SET_MCAST_RATE,
 
 	/* add new commands above here */
 
@@ -762,14 +772,26 @@
  *	/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
@@ -1273,6 +1295,21 @@
  *	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
  */
@@ -1529,6 +1566,19 @@
 	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,
 
 	/* add attributes here, update the policy in nl80211.c */
 
@@ -1573,6 +1623,7 @@
 #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
@@ -1693,10 +1744,15 @@
  * @__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 {
@@ -1706,6 +1762,11 @@
 	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,
@@ -2414,11 +2475,46 @@
 #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,
 	NL80211_CHAN_HT40MINUS,
 	NL80211_CHAN_HT40PLUS
+};
+
+/**
+ * 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,
 };
 
 /**
@@ -2489,6 +2585,7 @@
  * @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
@@ -2500,6 +2597,7 @@
 	NL80211_AUTHTYPE_SHARED_KEY,
 	NL80211_AUTHTYPE_FT,
 	NL80211_AUTHTYPE_NETWORK_EAP,
+	NL80211_AUTHTYPE_SAE,
 
 	/* keep last */
 	__NL80211_AUTHTYPE_NUM,
@@ -3028,6 +3126,20 @@
  *	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,
@@ -3035,6 +3147,14 @@
 	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,
 };
 
 /**
@@ -3069,4 +3189,25 @@
 	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 */

Added: iw/branches/upstream/current/p2p.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/p2p.c?rev=1791&op=file
==============================================================================
--- iw/branches/upstream/current/p2p.c (added)
+++ iw/branches/upstream/current/p2p.c Mon Jan 14 23:51:58 2013
@@ -1,0 +1,30 @@
+#include <net/if.h>
+#include <errno.h>
+#include <string.h>
+
+#include <netlink/genl/genl.h>
+#include <netlink/genl/family.h>
+#include <netlink/genl/ctrl.h>
+#include <netlink/msg.h>
+#include <netlink/attr.h>
+
+#include "nl80211.h"
+#include "iw.h"
+
+SECTION(p2p);
+
+static int handle_p2p_start(struct nl80211_state *state, struct nl_cb *cb,
+			    struct nl_msg *msg, int argc, char **argv,
+			    enum id_input id)
+{
+	return 0;
+}
+COMMAND(p2p, start, "", NL80211_CMD_START_P2P_DEVICE, 0, CIB_WDEV, handle_p2p_start, "");
+
+static int handle_p2p_stop(struct nl80211_state *state, struct nl_cb *cb,
+			   struct nl_msg *msg, int argc, char **argv,
+			   enum id_input id)
+{
+	return 0;
+}
+COMMAND(p2p, stop, "", NL80211_CMD_STOP_P2P_DEVICE, 0, CIB_WDEV, handle_p2p_stop, "");

Modified: iw/branches/upstream/current/phy.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/phy.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/phy.c (original)
+++ iw/branches/upstream/current/phy.c Mon Jan 14 23:51:58 2013
@@ -29,6 +29,64 @@
 }
 COMMAND(set, name, "<new name>", NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_name,
 	"Rename this wireless device.");
+
+static int handle_freqs(struct nl_msg *msg, int argc, char **argv)
+{
+	static const struct {
+		const char *name;
+		unsigned int val;
+	} bwmap[] = {
+		{ .name = "20", .val = NL80211_CHAN_WIDTH_20, },
+		{ .name = "40", .val = NL80211_CHAN_WIDTH_40, },
+		{ .name = "80", .val = NL80211_CHAN_WIDTH_80, },
+		{ .name = "80+80", .val = NL80211_CHAN_WIDTH_80P80, },
+		{ .name = "160", .val = NL80211_CHAN_WIDTH_160, },
+	};
+	uint32_t freq;
+	int i, bwval = NL80211_CHAN_WIDTH_20_NOHT;
+	char *end;
+
+	if (argc < 1)
+		return 1;
+
+	for (i = 0; i < ARRAY_SIZE(bwmap); i++) {
+		if (strcasecmp(bwmap[i].name, argv[0]) == 0) {
+			bwval = bwmap[i].val;
+			break;
+		}
+	}
+
+	if (bwval == NL80211_CHAN_WIDTH_20_NOHT)
+		return 1;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH, bwval);
+
+	if (argc == 1)
+		return 0;
+
+	/* center freq 1 */
+	if (!*argv[1])
+		return 1;
+	freq = strtoul(argv[1], &end, 10);
+	if (*end)
+		return 1;
+	NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1, freq);
+
+	if (argc == 2)
+		return 0;
+
+	/* center freq 2 */
+	if (!*argv[2])
+		return 1;
+	freq = strtoul(argv[2], &end, 10);
+	if (*end)
+		return 1;
+	NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ2, freq);
+
+	return 0;
+ nla_put_failure:
+	return -ENOBUFS;
+}
 
 static int handle_freqchan(struct nl_msg *msg, bool chan,
 			   int argc, char **argv)
@@ -46,10 +104,23 @@
 	unsigned int freq;
 	int i;
 
-	if (!argc || argc > 2)
-		return 1;
-
-	if (argc == 2) {
+	if (!argc || argc > 4)
+		return 1;
+
+	if (!*argv[0])
+		return 1;
+	freq = strtoul(argv[0], &end, 10);
+	if (*end)
+		return 1;
+
+	if (chan)
+		freq = ieee80211_channel_to_frequency(freq);
+
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
+
+	if (argc > 2) {
+		return handle_freqs(msg, argc - 1, argv + 1);
+	} else if (argc == 2) {
 		for (i = 0; i < ARRAY_SIZE(htmap); i++) {
 			if (strcasecmp(htmap[i].name, argv[1]) == 0) {
 				htval = htmap[i].val;
@@ -57,19 +128,9 @@
 			}
 		}
 		if (htval == NL80211_CHAN_NO_HT)
-			return 1;
-	}
-
-	if (!*argv[0])
-		return 1;
-	freq = strtoul(argv[0], &end, 10);
-	if (*end)
-		return 1;
-
-	if (chan)
-		freq = ieee80211_channel_to_frequency(freq);
-
-	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
+			return handle_freqs(msg, argc - 1, argv + 1);
+	}
+
 	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, htval);
 
 	return 0;
@@ -88,7 +149,8 @@
 	NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_freq,
 	"Set frequency/channel the hardware is using, including HT\n"
 	"configuration.");
-COMMAND(set, freq, "<freq> [HT20|HT40+|HT40-]",
+COMMAND(set, freq, "<freq> [HT20|HT40+|HT40-]\n"
+		   "<control freq> [20|40|80|80+80|160] [<center freq 1>] [<center freq 2>]",
 	NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_freq, NULL);
 
 static int handle_chan(struct nl80211_state *state,

Modified: iw/branches/upstream/current/roc.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/roc.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/roc.c (original)
+++ iw/branches/upstream/current/roc.c Mon Jan 14 23:51:58 2013
@@ -38,4 +38,4 @@
 	return -ENOBUFS;
 }
 
-COMMAND(roc, start, "<freq> <time>", NL80211_CMD_REMAIN_ON_CHANNEL, 0, CIB_NETDEV, handle_roc_start, "");
+COMMAND(roc, start, "<freq> <time in ms>", NL80211_CMD_REMAIN_ON_CHANNEL, 0, CIB_NETDEV, handle_roc_start, "");

Modified: iw/branches/upstream/current/scan.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/scan.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/scan.c (original)
+++ iw/branches/upstream/current/scan.c Mon Jan 14 23:51:58 2013
@@ -73,6 +73,7 @@
 	bool passive = false, have_ssids = false, have_freqs = false;
 	size_t tmp;
 	unsigned char *ies;
+	int flags = 0;
 
 	ssids = nlmsg_alloc();
 	if (!ssids)
@@ -93,6 +94,18 @@
 				break;
 			} else if (strcmp(argv[i], "ies") == 0) {
 				parse = IES;
+				break;
+			} else if (strcmp(argv[i], "lowpri") == 0) {
+				parse = NONE;
+				flags |= NL80211_SCAN_FLAG_LOW_PRIORITY;
+				break;
+			} else if (strcmp(argv[i], "flush") == 0) {
+				parse = NONE;
+				flags |= NL80211_SCAN_FLAG_FLUSH;
+				break;
+			} else if (strcmp(argv[i], "ap-force") == 0) {
+				parse = NONE;
+				flags |= NL80211_SCAN_FLAG_AP;
 				break;
 			} else if (strcmp(argv[i], "ssid") == 0) {
 				parse = SSID;
@@ -136,6 +149,8 @@
 
 	if (have_freqs)
 		nla_put_nested(msg, NL80211_ATTR_SCAN_FREQUENCIES, freqs);
+	if (flags)
+		NLA_PUT_U32(msg, NL80211_ATTR_SCAN_FLAGS, flags);
 
 	err = 0;
  nla_put_failure:
@@ -159,6 +174,7 @@
 	printf("\n");
 }
 
+#define BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126
 #define BSS_MEMBERSHIP_SELECTOR_HT_PHY 127
 
 static void print_supprates(const uint8_t type, uint8_t len, const uint8_t *data)
@@ -170,7 +186,9 @@
 	for (i = 0; i < len; i++) {
 		int r = data[i] & 0x7f;
 
-		if (r == BSS_MEMBERSHIP_SELECTOR_HT_PHY && data[i] & 0x80)
+		if (r == BSS_MEMBERSHIP_SELECTOR_VHT_PHY && data[i] & 0x80)
+			printf("VHT");
+		else if (r == BSS_MEMBERSHIP_SELECTOR_HT_PHY && data[i] & 0x80)
 			printf("HT");
 		else
 			printf("%d.%d", r/2, 5*(r&1));
@@ -532,14 +550,15 @@
 	print_ht_mcs(data + 3);
 }
 
+static const char *ht_secondary_offset[4] = {
+	"no secondary",
+	"above",
+	"[reserved!]",
+	"below",
+};
+
 static void print_ht_op(const uint8_t type, uint8_t len, const uint8_t *data)
 {
-	static const char *offset[4] = {
-		"no secondary",
-		"above",
-		"[reserved!]",
-		"below",
-	};
 	static const char *protection[4] = {
 		"no",
 		"nonmember",
@@ -554,7 +573,7 @@
 	printf("\n");
 	printf("\t\t * primary channel: %d\n", data[0]);
 	printf("\t\t * secondary channel offset: %s\n",
-		offset[data[1] & 0x3]);
+		ht_secondary_offset[data[1] & 0x3]);
 	printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]);
 	printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3);
 	printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]);
@@ -586,32 +605,60 @@
 			else
 				first = false;
 
+#define CAPA(bit, name)		case bit: printf(" " name); break
+
 			switch (bit + base) {
-			case 0:
-				printf(" HT Information Exchange Supported");
-				break;
-			case 1:
-				printf(" On-demand Beacon");
-				break;
-			case 2:
-				printf(" Extended Channel Switching");
-				break;
-			case 3:
-				printf(" Wave Indication");
-				break;
-			case 4:
-				printf(" PSMP Capability");
-				break;
-			case 5:
-				printf(" Service Interval Granularity");
-				break;
-			case 6:
-				printf(" S-PSMP Capability");
-				break;
+			CAPA(0, "HT Information Exchange Supported");
+			CAPA(1, "reserved (On-demand Beacon)");
+			CAPA(2, "Extended Channel Switching");
+			CAPA(3, "reserved (Wave Indication)");
+			CAPA(4, "PSMP Capability");
+			CAPA(5, "reserved (Service Interval Granularity)");
+			CAPA(6, "S-PSMP Capability");
+			CAPA(7, "Event");
+			CAPA(8, "Diagnostics");
+			CAPA(9, "Multicast Diagnostics");
+			CAPA(10, "Location Tracking");
+			CAPA(11, "FMS");
+			CAPA(12, "Proxy ARP Service");
+			CAPA(13, "Collocated Interference Reporting");
+			CAPA(14, "Civic Location");
+			CAPA(15, "Geospatial Location");
+			CAPA(16, "TFS");
+			CAPA(17, "WNM-Sleep Mode");
+			CAPA(18, "TIM Broadcast");
+			CAPA(19, "BSS Transition");
+			CAPA(20, "QoS Traffic Capability");
+			CAPA(21, "AC Station Count");
+			CAPA(22, "Multiple BSSID");
+			CAPA(23, "Timing Measurement");
+			CAPA(24, "Channel Usage");
+			CAPA(25, "SSID List");
+			CAPA(26, "DMS");
+			CAPA(27, "UTC TSF Offset");
+			CAPA(28, "TDLS Peer U-APSD Buffer STA Support");
+			CAPA(29, "TDLS Peer PSM Support");
+			CAPA(30, "TDLS channel switching");
+			CAPA(31, "Interworking");
+			CAPA(32, "QoS Map");
+			CAPA(33, "EBR");
+			CAPA(34, "SSPN Interface");
+			CAPA(35, "Reserved");
+			CAPA(36, "MSGCF Capability");
+			CAPA(37, "TDLS Support");
+			CAPA(38, "TDLS Prohibited");
+			CAPA(39, "TDLS Channel Switching Prohibited");
+			CAPA(40, "Reject Unadmitted Frame");
+			CAPA(44, "Identifier Location");
+			CAPA(45, "U-APSD Coexistence");
+			CAPA(46, "WNM-Notification");
+			CAPA(47, "Reserved");
+			CAPA(48, "UTF-8 SSID");
 			default:
 				printf(" %d", bit);
 				break;
 			}
+#undef CAPA
 		}
 	}
 
@@ -626,6 +673,60 @@
 	if (len - 4)
 		printf(" (+ %u octet%s)", len - 4, len - 4 == 1 ? "" : "s");
 	printf("\n");
+}
+
+static void print_vht_capa(const uint8_t type, uint8_t len, const uint8_t *data)
+{
+	printf("\n");
+	print_vht_info(data[0] | (data[1] << 8) |
+		       (data[2] << 16) | (data[3] << 24),
+		       data + 4);
+}
+
+static void print_vht_oper(const uint8_t type, uint8_t len, const uint8_t *data)
+{
+	const char *chandwidths[] = {
+		[0] = "20 or 40 MHz",
+		[1] = "80 MHz",
+		[3] = "80+80 MHz",
+		[2] = "160 MHz",
+	};
+
+	printf("\n");
+	printf("\t\t * channel width: %d (%s)\n", data[0],
+		data[0] < ARRAY_SIZE(chandwidths) ? chandwidths[data[0]] : "unknown");
+	printf("\t\t * center freq segment 1: %d\n", data[1]);
+	printf("\t\t * center freq segment 2: %d\n", data[2]);
+	printf("\t\t * VHT basic MCS set: 0x%.2x%.2x\n", data[4], data[3]);
+}
+
+static void print_obss_scan_params(const uint8_t type, uint8_t len, const uint8_t *data)
+{
+	printf("\n");
+	printf("\t\t * passive dwell: %d TUs\n", (data[1] << 8) | data[0]);
+	printf("\t\t * active dwell: %d TUs\n", (data[3] << 8) | data[2]);
+	printf("\t\t * channel width trigger scan interval: %d s\n", (data[5] << 8) | data[4]);
+	printf("\t\t * scan passive total per channel: %d TUs\n", (data[7] << 8) | data[6]);
+	printf("\t\t * scan active total per channel: %d TUs\n", (data[9] << 8) | data[8]);
+	printf("\t\t * BSS width channel transition delay factor: %d\n", (data[11] << 8) | data[10]);
+	printf("\t\t * OBSS Scan Activity Threshold: %d.%02d %%\n",
+		((data[13] << 8) | data[12]) / 100, ((data[13] << 8) | data[12]) % 100);
+}
+
+static void print_secchan_offs(const uint8_t type, uint8_t len, const uint8_t *data)
+{
+	if (data[0] < ARRAY_SIZE(ht_secondary_offset))
+		printf(" %s (%d)\n", ht_secondary_offset[data[0]], data[0]);
+	else
+		printf(" %d\n", data[0]);
+}
+
+static void print_bss_load(const uint8_t type, uint8_t len, const uint8_t *data)
+{
+	printf("\n");
+	printf("\t\t * station count: %d\n", (data[1] << 8) | data[0]);
+	printf("\t\t * channel utilisation: %d/255\n", data[2]);
+	printf("\t\t * available admission capacity: %d [*32us]\n", (data[4] << 8) | data[3]);
 }
 
 struct ie_print {
@@ -673,10 +774,15 @@
 	[3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), },
 	[5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), },
 	[7] = { "Country", print_country, 3, 255, BIT(PRINT_SCAN), },
+	[11] = { "BSS Load", print_bss_load, 5, 5, BIT(PRINT_SCAN), },
 	[32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), },
 	[42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), },
 	[45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), },
+	[74] = { "Overlapping BSS scan params", print_obss_scan_params, 14, 255, BIT(PRINT_SCAN), },
 	[61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), },
+	[62] = { "Secondary Channel Offset", print_secchan_offs, 1, 1, BIT(PRINT_SCAN), },
+	[191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), },
+	[192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), },
 	[48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), },
 	[50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
 	[114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
@@ -1344,7 +1450,7 @@
 	dump_argv[0] = argv[0];
 	return handle_cmd(state, id, dump_argc, dump_argv);
 }
-TOPLEVEL(scan, "[-u] [freq <freq>*] [ies <hex as 00:11:..>] [ssid <ssid>*|passive]", 0, 0,
+TOPLEVEL(scan, "[-u] [freq <freq>*] [ies <hex as 00:11:..>] [lowpri,flush,ap-force] [ssid <ssid>*|passive]", 0, 0,
 	 CIB_NETDEV, handle_scan_combined,
 	 "Scan on the given frequencies and probe for the given SSIDs\n"
 	 "(or wildcard if not given) unless passive scanning is requested.\n"
@@ -1354,7 +1460,7 @@
 	NL80211_CMD_GET_SCAN, NLM_F_DUMP, CIB_NETDEV, handle_scan_dump,
 	"Dump the current scan results. If -u is specified, print unknown\n"
 	"data in scan results.");
-COMMAND(scan, trigger, "[freq <freq>*] [ies <hex as 00:11:..>] [ssid <ssid>*|passive]",
+COMMAND(scan, trigger, "[freq <freq>*] [ies <hex as 00:11:..>] [lowpri,flush,ap-force] [ssid <ssid>*|passive]",
 	NL80211_CMD_TRIGGER_SCAN, 0, CIB_NETDEV, handle_scan,
 	 "Trigger a scan on the given frequencies with probing for the given\n"
 	 "SSIDs (or wildcard if not given) unless passive scanning is requested.");

Modified: iw/branches/upstream/current/util.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/util.c?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/util.c (original)
+++ iw/branches/upstream/current/util.c Mon Jan 14 23:51:58 2013
@@ -139,7 +139,7 @@
 
 const char *iftype_name(enum nl80211_iftype iftype)
 {
-	if (iftype <= NL80211_IFTYPE_MAX)
+	if (iftype <= NL80211_IFTYPE_MAX && ifmodes[iftype])
 		return ifmodes[iftype];
 	sprintf(modebuf, "Unknown mode (%d)", iftype);
 	return modebuf;
@@ -237,6 +237,9 @@
 	[NL80211_CMD_UNEXPECTED_4ADDR_FRAME] = "unexpected_4addr_frame",
 	[NL80211_CMD_SET_NOACK_MAP] = "set_noack_map",
 	[NL80211_CMD_CH_SWITCH_NOTIFY] = "ch_switch_notify",
+	[NL80211_CMD_START_P2P_DEVICE] = "start_p2p_device",
+	[NL80211_CMD_STOP_P2P_DEVICE] = "stop_p2p_device",
+	[NL80211_CMD_CONN_FAILED] = "conn_failed",
 };
 
 static char cmdbuf[100];
@@ -597,3 +600,77 @@
 		printf("\t\tHT TX MCS rate indexes are undefined\n");
 	}
 }
+
+void print_vht_info(__u32 capa, const __u8 *mcs)
+{
+	__u16 tmp;
+	int i;
+
+	printf("\t\tVHT Capabilities (0x%.8x):\n", capa);
+
+#define PRINT_VHT_CAPA(_bit, _str) \
+	do { \
+		if (capa & BIT(_bit)) \
+			printf("\t\t\t" _str "\n"); \
+	} while (0)
+
+	printf("\t\t\tMax MPDU length: ");
+	switch (capa & 3) {
+	case 0: printf("3895\n"); break;
+	case 1: printf("7991\n"); break;
+	case 2: printf("11454\n"); break;
+	case 3: printf("(reserved)\n");
+	}
+	printf("\t\t\tSupported Channel Width: ");
+	switch ((capa >> 2) & 3) {
+	case 0: printf("neither 160 nor 80+80\n"); break;
+	case 1: printf("160 MHz\n"); break;
+	case 2: printf("160 MHz, 80+80 MHz\n"); break;
+	case 3: printf("(reserved)\n");
+	}
+	PRINT_VHT_CAPA(4, "RX LDPC");
+	PRINT_VHT_CAPA(5, "short GI (80 MHz)");
+	PRINT_VHT_CAPA(6, "short GI (160/80+80 MHz)");
+	PRINT_VHT_CAPA(7, "TX STBC");
+	/* RX STBC */
+	PRINT_VHT_CAPA(11, "SU Beamformer");
+	PRINT_VHT_CAPA(12, "SU Beamformee");
+	/* compressed steering */
+	/* # of sounding dimensions */
+	PRINT_VHT_CAPA(19, "MU Beamformer");
+	PRINT_VHT_CAPA(20, "MU Beamformee");
+	PRINT_VHT_CAPA(21, "VHT TXOP PS");
+	PRINT_VHT_CAPA(22, "+HTC-VHT");
+	/* max A-MPDU */
+	/* VHT link adaptation */
+	PRINT_VHT_CAPA(29, "RX antenna pattern consistency");
+	PRINT_VHT_CAPA(30, "TX antenna pattern consistency");
+
+	printf("\t\tVHT RX MCS set:\n");
+	tmp = mcs[0] | (mcs[1] << 8);
+	for (i = 1; i <= 8; i++) {
+		printf("\t\t\t%d streams: ", i);
+		switch ((tmp >> ((i-1)*2) ) & 3) {
+		case 0: printf("MCS 0-7\n"); break;
+		case 1: printf("MCS 0-8\n"); break;
+		case 2: printf("MCS 0-9\n"); break;
+		case 3: printf("not supported\n"); break;
+		}
+	}
+	tmp = mcs[2] | (mcs[3] << 8);
+	printf("\t\tVHT RX highest supported: %d Mbps\n", tmp & 0x1fff);
+
+	printf("\t\tVHT TX MCS set:\n");
+	tmp = mcs[4] | (mcs[5] << 8);
+	for (i = 1; i <= 8; i++) {
+		printf("\t\t\t%d streams: ", i);
+		switch ((tmp >> ((i-1)*2) ) & 3) {
+		case 0: printf("MCS 0-7\n"); break;
+		case 1: printf("MCS 0-8\n"); break;
+		case 2: printf("MCS 0-9\n"); break;
+		case 3: printf("not supported\n"); break;
+		}
+	}
+	tmp = mcs[6] | (mcs[7] << 8);
+	printf("\t\tVHT TX highest supported: %d Mbps\n", tmp & 0x1fff);
+}

Modified: iw/branches/upstream/current/version.sh
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/version.sh?rev=1791&op=diff
==============================================================================
--- iw/branches/upstream/current/version.sh (original)
+++ iw/branches/upstream/current/version.sh Mon Jan 14 23:51:58 2013
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-VERSION="3.7"
+VERSION="3.8"
 OUT="$1"
 
 if head=`git rev-parse --verify HEAD 2>/dev/null`; then




More information about the Pkg-wpa-devel mailing list