[pkg-wpa-devel] r1565 - in /iw/branches/upstream/current: Makefile bitrate.c event.c genl.c ibss.c info.c interface.c iw.c iw.h mesh.c nl80211.h phy.c reg.c scan.c station.c survey.c util.c version.sh

slh-guest at users.alioth.debian.org slh-guest at users.alioth.debian.org
Fri Feb 4 14:19:46 UTC 2011


Author: slh-guest
Date: Fri Feb  4 14:19:41 2011
New Revision: 1565

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

Added:
    iw/branches/upstream/current/bitrate.c
Modified:
    iw/branches/upstream/current/Makefile
    iw/branches/upstream/current/event.c
    iw/branches/upstream/current/genl.c
    iw/branches/upstream/current/ibss.c
    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/reg.c
    iw/branches/upstream/current/scan.c
    iw/branches/upstream/current/station.c
    iw/branches/upstream/current/survey.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=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/Makefile (original)
+++ iw/branches/upstream/current/Makefile Fri Feb  4 14:19:41 2011
@@ -17,7 +17,8 @@
 OBJS = iw.o genl.o event.o info.o phy.o \
 	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
+	reason.o status.o connect.o link.o offch.o ps.o cqm.o \
+	bitrate.o
 OBJS += sections.o
 ALL = iw
 

Added: iw/branches/upstream/current/bitrate.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/bitrate.c?rev=1565&op=file
==============================================================================
--- iw/branches/upstream/current/bitrate.c (added)
+++ iw/branches/upstream/current/bitrate.c Fri Feb  4 14:19:41 2011
@@ -1,0 +1,140 @@
+#include <errno.h>
+
+#include "nl80211.h"
+#include "iw.h"
+
+
+static int handle_bitrates(struct nl80211_state *state,
+			   struct nl_cb *cb,
+			   struct nl_msg *msg,
+			   int argc, char **argv)
+{
+	struct nlattr *nl_rates, *nl_band;
+	int i;
+	bool have_legacy_24 = false, have_legacy_5 = false;
+	uint8_t legacy_24[32], legacy_5[32];
+	int n_legacy_24 = 0, n_legacy_5 = 0;
+	uint8_t *legacy = NULL;
+	int *n_legacy = NULL;
+	bool have_mcs_24 = false, have_mcs_5 = false;
+#ifdef NL80211_TXRATE_MCS
+	uint8_t mcs_24[77], mcs_5[77];
+	int n_mcs_24 = 0, n_mcs_5 = 0;
+	uint8_t *mcs = NULL;
+	int *n_mcs = NULL;
+#endif
+	enum {
+		S_NONE,
+		S_LEGACY,
+		S_MCS,
+	} parser_state = S_NONE;
+
+	for (i = 0; i < argc; i++) {
+		char *end;
+		double tmpd;
+#ifdef NL80211_TXRATE_MCS
+		long tmpl;
+#endif
+
+		if (strcmp(argv[i], "legacy-2.4") == 0) {
+			if (have_legacy_24)
+				return 1;
+			parser_state = S_LEGACY;
+			legacy = legacy_24;
+			n_legacy = &n_legacy_24;
+			have_legacy_24 = true;
+		} else if (strcmp(argv[i], "legacy-5") == 0) {
+			if (have_legacy_5)
+				return 1;
+			parser_state = S_LEGACY;
+			legacy = legacy_5;
+			n_legacy = &n_legacy_5;
+			have_legacy_5 = true;
+		}
+#ifdef NL80211_TXRATE_MCS
+		else if (strcmp(argv[i], "mcs-2.4") == 0) {
+			if (have_mcs_24)
+				return 1;
+			parser_state = S_MCS;
+			mcs = mcs_24;
+			n_mcs = &n_mcs_24;
+			have_mcs_24 = true;
+		} else if (strcmp(argv[i], "mcs-5") == 0) {
+			if (have_mcs_5)
+				return 1;
+			parser_state = S_MCS;
+			mcs = mcs_5;
+			n_mcs = &n_mcs_5;
+			have_mcs_5 = true;
+		}
+#endif
+		else switch (parser_state) {
+		case S_LEGACY:
+			tmpd = strtod(argv[i], &end);
+			if (*end != '\0')
+				return 1;
+			if (tmpd < 1 || tmpd > 255 * 2)
+				return 1;
+			legacy[(*n_legacy)++] = tmpd * 2;
+			break;
+		case S_MCS:
+#ifdef NL80211_TXRATE_MCS
+			tmpl = strtol(argv[i], &end, 0);
+			if (*end != '\0')
+				return 1;
+			if (tmpl < 0 || tmpl > 255)
+				return 1;
+			mcs[(*n_mcs)++] = tmpl;
+			break;
+#endif
+		default:
+			return 1;
+		}
+	}
+
+	nl_rates = nla_nest_start(msg, NL80211_ATTR_TX_RATES);
+	if (!nl_rates)
+		goto nla_put_failure;
+
+	if (have_legacy_24 || have_mcs_24) {
+		nl_band = nla_nest_start(msg, NL80211_BAND_2GHZ);
+		if (!nl_band)
+			goto nla_put_failure;
+		if (have_legacy_24)
+			nla_put(msg, NL80211_TXRATE_LEGACY, n_legacy_24, legacy_24);
+#ifdef NL80211_TXRATE_MCS
+		if (have_mcs_24)
+			nla_put(msg, NL80211_TXRATE_MCS, n_mcs_24, mcs_24);
+#endif
+		nla_nest_end(msg, nl_band);
+	}
+
+	if (have_legacy_5 || have_mcs_5) {
+		nl_band = nla_nest_start(msg, NL80211_BAND_5GHZ);
+		if (!nl_band)
+			goto nla_put_failure;
+		if (have_legacy_5)
+			nla_put(msg, NL80211_TXRATE_LEGACY, n_legacy_5, legacy_5);
+#ifdef NL80211_TXRATE_MCS
+		if (have_mcs_5)
+			nla_put(msg, NL80211_TXRATE_MCS, n_mcs_5, mcs_5);
+#endif
+		nla_nest_end(msg, nl_band);
+	}
+
+	nla_nest_end(msg, nl_rates);
+
+	return 0;
+ nla_put_failure:
+	return -ENOBUFS;
+}
+
+#define DESCR_LEGACY "[legacy-<2.4|5> <legacy rate in Mbps>*]"
+#ifdef NL80211_TXRATE_MCS
+#define DESCR DESCR_LEGACY " [mcs-<2.4|5> <MCS index>*]"
+#else
+#define DESCR DESCR_LEGACY
+#endif
+
+COMMAND(set, bitrates, DESCR, NL80211_CMD_SET_TX_BITRATE_MASK, 0, CIB_NETDEV,
+	handle_bitrates, "Sets up the specified rate masks.");

Modified: iw/branches/upstream/current/event.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/event.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/event.c (original)
+++ iw/branches/upstream/current/event.c Fri Feb  4 14:19:41 2011
@@ -100,7 +100,7 @@
 	printf("]");
 }
 
-static void parse_cqm_event(struct nlattr *tb)
+static void parse_cqm_event(struct nlattr **attrs)
 {
 	static struct nla_policy cqm_policy[NL80211_ATTR_CQM_MAX + 1] = {
 		[NL80211_ATTR_CQM_RSSI_THOLD] = { .type = NLA_U32 },
@@ -108,10 +108,12 @@
 		[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT] = { .type = NLA_U32 },
 	};
 	struct nlattr *cqm[NL80211_ATTR_CQM_MAX + 1];
+	struct nlattr *cqm_attr = attrs[NL80211_ATTR_CQM];
 
 	printf("connection quality monitor event: ");
 
-	if (!tb || nla_parse_nested(cqm, NL80211_ATTR_CQM_MAX, tb, cqm_policy)) {
+	if (!cqm_attr ||
+	    nla_parse_nested(cqm, NL80211_ATTR_CQM_MAX, cqm_attr, cqm_policy)) {
 		printf("missing data!\n");
 		return;
 	}
@@ -120,22 +122,69 @@
 		enum nl80211_cqm_rssi_threshold_event rssi_event;
 		rssi_event = nla_get_u32(cqm[NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT]);
 		if (rssi_event == NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH)
-			printf("RSSI went above threshold");
+			printf("RSSI went above threshold\n");
 		else
-			printf("RSSI went below threshold");
-	}
+			printf("RSSI went below threshold\n");
+	} else if (cqm[NL80211_ATTR_CQM_PKT_LOSS_EVENT] &&
+		   attrs[NL80211_ATTR_MAC]) {
+		uint32_t frames;
+		char buf[3*6];
+
+		frames = nla_get_u32(cqm[NL80211_ATTR_CQM_PKT_LOSS_EVENT]);
+		mac_addr_n2a(buf, nla_data(attrs[NL80211_ATTR_MAC]));
+		printf("peer %s didn't ACK %d packets\n", buf, frames);
+	} else
+		printf("unknown event\n");
+}
+
+static const char * key_type_str(enum nl80211_key_type key_type)
+{
+	static char buf[30];
+	switch (key_type) {
+	case NL80211_KEYTYPE_GROUP:
+		return "Group";
+	case NL80211_KEYTYPE_PAIRWISE:
+		return "Pairwise";
+	case NL80211_KEYTYPE_PEERKEY:
+		return "PeerKey";
+	default:
+		snprintf(buf, sizeof(buf), "unknown(%d)", key_type);
+		return buf;
+	}
+}
+
+static void parse_mic_failure(struct nlattr **attrs)
+{
+	printf("Michael MIC failure event:");
+
+	if (attrs[NL80211_ATTR_MAC]) {
+		char addr[3 * ETH_ALEN];
+		mac_addr_n2a(addr, nla_data(attrs[NL80211_ATTR_MAC]));
+		printf(" source MAC address %s", addr);
+	}
+
+	if (attrs[NL80211_ATTR_KEY_SEQ] &&
+	    nla_len(attrs[NL80211_ATTR_KEY_SEQ]) == 6) {
+		unsigned char *seq = nla_data(attrs[NL80211_ATTR_KEY_SEQ]);
+		printf(" seq=%02x%02x%02x%02x%02x%02x",
+		       seq[0], seq[1], seq[2], seq[3], seq[4], seq[5]);
+	}
+	if (attrs[NL80211_ATTR_KEY_TYPE]) {
+		enum nl80211_key_type key_type =
+			nla_get_u32(attrs[NL80211_ATTR_KEY_TYPE]);
+		printf(" Key Type %s", key_type_str(key_type));
+	}
+
+	if (attrs[NL80211_ATTR_KEY_IDX]) {
+		__u8 key_id = nla_get_u8(attrs[NL80211_ATTR_KEY_IDX]);
+		printf(" Key Id %d", key_id);
+	}
+
 	printf("\n");
 }
 
