[pkg-wpa-devel] r1606 - in /iw/branches/upstream/current: Makefile info.c nl80211.h roc.c util.c version.sh wowlan.c

slh-guest at users.alioth.debian.org slh-guest at users.alioth.debian.org
Fri Sep 9 22:22:55 UTC 2011


Author: slh-guest
Date: Fri Sep  9 22:22:55 2011
New Revision: 1606

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

Added:
    iw/branches/upstream/current/roc.c
Modified:
    iw/branches/upstream/current/Makefile
    iw/branches/upstream/current/info.c
    iw/branches/upstream/current/nl80211.h
    iw/branches/upstream/current/util.c
    iw/branches/upstream/current/version.sh
    iw/branches/upstream/current/wowlan.c

Modified: iw/branches/upstream/current/Makefile
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/Makefile?rev=1606&op=diff
==============================================================================
--- iw/branches/upstream/current/Makefile (original)
+++ iw/branches/upstream/current/Makefile Fri Sep  9 22:22:55 2011
@@ -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
+	bitrate.o wowlan.o roc.o
 OBJS += sections.o
 ALL = iw
 

Modified: iw/branches/upstream/current/info.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/info.c?rev=1606&op=diff
==============================================================================
--- iw/branches/upstream/current/info.c (original)
+++ iw/branches/upstream/current/info.c Fri Sep  9 22:22:55 2011
@@ -315,6 +315,11 @@
 			[NL80211_WOWLAN_TRIG_PKT_PATTERN] = {
 				.minlen = sizeof(struct nl80211_wowlan_pattern_support),
 			},
+			[NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED] = { .type = NLA_FLAG },
+			[NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE] = { .type = NLA_FLAG },
+			[NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST] = { .type = NLA_FLAG },
+			[NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE] = { .type = NLA_FLAG },
+			[NL80211_WOWLAN_TRIG_RFKILL_RELEASE] = { .type = NLA_FLAG },
 		};
 		struct nl80211_wowlan_pattern_support *pat;
 		int err;
@@ -328,16 +333,26 @@
 		} else {
 			printf("\n");
 			if (tb_wowlan[NL80211_WOWLAN_TRIG_ANY])
-				printf("\t\t * any (device continues operating)\n");
+				printf("\t\t * wake up on anything (device continues operating normally)\n");
 			if (tb_wowlan[NL80211_WOWLAN_TRIG_DISCONNECT])
-				printf("\t\t * disconnect\n");
+				printf("\t\t * wake up on disconnect\n");
 			if (tb_wowlan[NL80211_WOWLAN_TRIG_MAGIC_PKT])
-				printf("\t\t * magic packet\n");
+				printf("\t\t * wake up on magic packet\n");
 			if (tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]) {
 				pat = nla_data(tb_wowlan[NL80211_WOWLAN_TRIG_PKT_PATTERN]);
-				printf("\t\t * up to %u patterns of %u-%u bytes\n",
+				printf("\t\t * wake up on pattern match, up to %u patterns of %u-%u bytes\n",
 					pat->max_patterns, pat->min_pattern_len, pat->max_pattern_len);
 			}
+			if (tb_wowlan[NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED])
+				printf("\t\t * can do GTK rekeying\n");
+			if (tb_wowlan[NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE])
+				printf("\t\t * wake up on GTK rekey failure\n");
+			if (tb_wowlan[NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST])
+				printf("\t\t * wake up on EAP identity request\n");
+			if (tb_wowlan[NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE])
+				printf("\t\t * wake up on 4-way handshake\n");
+			if (tb_wowlan[NL80211_WOWLAN_TRIG_RFKILL_RELEASE])
+				printf("\t\t * wake up on rfkill release\n");
 		}
 	}
 

Modified: iw/branches/upstream/current/nl80211.h
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/nl80211.h?rev=1606&op=diff
==============================================================================
--- iw/branches/upstream/current/nl80211.h (original)
+++ iw/branches/upstream/current/nl80211.h Fri Sep  9 22:22:55 2011
@@ -247,7 +247,8 @@
  *	passed, all channels allowed for the current regulatory domain
  *	are used.  Extra IEs can also be passed from the userspace by
  *	using the %NL80211_ATTR_IE attribute.
- * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan
+ * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan.  Returns -ENOENT
+ *	if scheduled scan is not running.
  * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
  *	results available.
  * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
