Project import
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a6268a8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,124 @@
+#
+# Copyright (c) 2010-2011 Nest, Inc.
+# All rights reserved.
+#
+# This document is the property of Nest. It is considered
+# confidential and proprietary information.
+#
+# This document may not be reproduced or transmitted in any form,
+# in whole or in part, without the express written permission of
+# Nest.
+#
+# Description:
+# This file is for iw, a library and set of utilities for
+# manipulating Linux nl80211-based wireless network interfaces.
+#
+
+
+include pre.mak
+
+PackageRoot := ./$(IwPackageName)
+PackageExtension := tar.bz2
+PackageSeparator :=
+PackageVersion :=
+
+PackagePatchArgs := -p1
+
+PackageArchive := $(IwPackageName)/$(IwPackageName).$(PackageExtension)
+PackageSourceDir := $(IwPackageName)/$(IwPackageName)$(PackageSeparator)$(PackageVersion)
+PackagePatchDir := $(IwPackageName)/$(IwPackageName).patches
+
+PackageBuildMakefile = $(call GenerateBuildPaths,Makefile)
+
+LicenseSourceFile := COPYING
+LicenseSourcePath := $(addprefix $(PackageSourceDir)/,$(LicenseSourceFile))
+
+CleanPaths += $(PackageLicenseFile)
+
+NetlinkDir := sw/tps/libnl
+NetlinkIncDir := $(call GenerateResultPaths,$(NetlinkDir),usr/include)
+NetlinkLibDir := $(call GenerateResultPaths,$(NetlinkDir),usr/lib)
+
+SOURCEDIRS = $(PackageSourceDir)
+$(PackageSourceDir)_RULE_TARGET = $(BuildDirectory)/configure
+
+all: $(PackageDefaultGoal)
+
+# Generate the package license contents.
+
+$(LicenseSourcePath): $(BuildDirectory)/source
+
+$(PackageLicenseFile): $(LicenseSourcePath)
+ $(copy-result)
+
+# Extract the source from the archive and apply patches, if any.
+
+$(PackageSourceDir): $(PackageArchive) $(PackagePatchPaths)
+ $(call expand-archive,$(PackageArchive),$(PackageRoot))
+ $(Verbose)touch $@
+ $(call patch-directory,$(PackageSourceDir),$(PackagePatchArgs),$(PackagePatchPaths))
+
+# Prepare the sources.
+
+$(BuildDirectory)/source: | $(PackageSourceDir)
+ $(Verbose)touch $@
+
+# Patch the sources, if necessary.
+
+$(BuildDirectory)/patch: $(BuildDirectory)/source
+ $(Verbose)touch $@
+
+# Generate the package build makefile.
+
+# Configure the source for building.
+
+$(BuildDirectory)/configure: $(BuildDirectory)/source | $(PackageSourceDir) $(BuildDirectory)
+ $(call create-links,$(CURDIR)/$(PackageSourceDir),$(BuildDirectory))
+ $(Verbose)touch $@
+
+# Build the source.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+$(BuildDirectory)/build: $(BuildDirectory)/configure | $(BuildDirectory)
+ $(Verbose)unset MAKEFLAGS && \
+ $(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+ CC="$(CC)" CXX="$(CXX)" AR=$(AR) NM=$(NM) RANLIB=$(RANLIB) STRIP=$(STRIP) \
+ INSTALL="$(INSTALL) $(INSTALLFLAGS)" \
+ NLLIBNAME="libnl-2.0" \
+ NLCFLAGS="$(call ToolGenerateIncludeArgument,$(NetlinkIncDir))" \
+ NLLDFLAGS="-L$(NetlinkLibDir)" \
+ all
+ $(Verbose)touch $@
+
+# Stage the build to a temporary installation area.
+#
+# We have to unset MAKEFLAGS since they confuse the package build otherwise.
+
+.PHONY: stage
+stage: $(BuildDirectory)/stage-default $(BuildDirectory)/stage-headers
+
+$(BuildDirectory)/stage-default: $(BuildDirectory)/build | $(ResultDirectory)
+ $(Verbose)unset MAKEFLAGS && \
+ $(MAKE) $(JOBSFLAG) -C $(BuildDirectory) \
+ NLLIBNAME="libnl-2.0" \
+ DESTDIR=$(ResultDirectory) \
+ install
+ $(Verbose)touch $@
+
+ResultHeaderDir = $(ResultDirectory)/usr/include
+SourceHeaderPaths = $(wildcard $(BuildDirectory)/*.h)
+
+$(ResultHeaderDir):
+ $(create-directory)
+
+$(BuildDirectory)/stage-headers: $(BuildDirectory)/build | $(ResultHeaderDir)
+ install --mode=0664 $(SourceHeaderPaths) $(ResultHeaderDir)
+ $(Verbose)touch $@
+
+clean:
+ $(Verbose)$(RM) $(RMFLAGS) -r $(PackageSourceDir)
+ $(Verbose)$(RM) $(RMFLAGS) -r $(BuildDirectory)
+ $(Verbose)$(RM) $(RMFLAGS) -r $(ResultDirectory)
+
+include post.mak
diff --git a/iw.url b/iw.url
new file mode 100644
index 0000000..a3891cc
--- /dev/null
+++ b/iw.url
@@ -0,0 +1 @@
+git://git.sipsolutions.net/iw.git
diff --git a/iw.version b/iw.version
new file mode 100644
index 0000000..ea3f0d7
--- /dev/null
+++ b/iw.version
@@ -0,0 +1 @@
+0.9.22
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-50.description b/iw_0.9.22/iw_0.9.22.patches/iw-50.description
new file mode 100644
index 0000000..ec9fb0f
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-50.description
@@ -0,0 +1,3 @@
+This patch synchronizes the version script with the like script from the rfkill package and eliminates the GIT repository label version
+checking because it will invariably fail when the package is included as a subtree or submodule of a larger GIT repository.
+
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-50.patch b/iw_0.9.22/iw_0.9.22.patches/iw-50.patch
new file mode 100644
index 0000000..fa623cc
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-50.patch
@@ -0,0 +1,33 @@
+diff -aruN a/version.sh b/version.sh
+--- a/version.sh 2011-11-04 03:53:29.000000000 -0700
++++ b/version.sh 2011-12-15 14:17:51.000000000 -0800
+@@ -1,20 +1,17 @@
+ #!/bin/sh
+
+ VERSION="0.9.22"
+-OUT="$1"
+-
+-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+- git update-index --refresh --unmerged > /dev/null
+- descr=$(git describe)
+
+- # on git builds check that the version number above
+- # is correct...
+- [ "${descr%%-*}" = "v$VERSION" ] || exit 2
++SUFFIX=
++if test "x$1" = x--suffix; then
++ shift
++ SUFFIX="-$1"
++ shift
++fi
++OUT="$1"
+
+- v="${descr#v}"
+- if git diff-index --name-only HEAD | read dummy ; then
+- v="$v"-dirty
+- fi
++if test "x$SUFFIX" != 'x'; then
++ v="$VERSION$SUFFIX"
+ else
+ v="$VERSION"
+ fi
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-51.description b/iw_0.9.22/iw_0.9.22.patches/iw-51.description
new file mode 100644
index 0000000..7edbcbe
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-51.description
@@ -0,0 +1 @@
+This patch allows the package builder to specify the libnl version being built against externally to pkg-config.
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-51.patch b/iw_0.9.22/iw_0.9.22.patches/iw-51.patch
new file mode 100644
index 0000000..05d300f
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-51.patch
@@ -0,0 +1,57 @@
+diff -aruN iw-0.9.22/Makefile iw-0.9.22.N/Makefile
+--- iw-0.9.22/Makefile 2013-06-07 18:36:50.000000000 -0700
++++ iw-0.9.22.N/Makefile 2013-06-10 12:09:36.006767045 -0700
+@@ -22,6 +22,31 @@
+ OBJS += sections.o
+ ALL = iw
+
++ifdef NLLIBNAME
++
++NLLIBS = -lnl
++
++ifeq ($(NLLIBNAME),libnl-1)
++NL1FOUND := Y
++endif
++
++ifeq ($(NLLIBNAME),libnl-2.0)
++NL2FOUND := Y
++endif
++
++ifdef NLCFLAGS
++CFLAGS += $(NLCFLAGS)
++endif
++
++ifdef NLLDFLAGS
++LDFLAGS += $(NLLDFLAGS)
++endif
++
++ifdef NLLIBS
++LIBS += $(NLLIBS)
++endif
++
++else
+ NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
+ NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
+
+@@ -30,8 +55,6 @@
+ endif
+
+ ifeq ($(NL2FOUND),Y)
+-CFLAGS += -DCONFIG_LIBNL20
+-LIBS += -lnl-genl
+ NLLIBNAME = libnl-2.0
+ endif
+
+@@ -41,6 +64,12 @@
+
+ LIBS += $(shell $(PKG_CONFIG) --libs $(NLLIBNAME))
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags $(NLLIBNAME))
++endif
++
++ifeq ($(NL2FOUND),Y)
++CFLAGS += -DCONFIG_LIBNL20
++LIBS += -lnl-genl
++endif
+
+ ifeq ($(V),1)
+ Q=
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-52.description b/iw_0.9.22/iw_0.9.22.patches/iw-52.description
new file mode 100644
index 0000000..7157b47
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-52.description
@@ -0,0 +1 @@
+This patch adds the ability to add/delete/start/stop device side tcp keep alives using iw
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-52.patch b/iw_0.9.22/iw_0.9.22.patches/iw-52.patch
new file mode 100644
index 0000000..6a4e7dd
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-52.patch
@@ -0,0 +1,397 @@
+diff -aruN iw_0.9.22/keepalive.c iw_0.9.22.N/keepalive.c
+--- iw_0.9.22/keepalive.c 1969-12-31 16:00:00.000000000 -0800
++++ iw_0.9.22.N/keepalive.c 2015-03-27 17:02:09.738162006 -0700
+@@ -0,0 +1,287 @@
++#include <net/if.h>
++#include <errno.h>
++#include <string.h>
++#include <stdlib.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"
++
++typedef uint8_t u8;
++typedef uint16_t u16;
++typedef uint32_t u32;
++
++#define CFG80211_KEEP_ALIVE_PAYLOAD_MAX_LENGTH 64
++
++struct cfg80211_keepalive_request {
++ u32 interval;
++ u8 cmd; /* 0: ADD; 1: DEL: 2: START; 3: STOP */
++ u8 index;
++ u8 trig;
++ u8 dst_macaddr[ETH_ALEN];
++ u8 payload_len;
++ u8 payload[CFG80211_KEEP_ALIVE_PAYLOAD_MAX_LENGTH];
++};
++
++struct cfg80211_keepalive_request keepalive_req;
++
++SECTION(keepalive);
++
++static void keepalive_hex_dump(char *title, u8 *buf, size_t len)
++{
++ int i;
++
++ printf("%s - hexdump(len=%lu):", title, (unsigned long) len);
++
++ for (i = 0; i < len; i++)
++ printf(" %02x", buf[i]);
++ printf("\n");
++}
++
++static int nl80211_parse_klv_req(const char *s)
++{
++ long i;
++ char *endp;
++
++ i = strtol(s, &endp, 10);
++
++ if(endp == s)
++ return -1;
++ return i;
++}
++
++static int nl80211_str2hex(u8 *src, u8 *dst, int src_len)
++{
++ int i, bytecount=0;
++
++ if (src_len & 0x01)
++ return -2;
++
++ for (i=0; i<src_len; i++, src++) {
++ if (i != 0 && i%2 == 0) {
++ dst++;
++ bytecount++;
++ } else {
++ *dst <<= 4;
++ }
++
++ if ((*src >= '0') && (*src <= '9'))
++ *dst += *src - '0';
++ else if ((*src >= 'A') && (*src <= 'F'))
++ *dst += *src - 'A' + 10;
++ else if ((*src >= 'a') && (*src <= 'f'))
++ *dst += *src - 'a' + 10;
++ else {
++ return -1;
++ }
++ }
++
++ bytecount++;
++
++ return bytecount;
++}
++
++static int build_klv_req(struct nl_msg *msg, int klv_cmd, u8 index, int interval, u8 trig, u8 *dst_macaddr, u8 payload_len, u8 *payload)
++{
++ int ret = -1;
++
++ if (!msg)
++ return -1;
++
++ NLA_PUT_U32(msg, NL80211_ATTR_KLV_TYPE, klv_cmd);
++ NLA_PUT_U32(msg, NL80211_ATTR_KLV_INDEX, index);
++
++ if (klv_cmd == 0 || klv_cmd == 1) {
++
++ NLA_PUT_U32(msg, NL80211_ATTR_KLV_INTVL, interval);
++ NLA_PUT_U32 (msg, NL80211_ATTR_KLV_TRIG, trig);
++
++ if (payload != NULL) {
++ if (dst_macaddr) {
++ keepalive_hex_dump("nl80211 klv_dstmac: ", dst_macaddr, ETH_ALEN);
++ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst_macaddr);
++ }
++
++ keepalive_hex_dump("nl80211 klv_payload: ", payload, payload_len);
++ NLA_PUT(msg, NL80211_ATTR_KLV_PAYLOAD, payload_len, payload);
++ }
++ }
++
++ ret = 0;
++
++ nla_put_failure:
++ return ret;
++}
++
++static int nl80211_change_klv_req(char **cmdptr, int cmdtype, struct nl_msg *msg)
++{
++ u8 index = 1, trig_type = 1, payload_len = 0;
++ u8 dst_macaddr[ETH_ALEN];
++ u32 interval_ms = 10;
++ u8 *payload=NULL;
++ int val;
++ u8 dst_payload[64];
++
++ switch(cmdtype) {
++ case 0: /* KLV-ADD */
++ val = nl80211_parse_klv_req(*cmdptr++);
++ /* valid index # is [1, 3]. Index #0 is reserved for driver internal use */
++ if (val <= 0 || val > 3) {
++ printf("invalid index (%d)\n", val);
++ return -1;
++ }
++ index = val;
++
++ val = nl80211_parse_klv_req(*cmdptr++);
++ /* limit klv interval to [10 ms, 50000 ms] */
++ if (val < 1000 || val > 55000) {
++ printf("Keeplalive interval is out of range.\n");
++ return -1;
++ }
++ interval_ms = val;
++
++ val = nl80211_parse_klv_req(*cmdptr++);
++ /* valid trig type is limited to 0 or 1 */
++ if (val < 0 || val > 1) {
++ printf("Invalid keepalive trigger type.\n");
++ return -1;
++ }
++ trig_type = val;
++
++ memset(dst_macaddr, 0, ETH_ALEN);
++ if (nl80211_str2hex((u8 *)(*cmdptr++), dst_macaddr, 2*ETH_ALEN) <= 0) {
++ printf("Invalid mac address\n");
++ return -1;
++ }
++
++ val = strlen(*cmdptr); /* klv payload length must be <= 64 bytes */
++ if (val > 128) {
++ printf("Payload is too long\n");
++ return -1;
++ }
++
++ memset(dst_payload, 0, 64);
++ if ((payload_len=nl80211_str2hex((u8 *)(*cmdptr), dst_payload, val)) < 0) {
++ printf("Keepalive payload is invalid\n");
++ return -1;
++ }
++
++ break;
++
++ case 1: /* KLV-DEL */
++ index = nl80211_parse_klv_req(cmdptr[0]);
++ printf("index = %d\n", index);
++ /* index #0 is reserved for driver internal klv type */
++ if (index <= 0 || index > 3) {
++ return -1;
++ }
++
++ interval_ms = 10000;
++ break;
++
++ case 2: /* KLV-START */
++ case 3: /* KLV-STOP */
++ break;
++
++ case 4: /* KLV-SHOW */
++ printf("Not supported\n");
++ val = 0;
++ return val;
++
++ default:
++ return -1;
++ }
++
++ val = build_klv_req(msg, cmdtype, index, interval_ms, trig_type, &dst_macaddr[0], payload_len, dst_payload);
++
++ return val;
++}
++
++static int handle_keepalive_add(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv)
++{
++ int ret;
++
++ if (argc != 5) {
++ printf("Command parameters incorrect.\n");
++ return -1;
++ }
++
++ ret = nl80211_change_klv_req(argv, 0, msg);
++ printf("ret is %d\n", ret);
++ return ret;
++}
++
++static int handle_keepalive_delete(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv)
++{
++ int ret;
++
++ if (argc != 1) {
++ printf("Command parameters incorrect.\n");
++ return -1;
++ }
++
++ ret = nl80211_change_klv_req(argv, 1, msg);
++ return ret;
++}
++
++static int handle_keepalive_start(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv)
++{
++ int ret;
++ ret = nl80211_change_klv_req(argv, 2, msg);
++ return ret;
++}
++
++static int handle_keepalive_stop(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv)
++{
++ int ret;
++ ret = nl80211_change_klv_req(argv, 3, msg);
++ return ret;
++}
++
++static int print_keepalive_handler(struct nl_msg *msg, void *arg)
++{
++ int *ret = arg;
++ if (arg != NULL)
++ *ret = 0;
++ return 0;
++}
++
++static int handle_keepalive_show(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv)
++{
++ int ret;
++
++ printf("handle_keepalive_show\n");
++ nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
++ print_keepalive_handler, &ret);
++
++ return 0;
++}
++
++COMMAND(keepalive, add, "<index> <interval> <trigger_type> <dst_macaddr> <payload>",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_add,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, del, "<index>",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_delete,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, start, "",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_start,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, stop, "",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_stop,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, show, "", NL80211_CMD_GET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_show,
++ "Show keepalive status.");
+diff -aruN iw_0.9.22/Makefile iw_0.9.22.N/Makefile
+--- iw_0.9.22/Makefile 2015-03-27 17:09:36.094185681 -0700
++++ iw_0.9.22.N/Makefile 2015-03-27 17:02:09.738162006 -0700
+@@ -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 keepalive.o
+ OBJS += sections.o
+ ALL = iw
+
+diff -aruN iw_0.9.22/nl80211.h iw_0.9.22.N/nl80211.h
+--- iw_0.9.22/nl80211.h 2013-06-07 18:36:50.000000000 -0700
++++ iw_0.9.22.N/nl80211.h 2015-03-27 17:06:38.766176275 -0700
+@@ -616,6 +616,8 @@
+
+ NL80211_CMD_SET_REKEY_OFFLOAD,
+
++ NL80211_CMD_GET_KEEPALIVE,
++ NL80211_CMD_SET_KEEPALIVE,
+ /* add new commands above here */
+
+ /* used to define NL80211_CMD_MAX below */
+@@ -1217,6 +1219,81 @@
+ NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
+ NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
+
++ NL80211_ATTR_SCAN_SUPP_RATES,
++
++ NL80211_ATTR_HIDDEN_SSID,
++
++ NL80211_ATTR_IE_PROBE_RESP,
++ NL80211_ATTR_IE_ASSOC_RESP,
++
++ NL80211_ATTR_STA_WME,
++ NL80211_ATTR_SUPPORT_AP_UAPSD,
++
++ NL80211_ATTR_ROAM_SUPPORT,
++
++ NL80211_ATTR_SCHED_SCAN_MATCH,
++ NL80211_ATTR_MAX_MATCH_SETS,
++
++ NL80211_ATTR_PMKSA_CANDIDATE,
++
++ NL80211_ATTR_TX_NO_CCK_RATE,
++
++ NL80211_ATTR_TDLS_ACTION,
++ NL80211_ATTR_TDLS_DIALOG_TOKEN,
++ NL80211_ATTR_TDLS_OPERATION,
++ NL80211_ATTR_TDLS_SUPPORT,
++ NL80211_ATTR_TDLS_EXTERNAL_SETUP,
++
++ NL80211_ATTR_DEVICE_AP_SME,
++
++ NL80211_ATTR_DONT_WAIT_FOR_ACK,
++
++ NL80211_ATTR_FEATURE_FLAGS,
++
++ NL80211_ATTR_PROBE_RESP_OFFLOAD,
++
++ NL80211_ATTR_PROBE_RESP,
++
++ NL80211_ATTR_DFS_REGION,
++
++ NL80211_ATTR_DISABLE_HT,
++ NL80211_ATTR_HT_CAPABILITY_MASK,
++
++ NL80211_ATTR_NOACK_MAP,
++
++ NL80211_ATTR_INACTIVITY_TIMEOUT,
++
++ NL80211_ATTR_RX_SIGNAL_DBM,
++
++ NL80211_ATTR_BG_SCAN_PERIOD,
++
++ NL80211_ATTR_WDEV,
++
++ NL80211_ATTR_USER_REG_HINT_TYPE,
++
++ /* leave some room for new attributes in nl80211 updates */
++ NL80211_ATTR_IM_SCAN_RESULT = NL80211_ATTR_BG_SCAN_PERIOD + 10,
++ NL80211_ATTR_IM_SCAN_RESULT_MIN_RSSI,
++
++ NL80211_ATTR_SCAN_MIN_DWELL,
++ NL80211_ATTR_SCAN_MAX_DWELL,
++ NL80211_ATTR_SCAN_NUM_PROBE,
++
++ NL80211_ATTR_SCHED_SCAN_SHORT_INTERVAL,
++ NL80211_ATTR_SCHED_SCAN_NUM_SHORT_INTERVALS,
++
++ NL80211_ATTR_ROAMING_DISABLED,
++ NL80211_ATTR_CH_SWITCH_COUNT,
++ NL80211_ATTR_CH_SWITCH_BLOCK_TX,
++ NL80211_ATTR_CH_SWITCH_POST_BLOCK_TX,
++
++ NL80211_ATTR_KLVDATA,
++ NL80211_ATTR_KLV_TYPE,
++ NL80211_ATTR_KLV_INTVL,
++ NL80211_ATTR_KLV_INDEX,
++ NL80211_ATTR_KLV_TRIG,
++ NL80211_ATTR_KLV_PAYLOAD,
++
+ /* add attributes here, update the policy in nl80211.c */
+
+ __NL80211_ATTR_AFTER_LAST,
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-54.description b/iw_0.9.22/iw_0.9.22.patches/iw-54.description
new file mode 100644
index 0000000..3a401f0
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-54.description
@@ -0,0 +1 @@
+Add the enums for drop action for wow filters. iw latest version still does not define these enumerations. These defines are taken from nl80211.h sitting in compat-wireless directory.
diff --git a/iw_0.9.22/iw_0.9.22.patches/iw-54.patch b/iw_0.9.22/iw_0.9.22.patches/iw-54.patch
new file mode 100644
index 0000000..451e280
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.patches/iw-54.patch
@@ -0,0 +1,35 @@
+diff --git a/nl80211.h b/nl80211.h
+index 7ba71e4..3ef44f1 100644
+--- a/nl80211.h
++++ b/nl80211.h
+@@ -2222,12 +2222,30 @@ enum nl80211_wowlan_packet_pattern_attr {
+ __NL80211_WOWLAN_PKTPAT_INVALID,
+ NL80211_WOWLAN_PKTPAT_MASK,
+ NL80211_WOWLAN_PKTPAT_PATTERN,
++ NL80211_WOWLAN_PKTPAT_ACTION = NL80211_WOWLAN_PKTPAT_PATTERN + 10,
+
+ NUM_NL80211_WOWLAN_PKTPAT,
+ MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
+ };
+
+ /**
++ * enum nl80211_wowlan_action - WoWLAN packet pattern action
++ * @NL80211_WOWLAN_ACTION_ALLOW: this pattern should wake up the host
++ * and the packet should be forwarded to the host unless this packet
++ * matches a DROP rule.
++ * @NL80211_WOWLAN_ACTION_DROP: a packet containing this pattern shouldn't
++ * wake up the host.
++ */
++enum nl80211_wowlan_action {
++ NL80211_WOWLAN_ACTION_ALLOW,
++ NL80211_WOWLAN_ACTION_DROP,
++
++ /* keep last */
++ NUM_NL80211_WOWLAN_ACTION,
++ MAX_NL80211_WOWLAN_ACTION = NUM_NL80211_WOWLAN_ACTION - 1,
++};
++
++/**
+ * struct nl80211_wowlan_pattern_support - pattern support information
+ * @max_patterns: maximum number of patterns supported
+ * @min_pattern_len: minimum length of each pattern
diff --git a/iw_0.9.22/iw_0.9.22.tar.bz2 b/iw_0.9.22/iw_0.9.22.tar.bz2
new file mode 100644
index 0000000..dcb1533
--- /dev/null
+++ b/iw_0.9.22/iw_0.9.22.tar.bz2
Binary files differ
diff --git a/iw_3.10/iw_3.10.patches/iw-50.description b/iw_3.10/iw_3.10.patches/iw-50.description
new file mode 100644
index 0000000..ec9fb0f
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-50.description
@@ -0,0 +1,3 @@
+This patch synchronizes the version script with the like script from the rfkill package and eliminates the GIT repository label version
+checking because it will invariably fail when the package is included as a subtree or submodule of a larger GIT repository.
+
diff --git a/iw_3.10/iw_3.10.patches/iw-50.patch b/iw_3.10/iw_3.10.patches/iw-50.patch
new file mode 100644
index 0000000..364439b
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-50.patch
@@ -0,0 +1,33 @@
+diff -aruN iw-3.10/version.sh iw-3.10.n/version.sh
+--- iw-3.10/version.sh 2013-05-02 00:29:10.000000000 -0700
++++ iw-3.10.n/version.sh 2015-03-24 12:24:03.355548918 -0700
+@@ -1,20 +1,17 @@
+ #!/bin/sh
+
+ VERSION="3.10"
+-OUT="$1"
+-
+-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+- git update-index --refresh --unmerged > /dev/null
+- descr=$(git describe)
+
+- # on git builds check that the version number above
+- # is correct...
+- [ "${descr%%-*}" = "v$VERSION" ] || exit 2
++SUFFIX=
++if test "x$1" = x--suffix; then
++ shift
++ SUFFIX="-$1"
++ shift
++fi
++OUT="$1"
+
+- v="${descr#v}"
+- if git diff-index --name-only HEAD | read dummy ; then
+- v="$v"-dirty
+- fi
++if test "x$SUFFIX" != 'x'; then
++ v="$VERSION$SUFFIX"
+ else
+ v="$VERSION"
+ fi
diff --git a/iw_3.10/iw_3.10.patches/iw-51.description b/iw_3.10/iw_3.10.patches/iw-51.description
new file mode 100644
index 0000000..7edbcbe
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-51.description
@@ -0,0 +1 @@
+This patch allows the package builder to specify the libnl version being built against externally to pkg-config.
diff --git a/iw_3.10/iw_3.10.patches/iw-51.patch b/iw_3.10/iw_3.10.patches/iw-51.patch
new file mode 100644
index 0000000..471d120
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-51.patch
@@ -0,0 +1,82 @@
+diff -aruN iw-3.10/Makefile iw-3.10.n/Makefile
+--- iw-3.10/Makefile 2013-05-02 00:29:10.000000000 -0700
++++ iw-3.10.n/Makefile 2015-03-24 12:35:45.731563338 -0700
+@@ -25,6 +25,31 @@
+
+ ALL = iw
+
++ifdef NLLIBNAME
++
++NLLIBS = -lnl
++
++ifeq ($(NLLIBNAME),libnl-1)
++NL1FOUND := Y
++endif
++
++ifeq ($(NLLIBNAME),libnl-2.0)
++NL2FOUND := Y
++endif
++
++ifdef NLCFLAGS
++CFLAGS += $(NLCFLAGS)
++endif
++
++ifdef NLLDFLAGS
++LDFLAGS += $(NLLDFLAGS)
++endif
++
++ifdef NLLIBS
++LIBS += $(NLLIBS)
++endif
++
++else
+ ifeq ($(NO_PKG_CONFIG),)
+ NL3xFOUND := $(shell $(PKG_CONFIG) --atleast-version=3.2 libnl-3.0 && echo Y)
+ ifneq ($(NL3xFOUND),Y)
+@@ -39,14 +64,13 @@
+ endif
+ endif
+ endif
++endif
+
+ ifeq ($(NL1FOUND),Y)
+ NLLIBNAME = libnl-1
+ endif
+
+ ifeq ($(NL2FOUND),Y)
+-CFLAGS += -DCONFIG_LIBNL20
+-LIBS += -lnl-genl
+ NLLIBNAME = libnl-2.0
+ endif
+
+@@ -80,6 +104,11 @@
+ CFLAGS += $(shell $(PKG_CONFIG) --cflags $(NLLIBNAME))
+ endif # NO_PKG_CONFIG
+
++ifeq ($(NL2FOUND),Y)
++CFLAGS += -DCONFIG_LIBNL20
++LIBS += -lnl-genl
++endif
++
+ ifeq ($(V),1)
+ Q=
+ NQ=true
+@@ -88,7 +117,17 @@
+ NQ=echo
+ endif
+
+-all: $(ALL)
++all: version_check $(ALL)
++
++version_check:
++ifeq ($(NL2FOUND),Y)
++else
++ifeq ($(NL1FOUND),Y)
++else
++ $(error No libnl found)
++endif
++endif
++
+
+ VERSION_OBJS := $(filter-out version.o, $(OBJS))
+
diff --git a/iw_3.10/iw_3.10.patches/iw-52.description b/iw_3.10/iw_3.10.patches/iw-52.description
new file mode 100644
index 0000000..7157b47
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-52.description
@@ -0,0 +1 @@
+This patch adds the ability to add/delete/start/stop device side tcp keep alives using iw
diff --git a/iw_3.10/iw_3.10.patches/iw-52.patch b/iw_3.10/iw_3.10.patches/iw-52.patch
new file mode 100644
index 0000000..dc07013
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-52.patch
@@ -0,0 +1,329 @@
+diff -aruN iw-3.10/keepalive.c iw-3.10.n/keepalive.c
+--- iw-3.10/keepalive.c 1969-12-31 16:00:00.000000000 -0800
++++ iw-3.10.n/keepalive.c 2015-03-24 12:39:02.019567368 -0700
+@@ -0,0 +1,286 @@
++#include <net/if.h>
++#include <errno.h>
++#include <string.h>
++#include <stdlib.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"
++
++typedef uint8_t u8;
++typedef uint16_t u16;
++typedef uint32_t u32;
++
++#define CFG80211_KEEP_ALIVE_PAYLOAD_MAX_LENGTH 64
++
++struct cfg80211_keepalive_request {
++ u32 interval;
++ u8 cmd; /* 0: ADD; 1: DEL: 2: START; 3: STOP */
++ u8 index;
++ u8 trig;
++ u8 dst_macaddr[ETH_ALEN];
++ u8 payload_len;
++ u8 payload[CFG80211_KEEP_ALIVE_PAYLOAD_MAX_LENGTH];
++};
++
++struct cfg80211_keepalive_request keepalive_req;
++
++SECTION(keepalive);
++
++static void keepalive_hex_dump(char *title, u8 *buf, size_t len)
++{
++ int i;
++
++ printf("%s - hexdump(len=%lu):", title, (unsigned long) len);
++
++ for (i = 0; i < len; i++)
++ printf(" %02x", buf[i]);
++ printf("\n");
++}
++
++static int nl80211_parse_klv_req(const char *s)
++{
++ long i;
++ char *endp;
++
++ i = strtol(s, &endp, 10);
++
++ if(endp == s)
++ return -1;
++ return i;
++}
++
++static int nl80211_str2hex(u8 *src, u8 *dst, int src_len)
++{
++ int i, bytecount=0;
++
++ if (src_len & 0x01)
++ return -2;
++
++ for (i=0; i<src_len; i++, src++) {
++ if (i != 0 && i%2 == 0) {
++ dst++;
++ bytecount++;
++ } else {
++ *dst <<= 4;
++ }
++
++ if ((*src >= '0') && (*src <= '9'))
++ *dst += *src - '0';
++ else if ((*src >= 'A') && (*src <= 'F'))
++ *dst += *src - 'A' + 10;
++ else if ((*src >= 'a') && (*src <= 'f'))
++ *dst += *src - 'a' + 10;
++ else {
++ return -1;
++ }
++ }
++
++ bytecount++;
++
++ return bytecount;
++}
++
++static int build_klv_req(struct nl_msg *msg, int klv_cmd, u8 index, int interval, u8 trig, u8 *dst_macaddr, u8 payload_len, u8 *payload)
++{
++ int ret = -1;
++
++ if (!msg)
++ return -1;
++
++ NLA_PUT_U32(msg, NL80211_ATTR_KLV_TYPE, klv_cmd);
++ NLA_PUT_U32(msg, NL80211_ATTR_KLV_INDEX, index);
++
++ if (klv_cmd == 0 || klv_cmd == 1) {
++
++ NLA_PUT_U32(msg, NL80211_ATTR_KLV_INTVL, interval);
++ NLA_PUT_U32 (msg, NL80211_ATTR_KLV_TRIG, trig);
++
++ if (payload != NULL) {
++ if (dst_macaddr) {
++ keepalive_hex_dump("nl80211 klv_dstmac: ", dst_macaddr, ETH_ALEN);
++ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst_macaddr);
++ }
++
++ keepalive_hex_dump("nl80211 klv_payload: ", payload, payload_len);
++ NLA_PUT(msg, NL80211_ATTR_KLV_PAYLOAD, payload_len, payload);
++ }
++ }
++
++ ret = 0;
++
++ nla_put_failure:
++ return ret;
++}
++
++static int nl80211_change_klv_req(char **cmdptr, int cmdtype, struct nl_msg *msg)
++{
++ u8 index = 1, trig_type = 1, payload_len = 0;
++ u8 dst_macaddr[ETH_ALEN];
++ u32 interval_ms = 10;
++ int val;
++ u8 dst_payload[64];
++
++ switch(cmdtype) {
++ case 0: /* KLV-ADD */
++ val = nl80211_parse_klv_req(*cmdptr++);
++ /* valid index # is [1, 3]. Index #0 is reserved for driver internal use */
++ if (val <= 0 || val > 3) {
++ printf("invalid index (%d)\n", val);
++ return -1;
++ }
++ index = val;
++
++ val = nl80211_parse_klv_req(*cmdptr++);
++ /* limit klv interval to [10 ms, 50000 ms] */
++ if (val < 1000 || val > 55000) {
++ printf("Keeplalive interval is out of range.\n");
++ return -1;
++ }
++ interval_ms = val;
++
++ val = nl80211_parse_klv_req(*cmdptr++);
++ /* valid trig type is limited to 0 or 1 */
++ if (val < 0 || val > 1) {
++ printf("Invalid keepalive trigger type.\n");
++ return -1;
++ }
++ trig_type = val;
++
++ memset(dst_macaddr, 0, ETH_ALEN);
++ if (nl80211_str2hex((u8 *)(*cmdptr++), dst_macaddr, 2*ETH_ALEN) <= 0) {
++ printf("Invalid mac address\n");
++ return -1;
++ }
++
++ val = strlen(*cmdptr); /* klv payload length must be <= 64 bytes */
++ if (val > 128) {
++ printf("Payload is too long\n");
++ return -1;
++ }
++
++ memset(dst_payload, 0, 64);
++ if ((payload_len=nl80211_str2hex((u8 *)(*cmdptr), dst_payload, val)) < 0) {
++ printf("Keepalive payload is invalid\n");
++ return -1;
++ }
++
++ break;
++
++ case 1: /* KLV-DEL */
++ index = nl80211_parse_klv_req(cmdptr[0]);
++ printf("index = %d\n", index);
++ /* index #0 is reserved for driver internal klv type */
++ if (index <= 0 || index > 3) {
++ return -1;
++ }
++
++ interval_ms = 10000;
++ break;
++
++ case 2: /* KLV-START */
++ case 3: /* KLV-STOP */
++ break;
++
++ case 4: /* KLV-SHOW */
++ printf("Not supported\n");
++ val = 0;
++ return val;
++
++ default:
++ return -1;
++ }
++
++ val = build_klv_req(msg, cmdtype, index, interval_ms, trig_type, &dst_macaddr[0], payload_len, dst_payload);
++
++ return val;
++}
++
++static int handle_keepalive_add(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv, enum id_input id)
++{
++ int ret;
++
++ if (argc != 5) {
++ printf("Command parameters incorrect.\n");
++ return -1;
++ }
++
++ ret = nl80211_change_klv_req(argv, 0, msg);
++ printf("ret is %d\n", ret);
++ return ret;
++}
++
++static int handle_keepalive_delete(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv, enum id_input id)
++{
++ int ret;
++
++ if (argc != 1) {
++ printf("Command parameters incorrect.\n");
++ return -1;
++ }
++
++ ret = nl80211_change_klv_req(argv, 1, msg);
++ return ret;
++}
++
++static int handle_keepalive_start(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv, enum id_input id)
++{
++ int ret;
++ ret = nl80211_change_klv_req(argv, 2, msg);
++ return ret;
++}
++
++static int handle_keepalive_stop(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv, enum id_input id)
++{
++ int ret;
++ ret = nl80211_change_klv_req(argv, 3, msg);
++ return ret;
++}
++
++static int print_keepalive_handler(struct nl_msg *msg, void *arg)
++{
++ int *ret = arg;
++ if (arg != NULL)
++ *ret = 0;
++ return 0;
++}
++
++static int handle_keepalive_show(struct nl80211_state *state, struct nl_cb *cb,
++ struct nl_msg *msg, int argc, char **argv, enum id_input id)
++{
++ int ret;
++
++ printf("handle_keepalive_show\n");
++ nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM,
++ print_keepalive_handler, &ret);
++
++ return 0;
++}
++
++COMMAND(keepalive, add, "<index> <interval> <trigger_type> <dst_macaddr> <payload>",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_add,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, del, "<index>",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_delete,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, start, "",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_start,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, stop, "",
++ NL80211_CMD_SET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_stop,
++ "Configure keep alive feature");
++
++COMMAND(keepalive, show, "", NL80211_CMD_GET_KEEPALIVE, 0, CIB_NETDEV, handle_keepalive_show,
++ "Show keepalive status.");
+diff -aruN iw-3.10/Makefile iw-3.10.n/Makefile
+--- iw-3.10/Makefile 2015-03-24 12:38:14.411566390 -0700
++++ iw-3.10.n/Makefile 2015-03-24 12:39:23.491567809 -0700
+@@ -16,7 +16,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 p2p.o
++ bitrate.o wowlan.o roc.o p2p.o keepalive.o
+ OBJS += sections.o
+
+ OBJS-$(HWSIM) += hwsim.o
+diff -aruN iw-3.10/nl80211.h iw-3.10.n/nl80211.h
+--- iw-3.10/nl80211.h 2013-05-02 00:29:10.000000000 -0700
++++ iw-3.10.n/nl80211.h 2015-03-24 12:43:33.115572934 -0700
+@@ -772,6 +772,9 @@
+
+ NL80211_CMD_SET_REKEY_OFFLOAD,
+
++ NL80211_CMD_GET_KEEPALIVE,
++ NL80211_CMD_SET_KEEPALIVE,
++
+ NL80211_CMD_PMKSA_CANDIDATE,
+
+ NL80211_CMD_TDLS_OPER,
+@@ -1727,6 +1730,13 @@
+ NL80211_ATTR_CRIT_PROT_ID,
+ NL80211_ATTR_MAX_CRIT_PROT_DURATION,
+
++ NL80211_ATTR_KLVDATA,
++ NL80211_ATTR_KLV_TYPE,
++ NL80211_ATTR_KLV_INTVL,
++ NL80211_ATTR_KLV_INDEX,
++ NL80211_ATTR_KLV_TRIG,
++ NL80211_ATTR_KLV_PAYLOAD,
++
+ /* add attributes here, update the policy in nl80211.c */
+
+ __NL80211_ATTR_AFTER_LAST,
diff --git a/iw_3.10/iw_3.10.patches/iw-53.description b/iw_3.10/iw_3.10.patches/iw-53.description
new file mode 100644
index 0000000..3a401f0
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-53.description
@@ -0,0 +1 @@
+Add the enums for drop action for wow filters. iw latest version still does not define these enumerations. These defines are taken from nl80211.h sitting in compat-wireless directory.
diff --git a/iw_3.10/iw_3.10.patches/iw-53.patch b/iw_3.10/iw_3.10.patches/iw-53.patch
new file mode 100644
index 0000000..e327e90
--- /dev/null
+++ b/iw_3.10/iw_3.10.patches/iw-53.patch
@@ -0,0 +1,36 @@
+diff --git a/nl80211.h b/nl80211.h
+index 7ba71e4..3ef44f1 100644
+--- a/nl80211.h
++++ b/nl80211.h
+@@ -2222,12 +2222,30 @@ enum nl80211_wowlan_packet_pattern_attr {
+ __NL80211_WOWLAN_PKTPAT_INVALID,
+ NL80211_WOWLAN_PKTPAT_MASK,
+ NL80211_WOWLAN_PKTPAT_PATTERN,
+ NL80211_WOWLAN_PKTPAT_OFFSET,
++ NL80211_WOWLAN_PKTPAT_ACTION = NL80211_WOWLAN_PKTPAT_PATTERN + 10,
+
+ NUM_NL80211_WOWLAN_PKTPAT,
+ MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1,
+ };
+
+ /**
++ * enum nl80211_wowlan_action - WoWLAN packet pattern action
++ * @NL80211_WOWLAN_ACTION_ALLOW: this pattern should wake up the host
++ * and the packet should be forwarded to the host unless this packet
++ * matches a DROP rule.
++ * @NL80211_WOWLAN_ACTION_DROP: a packet containing this pattern shouldn't
++ * wake up the host.
++ */
++enum nl80211_wowlan_action {
++ NL80211_WOWLAN_ACTION_ALLOW,
++ NL80211_WOWLAN_ACTION_DROP,
++
++ /* keep last */
++ NUM_NL80211_WOWLAN_ACTION,
++ MAX_NL80211_WOWLAN_ACTION = NUM_NL80211_WOWLAN_ACTION - 1,
++};
++
++/**
+ * struct nl80211_wowlan_pattern_support - pattern support information
+ * @max_patterns: maximum number of patterns supported
+ * @min_pattern_len: minimum length of each pattern
diff --git a/iw_3.10/iw_3.10.tar.bz2 b/iw_3.10/iw_3.10.tar.bz2
new file mode 100644
index 0000000..686eea5
--- /dev/null
+++ b/iw_3.10/iw_3.10.tar.bz2
Binary files differ
diff --git a/iw_3.10/iw_3.10.version b/iw_3.10/iw_3.10.version
new file mode 100644
index 0000000..14ab818
--- /dev/null
+++ b/iw_3.10/iw_3.10.version
@@ -0,0 +1 @@
+fe424b2465118eca166b2e901b5a378bf9582fb0