-
 static int print_event(struct nl_msg *msg, void *arg)
 {
-#define PARSE_BEACON_CHAN(_attr, _chan) do { \
-	r = parse_beacon_hint_chan(tb[_attr], \
-				   &_chan); \
-	if (r) \
-		return NL_SKIP; \
-} while (0)
 	struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
 	struct nlattr *tb[NL80211_ATTR_MAX + 1], *nst;
 	struct print_event_args *args = arg;
@@ -144,14 +193,23 @@
 	__u8 reg_type;
 	struct ieee80211_beacon_channel chan_before_beacon,  chan_after_beacon;
 	__u32 wiphy_idx = 0;
-	int r;
 	int rem_nst;
 	__u16 status;
 
-	if (args->time) {
-		struct timeval tv;
-		gettimeofday(&tv, NULL);
-		printf("%ld.%06u: ", (long) tv.tv_sec, (unsigned int) tv.tv_usec);
+	if (args->time || args->reltime) {
+		unsigned long long usecs, previous;
+
+		previous = 1000000ULL * args->ts.tv_sec + args->ts.tv_usec;
+		gettimeofday(&args->ts, NULL);
+		usecs = 1000000ULL * args->ts.tv_sec + args->ts.tv_usec;
+		if (args->reltime) {
+			if (!args->have_ts) {
+				usecs = 0;
+				args->have_ts = true;
+			} else
+				usecs -= previous;
+		}
+		printf("%llu.%06llu: ", usecs/1000000, usecs % 1000000);
 	}
 
 	nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
@@ -235,8 +293,12 @@
 		memset(&chan_before_beacon, 0, sizeof(chan_before_beacon));
 		memset(&chan_after_beacon, 0, sizeof(chan_after_beacon));
 
-		PARSE_BEACON_CHAN(NL80211_ATTR_FREQ_BEFORE, chan_before_beacon);
-		PARSE_BEACON_CHAN(NL80211_ATTR_FREQ_AFTER, chan_after_beacon);
+		if (parse_beacon_hint_chan(tb[NL80211_ATTR_FREQ_BEFORE],
+					   &chan_before_beacon))
+			break;
+		if (parse_beacon_hint_chan(tb[NL80211_ATTR_FREQ_AFTER],
+					   &chan_after_beacon))
+			break;
 
 		if (chan_before_beacon.center_freq != chan_after_beacon.center_freq)
 			break;
@@ -290,6 +352,16 @@
 		break;
 	case NL80211_CMD_DISASSOCIATE:
 		printf("disassoc");
+		print_frame(args, tb[NL80211_ATTR_FRAME]);
+		printf("\n");
+		break;
+	case NL80211_CMD_UNPROT_DEAUTHENTICATE:
+		printf("unprotected deauth");
+		print_frame(args, tb[NL80211_ATTR_FRAME]);
+		printf("\n");
+		break;
+	case NL80211_CMD_UNPROT_DISASSOCIATE:
+		printf("unprotected disassoc");
 		print_frame(args, tb[NL80211_ATTR_FRAME]);
 		printf("\n");
 		break;
@@ -342,15 +414,18 @@
 			(unsigned long long)nla_get_u64(tb[NL80211_ATTR_COOKIE]));
 		break;
 	case NL80211_CMD_NOTIFY_CQM:
-		parse_cqm_event(tb[NL80211_ATTR_CQM]);
+		parse_cqm_event(tb);
+		break;
+	case NL80211_CMD_MICHAEL_MIC_FAILURE:
+		parse_mic_failure(tb);
 		break;
 	default:
 		printf("unknown event %d\n", gnlh->cmd);
 		break;
 	}
 
+	fflush(stdout);
 	return NL_SKIP;
-#undef PARSE_BEACON_CHAN
 }
 
 struct wait_event {
@@ -369,8 +444,8 @@
 	for (i = 0; i < wait->n_cmds; i++) {
 		if (gnlh->cmd == wait->cmds[i]) {
 			wait->cmd = gnlh->cmd;
-		if (wait->pargs)
-			print_event(msg, wait->pargs);
+			if (wait->pargs)
+				print_event(msg, wait->pargs);
 		}
 	}
 
@@ -480,12 +555,17 @@
 			args.frame = true;
 		else if (strcmp(argv[0], "-t") == 0)
 			args.time = true;
+		else if (strcmp(argv[0], "-r") == 0)
+			args.reltime = true;
 		else
 			return 1;
 		argc--;
 		argv++;
 	}
 
+	if (args.time && args.reltime)
+		return 1;
+
 	if (argc)
 		return 1;
 
@@ -495,7 +575,8 @@
 
 	return __do_listen_events(state, 0, NULL, &args);
 }
-TOPLEVEL(event, "[-t] [-f]", 0, 0, CIB_NONE, print_events,
+TOPLEVEL(event, "[-t] [-r] [-f]", 0, 0, CIB_NONE, print_events,
 	"Monitor events from the kernel.\n"
 	"-t - print timestamp\n"
+	"-r - print relative timstamp\n"
 	"-f - print full frame for auth/assoc etc.");

Modified: iw/branches/upstream/current/genl.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/genl.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/genl.c (original)
+++ iw/branches/upstream/current/genl.c Fri Feb  4 14:19:41 2011
@@ -8,6 +8,7 @@
 #include <netlink/genl/ctrl.h>  
 #include <netlink/msg.h>
 #include <netlink/attr.h>
+#include <linux/genetlink.h>
 
 #include "iw.h"
 

Modified: iw/branches/upstream/current/ibss.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/ibss.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/ibss.c (original)
+++ iw/branches/upstream/current/ibss.c Fri Feb  4 14:19:41 2011
@@ -1,4 +1,8 @@
+#ifndef _POSIX_SOURCE
+#define _POSIX_SOURCE
+#endif
 #include <errno.h>
+#include <string.h>
 
 #include <netlink/genl/genl.h>
 #include <netlink/genl/family.h>
@@ -22,6 +26,7 @@
 	int n_rates = 0;
 	char *value = NULL, *sptr = NULL;
 	float rate;
+	int bintval;
 
 	if (argc < 2)
 		return 1;
@@ -53,6 +58,17 @@
 		}
 	}
 
+	if (argc > 1 && strcmp(argv[0], "beacon-interval") == 0) {
+		argv++;
+		argc--;
+		bintval = strtoul(argv[0], &end, 10);
+		if (*end != '\0')
+			return 1;
+		NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, bintval);
+		argv++;
+		argc--;
+	}
+
 	/* basic rates */
 	if (argc > 1 && strcmp(argv[0], "basic-rates") == 0) {
 		argv++;
@@ -75,6 +91,20 @@
 
 		NLA_PUT(msg, NL80211_ATTR_BSS_BASIC_RATES, n_rates, rates);
 
+		argv++;
+		argc--;
+	}
+
+	/* multicast rate */
+	if (argc > 1 && strcmp(argv[0], "mcast-rate") == 0) {
+		argv++;
+		argc--;
+
+		rate = strtod(argv[0], &end);
+		if (*end != '\0')
+			return 1;
+
+		NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, (int) rate * 10);
 		argv++;
 		argc--;
 	}
@@ -104,11 +134,13 @@
 	NL80211_CMD_LEAVE_IBSS, 0, CIB_NETDEV, leave_ibss,
 	"Leave the current IBSS cell.");
 COMMAND(ibss, join,
-	"<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] "
-	"[basic-rates <rate in Mbps,rate2,...>] [key d:0:abcde]",
+	"<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [beacon-interval <TU>]"
+	" [basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] "
+	"[key d:0:abcde]",
 	NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss,
 	"Join the IBSS cell with the given SSID, if it doesn't exist create\n"
 	"it on the given frequency. When fixed frequency is requested, don't\n"
 	"join/create a cell on a different frequency. When a fixed BSSID is\n"
 	"requested use that BSSID and do not adopt another cell's BSSID even\n"
-	"if it has higher TSF and the same SSID.");
+	"if it has higher TSF and the same SSID. If an IBSS is created, create\n"
+	"it with the specified basic-rates, multicast-rate and beacon-interval.");