@@ -483,6 +484,14 @@
  *	more background information, see
  *	http://wireless.kernel.org/en/users/Documentation/WoWLAN.
  *
+ * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
+ *	the necessary information for supporting GTK rekey offload. This
+ *	feature is typically used during WoWLAN. The configuration data
+ *	is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
+ *	contains the data in sub-attributes). After rekeying happened,
+ *	this command may also be sent by the driver as an MLME event to
+ *	inform userspace of the new replay counter.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -604,6 +613,8 @@
 	NL80211_CMD_STOP_SCHED_SCAN,
 	NL80211_CMD_SCHED_SCAN_RESULTS,
 	NL80211_CMD_SCHED_SCAN_STOPPED,
+
+	NL80211_CMD_SET_REKEY_OFFLOAD,
 
 	/* add new commands above here */
 
@@ -745,8 +756,12 @@
  *
  * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
  *	a single scan request, a wiphy attribute.
+ * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
+ *	scan with a single scheduled scan request, a wiphy attribute.
  * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
  *	that can be added to a scan request
+ * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
+ *	elements that can be added to a scheduled scan request
  *
  * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
  * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
@@ -978,8 +993,8 @@
  *	driving the peer link management state machine.
  *	@NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled.
  *
- * @NL80211_ATTR_WOWLAN_SUPPORTED: indicates, as part of the wiphy capabilities,
- *	the supported WoWLAN triggers
+ * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
+ *	capabilities, the supported WoWLAN triggers
  * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
  *	indicate which WoW triggers should be enabled. This is also
  *	used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
@@ -996,6 +1011,9 @@
  *	are managed in software: interfaces of these types aren't subject to
  *	any restrictions in their number or combinations.
  *
+ * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information
+ *	necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -1193,6 +1211,11 @@
 
 	NL80211_ATTR_INTERFACE_COMBINATIONS,
 	NL80211_ATTR_SOFTWARE_IFTYPES,
+
+	NL80211_ATTR_REKEY_DATA,
+
+	NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
+	NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
 
 	/* add attributes here, update the policy in nl80211.c */
 
@@ -2239,6 +2262,16 @@
  *
  *	In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
  *	carrying a &struct nl80211_wowlan_pattern_support.
+ * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
+ *	used when setting, used only to indicate that GTK rekeying is supported
+ *	by the device (flag)
+ * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
+ *	done by the device) (flag)
+ * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
+ *	packet (flag)
+ * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
+ * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
+ *	(on devices that have rfkill in the device) (flag)
  * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
  * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
  */
@@ -2248,6 +2281,11 @@
 	NL80211_WOWLAN_TRIG_DISCONNECT,
 	NL80211_WOWLAN_TRIG_MAGIC_PKT,
 	NL80211_WOWLAN_TRIG_PKT_PATTERN,
+	NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
+	NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
+	NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
+	NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
+	NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
 
 	/* keep last */
 	NUM_NL80211_WOWLAN_TRIG,
@@ -2361,4 +2399,28 @@
 	MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
 };
 
+#define NL80211_KCK_LEN			16
+#define NL80211_KEK_LEN			16
+#define NL80211_REPLAY_CTR_LEN		8
+
+/**
+ * enum nl80211_rekey_data - attributes for GTK rekey offload
+ * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
+ * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
+ * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
+ * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
+ * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
+ * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
+ */
+enum nl80211_rekey_data {
+	__NL80211_REKEY_DATA_INVALID,
+	NL80211_REKEY_DATA_KEK,
+	NL80211_REKEY_DATA_KCK,
+	NL80211_REKEY_DATA_REPLAY_CTR,
+
+	/* keep last */
+	NUM_NL80211_REKEY_DATA,
+	MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
+};
+
 #endif /* __LINUX_NL80211_H */

