Browse Source

Switch to Barrier Breaker

Matthias Schiffer 9 years ago
parent
commit
e164bac87a
45 changed files with 613 additions and 5842 deletions
  1. 4 3
      Makefile
  2. 4 4
      include/Makefile.image
  3. 2 1
      include/config
  4. 1 1
      include/gluon.mk
  5. 18 3
      include/toplevel.mk
  6. 6 0
      include/verbose.mk
  7. 3 3
      modules
  8. 8 16
      patches/openwrt/0001-tools-Makefile-fix-host-tools-build-dependencies.patch
  9. 0 19
      patches/openwrt/0002-Make-Unifi-images-flashable.patch
  10. 107 0
      patches/openwrt/0002-procd-add-support-for-alternative-rc.d-directories.patch
  11. 0 379
      patches/openwrt/0003-Update-netifd-and-its-dependencies-from-Barrier-Breaker-r41888.patch
  12. 0 283
      patches/openwrt/0004-Update-odhcp6c-from-Barrier-Breaker-r41830.patch
  13. 0 22
      patches/openwrt/0005-package-base-files-change-sysctl-handling.patch
  14. 0 39
      patches/openwrt/0006-Fix-ping6-sender-address.patch
  15. 0 246
      patches/openwrt/0007-ar71xx-add-kernel-support-for-the-TL-WDR3500-board.patch
  16. 0 48
      patches/openwrt/0008-ar71xx-add-user-space-support-for-TL-WDR3500-board.patch
  17. 0 55
      patches/openwrt/0009-ar71xx-build-image-for-the-TL-WDR3500-board.patch
  18. 0 23
      patches/openwrt/0010-ar71xx-add-default-switch-configuration-for-the-TL-WDR3500.patch
  19. 0 20
      patches/openwrt/0011-ar71xx-add-diag-support-for-the-TL-WDR3500.patch
  20. 0 53
      patches/openwrt/0012-ar71xx-remove-numeric-suffix-of-the-TL-WDR3500-USB-LED.patch
  21. 0 21
      patches/openwrt/0013-ar71xx-fix-USB-power-GPIO-on-the-TL-WDR3500.patch
  22. 0 27
      patches/openwrt/0014-ar71xx-add-default-LED-configuration-for-the-WL-WRD3500.patch
  23. 0 42
      patches/openwrt/0015-ar71xx-fix-ethernet-LEDs-on-the-TL-WDR3500.patch
  24. 0 38
      patches/openwrt/0016-ar71xx-add-GPIO-output-select-values-for-AR934x.patch
  25. 0 2201
      patches/openwrt/0017-Backport-hostapd-from-Barrier-Breaker-r41029.patch
  26. 0 546
      patches/openwrt/0018-ar71xx-add-support-for-QCA953x-SoC.patch
  27. 0 297
      patches/openwrt/0019-ar71xx-add-support-for-the-TP-LINK-TL-WR841N-ND-v9.patch
  28. 0 427
      patches/openwrt/0020-Backport-support-for-TL-WR842N-v2-and-TL-MR3420-v2.patch
  29. 0 110
      patches/openwrt/0021-x86-add-grub2-iso-support.patch
  30. 0 24
      patches/openwrt/0022-x86-explicitely-pass-staging-directory-to-grub-mkimage-instead-of-relying-on-build-time-defaults-12821.patch
  31. 0 57
      patches/openwrt/0023-grub2-Add-sub-package-grub-editenv-for-target-installation.patch
  32. 0 37
      patches/openwrt/0024-x86-Fix-CONFIG_X86_GRUB_SERIAL.patch
  33. 0 218
      patches/openwrt/0025-grub2-update-to-2.02-beta2-fixes-mac-os-x-10.9-support-and-many-other-things.patch
  34. 0 20
      patches/openwrt/0026-grub2-disable-libdevmapper-fix-build-when-it-s-available.patch
  35. 0 20
      patches/openwrt/0027-grub2-disable-mkfont-fix-build-on-Archlinux.patch
  36. 0 155
      patches/openwrt/0028-ar71xx-add-support-for-dlink-dir-615-e1.patch
  37. 0 19
      patches/openwrt/0029-iptables-avoid-file-conflicts-due-to-unneeded-libip6t_-.so-in-ip6tables-package.patch
  38. 0 73
      patches/openwrt/0030-mac80211-add-another-ath9k-patch.patch
  39. 0 30
      patches/openwrt/0031-Reduce-fw3-log-spam-in-netifd-scripts.patch
  40. 242 124
      targets/ar71xx-generic/kernel-config
  41. 1 1
      targets/ar71xx-generic/kernel-vermagic
  42. 2 2
      targets/ar71xx-generic/profiles.mk
  43. 1 1
      targets/targets.mk
  44. 213 133
      targets/x86-generic/kernel-config
  45. 1 1
      targets/x86-generic/kernel-vermagic

+ 4 - 3
Makefile

@@ -153,8 +153,9 @@ include $(INCLUDE_DIR)/target.mk
 prereq: FORCE
 	+$(NO_TRACE_MAKE) prereq
 
-package/lua/host/install: tools/sed/install
-gluon-tools: package/lua/host/install
+gluon-tools: FORCE
+	+$(GLUONMAKE_EARLY) tools/sed/install
+	+$(GLUONMAKE_EARLY) package/lua/host/install
 
 prepare-tmpinfo: FORCE
 	mkdir -p tmp/info
@@ -187,7 +188,7 @@ prepare-target: FORCE
 	for dir in build_dir dl staging_dir tmp; do \
 		mkdir -p $(GLUON_ORIGOPENWRTDIR)/$$dir; \
 	done
-	for link in build_dir Config.in dl include Makefile package rules.mk scripts staging_dir target tmp toolchain tools; do \
+	for link in build_dir config Config.in dl include Makefile package rules.mk scripts staging_dir target tmp toolchain tools; do \
 		ln -sf $(GLUON_ORIGOPENWRTDIR)/$$link $(GLUON_OPENWRTDIR); \
 	done
 	+$(GLUONMAKE_EARLY) feeds

+ 4 - 4
include/Makefile.image

@@ -1,7 +1,7 @@
-override BuildImage :=
+override define BuildImage
+prepare: FORCE
+	$(call Image/Prepare)
+endef
 
 # The Makefile included here is $(TOPDIR)/target/linux/$(BOARD)/image/Makefile
 include Makefile
-
-prepare: FORCE
-	$(call Image/Prepare)

+ 2 - 1
include/config

@@ -1,3 +1,4 @@
+CONFIG_BUSYBOX_CUSTOM=y
 CONFIG_BUSYBOX_CONFIG_SHA512SUM=y
 # CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
 CONFIG_BUSYBOX_CONFIG_IP=y
@@ -11,4 +12,4 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS=y
 CONFIG_ATH_USER_REGD=y
 CONFIG_PACKAGE_ATH_DEBUG=y
 
-CONFIG_PACKAGE_luci-lib-core_srcdiet=y
+CONFIG_PACKAGE_luci-base_srcdiet=y

+ 1 - 1
include/gluon.mk

@@ -28,7 +28,7 @@ export GLUON_VERSION
 ifeq ($(OPENWRT_BUILD),1)
 ifeq ($(GLUON_TOOLS),1)
 
-CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/attitude_adjustment/12.09/%S/packages)
+CONFIG_VERSION_REPO := $(shell $(GLUONDIR)/scripts/site.sh opkg_repo || echo http://downloads.openwrt.org/barrier_breaker/14.07-rc2/%S/packages)
 export CONFIG_VERSION_REPO
 
 GLUON_SITE_CODE := $(shell $(GLUONDIR)/scripts/site.sh site_code)

+ 18 - 3
include/toplevel.mk

@@ -1,15 +1,17 @@
 # Makefile for OpenWrt
 #
-# Copyright (C) 2007-2011 OpenWrt.org
-# Copyright (C) 2013 Project Gluon
+# Copyright (C) 2007-2012 OpenWrt.org
+# Copyright (C) 2013-2014 Project Gluon
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
 #
 
-RELEASE:=Attitude Adjustment
+RELEASE:=Barrier Breaker
 PREP_MK= OPENWRT_BUILD= QUIET=0
 
+export IS_TTY=$(shell tty -s && echo 1 || echo 0)
+
 include $(GLUONDIR)/include/verbose.mk
 
 REVISION:=$(shell [ -d $(TOPDIR) ] && cd $(TOPDIR) && ./scripts/getver.sh 2>/dev/null)
@@ -39,11 +41,24 @@ unexport LPATH
 # make sure that a predefined CFLAGS variable does not disturb packages
 export CFLAGS=
 
+ifneq ($(shell $(HOSTCC) 2>&1 | grep clang),)
+  export HOSTCC_REAL?=$(HOSTCC)
+  export HOSTCC_WRAPPER:=$(TOPDIR)/scripts/clang-gcc-wrapper
+else
+  export HOSTCC_WRAPPER:=$(HOSTCC)
+endif
+
+ifeq ($(FORCE),)
+  .config scripts/config/conf scripts/config/mconf: tmp/.prereq-build
+endif
+
 SCAN_COOKIE?=$(shell echo $$$$)
 export SCAN_COOKIE
 
 SUBMAKE:=umask 022; $(SUBMAKE)
 
+ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;
+
 FORCE: ;
 
 .PHONY: FORCE

+ 6 - 0
include/verbose.mk

@@ -27,6 +27,7 @@ endif
 ifeq ($(IS_TTY),1)
   ifneq ($(strip $(NO_COLOR)),1)
     _Y:=\\033[33m
+    _R:=\\033[31m
     _N:=\\033[m
   endif
 endif
@@ -36,6 +37,10 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
 	printf "$(_Y)%s$(_N)\n" "$(1)" >&8
   endef
 
+  define ERROR_MESSAGE
+	printf "$(_R)%s$(_N)\n" "$(1)" >&8
+  endef
+
   ifeq ($(QUIET),1)
     ifneq ($(CURDIR),$(TOPDIR))
       _DIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
@@ -58,4 +63,5 @@ else
   define MESSAGE
     printf "%s\n" "$(1)"
   endef
+  ERROR_MESSAGE=$(MESSAGE)
 endif

+ 3 - 3
modules

@@ -1,14 +1,14 @@
 GLUON_FEEDS='openwrt gluon routing luci'
 
-OPENWRT_REPO=git://git.openwrt.org/12.09/openwrt.git
-OPENWRT_COMMIT=b0a05d4f7c194c7db43c3c5f1818449e4ecfe653
+OPENWRT_REPO=git://git.openwrt.org/14.07/openwrt.git
+OPENWRT_COMMIT=79465bfe7633bb92e7ea3468e9cec8bf5d4c0190
 
 PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git
 PACKAGES_OPENWRT_COMMIT=a5944176bc761a3fd233c59bad1af96165e5b60f
 PACKAGES_OPENWRT_BRANCH=for-14.07
 
 PACKAGES_GLUON_REPO=git://github.com/freifunk-gluon/packages.git
-PACKAGES_GLUON_COMMIT=1eff492575007ff8d7eb7d079a6cbd2c8979c6b7
+PACKAGES_GLUON_COMMIT=2d49f5770480d7bd612e0fa89065c52c8db7b957
 
 PACKAGES_ROUTING_REPO=git://github.com/openwrt-routing/packages.git
 PACKAGES_ROUTING_COMMIT=9d3c311fdd7dc15fd5e333b55c259fc2cf661ea2

+ 8 - 16
patches/openwrt/0001-tools-Makefile-fix-host-tools-build-dependencies.patch

@@ -1,20 +1,12 @@
 From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Wed, 7 May 2014 22:57:10 +0200
+Date: Sat, 26 Jul 2014 06:10:23 +0200
 Subject: tools/Makefile: fix host tools build dependencies
 
 diff --git a/tools/Makefile b/tools/Makefile
-index 6658f8c..26a3fb1 100644
+index 75d2b0d..ff1d299 100644
 --- a/tools/Makefile
 +++ b/tools/Makefile
-@@ -75,6 +75,7 @@ endif
- $(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
- $(curdir)/builddirs-default := $(tools-y)
- 
-+
- ifndef DUMP_TARGET_DB
- define PrepareStaging
- 	@for dir in $(1); do ( \
-@@ -86,10 +87,16 @@ define PrepareStaging
+@@ -95,10 +95,16 @@ define PrepareStaging
  endef
  
  # preparatory work
@@ -31,7 +23,7 @@ index 6658f8c..26a3fb1 100644
  
  $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
  	$(call PrepareStaging,$(STAGING_DIR_HOST))
-@@ -101,7 +108,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
+@@ -110,7 +116,7 @@ $(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
  
  
  define PrepareCommand
@@ -40,7 +32,7 @@ index 6658f8c..26a3fb1 100644
  	@mkdir -p "$$(dir $$@)"; rm -f "$$@"
  	@export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
  		echo "Command $(1) not found."; false; \
-@@ -110,7 +117,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
+@@ -119,7 +125,7 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
  endef
  endif
  
@@ -49,10 +41,10 @@ index 6658f8c..26a3fb1 100644
  	@rm -f $@
  	@if stat --version > /dev/null 2>&1; then \
  		ln -s `which stat` $@; \
-@@ -128,8 +135,8 @@ $(eval $(call PrepareCommand,seq,gseq seq))
- $(eval $(call PrepareCommand,python,python2 python))
+@@ -143,8 +149,8 @@ $(eval $(call PrepareCommand,tar,gtar tar))
+ $(eval $(call PrepareCommand,diff,gdiff diff))
  
- $(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,find md5sum cp stat seq python)
+ $(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,md5sum cp stat seq python awk getopt grep tar diff)
 -$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
 -$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
 +$(curdir)//prepare = $(staging_prepared) $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)

+ 0 - 19
patches/openwrt/0002-Make-Unifi-images-flashable.patch

@@ -1,19 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Fri, 27 Dec 2013 18:48:19 +0100
-Subject: Make Unifi images flashable
-
-diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
-index 9ebe486..8e82f7f 100644
---- a/target/linux/ar71xx/image/Makefile
-+++ b/target/linux/ar71xx/image/Makefile
-@@ -896,8 +896,8 @@ $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTAIRROUTER,ubnt-airrouter,UBNT-A
- $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTBULLETM,ubnt-bullet-m,UBNT-BM,ttyS0,115200,XM,XM,ar7240))
- $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTROCKETM,ubnt-rocket-m,UBNT-RM,ttyS0,115200,XM,XM,ar7240))
- $(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTNANOM,ubnt-nano-m,UBNT-NM,ttyS0,115200,XM,XM,ar7240))
--$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,XM,ar7240))
--$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,XM,ar7240))
-+$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,BZ,ar7240))
-+$(eval $(call SingleProfile,UBNTXM,$(fs_64k),UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,BZ,ar7240))
- 
- $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
- $(eval $(call SingleProfile,WHRHPG300N,$(fs_64k),WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))

+ 107 - 0
patches/openwrt/0002-procd-add-support-for-alternative-rc.d-directories.patch

@@ -0,0 +1,107 @@
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Wed, 6 Aug 2014 19:12:00 +0200
+Subject: procd: add support for alternative rc.d directories
+
+diff --git a/package/system/procd/patches/0001-Add-support-for-alternative-rc.d-directories.patch b/package/system/procd/patches/0001-Add-support-for-alternative-rc.d-directories.patch
+new file mode 100644
+index 0000000..bc24342
+--- /dev/null
++++ b/package/system/procd/patches/0001-Add-support-for-alternative-rc.d-directories.patch
+@@ -0,0 +1,97 @@
++From 03a2bc70e4260ec9f669391c47b9a7a9ecd0b75d Mon Sep 17 00:00:00 2001
++Message-Id: <03a2bc70e4260ec9f669391c47b9a7a9ecd0b75d.1407329621.git.mschiffer@universe-factory.net>
++From: Matthias Schiffer <mschiffer@universe-factory.net>
++Date: Wed, 6 Aug 2014 14:51:49 +0200
++Subject: [PATCH] Add support for alternative rc.d directories
++
++---
++ initd/preinit.c | 38 ++++++++++++++++++++++++++++++++++++++
++ rcS.c           |  2 +-
++ 2 files changed, 39 insertions(+), 1 deletion(-)
++
++diff --git a/initd/preinit.c b/initd/preinit.c
++index fb94527..8b832a7 100644
++--- a/initd/preinit.c
+++++ b/initd/preinit.c
++@@ -12,6 +12,8 @@
++  * GNU General Public License for more details.
++  */
++ 
+++#define _GNU_SOURCE
+++
++ #include <sys/stat.h>
++ #include <sys/types.h>
++ #include <sys/mount.h>
++@@ -46,6 +48,35 @@ check_dbglvl(void)
++ 		debug = lvl;
++ }
++ 
+++static char*
+++get_rc_d(void)
+++{
+++	size_t n = 0;
+++	ssize_t len;
+++	char *ret = NULL;
+++
+++	FILE *fp = fopen("/tmp/rc_d_path", "r");
+++
+++	if (!fp)
+++		return NULL;
+++
+++	len = getline(&ret, &n, fp);
+++
+++	fclose(fp);
+++
+++	unlink("/tmp/rc_d_path");
+++
+++	if (len <= 0) {
+++		free(ret);
+++		return NULL;
+++	}
+++
+++	if (ret[len-1] == '\n')
+++		ret[len-1] = 0;
+++
+++	return ret;
+++}
+++
++ static void
++ spawn_procd(struct uloop_process *proc, int ret)
++ {
++@@ -53,6 +84,7 @@ spawn_procd(struct uloop_process *proc, int ret)
++ 	char *argv[] = { "/sbin/procd", NULL};
++ 	struct stat s;
++ 	char dbg[2];
+++	char *rc_d_path;
++ 
++ 	if (plugd_proc.pid > 0)
++ 		kill(plugd_proc.pid, SIGKILL);
++@@ -72,6 +104,12 @@ spawn_procd(struct uloop_process *proc, int ret)
++ 		setenv("DBGLVL", dbg, 1);
++ 	}
++ 
+++	rc_d_path = get_rc_d();
+++	if (rc_d_path) {
+++		setenv("RC_D_PATH", rc_d_path, 1);
+++		free(rc_d_path);
+++	}
+++
++ 	execvp(argv[0], argv);
++ }
++ 
++diff --git a/rcS.c b/rcS.c
++index 0e1b0ba..1b00831 100644
++--- a/rcS.c
+++++ b/rcS.c
++@@ -150,7 +150,7 @@ int rcS(char *pattern, char *param, void (*q_empty)(struct runqueue *))
++ 	q.empty_cb = q_empty;
++ 	q.max_running_tasks = 1;
++ 
++-	return _rc(&q, "/etc/rc.d", pattern, "*", param);
+++	return _rc(&q, getenv("RC_D_PATH") ?: "/etc/rc.d", pattern, "*", param);
++ }
++ 
++ int rc(const char *file, char *param)
++-- 
++2.0.4
++

+ 0 - 379
patches/openwrt/0003-Update-netifd-and-its-dependencies-from-Barrier-Breaker-r41888.patch