Modified: iw/branches/upstream/current/info.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/info.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/info.c (original)
+++ iw/branches/upstream/current/info.c Fri Feb  4 14:19:41 2011
@@ -49,8 +49,9 @@
 	struct nlattr *nl_rate;
 	struct nlattr *nl_mode;
 	struct nlattr *nl_cmd;
+	struct nlattr *nl_if, *nl_ftype;
 	int bandidx = 1;
-	int rem_band, rem_freq, rem_rate, rem_mode, rem_cmd;
+	int rem_band, rem_freq, rem_rate, rem_mode, rem_cmd, rem_ftype, rem_if;
 	int open;
 
 	nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
@@ -141,7 +142,7 @@
 		       nla_get_u8(tb_msg[NL80211_ATTR_MAX_NUM_SCAN_SSIDS]));
 	if (tb_msg[NL80211_ATTR_MAX_SCAN_IE_LEN])
 		printf("\tmax scan IEs length: %d bytes\n",
-		       nla_get_u32(tb_msg[NL80211_ATTR_MAX_SCAN_IE_LEN]));
+		       nla_get_u16(tb_msg[NL80211_ATTR_MAX_SCAN_IE_LEN]));
 
 	if (tb_msg[NL80211_ATTR_WIPHY_FRAG_THRESHOLD]) {
 		unsigned int frag;
@@ -167,20 +168,59 @@
 		printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage);
 	}
 
-	if (!tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES])
-		goto commands;
-
-	printf("\tSupported interface modes:\n");
-	nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES], rem_mode)
-		printf("\t\t * %s\n", iftype_name(nl_mode->nla_type));
-
- commands:
-	if (!tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS])
-		return NL_SKIP;
-
-	printf("\tSupported commands:\n");
-	nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd)
-		printf("\t\t * %s\n", command_name(nla_get_u32(nl_cmd)));
+	if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX] &&
+	    tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX])
+		printf("\tAvailable Antennas: TX %#x RX %#x\n",
+		       nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX]),
+		       nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX]));
+
+	if (tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
+	    tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX])
+		printf("\tConfigured Antennas: TX %#x RX %#x\n",
+		       nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_TX]),
+		       nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_ANTENNA_RX]));
+
+	if (tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]) {
+		printf("\tSupported interface modes:\n");
+		nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES], rem_mode)
+			printf("\t\t * %s\n", iftype_name(nl_mode->nla_type));
+	}
+
+	if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) {
+		printf("\tSupported commands:\n");
+		nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd)
+			printf("\t\t * %s\n", command_name(nla_get_u32(nl_cmd)));
+	}
+
+	if (tb_msg[NL80211_ATTR_TX_FRAME_TYPES]) {
+		printf("\tSupported TX frame types:\n");
+		nla_for_each_nested(nl_if, tb_msg[NL80211_ATTR_TX_FRAME_TYPES], rem_if) {
+			bool printed = false;
+			nla_for_each_nested(nl_ftype, nl_if, rem_ftype) {
+				if (!printed)
+					printf("\t\t * %s:", iftype_name(nla_type(nl_if)));
+				printed = true;
+				printf(" 0x%.4x", nla_get_u16(nl_ftype));
+			}
+			if (printed)
+				printf("\n");
+		}
+	}
+
+	if (tb_msg[NL80211_ATTR_RX_FRAME_TYPES]) {
+		printf("\tSupported RX frame types:\n");
+		nla_for_each_nested(nl_if, tb_msg[NL80211_ATTR_RX_FRAME_TYPES], rem_if) {
+			bool printed = false;
+			nla_for_each_nested(nl_ftype, nl_if, rem_ftype) {
+				if (!printed)
+					printf("\t\t * %s:", iftype_name(nla_type(nl_if)));
+				printed = true;
+				printf(" 0x%.4x", nla_get_u16(nl_ftype));
+			}
+			if (printed)
+				printf("\n");
+		}
+	}
 
 	return NL_SKIP;
 }
@@ -195,7 +235,7 @@
 	return 0;
 }
 __COMMAND(NULL, info, "info", NULL, NL80211_CMD_GET_WIPHY, 0, 0, CIB_PHY, handle_info,
-	 "Show capabilities for the specified wireless device.");
+	 "Show capabilities for the specified wireless device.", NULL);
 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);

Modified: iw/branches/upstream/current/interface.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/interface.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/interface.c (original)
+++ iw/branches/upstream/current/interface.c Fri Feb  4 14:19:41 2011
@@ -105,13 +105,12 @@
 	} else if (strcmp(tpstr, "monitor") == 0) {
 		*type = NL80211_IFTYPE_MONITOR;
 		return 0;
-	} else if (strcmp(tpstr, "master") == 0) {
+	} else if (strcmp(tpstr, "master") == 0 ||
+		   strcmp(tpstr, "ap") == 0) {
 		*type = NL80211_IFTYPE_UNSPECIFIED;
-		fprintf(stderr, "See http://wireless.kernel.org/RTFM-AP.\n");
-		return 2;
-	} else if (strcmp(tpstr, "ap") == 0) {
-		*type = NL80211_IFTYPE_UNSPECIFIED;
-		fprintf(stderr, "See http://wireless.kernel.org/RTFM-AP.\n");
+		fprintf(stderr, "You need to run a management daemon, e.g. hostapd,\n");
+		fprintf(stderr, "see http://wireless.kernel.org/en/users/Documentation/hostapd\n");
+		fprintf(stderr, "for more information on how to do that.\n");
 		return 2;
 	} else if (strcmp(tpstr, "__ap") == 0) {
 		*type = NL80211_IFTYPE_AP;
@@ -130,6 +129,12 @@
 	} else if (strcmp(tpstr, "mp") == 0 ||
 		   strcmp(tpstr, "mesh") == 0) {
 		*type = NL80211_IFTYPE_MESH_POINT;
+		return 0;
+	} else if (strcmp(tpstr, "__p2pcl") == 0) {
+		*type = NL80211_IFTYPE_P2P_CLIENT;
+		return 0;
+	} else if (strcmp(tpstr, "__p2pgo") == 0) {
+		*type = NL80211_IFTYPE_P2P_GO;
 		return 0;
 	}
 
@@ -365,3 +370,47 @@
 	NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_type,
 	"Set interface type/mode.\n"
 	IFACE_TYPES);
+
+static int handle_interface_4addr(struct nl80211_state *state,
+				 struct nl_cb *cb,
+				 struct nl_msg *msg,
+				 int argc, char **argv)
+{
+	if (argc != 1)
+		return 1;
+	return parse_4addr_flag(argv[0], msg);
+}
+COMMAND(set, 4addr, "<on|off>",
+	NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_4addr,
+	"Set interface 4addr (WDS) mode.");
+
+static int handle_interface_wds_peer(struct nl80211_state *state,
+				     struct nl_cb *cb,
+				     struct nl_msg *msg,
+				     int argc, char **argv)
+{
+	unsigned char mac_addr[ETH_ALEN];
+
+	if (argc < 1)
+		return 1;
+
+	if (mac_addr_a2n(mac_addr, argv[0])) {
+		fprintf(stderr, "Invalid MAC address\n");
+		return 2;
+	}
+
+	argc--;
+	argv++;
+
+	if (argc)
+		return 1;
+
+	NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr);
+
+	return 0;
+ nla_put_failure:
+	return -ENOBUFS;
+}
+COMMAND(set, peer, "<MAC address>",
+	NL80211_CMD_SET_WDS_PEER, 0, CIB_NETDEV, handle_interface_wds_peer,
+	"Set interface WDS peer.");

Modified: iw/branches/upstream/current/iw.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/iw.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/iw.c (original)
+++ iw/branches/upstream/current/iw.c Fri Feb  4 14:19:41 2011
@@ -355,6 +355,12 @@
 		if (cmd->idby != command_idby)
 			return 1;
 		if (!cmd->handler)
+			return 1;
+	}
+
+	if (cmd->selector) {
+		cmd = cmd->selector(argc, argv);
+		if (!cmd)
 			return 1;
 	}
 

Modified: iw/branches/upstream/current/iw.h
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/iw.h?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/iw.h (original)
+++ iw/branches/upstream/current/iw.h Fri Feb  4 14:19:41 2011
@@ -51,12 +51,13 @@
 		       struct nl_cb *cb,
 		       struct nl_msg *msg,
 		       int argc, char **argv);
+	const struct cmd *(*selector)(int argc, char **argv);
 	const struct cmd *parent;
 };
 
 #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
 
-#define __COMMAND(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help)\
+#define __COMMAND(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help, _sel)\
 	static struct cmd						\
 	__cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden\
 	__attribute__((used)) __attribute__((section("__cmd")))	= {	\
@@ -69,11 +70,17 @@
 		.handler = (_handler),					\
 		.help = (_help),					\
 		.parent = _section,					\
-	 }
+		.selector = (_sel),					\
+	}
+#define __ACMD(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help, _sel, _alias)\
+	__COMMAND(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help, _sel);\
+	static const struct cmd *_alias = &__cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden
 #define COMMAND(section, name, args, cmd, flags, idby, handler, help)	\