Added: iw/branches/upstream/current/roc.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/roc.c?rev=1606&op=file
==============================================================================
--- iw/branches/upstream/current/roc.c (added)
+++ iw/branches/upstream/current/roc.c Fri Sep  9 22:22:55 2011
@@ -1,0 +1,40 @@
+#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(roc);
+
+static int handle_roc_start(struct nl80211_state *state, struct nl_cb *cb,
+			    struct nl_msg *msg, int argc, char **argv)
+{
+	char *end;
+	int freq, time;
+
+	if (argc != 2)
+		return 1;
+
+	freq = strtol(argv[0], &end, 0);
+	if (!end || *end)
+		return 1;
+
+	time = strtol(argv[1], &end, 0);
+	if (!end || *end)
+		return 1;
+
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
+	NLA_PUT_U32(msg, NL80211_ATTR_DURATION, time);
+	return 0;
+ nla_put_failure:
+	return -ENOBUFS;
+}
+
+COMMAND(roc, start, "<freq> <time>", NL80211_CMD_REMAIN_ON_CHANNEL, 0, CIB_NETDEV, handle_roc_start, "");

Modified: iw/branches/upstream/current/util.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/util.c?rev=1606&op=diff
==============================================================================
--- iw/branches/upstream/current/util.c (original)
+++ iw/branches/upstream/current/util.c Fri Sep  9 22:22:55 2011
@@ -208,6 +208,7 @@
 	[NL80211_CMD_FRAME_WAIT_CANCEL] = "frame_wait_cancel",
 	[NL80211_CMD_JOIN_MESH] = "join_mesh",
 	[NL80211_CMD_LEAVE_MESH] = "leave_mesh",
+	[NL80211_CMD_SET_REKEY_OFFLOAD] = "set_rekey_offload",
 };
 
 static char cmdbuf[100];

Modified: iw/branches/upstream/current/version.sh
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/version.sh?rev=1606&op=diff
==============================================================================
--- iw/branches/upstream/current/version.sh (original)
+++ iw/branches/upstream/current/version.sh Fri Sep  9 22:22:55 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-VERSION="3.0"
+VERSION="3.1"
 OUT="$1"
 
 if head=`git rev-parse --verify HEAD 2>/dev/null`; then

Modified: iw/branches/upstream/current/wowlan.c
URL: http://svn.debian.org/wsvn/iw/branches/upstream/current/wowlan.c?rev=1606&op=diff
==============================================================================
--- iw/branches/upstream/current/wowlan.c (original)
+++ iw/branches/upstream/current/wowlan.c Fri Sep  9 22:22:55 2011
@@ -40,6 +40,14 @@
 				NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT);
 			else if (strcmp(argv[0], "magic-packet") == 0)
 				NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT);
+			else if (strcmp(argv[0], "gtk-rekey-failure") == 0)
+				NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE);
+			else if (strcmp(argv[0], "eap-identity-request") == 0)
+				NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST);
+			else if (strcmp(argv[0], "4way-handshake") == 0)
+				NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE);
+			else if (strcmp(argv[0], "rfkill-release") == 0)
+				NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE);
 			else if (strcmp(argv[0], "patterns") == 0) {
 				parse_state = PS_PAT;
 				patterns = nlmsg_alloc();
@@ -81,7 +89,8 @@
 	nlmsg_free(patterns);
 	return err;
 }
-COMMAND(wowlan, enable, "[any] [disconnect] [magic-packet] [patterns <pattern>*]",
+COMMAND(wowlan, enable, "[any] [disconnect] [magic-packet] [gtk-rekey-failure] [eap-identity-request]"
+	" [4way-handshake] [rfkill-release] [patterns <pattern>*]",
 	NL80211_CMD_SET_WOWLAN, 0, CIB_PHY, handle_wowlan_enable,
 	"Enable WoWLAN with the given triggers.\n"
 	"Each pattern is given as a bytestring with '-' in places where any byte\n"
@@ -128,6 +137,14 @@
 		printf(" * wake up on disconnect\n");
 	if (trig[NL80211_WOWLAN_TRIG_MAGIC_PKT])
 		printf(" * wake up on magic packet\n");
+	if (trig[NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE])
+		printf(" * wake up on GTK rekeying failure\n");
+	if (trig[NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST])
+		printf(" * wake up on EAP identity request\n");
+	if (trig[NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE])
+		printf(" * wake up on 4-way handshake\n");
+	if (trig[NL80211_WOWLAN_TRIG_RFKILL_RELEASE])
+		printf(" * wake up on RF-kill release\n");
 	if (trig[NL80211_WOWLAN_TRIG_PKT_PATTERN]) {
 		nla_for_each_nested(pattern,
 				    trig[NL80211_WOWLAN_TRIG_PKT_PATTERN],




More information about the Pkg-wpa-devel mailing list