@@ -1,379 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 11 Jan 2014 11:47:31 +0100
-Subject: Update netifd and its dependencies from Barrier Breaker (r41888)
-
-diff --git a/package/libubox/Makefile b/package/libubox/Makefile
-index bcf4481..6cbfc08 100644
---- a/package/libubox/Makefile
-+++ b/package/libubox/Makefile
-@@ -1,13 +1,13 @@
- include $(TOPDIR)/rules.mk
- 
- PKG_NAME:=libubox
--PKG_VERSION:=2013-10-19
-+PKG_VERSION:=2014-07-16
- PKG_RELEASE=$(PKG_SOURCE_VERSION)
- 
- PKG_SOURCE_PROTO:=git
--PKG_SOURCE_URL:=git://nbd.name/luci2/libubox.git
-+PKG_SOURCE_URL:=http://git.openwrt.org/project/libubox.git
- PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
--PKG_SOURCE_VERSION:=734d28eb1a46358743cf8837c91e5d46695c3b91
-+PKG_SOURCE_VERSION:=bd388d2b6c2c151bf513c1e449417d18ce02d10b
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
- PKG_MIRROR_MD5SUM:=
- CMAKE_INSTALL:=1
-@@ -26,6 +26,7 @@ define Package/libubox
-   SECTION:=libs
-   CATEGORY:=Libraries
-   TITLE:=Basic utility library
-+  ABI_VERSION:=$(PKG_VERSION)
-   DEPENDS:=
- endef
- 
-@@ -54,6 +55,13 @@ define Package/libjson-script
-   TITLE:=Minimalistic JSON based scripting engine
- endef
- 
-+define Package/libubox-lua
-+  SECTION:=libs
-+  CATEGORY:=Libraries
-+  DEPENDS:=+libubox +liblua
-+  TITLE:=Lua binding for the OpenWrt Basic utility library
-+endef
-+
- TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
- CMAKE_OPTIONS = \
- 	-DLUAPATH=/usr/lib/lua
-@@ -79,7 +87,13 @@ define Package/libjson-script/install
- 	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libjson_script.so $(1)/lib/
- endef
- 
-+define Package/libubox-lua/install
-+	$(INSTALL_DIR) $(1)/usr/lib/lua
-+	$(CP) $(PKG_BUILD_DIR)/lua/uloop.so $(1)/usr/lib/lua/
-+endef
-+
- $(eval $(call BuildPackage,libubox))
- $(eval $(call BuildPackage,libblobmsg-json))
- $(eval $(call BuildPackage,jshn))
- $(eval $(call BuildPackage,libjson-script))
-+$(eval $(call BuildPackage,libubox-lua))
-diff --git a/package/netifd/Makefile b/package/netifd/Makefile
-index 5f2ee03..faf3e09 100644
---- a/package/netifd/Makefile
-+++ b/package/netifd/Makefile
-@@ -1,13 +1,13 @@
- include $(TOPDIR)/rules.mk
- 
- PKG_NAME:=netifd
--PKG_VERSION:=2013-07-16
-+PKG_VERSION:=2014-07-29
- PKG_RELEASE=$(PKG_SOURCE_VERSION)
- 
- PKG_SOURCE_PROTO:=git
--PKG_SOURCE_URL:=git://nbd.name/luci2/netifd.git
-+PKG_SOURCE_URL:=http://git.openwrt.org/project/netifd.git
- PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
--PKG_SOURCE_VERSION:=2674941b06c1ec67f1aff1bff9212e1372106641
-+PKG_SOURCE_VERSION:=4bf89afc22b43d5bd155d32d3998348a77179c1a
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
- PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
- # PKG_MIRROR_MD5SUM:=
-@@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/cmake.mk
- define Package/netifd
-   SECTION:=base
-   CATEGORY:=Base system
--  DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn
-+  DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox
-   TITLE:=OpenWrt Network Interface Configuration Daemon
- endef
- 
-@@ -40,7 +40,7 @@ define Package/netifd/install
- 	$(INSTALL_DIR) $(1)/sbin
- 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/netifd $(1)/sbin/
- 	$(CP) ./files/* $(1)/
--	$(CP) $(PKG_BUILD_DIR)/dummy/netifd-proto.sh $(1)/lib/netifd/
-+	$(CP) $(PKG_BUILD_DIR)/scripts/* $(1)/lib/netifd/
- endef
- 
- $(eval $(call BuildPackage,netifd))
-diff --git a/package/netifd/files/etc/hotplug.d/iface/00-netstate b/package/netifd/files/etc/hotplug.d/iface/00-netstate
-index c50cda6..023025c 100644
---- a/package/netifd/files/etc/hotplug.d/iface/00-netstate
-+++ b/package/netifd/files/etc/hotplug.d/iface/00-netstate
-@@ -1,6 +1,5 @@
- [ ifup = "$ACTION" ] && {
- 	uci_toggle_state network "$INTERFACE" up 1
--	uci_toggle_state network "$INTERFACE" connect_time $(sed -ne 's![^0-9].*$!!p' /proc/uptime)
- 	[ -n "$DEVICE" ] && {
- 		uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)"
- 		uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
-diff --git a/package/netifd/files/lib/netifd/dhcp.script b/package/netifd/files/lib/netifd/dhcp.script
-index 50163da..db3fc01 100755
---- a/package/netifd/files/lib/netifd/dhcp.script
-+++ b/package/netifd/files/lib/netifd/dhcp.script
-@@ -33,9 +33,15 @@ setup_interface () {
- 	for domain in $domain; do
- 		proto_add_dns_search "$domain"
- 	done
-+
-+	proto_add_data
-+	[ -n "$ZONE" ] && json_add_string zone "$ZONE"
-+	proto_close_data
-+
- 	proto_send_update "$INTERFACE"
- 
--	if [ -n "$IFACE6RD" -a -n "$ip6rd" ]; then
-+
-+	if [ "$IFACE6RD" != 0 -a -n "$ip6rd" ]; then
- 		local v4mask="${ip6rd%% *}"
- 		ip6rd="${ip6rd#* }"
- 		local ip6rdprefixlen="${ip6rd%% *}"
-@@ -44,19 +50,24 @@ setup_interface () {
- 		ip6rd="${ip6rd#* }"
- 		local ip6rdbr="${ip6rd%% *}"
- 
--uci -q batch <<-EOF >/dev/null
--set network.$IFACE6RD.proto=6rd
--set network.$IFACE6RD.auto=0
--set network.$IFACE6RD.peeraddr=$ip6rdbr
--set network.$IFACE6RD.ip4prefixlen=$v4mask
--set network.$IFACE6RD.ip6prefix=$ip6rdprefix
--set network.$IFACE6RD.ip6prefixlen=$ip6rdprefixlen
--commit network
--EOF
--
--		ifdown "$IFACE6RD"
--		/etc/init.d/network reload
--		ifup "$IFACE6RD"
-+		[ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE)
-+		[ -z "$IFACE6RD" -o "$IFACE6RD" = 1 ] && IFACE6RD=${INTERFACE}_6rd
-+
-+		json_init
-+		json_add_string name "$IFACE6RD"
-+		json_add_string ifname "@$INTERFACE"
-+		json_add_string proto "6rd"
-+		json_add_string peeraddr "$ip6rdbr"
-+		json_add_int ip4prefixlen "$v4mask"
-+		json_add_string ip6prefix "$ip6rdprefix"
-+		json_add_int ip6prefixlen "$ip6rdprefixlen"
-+		json_add_string tunlink "$INTERFACE"
-+		[ -n "$IFACE6RD_DELEGATE" ] && json_add_boolean delegate "$IFACE6RD_DELEGATE"
-+		[ -n "$ZONE6RD" ] || ZONE6RD=$ZONE
-+		[ -n "$ZONE6RD" ] && json_add_string zone "$ZONE6RD"
-+		json_close_object
-+
-+		ubus call network add_dynamic "$(json_dump)"
- 	fi
- 
- 	# TODO
-diff --git a/package/netifd/files/lib/netifd/proto/dhcp.sh b/package/netifd/files/lib/netifd/proto/dhcp.sh
-index a270c68..b14f7be 100755
---- a/package/netifd/files/lib/netifd/proto/dhcp.sh
-+++ b/package/netifd/files/lib/netifd/proto/dhcp.sh
-@@ -5,31 +5,44 @@
- init_proto "$@"
- 
- proto_dhcp_init_config() {
--	proto_config_add_string "ipaddr"
--	proto_config_add_string "netmask"
--	proto_config_add_string "hostname"
--	proto_config_add_string "clientid"
--	proto_config_add_string "vendorid"
--	proto_config_add_boolean "broadcast"
--	proto_config_add_string "reqopts"
--	proto_config_add_string "iface6rd"
-+	renew_handler=1
-+
-+	proto_config_add_string 'ipaddr:ipaddr'
-+	proto_config_add_string 'hostname:hostname'
-+	proto_config_add_string clientid
-+	proto_config_add_string vendorid
-+	proto_config_add_boolean 'broadcast:bool'
-+	proto_config_add_string 'reqopts:list(string)'
-+	proto_config_add_string iface6rd
-+	proto_config_add_string sendopts
-+	proto_config_add_boolean delegate
-+	proto_config_add_string zone6rd
-+	proto_config_add_string zone
- }
- 
- proto_dhcp_setup() {
- 	local config="$1"
- 	local iface="$2"
- 
--	local ipaddr hostname clientid vendorid broadcast reqopts iface6rd
--	json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd
-+	local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
-+	json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
- 
- 	local opt dhcpopts
- 	for opt in $reqopts; do
- 		append dhcpopts "-O $opt"
- 	done
- 
-+	for opt in $sendopts; do
-+		append dhcpopts "-x $opt"
-+	done
-+
- 	[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
- 	[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
- 	[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
-+	[ -n "$iface6rd" ] && append dhcpopts "-O 212"
-+	[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
-+	[ -n "$zone" ] && proto_export "ZONE=$zone"
-+	[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
- 
- 	proto_export "INTERFACE=$config"
- 	proto_run_command "$config" udhcpc \
-@@ -42,10 +55,16 @@ proto_dhcp_setup() {
- 		$clientid $broadcast $dhcpopts
- }
- 
-+proto_dhcp_renew() {
-+	local interface="$1"
-+	# SIGUSR1 forces udhcpc to renew its lease
-+	local sigusr1="$(kill -l SIGUSR1)"
-+	[ -n "$sigusr1" ] && proto_kill_command "$interface" $sigusr1
-+}
-+
- proto_dhcp_teardown() {
- 	local interface="$1"
- 	proto_kill_command "$interface"
- }
- 
- add_protocol dhcp
--
-diff --git a/package/netifd/patches/001-musl_af_inet_include.patch b/package/netifd/patches/001-musl_af_inet_include.patch
-new file mode 100644
-index 0000000..510ee05
---- /dev/null
-+++ b/package/netifd/patches/001-musl_af_inet_include.patch
-@@ -0,0 +1,11 @@
-+diff -urN netifd-2012-10-29/utils.c netifd-2012-10-29.new/utils.c
-+--- netifd-2012-10-29/utils.c	2012-11-23 17:15:39.000000000 +0100
-++++ netifd-2012-10-29.new/utils.c	2012-11-23 17:16:53.409244361 +0100
-+@@ -17,6 +17,7 @@
-+ 
-+ #include <arpa/inet.h>
-+ #include <netinet/in.h>
-++#include <sys/socket.h>
-+ 
-+ void
-+ __vlist_simple_init(struct vlist_simple_tree *tree, int offset)
-diff --git a/package/netifd/patches/002-fix_compile_with_old_includes.patch b/package/netifd/patches/002-fix_compile_with_old_includes.patch
-new file mode 100644
-index 0000000..361b2d1
---- /dev/null
-+++ b/package/netifd/patches/002-fix_compile_with_old_includes.patch
-@@ -0,0 +1,34 @@
-+--- a/system-linux.c
-++++ b/system-linux.c
-+@@ -43,6 +43,31 @@
-+ #define RTN_FAILED_POLICY 12
-+ #endif
-+ 
-++
-++#ifndef IFLA_IPTUN_MAX
-++enum {
-++        IFLA_IPTUN_UNSPEC,
-++        IFLA_IPTUN_LINK,
-++        IFLA_IPTUN_LOCAL,
-++        IFLA_IPTUN_REMOTE,
-++        IFLA_IPTUN_TTL,
-++        IFLA_IPTUN_TOS,
-++        IFLA_IPTUN_ENCAP_LIMIT,
-++        IFLA_IPTUN_FLOWINFO,
-++        IFLA_IPTUN_FLAGS,
-++        IFLA_IPTUN_PROTO,
-++        IFLA_IPTUN_PMTUDISC,
-++        IFLA_IPTUN_6RD_PREFIX,
-++        IFLA_IPTUN_6RD_RELAY_PREFIX,
-++        IFLA_IPTUN_6RD_PREFIXLEN,
-++        IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
-++        __IFLA_IPTUN_MAX,
-++};
-++#define IFLA_IPTUN_MAX  (__IFLA_IPTUN_MAX - 1)
-++#endif
-++
-++
-++
-+ #include <string.h>
-+ #include <fcntl.h>
-+ #include <glob.h>
-diff --git a/package/ubus/Makefile b/package/ubus/Makefile
-index be18fb5..ba96b3b 100644
---- a/package/ubus/Makefile
-+++ b/package/ubus/Makefile
-@@ -1,13 +1,13 @@
- include $(TOPDIR)/rules.mk
- 
- PKG_NAME:=ubus
--PKG_VERSION:=2013-08-08
-+PKG_VERSION:=2014-07-03
- PKG_RELEASE=$(PKG_SOURCE_VERSION)
- 
- PKG_SOURCE_PROTO:=git
- PKG_SOURCE_URL:=git://nbd.name/luci2/ubus.git
- PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
--PKG_SOURCE_VERSION:=b20a8a01c7faea5bcc9d34d10dcf7736589021b8
-+PKG_SOURCE_VERSION:=f688c7ad0b2435a89bfd13f5496cabf596b54c8f
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
- PKG_MIRROR_MD5SUM:=
- CMAKE_INSTALL:=1
-@@ -38,6 +38,7 @@ define Package/libubus
-   SECTION:=libs
-   CATEGORY:=Libraries
-   DEPENDS:=+libubox
-+  ABI_VERSION:=$(PKG_VERSION)
-   TITLE:=OpenWrt RPC client library
- endef
- 
-@@ -66,7 +67,7 @@ endef
- 
- define Package/libubus/install
- 	$(INSTALL_DIR) $(1)/lib
--	$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/lib/
-+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/lib/
- endef
- 
- define Package/libubus-lua/install
-@@ -74,8 +75,7 @@ define Package/libubus-lua/install
- 	$(CP) $(PKG_BUILD_DIR)/lua/ubus.so $(1)/usr/lib/lua/
- endef
- 
--$(eval $(call BuildPackage,ubus))
--$(eval $(call BuildPackage,ubusd))
- $(eval $(call BuildPackage,libubus))
- $(eval $(call BuildPackage,libubus-lua))
--
-+$(eval $(call BuildPackage,ubus))
-+$(eval $(call BuildPackage,ubusd))
-diff --git a/package/uci/Makefile b/package/uci/Makefile
-index 54ad80b..29f9ef3 100644
---- a/package/uci/Makefile
-+++ b/package/uci/Makefile
-@@ -1,5 +1,5 @@
- #
--# Copyright (C) 2008-2013 OpenWrt.org
-+# Copyright (C) 2008-2014 OpenWrt.org
- #
- # This is free software, licensed under the GNU General Public License v2.
- # See /LICENSE for more information.
-@@ -7,13 +7,13 @@
- 
- include $(TOPDIR)/rules.mk
- 
--UCI_VERSION=2013-06-11
-+UCI_VERSION=2014-04-11
- UCI_RELEASE=1
- 
- PKG_NAME:=uci
- PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
- PKG_RELEASE:=1
--PKG_REV:=c9c9d5cb085acc58b6579ace83fb79c085a9db27
-+PKG_REV:=e339407372ffc70b1451e4eda218c01aa95a6a7f
- 
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
- PKG_SOURCE_URL:=git://nbd.name/uci.git

+ 0 - 283
patches/openwrt/0004-Update-odhcp6c-from-Barrier-Breaker-r41830.patch

@@ -1,283 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 11 Jan 2014 11:47:58 +0100
-Subject: Update odhcp6c from Barrier Breaker (r41830)
-
-diff --git a/package/odhcp6c/Makefile b/package/odhcp6c/Makefile
-index e767064..3ec58e1 100644
---- a/package/odhcp6c/Makefile
-+++ b/package/odhcp6c/Makefile
-@@ -8,26 +8,55 @@
- include $(TOPDIR)/rules.mk
- 
- PKG_NAME:=odhcp6c
--PKG_VERSION:=2013-10-02
--PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
-+PKG_VERSION:=2014-07-21
-+PKG_RELEASE=$(PKG_SOURCE_VERSION)
- 
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
- PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
- PKG_SOURCE_URL:=git://github.com/sbyx/odhcp6c.git
- PKG_SOURCE_PROTO:=git
--PKG_SOURCE_VERSION:=357ecc1f5163bc7f74c64f4bca387e8d44a2eac5
-+PKG_SOURCE_VERSION:=67b311ab81736b35858664219d345844ab08fcc7
- PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
- 
- include $(INCLUDE_DIR)/package.mk
- include $(INCLUDE_DIR)/cmake.mk
- 
-+ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_prefix_class),0)
-+  CMAKE_OPTIONS += -DEXT_PREFIX_CLASS=$(CONFIG_PACKAGE_odhcp6c_ext_prefix_class)
-+endif
-+
-+ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_cer_id),0)
-+  CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcp6c_ext_cer_id)
-+endif
-+
-+ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_s46),0)
-+  CMAKE_OPTIONS += -DEXT_S46=$(CONFIG_PACKAGE_odhcp6c_ext_s46)
-+endif
-+
- define Package/odhcp6c
--  SECTION:=ipv6
--  CATEGORY:=IPv6
-+  SECTION:=net
-+  CATEGORY:=Network
-   TITLE:=Embedded DHCPv6-client for OpenWrt
-   DEPENDS:=+kmod-ipv6
- endef
- 
-+define Package/odhcp6c/config
-+  config PACKAGE_odhcp6c_ext_prefix_class
-+    int "Prefix Class Extension ID (0 = disabled)"
-+    depends on PACKAGE_odhcp6c
-+    default 0
-+
-+  config PACKAGE_odhcp6c_ext_cer_id
-+    int "CER-ID Extension ID (0 = disabled)"
-+    depends on PACKAGE_odhcp6c
-+    default 0
-+
-+  config PACKAGE_odhcp6c_ext_s46
-+    int "Softwire MAP Extension ID (0 = disabled)"
-+    depends on PACKAGE_odhcp6c
-+    default 0
-+endef
-+
- define Package/odhcp6c/install
- 	$(INSTALL_DIR) $(1)/usr/sbin/
- 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/
-diff --git a/package/odhcp6c/files/dhcpv6.script b/package/odhcp6c/files/dhcpv6.script
-index 324a823..8c1ba18 100755
---- a/package/odhcp6c/files/dhcpv6.script
-+++ b/package/odhcp6c/files/dhcpv6.script
-@@ -64,23 +64,68 @@ setup_interface () {
- 		entry="${entry#*,}"
- 		local metric="${entry%%,*}"
- 
--		proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
-+		if [ -z "$SOURCE_ROUTING" -o -z "$gw" ]; then
-+			proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
-+		else
-+			proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "::/128"
-+			for prefix in $PREFIXES $ADDRESSES; do
-+				local paddr="${prefix%%,*}"
-+				proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$paddr"
-+			done
-+		fi
- 	done
- 
-+	proto_add_data
-+	[ -n "$CER" ] && json_add_string cer "$CER"
-+	[ -n "$PASSTHRU" ] && json_add_string passthru "$PASSTHRU"
-+	[ -n "$ZONE" ] && json_add_string zone "$ZONE"
-+	proto_close_data
-+
- 	proto_send_update "$INTERFACE"
- 
--	if [ -n "$AFTR_IP " -a -n "$IFACE_DSLITE" ]; then
--uci -q batch <<-EOF >/dev/null
--set network.$IFACE_DSLITE.proto=dslite
--set network.$IFACE_DSLITE.auto=0
--set network.$IFACE_DSLITE.peeraddr=$AFTR_IP
--set network.$IFACE_DSLITE.tunlink=$INTERFACE
--commit network
--EOF
--
--		ifdown "$IFACE_DSLITE"
--		/etc/init.d/network reload
--		ifup "$IFACE_DSLITE"
-+	MAPTYPE=""
-+	MAPRULE=""
-+
-+	if [ -n "$MAPE" -a -f /lib/netifd/proto/map.sh ]; then
-+		MAPTYPE="map-e"
-+		MAPRULE="$MAPE"
-+	elif [ -n "$MAPT" -a -f /lib/netifd/proto/map.sh -a -f /proc/net/nat46/control ]; then
-+		MAPTYPE="map-t"
-+		MAPRULE="$MAPT"
-+	elif [ -n "$LW4O6" -a -f /lib/netifd/proto/map.sh ]; then
-+		MAPTYPE="lw4o6"
-+		MAPRULE="$LW4O6"
-+	fi
-+
-+	[ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE)
-+
-+	if [ "$IFACE_MAP" != 0 -a -n "$MAPTYPE" -a -n "$MAPRULE" ]; then
-+		[ -z "$IFACE_MAP" -o "$IFACE_MAP" = 1 ] && IFACE_MAP=${INTERFACE}_map
-+		json_init
-+		json_add_string name "$IFACE_MAP"
-+		json_add_string ifname "@$INTERFACE"
-+		json_add_string proto map
-+		json_add_string type "$MAPTYPE"
-+		json_add_string rule "$MAPRULE"
-+		json_add_string tunlink "$INTERFACE"
-+		[ -n "$ZONE_MAP" ] || ZONE_MAP=$ZONE
-+		[ -n "$ZONE_MAP" ] && json_add_string zone "$ZONE_MAP"
-+		[ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE"
-+		json_close_object
-+		ubus call network add_dynamic "$(json_dump)"
-+	elif [ -n "$AFTR_IP " -a "$IFACE_DSLITE" != 0 -a -f /lib/netifd/proto/dslite.sh ]; then
-+		[ -z "$IFACE_DSLITE" -o "$IFACE_DSLITE" = 1 ] && IFACE_DSLITE=${INTERFACE}_dslite
-+		json_init
-+		json_add_string name "$IFACE_DSLITE"
-+		json_add_string ifname "@$INTERFACE"
-+		json_add_string proto "dslite"
-+		json_add_string peeraddr "$AFTR_IP"
-+		json_add_string tunlink "$INTERFACE"
-+		[ -n "$ZONE_DSLITE" ] || ZONE_DSLITE=$ZONE
-+		[ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE"
-+		[ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE"
-+		json_close_object
-+		ubus call network add_dynamic "$(json_dump)"
- 	fi
- 
- 	# TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
-diff --git a/package/odhcp6c/files/dhcpv6.sh b/package/odhcp6c/files/dhcpv6.sh
-index bf6cd9a..0690bd1 100755
---- a/package/odhcp6c/files/dhcpv6.sh
-+++ b/package/odhcp6c/files/dhcpv6.sh
-@@ -5,23 +5,35 @@
- init_proto "$@"
- 
- proto_dhcpv6_init_config() {
--	proto_config_add_string "reqaddress"
--	proto_config_add_string "reqprefix"
--	proto_config_add_string "clientid"
--	proto_config_add_string "reqopts"
--	proto_config_add_string "noslaaconly"
--	proto_config_add_string "norelease"
--	proto_config_add_string "ip6prefix"
--	proto_config_add_string "iface_dslite"
--	proto_config_add_string "ifaceid"
-+	renew_handler=1
-+
-+	proto_config_add_string 'reqaddress:or("try","force","none")'
-+	proto_config_add_string 'reqprefix:or("auto","no",range(0, 64))'
-+	proto_config_add_string clientid
-+	proto_config_add_string 'reqopts:list(uinteger)'
-+	proto_config_add_string 'noslaaconly:bool'
-+	proto_config_add_string 'forceprefix:bool'
-+	proto_config_add_string 'norelease:bool'
-+	proto_config_add_string 'ip6prefix:ip6addr'
-+	proto_config_add_string iface_dslite
-+	proto_config_add_string zone_dslite
-+	proto_config_add_string iface_map
-+	proto_config_add_string zone_map
-+	proto_config_add_string zone
-+	proto_config_add_string 'ifaceid:ip6addr'
-+	proto_config_add_string 'sourcerouting:bool'
-+	proto_config_add_string "userclass"
-+	proto_config_add_string "vendorclass"
-+	proto_config_add_boolean delegate
-+	proto_config_add_int "soltimeout"
- }
- 
- proto_dhcpv6_setup() {
- 	local config="$1"
- 	local iface="$2"
- 
--	local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid
--	json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid
-+	local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone soltimeout
-+	json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone soltimeout
- 
- 
- 	# Configure
-@@ -35,16 +47,31 @@ proto_dhcpv6_setup() {
- 
- 	[ "$noslaaconly" = "1" ] && append opts "-S"
- 
-+	[ "$forceprefix" = "1" ] && append opts "-F"
-+
- 	[ "$norelease" = "1" ] && append opts "-k"
- 
- 	[ -n "$ifaceid" ] && append opts "-i$ifaceid"
- 
-+	[ -n "$vendorclass" ] && append opts "-V$vendorclass"
-+
-+	[ -n "$userclass" ] && append opts "-u$userclass"
-+
- 	for opt in $reqopts; do
- 		append opts "-r$opt"
- 	done
- 
-+	append opts "-t${soltimeout:-120}"
-+
- 	[ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
- 	[ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
-+	[ -n "$iface_map" ] && proto_export "IFACE_MAP=$iface_map"
-+	[ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1"
-+	[ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0"
-+	[ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0"
-+	[ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite"
-+	[ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map"
-+	[ -n "$zone" ] && proto_export "ZONE=$zone"
- 
- 	proto_export "INTERFACE=$config"
- 	proto_run_command "$config" odhcp6c \
-@@ -52,6 +79,13 @@ proto_dhcpv6_setup() {
- 		$opts $iface
- }
- 
-+proto_dhcpv6_renew() {
-+	local interface="$1"
-+	# SIGUSR1 forces odhcp6c to renew its lease
-+	local sigusr1="$(kill -l SIGUSR1)"
-+	[ -n "$sigusr1" ] && proto_kill_command "$interface" $sigusr1
-+}
-+
- proto_dhcpv6_teardown() {
- 	local interface="$1"
- 	proto_kill_command "$interface"
-diff --git a/package/odhcp6c/patches/001-fix-integer-overflow-after-50-days.patch b/package/odhcp6c/patches/001-fix-integer-overflow-after-50-days.patch
-deleted file mode 100644
-index 292d023..0000000
---- a/package/odhcp6c/patches/001-fix-integer-overflow-after-50-days.patch
-+++ /dev/null
-@@ -1,25 +0,0 @@
--From 5b98f902f616bd9b96a2128587bc6995555a43c1 Mon Sep 17 00:00:00 2001
--From: Steven Barth <steven@midlink.org>
--Date: Fri, 7 Mar 2014 10:33:49 +0100
--Subject: [PATCH] fix integer overflow after 50 days (thx Hauke Mehrtens)
--
-----
-- src/odhcp6c.c |    2 +-
-- 1 file changed, 1 insertion(+), 1 deletion(-)
--
--diff --git a/src/odhcp6c.c b/src/odhcp6c.c
--index 3c6b3b0..ba11ced 100644
----- a/src/odhcp6c.c
--+++ b/src/odhcp6c.c
--@@ -470,7 +470,7 @@ uint64_t odhcp6c_get_milli_time(void)
-- {
-- 	struct timespec t = {0, 0};
-- 	syscall(SYS_clock_gettime, CLOCK_MONOTONIC, &t);
---	return t.tv_sec * 1000 + t.tv_nsec / 1000000;
--+	return ((uint64_t)t.tv_sec) * 1000 + ((uint64_t)t.tv_nsec) / 1000000;
-- }
-- 
-- 
---- 
--1.7.10.4
--

+ 0 - 22
patches/openwrt/0005-package-base-files-change-sysctl-handling.patch

@@ -1,22 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 11 Jan 2014 13:31:13 +0100
-Subject: package/base-files: change sysctl handling
-
-Add hotplug script that applies interface specific sysctls for interfaces that
-only appear later - this allows to reliably configure per-interface parameters
-in sysctl.conf, e.g. to disable ipv6 autoconfig on a specific iface.
-
-Cherry-picked from Barrier Breaker
-
-diff --git a/package/base-files/files/etc/hotplug.d/net/00-sysctl b/package/base-files/files/etc/hotplug.d/net/00-sysctl
-new file mode 100644
-index 0000000..5d9da8a
---- /dev/null
-+++ b/package/base-files/files/etc/hotplug.d/net/00-sysctl
-@@ -0,0 +1,6 @@
-+#!/bin/sh
-+
-+if [ -f /etc/sysctl.conf ] && [ "$ACTION" = add ]; then
-+	sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" /etc/sysctl.conf | \
-+		sysctl -e -p - | logger -t sysctl
-+fi

+ 0 - 39
patches/openwrt/0006-Fix-ping6-sender-address.patch

@@ -1,39 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 11 Jan 2014 17:08:59 +0100
-Subject: Fix ping6 sender address
-
-diff --git a/package/busybox/patches/960-ping6_sender_address.patch b/package/busybox/patches/960-ping6_sender_address.patch
-new file mode 100644
-index 0000000..7c56a6d
---- /dev/null
-+++ b/package/busybox/patches/960-ping6_sender_address.patch
-@@ -0,0 +1,29 @@
-+--- a/networking/ping.c
-++++ b/networking/ping.c
-+@@ -638,7 +638,7 @@ static void unpack4(char *buf, int sz, s
-+ 	}
-+ }
-+ #if ENABLE_PING6
-+-static void unpack6(char *packet, int sz, /*struct sockaddr_in6 *from,*/ int hoplimit)
-++static void unpack6(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit)
-+ {
-+ 	struct icmp6_hdr *icmppkt;
-+ 	char buf[INET6_ADDRSTRLEN];
-+@@ -658,7 +658,7 @@ static void unpack6(char *packet, int sz
-+ 		if (sz >= sizeof(struct icmp6_hdr) + sizeof(uint32_t))
-+ 			tp = (uint32_t *) &icmppkt->icmp6_data8[4];
-+ 		unpack_tail(sz, tp,
-+-			inet_ntop(AF_INET6, &pingaddr.sin6.sin6_addr,
-++			inet_ntop(AF_INET6, &from->sin6_addr,
-+ 					buf, sizeof(buf)),
-+ 			recv_seq, hoplimit);
-+ 	} else if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST) {
-+@@ -808,7 +808,7 @@ static void ping6(len_and_sockaddr *lsa)
-+ 				move_from_unaligned_int(hoplimit, CMSG_DATA(mp));
-+ 			}
-+ 		}
-+-		unpack6(G.rcv_packet, c, /*&from,*/ hoplimit);
-++		unpack6(G.rcv_packet, c, &from, hoplimit);
-+ 		if (pingcount && nreceived >= pingcount)
-+ 			break;
-+ 	}

+ 0 - 246
patches/openwrt/0007-ar71xx-add-kernel-support-for-the-TL-WDR3500-board.patch

@@ -1,246 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Fri, 1 Feb 2013 15:50:29 +0000
-Subject: ar71xx: add kernel support for the TL-WDR3500 board
-
-WDR3500 is similar to WDR3600 except it doesn't have gigabit ethernet,
-and has only 1 USB port.
-
-Pending issues:
-
-  * Leds are not working at all (except power and wlan_5g)
-  * LAN switch ethernet ports are reversed with respect to case label.
-
-  [Label] -> soft device
-  [LAN1] -> eth0.4
-  [LAN2] -> eth0.3
-  [LAN3] -> eth0.2
-  [LAN4] -> eth0.1
-
-Based on http://patchwork.openwrt.org/patch/3208/
-
-Thanks-to: Paul Fertser <fercerpav@gmail.com>
-Signed-off-by: Gui Iribarren <gui@altermundi.net>
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35423 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-Conflicts:
-	target/linux/ar71xx/config-3.7
-
-diff --git a/target/linux/ar71xx/config-3.3 b/target/linux/ar71xx/config-3.3
-index 446f202..dfc5bf2 100644
---- a/target/linux/ar71xx/config-3.3
-+++ b/target/linux/ar71xx/config-3.3
-@@ -60,6 +60,7 @@ CONFIG_ATH79_MACH_TL_MR3020=y
- CONFIG_ATH79_MACH_TL_MR3X20=y
- CONFIG_ATH79_MACH_TL_WA901ND=y
- CONFIG_ATH79_MACH_TL_WA901ND_V2=y
-+CONFIG_ATH79_MACH_TL_WDR3500=y
- CONFIG_ATH79_MACH_TL_WDR4300=y
- CONFIG_ATH79_MACH_TL_WR1041N_V2=y
- CONFIG_ATH79_MACH_TL_WR1043ND=y
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-new file mode 100644
-index 0000000..05fe83d
---- /dev/null
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-@@ -0,0 +1,153 @@
-+/*
-+ *  TP-LINK TL-WDR3500 board support
-+ *
-+ *  Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
-+ *  Copyright (C) 2013 Gui Iribarren <gui@altermundi.net>
-+ *
-+ *  This program is free software; you can redistribute it and/or modify it
-+ *  under the terms of the GNU General Public License version 2 as published
-+ *  by the Free Software Foundation.
-+ */
-+
-+#include <linux/pci.h>
-+#include <linux/phy.h>
-+#include <linux/gpio.h>
-+#include <linux/platform_device.h>
-+#include <linux/ath9k_platform.h>
-+#include <linux/ar8216_platform.h>
-+
-+#include <asm/mach-ath79/ar71xx_regs.h>
-+
-+#include "common.h"
-+#include "dev-ap9x-pci.h"
-+#include "dev-eth.h"
-+#include "dev-gpio-buttons.h"
-+#include "dev-leds-gpio.h"
-+#include "dev-m25p80.h"
-+#include "dev-spi.h"
-+#include "dev-usb.h"
-+#include "dev-wmac.h"
-+#include "machtypes.h"
-+
-+#define WDR3500_GPIO_LED_USB1		11
-+#define WDR3500_GPIO_LED_WLAN2G		13
-+#define WDR3500_GPIO_LED_SYSTEM		14
-+#define WDR3500_GPIO_LED_QSS		15
-+
-+#define WDR3500_GPIO_BTN_WPS		16
-+#define WDR3500_GPIO_BTN_RFKILL		17
-+
-+#define WDR3500_GPIO_USB1_POWER		22
-+
-+#define WDR3500_KEYS_POLL_INTERVAL	20	/* msecs */
-+#define WDR3500_KEYS_DEBOUNCE_INTERVAL	(3 * WDR3500_KEYS_POLL_INTERVAL)
-+
-+#define WDR3500_MAC0_OFFSET		0
-+#define WDR3500_MAC1_OFFSET		6
-+#define WDR3500_WMAC_CALDATA_OFFSET	0x1000
-+#define WDR3500_PCIE_CALDATA_OFFSET	0x5000
-+
-+static const char *wdr3500_part_probes[] = {
-+	"tp-link",
-+	NULL,
-+};
-+
-+static struct flash_platform_data wdr3500_flash_data = {
-+	.part_probes	= wdr3500_part_probes,
-+};
-+
-+static struct gpio_led wdr3500_leds_gpio[] __initdata = {
-+	{
-+		.name		= "tp-link:green:qss",
-+		.gpio		= WDR3500_GPIO_LED_QSS,
-+		.active_low	= 1,
-+	},
-+	{
-+		.name		= "tp-link:green:system",
-+		.gpio		= WDR3500_GPIO_LED_SYSTEM,
-+		.active_low	= 1,
-+	},
-+	{
-+		.name		= "tp-link:green:usb1",
-+		.gpio		= WDR3500_GPIO_LED_USB1,
-+		.active_low	= 1,
-+	},
-+	{
-+		.name		= "tp-link:green:wlan2g",
-+		.gpio		= WDR3500_GPIO_LED_WLAN2G,
-+		.active_low	= 1,
-+	},
-+};
-+
-+static struct gpio_keys_button wdr3500_gpio_keys[] __initdata = {
-+	{
-+		.desc		= "QSS button",
-+		.type		= EV_KEY,
-+		.code		= KEY_WPS_BUTTON,
-+		.debounce_interval = WDR3500_KEYS_DEBOUNCE_INTERVAL,
-+		.gpio		= WDR3500_GPIO_BTN_WPS,
-+		.active_low	= 1,
-+	},
-+	{
-+		.desc		= "RFKILL switch",
-+		.type		= EV_SW,
-+		.code		= KEY_RFKILL,
-+		.debounce_interval = WDR3500_KEYS_DEBOUNCE_INTERVAL,
-+		.gpio		= WDR3500_GPIO_BTN_RFKILL,
-+	},
-+};
-+
-+
-+static void __init wdr3500_setup(void)
-+{
-+	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
-+	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
-+	u8 tmpmac[ETH_ALEN];
-+
-+	ath79_register_m25p80(&wdr3500_flash_data);
-+	ath79_register_leds_gpio(-1, ARRAY_SIZE(wdr3500_leds_gpio),
-+				 wdr3500_leds_gpio);
-+	ath79_register_gpio_keys_polled(-1, WDR3500_KEYS_POLL_INTERVAL,
-+					ARRAY_SIZE(wdr3500_gpio_keys),
-+					wdr3500_gpio_keys);
-+
-+	ath79_init_mac(tmpmac, mac, 0);
-+	ath79_register_wmac(art + WDR3500_WMAC_CALDATA_OFFSET, tmpmac);
-+
-+	ath79_init_mac(tmpmac, mac, 1);
-+	ap9x_pci_setup_wmac_led_pin(0, 0);
-+	ap91_pci_init(art + WDR3500_PCIE_CALDATA_OFFSET, tmpmac);
-+
-+	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
-+
-+	ath79_register_mdio(1, 0x0);
-+
-+	/* LAN */
-+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1);
-+
-+	/* GMAC1 is connected to the internal switch */
-+	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
-+
-+	ath79_register_eth(1);
-+
-+	/* WAN */
-+	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 2);
-+
-+	/* GMAC0 is connected to the PHY4 of the internal switch */
-+	ath79_switch_data.phy4_mii_en = 1;
-+	ath79_switch_data.phy_poll_mask = BIT(4);
-+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
-+	ath79_eth0_data.phy_mask = BIT(4);
-+	ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev;
-+
-+	ath79_register_eth(0);
-+
-+	gpio_request_one(WDR3500_GPIO_USB1_POWER,
-+			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
-+			 "USB1 power");
-+	ath79_register_usb();
-+}
-+
-+MIPS_MACHINE(ATH79_MACH_TL_WDR3500, "TL-WDR3500",
-+	     "TP-LINK TL-WDR3500",
-+	     wdr3500_setup);
-diff --git a/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-add-TL-WDR3500-support.patch b/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-add-TL-WDR3500-support.patch
-new file mode 100644
-index 0000000..0a2c3bd
---- /dev/null
-+++ b/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-add-TL-WDR3500-support.patch
-@@ -0,0 +1,40 @@
-+--- a/arch/mips/ath79/machtypes.h
-++++ b/arch/mips/ath79/machtypes.h
-+@@ -84,6 +84,7 @@ enum ath79_mach_type {
-+ 	ATH79_MACH_TL_WA7510N_V1,	/* TP-LINK TL-WA7510N v1*/
-+ 	ATH79_MACH_TL_WA901ND,		/* TP-LINK TL-WA901ND */
-+ 	ATH79_MACH_TL_WA901ND_V2,	/* TP-LINK TL-WA901ND v2 */
-++	ATH79_MACH_TL_WDR3500,		/* TP-LINK TL-WDR3500 */
-+ 	ATH79_MACH_TL_WDR4300,		/* TP-LINK TL-WDR4300 */
-+ 	ATH79_MACH_TL_WR1041N_V2,	/* TP-LINK TL-WR1041N v2 */
-+ 	ATH79_MACH_TL_WR1043ND,		/* TP-LINK TL-WR1043ND */
-+--- a/arch/mips/ath79/Kconfig
-++++ b/arch/mips/ath79/Kconfig
-+@@ -514,6 +514,17 @@ config ATH79_MACH_TL_WA901ND_V2
-+ 	select ATH79_DEV_M25P80
-+ 	select ATH79_DEV_WMAC
-+ 
-++config ATH79_MACH_TL_WDR3500
-++	bool "TP-LINK TL-WDR3500 board support"
-++	select SOC_AR934X
-++	select ATH79_DEV_AP9X_PCI if PCI
-++	select ATH79_DEV_ETH
-++	select ATH79_DEV_GPIO_BUTTONS
-++	select ATH79_DEV_LEDS_GPIO
-++	select ATH79_DEV_M25P80
-++	select ATH79_DEV_USB
-++	select ATH79_DEV_WMAC
-++
-+ config ATH79_MACH_TL_WDR4300
-+ 	bool "TP-LINK TL-WDR3600/4300/4310 board support"
-+ 	select SOC_AR934X
-+--- a/arch/mips/ath79/Makefile
-++++ b/arch/mips/ath79/Makefile
-+@@ -81,6 +81,7 @@ obj-$(CONFIG_ATH79_MACH_TL_MR3020)	+= ma
-+ obj-$(CONFIG_ATH79_MACH_TL_MR3X20)	+= mach-tl-mr3x20.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WA901ND)	+= mach-tl-wa901nd.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WA901ND_V2)	+= mach-tl-wa901nd-v2.o
-++obj-$(CONFIG_ATH79_MACH_TL_WDR3500)     += mach-tl-wdr3500.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WDR4300)     += mach-tl-wdr4300.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WR741ND)	+= mach-tl-wr741nd.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WR741ND_V4)	+= mach-tl-wr741nd-v4.o

+ 0 - 48
patches/openwrt/0008-ar71xx-add-user-space-support-for-TL-WDR3500-board.patch

@@ -1,48 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Fri, 1 Feb 2013 15:50:32 +0000
-Subject: ar71xx: add user-space support for TL-WDR3500 board
-
-Based on http://patchwork.openwrt.org/patch/3208/
-
-Thanks-to: Paul Fertser <fercerpav@gmail.com>
-Signed-off-by: Gui Iribarren <gui@altermundi.net>
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35424 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-index fe7c910..8d71352 100755
---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
-+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-@@ -123,6 +123,9 @@ tplink_board_detect() {
- 	"342000"*)
- 		model="TP-Link TL-MR3420"
- 		;;
-+	"350000"*)
-+		model="TP-Link TL-WDR3500"
-+		;;
- 	"360000"*)
- 		model="TP-Link TL-WDR3600"
- 		;;
-@@ -357,6 +360,9 @@ ar71xx_board_detect() {
- 	*"TL-WA901ND v2")
- 		name="tl-wa901nd-v2"
- 		;;
-+	*"TL-WDR3500")
-+		name="tl-wdr3500"
-+		;;
- 	*"TL-WDR3600/4300/4310")
- 		name="tl-wdr4300"
- 		;;
-diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-index 49b1de9..e52ad9e 100755
---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-@@ -155,6 +155,7 @@ platform_check_image() {
- 	tl-wa7510n | \
- 	tl-wa901nd | \
- 	tl-wa901nd-v2 | \
-+	tl-wdr3500 | \
- 	tl-wdr4300 | \
- 	tl-wr703n | \
- 	tl-wr741nd | \

+ 0 - 55
patches/openwrt/0009-ar71xx-build-image-for-the-TL-WDR3500-board.patch

@@ -1,55 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Fri, 1 Feb 2013 15:50:34 +0000
-Subject: ar71xx: build image for the TL-WDR3500 board
-
-Based on http://patchwork.openwrt.org/patch/3208/
-
-Thanks-to: Paul Fertser <fercerpav@gmail.com>
-Signed-off-by: Gui Iribarren <gui@altermundi.net>
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35425 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-Conflicts:
-	target/linux/ar71xx/image/Makefile
-
-diff --git a/target/linux/ar71xx/generic/profiles/tp-link.mk b/target/linux/ar71xx/generic/profiles/tp-link.mk
-index 07d7059..3d7859c 100644
---- a/target/linux/ar71xx/generic/profiles/tp-link.mk
-+++ b/target/linux/ar71xx/generic/profiles/tp-link.mk
-@@ -105,12 +105,12 @@ $(eval $(call Profile,TLWA901))
- 
- 
- define Profile/TLWDR4300
--	NAME:=TP-LINK TL-WDR3600/4300/4310
-+	NAME:=TP-LINK TL-WDR3500/3600/4300/4310
- 	PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
- endef
- 
- define Profile/TLWDR4300/Description
--	Package set optimized for the TP-LINK TL-WDR3600/4300/4310.
-+	Package set optimized for the TP-LINK TL-WDR3500/3600/4300/4310.
- endef
- $(eval $(call Profile,TLWDR4300))
- 
-diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
-index 8e82f7f..01d1e67 100644
---- a/target/linux/ar71xx/image/Makefile
-+++ b/target/linux/ar71xx/image/Makefile
-@@ -881,6 +881,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR741NV4,tl-wr741nd-v4,TL
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR841NV8,tl-wr841n-v8,TL-WR841N-v8,ttyS0,115200,0x08410008,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR1041,tl-wr1041n-v2,TL-WR1041N-v2,ttyS0,115200,0x10410002,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
-+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3500V1,tl-wdr3500-v1,TL-WDR3500,ttyS0,115200,0x35000001,1,8Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3600V1,tl-wdr3600-v1,TL-WDR4300,ttyS0,115200,0x36000001,1,8Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4300V1,tl-wdr4300-v1,TL-WDR4300,ttyS0,115200,0x43000001,1,8Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR4310V1,tl-wdr4310-v1,TL-WDR4300,ttyS0,115200,0x43100001,1,8Mlzma))
-@@ -925,7 +926,7 @@ $(eval $(call MultiProfile,TLWR740,TLWR740NV1 TLWR740NV3 TLWR740NV4))
- $(eval $(call MultiProfile,TLWR741,TLWR741NV1 TLWR741NV2 TLWR741NV4))
- $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7 TLWR841NV8))
- $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
--$(eval $(call MultiProfile,TLWDR4300,TLWDR3600V1 TLWDR4300V1 TLWDR4310V1))
-+$(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4310V1))
- $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTUNIFI UBNTUNIFIOUTDOOR))
- $(eval $(call MultiProfile,WNDR3700,WNDR3700V1 WNDR3700V2 WNDR3800 WNDRMAC WNDRMACV2))
- $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))

+ 0 - 23
patches/openwrt/0010-ar71xx-add-default-switch-configuration-for-the-TL-WDR3500.patch

@@ -1,23 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 24 Mar 2013 19:23:36 +0000
-Subject: ar71xx: add default switch configuration for the TL-WDR3500
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36116 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-Conflicts:
-	target/linux/ar71xx/base-files/etc/uci-defaults/02_network
-
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/network b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-index 7fa219d..a36036f 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/network
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-@@ -188,6 +188,7 @@ tew-632brp |\
- tew-712br |\
- tl-mr3220 |\
- tl-mr3420 |\
-+tl-wdr3500 |\
- tl-wr741nd |\
- tl-wr741nd-v4 |\
- tl-wr841n-v7 |\

+ 0 - 20
patches/openwrt/0011-ar71xx-add-diag-support-for-the-TL-WDR3500.patch