-	__COMMAND(&(__section ## _ ## section), name, #name, args, cmd, flags, 0, idby, handler, help)
+	__COMMAND(&(__section ## _ ## section), name, #name, args, cmd, flags, 0, idby, handler, help, NULL)
+#define COMMAND_ALIAS(section, name, args, cmd, flags, idby, handler, help, selector, alias)\
+	__ACMD(&(__section ## _ ## section), name, #name, args, cmd, flags, 0, idby, handler, help, selector, alias)
 #define HIDDEN(section, name, args, cmd, flags, idby, handler)		\
-	__COMMAND(&(__section ## _ ## section), name, #name, args, cmd, flags, 1, idby, handler, NULL)
+	__COMMAND(&(__section ## _ ## section), name, #name, args, cmd, flags, 1, idby, handler, NULL, NULL)
 
 #define TOPLEVEL(_name, _args, _nlcmd, _flags, _idby, _handler, _help)	\
 	struct cmd							\
@@ -105,7 +112,9 @@
 	       int argc, char **argv);
 
 struct print_event_args {
-	bool frame, time;
+	struct timeval ts; /* internal */
+	bool have_ts; /* must be set false */
+	bool frame, time, reltime;
 };
 
 __u32 listen_events(struct nl80211_state *state,

Modified: iw/branches/upstream/current/mesh.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/mesh.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/mesh.c (original)
+++ iw/branches/upstream/current/mesh.c Fri Feb  4 14:19:41 2011
@@ -10,6 +10,9 @@
 
 #include "nl80211.h"
 #include "iw.h"
+
+SECTION(mesh);
+
 
 typedef struct _any_t {
 	union {
@@ -143,6 +146,9 @@
 	_my_nla_put_u8, _parse_u8, _print_u8},
 	{"mesh_ttl",
 	NL80211_MESHCONF_TTL,
+	_my_nla_put_u8, _parse_u8, _print_u8},
+	{"mesh_element_ttl",
+	NL80211_MESHCONF_ELEMENT_TTL,
 	_my_nla_put_u8, _parse_u8, _print_u8},
 	{"mesh_auto_open_plinks",
 	NL80211_MESHCONF_AUTO_OPEN_PLINKS,
@@ -179,23 +185,14 @@
 		printf(" - %s\n", _mesh_param_descrs[i].name);
 }
 
-static const struct mesh_param_descr* find_mesh_param(int argc, char **argv,
-						const char *action_name)
+static const struct mesh_param_descr *find_mesh_param(const char *name)
 {
 	int i;
-	const struct mesh_param_descr *mdescr;
-
-	if (argc < 1) {
-		printf("You must specify which mesh parameter to %s.\n",
-		       action_name);
-		print_all_mesh_param_descr();
-		return NULL;
-	}
+	const struct mesh_param_descr *mdescr = NULL;
 
 	/* Find out what mesh parameter we want to change. */
-	mdescr = NULL;
 	for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
-		if (!strcmp(_mesh_param_descrs[i].name, argv[0]))
+		if (!strcmp(_mesh_param_descrs[i].name, name))
 			return _mesh_param_descrs + i;
 	}
 
@@ -212,40 +209,65 @@
 				   struct nl_msg *msg,
 				   int argc, char **argv)
 {
-	int err;
-	uint32_t ret;
 	const struct mesh_param_descr *mdescr;
 	struct nlattr *container;
-	_any any;
-
-	mdescr = find_mesh_param(argc, argv, "change");
-	if (!mdescr)
-		return 2;
-	if (argc != 2) {
-		printf("Must specify a value for %s.\n", mdescr->name);
-		return 2;
-	}
-
-	/* Parse the new value */
-	memset(&any, 0, sizeof(_any));
-	ret = mdescr->parse_fn(argv[1], &any);
-	if (ret != 0) {
-		printf("%s must be set to a number "
-		       "between 0 and %u\n", mdescr->name, ret);
-		return 2;
-	}
-
-	/* Construct a netlink message */
+	uint32_t ret;
+	int err;
+
 	container = nla_nest_start(msg, NL80211_ATTR_MESH_PARAMS);
 	if (!container)
 		return -ENOBUFS;
-	err = mdescr->nla_put_fn(msg, mdescr->mesh_param_num, &any);
+
+	if (!argc)
+		return 1;
+
+	while (argc) {
+		const char *name;
+		char *value;
+		_any any;
+
+		memset(&any, 0, sizeof(_any));
+
+		name = argv[0];
+		value = strchr(name, '=');
+		if (value) {
+			*value = '\0';
+			value++;
+			argc--;
+			argv++;
+		} else {
+			/* backward compat -- accept w/o '=' */
+			if (argc < 2) {
+				printf("Must specify a value for %s.\n", name);
+				return 2;
+			}
+			value = argv[1];
+			argc -= 2;
+			argv += 2;
+		}
+
+		mdescr = find_mesh_param(name);
+		if (!mdescr)
+			return 2;
+
+		/* Parse the new value */
+		ret = mdescr->parse_fn(value, &any);
+		if (ret != 0) {
+			printf("%s must be set to a number "
+			       "between 0 and %u\n", mdescr->name, ret);
+			return 2;
+		}
+
+		err = mdescr->nla_put_fn(msg, mdescr->mesh_param_num, &any);
+		if (err)
+			return err;
+	}
 	nla_nest_end(msg, container);
 
 	return err;
 }
 
-COMMAND(set, mesh_param, "<param> <value>",
+COMMAND(set, mesh_param, "<param>=<value> [<param>=<value>]*",
 	NL80211_CMD_SET_MESH_PARAMS, 0, CIB_NETDEV, set_interface_meshparam,
 	"Set mesh parameter (run command without any to see available ones).");
 
@@ -267,8 +289,20 @@
 
 	/* unpack the mesh parameters */
 	if (nla_parse_nested(mesh_params, NL80211_MESHCONF_ATTR_MAX,
-				parent_attr, NULL))
+			     parent_attr, NULL))
 		return -EINVAL;
+
+	if (!mdescr) {
+		int i;
+
+		for (i = 0; i < ARRAY_SIZE(_mesh_param_descrs); i++) {
+			mdescr = &_mesh_param_descrs[i];
+			printf("%s = ", mdescr->name);
+			mdescr->nla_print_fn(mesh_params[mdescr->mesh_param_num]);
+			printf("\n");
+		}
+		return NL_SKIP;
+	}
 
 	/* print out the mesh parameter */
 	mdescr->nla_print_fn(mesh_params[mdescr->mesh_param_num]);
@@ -281,17 +315,53 @@
 				   struct nl_msg *msg,
 				   int argc, char **argv)
 {
-	const struct mesh_param_descr *mdescr;
-
-	mdescr = find_mesh_param(argc, argv, "get");
-	if (!mdescr)
-		return 2;
+	const struct mesh_param_descr *mdescr = NULL;
+
+	if (argc > 1)
+		return 1;
+
+	if (argc == 1) {
+		mdescr = find_mesh_param(argv[0]);
+		if (!mdescr)
+			return 2;
+	}
 
 	nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
 		  print_mesh_param_handler, (void *)mdescr);
 	return 0;
 }
 
-COMMAND(get, mesh_param, "<param>",
+COMMAND(get, mesh_param, "[<param>]",
 	NL80211_CMD_GET_MESH_PARAMS, 0, CIB_NETDEV, get_interface_meshparam,
 	"Retrieve mesh parameter (run command without any to see available ones).");
+
+static int join_mesh(struct nl80211_state *state, struct nl_cb *cb,
+		     struct nl_msg *msg, int argc, char **argv)
+{
+	if (argc < 1)
+		return 1;
+
+	NLA_PUT(msg, NL80211_ATTR_MESH_ID, strlen(argv[0]), argv[0]);
+	argc--;
+	argv++;
+
+	if (!argc)
+		return 0;
+	return set_interface_meshparam(state, cb, msg, argc, argv);
+ nla_put_failure:
+	return -ENOBUFS;
+}
+COMMAND(mesh, join, "<mesh ID> [<param>=<value>]*",
+	NL80211_CMD_JOIN_MESH, 0, CIB_NETDEV, join_mesh,
+	"Join a mesh with the given mesh ID and mesh parameters.");
+
+static int leave_mesh(struct nl80211_state *state, struct nl_cb *cb,
+		      struct nl_msg *msg, int argc, char **argv)
+{
+	if (argc)
+		return 1;
+
+	return 0;
+}
+COMMAND(mesh, leave, NULL, NL80211_CMD_LEAVE_MESH, 0, CIB_NETDEV, leave_mesh,
+	"Leave a mesh.");

Modified: iw/branches/upstream/current/nl80211.h
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/nl80211.h?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/nl80211.h (original)
+++ iw/branches/upstream/current/nl80211.h Fri Feb  4 14:19:41 2011
@@ -37,6 +37,43 @@
  * to.
  *
  * TODO: need more info?
+ */
+
+/**
+ * DOC: Frame transmission/registration support
+ *
+ * Frame transmission and registration support exists to allow userspace
+ * management entities such as wpa_supplicant react to management frames
+ * that are not being handled by the kernel. This includes, for example,
+ * certain classes of action frames that cannot be handled in the kernel
+ * for various reasons.
+ *
+ * Frame registration is done on a per-interface basis and registrations
+ * cannot be removed other than by closing the socket. It is possible to
+ * specify a registration filter to register, for example, only for a
+ * certain type of action frame. In particular with action frames, those
+ * that userspace registers for will not be returned as unhandled by the
+ * driver, so that the registered application has to take responsibility
+ * for doing that.
+ *
+ * The type of frame that can be registered for is also dependent on the
+ * driver and interface type. The frame types are advertised in wiphy
+ * attributes so applications know what to expect.
+ *
+ * NOTE: When an interface changes type while registrations are active,
+ *       these registrations are ignored until the interface type is
+ *       changed again. This means that changing the interface type can
+ *       lead to a situation that couldn't otherwise be produced, but
+ *       any such registrations will be dormant in the sense that they
+ *       will not be serviced, i.e. they will not receive any frames.
+ *
+ * Frame transmission allows userspace to send for example the required
+ * responses to action frames. It is subject to some sanity checking,
+ * but many frames can be transmitted. When a frame was transmitted, its
+ * status is indicated to the sending socket.
+ *
+ * For more technical details, see the corresponding command descriptions
+ * below.
  */
 
 /**
@@ -135,10 +172,10 @@
  * 	to the specified ISO/IEC 3166-1 alpha2 country code. The core will
  * 	store this as a valid request and then query userspace for it.
  *
- * @NL80211_CMD_GET_MESH_PARAMS: Get mesh networking properties for the
+ * @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
  *	interface identified by %NL80211_ATTR_IFINDEX
  *
- * @NL80211_CMD_SET_MESH_PARAMS: Set mesh networking properties for the
+ * @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the
  *      interface identified by %NL80211_ATTR_IFINDEX
  *
  * @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
@@ -258,7 +295,9 @@
  *	auth and assoc steps. For this, you need to specify the SSID in a
  *	%NL80211_ATTR_SSID attribute, and can optionally specify the association
  *	IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
- *	%NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT.
+ *	%NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
+ *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
+ *	%NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
  *	It is also sent as an event, with the BSSID and response IEs when the
  *	connection is established or failed to be established. This can be
  *	determined by the STATUS_CODE attribute.
@@ -276,8 +315,8 @@
  *	channel for the specified amount of time. This can be used to do
  *	off-channel operations like transmit a Public Action frame and wait for
  *	a response while being associated to an AP on another channel.
- *	%NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which
- *	radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
+ *	%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.
  *	%NL80211_ATTR_DURATION is used to specify the duration in milliseconds
@@ -301,30 +340,42 @@
  *	rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
  *	and @NL80211_ATTR_TX_RATES the set of allowed rates.
  *
- * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames
- *	(via @NL80211_CMD_ACTION) for processing in userspace. This command
- *	requires an interface index and a match attribute containing the first
- *	few bytes of the frame that should match, e.g. a single byte for only
- *	a category match or four bytes for vendor frames including the OUI.
- *	The registration cannot be dropped, but is removed automatically
- *	when the netlink socket is closed. Multiple registrations can be made.
- * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This
- *	command is used both as a request to transmit an Action frame and as an
- *	event indicating reception of an Action frame that was not processed in
+ * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
+ *	(via @NL80211_CMD_FRAME) for processing in userspace. This command
+ *	requires an interface index, a frame type attribute (optional for
+ *	backward compatibility reasons, if not given assumes action frames)
+ *	and a match attribute containing the first few bytes of the frame
+ *	that should match, e.g. a single byte for only a category match or
+ *	four bytes for vendor frames including the OUI. The registration
+ *	cannot be dropped, but is removed automatically when the netlink
+ *	socket is closed. Multiple registrations can be made.
+ * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
+ *	backward compatibility
+ * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
+ *	command is used both as a request to transmit a management frame and
+ *	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. This
- *	channel has to be the current channel (remain-on-channel or the
- *	operational channel). When called, this operation returns a cookie
- *	(%NL80211_ATTR_COOKIE) that will be included with the TX status event
- *	pertaining to the TX request.
- * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame
- *	transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies
+ *	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.
+ * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
+ *	command may be used with the corresponding cookie to cancel the wait
+ *	time if it is known that it is no longer necessary.
+ * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
+ * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
+ *	transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
  *	the TX command and %NL80211_ATTR_FRAME includes the contents of the
  *	frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
  *	the frame.
+ * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
+ *	backward compatibility.
  * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
  *	is used to configure connection quality monitoring notification trigger
  *	levels.
@@ -341,6 +392,20 @@
  *	of any other interfaces, and other interfaces will again take
  *	precedence when they are used.
  *
+ * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
+ *
+ * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
+ *	mesh config parameters may be given.
+ * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
+ *	network is determined by the network interface.
+ *
+ * @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
+ *	notification. This event is used to indicate that an unprotected
+ *	deauthentication frame was dropped when MFP is in use.
+ * @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
+ *	notification. This event is used to indicate that an unprotected
+ *	disassociation frame was dropped when MFP is in use.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -383,8 +448,8 @@
 	NL80211_CMD_SET_REG,
 	NL80211_CMD_REQ_SET_REG,
 
-	NL80211_CMD_GET_MESH_PARAMS,
-	NL80211_CMD_SET_MESH_PARAMS,
+	NL80211_CMD_GET_MESH_CONFIG,
+	NL80211_CMD_SET_MESH_CONFIG,
 
 	NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */,
 
@@ -429,9 +494,12 @@
 
 	NL80211_CMD_SET_TX_BITRATE_MASK,
 
-	NL80211_CMD_REGISTER_ACTION,
-	NL80211_CMD_ACTION,
-	NL80211_CMD_ACTION_TX_STATUS,
+	NL80211_CMD_REGISTER_FRAME,
+	NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
+	NL80211_CMD_FRAME,
+	NL80211_CMD_ACTION = NL80211_CMD_FRAME,
+	NL80211_CMD_FRAME_TX_STATUS,
+	NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
 
 	NL80211_CMD_SET_POWER_SAVE,
 	NL80211_CMD_GET_POWER_SAVE,
@@ -440,6 +508,15 @@
 	NL80211_CMD_NOTIFY_CQM,
 
 	NL80211_CMD_SET_CHANNEL,
+	NL80211_CMD_SET_WDS_PEER,
+
+	NL80211_CMD_FRAME_WAIT_CANCEL,
+
+	NL80211_CMD_JOIN_MESH,
+	NL80211_CMD_LEAVE_MESH,
+
+	NL80211_CMD_UNPROT_DEAUTHENTICATE,
+	NL80211_CMD_UNPROT_DISASSOCIATE,
 
 	/* add new commands above here */
 
@@ -460,6 +537,10 @@
 #define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
 #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
 #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT
+
+/* source-level API compatibility */
+#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG
+#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG
 
 /**
  * enum nl80211_attrs - nl80211 netlink attributes
@@ -639,6 +720,15 @@
  *	request, the driver will assume that the port is unauthorized until
  *	authorized by user space. Otherwise, port is marked authorized by
  *	default in station mode.
+ * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
+ *	ethertype that will be used for key negotiation. It can be
+ *	specified with the associate and connect commands. If it is not
+ *	specified, the value defaults to 0x888E (PAE, 802.1X). This
+ *	attribute is also used as a flag in the wiphy information to
+ *	indicate that protocols other than PAE are supported.
+ * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
+ *	%NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
+ *	ethertype frames used for key negotiation must not be encrypted.
  *
  * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
  *	We recommend using nested, driver-specific attributes within this.
@@ -697,6 +787,9 @@
  *	cache, a wiphy attribute.
  *
  * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
+ * @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
+ *	specifies the maximum duration that can be requested with the
+ *	remain-on-channel operation, in milliseconds, u32.
  *
  * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
  *
@@ -708,7 +801,16 @@
  *	is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
  *
  * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
- *	at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION.
+ *	at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
+ * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
+ *	@NL80211_CMD_REGISTER_FRAME command.
+ * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
+ *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
+ *	information about which frame types can be transmitted with
+ *	%NL80211_CMD_FRAME.
+ * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
+ *	nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
+ *	information about which frame types can be registered for RX.
  *
  * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
  *	acknowledged by the recipient.
@@ -724,6 +826,60 @@
  *
  * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
  *	connected to this BSS.
+ *
+ * @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See
+ *      &enum nl80211_tx_power_setting for possible values.
+ * @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units.
+ *      This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
+ *      for non-automatic settings.
+ *
+ * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
+ *	means support for per-station GTKs.
+ *
+ * @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting.
+ *	This can be used to mask out antennas which are not attached or should
+ *	not be used for transmitting. If an antenna is not selected in this
+ *	bitmap the hardware is not allowed to transmit on this antenna.
+ *
+ *	Each bit represents one antenna, starting with antenna 1 at the first
+ *	bit. Depending on which antennas are selected in the bitmap, 802.11n
+ *	drivers can derive which chainmasks to use (if all antennas belonging to
+ *	a particular chain are disabled this chain should be disabled) and if
+ *	a chain has diversity antennas wether diversity should be used or not.
+ *	HT capabilities (STBC, TX Beamforming, Antenna selection) can be
+ *	derived from the available chains after applying the antenna mask.
+ *	Non-802.11n drivers can derive wether to use diversity or not.
+ *	Drivers may reject configurations or RX/TX mask combinations they cannot
+ *	support by returning -EINVAL.
+ *
+ * @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving.
+ *	This can be used to mask out antennas which are not attached or should
+ *	not be used for receiving. If an antenna is not selected in this bitmap
+ *	the hardware should not be configured to receive on this antenna.
+ *	For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX.
+ *
+ * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
+ *	for configuration as TX antennas via the above parameters.
+ *
+ * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
+ *	for configuration as RX antennas via the above parameters.
+ *
+ * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
+ *
+ * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
+ *	transmitted on another channel when the channel given doesn't match
+ *	the current channel. If the current channel doesn't match and this
+ *	flag isn't set, the frame will be rejected. This is also used as an
+ *	nl80211 capability flag.
+ *
+ * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16)
+ *
+ * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
+ *	attributes, specifying what a key should be set as default as.
+ *	See &enum nl80211_key_default_types.
+ *
+ * @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters.  These cannot be
+ * changed once the mesh is active.
  *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -779,7 +935,7 @@
 	NL80211_ATTR_REG_ALPHA2,
 	NL80211_ATTR_REG_RULES,
 
-	NL80211_ATTR_MESH_PARAMS,
+	NL80211_ATTR_MESH_CONFIG,
 
 	NL80211_ATTR_BSS_BASIC_RATES,
 
@@ -882,6 +1038,36 @@
 
 	NL80211_ATTR_AP_ISOLATE,
 
+	NL80211_ATTR_WIPHY_TX_POWER_SETTING,
+	NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
+
+	NL80211_ATTR_TX_FRAME_TYPES,
+	NL80211_ATTR_RX_FRAME_TYPES,
+	NL80211_ATTR_FRAME_TYPE,
+
+	NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
+	NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
+
+	NL80211_ATTR_SUPPORT_IBSS_RSN,
+
+	NL80211_ATTR_WIPHY_ANTENNA_TX,
+	NL80211_ATTR_WIPHY_ANTENNA_RX,
+
+	NL80211_ATTR_MCAST_RATE,
+
+	NL80211_ATTR_OFFCHANNEL_TX_OK,
+
+	NL80211_ATTR_BSS_HT_OPMODE,
+
+	NL80211_ATTR_KEY_DEFAULT_TYPES,
+
+	NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
+
+	NL80211_ATTR_MESH_SETUP,
+
+	NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
+	NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -890,6 +1076,7 @@
 
 /* source-level API compatibility */
 #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
+#define	NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
 
 /*
  * Allow user space programs to use #ifdef on new attributes by defining them
@@ -937,8 +1124,10 @@
  * @NL80211_IFTYPE_WDS: wireless distribution interface
  * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
  * @NL80211_IFTYPE_MESH_POINT: mesh point
+ * @NL80211_IFTYPE_P2P_CLIENT: P2P client
+ * @NL80211_IFTYPE_P2P_GO: P2P group owner
  * @NL80211_IFTYPE_MAX: highest interface type number currently defined
- * @__NL80211_IFTYPE_AFTER_LAST: internal use
+ * @NUM_NL80211_IFTYPES: number of defined interface types
  *
  * These values are used with the %NL80211_ATTR_IFTYPE
  * to set the type of an interface.
@@ -953,10 +1142,12 @@
 	NL80211_IFTYPE_WDS,
 	NL80211_IFTYPE_MONITOR,
 	NL80211_IFTYPE_MESH_POINT,
+	NL80211_IFTYPE_P2P_CLIENT,
+	NL80211_IFTYPE_P2P_GO,
 
 	/* keep last */
-	__NL80211_IFTYPE_AFTER_LAST,
-	NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
+	NUM_NL80211_IFTYPES,
+	NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
 };
 
 /**
@@ -965,11 +1156,14 @@
  * Station flags. When a station is added to an AP interface, it is
  * assumed to be already associated (and hence authenticated.)
  *
+ * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
  * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
  * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
  *	with short barker preamble
  * @NL80211_STA_FLAG_WME: station is WME/QoS capable
  * @NL80211_STA_FLAG_MFP: station uses management frame protection
+ * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
+ * @__NL80211_STA_FLAG_AFTER_LAST: internal use
  */
 enum nl80211_sta_flags {
 	__NL80211_STA_FLAG_INVALID,
@@ -1039,6 +1233,9 @@
  * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
  * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
  *	station)
+ * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
+ * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
+ * @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
  */
 enum nl80211_sta_info {
 	__NL80211_STA_INFO_INVALID,
@@ -1052,6 +1249,9 @@
 	NL80211_STA_INFO_TX_BITRATE,
 	NL80211_STA_INFO_RX_PACKETS,
 	NL80211_STA_INFO_TX_PACKETS,
+	NL80211_STA_INFO_TX_RETRIES,
+	NL80211_STA_INFO_TX_FAILED,
+	NL80211_STA_INFO_SIGNAL_AVG,
 
 	/* keep last */
 	__NL80211_STA_INFO_AFTER_LAST,
@@ -1082,14 +1282,17 @@
  * information about a mesh path.
  *
  * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
- * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination
- * @NL80211_ATTR_MPATH_SN: destination sequence number
- * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path
- * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now
- * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in
+ * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
+ * @NL80211_MPATH_INFO_SN: destination sequence number
+ * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
+ * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
+ * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
  * 	&enum nl80211_mpath_flags;
- * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
- * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries
+ * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
+ * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
+ * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
+ *	currently defind
+ * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
  */
 enum nl80211_mpath_info {
 	__NL80211_MPATH_INFO_INVALID,
@@ -1118,6 +1321,8 @@
  * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
  * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
  * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
+ * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
+ * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
  */
 enum nl80211_band_attr {
 	__NL80211_BAND_ATTR_INVALID,
@@ -1138,6 +1343,7 @@
 
 /**
  * enum nl80211_frequency_attr - frequency attributes
+ * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
  * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
  * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
  *	regulatory domain.
@@ -1149,6 +1355,9 @@
  *	on this channel in current regulatory domain.
  * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
  *	(100 * dBm).
+ * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
+ *	currently defined
+ * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
  */
 enum nl80211_frequency_attr {
 	__NL80211_FREQUENCY_ATTR_INVALID,
@@ -1168,9 +1377,13 @@
 
 /**
  * enum nl80211_bitrate_attr - bitrate attributes
+ * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
  * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
  * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
  *	in 2.4 GHz band.
+ * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
+ *	currently defined
+ * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
  */
 enum nl80211_bitrate_attr {
 	__NL80211_BITRATE_ATTR_INVALID,
@@ -1192,7 +1405,11 @@
  * 	wireless core it thinks its knows the regulatory domain we should be in.
  * @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
  * 	802.11 country information element with regulatory information it
- * 	thinks we should consider.
+ * 	thinks we should consider. cfg80211 only processes the country
+ *	code from the IE, and relies on the regulatory domain information
+ *	structure pased by userspace (CRDA) from our wireless-regdb.
+ *	If a channel is enabled but the country code indicates it should
+ *	be disabled we disable the channel and re-enable it upon disassociation.
  */
 enum nl80211_reg_initiator {
 	NL80211_REGDOM_SET_BY_CORE,
@@ -1226,6 +1443,7 @@
 
 /**
  * enum nl80211_reg_rule_attr - regulatory rule attributes
+ * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
  * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
  * 	considerations for a given frequency range. These are the
  * 	&enum nl80211_reg_rule_flags.
@@ -1242,6 +1460,9 @@
  * 	If you don't have one then don't send this.
  * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
  * 	a given frequency range. The value is in mBm (100 * dBm).
+ * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
+ *	currently defined
+ * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
  */
 enum nl80211_reg_rule_attr {
 	__NL80211_REG_RULE_ATTR_INVALID,
@@ -1293,11 +1514,31 @@
  * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
  * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
  * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
+ * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
+ *	spent on this channel
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
+ *	channel was sensed busy (either due to activity or energy detect)
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
+ *	channel was sensed busy
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
+ *	receiving data
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
+ *	transmitting data
+ * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
+ *	currently defined
+ * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
  */
 enum nl80211_survey_info {
 	__NL80211_SURVEY_INFO_INVALID,
 	NL80211_SURVEY_INFO_FREQUENCY,
 	NL80211_SURVEY_INFO_NOISE,
+	NL80211_SURVEY_INFO_IN_USE,
+	NL80211_SURVEY_INFO_CHANNEL_TIME,
+	NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
+	NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
+	NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
+	NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
 
 	/* keep last */
 	__NL80211_SURVEY_INFO_AFTER_LAST,
@@ -1337,7 +1578,8 @@
 /**
  * enum nl80211_meshconf_params - mesh configuration parameters
  *
- * Mesh configuration parameters
+ * Mesh configuration parameters. These can be changed while the mesh is
+ * active.
  *
  * @__NL80211_MESHCONF_INVALID: internal use
  *
@@ -1385,6 +1627,9 @@
  * that it takes for an HWMP information element to propagate across the mesh
  *
  * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not
+ *
+ * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
+ * source mesh point for path selection elements.
  *
  * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
  *
@@ -1406,10 +1651,44 @@
 	NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
 	NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
 	NL80211_MESHCONF_HWMP_ROOTMODE,
+	NL80211_MESHCONF_ELEMENT_TTL,
 
 	/* keep last */
 	__NL80211_MESHCONF_ATTR_AFTER_LAST,
 	NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_mesh_setup_params - mesh setup parameters
+ *
+ * Mesh setup parameters.  These are used to start/join a mesh and cannot be
+ * changed while the mesh is active.
+ *
+ * @__NL80211_MESH_SETUP_INVALID: Internal use
+ *
+ * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
+ * vendor specific path selection algorithm or disable it to use the default
+ * HWMP.
+ *
+ * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
+ * vendor specific path metric or disable it to use the default Airtime
+ * metric.
+ *
+ * @NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE: A vendor specific information
+ * element that vendors will use to identify the path selection methods and
+ * metrics in use.
+ *
+ * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
+ */
+enum nl80211_mesh_setup_params {
+	__NL80211_MESH_SETUP_INVALID,
+	NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL,
+	NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC,
+	NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE,
+
+	/* keep last */
+	__NL80211_MESH_SETUP_ATTR_AFTER_LAST,
+	NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1
 };
 
 /**
@@ -1457,6 +1736,7 @@
  * enum nl80211_bss - netlink attributes for a BSS
  *
  * @__NL80211_BSS_INVALID: invalid
+ * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
  * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
  * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
  * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
@@ -1500,6 +1780,12 @@
 
 /**
  * enum nl80211_bss_status - BSS "status"
+ * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
+ * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
+ * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
+ *
+ * The BSS status is a BSS attribute in scan dumps, which
+ * indicates the status the interface has wrt. this BSS.
  */
 enum nl80211_bss_status {
 	NL80211_BSS_STATUS_AUTHENTICATED,
@@ -1537,11 +1823,14 @@
  * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
  * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
  * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
+ * @NUM_NL80211_KEYTYPES: number of defined key types
  */
 enum nl80211_key_type {
 	NL80211_KEYTYPE_GROUP,
 	NL80211_KEYTYPE_PAIRWISE,
 	NL80211_KEYTYPE_PEERKEY,
+
+	NUM_NL80211_KEYTYPES
 };
 
 /**
@@ -1557,6 +1846,23 @@
 enum nl80211_wpa_versions {
 	NL80211_WPA_VERSION_1 = 1 << 0,
 	NL80211_WPA_VERSION_2 = 1 << 1,
+};
+
+/**
+ * enum nl80211_key_default_types - key default types
+ * @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
+ * @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
+ *	unicast key
+ * @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
+ *	multicast key
+ * @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
+ */
+enum nl80211_key_default_types {
+	__NL80211_KEY_DEFAULT_TYPE_INVALID,
+	NL80211_KEY_DEFAULT_TYPE_UNICAST,
+	NL80211_KEY_DEFAULT_TYPE_MULTICAST,
+
+	NUM_NL80211_KEY_DEFAULT_TYPES
 };
 
 /**
@@ -1572,6 +1878,12 @@
  *	CCMP keys, each six bytes in little endian
  * @NL80211_KEY_DEFAULT: flag indicating default key
  * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
+ * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
+ *	specified the default depends on whether a MAC address was
+ *	given with the command using the key or not (u32)
+ * @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
+ *	attributes, specifying what a key should be set as default as.
+ *	See &enum nl80211_key_default_types.
  * @__NL80211_KEY_AFTER_LAST: internal
  * @NL80211_KEY_MAX: highest key attribute
  */
@@ -1583,6 +1895,8 @@
 	NL80211_KEY_SEQ,
 	NL80211_KEY_DEFAULT,
 	NL80211_KEY_DEFAULT_MGMT,
+	NL80211_KEY_TYPE,
+	NL80211_KEY_DEFAULT_TYPES,
 
 	/* keep last */
 	__NL80211_KEY_AFTER_LAST,
@@ -1610,8 +1924,8 @@
 
 /**
  * enum nl80211_band - Frequency band
- * @NL80211_BAND_2GHZ - 2.4 GHz ISM band
- * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz)
+ * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
+ * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
  */
 enum nl80211_band {
 	NL80211_BAND_2GHZ,
@@ -1633,6 +1947,8 @@
  *	the minimum amount the RSSI level must change after an event before a
  *	new event may be issued (to reduce effects of RSSI oscillation).
  * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
+ * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
+ *	consecutive packets were not acknowledged by the peer
  * @__NL80211_ATTR_CQM_AFTER_LAST: internal
  * @NL80211_ATTR_CQM_MAX: highest key attribute
  */
@@ -1641,6 +1957,7 @@
 	NL80211_ATTR_CQM_RSSI_THOLD,
 	NL80211_ATTR_CQM_RSSI_HYST,
 	NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
+	NL80211_ATTR_CQM_PKT_LOSS_EVENT,
 
 	/* keep last */
 	__NL80211_ATTR_CQM_AFTER_LAST,
@@ -1649,9 +1966,9 @@
 
 /**
  * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW - The RSSI level is lower than the
+ * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
  *      configured threshold
- * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH - The RSSI is higher than the
+ * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
  *      configured threshold
  */
 enum nl80211_cqm_rssi_threshold_event {
@@ -1659,4 +1976,17 @@
 	NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
 };
 
+
+/**
+ * enum nl80211_tx_power_setting - TX power adjustment
+ * @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
+ * @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter
+ * @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter
+ */
+enum nl80211_tx_power_setting {
+	NL80211_TX_POWER_AUTOMATIC,
+	NL80211_TX_POWER_LIMITED,
+	NL80211_TX_POWER_FIXED,
+};
+
 #endif /* __LINUX_NL80211_H */

Modified: iw/branches/upstream/current/phy.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/phy.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/phy.c (original)
+++ iw/branches/upstream/current/phy.c Fri Feb  4 14:19:41 2011
@@ -1,6 +1,7 @@
 #include <stdbool.h>
 #include <errno.h>
 #include <net/if.h>
+#include <strings.h>
 
 #include <netlink/genl/genl.h>
 #include <netlink/genl/family.h>
@@ -258,3 +259,90 @@
 	NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_distance,
 	"Set appropriate coverage class for given link distance in meters.\n"
 	"Valid values: 0 - 114750");
+
+static int handle_txpower(struct nl80211_state *state,
+			  struct nl_cb *cb,
+			  struct nl_msg *msg,
+			  int argc, char **argv)
+{
+	enum nl80211_tx_power_setting type;
+	int mbm;
+
+	/* get the required args */
+	if (argc != 1 && argc != 2)
+		return 1;
+
+	if (!strcmp(argv[0], "auto"))
+		type = NL80211_TX_POWER_AUTOMATIC;
+	else if (!strcmp(argv[0], "fixed"))
+		type = NL80211_TX_POWER_FIXED;
+	else if (!strcmp(argv[0], "limit"))
+		type = NL80211_TX_POWER_LIMITED;
+	else {
+		printf("Invalid parameter: %s\n", argv[0]);
+		return 2;
+	}
+
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_TX_POWER_SETTING, type);
+
+	if (type != NL80211_TX_POWER_AUTOMATIC) {
+		if (argc != 2) {
+			printf("Missing TX power level argument.\n");
+			return 2;
+		}
+
+		mbm = atoi(argv[1]);
+		NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, mbm);
+	} else if (argc != 1)
+		return 1;
+
+	return 0;
+
+ nla_put_failure:
+	return -ENOBUFS;
+}
+COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
+	NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_txpower,
+	"Specify transmit power level and setting type.");
+COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
+	NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_txpower,
+	"Specify transmit power level and setting type.");
+
+static int handle_antenna(struct nl80211_state *state,
+			  struct nl_cb *cb,
+			  struct nl_msg *msg,
+			  int argc, char **argv)
+{
+	char *end;
+	uint32_t tx_ant = 0, rx_ant = 0;
+
+	if (argc == 1 && strcmp(argv[0], "all") == 0) {
+		tx_ant = 0xffffffff;
+		rx_ant = 0xffffffff;
+	} else if (argc == 1) {
+		tx_ant = rx_ant = strtoul(argv[0], &end, 0);
+		if (*end)
+			return 1;
+	}
+	else if (argc == 2) {
+		tx_ant = strtoul(argv[0], &end, 0);
+		if (*end)
+			return 1;
+		rx_ant = strtoul(argv[1], &end, 0);
+		if (*end)
+			return 1;
+	} else
+		return 1;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_TX, tx_ant);
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_RX, rx_ant);
+
+	return 0;
+
+ nla_put_failure:
+	return -ENOBUFS;
+}
+COMMAND(set, antenna, "<bitmap> | all | <tx bitmap> <rx bitmap>",
+	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.");

Modified: iw/branches/upstream/current/reg.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/reg.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/reg.c (original)
+++ iw/branches/upstream/current/reg.c Fri Feb  4 14:19:41 2011
@@ -132,7 +132,7 @@
 	}
 
 	alpha2 = nla_data(tb_msg[NL80211_ATTR_REG_ALPHA2]);
-	printf("country %s:\n", alpha2);
+	printf("country %c%c:\n", alpha2[0], alpha2[1]);
 
 	nla_for_each_nested(nl_rule, tb_msg[NL80211_ATTR_REG_RULES], rem_rule) {
 		struct nlattr *tb_rule[NL80211_FREQUENCY_ATTR_MAX + 1];

Modified: iw/branches/upstream/current/scan.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/scan.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/scan.c (original)
+++ iw/branches/upstream/current/scan.c Fri Feb  4 14:19:41 2011
@@ -38,19 +38,17 @@
 
 #define IEEE80211_COUNTRY_EXTENSION_ID 201
 
-struct ieee80211_country_ie_triplet {
-	union {
-		struct {
-			__u8 first_channel;
-			__u8 num_channels;
-			__s8 max_power;
-		} __attribute__ ((packed)) chans;
-		struct {
-			__u8 reg_extension_id;
-			__u8 reg_class;
-			__u8 coverage_class;
-		} __attribute__ ((packed)) ext;
-	};
+union ieee80211_country_ie_triplet {
+	struct {
+		__u8 first_channel;
+		__u8 num_channels;
+		__s8 max_power;
+	} __attribute__ ((packed)) chans;
+	struct {
+		__u8 reg_extension_id;
+		__u8 reg_class;
+		__u8 coverage_class;
+	} __attribute__ ((packed)) ext;
 } __attribute__ ((packed));
 
 static int handle_scan(struct nl80211_state *state,
@@ -204,8 +202,7 @@
 
 	while (len >= 3) {
 		int end_channel;
-		struct ieee80211_country_ie_triplet *triplet =
-			(struct ieee80211_country_ie_triplet *) data;
+		union ieee80211_country_ie_triplet *triplet = (void *) data;
 
 		if (triplet->ext.reg_extension_id >= IEEE80211_COUNTRY_EXTENSION_ID) {
 			printf("\t\tExtension ID: %d Regulatory Class: %d Coverage class: %d (up to %dm)\n",
@@ -225,7 +222,7 @@
 		else
 			end_channel =  triplet->chans.first_channel + (4 * (triplet->chans.num_channels - 1));
 
-		printf("\t\tChannels [%d - %d]\n", triplet->chans.first_channel, end_channel);
+		printf("\t\tChannels [%d - %d] @ %d dBm\n", triplet->chans.first_channel, end_channel, triplet->chans.max_power);
 
 		data += 3;
 		len -= 3;
@@ -471,6 +468,28 @@
 		len -= 2;
 	}
 
+	if (len >= 2) {
+		int pmkid_count = data[0] | (data[1] << 8);
+
+		if (len >= 2 + 16 * pmkid_count) {
+			tab_on_first(&first);
+			printf("\t * %d PMKIDs\n", pmkid_count);
+			/* not printing PMKID values */
+			data += 2 + 16 * pmkid_count;
+			len -= 2 + 16 * pmkid_count;
+		} else
+			goto invalid;
+	}
+
+	if (len >= 4) {
+		tab_on_first(&first);
+		printf("\t * Group mgmt cipher suite: ");
+		print_cipher(data);
+		printf("\n");
+		data += 4;
+		len -= 4;
+	}
+
  invalid:
 	if (len != 0) {
 		printf("\t\t * bogus tail data (%d):", len);
@@ -490,15 +509,47 @@
 
 static void print_ht_capa(const uint8_t type, uint8_t len, const uint8_t *data)
 {
-	if (len != 26) {
-		printf("\n\t\tHT Capability IE len != expected 26 bytes, skipping parse\n");
-		return;
-	}
 	printf("\n");
 	print_ht_capability(data[0] | (data[1] << 8));
 	print_ampdu_length(data[2] & 3);
 	print_ampdu_spacing((data[2] >> 2) & 7);
 	print_ht_mcs(data + 3);
+}
+
+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",
+		"20 MHz",
+		"non-HT mixed",
+	};
+	static const char *sta_chan_width[2] = {
+		"20 MHz",
+		"any",
+	};
+
+	printf("\n");
+	printf("\t\t * primary channel: %d\n", data[0]);
+	printf("\t\t * secondary channel offset: %s\n",
+		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]);
+	printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2);
+	printf("\t\t * OBSS non-GF present: %d\n", (data[2] & 0x10) >> 4);
+	printf("\t\t * dual beacon: %d\n", (data[4] & 0x40) >> 6);
+	printf("\t\t * dual CTS protection: %d\n", (data[4] & 0x80) >> 7);
+	printf("\t\t * STBC beacon: %d\n", data[5] & 0x1);
+	printf("\t\t * L-SIG TXOP Prot: %d\n", (data[5] & 0x2) >> 1);
+	printf("\t\t * PCO active: %d\n", (data[5] & 0x4) >> 2);
+	printf("\t\t * PCO phase: %d\n", (data[5] & 0x8) >> 3);
 }
 
 static void print_capabilities(const uint8_t type, uint8_t len, const uint8_t *data)
@@ -608,7 +659,8 @@
 	[7] = { "Country", print_country, 3, 255, 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, 1, 255, BIT(PRINT_SCAN), },
+	[45] = { "HT capabilities", print_ht_capa, 26, 26, BIT(PRINT_SCAN), },
+	[61] = { "HT operation", print_ht_op, 22, 22, BIT(PRINT_SCAN), },
 	[48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), },
 	[50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
 	[127] = { "Extended capabilities", print_capabilities, 0, 255, BIT(PRINT_SCAN), },

Modified: iw/branches/upstream/current/station.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/station.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/station.c (original)
+++ iw/branches/upstream/current/station.c Fri Feb  4 14:19:41 2011
@@ -48,6 +48,8 @@
 		[NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
 		[NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
 		[NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 },
+		[NL80211_STA_INFO_TX_RETRIES] = { .type = NLA_U32 },
+		[NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 },
 	};
 
 	static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
@@ -96,9 +98,18 @@
 	if (sinfo[NL80211_STA_INFO_TX_PACKETS])
 		printf("\n\ttx packets:\t%u",
 			nla_get_u32(sinfo[NL80211_STA_INFO_TX_PACKETS]));
+	if (sinfo[NL80211_STA_INFO_TX_RETRIES])
+		printf("\n\ttx retries:\t%u",
+			nla_get_u32(sinfo[NL80211_STA_INFO_TX_RETRIES]));
+	if (sinfo[NL80211_STA_INFO_TX_FAILED])
+		printf("\n\ttx failed:\t%u",
+			nla_get_u32(sinfo[NL80211_STA_INFO_TX_FAILED]));
 	if (sinfo[NL80211_STA_INFO_SIGNAL])
 		printf("\n\tsignal:  \t%d dBm",
 			(int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]));
+	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]));
 
 	if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
 		if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX,
@@ -196,6 +207,20 @@
 	NL80211_CMD_DEL_STATION, 0, CIB_NETDEV, handle_station_get,
 	"Remove the given station entry (use with caution!)");
 
+static const struct cmd *station_set_plink;
+static const struct cmd *station_set_vlan;
+
+static const struct cmd *select_station_cmd(int argc, char **argv)
+{
+	if (argc < 2)
+		return NULL;
+	if (strcmp(argv[1], "plink_action") == 0)
+		return station_set_plink;
+	if (strcmp(argv[1], "vlan") == 0)
+		return station_set_vlan;
+	return NULL;
+}
+
 static int handle_station_set_plink(struct nl80211_state *state,
 			      struct nl_cb *cb,
 			      struct nl_msg *msg,
@@ -240,9 +265,10 @@
  nla_put_failure:
 	return -ENOBUFS;
 }
-COMMAND(station, set, "<MAC address> plink_action <open|block>",
+COMMAND_ALIAS(station, set, "<MAC address> plink_action <open|block>",
 	NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set_plink,
-	"Set mesh peer link action for this station (peer).");
+	"Set mesh peer link action for this station (peer).",
+	select_station_cmd, station_set_plink);
 
 static int handle_station_set_vlan(struct nl80211_state *state,
 			      struct nl_cb *cb,
@@ -286,9 +312,10 @@
  nla_put_failure:
 	return -ENOBUFS;
 }
-COMMAND(station, set, "<MAC address> vlan <ifindex>",
+COMMAND_ALIAS(station, set, "<MAC address> vlan <ifindex>",
 	NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set_vlan,
-	"Set an AP VLAN for this station.");
+	"Set an AP VLAN for this station.",
+	select_station_cmd, station_set_vlan);
 
 
 static int handle_station_dump(struct nl80211_state *state,

Modified: iw/branches/upstream/current/survey.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/survey.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/survey.c (original)
+++ iw/branches/upstream/current/survey.c Fri Feb  4 14:19:41 2011
@@ -44,11 +44,27 @@
 	}
 
 	if (sinfo[NL80211_SURVEY_INFO_FREQUENCY])
-		printf("\tfrequency:\t%u MHz\n",
-			nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]));
+		printf("\tfrequency:\t\t\t%u MHz%s\n",
+			nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]),
+			sinfo[NL80211_SURVEY_INFO_IN_USE] ? " [in use]" : "");
 	if (sinfo[NL80211_SURVEY_INFO_NOISE])
-		printf("\tnoise:\t\t%d dBm\n",
+		printf("\tnoise:\t\t\t\t%d dBm\n",
 			(int8_t)nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME])
+		printf("\tchannel active time:\t\t%llu ms\n",
+			(unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY])
+		printf("\tchannel busy time:\t\t%llu ms\n",
+			(unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY])
+		printf("\textension channel busy time:\t%llu ms\n",
+			(unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX])
+		printf("\tchannel receive time:\t\t%llu ms\n",
+			(unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]));
+	if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX])
+		printf("\tchannel transmit time:\t\t%llu ms\n",
+			(unsigned long long)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]));
 	return NL_SKIP;
 }
 

Modified: iw/branches/upstream/current/util.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/util.c?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/util.c (original)
+++ iw/branches/upstream/current/util.c Fri Feb  4 14:19:41 2011
@@ -93,7 +93,9 @@
 	"AP/VLAN",
 	"WDS",
 	"monitor",
-	"mesh point"
+	"mesh point",
+	"P2P-client",
+	"P2P-GO",
 };
 
 static char modebuf[100];
@@ -166,6 +168,10 @@
 	[NL80211_CMD_REGISTER_ACTION] = "register_action",
 	[NL80211_CMD_ACTION] = "action",
 	[NL80211_CMD_SET_CHANNEL] = "set_channel",
+	[NL80211_CMD_SET_WDS_PEER] = "set_wds_peer",
+	[NL80211_CMD_FRAME_WAIT_CANCEL] = "frame_wait_cancel",
+	[NL80211_CMD_JOIN_MESH] = "join_mesh",
+	[NL80211_CMD_LEAVE_MESH] = "leave_mesh",
 };
 
 static char cmdbuf[100];

Modified: iw/branches/upstream/current/version.sh
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/version.sh?rev=1565&op=diff
==============================================================================
--- iw/branches/upstream/current/version.sh (original)
+++ iw/branches/upstream/current/version.sh Fri Feb  4 14:19:41 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-VERSION="0.9.20"
+VERSION="0.9.22"
 OUT="$1"
 
 echo '#include "iw.h"' > "$OUT"




More information about the Pkg-wpa-devel mailing list