@@ -1,20 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 24 Mar 2013 19:23:43 +0000
-Subject: ar71xx: add diag support for the TL-WDR3500
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36117 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
-index 416322d..b206438 100755
---- a/target/linux/ar71xx/base-files/etc/diag.sh
-+++ b/target/linux/ar71xx/base-files/etc/diag.sh
-@@ -129,6 +129,7 @@ get_status_led() {
- 	tl-mr3420 | \
- 	tl-wa901nd | \
- 	tl-wa901nd-v2 | \
-+	tl-wdr3500 | \
- 	tl-wr1041n-v2 | \
- 	tl-wr1043nd | \
- 	tl-wr741nd | \

+ 0 - 53
patches/openwrt/0012-ar71xx-remove-numeric-suffix-of-the-TL-WDR3500-USB-LED.patch

@@ -1,53 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 24 Mar 2013 19:23:45 +0000
-Subject: ar71xx: remove numeric suffix of the TL-WDR3500 USB LED
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36118 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-index 05fe83d..785b21f 100644
---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-@@ -29,7 +29,7 @@
- #include "dev-wmac.h"
- #include "machtypes.h"
- 
--#define WDR3500_GPIO_LED_USB1		11
-+#define WDR3500_GPIO_LED_USB		11
- #define WDR3500_GPIO_LED_WLAN2G		13
- #define WDR3500_GPIO_LED_SYSTEM		14
- #define WDR3500_GPIO_LED_QSS		15
-@@ -37,7 +37,7 @@
- #define WDR3500_GPIO_BTN_WPS		16
- #define WDR3500_GPIO_BTN_RFKILL		17
- 
--#define WDR3500_GPIO_USB1_POWER		22
-+#define WDR3500_GPIO_USB_POWER		22
- 
- #define WDR3500_KEYS_POLL_INTERVAL	20	/* msecs */
- #define WDR3500_KEYS_DEBOUNCE_INTERVAL	(3 * WDR3500_KEYS_POLL_INTERVAL)
-@@ -68,8 +68,8 @@ static struct gpio_led wdr3500_leds_gpio[] __initdata = {
- 		.active_low	= 1,
- 	},
- 	{
--		.name		= "tp-link:green:usb1",
--		.gpio		= WDR3500_GPIO_LED_USB1,
-+		.name		= "tp-link:green:usb",
-+		.gpio		= WDR3500_GPIO_LED_USB,
- 		.active_low	= 1,
- 	},
- 	{
-@@ -142,9 +142,9 @@ static void __init wdr3500_setup(void)
- 
- 	ath79_register_eth(0);
- 
--	gpio_request_one(WDR3500_GPIO_USB1_POWER,
-+	gpio_request_one(WDR3500_GPIO_USB_POWER,
- 			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
--			 "USB1 power");
-+			 "USB power");
- 	ath79_register_usb();
- }
- 

+ 0 - 21
patches/openwrt/0013-ar71xx-fix-USB-power-GPIO-on-the-TL-WDR3500.patch

@@ -1,21 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 24 Mar 2013 19:23:47 +0000
-Subject: ar71xx: fix USB power GPIO on the TL-WDR3500
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36119 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-index 785b21f..5020ba4 100644
---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-@@ -37,7 +37,7 @@
- #define WDR3500_GPIO_BTN_WPS		16
- #define WDR3500_GPIO_BTN_RFKILL		17
- 
--#define WDR3500_GPIO_USB_POWER		22
-+#define WDR3500_GPIO_USB_POWER		12
- 
- #define WDR3500_KEYS_POLL_INTERVAL	20	/* msecs */
- #define WDR3500_KEYS_DEBOUNCE_INTERVAL	(3 * WDR3500_KEYS_POLL_INTERVAL)

+ 0 - 27
patches/openwrt/0014-ar71xx-add-default-LED-configuration-for-the-WL-WRD3500.patch

@@ -1,27 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 24 Mar 2013 21:07:21 +0000
-Subject: ar71xx: add default LED configuration for the WL-WRD3500
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36120 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-Conflicts:
-	target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
-
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/leds b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-index 7be4ce9..48b8154 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-@@ -126,6 +126,11 @@ tl-wa901nd-v2)
- 	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
- 	;;
- 
-+tl-wdr3500)
-+        ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1"
-+        ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt"
-+        ;;
-+
- tl-wdr4300)
- 	ucidef_set_led_usbdev "usb1" "USB1" "tp-link:green:usb1" "1-1.1"
- 	ucidef_set_led_usbdev "usb2" "USB2" "tp-link:green:usb2" "1-1.2"

+ 0 - 42
patches/openwrt/0015-ar71xx-fix-ethernet-LEDs-on-the-TL-WDR3500.patch

@@ -1,42 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Mon, 25 Mar 2013 06:40:03 +0000
-Subject: ar71xx: fix ethernet LEDs on the TL-WDR3500
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36122 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-index 5020ba4..452c20b 100644
---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
-@@ -33,6 +33,11 @@
- #define WDR3500_GPIO_LED_WLAN2G		13
- #define WDR3500_GPIO_LED_SYSTEM		14
- #define WDR3500_GPIO_LED_QSS		15
-+#define WDR3500_GPIO_LED_WAN		18
-+#define WDR3500_GPIO_LED_LAN1		19
-+#define WDR3500_GPIO_LED_LAN2		20
-+#define WDR3500_GPIO_LED_LAN3		21
-+#define WDR3500_GPIO_LED_LAN4		22
- 
- #define WDR3500_GPIO_BTN_WPS		16
- #define WDR3500_GPIO_BTN_RFKILL		17
-@@ -146,6 +151,17 @@ static void __init wdr3500_setup(void)
- 			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
- 			 "USB power");
- 	ath79_register_usb();
-+
-+	ath79_gpio_output_select(WDR3500_GPIO_LED_LAN1,
-+				 AR934X_GPIO_OUT_LED_LINK3);
-+	ath79_gpio_output_select(WDR3500_GPIO_LED_LAN2,
-+				 AR934X_GPIO_OUT_LED_LINK2);
-+	ath79_gpio_output_select(WDR3500_GPIO_LED_LAN3,
-+				 AR934X_GPIO_OUT_LED_LINK1);
-+	ath79_gpio_output_select(WDR3500_GPIO_LED_LAN4,
-+				 AR934X_GPIO_OUT_LED_LINK0);
-+	ath79_gpio_output_select(WDR3500_GPIO_LED_WAN,
-+				 AR934X_GPIO_OUT_LED_LINK4);
- }
- 
- MIPS_MACHINE(ATH79_MACH_TL_WDR3500, "TL-WDR3500",

+ 0 - 38
patches/openwrt/0016-ar71xx-add-GPIO-output-select-values-for-AR934x.patch

@@ -1,38 +0,0 @@
-From: juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Mon, 25 Mar 2013 06:40:00 +0000
-Subject: ar71xx: add GPIO output select values for AR934x
-
-Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-
-git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36121 3c298f89-4303-0410-b956-a3cf2f4a3e73
-
-Conflicts:
-	target/linux/ar71xx/patches-3.8/601-MIPS-ath79-add-more-register-defines.patch
-
-diff --git a/target/linux/ar71xx/patches-3.3/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-3.3/601-MIPS-ath79-add-more-register-defines.patch
-index 8411d58..12522c1 100644
---- a/target/linux/ar71xx/patches-3.3/601-MIPS-ath79-add-more-register-defines.patch
-+++ b/target/linux/ar71xx/patches-3.3/601-MIPS-ath79-add-more-register-defines.patch
-@@ -166,7 +166,7 @@
-  #define AR934X_GPIO_REG_FUNC		0x6c
-  
-  #define AR71XX_GPIO_COUNT		16
--@@ -550,4 +618,139 @@
-+@@ -550,4 +618,144 @@
-  #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT	13
-  #define AR934X_SRIF_DPLL2_OUTDIV_MASK	0x7
-  
-@@ -237,7 +237,12 @@
- +#define AR934X_GPIO_FUNC_CLK_OBS0_EN		BIT(2)
- +#define AR934X_GPIO_FUNC_JTAG_DISABLE		BIT(1)
- +
--+#define AR934X_GPIO_OUT_GPIO		0x00
-++#define AR934X_GPIO_OUT_GPIO          0
-++#define AR934X_GPIO_OUT_LED_LINK0     41
-++#define AR934X_GPIO_OUT_LED_LINK1     42
-++#define AR934X_GPIO_OUT_LED_LINK2     43
-++#define AR934X_GPIO_OUT_LED_LINK3     44
-++#define AR934X_GPIO_OUT_LED_LINK4     45
- +
- +/*
- + * MII_CTRL block

+ 0 - 2201
patches/openwrt/0017-Backport-hostapd-from-Barrier-Breaker-r41029.patch

@@ -1,2201 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Mon, 19 May 2014 15:59:06 +0200
-Subject: Backport hostapd from Barrier Breaker (r41029)
-
-diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
-index b4dc242..beb37a3 100644
---- a/package/hostapd/Makefile
-+++ b/package/hostapd/Makefile
-@@ -8,9 +8,9 @@
- include $(TOPDIR)/rules.mk
- 
- PKG_NAME:=hostapd
--PKG_VERSION:=20131120
-+PKG_VERSION:=2014-06-03
- PKG_RELEASE:=1
--PKG_REV:=594516b4c28a94ca686b17f1e463dfd6712b75a7
-+PKG_REV:=84df167554569af8c87f0a8ac1fb508192417d8e
- 
- PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
- PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
-diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh
-index b55b63d..2a16bb4 100644
---- a/package/hostapd/files/hostapd.sh
-+++ b/package/hostapd/files/hostapd.sh
-@@ -130,7 +130,9 @@ hostapd_set_bss_options() {
- 				append "$var" "radius_das_client=$dae_client $dae_secret" "$N"
- 			}
- 			config_get nasid "$vif" nasid
-+			config_get ownip "$vif" ownip
- 			append "$var" "nas_identifier=$nasid" "$N"
-+			append "$var" "own_ip_addr=$ownip" "$N"
- 			append "$var" "eapol_key_index_workaround=1" "$N"
- 			append "$var" "ieee8021x=1" "$N"
- 			append "$var" "wpa_key_mgmt=WPA-EAP" "$N"
-diff --git a/package/hostapd/patches/100-madwifi_key_fixes.patch b/package/hostapd/patches/100-madwifi_key_fixes.patch
-index dcd6d10..a46943b 100644
---- a/package/hostapd/patches/100-madwifi_key_fixes.patch
-+++ b/package/hostapd/patches/100-madwifi_key_fixes.patch
-@@ -1,6 +1,6 @@
- --- a/src/drivers/driver_madwifi.c
- +++ b/src/drivers/driver_madwifi.c
--@@ -450,7 +450,9 @@ wpa_driver_madwifi_set_key(const char *i
-+@@ -449,7 +449,9 @@ wpa_driver_madwifi_set_key(const char *i
-  
-  	memset(&wk, 0, sizeof(wk));
-  	wk.ik_type = cipher;
-@@ -11,7 +11,7 @@
-  	if (addr == NULL || is_broadcast_ether_addr(addr)) {
-  		memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
-  		wk.ik_keyix = key_idx;
--@@ -462,6 +464,20 @@ wpa_driver_madwifi_set_key(const char *i
-+@@ -461,6 +463,20 @@ wpa_driver_madwifi_set_key(const char *i
-  	wk.ik_keylen = key_len;
-  	memcpy(wk.ik_keydata, key, key_len);
-  
-diff --git a/package/hostapd/patches/110-bool_fix.patch b/package/hostapd/patches/110-bool_fix.patch
-index 9f82b0b..1ad84bf 100644
---- a/package/hostapd/patches/110-bool_fix.patch
-+++ b/package/hostapd/patches/110-bool_fix.patch
-@@ -1,6 +1,6 @@
- --- a/src/ap/ieee802_1x.c
- +++ b/src/ap/ieee802_1x.c
--@@ -1933,9 +1933,9 @@ void ieee802_1x_notify_pre_auth(struct e
-+@@ -2119,9 +2119,9 @@ void ieee802_1x_notify_pre_auth(struct e
-  }
-  
-  
-diff --git a/package/hostapd/patches/130-no_eapol_fix.patch b/package/hostapd/patches/130-no_eapol_fix.patch
-new file mode 100644
-index 0000000..3c19cb3
---- /dev/null
-+++ b/package/hostapd/patches/130-no_eapol_fix.patch
-@@ -0,0 +1,14 @@
-+--- a/wpa_supplicant/wpa_supplicant.c
-++++ b/wpa_supplicant/wpa_supplicant.c
-+@@ -247,9 +247,10 @@ void wpa_supplicant_cancel_auth_timeout(
-+  */
-+ void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s)
-+ {
-++	struct wpa_ssid *ssid = wpa_s->current_ssid;
-++
-+ #ifdef IEEE8021X_EAPOL
-+ 	struct eapol_config eapol_conf;
-+-	struct wpa_ssid *ssid = wpa_s->current_ssid;
-+ 
-+ #ifdef CONFIG_IBSS_RSN
-+ 	if (ssid->mode == WPAS_MODE_IBSS &&
-diff --git a/package/hostapd/patches/130-wds_sta_del_fix.patch b/package/hostapd/patches/130-wds_sta_del_fix.patch
-deleted file mode 100644
-index 06b6906..0000000
---- a/package/hostapd/patches/130-wds_sta_del_fix.patch
-+++ /dev/null
-@@ -1,13 +0,0 @@
----- a/src/drivers/driver_nl80211.c
--+++ b/src/drivers/driver_nl80211.c
--@@ -9083,8 +9083,8 @@ static int i802_set_wds_sta(void *priv, 
-- 					name);
-- 
-- 		i802_set_sta_vlan(priv, addr, bss->ifname, 0);
---		return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
---						    name);
--+		nl80211_remove_iface(drv, if_nametoindex(name));
--+		return 0;
-- 	}
-- }
-- 
-diff --git a/package/hostapd/patches/200-multicall.patch b/package/hostapd/patches/200-multicall.patch
-index 2289f51..efe151c 100644
---- a/package/hostapd/patches/200-multicall.patch
-+++ b/package/hostapd/patches/200-multicall.patch
-@@ -1,14 +1,14 @@
- --- a/hostapd/Makefile
- +++ b/hostapd/Makefile
--@@ -14,6 +14,7 @@ CFLAGS += -I../src/utils
-+@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src/utils)
-  # CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
-  
-  -include .config
- +-include $(if $(MULTICALL), ../wpa_supplicant/.config)
-  
-- ifndef CONFIG_OS
-- ifdef CONFIG_NATIVE_WINDOWS
--@@ -200,10 +201,14 @@ ifdef CONFIG_IEEE80211AC
-+ ifdef CONFIG_TESTING_OPTIONS
-+ CFLAGS += -DCONFIG_TESTING_OPTIONS
-+@@ -223,10 +224,14 @@ ifdef CONFIG_IEEE80211AC
-  CFLAGS += -DCONFIG_IEEE80211AC
-  endif
-  
-@@ -26,7 +26,7 @@
-  LIBS += $(DRV_AP_LIBS)
-  
-  ifdef CONFIG_L2_PACKET
--@@ -890,6 +895,12 @@ install: all
-+@@ -913,6 +918,12 @@ install: all
-  
-  BCHECK=../src/drivers/build.hostapd
-  
-@@ -39,7 +39,7 @@
-  hostapd: $(BCHECK) $(OBJS)
-  	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
-  	@$(E) "  LD " $@
--@@ -928,6 +939,12 @@ HOBJS += ../src/crypto/aes-internal.o
-+@@ -951,6 +962,12 @@ HOBJS += ../src/crypto/aes-internal.o
-  HOBJS += ../src/crypto/aes-internal-enc.o
-  endif
-  
-@@ -54,15 +54,15 @@
-  	@$(E) "  LD " $@
- --- a/wpa_supplicant/Makefile
- +++ b/wpa_supplicant/Makefile
--@@ -14,6 +14,7 @@ CFLAGS += -I../src
-- CFLAGS += -I../src/utils
-+@@ -14,6 +14,7 @@ CFLAGS += -I$(abspath ../src)
-+ CFLAGS += -I$(abspath ../src/utils)
-  
-  -include .config
- +-include $(if $(MULTICALL),../hostapd/.config)
-  
-- BINALL=wpa_supplicant wpa_cli
-- 
--@@ -727,6 +728,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
-+ ifdef CONFIG_TESTING_OPTIONS
-+ CFLAGS += -DCONFIG_TESTING_OPTIONS
-+@@ -741,6 +742,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
-  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
-  LIBS += -ldl -rdynamic
-  endif
-@@ -72,8 +72,8 @@
- +  endif
-  endif
-  
-- ifdef CONFIG_AP
--@@ -735,9 +740,11 @@ NEED_EAP_COMMON=y
-+ ifdef CONFIG_MACSEC
-+@@ -762,9 +767,11 @@ NEED_EAP_COMMON=y
-  NEED_RSN_AUTHENTICATOR=y
-  CFLAGS += -DCONFIG_AP
-  OBJS += ap.o
-@@ -85,7 +85,7 @@
-  OBJS += ../src/ap/hostapd.o
-  OBJS += ../src/ap/wpa_auth_glue.o
-  OBJS += ../src/ap/utils.o
--@@ -799,10 +806,18 @@ endif
-+@@ -826,10 +833,18 @@ endif
-  ifdef CONFIG_HS20
-  OBJS += ../src/ap/hs20.o
-  endif
-@@ -104,7 +104,7 @@
-  NEED_AES_WRAP=y
-  OBJS += ../src/ap/wpa_auth.o
-  OBJS += ../src/ap/wpa_auth_ie.o
--@@ -1551,6 +1566,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
-+@@ -1602,6 +1617,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv)
-  
-  $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
-  
-@@ -117,7 +117,7 @@
-  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
-  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
-  	@$(E) "  LD " $@
--@@ -1625,6 +1646,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c ..
-+@@ -1682,6 +1703,12 @@ endif
-  %@.service: %.service.arg.in
-  	sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
-  
-@@ -132,7 +132,7 @@
-  wpa_cli.exe: wpa_cli
- --- a/src/drivers/driver.h
- +++ b/src/drivers/driver.h
--@@ -4079,8 +4079,8 @@ union wpa_event_data {
-+@@ -4117,8 +4117,8 @@ union wpa_event_data {
-   * Driver wrapper code should call this function whenever an event is received
-   * from the driver.
-   */
-@@ -145,7 +145,7 @@
-  /*
- --- a/src/ap/drv_callbacks.c
- +++ b/src/ap/drv_callbacks.c
--@@ -844,8 +844,8 @@ static void hostapd_event_dfs_nop_finish
-+@@ -926,8 +926,8 @@ static void hostapd_event_dfs_nop_finish
-  #endif /* NEED_AP_MLME */
-  
-  
-@@ -158,7 +158,7 @@
-  #ifndef CONFIG_NO_STDOUT_DEBUG
- --- a/wpa_supplicant/wpa_priv.c
- +++ b/wpa_supplicant/wpa_priv.c
--@@ -817,8 +817,8 @@ static void wpa_priv_send_ft_response(st
-+@@ -815,8 +815,8 @@ static void wpa_priv_send_ft_response(st
-  }
-  
-  
-@@ -169,7 +169,7 @@
-  {
-  	struct wpa_priv_interface *iface = ctx;
-  
--@@ -960,6 +960,7 @@ int main(int argc, char *argv[])
-+@@ -956,6 +956,7 @@ int main(int argc, char *argv[])
-  	if (os_program_init())
-  		return -1;
-  
-@@ -179,7 +179,7 @@
-  	for (;;) {
- --- a/wpa_supplicant/events.c
- +++ b/wpa_supplicant/events.c
--@@ -2710,8 +2710,8 @@ static void wpa_supplicant_update_channe
-+@@ -2919,8 +2919,8 @@ static void wpa_supplicant_notify_avoid_
-  }
-  
-  
-@@ -192,7 +192,7 @@
-  
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
--@@ -3138,6 +3138,9 @@ static void wpa_supplicant_deinit_iface(
-+@@ -3811,6 +3811,9 @@ static void wpa_supplicant_deinit_iface(
-  	os_free(wpa_s);
-  }
-  
-@@ -202,7 +202,7 @@
-  
-  /**
-   * wpa_supplicant_add_iface - Add a new network interface
--@@ -3329,6 +3332,7 @@ struct wpa_global * wpa_supplicant_init(
-+@@ -4002,6 +4005,7 @@ struct wpa_global * wpa_supplicant_init(
-  	wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
-  #endif /* CONFIG_NO_WPA_MSG */
-  
-@@ -212,7 +212,7 @@
-  		wpa_debug_open_syslog();
- --- a/hostapd/main.c
- +++ b/hostapd/main.c
--@@ -511,6 +511,9 @@ static int hostapd_get_ctrl_iface_group(
-+@@ -502,6 +502,9 @@ static int hostapd_get_ctrl_iface_group(
-  	return 0;
-  }
-  
-@@ -220,27 +220,57 @@
- +                       union wpa_event_data *data);
- +
-  
-- int main(int argc, char *argv[])
-- {
--@@ -541,6 +544,7 @@ int main(int argc, char *argv[])
-+ #ifdef CONFIG_WPS
-+ static int gen_uuid(const char *txt_addr)
-+@@ -553,6 +556,7 @@ int main(int argc, char *argv[])
-  	interfaces.global_iface_name = NULL;
-  	interfaces.global_ctrl_sock = -1;
-  
- +	wpa_supplicant_event = hostapd_wpa_event;
-  	for (;;) {
-- 		c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
-+ 		c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
-  		if (c < 0)
- --- a/src/drivers/drivers.c
- +++ b/src/drivers/drivers.c
--@@ -7,7 +7,11 @@
--  */
-- 
-- #include "includes.h"
--+#include "common.h"
--+#include "driver.h"
-+@@ -10,6 +10,9 @@
-+ #include "utils/common.h"
-+ #include "driver.h"
-  
- +void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
- +			     union wpa_event_data *data);
-- 
-++
-  #ifdef CONFIG_DRIVER_WEXT
-  extern struct wpa_driver_ops wpa_driver_wext_ops; /* driver_wext.c */
-+ #endif /* CONFIG_DRIVER_WEXT */
-+--- a/wpa_supplicant/eapol_test.c
-++++ b/wpa_supplicant/eapol_test.c
-+@@ -28,8 +28,12 @@
-+ #include "ctrl_iface.h"
-+ #include "pcsc_funcs.h"
-+ #include "wpas_glue.h"
-++#include "drivers/driver.h"
-+ 
-+ 
-++void (*wpa_supplicant_event)(void *ctx, enum wpa_event_type event,
-++			     union wpa_event_data *data);
-++
-+ struct wpa_driver_ops *wpa_drivers[] = { NULL };
-+ 
-+ 
-+@@ -1185,6 +1189,8 @@ static void usage(void)
-+ 	       "option several times.\n");
-+ }
-+ 
-++extern void supplicant_event(void *ctx, enum wpa_event_type event,
-++			     union wpa_event_data *data);
-+ 
-+ int main(int argc, char *argv[])
-+ {
-+@@ -1203,6 +1209,7 @@ int main(int argc, char *argv[])
-+ 	if (os_program_init())
-+ 		return -1;
-+ 
-++	wpa_supplicant_event = supplicant_event;
-+ 	hostapd_logger_register_cb(hostapd_logger_cb);
-+ 
-+ 	os_memset(&eapol_test, 0, sizeof(eapol_test));
-diff --git a/package/hostapd/patches/300-noscan.patch b/package/hostapd/patches/300-noscan.patch
-index 17e7661..4ea26b6 100644
---- a/package/hostapd/patches/300-noscan.patch
-+++ b/package/hostapd/patches/300-noscan.patch
-@@ -1,17 +1,17 @@
- --- a/hostapd/config_file.c
- +++ b/hostapd/config_file.c
--@@ -2412,6 +2412,8 @@ static int hostapd_config_fill(struct ho
-- 			}
-+@@ -2639,6 +2639,8 @@ static int hostapd_config_fill(struct ho
-+ 		}
-  #endif /* CONFIG_IEEE80211W */
-  #ifdef CONFIG_IEEE80211N
--+		} else if (os_strcmp(buf, "noscan") == 0) {
--+			conf->noscan = atoi(pos);
-- 		} else if (os_strcmp(buf, "ieee80211n") == 0) {
-- 			conf->ieee80211n = atoi(pos);
-- 		} else if (os_strcmp(buf, "ht_capab") == 0) {
-++	} else if (os_strcmp(buf, "noscan") == 0) {
-++		conf->noscan = atoi(pos);
-+ 	} else if (os_strcmp(buf, "ieee80211n") == 0) {
-+ 		conf->ieee80211n = atoi(pos);
-+ 	} else if (os_strcmp(buf, "ht_capab") == 0) {
- --- a/src/ap/ap_config.h
- +++ b/src/ap/ap_config.h
--@@ -527,6 +527,7 @@ struct hostapd_config {
-+@@ -576,6 +576,7 @@ struct hostapd_config {
-  
-  	int ht_op_mode_fixed;
-  	u16 ht_capab;
-@@ -21,9 +21,9 @@
-  	int require_ht;
- --- a/src/ap/hw_features.c
- +++ b/src/ap/hw_features.c
--@@ -577,7 +577,7 @@ static int ieee80211n_check_40mhz(struct
-- {
-+@@ -690,7 +690,7 @@ static int ieee80211n_check_40mhz(struct
-  	struct wpa_driver_scan_params params;
-+ 	int ret;
-  
- -	if (!iface->conf->secondary_channel)
- +	if (!iface->conf->secondary_channel || iface->conf->noscan)
-diff --git a/package/hostapd/patches/310-rescan_immediately.patch b/package/hostapd/patches/310-rescan_immediately.patch
-index 043f07c..dac0f6e 100644
---- a/package/hostapd/patches/310-rescan_immediately.patch
-+++ b/package/hostapd/patches/310-rescan_immediately.patch
-@@ -1,6 +1,6 @@
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
--@@ -2488,7 +2488,7 @@ static struct wpa_supplicant * wpa_suppl
-+@@ -2752,7 +2752,7 @@ static struct wpa_supplicant * wpa_suppl
-  	if (wpa_s == NULL)
-  		return NULL;
-  	wpa_s->scan_req = INITIAL_SCAN_REQ;
-diff --git a/package/hostapd/patches/320-optional_rfkill.patch b/package/hostapd/patches/320-optional_rfkill.patch
-index 7ec51b1..3808f9b 100644
---- a/package/hostapd/patches/320-optional_rfkill.patch
-+++ b/package/hostapd/patches/320-optional_rfkill.patch
-@@ -1,221 +1,6 @@
----- a/src/drivers/driver_nl80211.c
--+++ b/src/drivers/driver_nl80211.c
--@@ -254,7 +254,9 @@ struct wpa_driver_nl80211_data {
-- 	int if_removed;
-- 	int if_disabled;
-- 	int ignore_if_down_event;
--+#ifdef CONFIG_RFKILL
-- 	struct rfkill_data *rfkill;
--+#endif
-- 	struct wpa_driver_capa capa;
-- 	u8 *extended_capa, *extended_capa_mask;
-- 	unsigned int extended_capa_len;
--@@ -3630,7 +3632,7 @@ static int wpa_driver_nl80211_init_nl(st
-- 	return 0;
-- }
-- 
---
--+#ifdef CONFIG_RFKILL
-- static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
-- {
-- 	wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
--@@ -3652,6 +3654,7 @@ static void wpa_driver_nl80211_rfkill_un
-- 	}
-- 	/* rtnetlink ifup handler will report interface as enabled */
-- }
--+#endif /* CONFIG_RFKILL */
-- 
-- 
-- static void wpa_driver_nl80211_handle_eapol_tx_status(int sock,
--@@ -3740,7 +3743,9 @@ static void * wpa_driver_nl80211_drv_ini
-- 					  const u8 *set_addr)
-- {
-- 	struct wpa_driver_nl80211_data *drv;
--+#ifdef CONFIG_RFKILL
-- 	struct rfkill_config *rcfg;
--+#endif
-- 	struct i802_bss *bss;
-- 
-- 	if (global_priv == NULL)
--@@ -3778,6 +3783,7 @@ static void * wpa_driver_nl80211_drv_ini
-- 	if (nl80211_init_bss(bss))
-- 		goto failed;
-- 
--+#ifdef CONFIG_RFKILL
-- 	rcfg = os_zalloc(sizeof(*rcfg));
-- 	if (rcfg == NULL)
-- 		goto failed;
--@@ -3790,6 +3796,7 @@ static void * wpa_driver_nl80211_drv_ini
-- 		wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
-- 		os_free(rcfg);
-- 	}
--+#endif /* CONFIG_RFKILL */
-- 
-- 	if (linux_iface_up(drv->global->ioctl_sock, ifname) > 0)
-- 		drv->start_iface_up = 1;
--@@ -4116,10 +4123,12 @@ static void nl80211_mgmt_unsubscribe(str
-- }
-- 
-- 
--+#ifdef CONFIG_RFKILL
-- static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
-- {
-- 	wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
-- }
--+#endif /* CONFIG_RFKILL */
-- 
-- 
-- static void nl80211_del_p2pdev(struct i802_bss *bss)
--@@ -4246,13 +4255,16 @@ wpa_driver_nl80211_finish_drv_init(struc
-- 	}
-- 
-- 	if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
--+#ifdef CONFIG_RFKILL
-- 		if (rfkill_is_blocked(drv->rfkill)) {
-- 			wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
-- 				   "interface '%s' due to rfkill",
-- 				   bss->ifname);
-- 			drv->if_disabled = 1;
-- 			send_rfkill_event = 1;
---		} else {
--+		} else
--+#endif
--+		{
-- 			wpa_printf(MSG_ERROR, "nl80211: Could not set "
-- 				   "interface '%s' UP", bss->ifname);
-- 			return -1;
--@@ -4268,8 +4280,10 @@ wpa_driver_nl80211_finish_drv_init(struc
-- 		return -1;
-- 
-- 	if (send_rfkill_event) {
--+#ifdef CONFIG_RFKILL
-- 		eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
-- 				       drv, drv->ctx);
--+#endif
-- 	}
-- 
-- 	return 0;
--@@ -4347,7 +4361,9 @@ static void wpa_driver_nl80211_deinit(st
-- 
-- 	netlink_send_oper_ifla(drv->global->netlink, drv->ifindex, 0,
-- 			       IF_OPER_UP);
--+#ifdef CONFIG_RFKILL
-- 	rfkill_deinit(drv->rfkill);
--+#endif
-- 
-- 	eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
-- 
----- a/src/drivers/driver_wext.c
--+++ b/src/drivers/driver_wext.c
--@@ -740,7 +740,7 @@ static void wpa_driver_wext_event_rtm_de
-- 	}
-- }
-- 
---
--+#ifdef CONFIG_RFKILL
-- static void wpa_driver_wext_rfkill_blocked(void *ctx)
-- {
-- 	wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
--@@ -762,7 +762,7 @@ static void wpa_driver_wext_rfkill_unblo
-- 	}
-- 	/* rtnetlink ifup handler will report interface as enabled */
-- }
---
--+#endif /* CONFIG_RFKILL */
-- 
-- static void wext_get_phy_name(struct wpa_driver_wext_data *drv)
-- {
--@@ -808,7 +808,9 @@ void * wpa_driver_wext_init(void *ctx, c
-- {
-- 	struct wpa_driver_wext_data *drv;
-- 	struct netlink_config *cfg;
--+#ifdef CONFIG_RFKILL
-- 	struct rfkill_config *rcfg;
--+#endif
-- 	char path[128];
-- 	struct stat buf;
-- 
--@@ -843,6 +845,7 @@ void * wpa_driver_wext_init(void *ctx, c
-- 		goto err2;
-- 	}
-- 
--+#ifdef CONFIG_RFKILL
-- 	rcfg = os_zalloc(sizeof(*rcfg));
-- 	if (rcfg == NULL)
-- 		goto err3;
--@@ -855,6 +858,7 @@ void * wpa_driver_wext_init(void *ctx, c
-- 		wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
-- 		os_free(rcfg);
-- 	}
--+#endif /* CONFIG_RFKILL */
-- 
-- 	drv->mlme_sock = -1;
-- 
--@@ -872,7 +876,9 @@ void * wpa_driver_wext_init(void *ctx, c
-- 	return drv;
-- 
-- err3:
--+#ifdef CONFIG_RFKILL
-- 	rfkill_deinit(drv->rfkill);
--+#endif
-- 	netlink_deinit(drv->netlink);
-- err2:
-- 	close(drv->ioctl_sock);
--@@ -882,10 +888,12 @@ err1:
-- }
-- 
-- 
--+#ifdef CONFIG_RFKILL
-- static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
-- {
-- 	wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
-- }
--+#endif /* CONFIG_RFKILL */
-- 
-- 
-- static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
--@@ -893,13 +901,16 @@ static int wpa_driver_wext_finish_drv_in
-- 	int send_rfkill_event = 0;
-- 
-- 	if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
--+#ifdef CONFIG_RFKILL
-- 		if (rfkill_is_blocked(drv->rfkill)) {
-- 			wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
-- 				   "interface '%s' due to rfkill",
-- 				   drv->ifname);
-- 			drv->if_disabled = 1;
-- 			send_rfkill_event = 1;
---		} else {
--+		} else
--+#endif
--+		{
-- 			wpa_printf(MSG_ERROR, "WEXT: Could not set "
-- 				   "interface '%s' UP", drv->ifname);
-- 			return -1;
--@@ -947,8 +958,10 @@ static int wpa_driver_wext_finish_drv_in
-- 			       1, IF_OPER_DORMANT);
-- 
-- 	if (send_rfkill_event) {
--+#ifdef CONFIG_RFKILL
-- 		eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
-- 				       drv, drv->ctx);
--+#endif
-- 	}
-- 
-- 	return 0;
--@@ -978,7 +991,9 @@ void wpa_driver_wext_deinit(void *priv)
-- 
-- 	netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
-- 	netlink_deinit(drv->netlink);
--+#ifdef CONFIG_RFKILL
-- 	rfkill_deinit(drv->rfkill);
--+#endif
-- 
-- 	if (drv->mlme_sock >= 0)
-- 		eloop_unregister_read_sock(drv->mlme_sock);
- --- a/src/drivers/drivers.mak
- +++ b/src/drivers/drivers.mak
--@@ -25,7 +25,6 @@ NEED_SME=y
-+@@ -30,7 +30,6 @@ NEED_SME=y
-  NEED_AP_MLME=y
-  NEED_NETLINK=y
-  NEED_LINUX_IOCTL=y
-@@ -223,7 +8,7 @@
-  
-  ifdef CONFIG_LIBNL32
-    DRV_LIBS += -lnl-3
--@@ -109,7 +108,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
-+@@ -114,7 +113,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
-  CONFIG_WIRELESS_EXTENSION=y
-  NEED_NETLINK=y
-  NEED_LINUX_IOCTL=y
-@@ -231,7 +16,7 @@
-  endif
-  
-  ifdef CONFIG_DRIVER_NDIS
--@@ -135,7 +133,6 @@ endif
-+@@ -140,7 +138,6 @@ endif
-  ifdef CONFIG_WIRELESS_EXTENSION
-  DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
-  DRV_WPA_OBJS += ../src/drivers/driver_wext.o
-@@ -239,7 +24,7 @@
-  endif
-  
-  ifdef NEED_NETLINK
--@@ -148,6 +145,7 @@ endif
-+@@ -153,6 +150,7 @@ endif
-  
-  ifdef NEED_RFKILL
-  DRV_OBJS += ../src/drivers/rfkill.o
-@@ -247,15 +32,30 @@
-  endif
-  
-  ifdef CONFIG_VLAN_NETLINK
----- a/src/drivers/driver_wext.h
--+++ b/src/drivers/driver_wext.h
--@@ -22,7 +22,9 @@ struct wpa_driver_wext_data {
-- 	int ifindex2;
-- 	int if_removed;
-- 	int if_disabled;
--+#ifdef CONFIG_RFKILL
-- 	struct rfkill_data *rfkill;
--+#endif
-- 	u8 *assoc_req_ies;
-- 	size_t assoc_req_ies_len;
-- 	u8 *assoc_resp_ies;
-+--- a/src/drivers/rfkill.h
-++++ b/src/drivers/rfkill.h
-+@@ -18,8 +18,24 @@ struct rfkill_config {
-+ 	void (*unblocked_cb)(void *ctx);
-+ };
-+ 
-++#ifdef CONFIG_RFKILL
-+ struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
-+ void rfkill_deinit(struct rfkill_data *rfkill);
-+ int rfkill_is_blocked(struct rfkill_data *rfkill);
-++#else
-++static inline struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
-++{
-++	return (void *) 1;
-++}
-++
-++static inline void rfkill_deinit(struct rfkill_data *rfkill)
-++{
-++}
-++
-++static inline int rfkill_is_blocked(struct rfkill_data *rfkill)
-++{
-++	return 0;
-++}
-++#endif
-+ 
-+ #endif /* RFKILL_H */
-diff --git a/package/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
-index a505a60..dbc9ef8 100644
---- a/package/hostapd/patches/330-nl80211_fix_set_freq.patch
-+++ b/package/hostapd/patches/330-nl80211_fix_set_freq.patch
-@@ -1,15 +1,15 @@
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
--@@ -6860,7 +6860,7 @@ static int wpa_driver_nl80211_set_freq(s
-- 
-- 	nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_WIPHY);
-+@@ -7488,7 +7488,7 @@ static int nl80211_set_channel(struct i8
-+ 	nl80211_cmd(drv, msg, 0, set_chan ? NL80211_CMD_SET_CHANNEL :
-+ 		    NL80211_CMD_SET_WIPHY);
-  
- -	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
- +	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
-  	if (nl80211_put_freq_params(msg, freq) < 0)
-  		goto nla_put_failure;
-  
--@@ -11322,7 +11322,7 @@ static int nl80211_switch_channel(void *
-+@@ -12047,7 +12047,7 @@ static int nl80211_switch_channel(void *
-  		return -ENOMEM;
-  
-  	nl80211_cmd(drv, msg, 0, NL80211_CMD_CHANNEL_SWITCH);
-diff --git a/package/hostapd/patches/340-reload_freq_change.patch b/package/hostapd/patches/340-reload_freq_change.patch
-index 9316794..d3e8918 100644
---- a/package/hostapd/patches/340-reload_freq_change.patch
-+++ b/package/hostapd/patches/340-reload_freq_change.patch
-@@ -1,6 +1,6 @@
- --- a/src/ap/hostapd.c
- +++ b/src/ap/hostapd.c
--@@ -72,6 +72,16 @@ static void hostapd_reload_bss(struct ho
-+@@ -70,6 +70,16 @@ static void hostapd_reload_bss(struct ho
-  #endif /* CONFIG_NO_RADIUS */
-  
-  	ssid = &hapd->conf->ssid;
-@@ -17,7 +17,7 @@
-  	if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next &&
-  	    ssid->wpa_passphrase_set && ssid->wpa_passphrase) {
-  		/*
--@@ -172,6 +182,9 @@ int hostapd_reload_config(struct hostapd
-+@@ -170,20 +180,12 @@ int hostapd_reload_config(struct hostapd
-  	oldconf = hapd->iconf;
-  	iface->conf = newconf;
-  
-@@ -27,3 +27,17 @@
-  	for (j = 0; j < iface->num_bss; j++) {
-  		hapd = iface->bss[j];
-  		hapd->iconf = newconf;
-+-		hapd->iconf->channel = oldconf->channel;
-+-		hapd->iconf->secondary_channel = oldconf->secondary_channel;
-+-		hapd->iconf->ieee80211n = oldconf->ieee80211n;
-+-		hapd->iconf->ieee80211ac = oldconf->ieee80211ac;
-+-		hapd->iconf->ht_capab = oldconf->ht_capab;
-+-		hapd->iconf->vht_capab = oldconf->vht_capab;
-+-		hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth;
-+-		hapd->iconf->vht_oper_centr_freq_seg0_idx =
-+-			oldconf->vht_oper_centr_freq_seg0_idx;
-+-		hapd->iconf->vht_oper_centr_freq_seg1_idx =
-+-			oldconf->vht_oper_centr_freq_seg1_idx;
-+ 		hapd->conf = newconf->bss[j];
-+ 		hostapd_reload_bss(hapd);
-+ 	}
-diff --git a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
-index 885922c..e6f6cf3 100644
---- a/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
-+++ b/package/hostapd/patches/350-nl80211_del_beacon_bss.patch
-@@ -1,6 +1,6 @@
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
--@@ -4290,18 +4290,20 @@ wpa_driver_nl80211_finish_drv_init(struc
-+@@ -4817,18 +4817,20 @@ wpa_driver_nl80211_finish_drv_init(struc
-  }
-  
-  
-@@ -24,7 +24,7 @@
-  
-  	return send_and_recv_msgs(drv, msg, NULL, NULL);
-   nla_put_failure:
--@@ -4309,6 +4311,15 @@ static int wpa_driver_nl80211_del_beacon
-+@@ -4836,6 +4838,15 @@ static int wpa_driver_nl80211_del_beacon
-  	return -ENOBUFS;
-  }
-  
-@@ -40,7 +40,7 @@
-  
-  /**
-   * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
--@@ -9911,7 +9922,6 @@ static int wpa_driver_nl80211_stop_ap(vo
-+@@ -10617,7 +10628,6 @@ static int wpa_driver_nl80211_stop_ap(vo
-  	if (!is_ap_interface(drv->nlmode))
-  		return -1;
-  	wpa_driver_nl80211_del_beacon(drv);
-diff --git a/package/hostapd/patches/360-ctrl_iface_reload.patch b/package/hostapd/patches/360-ctrl_iface_reload.patch
-index 170d4f2..e69c3d3 100644
---- a/package/hostapd/patches/360-ctrl_iface_reload.patch
-+++ b/package/hostapd/patches/360-ctrl_iface_reload.patch
-@@ -1,6 +1,6 @@
- --- a/hostapd/ctrl_iface.c
- +++ b/hostapd/ctrl_iface.c
--@@ -34,6 +34,7 @@
-+@@ -37,6 +37,7 @@
-  #include "wps/wps.h"
-  #include "config_file.h"
-  #include "ctrl_iface.h"
-@@ -8,7 +8,7 @@
-  
-  
-  struct wpa_ctrl_dst {
--@@ -44,6 +45,7 @@ struct wpa_ctrl_dst {
-+@@ -47,6 +48,7 @@ struct wpa_ctrl_dst {
-  	int errors;
-  };
-  
-@@ -16,7 +16,7 @@
-  
-  static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
-  				    const char *buf, size_t len);
--@@ -153,6 +155,68 @@ static int hostapd_ctrl_iface_new_sta(st
-+@@ -156,6 +158,68 @@ static int hostapd_ctrl_iface_new_sta(st
-  	return 0;
-  }
-  
-@@ -85,14 +85,14 @@
-  
-  #ifdef CONFIG_IEEE80211W
-  #ifdef NEED_AP_MLME
--@@ -1199,6 +1263,10 @@ static void hostapd_ctrl_iface_receive(i
-- 				reply_len += res;
-- 		}
-- #endif /* CONFIG_NO_RADIUS */
-+@@ -1546,6 +1610,10 @@ static void hostapd_ctrl_iface_receive(i
-+ 	} else if (os_strncmp(buf, "VENDOR ", 7) == 0) {
-+ 		reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply,
-+ 						      reply_size);
- +	} else if (os_strcmp(buf, "DOWN") == 0) {
- +		hostapd_ctrl_iface_set_down(hapd);
- +	} else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
- +		hostapd_ctrl_iface_update(hapd, buf + 7);
-- 	} else if (os_strcmp(buf, "STA-FIRST") == 0) {
-- 		reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
-- 							 reply_size);
-+ 
-+ 	} else {
-+ 		os_memcpy(reply, "UNKNOWN COMMAND\n", 16);
-diff --git a/package/hostapd/patches/370-ap_sta_support.patch b/package/hostapd/patches/370-ap_sta_support.patch
-index a3d0572..8a92ead 100644
---- a/package/hostapd/patches/370-ap_sta_support.patch
-+++ b/package/hostapd/patches/370-ap_sta_support.patch
-@@ -1,6 +1,6 @@
- --- a/wpa_supplicant/wpa_supplicant_i.h
- +++ b/wpa_supplicant/wpa_supplicant_i.h
--@@ -96,6 +96,11 @@ struct wpa_interface {
-+@@ -108,6 +108,11 @@ struct wpa_interface {
-  	const char *ifname;
-  
-  	/**
-@@ -12,7 +12,7 @@
-  	 * bridge_ifname - Optional bridge interface name
-  	 *
-  	 * If the driver interface (ifname) is included in a Linux bridge
--@@ -325,6 +330,8 @@ struct wpa_supplicant {
-+@@ -395,6 +400,8 @@ struct wpa_supplicant {
-  #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
-  	char bridge_ifname[16];
-  
-@@ -20,12 +20,12 @@
- +
-  	char *confname;
-  	char *confanother;
-- 	struct wpa_config *conf;
-+ 
- --- a/wpa_supplicant/Makefile
- +++ b/wpa_supplicant/Makefile
- @@ -13,6 +13,10 @@ PKG_CONFIG ?= pkg-config
-- CFLAGS += -I../src
-- CFLAGS += -I../src/utils
-+ CFLAGS += -I$(abspath ../src)
-+ CFLAGS += -I$(abspath ../src/utils)
-  
- +ifdef MULTICALL
- +CFLAGS += -DMULTICALL
-@@ -34,7 +34,7 @@
-  -include .config
-  -include $(if $(MULTICALL),../hostapd/.config)
-  
--@@ -76,6 +80,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
-+@@ -82,6 +86,8 @@ OBJS_c = wpa_cli.o ../src/common/wpa_ctr
-  OBJS_c += ../src/utils/wpa_debug.o
-  OBJS_c += ../src/utils/common.o
-  
-@@ -45,9 +45,9 @@
-  CONFIG_OS=win32
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
--@@ -109,6 +109,46 @@ extern int wpa_debug_show_keys;
-- extern int wpa_debug_timestamp;
-- extern struct wpa_driver_ops *wpa_drivers[];
-+@@ -105,6 +105,55 @@ const char *wpa_supplicant_full_license5
-+ "\n";
-+ #endif /* CONFIG_NO_STDOUT_DEBUG */
-  
- +static int hostapd_stop(struct wpa_supplicant *wpa_s)
- +{
-@@ -69,14 +69,23 @@
- +	int len = sizeof(buf);
- +	enum hostapd_hw_mode hw_mode;
- +	u8 channel;
-++	int sec_chan = 0;
- +	int ret;
- +
- +	if (!bss)
- +		return;
- +
-++	if (bss->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH) {
-++		int sec = bss->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK;
-++		if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE)
-++			sec_chan = 1;
-++		else if (sec ==  HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW)
-++			sec_chan = -1;
-++	}
-++
- +	hw_mode = ieee80211_freq_to_chan(bss->freq, &channel);
--+	if (asprintf(&cmd, "UPDATE channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d",
--+		     channel, hw_mode, !!bss->ht_capab) < 0)
-++	if (asprintf(&cmd, "UPDATE channel=%d sec_chan=%d hw_mode=%d ieee80211n=%d",
-++		     channel, sec_chan, hw_mode, !!bss->ht_capab) < 0)
- +		return -1;
- +
- +	ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL);
-@@ -92,7 +101,7 @@
-  /* Configure default/group WEP keys for static WEP */
-  int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
-  {
--@@ -685,8 +725,12 @@ void wpa_supplicant_set_state(struct wpa
-+@@ -711,8 +760,12 @@ void wpa_supplicant_set_state(struct wpa
-  #endif /* CONFIG_P2P */
-  
-  		sme_sched_obss_scan(wpa_s, 1);
-@@ -105,7 +114,7 @@
-  		wpa_s->new_connection = 1;
-  		wpa_drv_set_operstate(wpa_s, 0);
-  #ifndef IEEE8021X_EAPOL
--@@ -2906,6 +2950,20 @@ static int wpa_supplicant_init_iface(str
-+@@ -3595,6 +3648,20 @@ static int wpa_supplicant_init_iface(str
-  			   sizeof(wpa_s->bridge_ifname));
-  	}
-  
-@@ -126,7 +135,7 @@
-  	/* RSNA Supplicant Key Management - INITIALIZE */
-  	eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
-  	eapol_sm_notify_portValid(wpa_s->eapol, FALSE);
--@@ -3125,6 +3183,11 @@ static void wpa_supplicant_deinit_iface(
-+@@ -3798,6 +3865,11 @@ static void wpa_supplicant_deinit_iface(
-  	if (terminate)
-  		wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING);
-  
-@@ -148,41 +157,45 @@
-  #include "drivers/driver.h"
-  #include "wpa_supplicant_i.h"
-  #include "config.h"
--@@ -245,6 +246,9 @@ static void calculate_update_time(const 
-+@@ -247,6 +248,10 @@ static void calculate_update_time(const 
-  static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src,
-- 			     struct os_time *fetch_time)
-+ 			     struct os_reltime *fetch_time)
-  {
- +	struct ieee80211_ht_capabilities *capab;
-++	struct ieee80211_ht_operation *oper;
- +	struct ieee802_11_elems elems;
- +
-  	dst->flags = src->flags;
-  	os_memcpy(dst->bssid, src->bssid, ETH_ALEN);
-  	dst->freq = src->freq;
--@@ -255,6 +259,12 @@ static void wpa_bss_copy_res(struct wpa_
-+@@ -257,6 +262,15 @@ static void wpa_bss_copy_res(struct wpa_
-  	dst->level = src->level;
-  	dst->tsf = src->tsf;
-  
- +	memset(&elems, 0, sizeof(elems));
- +	ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0);
- +	capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities;
-++	oper = (struct ieee80211_ht_operation *) elems.ht_operation;
- +	if (capab)
- +		dst->ht_capab = le_to_host16(capab->ht_capabilities_info);
-++	if (oper)
-++		dst->ht_param = oper->ht_param;
- +
-  	calculate_update_time(fetch_time, src->age, &dst->last_update);
-  }
-  
- --- a/wpa_supplicant/main.c
- +++ b/wpa_supplicant/main.c
--@@ -27,7 +27,7 @@ static void usage(void)
-- 	       "  wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] "
-+@@ -33,7 +33,7 @@ static void usage(void)
-+ 	       "vW] [-P<pid file>] "
-  	       "[-g<global ctrl>] \\\n"
-  	       "        [-G<group>] \\\n"
- -	       "        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
- +	       "        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>] "
-  	       "[-p<driver_param>] \\\n"
-- 	       "        [-b<br_ifname>] [-f<debug file>] [-e<entropy file>] "
-- 	       "\\\n"
--@@ -72,6 +72,7 @@ static void usage(void)
-+ 	       "        [-b<br_ifname>] [-e<entropy file>]"
-+ #ifdef CONFIG_DEBUG_FILE
-+@@ -84,6 +84,7 @@ static void usage(void)
-  #endif /* CONFIG_DEBUG_LINUX_TRACING */
-  	printf("  -t = include timestamp in debug messages\n"
-  	       "  -h = show this help text\n"
-@@ -190,16 +203,16 @@
-  	       "  -L = show license (BSD)\n"
-  	       "  -o = override driver parameter for new interfaces\n"
-  	       "  -O = override ctrl_interface parameter for new interfaces\n"
--@@ -160,7 +161,7 @@ int main(int argc, char *argv[])
-+@@ -175,7 +176,7 @@ int main(int argc, char *argv[])
-  
-  	for (;;) {
-  		c = getopt(argc, argv,
---			   "b:Bc:C:D:de:f:g:G:hi:I:KLNo:O:p:P:qsTtuvW");
--+			   "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
-+-			   "b:Bc:C:D:de:f:g:G:hi:I:KLm:No:O:p:P:qsTtuvW");
-++			   "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
-  		if (c < 0)
-  			break;
-  		switch (c) {
--@@ -207,6 +208,9 @@ int main(int argc, char *argv[])
-+@@ -222,6 +223,9 @@ int main(int argc, char *argv[])
-  			usage();
-  			exitcode = 0;
-  			goto out;
-@@ -211,12 +224,14 @@
-  			break;
- --- a/wpa_supplicant/bss.h
- +++ b/wpa_supplicant/bss.h
--@@ -69,6 +69,8 @@ struct wpa_bss {
-+@@ -70,6 +70,10 @@ struct wpa_bss {
-  	u8 ssid[32];
-  	/** Length of SSID */
-  	size_t ssid_len;
- +	/** HT caapbilities */
- +	u16 ht_capab;
-++	/* Five octets of HT Operation Information */
-++	u8 ht_param;
-  	/** Frequency of the channel in MHz (e.g., 2412 = channel 1) */
-  	int freq;
-  	/** Beacon interval in TUs (host byte order) */
-diff --git a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
-index 27f21bd..dee1ab3 100644
---- a/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
-+++ b/package/hostapd/patches/380-disable_ctrl_iface_mib.patch
-@@ -1,6 +1,6 @@
- --- a/hostapd/Makefile
- +++ b/hostapd/Makefile
--@@ -144,6 +144,9 @@ endif
-+@@ -163,6 +163,9 @@ endif
-  ifdef CONFIG_NO_CTRL_IFACE
-  CFLAGS += -DCONFIG_NO_CTRL_IFACE
-  else
-@@ -12,28 +12,15 @@
-  endif
- --- a/hostapd/ctrl_iface.c
- +++ b/hostapd/ctrl_iface.c
--@@ -1234,6 +1234,7 @@ static void hostapd_ctrl_iface_receive(i
-- 	} else if (os_strcmp(buf, "STATUS") == 0) {
-- 		reply_len = hostapd_ctrl_iface_status(hapd, reply,
-+@@ -1447,6 +1447,7 @@ static void hostapd_ctrl_iface_receive(i
-  						      reply_size);
-+ 	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) {
-+ 		reply_len = hostapd_drv_status(hapd, reply, reply_size);
- +#ifdef CONFIG_CTRL_IFACE_MIB
-  	} else if (os_strcmp(buf, "MIB") == 0) {
-  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size);
-  		if (reply_len >= 0) {
--@@ -1263,10 +1264,12 @@ static void hostapd_ctrl_iface_receive(i
-- 				reply_len += res;
-- 		}
-- #endif /* CONFIG_NO_RADIUS */
--+#endif
-- 	} else if (os_strcmp(buf, "DOWN") == 0) {
-- 		hostapd_ctrl_iface_set_down(hapd);
-- 	} else if (os_strncmp(buf, "UPDATE ", 7) == 0) {
-- 		hostapd_ctrl_iface_update(hapd, buf + 7);
--+#ifdef CONFIG_CTRL_IFACE_MIB
-- 	} else if (os_strcmp(buf, "STA-FIRST") == 0) {
-- 		reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
-- 							 reply_size);
--@@ -1276,6 +1279,7 @@ static void hostapd_ctrl_iface_receive(i
-+@@ -1488,6 +1489,7 @@ static void hostapd_ctrl_iface_receive(i
-  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
-  		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply,
-  							reply_size);
-@@ -43,7 +30,7 @@
-  			reply_len = -1;
- --- a/wpa_supplicant/Makefile
- +++ b/wpa_supplicant/Makefile
--@@ -778,6 +778,9 @@ ifdef CONFIG_WNM
-+@@ -805,6 +805,9 @@ ifdef CONFIG_WNM
-  OBJS += ../src/ap/wnm_ap.o
-  endif
-  ifdef CONFIG_CTRL_IFACE
-@@ -55,7 +42,7 @@
-  
- --- a/wpa_supplicant/ctrl_iface.c
- +++ b/wpa_supplicant/ctrl_iface.c
--@@ -5262,6 +5262,7 @@ char * wpa_supplicant_ctrl_iface_process
-+@@ -6243,6 +6243,7 @@ char * wpa_supplicant_ctrl_iface_process
-  			reply_len = -1;
-  	} else if (os_strncmp(buf, "NOTE ", 5) == 0) {
-  		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
-@@ -63,7 +50,7 @@
-  	} else if (os_strcmp(buf, "MIB") == 0) {
-  		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
-  		if (reply_len >= 0) {
--@@ -5273,6 +5274,7 @@ char * wpa_supplicant_ctrl_iface_process
-+@@ -6254,6 +6255,7 @@ char * wpa_supplicant_ctrl_iface_process
-  			else
-  				reply_len += res;
-  		}
-@@ -71,7 +58,7 @@
-  	} else if (os_strncmp(buf, "STATUS", 6) == 0) {
-  		reply_len = wpa_supplicant_ctrl_iface_status(
-  			wpa_s, buf + 6, reply, reply_size);
--@@ -5687,6 +5689,7 @@ char * wpa_supplicant_ctrl_iface_process
-+@@ -6661,6 +6663,7 @@ char * wpa_supplicant_ctrl_iface_process
-  		reply_len = wpa_supplicant_ctrl_iface_bss(
-  			wpa_s, buf + 4, reply, reply_size);
-  #ifdef CONFIG_AP
-@@ -79,7 +66,7 @@
-  	} else if (os_strcmp(buf, "STA-FIRST") == 0) {
-  		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
-  	} else if (os_strncmp(buf, "STA ", 4) == 0) {
--@@ -5695,6 +5698,7 @@ char * wpa_supplicant_ctrl_iface_process
-+@@ -6669,6 +6672,7 @@ char * wpa_supplicant_ctrl_iface_process
-  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
-  		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
-  						   reply_size);
-@@ -89,15 +76,15 @@
-  			reply_len = -1;
- --- a/src/ap/ctrl_iface_ap.c
- +++ b/src/ap/ctrl_iface_ap.c
--@@ -20,6 +20,7 @@
-+@@ -21,6 +21,7 @@
-  #include "ctrl_iface_ap.h"
-  #include "ap_drv_ops.h"
-  
- +#ifdef CONFIG_CTRL_IFACE_MIB
-  
-- static int hostapd_get_sta_conn_time(struct sta_info *sta,
-- 				     char *buf, size_t buflen)
--@@ -129,6 +130,7 @@ int hostapd_ctrl_iface_sta_next(struct h
-+ static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
-+ 				 struct sta_info *sta,
-+@@ -214,6 +215,7 @@ int hostapd_ctrl_iface_sta_next(struct h
-  	return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen);
-  }
-  
-@@ -105,14 +92,14 @@
-  
-  #ifdef CONFIG_P2P_MANAGER
-  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype,
--@@ -423,3 +425,4 @@ int hostapd_parse_csa_settings(const cha
-+@@ -526,3 +528,4 @@ int hostapd_parse_csa_settings(const cha
-  
-  	return 0;
-  }
- +
- --- a/src/ap/ieee802_1x.c
- +++ b/src/ap/ieee802_1x.c
--@@ -1938,6 +1938,7 @@ static const char * bool_txt(Boolean boo
-+@@ -2124,6 +2124,7 @@ static const char * bool_txt(Boolean boo
-  	return bool_val ? "TRUE" : "FALSE";
-  }
-  
-@@ -120,17 +107,17 @@
-  
-  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
-  {
--@@ -2090,6 +2091,7 @@ int ieee802_1x_get_mib_sta(struct hostap
-+@@ -2291,6 +2292,7 @@ int ieee802_1x_get_mib_sta(struct hostap
-  	return len;
-  }
-  
- +#endif
-  
-  static void ieee802_1x_finished(struct hostapd_data *hapd,
-- 				struct sta_info *sta, int success)
-+ 				struct sta_info *sta, int success,
- --- a/src/ap/wpa_auth.c
- +++ b/src/ap/wpa_auth.c
--@@ -2708,6 +2708,7 @@ static const char * wpa_bool_txt(int boo
-+@@ -2832,6 +2832,7 @@ static const char * wpa_bool_txt(int boo
-  	return bool ? "TRUE" : "FALSE";
-  }
-  
-@@ -138,7 +125,7 @@
-  
-  #define RSN_SUITE "%02x-%02x-%02x-%d"
-  #define RSN_SUITE_ARG(s) \
--@@ -2852,7 +2853,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
-+@@ -2976,7 +2977,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
-  
-  	return len;
-  }
-@@ -149,7 +136,7 @@
-  {
- --- a/src/rsn_supp/wpa.c
- +++ b/src/rsn_supp/wpa.c
--@@ -1844,6 +1844,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
-+@@ -1911,6 +1911,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
-  }
-  
-  
-@@ -158,7 +145,7 @@
-  #define RSN_SUITE "%02x-%02x-%02x-%d"
-  #define RSN_SUITE_ARG(s) \
-  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
--@@ -1927,6 +1929,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
-+@@ -1994,6 +1996,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
-  
-  	return (int) len;
-  }
-diff --git a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
-index 00a3222..40148fc 100644
---- a/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
-+++ b/package/hostapd/patches/390-wpa_ie_cap_workaround.patch
-@@ -1,6 +1,6 @@
- --- a/src/common/wpa_common.c
- +++ b/src/common/wpa_common.c
--@@ -959,6 +959,31 @@ const char * wpa_key_mgmt_txt(int key_mg
-+@@ -1002,6 +1002,31 @@ const char * wpa_key_mgmt_txt(int key_mg
-  }
-  
-  
-@@ -32,7 +32,7 @@
-  int wpa_compare_rsn_ie(int ft_initial_assoc,
-  		       const u8 *ie1, size_t ie1len,
-  		       const u8 *ie2, size_t ie2len)
--@@ -966,8 +991,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
-+@@ -1009,8 +1034,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
-  	if (ie1 == NULL || ie2 == NULL)
-  		return -1;
-  
-diff --git a/package/hostapd/patches/400-terminate_on_setup_failure.patch b/package/hostapd/patches/400-terminate_on_setup_failure.patch
-deleted file mode 100644
-index 0d9065a..0000000
---- a/package/hostapd/patches/400-terminate_on_setup_failure.patch
-+++ /dev/null
-@@ -1,85 +0,0 @@
----- a/src/ap/hostapd.c
--+++ b/src/ap/hostapd.c
--@@ -1103,13 +1103,8 @@ int hostapd_setup_interface_complete(str
-- 	size_t j;
-- 	u8 *prev_addr;
-- 
---	if (err) {
---		wpa_printf(MSG_ERROR, "Interface initialization failed");
---		hostapd_set_state(iface, HAPD_IFACE_DISABLED);
---		if (iface->interfaces && iface->interfaces->terminate_on_error)
---			eloop_terminate();
---		return -1;
---	}
--+	if (err)
--+		goto error;
-- 
-- 	wpa_printf(MSG_DEBUG, "Completing interface initialization");
-- 	if (iface->conf->channel) {
--@@ -1140,7 +1135,7 @@ int hostapd_setup_interface_complete(str
-- 				     hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
-- 			wpa_printf(MSG_ERROR, "Could not set channel for "
-- 				   "kernel driver");
---			return -1;
--+			goto error;
-- 		}
-- 	}
-- 
--@@ -1151,7 +1146,7 @@ int hostapd_setup_interface_complete(str
-- 			hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211,
-- 				       HOSTAPD_LEVEL_WARNING,
-- 				       "Failed to prepare rates table.");
---			return -1;
--+			goto error;
-- 		}
-- 	}
-- 
--@@ -1159,14 +1154,14 @@ int hostapd_setup_interface_complete(str
-- 	    hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) {
-- 		wpa_printf(MSG_ERROR, "Could not set RTS threshold for "
-- 			   "kernel driver");
---		return -1;
--+		goto error;
-- 	}
-- 
-- 	if (hapd->iconf->fragm_threshold > -1 &&
-- 	    hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) {
-- 		wpa_printf(MSG_ERROR, "Could not set fragmentation threshold "
-- 			   "for kernel driver");
---		return -1;
--+		goto error;
-- 	}
-- 
-- 	prev_addr = hapd->own_addr;
--@@ -1176,7 +1171,7 @@ int hostapd_setup_interface_complete(str
-- 		if (j)
-- 			os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN);
-- 		if (hostapd_setup_bss(hapd, j == 0))
---			return -1;
--+			goto error;
-- 		if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0)
-- 			prev_addr = hapd->own_addr;
-- 	}
--@@ -1191,7 +1186,7 @@ int hostapd_setup_interface_complete(str
-- 	if (hostapd_driver_commit(hapd) < 0) {
-- 		wpa_printf(MSG_ERROR, "%s: Failed to commit driver "
-- 			   "configuration", __func__);
---		return -1;
--+		goto error;
-- 	}
-- 
-- 	/*
--@@ -1216,6 +1211,13 @@ int hostapd_setup_interface_complete(str
-- 		iface->interfaces->terminate_on_error--;
-- 
-- 	return 0;
--+
--+error:
--+	wpa_printf(MSG_ERROR, "Interface initialization failed");
--+	hostapd_set_state(iface, HAPD_IFACE_DISABLED);
--+	if (iface->interfaces && iface->interfaces->terminate_on_error)
--+		eloop_terminate();
--+	return -1;
-- }
-- 
-- 
-diff --git a/package/hostapd/patches/410-bring_down_interface.patch b/package/hostapd/patches/410-bring_down_interface.patch
-index 31033a0..165484b 100644
---- a/package/hostapd/patches/410-bring_down_interface.patch
-+++ b/package/hostapd/patches/410-bring_down_interface.patch
-@@ -1,6 +1,6 @@
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
--@@ -8480,12 +8480,7 @@ static int wpa_driver_nl80211_set_mode(s
-+@@ -9070,12 +9070,7 @@ static int wpa_driver_nl80211_set_mode(s
-  			/* Try to set the mode again while the interface is
-  			 * down */
-  			ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
-@@ -14,7 +14,7 @@
-  				break;
-  		} else
-  			wpa_printf(MSG_DEBUG, "nl80211: Failed to set "
--@@ -8498,6 +8493,8 @@ static int wpa_driver_nl80211_set_mode(s
-+@@ -9088,6 +9083,8 @@ static int wpa_driver_nl80211_set_mode(s
-  			   "interface is down");
-  		drv->nlmode = nlmode;
-  		drv->ignore_if_down_event = 1;
-diff --git a/package/hostapd/patches/420-fix_wps_pin_crash.patch b/package/hostapd/patches/420-fix_wps_pin_crash.patch
-index 130bd53..31995c4 100644
---- a/package/hostapd/patches/420-fix_wps_pin_crash.patch
-+++ b/package/hostapd/patches/420-fix_wps_pin_crash.patch
-@@ -1,6 +1,6 @@
- --- a/hostapd/ctrl_iface.c
- +++ b/hostapd/ctrl_iface.c
--@@ -480,6 +480,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
-+@@ -540,6 +540,9 @@ static int hostapd_ctrl_iface_wps_ap_pin
-  	char *pos;
-  	const char *pin_txt;
-  
-diff --git a/package/hostapd/patches/430-wps_single_auth_enc_type.patch b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
-index 6e86658..8dae52b 100644
---- a/package/hostapd/patches/430-wps_single_auth_enc_type.patch
-+++ b/package/hostapd/patches/430-wps_single_auth_enc_type.patch
-@@ -1,6 +1,6 @@
- --- a/src/ap/wps_hostapd.c
- +++ b/src/ap/wps_hostapd.c
--@@ -1069,11 +1069,9 @@ int hostapd_init_wps(struct hostapd_data
-+@@ -1051,11 +1051,9 @@ int hostapd_init_wps(struct hostapd_data
-  
-  		if (conf->rsn_pairwise & WPA_CIPHER_CCMP)
-  			wps->encr_types |= WPS_ENCR_AES;
-@@ -14,7 +14,7 @@
-  		if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK)
-  			wps->auth_types |= WPS_AUTH_WPAPSK;
-  		if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X)
--@@ -1081,7 +1079,7 @@ int hostapd_init_wps(struct hostapd_data
-+@@ -1063,7 +1061,7 @@ int hostapd_init_wps(struct hostapd_data
-  
-  		if (conf->wpa_pairwise & WPA_CIPHER_CCMP)
-  			wps->encr_types |= WPS_ENCR_AES;
-diff --git a/package/hostapd/patches/440-dynamic_20_40_mhz.patch b/package/hostapd/patches/440-dynamic_20_40_mhz.patch
-deleted file mode 100644
-index 905ec2c..0000000
---- a/package/hostapd/patches/440-dynamic_20_40_mhz.patch
-+++ /dev/null
-@@ -1,206 +0,0 @@
----- a/hostapd/config_file.c
--+++ b/hostapd/config_file.c
--@@ -2422,6 +2422,10 @@ static int hostapd_config_fill(struct ho
-- 					   "ht_capab", line);
-- 				errors++;
-- 			}
--+		} else if (os_strcmp(buf, "dynamic_ht40") == 0) {
--+			conf->dynamic_ht40 = atoi(pos);
--+			if (conf->dynamic_ht40 == 1)
--+				conf->dynamic_ht40 = 1500;
-- 		} else if (os_strcmp(buf, "require_ht") == 0) {
-- 			conf->require_ht = atoi(pos);
-- 		} else if (os_strcmp(buf, "obss_interval") == 0) {
----- a/src/ap/ap_config.h
--+++ b/src/ap/ap_config.h
--@@ -531,6 +531,7 @@ struct hostapd_config {
-- 	int ieee80211n;
-- 	int secondary_channel;
-- 	int require_ht;
--+	int dynamic_ht40;
-- 	int obss_interval;
-- 	u32 vht_capab;
-- 	int ieee80211ac;
----- a/src/ap/hostapd.c
--+++ b/src/ap/hostapd.c
--@@ -23,6 +23,7 @@
-- #include "beacon.h"
-- #include "iapp.h"
-- #include "ieee802_1x.h"
--+#include "ieee802_11.h"
-- #include "ieee802_11_auth.h"
-- #include "vlan_init.h"
-- #include "wpa_auth.h"
--@@ -332,6 +333,7 @@ static void hostapd_cleanup(struct hosta
-- static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
-- {
-- 	wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface);
--+	hostapd_deinit_ht(iface);
-- 	hostapd_free_hw_features(iface->hw_features, iface->num_hw_features);
-- 	iface->hw_features = NULL;
-- 	os_free(iface->current_rates);
----- a/src/ap/hostapd.h
--+++ b/src/ap/hostapd.h
--@@ -326,6 +326,9 @@ struct hostapd_iface {
-- 	/* Overlapping BSS information */
-- 	int olbc_ht;
-- 
--+	int force_20mhz;
--+	struct os_time last_20mhz_trigger;
--+
-- 	u16 ht_op_mode;
-- 
-- 	/* surveying helpers */
----- a/src/ap/ieee802_11.c
--+++ b/src/ap/ieee802_11.c
--@@ -1538,6 +1538,9 @@ static void handle_beacon(struct hostapd
-- 					     sizeof(mgmt->u.beacon)), &elems,
-- 				      0);
-- 
--+	if (!elems.ht_capabilities)
--+		hostapd_trigger_20mhz(hapd->iface);
--+
-- 	ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);
-- }
-- 
----- a/src/ap/ieee802_11.h
--+++ b/src/ap/ieee802_11.h
--@@ -82,4 +82,17 @@ int hostapd_update_time_adv(struct hosta
-- void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr);
-- u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid);
-- 
--+#ifdef CONFIG_IEEE80211N
--+void hostapd_trigger_20mhz(struct hostapd_iface *iface);
--+void hostapd_deinit_ht(struct hostapd_iface *iface);
--+
--+#else
--+static inline void hostapd_deinit_ht(struct hostapd_iface *iface)
--+{
--+}
--+static inline void hostapd_trigger_20mhz(struct hostapd_iface *iface)
--+{
--+}
--+#endif /* CONFIG_IEEE80211N */
--+
-- #endif /* IEEE802_11_H */
----- a/src/ap/ieee802_11_ht.c
--+++ b/src/ap/ieee802_11_ht.c
--@@ -20,9 +20,11 @@
-- #include "drivers/driver.h"
-- #include "hostapd.h"
-- #include "ap_config.h"
--+#include "ap_drv_ops.h"
-- #include "sta_info.h"
-- #include "beacon.h"
-- #include "ieee802_11.h"
--+#include "utils/eloop.h"
-- 
-- 
-- u8 * hostapd_eid_ht_capabilities(struct hostapd_data *hapd, u8 *eid)
--@@ -86,12 +88,15 @@ u8 * hostapd_eid_ht_operation(struct hos
-- 
-- 	oper->control_chan = hapd->iconf->channel;
-- 	oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
---	if (hapd->iconf->secondary_channel == 1)
---		oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
---			HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
---	if (hapd->iconf->secondary_channel == -1)
---		oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
---			HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
--+
--+	if (!hapd->iface->force_20mhz) {
--+		if (hapd->iconf->secondary_channel == 1)
--+			oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
--+				HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
--+		if (hapd->iconf->secondary_channel == -1)
--+			oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
--+				HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
--+	}
-- 
-- 	pos += sizeof(*oper);
-- 
--@@ -286,3 +291,84 @@ void hostapd_get_ht_capab(struct hostapd
-- 
-- 	neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
-- }
--+
--+static void hostapd_set_force_20mhz(struct hostapd_iface *iface);
--+
--+static void hostapd_restore_40mhz(void *eloop_data, void *user_ctx)
--+{
--+	struct hostapd_iface *iface = eloop_data;
--+	struct os_time time;
--+	int timeout;
--+
--+	if (!iface->last_20mhz_trigger.sec)
--+	    return;
--+
--+	os_get_time(&time);
--+	timeout = iface->last_20mhz_trigger.sec + iface->conf->dynamic_ht40 -
--+		  time.sec;
--+
--+	if (timeout > 0) {
--+		eloop_register_timeout(timeout, 0, hostapd_restore_40mhz,
--+				       iface, NULL);
--+		return;
--+	}
--+
--+	iface->last_20mhz_trigger.sec = 0;
--+	iface->last_20mhz_trigger.usec = 0;
--+
--+	iface->force_20mhz = 0;
--+	hostapd_set_force_20mhz(iface);
--+}
--+
--+static void hostapd_set_force_20mhz(struct hostapd_iface *iface)
--+{
--+	int secondary_channel;
--+	int i;
--+
--+	ieee802_11_set_beacons(iface);
--+
--+	for (i = 0; i < iface->num_bss; i++) {
--+		struct hostapd_data *hapd = iface->bss[i];
--+
--+		if (iface->force_20mhz)
--+			secondary_channel = 0;
--+		else
--+			secondary_channel = hapd->iconf->secondary_channel;
--+
--+		if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
--+				     hapd->iconf->channel,
--+				     hapd->iconf->ieee80211n,
--+				     hapd->iconf->ieee80211ac,
--+				     secondary_channel,
--+				     hapd->iconf->vht_oper_chwidth,
--+				     hapd->iconf->vht_oper_centr_freq_seg0_idx,
--+				     hapd->iconf->vht_oper_centr_freq_seg1_idx)) {
--+			wpa_printf(MSG_ERROR, "Could not set channel for "
--+				   "kernel driver");
--+		}
--+	}
--+}
--+
--+void hostapd_deinit_ht(struct hostapd_iface *iface)
--+{
--+	eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
--+}
--+
--+void hostapd_trigger_20mhz(struct hostapd_iface *iface)
--+{
--+	if (!iface->conf->dynamic_ht40)
--+		return;
--+
--+	if (!iface->force_20mhz) {
--+		iface->force_20mhz = 1;
--+		hostapd_set_force_20mhz(iface);
--+	}
--+
--+	if (!iface->last_20mhz_trigger.sec) {
--+		eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
--+		eloop_register_timeout(iface->conf->dynamic_ht40, 0,
--+				       hostapd_restore_40mhz, iface, NULL);
--+	}
--+
--+	os_get_time(&iface->last_20mhz_trigger);
--+}
-diff --git a/package/hostapd/patches/450-limit_debug_messages.patch b/package/hostapd/patches/450-limit_debug_messages.patch
-index aaea941..08f17dc 100644
---- a/package/hostapd/patches/450-limit_debug_messages.patch
-+++ b/package/hostapd/patches/450-limit_debug_messages.patch
-@@ -20,40 +20,41 @@
-  {
-  	size_t i;
-  
--@@ -375,20 +375,9 @@ static void _wpa_hexdump(int level, cons
-+@@ -375,20 +375,8 @@ static void _wpa_hexdump(int level, cons
-  #endif /* CONFIG_ANDROID_LOG */
-  }
-  
---void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
-+-void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
- -{
- -	_wpa_hexdump(level, title, buf, len, 1);
- -}
- -
- -
---void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
-+-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
- -{
- -	_wpa_hexdump(level, title, buf, len, wpa_debug_show_keys);
- -}
-- 
- -
---static void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
-+-
-+-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
- -			       size_t len, int show)
--+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
-++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
- +			size_t len, int show)
-  {
-  	size_t i, llen;
-  	const u8 *pos = buf;
--@@ -495,19 +484,6 @@ static void _wpa_hexdump_ascii(int level
-+@@ -495,20 +483,6 @@ static void _wpa_hexdump_ascii(int level
-  }
-  
-  
---void wpa_hexdump_ascii(int level, const char *title, const u8 *buf, size_t len)
-+-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
-+-		       size_t len)
- -{
- -	_wpa_hexdump_ascii(level, title, buf, len, 1);
- -}
- -
- -
---void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
-+-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
- -			   size_t len)
- -{
- -	_wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
-@@ -63,7 +64,7 @@
-  #ifdef CONFIG_DEBUG_FILE
-  static char *last_path = NULL;
-  #endif /* CONFIG_DEBUG_FILE */
--@@ -591,7 +567,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
-+@@ -592,7 +566,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
-  }
-  
-  
-@@ -72,7 +73,7 @@
-  {
-  	va_list ap;
-  	char *buf;
--@@ -625,7 +601,7 @@ void wpa_msg(void *ctx, int level, const
-+@@ -630,7 +604,7 @@ void wpa_msg(void *ctx, int level, const
-  }
-  
-  
-@@ -83,14 +84,14 @@
-  	char *buf;
- --- a/src/utils/wpa_debug.h
- +++ b/src/utils/wpa_debug.h
--@@ -43,6 +43,17 @@ int wpa_debug_open_file(const char *path
-+@@ -47,6 +47,17 @@ int wpa_debug_open_file(const char *path
-  int wpa_debug_reopen_file(void);
-  void wpa_debug_close_file(void);
-  
- +/* internal */
- +void _wpa_hexdump(int level, const char *title, const u8 *buf,
- +		  size_t len, int show);
--+void _wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
-++void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
- +			size_t len, int show);
- +extern int wpa_debug_show_keys;
- +
-@@ -101,7 +102,7 @@
-  /**
-   * wpa_debug_printf_timestamp - Print timestamp for debug output
-   *
--@@ -63,9 +74,15 @@ void wpa_debug_print_timestamp(void);
-+@@ -67,9 +78,15 @@ void wpa_debug_print_timestamp(void);
-   *
-   * Note: New line '\n' is added to the end of the text when printing to stdout.
-   */
-@@ -118,11 +119,11 @@
-  /**
-   * wpa_hexdump - conditional hex dump
-   * @level: priority level (MSG_*) of the message
--@@ -77,7 +94,13 @@ PRINTF_FORMAT(2, 3);
-+@@ -81,7 +98,13 @@ PRINTF_FORMAT(2, 3);
-   * output may be directed to stdout, stderr, and/or syslog based on
-   * configuration. The contents of buf is printed out has hex dump.
-   */
---void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len);
-+-void wpa_hexdump(int level, const char *title, const void *buf, size_t len);
- +static inline void wpa_hexdump(int level, const char *title, const u8 *buf, size_t len)
- +{
- +	if (level < CONFIG_MSG_MIN_PRIORITY)
-@@ -133,11 +134,11 @@
-  
-  static inline void wpa_hexdump_buf(int level, const char *title,
-  				   const struct wpabuf *buf)
--@@ -99,7 +122,13 @@ static inline void wpa_hexdump_buf(int l
-+@@ -103,7 +126,13 @@ static inline void wpa_hexdump_buf(int l
-   * like wpa_hexdump(), but by default, does not include secret keys (passwords,
-   * etc.) in debug output.
-   */
---void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len);
-+-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len);
- +static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
- +{
- +	if (level < CONFIG_MSG_MIN_PRIORITY)
-@@ -148,11 +149,11 @@
-  
-  static inline void wpa_hexdump_buf_key(int level, const char *title,
-  				       const struct wpabuf *buf)
--@@ -121,8 +150,14 @@ static inline void wpa_hexdump_buf_key(i
-+@@ -125,8 +154,14 @@ static inline void wpa_hexdump_buf_key(i
-   * the hex numbers and ASCII characters (for printable range) are shown. 16
-   * bytes per line will be shown.
-   */
---void wpa_hexdump_ascii(int level, const char *title, const u8 *buf,
-+-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
- -		       size_t len);
- +static inline void wpa_hexdump_ascii(int level, const char *title,
- +				     const u8 *buf, size_t len)
-@@ -165,11 +166,11 @@
-  
-  /**
-   * wpa_hexdump_ascii_key - conditional hex dump, hide keys
--@@ -138,8 +173,14 @@ void wpa_hexdump_ascii(int level, const 
-+@@ -142,8 +177,14 @@ void wpa_hexdump_ascii(int level, const 
-   * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
-   * default, does not include secret keys (passwords, etc.) in debug output.
-   */
---void wpa_hexdump_ascii_key(int level, const char *title, const u8 *buf,
-+-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
- -			   size_t len);
- +static inline void wpa_hexdump_ascii_key(int level, const char *title,
- +					 const u8 *buf, size_t len)
-@@ -182,7 +183,7 @@
-  
-  /*
-   * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
--@@ -174,7 +215,12 @@ void wpa_hexdump_ascii_key(int level, co
-+@@ -178,7 +219,12 @@ void wpa_hexdump_ascii_key(int level, co
-   *
-   * Note: New line '\n' is added to the end of the text when printing to stdout.
-   */
-@@ -196,7 +197,7 @@
-  
-  /**
-   * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
--@@ -188,8 +234,13 @@ void wpa_msg(void *ctx, int level, const
-+@@ -192,8 +238,13 @@ void wpa_msg(void *ctx, int level, const
-   * attached ctrl_iface monitors. In other words, it can be used for frequent
-   * events that do not need to be sent to syslog.
-   */
-diff --git a/package/hostapd/patches/460-indicate-features.patch b/package/hostapd/patches/460-indicate-features.patch
-index 7a44da1..cee3e76 100644
---- a/package/hostapd/patches/460-indicate-features.patch
-+++ b/package/hostapd/patches/460-indicate-features.patch
-@@ -1,23 +1,23 @@
- --- a/hostapd/main.c
- +++ b/hostapd/main.c
--@@ -14,6 +14,7 @@
-- 
-+@@ -15,6 +15,7 @@
-  #include "utils/common.h"
-  #include "utils/eloop.h"
-+ #include "utils/uuid.h"
- +#include "utils/build_features.h"
-  #include "crypto/random.h"
-  #include "crypto/tls.h"
-  #include "common/version.h"
--@@ -546,7 +547,7 @@ int main(int argc, char *argv[])
-+@@ -558,7 +559,7 @@ int main(int argc, char *argv[])
-  
-  	wpa_supplicant_event = hostapd_wpa_event;
-  	for (;;) {
---		c = getopt(argc, argv, "b:Bde:f:hKP:Ttvg:G:");
--+		c = getopt(argc, argv, "b:Bde:f:hKP:Ttg:G:v::");
-+-		c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:vg:G:");
-++		c = getopt(argc, argv, "b:Bde:f:hKP:Ttu:g:G:v::");
-  		if (c < 0)
-  			break;
-  		switch (c) {
--@@ -583,6 +584,8 @@ int main(int argc, char *argv[])
-+@@ -595,6 +596,8 @@ int main(int argc, char *argv[])
-  			break;
-  #endif /* CONFIG_DEBUG_LINUX_TRACING */
-  		case 'v':
-@@ -36,16 +36,16 @@
-  #include "wpa_supplicant_i.h"
-  #include "driver_i.h"
-  #include "p2p_supplicant.h"
--@@ -161,7 +162,7 @@ int main(int argc, char *argv[])
-+@@ -176,7 +177,7 @@ int main(int argc, char *argv[])
-  
-  	for (;;) {
-  		c = getopt(argc, argv,
---			   "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuvW");
--+			   "b:Bc:C:D:de:f:g:G:hH:i:I:KLNo:O:p:P:qsTtuv::W");
-+-			   "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuvW");
-++			   "b:Bc:C:D:de:f:g:G:hH:i:I:KLm:No:O:p:P:qsTtuv::W");
-  		if (c < 0)
-  			break;
-  		switch (c) {
--@@ -259,8 +260,12 @@ int main(int argc, char *argv[])
-+@@ -279,8 +280,12 @@ int main(int argc, char *argv[])
-  			break;
-  #endif /* CONFIG_DBUS */
-  		case 'v':
-diff --git a/package/hostapd/patches/470-hostapd_cli_ifdef.patch b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
-index 5ac0fdd..d4a0f12 100644
---- a/package/hostapd/patches/470-hostapd_cli_ifdef.patch
-+++ b/package/hostapd/patches/470-hostapd_cli_ifdef.patch
-@@ -16,7 +16,7 @@
-  "   get_config           show current configuration\n"
-  "   help                 show this usage help\n"
-  "   interface [ifname]   show interfaces/select interface\n"
--@@ -352,7 +350,6 @@ static int hostapd_cli_cmd_sa_query(stru
-+@@ -362,7 +360,6 @@ static int hostapd_cli_cmd_sa_query(stru
-  #endif /* CONFIG_IEEE80211W */
-  
-  
-@@ -24,7 +24,7 @@
-  static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc,
-  				   char *argv[])
-  {
--@@ -578,7 +575,6 @@ static int hostapd_cli_cmd_wps_config(st
-+@@ -588,7 +585,6 @@ static int hostapd_cli_cmd_wps_config(st
-  			 ssid_hex, argv[1]);
-  	return wpa_ctrl_command(ctrl, buf);
-  }
-@@ -32,7 +32,7 @@
-  
-  
-  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
--@@ -903,7 +899,6 @@ static struct hostapd_cli_cmd hostapd_cl
-+@@ -979,7 +975,6 @@ static struct hostapd_cli_cmd hostapd_cl
-  #ifdef CONFIG_IEEE80211W
-  	{ "sa_query", hostapd_cli_cmd_sa_query },
-  #endif /* CONFIG_IEEE80211W */
-@@ -40,7 +40,7 @@
-  	{ "wps_pin", hostapd_cli_cmd_wps_pin },
-  	{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin },
-  	{ "wps_pbc", hostapd_cli_cmd_wps_pbc },
--@@ -917,7 +912,6 @@ static struct hostapd_cli_cmd hostapd_cl
-+@@ -993,7 +988,6 @@ static struct hostapd_cli_cmd hostapd_cl
-  	{ "wps_ap_pin", hostapd_cli_cmd_wps_ap_pin },
-  	{ "wps_config", hostapd_cli_cmd_wps_config },
-  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status },
-diff --git a/package/hostapd/patches/471-wpa_cli_ifdef.patch b/package/hostapd/patches/471-wpa_cli_ifdef.patch
-index cc84444..36b5a44 100644
---- a/package/hostapd/patches/471-wpa_cli_ifdef.patch
-+++ b/package/hostapd/patches/471-wpa_cli_ifdef.patch
-@@ -10,4 +10,4 @@
- +
-  static const char *wpa_cli_version =
-  "wpa_cli v" VERSION_STR "\n"
-- "Copyright (c) 2004-2013, Jouni Malinen <j@w1.fi> and contributors";
-+ "Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi> and contributors";
-diff --git a/package/hostapd/patches/480-max_num_sta_probe.patch b/package/hostapd/patches/480-max_num_sta_probe.patch
-index e5ca8b4..e238bf4 100644
---- a/package/hostapd/patches/480-max_num_sta_probe.patch
-+++ b/package/hostapd/patches/480-max_num_sta_probe.patch
-@@ -1,6 +1,6 @@
- --- a/src/ap/beacon.c
- +++ b/src/ap/beacon.c
--@@ -501,6 +501,10 @@ void handle_probe_req(struct hostapd_dat
-+@@ -599,6 +599,10 @@ void handle_probe_req(struct hostapd_dat
-  		return;
-  	}
-  
-@@ -9,5 +9,5 @@
- +			   " too many connected stations.", MAC2STR(mgmt->sa));
- +
-  #ifdef CONFIG_INTERWORKING
-- 	if (elems.interworking && elems.interworking_len >= 1) {
-- 		u8 ant = elems.interworking[0] & 0x0f;
-+ 	if (hapd->conf->interworking &&
-+ 	    elems.interworking && elems.interworking_len >= 1) {
-diff --git a/package/hostapd/patches/490-scan_wait.patch b/package/hostapd/patches/490-scan_wait.patch
-index 61715d6..3459a61 100644
---- a/package/hostapd/patches/490-scan_wait.patch
-+++ b/package/hostapd/patches/490-scan_wait.patch
-@@ -1,15 +1,15 @@
- --- a/hostapd/main.c
- +++ b/hostapd/main.c
--@@ -33,6 +33,8 @@
-- extern int wpa_debug_level;
-- extern int wpa_debug_show_keys;
-- extern int wpa_debug_timestamp;
-+@@ -36,6 +36,8 @@ struct hapd_global {
-+ };
-+ 
-+ static struct hapd_global global;
- +static int daemonize = 0;
- +static char *pid_file = NULL;
-  
-- extern struct wpa_driver_ops *wpa_drivers[];
-  
--@@ -147,6 +149,14 @@ static void hostapd_logger_cb(void *ctx,
-+ #ifndef CONFIG_NO_HOSTAPD_LOGGER
-+@@ -141,6 +143,14 @@ static void hostapd_logger_cb(void *ctx,
-  }
-  #endif /* CONFIG_NO_HOSTAPD_LOGGER */
-  
-@@ -24,7 +24,7 @@
-  
-  /**
-   * hostapd_driver_init - Preparate driver interface
--@@ -165,6 +175,8 @@ static int hostapd_driver_init(struct ho
-+@@ -159,6 +169,8 @@ static int hostapd_driver_init(struct ho
-  		return -1;
-  	}
-  
-@@ -33,7 +33,7 @@
-  	/* Initialize the driver interface */
-  	if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5]))
-  		b = NULL;
--@@ -381,8 +393,6 @@ static void hostapd_global_deinit(const 
-+@@ -372,8 +384,6 @@ static void hostapd_global_deinit(const 
-  #endif /* CONFIG_NATIVE_WINDOWS */
-  
-  	eap_server_unregister_methods();
-@@ -42,7 +42,7 @@
-  }
-  
-  
--@@ -408,11 +418,6 @@ static int hostapd_global_run(struct hap
-+@@ -399,11 +409,6 @@ static int hostapd_global_run(struct hap
-  	}
-  #endif /* EAP_SERVER_TNC */
-  
-@@ -54,7 +54,7 @@
-  	eloop_run();
-  
-  	return 0;
--@@ -521,8 +526,7 @@ int main(int argc, char *argv[])
-+@@ -533,8 +538,7 @@ int main(int argc, char *argv[])
-  	struct hapd_interfaces interfaces;
-  	int ret = 1;
-  	size_t i, j;
-diff --git a/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
-index 544151e..9f4a5f5 100644
---- a/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
-+++ b/package/hostapd/patches/500-wpa_supplicant-add-new-config-params-to-be-used-with.patch
-@@ -22,9 +22,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
-  #include "common/defs.h"
-  #include "utils/list.h"
-  
--@@ -404,6 +405,11 @@ struct wpa_driver_associate_params {
-- 	 */
-- 	int freq;
-+@@ -414,6 +415,11 @@ struct wpa_driver_associate_params {
-+ 	 * responsible for selecting with which BSS to associate. */
-+ 	const u8 *bssid;
-  
- +	int beacon_interval;
- +	int fixed_freq;
-@@ -32,11 +32,11 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- +	int mcast_rate;
- +
-  	/**
-- 	 * bg_scan_period - Background scan period in seconds, 0 to disable
-- 	 * background scan, or -1 to indicate no change to default driver
-+ 	 * bssid_hint - BSSID of a proposed AP
-+ 	 *
- --- a/wpa_supplicant/config.c
- +++ b/wpa_supplicant/config.c
--@@ -14,6 +14,7 @@
-+@@ -15,6 +15,7 @@
-  #include "rsn_supp/wpa.h"
-  #include "eap_peer/eap.h"
-  #include "p2p/p2p.h"
-@@ -44,7 +44,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
-  #include "config.h"
-  
-  
--@@ -1512,6 +1513,97 @@ static char * wpa_config_write_psk_list(
-+@@ -1527,6 +1528,97 @@ static char * wpa_config_write_psk_list(
-  
-  #endif /* CONFIG_P2P */
-  
-@@ -142,16 +142,16 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
-  /* Helper macros for network block parser */
-  
-  #ifdef OFFSET
--@@ -1715,6 +1807,9 @@ static const struct parse_data ssid_fiel
-+@@ -1733,6 +1825,9 @@ static const struct parse_data ssid_fiel
-  	{ INT(ap_max_inactivity) },
-  	{ INT(dtim_period) },
-  	{ INT(beacon_int) },
- +	{ INT_RANGE(fixed_freq, 0, 1) },
- +	{ FUNC(rates) },
- +	{ FUNC(mcast_rate) },
-- };
-- 
-- #undef OFFSET
-+ #ifdef CONFIG_MACSEC
-+ 	{ INT_RANGE(macsec_policy, 0, 1) },
-+ #endif /* CONFIG_MACSEC */
- --- a/wpa_supplicant/config_ssid.h
- +++ b/wpa_supplicant/config_ssid.h
- @@ -12,6 +12,7 @@
-@@ -162,37 +162,24 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
-  
-  #define MAX_SSID_LEN 32
-  
--@@ -620,6 +621,10 @@ struct wpa_ssid {
-- 	 * dereferences since it may not be updated in all cases.
-+@@ -637,6 +638,10 @@ struct wpa_ssid {
-  	 */
-  	void *parent_cred;
--+
-+ 
- +	int fixed_freq;
- +	unsigned char rates[NL80211_MAX_SUPP_RATES];
- +	double mcast_rate;
-- };
-- 
-- #endif /* CONFIG_SSID_H */
-++
-+ #ifdef CONFIG_MACSEC
-+ 	/**
-+ 	 * macsec_policy - Determines the policy for MACsec secure session
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
--@@ -1623,15 +1623,24 @@ void wpa_supplicant_associate(struct wpa
-- 		params.ssid_len = ssid->ssid_len;
-- 	}
-- 
---	if (ssid->mode == WPAS_MODE_IBSS && ssid->bssid_set &&
---	    wpa_s->conf->ap_scan == 2) {
---		params.bssid = ssid->bssid;
---		params.fixed_bssid = 1;
--+	if (ssid->mode == WPAS_MODE_IBSS) {
--+		if (ssid->bssid_set && wpa_s->conf->ap_scan == 2) {
--+			params.bssid = ssid->bssid;
--+			params.fixed_bssid = 1;
--+		}
--+		if (ssid->frequency > 0 && params.freq == 0)
--+			/* Initial channel for IBSS */
--+			params.freq = ssid->frequency;
-+@@ -1806,6 +1806,13 @@ static void wpas_start_assoc_cb(struct w
-+ 			params.beacon_int = ssid->beacon_int;
-+ 		else
-+ 			params.beacon_int = wpa_s->conf->beacon_int;
- +		params.fixed_freq = ssid->fixed_freq;
--+		params.beacon_interval = ssid->beacon_int;
- +		i = 0;
- +		while (i < NL80211_MAX_SUPP_RATES) {
- +			params.rates[i] = ssid->rates[i];
-@@ -201,9 +188,4 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- +		params.mcast_rate = ssid->mcast_rate;
-  	}
-  
---	if (ssid->mode == WPAS_MODE_IBSS && ssid->frequency > 0 &&
---	    params.freq == 0)
---		params.freq = ssid->frequency; /* Initial channel for IBSS */
-  	params.wpa_ie = wpa_ie;
-- 	params.wpa_ie_len = wpa_ie_len;
-- 	params.pairwise_suite = cipher_pairwise;
-diff --git a/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
-index 565bbc9..e7484d9 100644
---- a/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
-+++ b/package/hostapd/patches/501-driver_nl80211-use-new-parameters-during-ibss-join.patch
-@@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
- 
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
--@@ -7903,7 +7903,7 @@ static int wpa_driver_nl80211_ibss(struc
-+@@ -8581,7 +8581,7 @@ static int wpa_driver_nl80211_ibss(struc
-  				   struct wpa_driver_associate_params *params)
-  {
-  	struct nl_msg *msg;
-@@ -19,9 +19,9 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org>
-  	int count = 0;
-  
-  	wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex);
--@@ -7936,6 +7936,37 @@ retry:
-- 	wpa_printf(MSG_DEBUG, "  * freq=%d", params->freq);
-- 	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, params->freq);
-+@@ -8620,6 +8620,37 @@ retry:
-+ 			    params->beacon_int);
-+ 	}
-  
- +	if (params->fixed_freq) {
- +		wpa_printf(MSG_DEBUG, "  * fixed_freq");
-diff --git a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
-index adb20a2..b4c4034 100644
---- a/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
-+++ b/package/hostapd/patches/502-wpa_s-support-htmode-param.patch
-@@ -16,7 +16,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
- 
- --- a/src/drivers/driver.h
- +++ b/src/drivers/driver.h
--@@ -409,6 +409,8 @@ struct wpa_driver_associate_params {
-+@@ -419,6 +419,8 @@ struct wpa_driver_associate_params {
-  	int fixed_freq;
-  	unsigned char rates[NL80211_MAX_SUPP_RATES];
-  	int mcast_rate;
-@@ -24,10 +24,10 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
- +	unsigned int htmode;
-  
-  	/**
-- 	 * bg_scan_period - Background scan period in seconds, 0 to disable
-+ 	 * bssid_hint - BSSID of a proposed AP
- --- a/src/drivers/driver_nl80211.c
- +++ b/src/drivers/driver_nl80211.c
--@@ -7967,6 +7967,22 @@ retry:
-+@@ -8651,6 +8651,22 @@ retry:
-  		NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate);
-  	}
-  
-@@ -52,7 +52,7 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
-  		goto nla_put_failure;
- --- a/wpa_supplicant/config.c
- +++ b/wpa_supplicant/config.c
--@@ -1544,6 +1544,71 @@ static char * wpa_config_write_mcast_rat
-+@@ -1559,6 +1559,71 @@ static char * wpa_config_write_mcast_rat
-  }
-  #endif /* NO_CONFIG_WRITE */
-  
-@@ -124,28 +124,28 @@ Signed-off-by: Antonio Quartulli <ordex@autistici.org>
-  static int wpa_config_parse_rates(const struct parse_data *data,
-  				  struct wpa_ssid *ssid, int line,
-  				  const char *value)
--@@ -1810,6 +1875,7 @@ static const struct parse_data ssid_fiel
-+@@ -1828,6 +1893,7 @@ static const struct parse_data ssid_fiel
-  	{ INT_RANGE(fixed_freq, 0, 1) },
-  	{ FUNC(rates) },
-  	{ FUNC(mcast_rate) },
- +	{ FUNC(htmode) },
-- };
-- 
-- #undef OFFSET
-+ #ifdef CONFIG_MACSEC
-+ 	{ INT_RANGE(macsec_policy, 0, 1) },
-+ #endif /* CONFIG_MACSEC */
- --- a/wpa_supplicant/config_ssid.h
- +++ b/wpa_supplicant/config_ssid.h
--@@ -625,6 +625,8 @@ struct wpa_ssid {
-+@@ -641,6 +641,8 @@ struct wpa_ssid {
-  	int fixed_freq;
-  	unsigned char rates[NL80211_MAX_SUPP_RATES];
-  	double mcast_rate;
- +	int ht_set;
- +	unsigned int htmode;
-- };
-  
-- #endif /* CONFIG_SSID_H */
-+ #ifdef CONFIG_MACSEC
-+ 	/**
- --- a/wpa_supplicant/wpa_supplicant.c
- +++ b/wpa_supplicant/wpa_supplicant.c
--@@ -1639,6 +1639,8 @@ void wpa_supplicant_associate(struct wpa
-+@@ -1813,6 +1813,8 @@ static void wpas_start_assoc_cb(struct w
-  			i++;
-  		}
-  		params.mcast_rate = ssid->mcast_rate;
-diff --git a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch b/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
-deleted file mode 100644
-index fe72ee2..0000000
---- a/package/hostapd/patches/510-wpa_supplicant_p2p_parse_ifcomb.patch
-+++ /dev/null
-@@ -1,18 +0,0 @@
----- a/src/drivers/driver_nl80211.c
--+++ b/src/drivers/driver_nl80211.c
--@@ -3157,10 +3157,12 @@ static int wiphy_info_iface_comb_process
-- 	}
-- 
-- 	if (combination_has_p2p && combination_has_mgd) {
---		info->p2p_concurrent = 1;
---		info->num_multichan_concurrent =
--+		int num_channels =
-- 			nla_get_u32(tb_comb[NL80211_IFACE_COMB_NUM_CHANNELS]);
---		return 1;
--+
--+		info->p2p_concurrent = 1;
--+		if (info->num_multichan_concurrent < num_channels)
--+			info->num_multichan_concurrent = num_channels;
-- 	}
-- 
-- 	return 0;

+ 0 - 546
patches/openwrt/0018-ar71xx-add-support-for-QCA953x-SoC.patch

@@ -1,546 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 29 Mar 2014 21:55:41 +0100
-Subject: ar71xx: add support for QCA953x SoC
-
-diff --git a/target/linux/ar71xx/config-3.3 b/target/linux/ar71xx/config-3.3
-index dfc5bf2..1c3ba3c 100644
---- a/target/linux/ar71xx/config-3.3
-+++ b/target/linux/ar71xx/config-3.3
-@@ -40,11 +40,11 @@ CONFIG_ATH79_MACH_EW_DORIN=y
- CONFIG_ATH79_MACH_HORNET_UB=y
- CONFIG_ATH79_MACH_JA76PF=y
- CONFIG_ATH79_MACH_JWAP003=y
-+CONFIG_ATH79_MACH_MR600=y
- CONFIG_ATH79_MACH_MZK_W04NU=y
- CONFIG_ATH79_MACH_MZK_W300NH=y
- CONFIG_ATH79_MACH_NBG460N=y
- CONFIG_ATH79_MACH_OM2P=y
--CONFIG_ATH79_MACH_MR600=y
- CONFIG_ATH79_MACH_PB42=y
- CONFIG_ATH79_MACH_PB44=y
- CONFIG_ATH79_MACH_PB92=y
-@@ -214,6 +214,7 @@ CONFIG_SOC_AR724X=y
- CONFIG_SOC_AR913X=y
- CONFIG_SOC_AR933X=y
- CONFIG_SOC_AR934X=y
-+CONFIG_SOC_QCA953X=y
- CONFIG_SOC_QCA955X=y
- CONFIG_SPI=y
- CONFIG_SPI_AP83=y
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
-index 5a0b950..1a9b0df 100644
---- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
-@@ -195,6 +195,7 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask)
- 	case ATH79_SOC_AR7241:
- 	case ATH79_SOC_AR9330:
- 	case ATH79_SOC_AR9331:
-+	case ATH79_SOC_QCA9533:
- 		mdio_dev = &ath79_mdio1_device;
- 		mdio_data = &ath79_mdio1_data;
- 		break;
-@@ -250,6 +251,11 @@ void __init ath79_register_mdio(unsigned int id, u32 phy_mask)
- 		}
- 		mdio_data->is_ar934x = 1;
- 		break;
-+
-+	case ATH79_SOC_QCA9533:
-+		mdio_data->builtin_switch = 1;
-+		break;
-+
- 	case ATH79_SOC_QCA9558:
- 		if (id == 1)
- 			mdio_data->builtin_switch = 1;
-@@ -540,6 +546,7 @@ static void __init ath79_init_eth_pll_data(unsigned int id)
- 	case ATH79_SOC_AR9341:
- 	case ATH79_SOC_AR9342:
- 	case ATH79_SOC_AR9344:
-+	case ATH79_SOC_QCA9533:
- 	case ATH79_SOC_QCA9558:
- 		pll_10 = AR934X_PLL_VAL_10;
- 		pll_100 = AR934X_PLL_VAL_100;
-@@ -596,6 +603,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
- 		case ATH79_SOC_AR7241:
- 		case ATH79_SOC_AR9330:
- 		case ATH79_SOC_AR9331:
-+		case ATH79_SOC_QCA9533:
- 			pdata->phy_if_mode = PHY_INTERFACE_MODE_MII;
- 			break;
- 
-@@ -645,6 +653,7 @@ static int __init ath79_setup_phy_if_mode(unsigned int id,
- 		case ATH79_SOC_AR7241:
- 		case ATH79_SOC_AR9330:
- 		case ATH79_SOC_AR9331:
-+		case ATH79_SOC_QCA9533:
- 			pdata->phy_if_mode = PHY_INTERFACE_MODE_GMII;
- 			break;
- 
-@@ -882,6 +891,37 @@ void __init ath79_register_eth(unsigned int id)
- 			pdata->fifo_cfg3 = 0x01f00140;
- 		break;
- 
-+	case ATH79_SOC_QCA9533:
-+		if (id == 0) {
-+			pdata->reset_bit = AR933X_RESET_GE0_MAC |
-+					   AR933X_RESET_GE0_MDIO;
-+			pdata->set_speed = ath79_set_speed_dummy;
-+
-+			pdata->phy_mask = BIT(4);
-+		} else {
-+			pdata->reset_bit = AR933X_RESET_GE1_MAC |
-+					   AR933X_RESET_GE1_MDIO;
-+			pdata->set_speed = ath79_set_speed_dummy;
-+
-+			pdata->speed = SPEED_1000;
-+			pdata->duplex = DUPLEX_FULL;
-+			pdata->switch_data = &ath79_switch_data;
-+
-+			ath79_switch_data.phy_poll_mask |= BIT(4);
-+		}
-+
-+		pdata->ddr_flush = ath79_ddr_no_flush;
-+		pdata->has_gbit = 1;
-+		pdata->is_ar724x = 1;
-+
-+		if (!pdata->fifo_cfg1)
-+			pdata->fifo_cfg1 = 0x0010ffff;
-+		if (!pdata->fifo_cfg2)
-+			pdata->fifo_cfg2 = 0x015500aa;
-+		if (!pdata->fifo_cfg3)
-+			pdata->fifo_cfg3 = 0x01f00140;
-+		break;
-+
- 	case ATH79_SOC_AR9341:
- 	case ATH79_SOC_AR9342:
- 	case ATH79_SOC_AR9344:
-@@ -953,6 +993,7 @@ void __init ath79_register_eth(unsigned int id)
- 		case ATH79_SOC_AR7241:
- 		case ATH79_SOC_AR9330:
- 		case ATH79_SOC_AR9331:
-+		case ATH79_SOC_QCA9533:
- 			pdata->mii_bus_dev = &ath79_mdio1_device.dev;
- 			break;
- 
-diff --git a/target/linux/ar71xx/patches-3.3/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-3.3/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
-new file mode 100644
-index 0000000..4c9e761
---- /dev/null
-+++ b/target/linux/ar71xx/patches-3.3/707-MIPS-ath79-add-support-for-QCA953x-SoC.patch
-@@ -0,0 +1,417 @@
-+From 5300a7cd7ed2f88488ddba62947b9c6bb9663777 Mon Sep 17 00:00:00 2001
-+Message-Id: <5300a7cd7ed2f88488ddba62947b9c6bb9663777.1396122227.git.mschiffer@universe-factory.net>
-+From: Matthias Schiffer <mschiffer@universe-factory.net>
-+Date: Sat, 29 Mar 2014 20:26:08 +0100
-+Subject: [PATCH 1/2] MIPS: ath79: add support for QCA953x SoC
-+
-+Note that the clock calculation looks very similar to the QCA955x, but actually
-+some bits' meanings are slightly different.
-+---
-+ arch/mips/ath79/Kconfig                        |  6 +-
-+ arch/mips/ath79/clock.c                        | 78 ++++++++++++++++++++++++++
-+ arch/mips/ath79/common.c                       |  4 ++
-+ arch/mips/ath79/dev-common.c                   |  1 +
-+ arch/mips/ath79/dev-wmac.c                     | 20 +++++++
-+ arch/mips/ath79/early_printk.c                 |  1 +
-+ arch/mips/ath79/gpio.c                         |  4 +-
-+ arch/mips/ath79/irq.c                          |  4 ++
-+ arch/mips/ath79/setup.c                        |  8 ++-
-+ arch/mips/include/asm/mach-ath79/ar71xx_regs.h | 48 ++++++++++++++++
-+ arch/mips/include/asm/mach-ath79/ath79.h       | 11 ++++
-+ 11 files changed, 182 insertions(+), 3 deletions(-)
-+
-+--- a/arch/mips/ath79/Kconfig
-++++ b/arch/mips/ath79/Kconfig
-+@@ -688,6 +688,10 @@ config SOC_AR934X
-+ 	select PCI_AR724X if PCI
-+ 	def_bool n
-+ 
-++config SOC_QCA953X
-++	select USB_ARCH_HAS_EHCI
-++	def_bool n
-++
-+ config SOC_QCA955X
-+ 	select USB_ARCH_HAS_EHCI
-+ 	select HW_HAS_PCI
-+@@ -731,7 +735,7 @@ config ATH79_DEV_USB
-+ 	def_bool n
-+ 
-+ config ATH79_DEV_WMAC
-+-	depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA955X)
-++	depends on (SOC_AR913X || SOC_AR933X || SOC_AR934X || SOC_QCA953X || SOC_QCA955X)
-+ 	def_bool n
-+ 
-+ config ATH79_NVRAM
-+--- a/arch/mips/ath79/clock.c
-++++ b/arch/mips/ath79/clock.c
-+@@ -295,6 +295,82 @@ static void __init ar934x_clocks_init(vo
-+ 	iounmap(dpll_base);
-+ }
-+ 
-++static void __init qca953x_clocks_init(void)
-++{
-++	u32 pll, out_div, ref_div, nint, frac, clk_ctrl, postdiv;
-++	u32 cpu_pll, ddr_pll;
-++	u32 bootstrap;
-++
-++	bootstrap = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
-++	if (bootstrap &	QCA953X_BOOTSTRAP_REF_CLK_40)
-++		ath79_ref_clk.rate = 40 * 1000 * 1000;
-++	else
-++		ath79_ref_clk.rate = 25 * 1000 * 1000;
-++
-++	pll = ath79_pll_rr(QCA953X_PLL_CPU_CONFIG_REG);
-++	out_div = (pll >> QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
-++		  QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK;
-++	ref_div = (pll >> QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT) &
-++		  QCA953X_PLL_CPU_CONFIG_REFDIV_MASK;
-++	nint = (pll >> QCA953X_PLL_CPU_CONFIG_NINT_SHIFT) &
-++	       QCA953X_PLL_CPU_CONFIG_NINT_MASK;
-++	frac = (pll >> QCA953X_PLL_CPU_CONFIG_NFRAC_SHIFT) &
-++	       QCA953X_PLL_CPU_CONFIG_NFRAC_MASK;
-++
-++	cpu_pll = nint * ath79_ref_clk.rate / ref_div;
-++	cpu_pll += frac * (ath79_ref_clk.rate >> 6) / ref_div;
-++	cpu_pll /= (1 << out_div);
-++
-++	pll = ath79_pll_rr(QCA953X_PLL_DDR_CONFIG_REG);
-++	out_div = (pll >> QCA953X_PLL_DDR_CONFIG_OUTDIV_SHIFT) &
-++		  QCA953X_PLL_DDR_CONFIG_OUTDIV_MASK;
-++	ref_div = (pll >> QCA953X_PLL_DDR_CONFIG_REFDIV_SHIFT) &
-++		  QCA953X_PLL_DDR_CONFIG_REFDIV_MASK;
-++	nint = (pll >> QCA953X_PLL_DDR_CONFIG_NINT_SHIFT) &
-++	       QCA953X_PLL_DDR_CONFIG_NINT_MASK;
-++	frac = (pll >> QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT) &
-++	       QCA953X_PLL_DDR_CONFIG_NFRAC_MASK;
-++
-++	ddr_pll = nint * ath79_ref_clk.rate / ref_div;
-++	ddr_pll += frac * (ath79_ref_clk.rate >> 6) / (ref_div << 4);
-++	ddr_pll /= (1 << out_div);
-++
-++	clk_ctrl = ath79_pll_rr(QCA953X_PLL_CLK_CTRL_REG);
-++
-++	postdiv = (clk_ctrl >> QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT) &
-++		  QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_MASK;
-++
-++	if (clk_ctrl & QCA953X_PLL_CLK_CTRL_CPU_PLL_BYPASS)
-++		ath79_cpu_clk.rate = ath79_ref_clk.rate;
-++	else if (clk_ctrl & QCA953X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL)
-++		ath79_cpu_clk.rate = cpu_pll / (postdiv + 1);
-++	else
-++		ath79_cpu_clk.rate = ddr_pll / (postdiv + 1);
-++
-++	postdiv = (clk_ctrl >> QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT) &
-++		  QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_MASK;
-++
-++	if (clk_ctrl & QCA953X_PLL_CLK_CTRL_DDR_PLL_BYPASS)
-++		ath79_ddr_clk.rate = ath79_ref_clk.rate;
-++	else if (clk_ctrl & QCA953X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL)
-++		ath79_ddr_clk.rate = ddr_pll / (postdiv + 1);
-++	else
-++		ath79_ddr_clk.rate = cpu_pll / (postdiv + 1);
-++
-++	postdiv = (clk_ctrl >> QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT) &
-++		  QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_MASK;
-++
-++	if (clk_ctrl & QCA953X_PLL_CLK_CTRL_AHB_PLL_BYPASS)
-++		ath79_ahb_clk.rate = ath79_ref_clk.rate;
-++	else if (clk_ctrl & QCA953X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL)
-++		ath79_ahb_clk.rate = ddr_pll / (postdiv + 1);
-++	else
-++		ath79_ahb_clk.rate = cpu_pll / (postdiv + 1);
-++
-++	ath79_wdt_clk.rate = ath79_ref_clk.rate;
-++	ath79_uart_clk.rate = ath79_ref_clk.rate;
-++}
-++
-+ static void __init qca955x_clocks_init(void)
-+ {
-+ 	u32 pll, out_div, ref_div, nint, frac, clk_ctrl, postdiv;
-+@@ -383,6 +459,8 @@ void __init ath79_clocks_init(void)
-+ 		ar933x_clocks_init();
-+ 	else if (soc_is_ar934x())
-+ 		ar934x_clocks_init();
-++	else if (soc_is_qca953x())
-++		qca953x_clocks_init();
-+ 	else if (soc_is_qca955x())
-+ 		qca955x_clocks_init();
-+ 	else
-+--- a/arch/mips/ath79/common.c
-++++ b/arch/mips/ath79/common.c
-+@@ -74,6 +74,8 @@ void ath79_device_reset_set(u32 mask)
-+ 	else if (soc_is_ar934x() ||
-+ 		 soc_is_qca955x())
-+ 		reg = AR934X_RESET_REG_RESET_MODULE;
-++	else if (soc_is_qca953x())
-++		reg = QCA953X_RESET_REG_RESET_MODULE;
-+ 	else
-+ 		BUG();
-+ 
-+@@ -101,6 +103,8 @@ void ath79_device_reset_clear(u32 mask)
-+ 	else if (soc_is_ar934x() ||
-+ 		 soc_is_qca955x())
-+ 		reg = AR934X_RESET_REG_RESET_MODULE;
-++	else if (soc_is_qca953x())
-++		reg = QCA953X_RESET_REG_RESET_MODULE;
-+ 	else
-+ 		BUG();
-+ 
-+--- a/arch/mips/ath79/dev-common.c
-++++ b/arch/mips/ath79/dev-common.c
-+@@ -100,6 +100,7 @@ void __init ath79_register_uart(void)
-+ 	    soc_is_ar724x() ||
-+ 	    soc_is_ar913x() ||
-+ 	    soc_is_ar934x() ||
-++	    soc_is_qca953x() ||
-+ 	    soc_is_qca955x()) {
-+ 		ath79_uart_data[0].uartclk = clk_get_rate(clk);
-+ 		platform_device_register(&ath79_uart_device);
-+--- a/arch/mips/ath79/dev-wmac.c
-++++ b/arch/mips/ath79/dev-wmac.c
-+@@ -99,7 +99,7 @@ static int ar933x_wmac_reset(void)
-+ 	return -ETIMEDOUT;
-+ }
-+ 
-+-static int ar933x_r1_get_wmac_revision(void)
-++static int ar93xx_get_soc_revision(void)
-+ {
-+ 	return ath79_soc_rev;
-+ }
-+@@ -124,7 +124,7 @@ static void __init ar933x_wmac_setup(voi
-+ 		ath79_wmac_data.is_clk_25mhz = true;
-+ 
-+ 	if (ath79_soc_rev == 1)
-+-		ath79_wmac_data.get_mac_revision = ar933x_r1_get_wmac_revision;
-++		ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
-+ 
-+ 	ath79_wmac_data.external_reset = ar933x_wmac_reset;
-+ }
-+@@ -147,6 +147,26 @@ static void ar934x_wmac_setup(void)
-+ 		ath79_wmac_data.is_clk_25mhz = true;
-+ }
-+ 
-++static void qca953x_wmac_setup(void)
-++{
-++	u32 t;
-++
-++	ath79_wmac_device.name = "qca953x_wmac";
-++
-++	ath79_wmac_resources[0].start = QCA953X_WMAC_BASE;
-++	ath79_wmac_resources[0].end = QCA953X_WMAC_BASE + QCA953X_WMAC_SIZE - 1;
-++	ath79_wmac_resources[1].start = ATH79_CPU_IRQ_IP2;
-++	ath79_wmac_resources[1].end = ATH79_CPU_IRQ_IP2;
-++
-++	t = ath79_reset_rr(QCA953X_RESET_REG_BOOTSTRAP);
-++	if (t & QCA953X_BOOTSTRAP_REF_CLK_40)
-++		ath79_wmac_data.is_clk_25mhz = false;
-++	else
-++		ath79_wmac_data.is_clk_25mhz = true;
-++
-++	ath79_wmac_data.get_mac_revision = ar93xx_get_soc_revision;
-++}
-++
-+ static void qca955x_wmac_setup(void)
-+ {
-+ 	u32 t;
-+@@ -314,6 +334,8 @@ void __init ath79_register_wmac(u8 *cal_
-+ 		ar933x_wmac_setup();
-+ 	else if (soc_is_ar934x())
-+ 		ar934x_wmac_setup();
-++	else if (soc_is_qca953x())
-++		qca953x_wmac_setup();
-+ 	else if (soc_is_qca955x())
-+ 		qca955x_wmac_setup();
-+ 	else
-+--- a/arch/mips/ath79/early_printk.c
-++++ b/arch/mips/ath79/early_printk.c
-+@@ -114,6 +114,7 @@ static void prom_putchar_init(void)
-+ 	case REV_ID_MAJOR_AR9341:
-+ 	case REV_ID_MAJOR_AR9342:
-+ 	case REV_ID_MAJOR_AR9344:
-++	case REV_ID_MAJOR_QCA9533:
-+ 	case REV_ID_MAJOR_QCA9558:
-+ 		_prom_putchar = prom_putchar_ar71xx;
-+ 		break;
-+--- a/arch/mips/ath79/gpio.c
-++++ b/arch/mips/ath79/gpio.c
-+@@ -240,6 +240,8 @@ void __init ath79_gpio_init(void)
-+ 		ath79_gpio_count = AR933X_GPIO_COUNT;
-+ 	else if (soc_is_ar934x())
-+ 		ath79_gpio_count = AR934X_GPIO_COUNT;
-++	else if (soc_is_qca953x())
-++		ath79_gpio_count = QCA953X_GPIO_COUNT;
-+ 	else if (soc_is_qca955x())
-+ 		ath79_gpio_count = QCA955X_GPIO_COUNT;
-+ 	else
-+@@ -247,7 +249,7 @@ void __init ath79_gpio_init(void)
-+ 
-+ 	ath79_gpio_base = ioremap_nocache(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE);
-+ 	ath79_gpio_chip.ngpio = ath79_gpio_count;
-+-	if (soc_is_ar934x() || soc_is_qca955x()) {
-++	if (soc_is_ar934x() || soc_is_qca953x() || soc_is_qca955x()) {
-+ 		ath79_gpio_chip.direction_input = ar934x_gpio_direction_input;
-+ 		ath79_gpio_chip.direction_output = ar934x_gpio_direction_output;
-+ 	}
-+--- a/arch/mips/ath79/irq.c
-++++ b/arch/mips/ath79/irq.c
-+@@ -106,6 +106,7 @@ static void __init ath79_misc_irq_init(v
-+ 	else if (soc_is_ar724x() ||
-+ 		 soc_is_ar933x() ||
-+ 		 soc_is_ar934x() ||
-++		 soc_is_qca953x() ||
-+ 		 soc_is_qca955x())
-+ 		ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
-+ 	else
-+@@ -352,6 +353,9 @@ void __init arch_init_irq(void)
-+ 	} else if (soc_is_ar934x()) {
-+ 		ath79_ip2_handler = ath79_default_ip2_handler;
-+ 		ath79_ip3_handler = ar934x_ip3_handler;
-++	} else if (soc_is_qca953x()) {
-++		ath79_ip2_handler = ath79_default_ip2_handler;
-++		ath79_ip3_handler = ath79_default_ip3_handler;
-+ 	} else if (soc_is_qca955x()) {
-+ 		ath79_ip2_handler = ath79_default_ip2_handler;
-+ 		ath79_ip3_handler = ath79_default_ip3_handler;
-+--- a/arch/mips/ath79/setup.c
-++++ b/arch/mips/ath79/setup.c
-+@@ -164,6 +164,12 @@ static void __init ath79_detect_sys_type
-+ 		rev = id & AR934X_REV_ID_REVISION_MASK;
-+ 		break;
-+ 
-++	case REV_ID_MAJOR_QCA9533:
-++		ath79_soc = ATH79_SOC_QCA9533;
-++		chip = "9533";
-++		rev = id & AR944X_REV_ID_REVISION_MASK;
-++		break;
-++
-+ 	case REV_ID_MAJOR_QCA9558:
-+ 		ath79_soc = ATH79_SOC_QCA9558;
-+ 		chip = "9558";
-+@@ -176,7 +182,7 @@ static void __init ath79_detect_sys_type
-+ 
-+ 	ath79_soc_rev = rev;
-+ 
-+-	if (soc_is_qca955x())
-++	if (soc_is_qca953x() || soc_is_qca955x())
-+ 		sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
-+ 			chip, rev);
-+ 	else
-+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
-++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
-+@@ -106,6 +106,9 @@
-+ #define AR934X_NFC_BASE		0x1b000200
-+ #define AR934X_NFC_SIZE		0xb8
-+ 
-++#define QCA953X_WMAC_BASE	(AR71XX_APB_BASE + 0x00100000)
-++#define QCA953X_WMAC_SIZE	0x20000
-++
-+ #define QCA955X_PCI_MEM_BASE0	0x10000000
-+ #define QCA955X_PCI_MEM_BASE1	0x12000000
-+ #define QCA955X_PCI_MEM_SIZE	0x02000000
-+@@ -280,6 +283,43 @@
-+ 
-+ #define AR934X_PLL_SWITCH_CLOCK_CONTROL_MDIO_CLK_SEL	BIT(6)
-+ 
-++#define QCA953X_PLL_CPU_CONFIG_REG		0x00
-++#define QCA953X_PLL_DDR_CONFIG_REG		0x04
-++#define QCA953X_PLL_CLK_CTRL_REG		0x08
-++#define QCA953X_PLL_ETH_XMII_CONTROL_REG	0x2c
-++#define QCA953X_PLL_ETH_SGMII_CONTROL_REG	0x48
-++
-++#define QCA953X_PLL_CPU_CONFIG_NFRAC_SHIFT	0
-++#define QCA953X_PLL_CPU_CONFIG_NFRAC_MASK	0x3f
-++#define QCA953X_PLL_CPU_CONFIG_NINT_SHIFT	6
-++#define QCA953X_PLL_CPU_CONFIG_NINT_MASK	0x3f
-++#define QCA953X_PLL_CPU_CONFIG_REFDIV_SHIFT	12
-++#define QCA953X_PLL_CPU_CONFIG_REFDIV_MASK	0x1f
-++#define QCA953X_PLL_CPU_CONFIG_OUTDIV_SHIFT	19
-++#define QCA953X_PLL_CPU_CONFIG_OUTDIV_MASK	0x3
-++
-++#define QCA953X_PLL_DDR_CONFIG_NFRAC_SHIFT	0
-++#define QCA953X_PLL_DDR_CONFIG_NFRAC_MASK	0x3ff
-++#define QCA953X_PLL_DDR_CONFIG_NINT_SHIFT	10
-++#define QCA953X_PLL_DDR_CONFIG_NINT_MASK	0x3f
-++#define QCA953X_PLL_DDR_CONFIG_REFDIV_SHIFT	16
-++#define QCA953X_PLL_DDR_CONFIG_REFDIV_MASK	0x1f
-++#define QCA953X_PLL_DDR_CONFIG_OUTDIV_SHIFT	23
-++#define QCA953X_PLL_DDR_CONFIG_OUTDIV_MASK	0x7
-++
-++#define QCA953X_PLL_CLK_CTRL_CPU_PLL_BYPASS		BIT(2)
-++#define QCA953X_PLL_CLK_CTRL_DDR_PLL_BYPASS		BIT(3)
-++#define QCA953X_PLL_CLK_CTRL_AHB_PLL_BYPASS		BIT(4)
-++#define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_SHIFT		5
-++#define QCA953X_PLL_CLK_CTRL_CPU_POST_DIV_MASK		0x1f
-++#define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_SHIFT		10
-++#define QCA953X_PLL_CLK_CTRL_DDR_POST_DIV_MASK		0x1f
-++#define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_SHIFT		15
-++#define QCA953X_PLL_CLK_CTRL_AHB_POST_DIV_MASK		0x1f
-++#define QCA953X_PLL_CLK_CTRL_CPUCLK_FROM_CPUPLL		BIT(20)
-++#define QCA953X_PLL_CLK_CTRL_DDRCLK_FROM_DDRPLL		BIT(21)
-++#define QCA953X_PLL_CLK_CTRL_AHBCLK_FROM_DDRPLL		BIT(24)
-++
-+ #define QCA955X_PLL_CPU_CONFIG_REG		0x00
-+ #define QCA955X_PLL_DDR_CONFIG_REG		0x04
-+ #define QCA955X_PLL_CLK_CTRL_REG		0x08
-+@@ -354,6 +394,10 @@
-+ #define AR934X_RESET_REG_BOOTSTRAP		0xb0
-+ #define AR934X_RESET_REG_PCIE_WMAC_INT_STATUS	0xac
-+ 
-++#define QCA953X_RESET_REG_RESET_MODULE		0x1c
-++#define QCA953X_RESET_REG_BOOTSTRAP		0xb0
-++#define QCA953X_RESET_REG_EXT_INT_STATUS	0xac
-++
-+ #define QCA955X_RESET_REG_BOOTSTRAP		0xb0
-+ #define QCA955X_RESET_REG_EXT_INT_STATUS	0xac
-+ 
-+@@ -468,6 +512,8 @@
-+ #define AR934X_BOOTSTRAP_SDRAM_DISABLED	BIT(1)
-+ #define AR934X_BOOTSTRAP_DDR1		BIT(0)
-+ 
-++#define QCA953X_BOOTSTRAP_REF_CLK_40	BIT(4)
-++
-+ #define QCA955X_BOOTSTRAP_REF_CLK_40	BIT(4)
-+ 
-+ #define AR934X_PCIE_WMAC_INT_WMAC_MISC		BIT(0)
-+@@ -530,6 +576,7 @@
-+ #define REV_ID_MAJOR_AR9341		0x0120
-+ #define REV_ID_MAJOR_AR9342		0x1120
-+ #define REV_ID_MAJOR_AR9344		0x2120
-++#define REV_ID_MAJOR_QCA9533		0x0140
-+ #define REV_ID_MAJOR_QCA9558		0x1130
-+ 
-+ #define AR71XX_REV_ID_MINOR_MASK	0x3
-+@@ -603,6 +650,7 @@
-+ #define AR913X_GPIO_COUNT		22
-+ #define AR933X_GPIO_COUNT		30
-+ #define AR934X_GPIO_COUNT		23
-++#define QCA953X_GPIO_COUNT		24 /* (?) */
-+ #define QCA955X_GPIO_COUNT		24
-+ 
-+ /*
-+--- a/arch/mips/include/asm/mach-ath79/ath79.h
-++++ b/arch/mips/include/asm/mach-ath79/ath79.h
-+@@ -32,6 +32,7 @@ enum ath79_soc_type {
-+ 	ATH79_SOC_AR9341,
-+ 	ATH79_SOC_AR9342,
-+ 	ATH79_SOC_AR9344,
-++	ATH79_SOC_QCA9533,
-+ 	ATH79_SOC_QCA9558,
-+ };
-+ 
-+@@ -99,6 +100,16 @@ static inline int soc_is_ar934x(void)
-+ 	return soc_is_ar9341() || soc_is_ar9342() || soc_is_ar9344();
-+ }
-+ 
-++static inline int soc_is_qca9533(void)
-++{
-++	return ath79_soc == ATH79_SOC_QCA9533;
-++}
-++
-++static inline int soc_is_qca953x(void)
-++{
-++	return soc_is_qca9533();
-++}
-++
-+ static inline int soc_is_qca9558(void)
-+ {
-+ 	return ath79_soc == ATH79_SOC_QCA9558;

+ 0 - 297
patches/openwrt/0019-ar71xx-add-support-for-the-TP-LINK-TL-WR841N-ND-v9.patch

@@ -1,297 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 29 Mar 2014 21:12:15 +0100
-Subject: ar71xx: add support for the TP-LINK TL-WR841N/ND v9
-
-diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
-index b206438..0bf2dd1 100755
---- a/target/linux/ar71xx/base-files/etc/diag.sh
-+++ b/target/linux/ar71xx/base-files/etc/diag.sh
-@@ -144,6 +144,9 @@ get_status_led() {
- 	tl-wr703n)
- 		status_led="tp-link:blue:system"
- 		;;
-+	tl-wr841n-v9)
-+		status_led="tp-link:green:qss"
-+		;;
- 	tl-wr2543n)
- 		status_led="tp-link:green:wps"
- 		;;
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/leds b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-index 48b8154..43bc24d 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-@@ -163,6 +163,15 @@ tl-wr841n-v8)
- 	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
- 	;;
- 
-+tl-wr841n-v9)
-+	ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
-+	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10"
-+	ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
-+	ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04"
-+	ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
-+	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
-+	;;
-+
- tl-wr941nd | \
- tl-wr1041n-v2)
- 	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/network b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-index a36036f..a1dfda0 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/network
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-@@ -192,6 +192,7 @@ tl-wdr3500 |\
- tl-wr741nd |\
- tl-wr741nd-v4 |\
- tl-wr841n-v7 |\
-+tl-wr841n-v9 |\
- whr-g301n |\
- whr-hp-g300n |\
- whr-hp-gn |\
-diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-index 8d71352..ca174da 100755
---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
-+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-@@ -381,6 +381,9 @@ ar71xx_board_detect() {
- 	*"TL-WR841N/ND v8")
- 		name="tl-wr841n-v8"
- 		;;
-+	*"TL-WR841N/ND v9")
-+		name="tl-wr841n-v9"
-+		;;
- 	*TL-WR941ND)
- 		name="tl-wr941nd"
- 		;;
-diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-index e52ad9e..7168b4e 100755
---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-@@ -163,6 +163,7 @@ platform_check_image() {
- 	tl-wr841n-v1 | \
- 	tl-wr841n-v7 | \
- 	tl-wr841n-v8 | \
-+	tl-wr841n-v9 | \
- 	tl-wr941nd | \
- 	tl-wr1041n-v2 | \
- 	tl-wr1043nd | \
-diff --git a/target/linux/ar71xx/config-3.3 b/target/linux/ar71xx/config-3.3
-index 1c3ba3c..82d4d21 100644
---- a/target/linux/ar71xx/config-3.3
-+++ b/target/linux/ar71xx/config-3.3
-@@ -70,6 +70,7 @@ CONFIG_ATH79_MACH_TL_WR741ND=y
- CONFIG_ATH79_MACH_TL_WR741ND_V4=y
- CONFIG_ATH79_MACH_TL_WR841N_V1=y
- CONFIG_ATH79_MACH_TL_WR841N_V8=y
-+CONFIG_ATH79_MACH_TL_WR841N_V9=y
- CONFIG_ATH79_MACH_TL_WR941ND=y
- CONFIG_ATH79_MACH_UBNT=y
- CONFIG_ATH79_MACH_UBNT_XM=y
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c
-new file mode 100644
-index 0000000..c28afc6
---- /dev/null
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c
-@@ -0,0 +1,138 @@
-+/*
-+ *  TP-LINK TL-WR841N/ND v9
-+ *
-+ *  Copyright (C) 2014 Matthias Schiffer <mschiffer@universe-factory.net>
-+ *
-+ *  This program is free software; you can redistribute it and/or modify it
-+ *  under the terms of the GNU General Public License version 2 as published
-+ *  by the Free Software Foundation.
-+ */
-+
-+#include <linux/gpio.h>
-+#include <linux/platform_device.h>
-+
-+#include <asm/mach-ath79/ath79.h>
-+#include <asm/mach-ath79/ar71xx_regs.h>
-+
-+#include "common.h"
-+#include "dev-eth.h"
-+#include "dev-gpio-buttons.h"
-+#include "dev-leds-gpio.h"
-+#include "dev-m25p80.h"
-+#include "dev-wmac.h"
-+#include "machtypes.h"
-+
-+#define TL_WR841NV9_GPIO_LED_WLAN	13
-+#define TL_WR841NV9_GPIO_LED_QSS	3
-+#define TL_WR841NV9_GPIO_LED_WAN	4
-+#define TL_WR841NV9_GPIO_LED_LAN1	16
-+#define TL_WR841NV9_GPIO_LED_LAN2	15
-+#define TL_WR841NV9_GPIO_LED_LAN3	14
-+#define TL_WR841NV9_GPIO_LED_LAN4	11
-+
-+#define TL_WR841NV9_GPIO_BTN_RESET	12
-+#define TL_WR841NV9_GPIO_BTN_WIFI	17
-+
-+#define TL_WR841NV9_KEYS_POLL_INTERVAL	20	/* msecs */
-+#define TL_WR841NV9_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR841NV9_KEYS_POLL_INTERVAL)
-+
-+static const char *tl_wr841n_v9_part_probes[] = {
-+	"tp-link",
-+	NULL,
-+};
-+
-+static struct flash_platform_data tl_wr841n_v9_flash_data = {
-+	.part_probes	= tl_wr841n_v9_part_probes,
-+};
-+
-+static struct gpio_led tl_wr841n_v9_leds_gpio[] __initdata = {
-+	{
-+		.name		= "tp-link:green:lan1",
-+		.gpio		= TL_WR841NV9_GPIO_LED_LAN1,
-+		.active_low	= 1,
-+	}, {
-+		.name		= "tp-link:green:lan2",
-+		.gpio		= TL_WR841NV9_GPIO_LED_LAN2,
-+		.active_low	= 1,
-+	}, {
-+		.name		= "tp-link:green:lan3",
-+		.gpio		= TL_WR841NV9_GPIO_LED_LAN3,
-+		.active_low	= 1,
-+	}, {
-+		.name		= "tp-link:green:lan4",
-+		.gpio		= TL_WR841NV9_GPIO_LED_LAN4,
-+		.active_low	= 1,
-+	}, {
-+		.name		= "tp-link:green:qss",
-+		.gpio		= TL_WR841NV9_GPIO_LED_QSS,
-+		.active_low	= 1,
-+	}, {
-+		.name		= "tp-link:green:wan",
-+		.gpio		= TL_WR841NV9_GPIO_LED_WAN,
-+		.active_low	= 1,
-+	}, {
-+		.name		= "tp-link:green:wlan",
-+		.gpio		= TL_WR841NV9_GPIO_LED_WLAN,
-+		.active_low	= 1,
-+	},
-+};
-+
-+static struct gpio_keys_button tl_wr841n_v9_gpio_keys[] __initdata = {
-+	{
-+		.desc		= "Reset button",
-+		.type		= EV_KEY,
-+		.code		= KEY_RESTART,
-+		.debounce_interval = TL_WR841NV9_KEYS_DEBOUNCE_INTERVAL,
-+		.gpio		= TL_WR841NV9_GPIO_BTN_RESET,
-+		.active_low	= 1,
-+	}, {
-+		.desc		= "WIFI button",
-+		.type		= EV_KEY,
-+		.code		= KEY_RFKILL,
-+		.debounce_interval = TL_WR841NV9_KEYS_DEBOUNCE_INTERVAL,
-+		.gpio		= TL_WR841NV9_GPIO_BTN_WIFI,
-+		.active_low	= 1,
-+	}
-+};
-+
-+
-+static void __init tl_ap143_setup(void)
-+{
-+	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
-+	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
-+	u8 tmpmac[ETH_ALEN];
-+
-+	ath79_register_m25p80(&tl_wr841n_v9_flash_data);
-+
-+	ath79_setup_ar933x_phy4_switch(false, false);
-+
-+	ath79_register_mdio(0, 0x0);
-+
-+	/* LAN */
-+	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
-+	ath79_register_eth(1);
-+
-+	/* WAN */
-+	ath79_switch_data.phy4_mii_en = 1;
-+	ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
-+	ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1);
-+	ath79_register_eth(0);
-+
-+	ath79_init_mac(tmpmac, mac, 0);
-+	ath79_register_wmac(ee, tmpmac);
-+}
-+
-+static void __init tl_wr841n_v9_setup(void)
-+{
-+	tl_ap143_setup();
-+
-+	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr841n_v9_leds_gpio),
-+				 tl_wr841n_v9_leds_gpio);
-+
-+	ath79_register_gpio_keys_polled(1, TL_WR841NV9_KEYS_POLL_INTERVAL,
-+					ARRAY_SIZE(tl_wr841n_v9_gpio_keys),
-+					tl_wr841n_v9_gpio_keys);
-+}
-+
-+MIPS_MACHINE(ATH79_MACH_TL_WR841N_V9, "TL-WR841N-v9", "TP-LINK TL-WR841N/ND v9",
-+	     tl_wr841n_v9_setup);
-diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
-index 01d1e67..c270f73 100644
---- a/target/linux/ar71xx/image/Makefile
-+++ b/target/linux/ar71xx/image/Makefile
-@@ -879,6 +879,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR703,tl-wr703n-v1,TL-WR7
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR740NV4,tl-wr740n-v4,TL-WR741ND-v4,ttyATH0,115200,0x07400004,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR741NV4,tl-wr741nd-v4,TL-WR741ND-v4,ttyATH0,115200,0x07410004,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR841NV8,tl-wr841n-v8,TL-WR841N-v8,ttyS0,115200,0x08410008,1,4Mlzma))
-+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR841NV9,tl-wr841n-v9,TL-WR841N-v9,ttyS0,115200,0x08410009,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR1041,tl-wr1041n-v2,TL-WR1041N-v2,ttyS0,115200,0x10410002,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3500V1,tl-wdr3500-v1,TL-WDR3500,ttyS0,115200,0x35000001,1,8Mlzma))
-@@ -924,7 +925,7 @@ $(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2))
- $(eval $(call MultiProfile,TLWA7510,TLWA7510NV1))
- $(eval $(call MultiProfile,TLWR740,TLWR740NV1 TLWR740NV3 TLWR740NV4))
- $(eval $(call MultiProfile,TLWR741,TLWR741NV1 TLWR741NV2 TLWR741NV4))
--$(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7 TLWR841NV8))
-+$(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7 TLWR841NV8 TLWR841NV9))
- $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
- $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4310V1))
- $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTUNIFI UBNTUNIFIOUTDOOR))
-diff --git a/target/linux/ar71xx/patches-3.3/708-MIPS-ath79-TL-WR841v9-support.patch b/target/linux/ar71xx/patches-3.3/708-MIPS-ath79-TL-WR841v9-support.patch
-new file mode 100644
-index 0000000..37425a6
---- /dev/null
-+++ b/target/linux/ar71xx/patches-3.3/708-MIPS-ath79-TL-WR841v9-support.patch
-@@ -0,0 +1,38 @@
-+--- a/arch/mips/ath79/Kconfig
-++++ b/arch/mips/ath79/Kconfig
-+@@ -547,6 +547,15 @@ config ATH79_MACH_TL_WR841N_V8
-+ 	select ATH79_DEV_M25P80
-+ 	select ATH79_DEV_WMAC
-+ 
-++config ATH79_MACH_TL_WR841N_V9
-++       bool "TP-LINK TL-WR841N/ND v9 support"
-++       select SOC_QCA953X
-++       select ATH79_DEV_ETH
-++       select ATH79_DEV_GPIO_BUTTONS
-++       select ATH79_DEV_LEDS_GPIO
-++       select ATH79_DEV_M25P80
-++       select ATH79_DEV_WMAC
-++
-+ config ATH79_MACH_TL_WR941ND
-+ 	bool "TP-LINK TL-WR941ND support"
-+ 	select SOC_AR913X
-+--- a/arch/mips/ath79/Makefile
-++++ b/arch/mips/ath79/Makefile
-+@@ -85,6 +85,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR741ND)	+= m
-+ obj-$(CONFIG_ATH79_MACH_TL_WR741ND_V4)	+= mach-tl-wr741nd-v4.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WR841N_V1)	+= mach-tl-wr841n.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8)	+= mach-tl-wr841n-v8.o
-++obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9)	+= mach-tl-wr841n-v9.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WR941ND)	+= mach-tl-wr941nd.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2)	+= mach-tl-wr1041n-v2.o
-+ obj-$(CONFIG_ATH79_MACH_TL_WR1043ND)	+= mach-tl-wr1043nd.o
-+--- a/arch/mips/ath79/machtypes.h
-++++ b/arch/mips/ath79/machtypes.h
-+@@ -90,6 +90,7 @@ enum ath79_mach_type {
-+ 	ATH79_MACH_TL_WR841N_V1,	/* TP-LINK TL-WR841N v1 */
-+ 	ATH79_MACH_TL_WR841N_V7,	/* TP-LINK TL-WR841N/ND v7 */
-+ 	ATH79_MACH_TL_WR841N_V8,	/* TP-LINK TL-WR841N/ND v8 */
-++	ATH79_MACH_TL_WR841N_V9,	/* TP-LINK TL-WR841N/ND v9 */
-+ 	ATH79_MACH_TL_WR941ND,		/* TP-LINK TL-WR941ND */
-+ 	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
-+ 	ATH79_MACH_UBNT_BULLET_M,	/* Ubiquiti Bullet M */

+ 0 - 427
patches/openwrt/0020-Backport-support-for-TL-WR842N-v2-and-TL-MR3420-v2.patch

@@ -1,427 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Thu, 1 May 2014 02:26:02 +0200
-Subject: Backport support for TL-WR842N v2 and TL-MR3420 v2
-
-diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
-index 0bf2dd1..0d01119 100755
---- a/target/linux/ar71xx/base-files/etc/diag.sh
-+++ b/target/linux/ar71xx/base-files/etc/diag.sh
-@@ -127,6 +127,7 @@ get_status_led() {
- 		;;
- 	tl-mr3220 | \
- 	tl-mr3420 | \
-+	tl-mr3420-v2 | \
- 	tl-wa901nd | \
- 	tl-wa901nd-v2 | \
- 	tl-wdr3500 | \
-@@ -137,6 +138,7 @@ get_status_led() {
- 	tl-wr841n-v1 | \
- 	tl-wr841n-v7 | \
- 	tl-wr841n-v8 | \
-+	tl-wr842n-v2 | \
- 	tl-wr941nd)
- 		status_led="tp-link:green:system"
- 		;;
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/leds b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-index 43bc24d..f1ac9ec 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-@@ -118,6 +118,16 @@ tl-mr3420 )
- 	ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
- 	;;
- 
-+tl-mr3420-v2)
-+	ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
-+	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
-+	ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
-+	ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
-+	ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
-+	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
-+	ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
-+	;;
-+
- tl-wa901nd)
- 	ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
- 	;;
-@@ -172,6 +182,16 @@ tl-wr841n-v9)
- 	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
- 	;;
- 
-+tl-wr842n-v2)
-+	ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
-+	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
-+	ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
-+	ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x10"
-+	ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02"
-+	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
-+	ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
-+	;;
-+
- tl-wr941nd | \
- tl-wr1041n-v2)
- 	ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/network b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-index a1dfda0..e38a9b8 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/network
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-@@ -128,7 +128,9 @@ tl-wr941nd)
- 	ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
- 	;;
- 
--tl-wr841n-v8)
-+tl-mr3420-v2 |\
-+tl-wr841n-v8 |\
-+tl-wr842n-v2)
- 	ucidef_set_interfaces_lan_wan "eth1" "eth0"
- 	ucidef_add_switch "switch0" "1" "1"
- 	ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
-diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-index ca174da..11aa31b 100755
---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
-+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-@@ -351,6 +351,9 @@ ar71xx_board_detect() {
- 	*TL-MR3420)
- 		name="tl-mr3420"
- 		;;
-+	*"TL-MR3420 v2")
-+		name="tl-mr3420-v2"
-+		;;
- 	*TL-WA7510N)
- 		name="tl-wa7510n"
- 		;;
-@@ -384,6 +387,9 @@ ar71xx_board_detect() {
- 	*"TL-WR841N/ND v9")
- 		name="tl-wr841n-v9"
- 		;;
-+	*"TL-WR842N/ND v2")
-+		name="tl-wr842n-v2"
-+		;;
- 	*TL-WR941ND)
- 		name="tl-wr941nd"
- 		;;
-diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-index 7168b4e..b25df6c 100755
---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-@@ -152,6 +152,7 @@ platform_check_image() {
- 	tl-mr3040 | \
- 	tl-mr3220 | \
- 	tl-mr3420 | \
-+	tl-mr3420-v2 | \
- 	tl-wa7510n | \
- 	tl-wa901nd | \
- 	tl-wa901nd-v2 | \
-@@ -164,6 +165,7 @@ platform_check_image() {
- 	tl-wr841n-v7 | \
- 	tl-wr841n-v8 | \
- 	tl-wr841n-v9 | \
-+	tl-wr842n-v2 | \
- 	tl-wr941nd | \
- 	tl-wr1041n-v2 | \
- 	tl-wr1043nd | \
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
-index ffaf8d1..0099b15 100644
---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
-@@ -1,5 +1,5 @@
- /*
-- *  TP-LINK TL-WR841N/ND v8 board support
-+ *  TP-LINK TL-WR841N/ND v8/TL-MR3420 v2 board support
-  *
-  *  Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
-  *
-@@ -8,6 +8,7 @@
-  *  by the Free Software Foundation.
-  */
- 
-+#include <linux/gpio.h>
- #include <linux/platform_device.h>
- 
- #include <asm/mach-ath79/ath79.h>
-@@ -18,6 +19,7 @@
- #include "dev-gpio-buttons.h"
- #include "dev-leds-gpio.h"
- #include "dev-m25p80.h"
-+#include "dev-usb.h"
- #include "dev-wmac.h"
- #include "machtypes.h"
- 
-@@ -31,7 +33,10 @@
- #define TL_WR841NV8_GPIO_LED_SYSTEM	14
- 
- #define TL_WR841NV8_GPIO_BTN_RESET	17
--#define TL_WR841NV8_GPIO_SW_RFKILL	16
-+#define TL_WR841NV8_GPIO_SW_RFKILL	16	/* WPS for MR3420 v2 */
-+
-+#define TL_MR3420V2_GPIO_LED_3G	11
-+#define TL_MR3420V2_GPIO_USB_POWER	4
- 
- #define TL_WR841NV8_KEYS_POLL_INTERVAL	20	/* msecs */
- #define TL_WR841NV8_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR841NV8_KEYS_POLL_INTERVAL)
-@@ -78,6 +83,11 @@ static struct gpio_led tl_wr841n_v8_leds_gpio[] __initdata = {
- 		.name		= "tp-link:green:wlan",
- 		.gpio		= TL_WR841NV8_GPIO_LED_WLAN,
- 		.active_low	= 1,
-+	}, {
-+		/* the 3G LED is only present on the MR3420 v2 */
-+		.name		= "tp-link:green:3g",
-+		.gpio		= TL_MR3420V2_GPIO_LED_3G,
-+		.active_low	= 1,
- 	},
- };
- 
-@@ -99,17 +109,37 @@ static struct gpio_keys_button tl_wr841n_v8_gpio_keys[] __initdata = {
- 	}
- };
- 
--static void __init tl_wr841n_v8_setup(void)
-+static struct gpio_keys_button tl_mr3420v2_gpio_keys[] __initdata = {
-+	{
-+		.desc		= "Reset button",
-+		.type		= EV_KEY,
-+		.code		= KEY_RESTART,
-+		.debounce_interval = TL_WR841NV8_KEYS_DEBOUNCE_INTERVAL,
-+		.gpio		= TL_WR841NV8_GPIO_BTN_RESET,
-+		.active_low	= 1,
-+	}, {
-+		.desc		= "WPS",
-+		.type		= EV_KEY,
-+		.code		= KEY_WPS_BUTTON,
-+		.debounce_interval = TL_WR841NV8_KEYS_DEBOUNCE_INTERVAL,
-+		.gpio		= TL_WR841NV8_GPIO_SW_RFKILL,
-+		.active_low	= 0,
-+	}
-+};
-+
-+static void __init tl_ap123_setup(void)
- {
- 	u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
- 	u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
- 
--	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr841n_v8_leds_gpio),
--				 tl_wr841n_v8_leds_gpio);
-+	/* Disable JTAG, enabling GPIOs 0-3 */
-+	/* Configure OBS4 line, for GPIO 4*/
-+	ath79_gpio_function_setup(AR934X_GPIO_FUNC_JTAG_DISABLE,
-+				 AR934X_GPIO_FUNC_CLK_OBS4_EN);
- 
--	ath79_register_gpio_keys_polled(1, TL_WR841NV8_KEYS_POLL_INTERVAL,
--					ARRAY_SIZE(tl_wr841n_v8_gpio_keys),
--					tl_wr841n_v8_gpio_keys);
-+	/* config gpio4 as normal gpio function */
-+	ath79_gpio_output_select(TL_MR3420V2_GPIO_USB_POWER,
-+				 AR934X_GPIO_OUT_GPIO);
- 
- 	ath79_register_m25p80(&tl_wr841n_v8_flash_data);
- 
-@@ -135,5 +165,61 @@ static void __init tl_wr841n_v8_setup(void)
- 	ath79_register_wmac(ee, mac);
- }
- 
-+static void __init tl_wr841n_v8_setup(void)
-+{
-+	tl_ap123_setup();
-+
-+	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr841n_v8_leds_gpio) - 1,
-+				 tl_wr841n_v8_leds_gpio);
-+
-+	ath79_register_gpio_keys_polled(1, TL_WR841NV8_KEYS_POLL_INTERVAL,
-+					ARRAY_SIZE(tl_wr841n_v8_gpio_keys),
-+					tl_wr841n_v8_gpio_keys);
-+}
-+
- MIPS_MACHINE(ATH79_MACH_TL_WR841N_V8, "TL-WR841N-v8", "TP-LINK TL-WR841N/ND v8",
- 	     tl_wr841n_v8_setup);
-+
-+
-+static void __init tl_wr842n_v2_setup(void)
-+{
-+	tl_ap123_setup();
-+
-+	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr841n_v8_leds_gpio),
-+				 tl_wr841n_v8_leds_gpio);
-+
-+	ath79_register_gpio_keys_polled(1, TL_WR841NV8_KEYS_POLL_INTERVAL,
-+					ARRAY_SIZE(tl_wr841n_v8_gpio_keys),
-+					tl_wr841n_v8_gpio_keys);
-+
-+	gpio_request_one(TL_MR3420V2_GPIO_USB_POWER,
-+			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
-+			 "USB power");
-+
-+	ath79_register_usb();
-+}
-+
-+MIPS_MACHINE(ATH79_MACH_TL_WR842N_V2, "TL-WR842N-v2", "TP-LINK TL-WR842N/ND v2",
-+	     tl_wr842n_v2_setup);
-+
-+static void __init tl_mr3420v2_setup(void)
-+{
-+	tl_ap123_setup();
-+
-+	ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr841n_v8_leds_gpio),
-+				tl_wr841n_v8_leds_gpio);
-+
-+	ath79_register_gpio_keys_polled(1, TL_WR841NV8_KEYS_POLL_INTERVAL,
-+				ARRAY_SIZE(tl_mr3420v2_gpio_keys),
-+				tl_mr3420v2_gpio_keys);
-+
-+	/* enable power for the USB port */
-+	gpio_request_one(TL_MR3420V2_GPIO_USB_POWER,
-+			 GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
-+			 "USB power");
-+
-+	ath79_register_usb();
-+}
-+
-+MIPS_MACHINE(ATH79_MACH_TL_MR3420_V2, "TL-MR3420-v2", "TP-LINK TL-MR3420 v2",
-+	     tl_mr3420v2_setup);
-diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
-index c270f73..a055521 100644
---- a/target/linux/ar71xx/image/Makefile
-+++ b/target/linux/ar71xx/image/Makefile
-@@ -853,7 +853,7 @@ $(eval $(call SingleProfile,Planex,$(fs_64k),MZKW300NH,mzk-w300nh,MZK-W300NH,tty
- $(eval $(call SingleProfile,TPLINKOLD,$(fs_squash),TLWR841NV15,tl-wr841nd-v1.5,TL-WR841N-v1.5,ttyS0,115200,0x08410002,2,4M))
- 
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3220,tl-mr3220-v1,TL-MR3220,ttyS0,115200,0x32200001,1,4M))
--$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M))
-+$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLMR3420V1,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA701,tl-wa701n-v1,TL-WA901ND,ttyS0,115200,0x07010001,1,4M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA7510NV1,tl-wa7510n,TL-WA7510N,ttyS0,115200,0x75100001,1,4M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWA901NV1,tl-wa901nd-v1,TL-WA901ND,ttyS0,115200,0x09010001,1,4M))
-@@ -866,7 +866,7 @@ $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR743,tl-wr743nd-v1,TL-WR741ND
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR841NV3,tl-wr841nd-v3,TL-WR941ND,ttyS0,115200,0x08410003,3,4M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR841NV5,tl-wr841nd-v5,TL-WR741ND,ttyS0,115200,0x08410005,1,4M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR841NV7,tl-wr841nd-v7,TL-WR841N-v7,ttyS0,115200,0x08410007,1,4M))
--$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR842,tl-wr842n-v1,TL-MR3420,ttyS0,115200,0x08420001,1,8M))
-+$(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR842V1,tl-wr842n-v1,TL-MR3420,ttyS0,115200,0x08420001,1,8M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV2,tl-wr941nd-v2,TL-WR941ND,ttyS0,115200,0x09410002,2,4M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV3,tl-wr941nd-v3,TL-WR941ND,ttyS0,115200,0x09410002,2,4M))
- $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,ttyS0,115200,0x09410004,1,4M))
-@@ -875,11 +875,13 @@ $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR1043,tl-wr1043nd-v1,TL-WR104
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR11U,tl-mr11u-v1,TL-MR11U,ttyATH0,115200,0x00110101,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3020,tl-mr3020-v1,TL-MR3020,ttyATH0,115200,0x30200001,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3040,tl-mr3040-v1,TL-MR3040,ttyATH0,115200,0x30400001,1,4Mlzma))
-+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3420V2,tl-mr3420-v2,TL-MR3420-v2,ttyS0,115200,0x34200002,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR703,tl-wr703n-v1,TL-WR703N,ttyATH0,115200,0x07030101,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR740NV4,tl-wr740n-v4,TL-WR741ND-v4,ttyATH0,115200,0x07400004,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR741NV4,tl-wr741nd-v4,TL-WR741ND-v4,ttyATH0,115200,0x07410004,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR841NV8,tl-wr841n-v8,TL-WR841N-v8,ttyS0,115200,0x08410008,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR841NV9,tl-wr841n-v9,TL-WR841N-v9,ttyS0,115200,0x08410009,1,4Mlzma))
-+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR842V2,tl-wr842n-v2,TL-WR842N-v2,ttyS0,115200,0x8420002,1,8Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR1041,tl-wr1041n-v2,TL-WR1041N-v2,ttyS0,115200,0x10410002,1,4Mlzma))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
- $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWDR3500V1,tl-wdr3500-v1,TL-WDR3500,ttyS0,115200,0x35000001,1,8Mlzma))
-@@ -921,11 +923,13 @@ $(eval $(call SingleProfile,ZyXEL,$(fs_64k),NBG_460N_550N_550NH,nbg460n_550n_550
- $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M))
- $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT))
- $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
-+$(eval $(call MultiProfile,TLMR3420,TLMR3420V1 TLMR3420V2))
- $(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2))
- $(eval $(call MultiProfile,TLWA7510,TLWA7510NV1))
- $(eval $(call MultiProfile,TLWR740,TLWR740NV1 TLWR740NV3 TLWR740NV4))
- $(eval $(call MultiProfile,TLWR741,TLWR741NV1 TLWR741NV2 TLWR741NV4))
- $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7 TLWR841NV8 TLWR841NV9))
-+$(eval $(call MultiProfile,TLWR842,TLWR842V1 TLWR842V2))
- $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
- $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4310V1))
- $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTNANOM UBNTUNIFI UBNTUNIFIOUTDOOR))
-diff --git a/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
-index 0230908..6d67f5f 100644
---- a/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
-+++ b/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
-@@ -1,6 +1,6 @@
- --- a/arch/mips/ath79/machtypes.h
- +++ b/arch/mips/ath79/machtypes.h
--@@ -16,18 +16,102 @@
-+@@ -16,18 +16,104 @@
-  
-  enum ath79_mach_type {
-  	ATH79_MACH_GENERIC = 0,
-@@ -61,6 +61,7 @@
- +	ATH79_MACH_TL_MR3040,		/* TP-LINK TL-MR3040 */
- +	ATH79_MACH_TL_MR3220,		/* TP-LINK TL-MR3220 */
- +	ATH79_MACH_TL_MR3420,		/* TP-LINK TL-MR3420 */
-++	ATH79_MACH_TL_MR3420_V2,	/* TP-LINK TL-MR3420 v2 */
- +	ATH79_MACH_TL_WA901ND,		/* TP-LINK TL-WA901ND */
- +	ATH79_MACH_TL_WA901ND_V2,	/* TP-LINK TL-WA901ND v2 */
- +	ATH79_MACH_TL_WDR4300,		/* TP-LINK TL-WDR4300 */
-@@ -73,6 +74,7 @@
- +	ATH79_MACH_TL_WR841N_V1,	/* TP-LINK TL-WR841N v1 */
- +	ATH79_MACH_TL_WR841N_V7,	/* TP-LINK TL-WR841N/ND v7 */
- +	ATH79_MACH_TL_WR841N_V8,	/* TP-LINK TL-WR841N/ND v8 */
-++	ATH79_MACH_TL_WR842N_V2,	/* TP-LINK TL-WR842N/ND v2 */
- +	ATH79_MACH_TL_WR941ND,		/* TP-LINK TL-WR941ND */
-  	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
-  	ATH79_MACH_UBNT_BULLET_M,	/* Ubiquiti Bullet M */
-diff --git a/target/linux/ar71xx/patches-3.3/612-MIPS-ath79-TL-WA7510N-v1-support.patch b/target/linux/ar71xx/patches-3.3/612-MIPS-ath79-TL-WA7510N-v1-support.patch
-index 6bd58b0..dba879e 100644
---- a/target/linux/ar71xx/patches-3.3/612-MIPS-ath79-TL-WA7510N-v1-support.patch
-+++ b/target/linux/ar71xx/patches-3.3/612-MIPS-ath79-TL-WA7510N-v1-support.patch
-@@ -1,9 +1,9 @@
- --- a/arch/mips/ath79/machtypes.h
- +++ b/arch/mips/ath79/machtypes.h
--@@ -74,6 +74,7 @@ enum ath79_mach_type {
-- 	ATH79_MACH_TL_MR3040,		/* TP-LINK TL-MR3040 */
-+@@ -75,6 +75,7 @@ enum ath79_mach_type {
-  	ATH79_MACH_TL_MR3220,		/* TP-LINK TL-MR3220 */
-  	ATH79_MACH_TL_MR3420,		/* TP-LINK TL-MR3420 */
-+ 	ATH79_MACH_TL_MR3420_V2,	/* TP-LINK TL-MR3420 v2 */
- +	ATH79_MACH_TL_WA7510N_V1,	/* TP-LINK TL-WA7510N v1*/
-  	ATH79_MACH_TL_WA901ND,		/* TP-LINK TL-WA901ND */
-  	ATH79_MACH_TL_WA901ND_V2,	/* TP-LINK TL-WA901ND v2 */
-diff --git a/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-add-TL-WDR3500-support.patch b/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-add-TL-WDR3500-support.patch
-index 0a2c3bd..059089b 100644
---- a/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-add-TL-WDR3500-support.patch
-+++ b/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-add-TL-WDR3500-support.patch
-@@ -1,6 +1,6 @@
- --- a/arch/mips/ath79/machtypes.h
- +++ b/arch/mips/ath79/machtypes.h
--@@ -84,6 +84,7 @@ enum ath79_mach_type {
-+@@ -78,6 +78,7 @@ enum ath79_mach_type {
-  	ATH79_MACH_TL_WA7510N_V1,	/* TP-LINK TL-WA7510N v1*/
-  	ATH79_MACH_TL_WA901ND,		/* TP-LINK TL-WA901ND */
-  	ATH79_MACH_TL_WA901ND_V2,	/* TP-LINK TL-WA901ND v2 */
-@@ -10,7 +10,7 @@
-  	ATH79_MACH_TL_WR1043ND,		/* TP-LINK TL-WR1043ND */
- --- a/arch/mips/ath79/Kconfig
- +++ b/arch/mips/ath79/Kconfig
--@@ -514,6 +514,17 @@ config ATH79_MACH_TL_WA901ND_V2
-+@@ -469,6 +469,17 @@ config ATH79_MACH_TL_WA901ND_V2
-  	select ATH79_DEV_M25P80
-  	select ATH79_DEV_WMAC
-  
-@@ -30,7 +30,7 @@
-  	select SOC_AR934X
- --- a/arch/mips/ath79/Makefile
- +++ b/arch/mips/ath79/Makefile
--@@ -81,6 +81,7 @@ obj-$(CONFIG_ATH79_MACH_TL_MR3020)	+= ma
-+@@ -78,6 +78,7 @@ obj-$(CONFIG_ATH79_MACH_TL_MR3020)	+= ma
-  obj-$(CONFIG_ATH79_MACH_TL_MR3X20)	+= mach-tl-mr3x20.o
-  obj-$(CONFIG_ATH79_MACH_TL_WA901ND)	+= mach-tl-wa901nd.o
-  obj-$(CONFIG_ATH79_MACH_TL_WA901ND_V2)	+= mach-tl-wa901nd-v2.o
-diff --git a/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-ubnt-xm-add-unifi-outdoor.patch b/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-ubnt-xm-add-unifi-outdoor.patch
-index 8a1c770..9766afe 100644
---- a/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-ubnt-xm-add-unifi-outdoor.patch
-+++ b/target/linux/ar71xx/patches-3.3/613-MIPS-ath79-ubnt-xm-add-unifi-outdoor.patch
-@@ -56,7 +56,7 @@
- +	     ubnt_unifi_outdoor_setup);
- --- a/arch/mips/ath79/machtypes.h
- +++ b/arch/mips/ath79/machtypes.h
--@@ -97,6 +97,7 @@ enum ath79_mach_type {
-+@@ -100,6 +100,7 @@ enum ath79_mach_type {
-  	ATH79_MACH_UBNT_RSPRO,		/* Ubiquiti RouterStation Pro */
-  	ATH79_MACH_UBNT_RS,		/* Ubiquiti RouterStation */
-  	ATH79_MACH_UBNT_UNIFI, 		/* Ubiquiti Unifi */
-diff --git a/target/linux/ar71xx/patches-3.3/708-MIPS-ath79-TL-WR841v9-support.patch b/target/linux/ar71xx/patches-3.3/708-MIPS-ath79-TL-WR841v9-support.patch
-index 37425a6..612970b 100644
---- a/target/linux/ar71xx/patches-3.3/708-MIPS-ath79-TL-WR841v9-support.patch
-+++ b/target/linux/ar71xx/patches-3.3/708-MIPS-ath79-TL-WR841v9-support.patch
-@@ -33,6 +33,6 @@
-  	ATH79_MACH_TL_WR841N_V7,	/* TP-LINK TL-WR841N/ND v7 */
-  	ATH79_MACH_TL_WR841N_V8,	/* TP-LINK TL-WR841N/ND v8 */
- +	ATH79_MACH_TL_WR841N_V9,	/* TP-LINK TL-WR841N/ND v9 */
-+ 	ATH79_MACH_TL_WR842N_V2,	/* TP-LINK TL-WR842N/ND v2 */
-  	ATH79_MACH_TL_WR941ND,		/* TP-LINK TL-WR941ND */
-  	ATH79_MACH_UBNT_AIRROUTER,	/* Ubiquiti AirRouter */
-- 	ATH79_MACH_UBNT_BULLET_M,	/* Ubiquiti Bullet M */

+ 0 - 110
patches/openwrt/0021-x86-add-grub2-iso-support.patch

@@ -1,110 +0,0 @@
-From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 7 Oct 2012 23:01:52 +0000
-Subject: x86: add grub2 iso support
-
-diff --git a/Config.in b/Config.in
-index 5b4522e..54df7c8 100644
---- a/Config.in
-+++ b/Config.in
-@@ -81,7 +81,7 @@ menu "Target Images"
- 	config TARGET_ROOTFS_ISO
- 		bool "iso"
- 		default n
--		depends TARGET_ROOTFS_INITRAMFS && TARGET_x86
-+		depends on TARGET_x86_generic
- 		help
- 		  Create some bootable ISO image
- 
-diff --git a/target/linux/x86/base-files/lib/preinit/20_check_iso b/target/linux/x86/base-files/lib/preinit/20_check_iso
-new file mode 100644
-index 0000000..beff6eb
---- /dev/null
-+++ b/target/linux/x86/base-files/lib/preinit/20_check_iso
-@@ -0,0 +1,5 @@
-+check_for_iso() {
-+	grep -qE '/dev/root.*iso9660' /proc/mounts && ramoverlay
-+}
-+
-+boot_hook_add preinit_mount_root check_for_iso
-diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
-index 13da511..8f0debd 100644
---- a/target/linux/x86/image/Makefile
-+++ b/target/linux/x86/image/Makefile
-@@ -9,7 +9,8 @@ include $(INCLUDE_DIR)/image.mk
- 
- export PATH=$(TARGET_PATH):/sbin
- 
--GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga
-+GRUB2_MODULES = at_keyboard biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga
-+GRUB2_MODULES_ISO = at_keyboard biosdisk boot chain configfile iso9660 linux ls part_msdos reboot serial vga
- GRUB_TERMINALS =
- GRUB_SERIAL_CONFIG =
- GRUB_TERMINAL_CONFIG =
-@@ -51,7 +52,7 @@ ifneq ($(CONFIG_X86_GRUB_IMAGES),)
-   define Image/cmdline/ext4
-     root=$(ROOTPART) rootfstype=ext4 rootwait
-   endef
--  
-+
-   define Image/cmdline/jffs2-64k
-     block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=jffs2 rootwait
-   endef
-@@ -165,7 +166,31 @@ define Image/Build/squashfs
- 	$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
- endef
- 
--define Image/Build/iso 
-+ifdef CONFIG_X86_USE_GRUB2
-+  define Image/Build/iso
-+	$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
-+	$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
-+	grub-mkimage \
-+		-o $(KDIR)/grub2/eltorito.img \
-+		-O i386-pc \
-+		-c ./grub-early.cfg \
-+		$(GRUB2_MODULES_ISO)
-+	cat \
-+		$(STAGING_DIR_HOST)/lib/grub/i386-pc/cdboot.img \
-+		$(KDIR)/grub2/eltorito.img \
-+		> $(KDIR)/root.grub/boot/grub/eltorito.img
-+	sed \
-+		-e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \
-+		-e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
-+		-e 's#@CMDLINE@#root=/dev/sr0 rootfstype=iso9660 rootwait $(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \
-+		-e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \
-+		./grub-iso.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg
-+	$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
-+	mkisofs -R -b boot/grub/eltorito.img -no-emul-boot -boot-info-table \
-+		-o $(KDIR)/root.iso $(KDIR)/root.grub $(TARGET_DIR)
-+  endef
-+else
-+  define Image/Build/iso
- 	$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub
- 	$(CP) \
- 		$(KDIR)/stage2_eltorito \
-@@ -179,7 +204,8 @@ define Image/Build/iso
- 	$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz 
- 	mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table \
- 		-o $(KDIR)/root.iso $(KDIR)/root.grub 
--endef 
-+  endef
-+endif
- 
- ifneq ($(CONFIG_X86_VDI_IMAGES),)
-   define Image/Build/vdi
-diff --git a/target/linux/x86/image/grub-iso.cfg b/target/linux/x86/image/grub-iso.cfg
-new file mode 100644
-index 0000000..4d5d697
---- /dev/null
-+++ b/target/linux/x86/image/grub-iso.cfg
-@@ -0,0 +1,10 @@
-+@SERIAL_CONFIG@
-+@TERMINAL_CONFIG@
-+
-+set default="0"
-+set timeout="@TIMEOUT@"
-+set root='(cd)'
-+
-+menuentry "OpenWrt" {
-+	linux /boot/vmlinuz @CMDLINE@ noinitrd reboot=bios
-+}

+ 0 - 24
patches/openwrt/0022-x86-explicitely-pass-staging-directory-to-grub-mkimage-instead-of-relying-on-build-time-defaults-12821.patch

@@ -1,24 +0,0 @@
-From: jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Thu, 17 Jan 2013 15:46:26 +0000
-Subject: x86: explicitely pass staging directory to grub-mkimage instead of relying on build time defaults (#12821)
-
-diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
-index 8f0debd..6e2bd54 100644
---- a/target/linux/x86/image/Makefile
-+++ b/target/linux/x86/image/Makefile
-@@ -102,6 +102,7 @@ ifneq ($(CONFIG_X86_GRUB_IMAGES),)
- 	$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
- 	$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
- 	grub-mkimage \
-+		-d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
- 		-o $(KDIR)/grub2/core.img \
- 		-O i386-pc \
- 		-c ./grub-early.cfg \
-@@ -171,6 +172,7 @@ ifdef CONFIG_X86_USE_GRUB2
- 	$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
- 	$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
- 	grub-mkimage \
-+		-d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
- 		-o $(KDIR)/grub2/eltorito.img \
- 		-O i386-pc \
- 		-c ./grub-early.cfg \

+ 0 - 57
patches/openwrt/0023-grub2-Add-sub-package-grub-editenv-for-target-installation.patch

@@ -1,57 +0,0 @@
-From: blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Tue, 7 May 2013 12:35:07 +0000
-Subject: grub2: Add sub package grub-editenv for target installation
-
-grub-editenv allows to modify grub2 environment files. Add a new package
-that build grub2 for the target and packs up grub-editenv.
-
-Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
-
-diff --git a/package/grub2/Makefile b/package/grub2/Makefile
-index b606f54..dd490ff 100644
---- a/package/grub2/Makefile
-+++ b/package/grub2/Makefile
-@@ -16,7 +16,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
- PKG_SOURCE_URL:=@GNU/grub
- PKG_MD5SUM:=e927540b6eda8b024fb0391eeaa4091c
- 
--PKG_HOST_ONLY:=1
- HOST_BUILD_PARALLEL:=1
- PKG_BUILD_DEPENDS:=grub2/host
- 
-@@ -32,6 +31,23 @@ define Package/grub2
-   DEPENDS:=@TARGET_x86
- endef
- 
-+define Package/grub2-editenv
-+  CATEGORY:=Utilities
-+  SECTION:=utils
-+  TITLE:=Grub2 Environment editor
-+  URL:=http://www.gnu.org/software/grub/
-+  DEPENDS:=@TARGET_x86
-+endef
-+
-+define Package/grub2-editenv/description
-+	Edit grub2 environment files.
-+endef
-+
-+CONFIGURE_ARGS += \
-+	--target=$(REAL_GNU_TARGET_NAME) \
-+	--disable-werror \
-+	--disable-nls
-+
- HOST_CONFIGURE_ARGS += \
- 	--target=$(REAL_GNU_TARGET_NAME) \
- 	--sbindir="$(STAGING_DIR_HOST)/bin" \
-@@ -47,5 +63,11 @@ define Host/Configure
- 	$(Host/Configure/Default)
- endef
- 
-+define Package/grub2-editenv/install
-+	$(INSTALL_DIR) $(1)/usr/sbin
-+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
-+endef
-+
- $(eval $(call HostBuild))
- $(eval $(call BuildPackage,grub2))
-+$(eval $(call BuildPackage,grub2-editenv))

+ 0 - 37
patches/openwrt/0024-x86-Fix-CONFIG_X86_GRUB_SERIAL.patch

@@ -1,37 +0,0 @@
-From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sat, 10 Aug 2013 18:35:29 +0000
-Subject: x86: Fix CONFIG_X86_GRUB_SERIAL=""
-
-With
-
-    .config:CONFIG_X86_GRUB_SERIAL=""
-
-which (AFAICT) is the way to tell GRUB not to use a serial console, in
-
-    target/linux/x86/image/Makefile:ifneq ($(CONFIG_X86_GRUB_SERIAL),)
-
-$(CONFIG_X86_GRUB_SERIAL) expands to `""' (a literal double double-quote),
-making the condition unconditionally false.
-
-This patch fixes the situation by passing CONFIG_X86_GRUB_SERIAL through
-qstrip before testing.
-
-Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
-
-diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
-index 6e2bd54..2e73519 100644
---- a/target/linux/x86/image/Makefile
-+++ b/target/linux/x86/image/Makefile
-@@ -27,8 +27,10 @@ ifneq ($(strip $(foreach subtarget,$(USE_ATKBD),$(CONFIG_TARGET_x86_$(subtarget)
-   GRUB2_MODULES += at_keyboard
- endif
- 
--ifneq ($(CONFIG_X86_GRUB_SERIAL),)
--  GRUB_CONSOLE_CMDLINE += console=$(call qstrip,$(CONFIG_X86_GRUB_SERIAL)),$(CONFIG_X86_GRUB_BAUDRATE)n8
-+GRUB_SERIAL:=$(call qstrip,$(CONFIG_X86_GRUB_SERIAL))
-+
-+ifneq ($(GRUB_SERIAL),)
-+  GRUB_CONSOLE_CMDLINE += console=$(GRUB_SERIAL),$(CONFIG_X86_GRUB_BAUDRATE)n8
-   GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_X86_GRUB_BAUDRATE) --word=8 --parity=no --stop=1
-   GRUB_TERMINALS += serial
- endif

+ 0 - 218
patches/openwrt/0025-grub2-update-to-2.02-beta2-fixes-mac-os-x-10.9-support-and-many-other-things.patch

@@ -1,218 +0,0 @@
-From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Wed, 12 Mar 2014 11:21:16 +0000
-Subject: grub2: update to 2.02-beta2, fixes mac os x 10.9 support (and many other things)
-
-Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-
-diff --git a/package/grub2/Makefile b/package/grub2/Makefile
-index dd490ff..4edd92b 100644
---- a/package/grub2/Makefile
-+++ b/package/grub2/Makefile
-@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
- include $(INCLUDE_DIR)/kernel.mk
- 
- PKG_NAME:=grub
--PKG_VERSION:=2.00
-+PKG_VERSION:=2.02~beta2
- PKG_RELEASE:=1
- 
--PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
--PKG_SOURCE_URL:=@GNU/grub
--PKG_MD5SUM:=e927540b6eda8b024fb0391eeaa4091c
-+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-+PKG_SOURCE_URL:=http://alpha.gnu.org/gnu/grub
-+PKG_MD5SUM:=be62932eade308a364ea4bbc91295930
- 
- HOST_BUILD_PARALLEL:=1
- PKG_BUILD_DEPENDS:=grub2/host
-diff --git a/package/grub2/patches/100-grub_setup_root.patch b/package/grub2/patches/100-grub_setup_root.patch
-index 7775b2a..9619c41 100644
---- a/package/grub2/patches/100-grub_setup_root.patch
-+++ b/package/grub2/patches/100-grub_setup_root.patch
-@@ -1,41 +1,6 @@
- --- a/util/grub-setup.c
- +++ b/util/grub-setup.c
--@@ -141,12 +141,11 @@ write_rootdev (char *core_img, grub_devi
-- static void
-- setup (const char *dir,
--        const char *boot_file, const char *core_file,
---       const char *dest, int force,
--+       const char *root, const char *dest, int force,
--        int fs_probe, int allow_floppy)
-- {
--   char *boot_path, *core_path, *core_path_dev, *core_path_dev_full;
--   char *boot_img, *core_img;
---  char *root = 0;
--   size_t boot_size, core_size;
--   grub_uint16_t core_sectors;
--   grub_device_t root_dev = 0, dest_dev, core_dev;
--@@ -253,7 +252,10 @@ setup (const char *dir,
-- 
--   core_dev = dest_dev;
-- 
---  {
--+  if (root)
--+    root_dev = grub_device_open(root);
--+
--+  if (!root_dev) {
--     char **root_devices = grub_guess_root_devices (dir);
--     char **cur;
--     int found = 0;
--@@ -263,6 +265,8 @@ setup (const char *dir,
-- 	char *drive;
-- 	grub_device_t try_dev;
-- 
--+	if (root_dev)
--+	  break;
-- 	drive = grub_util_get_grub_dev (*cur);
-- 	if (!drive)
-- 	  continue;
--@@ -956,6 +960,8 @@ static struct argp_option options[] = {
-+@@ -87,6 +87,8 @@ static struct argp_option options[] = {
-     N_("install even if problems are detected"), 0},
-    {"skip-fs-probe",'s',0,      0,
-     N_("do not probe for filesystems in DEVICE"), 0},
-@@ -44,7 +9,7 @@
-    {"verbose",     'v', 0,      0, N_("print verbose messages."), 0},
-    {"allow-floppy", 'a', 0,      0,
-     /* TRANSLATORS: The potential breakage isn't limited to floppies but it's
--@@ -993,6 +999,7 @@ struct arguments
-+@@ -130,6 +132,7 @@ struct arguments
-    char *core_file;
-    char *dir;
-    char *dev_map;
-@@ -52,7 +17,7 @@
-    int  force;
-    int  fs_probe;
-    int allow_floppy;
--@@ -1040,6 +1047,13 @@ argp_parser (int key, char *arg, struct 
-+@@ -178,6 +181,13 @@ argp_parser (int key, char *arg, struct 
-          arguments->dev_map = xstrdup (arg);
-          break;
-  
-@@ -66,12 +31,88 @@
-        case 'f':
-          arguments->force = 1;
-          break;
--@@ -1172,7 +1186,7 @@ main (int argc, char *argv[])
--   setup (arguments.dir ? : DEFAULT_DIRECTORY,
-- 	 arguments.boot_file ? : DEFAULT_BOOT_FILE,
-- 	 arguments.core_file ? : DEFAULT_CORE_FILE,
---	 dest_dev, arguments.force,
--+	 arguments.root_dev, dest_dev, arguments.force,
-- 	 arguments.fs_probe, arguments.allow_floppy);
-+@@ -313,7 +323,7 @@ main (int argc, char *argv[])
-+   GRUB_SETUP_FUNC (arguments.dir ? : DEFAULT_DIRECTORY,
-+ 		   arguments.boot_file ? : DEFAULT_BOOT_FILE,
-+ 		   arguments.core_file ? : DEFAULT_CORE_FILE,
-+-		   dest_dev, arguments.force,
-++		   arguments.root_dev, dest_dev, arguments.force,
-+ 		   arguments.fs_probe, arguments.allow_floppy,
-+ 		   arguments.add_rs_codes);
-+ 
-+--- a/util/setup.c
-++++ b/util/setup.c
-+@@ -247,13 +247,12 @@ identify_partmap (grub_disk_t disk __att
-+ void
-+ SETUP (const char *dir,
-+        const char *boot_file, const char *core_file,
-+-       const char *dest, int force,
-++       const char *root, const char *dest, int force,
-+        int fs_probe, int allow_floppy,
-+        int add_rs_codes __attribute__ ((unused))) /* unused on sparc64 */
-+ {
-+   char *core_path;
-+   char *boot_img, *core_img, *boot_path;
-+-  char *root = 0;
-+   size_t boot_size, core_size;
-+ #ifdef GRUB_SETUP_BIOS
-+   grub_uint16_t core_sectors;
-+@@ -307,7 +306,10 @@ SETUP (const char *dir,
-+ 
-+   core_dev = dest_dev;
-+ 
-+-  {
-++  if (root)
-++    root_dev = grub_device_open(root);
-++
-++  if (!root_dev) {
-+     char **root_devices = grub_guess_root_devices (dir);
-+     char **cur;
-+     int found = 0;
-+@@ -317,6 +319,8 @@ SETUP (const char *dir,
-+ 	char *drive;
-+ 	grub_device_t try_dev;
-+ 
-++	if (root_dev)
-++	  break;
-+ 	drive = grub_util_get_grub_dev (*cur);
-+ 	if (!drive)
-+ 	  continue;
-+--- a/include/grub/util/install.h
-++++ b/include/grub/util/install.h
-+@@ -182,13 +182,13 @@ grub_install_get_image_target (const cha
-+ void
-+ grub_util_bios_setup (const char *dir,
-+ 		      const char *boot_file, const char *core_file,
-+-		      const char *dest, int force,
-++		      const char *root, const char *dest, int force,
-+ 		      int fs_probe, int allow_floppy,
-+ 		      int add_rs_codes);
-+ void
-+ grub_util_sparc_setup (const char *dir,
-+ 		       const char *boot_file, const char *core_file,
-+-		       const char *dest, int force,
-++		       const char *root, const char *dest, int force,
-+ 		       int fs_probe, int allow_floppy,
-+ 		       int add_rs_codes);
-  
--   /* Free resources.  */
-+--- a/util/grub-install.c
-++++ b/util/grub-install.c
-+@@ -1660,7 +1660,7 @@ main (int argc, char *argv[])
-+ 	/*  Now perform the installation.  */
-+ 	if (install_bootsector)
-+ 	  grub_util_bios_setup (platdir, "boot.img", "core.img",
-+-				install_drive, force,
-++				NULL, install_drive, force,
-+ 				fs_probe, allow_floppy, add_rs_codes);
-+ 	break;
-+       }
-+@@ -1686,7 +1686,7 @@ main (int argc, char *argv[])
-+ 	/*  Now perform the installation.  */
-+ 	if (install_bootsector)
-+ 	  grub_util_sparc_setup (platdir, "boot.img", "core.img",
-+-				 install_device, force,
-++				 NULL, install_device, force,
-+ 				 fs_probe, allow_floppy,
-+ 				 0 /* unused */ );
-+ 	break;
-diff --git a/package/grub2/patches/200-fix-gets-removal.patch b/package/grub2/patches/200-fix-gets-removal.patch
-index 4370fb5..737fb97 100644
---- a/package/grub2/patches/200-fix-gets-removal.patch
-+++ b/package/grub2/patches/200-fix-gets-removal.patch
-@@ -1,15 +1,16 @@
- --- a/grub-core/gnulib/stdio.in.h
- +++ b/grub-core/gnulib/stdio.in.h
--@@ -137,12 +137,6 @@
--                  "use gnulib module fflush for portable POSIX compliance");
-+@@ -695,13 +695,6 @@ _GL_WARN_ON_USE (getline, "getline is un
-+ # endif
-  #endif
-  
- -/* It is very rare that the developer ever has full control of stdin,
---   so any use of gets warrants an unconditional warning.  Assume it is
---   always declared, since it is required by C89.  */
-+-   so any use of gets warrants an unconditional warning; besides, C11
-+-   removed it.  */
- -#undef gets
---_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
-+-#if HAVE_RAW_DECL_GETS
-+-#endif
- -
-- #if @GNULIB_FOPEN@
-- # if @REPLACE_FOPEN@
-- #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-+ 
-+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
-+ struct obstack;

+ 0 - 20
patches/openwrt/0026-grub2-disable-libdevmapper-fix-build-when-it-s-available.patch

@@ -1,20 +0,0 @@
-From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 30 Mar 2014 19:55:39 +0000
-Subject: grub2: disable libdevmapper - fix build when it's available
-
-Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
-
-diff --git a/package/grub2/Makefile b/package/grub2/Makefile
-index 4edd92b..ed86fff 100644
---- a/package/grub2/Makefile
-+++ b/package/grub2/Makefile
-@@ -46,7 +46,8 @@ endef
- CONFIGURE_ARGS += \
- 	--target=$(REAL_GNU_TARGET_NAME) \
- 	--disable-werror \
--	--disable-nls
-+	--disable-nls \
-+	--disable-device-mapper
- 
- HOST_CONFIGURE_ARGS += \
- 	--target=$(REAL_GNU_TARGET_NAME) \

+ 0 - 20
patches/openwrt/0027-grub2-disable-mkfont-fix-build-on-Archlinux.patch

@@ -1,20 +0,0 @@
-From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
-Date: Sun, 30 Mar 2014 19:55:43 +0000
-Subject: grub2: disable mkfont - fix build on Archlinux
-
-Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
-
-diff --git a/package/grub2/Makefile b/package/grub2/Makefile
-index ed86fff..509fb60 100644
---- a/package/grub2/Makefile
-+++ b/package/grub2/Makefile
-@@ -47,7 +47,8 @@ CONFIGURE_ARGS += \
- 	--target=$(REAL_GNU_TARGET_NAME) \
- 	--disable-werror \
- 	--disable-nls \
--	--disable-device-mapper
-+	--disable-device-mapper \
-+	--disable-grub-mkfont
- 
- HOST_CONFIGURE_ARGS += \
- 	--target=$(REAL_GNU_TARGET_NAME) \

+ 0 - 155
patches/openwrt/0028-ar71xx-add-support-for-dlink-dir-615-e1.patch

@@ -1,155 +0,0 @@
-From: Zhao, Gang <gamerh2o@gmail.com>
-Date: Wed, 21 May 2014 23:26:28 +0800
-Subject: ar71xx: add support for dlink dir-615-e1
-
-Dlink dir-615-e1 can use dir-600-a1's image, but the image can't be
-uploaded through dlink's normal firmware update web page.
-
-Add profile for dir-615-e1 so the generated image can be uploaded
-through the firmware update web page.
-
-Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
-
-diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
-index 0d01119..c86044b 100755
---- a/target/linux/ar71xx/base-files/etc/diag.sh
-+++ b/target/linux/ar71xx/base-files/etc/diag.sh
-@@ -61,6 +61,7 @@ get_status_led() {
- 		status_led="db120:green:status"
- 		;;
- 	dir-600-a1 |\
-+	dir-615-e1 |\
- 	dir-615-e4)
- 		status_led="d-link:green:power"
- 		;;
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/leds b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-index f1ac9ec..98568fa 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
-@@ -52,6 +52,7 @@ rb750)
- 	;;
- 
- dir-600-a1|\
-+dir-615-e1|\
- dir-615-e4)
- 	ucidef_set_led_netdev "wan" "WAN" "d-link:green:wan" "eth1"
- 	ucidef_set_led_switch "lan1" "LAN1" "d-link:green:lan1" "switch0" "0x02"
-diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/network b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-index e38a9b8..a2ac224 100755
---- a/target/linux/ar71xx/base-files/etc/uci-defaults/network
-+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/network
-@@ -182,6 +182,7 @@ ap96 |\
- airrouter |\
- dir-600-a1 |\
- dir-615-c1 |\
-+dir-615-e1 |\
- dir-615-e4 |\
- ja76pf |\
- rb-750 |\
-diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-index 11aa31b..9273012 100755
---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
-+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
-@@ -201,6 +201,9 @@ ar71xx_board_detect() {
- 	*"DIR-600 rev. A1")
- 		name="dir-600-a1"
- 		;;
-+	*"DIR-615 rev. E1")
-+		name="dir-615-e1"
-+		;;
- 	*"DIR-615 rev. E4")
- 		name="dir-615-e4"
- 		;;
-diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-index b25df6c..5fdd564 100755
---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
-@@ -104,6 +104,7 @@ platform_check_image() {
- 	ap83 | \
- 	dir-600-a1 | \
- 	dir-615-c1 | \
-+	dir-615-e1 | \
- 	dir-615-e4 | \
- 	ew-dorin | \
- 	ew-dorin-router | \
-diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-600-a1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-600-a1.c
-index c0fa900..321fdce 100644
---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-600-a1.c
-+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-600-a1.c
-@@ -141,6 +141,14 @@ static void __init dir_600_a1_setup(void)
- MIPS_MACHINE(ATH79_MACH_DIR_600_A1, "DIR-600-A1", "D-Link DIR-600 rev. A1",
- 	     dir_600_a1_setup);
- 
-+static void __init dir_615_e1_setup(void)
-+{
-+	dir_600_a1_setup();
-+}
-+
-+MIPS_MACHINE(ATH79_MACH_DIR_615_E1, "DIR-615-E1", "D-Link DIR-615 rev. E1",
-+	     dir_615_e1_setup);
-+
- static void __init dir_615_e4_setup(void)
- {
- 	dir_600_a1_setup();
-diff --git a/target/linux/ar71xx/generic/profiles/d-link.mk b/target/linux/ar71xx/generic/profiles/d-link.mk
-index 98fe00f..9a8ab1b 100644
---- a/target/linux/ar71xx/generic/profiles/d-link.mk
-+++ b/target/linux/ar71xx/generic/profiles/d-link.mk
-@@ -38,6 +38,16 @@ endef
- 
- $(eval $(call Profile,DIR615C1))
- 
-+define Profile/DIR615E1
-+	NAME:=D-Link DIR-615 rev. E1
-+	PACKAGES:=
-+endef
-+
-+define Profile/DIR615E1/Description
-+	Package set optimized for the D-Link DIR-615 rev. E1.
-+endef
-+
-+$(eval $(call Profile,DIR615E1))
- 
- define Profile/DIR615E4
- 	NAME:=D-Link DIR-615 rev. E4
-diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
-index a055521..11ba068 100644
---- a/target/linux/ar71xx/image/Makefile
-+++ b/target/linux/ar71xx/image/Makefile
-@@ -804,6 +804,7 @@ $(eval $(call SingleProfile,AthLzma,$(fs_64k),PB92,pb92,PB92,ttyS0,115200,$$(pb9
- 
- $(eval $(call SingleProfile,Cameo7240,$(fs_64k),DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
- $(eval $(call SingleProfile,Cameo7240,$(fs_64k),DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
-+$(eval $(call SingleProfile,Cameo7240,$(fs_64k),DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
- $(eval $(call SingleProfile,Cameo7240,$(fs_64k),DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
- $(eval $(call SingleProfile,Cameo7240,$(fs_64k),FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
- 
-diff --git a/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
-index 6d67f5f..c7d0220 100644
---- a/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
-+++ b/target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
-@@ -1,6 +1,6 @@
- --- a/arch/mips/ath79/machtypes.h
- +++ b/arch/mips/ath79/machtypes.h
--@@ -16,18 +16,104 @@
-+@@ -16,18 +16,105 @@
-  
-  enum ath79_mach_type {
-  	ATH79_MACH_GENERIC = 0,
-@@ -21,6 +21,7 @@
-  	ATH79_MACH_PB44,		/* Atheros PB44 reference board */
- +	ATH79_MACH_DIR_600_A1,		/* D-Link DIR-600 rev. A1 */
- +	ATH79_MACH_DIR_615_C1,		/* D-Link DIR-615 rev. C1 */
-++	ATH79_MACH_DIR_615_E1,		/* D-Link DIR-615 rev. E1 */
- +	ATH79_MACH_DIR_615_E4,		/* D-Link DIR-615 rev. E4 */
- +	ATH79_MACH_DIR_825_B1,		/* D-Link DIR-825 rev. B1 */
- +	ATH79_MACH_EW_DORIN,		/* embedded wireless Dorin Platform */
-@@ -306,7 +307,7 @@
- +	select MYLOADER
- +
- +config ATH79_MACH_DIR_600_A1
--+	bool "D-Link DIR-600 A1/DIR-615 E4 support"
-++	bool "D-Link DIR-600 A1/DIR-615 E1/DIR-615 E4 support"
- +	select SOC_AR724X
- +	select ATH79_DEV_AP9X_PCI if PCI
- +	select ATH79_DEV_ETH

+ 0 - 19
patches/openwrt/0029-iptables-avoid-file-conflicts-due-to-unneeded-libip6t_-.so-in-ip6tables-package.patch

@@ -1,19 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 5 Jul 2014 22:30:34 +0200
-Subject: iptables: avoid file conflicts due to unneeded libip6t_*.so in ip6tables package
-
-diff --git a/package/iptables/Makefile b/package/iptables/Makefile
-index e36a093..0c7a380 100644
---- a/package/iptables/Makefile
-+++ b/package/iptables/Makefile
-@@ -406,10 +406,6 @@ define Package/ip6tables/install
- 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ip6tables $(1)/usr/sbin/
- 	$(LN) ip6tables $(1)/usr/sbin/ip6tables-save
- 	$(LN) ip6tables $(1)/usr/sbin/ip6tables-restore
--	$(INSTALL_DIR) $(1)/usr/lib/iptables
--	(cd $(PKG_INSTALL_DIR)/usr/lib/iptables ; \
--		$(CP) libip6t_*.so $(1)/usr/lib/iptables/ \
--	)
- endef
- 
- define Package/libiptc/install

+ 0 - 73
patches/openwrt/0030-mac80211-add-another-ath9k-patch.patch

@@ -1,73 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Thu, 24 Jul 2014 03:00:23 +0200
-Subject: mac80211: add another ath9k patch
-
-diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch
-index ba05bde..6197e0e 100644
---- a/package/mac80211/patches/300-pending_work.patch
-+++ b/package/mac80211/patches/300-pending_work.patch
-@@ -1,3 +1,21 @@
-+commit ff354dbdd743e5fe186df8cd17982db19f78231a
-+Author: Felix Fietkau <nbd@openwrt.org>
-+Date:   Wed Jul 23 15:33:26 2014 +0200
-+
-+    ath9k: fix aggregation session lockup
-+    
-+    If an aggregation session fails, frames still end up in the driver queue
-+    with IEEE80211_TX_CTL_AMPDU set.
-+    This causes tx for the affected station/tid to stall, since
-+    ath_tx_get_tid_subframe returning packets to send.
-+    
-+    Fix this by clearing IEEE80211_TX_CTL_AMPDU as long as no aggregation
-+    session is running.
-+    
-+    Cc: stable@vger.kernel.org
-+    Reported-by: Antonio Quartulli <antonio@open-mesh.com>
-+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-+
- commit 38695a6e5a940e6a524523b88a33916b016fb2a1
- Author: Felix Fietkau <nbd@openwrt.org>
- Date:   Fri Jul 11 12:06:18 2014 +0200
-@@ -2990,7 +3008,23 @@ Date:   Mon May 19 21:20:49 2014 +0200
-  	if (WARN_ON(--txq->pending_frames < 0))
-  		txq->pending_frames = 0;
-  
--@@ -1999,6 +1997,7 @@ static void setup_frame_info(struct ieee
-+@@ -887,6 +885,15 @@ ath_tx_get_tid_subframe(struct ath_softc
-+ 
-+ 		tx_info = IEEE80211_SKB_CB(skb);
-+ 		tx_info->flags &= ~IEEE80211_TX_CTL_CLEAR_PS_FILT;
-++
-++		/*
-++		 * No aggregation session is running, but there may be frames
-++		 * from a previous session or a failed attempt in the queue.
-++		 * Send them out as normal data frames
-++		 */
-++		if (!tid->active)
-++			tx_info->flags &= ~IEEE80211_TX_CTL_AMPDU;
-++
-+ 		if (!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) {
-+ 			bf->bf_state.bf_type = 0;
-+ 			return bf;
-+@@ -1999,6 +2006,7 @@ static void setup_frame_info(struct ieee
-  		an = (struct ath_node *) sta->drv_priv;
-  
-  	memset(fi, 0, sizeof(*fi));
-@@ -2998,7 +3032,7 @@ Date:   Mon May 19 21:20:49 2014 +0200
-  	if (hw_key)
-  		fi->keyix = hw_key->hw_key_idx;
-  	else if (an && ieee80211_is_data(hdr->frame_control) && an->ps_key > 0)
--@@ -2150,6 +2149,7 @@ int ath_tx_start(struct ieee80211_hw *hw
-+@@ -2150,6 +2158,7 @@ int ath_tx_start(struct ieee80211_hw *hw
-  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-  	struct ieee80211_sta *sta = txctl->sta;
-  	struct ieee80211_vif *vif = info->control.vif;
-@@ -3006,7 +3040,7 @@ Date:   Mon May 19 21:20:49 2014 +0200
-  	struct ath_softc *sc = hw->priv;
-  	struct ath_txq *txq = txctl->txq;
-  	struct ath_atx_tid *tid = NULL;
--@@ -2170,11 +2170,13 @@ int ath_tx_start(struct ieee80211_hw *hw
-+@@ -2170,11 +2179,13 @@ int ath_tx_start(struct ieee80211_hw *hw
-  	q = skb_get_queue_mapping(skb);
-  
-  	ath_txq_lock(sc, txq);

+ 0 - 30
patches/openwrt/0031-Reduce-fw3-log-spam-in-netifd-scripts.patch

@@ -1,30 +0,0 @@
-From: Matthias Schiffer <mschiffer@universe-factory.net>
-Date: Sat, 26 Jul 2014 17:03:40 +0200
-Subject: Reduce fw3 log spam in netifd scripts
-
-diff --git a/package/netifd/files/lib/netifd/dhcp.script b/package/netifd/files/lib/netifd/dhcp.script
-index db3fc01..a7ce0d8 100755
---- a/package/netifd/files/lib/netifd/dhcp.script
-+++ b/package/netifd/files/lib/netifd/dhcp.script
-@@ -50,7 +50,7 @@ setup_interface () {
- 		ip6rd="${ip6rd#* }"
- 		local ip6rdbr="${ip6rd%% *}"
- 
--		[ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE)
-+		[ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE 2>/dev/null)
- 		[ -z "$IFACE6RD" -o "$IFACE6RD" = 1 ] && IFACE6RD=${INTERFACE}_6rd
- 
- 		json_init
-diff --git a/package/odhcp6c/files/dhcpv6.script b/package/odhcp6c/files/dhcpv6.script
-index 8c1ba18..146a966 100755
---- a/package/odhcp6c/files/dhcpv6.script
-+++ b/package/odhcp6c/files/dhcpv6.script
-@@ -97,7 +97,7 @@ setup_interface () {
- 		MAPRULE="$LW4O6"
- 	fi
- 
--	[ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE)
-+	[ -n "$ZONE" ] || ZONE=$(fw3 network $INTERFACE 2>/dev/null)
- 
- 	if [ "$IFACE_MAP" != 0 -a -n "$MAPTYPE" -a -n "$MAPRULE" ]; then
- 		[ -z "$IFACE_MAP" -o "$IFACE_MAP" = 1 ] && IFACE_MAP=${INTERFACE}_map

File diff suppressed because it is too large
+ 242 - 124
targets/ar71xx-generic/kernel-config


+ 1 - 1
targets/ar71xx-generic/kernel-vermagic

@@ -1 +1 @@
-d6597ebf6203328d3519ea3c3371a493
+f2469bbdb9dd44754c52e799dc02ee7f

+ 2 - 2
targets/ar71xx-generic/profiles.mk

@@ -82,8 +82,8 @@ $(eval $(call GluonModel,UBNT,ubnt-unifi-outdoor-squashfs,ubiquiti-unifiap-outdo
 ## D-Link
 
 # D-Link DIR-615 rev. E1
-$(eval $(call GluonProfile,DIR615E1))
-$(eval $(call GluonModel,DIR615E1,dir-615-e1-squashfs,d-link-dir-615-rev-e1))
+#$(eval $(call GluonProfile,DIR615E1))
+#$(eval $(call GluonModel,DIR615E1,dir-615-e1-squashfs,d-link-dir-615-rev-e1))
 
 # D-Link DIR-825 rev. B1
 $(eval $(call GluonProfile,DIR825B1))

+ 1 - 1
targets/targets.mk

@@ -1,5 +1,5 @@
 $(eval $(call GluonTarget,ar71xx,generic))
 
-ifeq ($(BROKEN),1)
+ifneq ($(BROKEN),)
 $(eval $(call GluonTarget,x86,generic))
 endif

File diff suppressed because it is too large
+ 213 - 133
targets/x86-generic/kernel-config


+ 1 - 1
targets/x86-generic/kernel-vermagic

@@ -1 +1 @@
-fa7af62e0ef1d529ecb7f7efccc706c3
+142143844bfcd7ade9ea7e57dd843e69

Some files were not shown because too many files changed in this diff