From lede-commits at lists.infradead.org  Sun Oct  1 01:11:00 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 01 Oct 2017 04:11:00 -0400
Subject: [source]  sunxi: clean up modules definitions
In-Reply-To: <20171001081100.16659.75354@git-01.infra.lede-project.org>
References: <20171001081100.16659.75354@git-01.infra.lede-project.org>
Message-ID: <mailman.52218.1506845623.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/3350137bd3db25a24ebba62835333a456cc448b2

commit 3350137bd3db25a24ebba62835333a456cc448b2
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Thu May 4 07:00:06 2017 +0200

    sunxi: clean up modules definitions
    
    Module definitions for kmod-wdt-sunxi and kmod-eeprom-sunxi are removed
    (wdt-sunxi was builtin anyways; nvmem-sunxi, which is the new name of
    eeprom-sunxi is changed to builtin). As kmod-eeprom-sunxi was specified
    in DEFAULT_PACKAGES, but not available on kernel 4.4, it was breaking the
    image builder.
    
    Support for kmod-sunxi-ir is added for kernel 4.4 (it is unclear why it
    was disable before, it builds fine with with kernel 4.4).
    
    Condtionals only relevant for pre-4.4 kernels are removed from modules.mk,
    as sunxi does't support older kernels anymore.
    
    Fixes FS#755.
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 target/linux/sunxi/Makefile   |  2 +-
 target/linux/sunxi/config-4.4 |  2 +-
 target/linux/sunxi/modules.mk | 46 +++----------------------------------------
 3 files changed, 5 insertions(+), 45 deletions(-)

diff --git a/target/linux/sunxi/Makefile b/target/linux/sunxi/Makefile
index b0bc1ba..3c2f14b 100644
--- a/target/linux/sunxi/Makefile
+++ b/target/linux/sunxi/Makefile
@@ -27,7 +27,7 @@ KERNELNAME:=zImage dtbs
 
 include $(INCLUDE_DIR)/target.mk
 
-DEFAULT_PACKAGES += uboot-envtools kmod-eeprom-sunxi kmod-wdt-sunxi
+DEFAULT_PACKAGES += uboot-envtools
 DEFAULT_PACKAGES += mkf2fs e2fsprogs
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/sunxi/config-4.4 b/target/linux/sunxi/config-4.4
index 2253afa..a978e9d 100644
--- a/target/linux/sunxi/config-4.4
+++ b/target/linux/sunxi/config-4.4
@@ -356,7 +356,7 @@ CONFIG_NO_HZ_COMMON=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=8
 CONFIG_NVMEM=y
-# CONFIG_NVMEM_SUNXI_SID is not set
+CONFIG_NVMEM_SUNXI_SID=y
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_EARLY_FLATTREE=y
diff --git a/target/linux/sunxi/modules.mk b/target/linux/sunxi/modules.mk
index 6f49917..99b82a3 100644
--- a/target/linux/sunxi/modules.mk
+++ b/target/linux/sunxi/modules.mk
@@ -25,7 +25,7 @@ $(eval $(call KernelPackage,rtc-sunxi))
 define KernelPackage/sunxi-ir
     SUBMENU:=$(OTHER_MENU)
     TITLE:=Sunxi SoC built-in IR support (A20)
-    DEPENDS:=@TARGET_sunxi @!LINUX_4_4 +kmod-input-core 
+    DEPENDS:=@TARGET_sunxi +kmod-input-core
     $(call AddDepends/rtc)
     KCONFIG:= \
 	CONFIG_MEDIA_SUPPORT=y \
@@ -42,22 +42,6 @@ endef
 
 $(eval $(call KernelPackage,sunxi-ir))
 
-define KernelPackage/eeprom-sunxi
-    SUBMENU:=$(OTHER_MENU)
-    TITLE:=AllWinner Security ID fuse support
-    DEPENDS:=@TARGET_sunxi @!LINUX_4_4
-    KCONFIG:= \
-	CONFIG_EEPROM_SUNXI_SID
-    FILES:=$(LINUX_DIR)/drivers/misc/eeprom/sunxi_sid.ko
-    AUTOLOAD:=$(call AutoLoad,50,sunxi_sid)
-endef
-
-define KernelPackage/eeprom-sunxi/description
- Support for the AllWinner Security ID fuse support
-endef
-
-$(eval $(call KernelPackage,eeprom-sunxi))
-
 define KernelPackage/ata-sunxi
     TITLE:=AllWinner sunXi AHCI SATA support
     SUBMENU:=$(BLOCK_MENU)
@@ -76,7 +60,7 @@ $(eval $(call KernelPackage,ata-sunxi))
 define KernelPackage/sun4i-emac
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=AllWinner EMAC Ethernet support
-  DEPENDS:=@TARGET_sunxi +LINUX_4_4:kmod-of-mdio +LINUX_4_4:kmod-libphy
+  DEPENDS:=@TARGET_sunxi +kmod-of-mdio +kmod-libphy
   KCONFIG:=CONFIG_SUN4I_EMAC
   FILES:=$(LINUX_DIR)/drivers/net/ethernet/allwinner/sun4i-emac.ko
   AUTOLOAD:=$(call AutoProbe,sun4i-emac)
@@ -85,35 +69,11 @@ endef
 $(eval $(call KernelPackage,sun4i-emac))
 
 
-define KernelPackage/wdt-sunxi
-    SUBMENU:=$(OTHER_MENU)
-    TITLE:=AllWinner sunXi Watchdog timer
-    DEPENDS:=@TARGET_sunxi
-    KCONFIG:=CONFIG_SUNXI_WATCHDOG
-    FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/sunxi_wdt.ko
-    AUTOLOAD:=$(call AutoLoad,51,sunxi_wdt)
-endef
-
-define KernelPackage/wdt-sunxi/description
-    Kernel module for AllWinner sunXi watchdog timer.
-endef
-
-$(eval $(call KernelPackage,wdt-sunxi))
-
-
 define KernelPackage/sound-soc-sunxi
   TITLE:=AllWinner built-in SoC sound support
-  KCONFIG:= \
-	CONFIG_SND_SUNXI_SOC_CODEC \
-	CONFIG_SND_SUN4I_CODEC
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),lt,4.4.0)),1)
-  FILES+=$(LINUX_DIR)/sound/soc/sunxi/sunxi-codec.ko
-  AUTOLOAD:=$(call AutoLoad,65,sunxi-codec)
-endif
-ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,4.4.0)),1)
+  KCONFIG:=CONFIG_SND_SUN4I_CODEC
   FILES:=$(LINUX_DIR)/sound/soc/sunxi/sun4i-codec.ko
   AUTOLOAD:=$(call AutoLoad,65,sun4i-codec)
-endif
   DEPENDS:=@TARGET_sunxi +kmod-sound-soc-core
   $(call AddDepends/sound)
 endef


From lede-commits at lists.infradead.org  Sun Oct  1 01:53:02 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 01 Oct 2017 04:53:02 -0400
Subject: [source]  base-files: create /etc/config/ directory
In-Reply-To: <20171001085302.24396.47928@git-01.infra.lede-project.org>
References: <20171001085302.24396.47928@git-01.infra.lede-project.org>
Message-ID: <mailman.52219.1506848011.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/b8357e87d7cbc73e19073b4b8cd749e46e6b7fc2

commit b8357e87d7cbc73e19073b4b8cd749e46e6b7fc2
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Sep 30 13:50:44 2017 +0200

    base-files: create /etc/config/ directory
    
    The /bin/config_generate script and some other scripts are assuming the
    /etc/config directory exists in the image. This is true in case for
    example the package firewall, dropbear or dnsmasq are included, which
    are adding the files under /etc/config/. Without any of these package
    the system will not boot up fully because the /etc/config/ directory is
    missing and some init scripts just fail.
    
    Make sure all images with the base-files contain a /etc/config/
    directory.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Acked-by: John Crispin <john at phrozen.org>
---
 package/base-files/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 18ebe60..fdeda95 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -138,6 +138,7 @@ define Package/base-files/install
 
 	mkdir -p $(1)/CONTROL
 	mkdir -p $(1)/dev
+	mkdir -p $(1)/etc/config
 	mkdir -p $(1)/etc/crontabs
 	mkdir -p $(1)/etc/rc.d
 	mkdir -p $(1)/overlay


From lede-commits at lists.infradead.org  Sun Oct  1 07:44:09 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 01 Oct 2017 10:44:09 -0400
Subject: [source]  mac80211: fix compile error on PowerPC (PPC_85xx)
In-Reply-To: <20171001144407.1765.27953@git-01.infra.lede-project.org>
References: <20171001144407.1765.27953@git-01.infra.lede-project.org>
Message-ID: <mailman.52238.1506869198.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/ba1aedafebcb5cb577c69d412ee3d4de262ccc32

commit ba1aedafebcb5cb577c69d412ee3d4de262ccc32
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 1 16:16:32 2017 +0200

    mac80211: fix compile error on PowerPC (PPC_85xx)
    
    Including linux/interrupt.h in linux/hrtimer.h causes this error message
    on PowerPC builds on x86, ARM and MIPS it works:
    
      CC [M]  /backports-4.14-rc2-1/compat/main.o
    In file included from /backports-4.14-rc2-1/backport-include/linux/printk.h:5:0,
                     from ./include/linux/kernel.h:13,
                     from /backports-4.14-rc2-1/backport-include/linux/kernel.h:3,
                     from ./include/linux/list.h:8,
                     from /backports-4.14-rc2-1/backport-include/linux/list.h:3,
                     from ./include/linux/module.h:9,
                     from /backports-4.14-rc2-1/backport-include/linux/module.h:3,
                     from /backports-4.14-rc2-1/compat/main.c:1:
    ./include/linux/ratelimit.h: In function 'ratelimit_state_exit':
    ./include/linux/ratelimit.h:62:11: error: dereferencing pointer to incomplete type 'struct task_struct'
        current->comm, rs->missed);
               ^
    ./include/linux/printk.h:279:37: note: in definition of macro 'pr_warning'
      printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                                         ^
    ./include/linux/ratelimit.h:61:3: note: in expansion of macro 'pr_warn'
       pr_warn("%s: %d output lines suppressed due to ratelimiting\n",
       ^
    
    The backport of the hrtimer_start() functions needs the
    linux/interrupt.h because some parts are defined there. Fix this by
    moving the hrtimer_start() backport to the linux/interrupt.h backport
    header file.
    
    Fixes: a8f63a0717f5: ("mac80211: update to backports-4.14-rc2")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 ...der-fix-compile-error-on-PowerPC-PPC_85xx.patch | 81 ++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/package/kernel/mac80211/patches/006-header-fix-compile-error-on-PowerPC-PPC_85xx.patch b/package/kernel/mac80211/patches/006-header-fix-compile-error-on-PowerPC-PPC_85xx.patch
new file mode 100644
index 0000000..fa35c4b
--- /dev/null
+++ b/package/kernel/mac80211/patches/006-header-fix-compile-error-on-PowerPC-PPC_85xx.patch
@@ -0,0 +1,81 @@
+From f192535ab136905d87bc75a4e848b66f0aef315e Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Sun, 1 Oct 2017 16:05:24 +0200
+Subject: header: fix compile error on PowerPC (PPC_85xx)
+
+Including linux/interrupt.h in linux/hrtimer.h causes this error message
+on PowerPC builds on x86, ARM and MIPS it works:
+
+  CC [M]  /backports-4.14-rc2-1/compat/main.o
+In file included from /backports-4.14-rc2-1/backport-include/linux/printk.h:5:0,
+                 from ./include/linux/kernel.h:13,
+                 from /backports-4.14-rc2-1/backport-include/linux/kernel.h:3,
+                 from ./include/linux/list.h:8,
+                 from /backports-4.14-rc2-1/backport-include/linux/list.h:3,
+                 from ./include/linux/module.h:9,
+                 from /backports-4.14-rc2-1/backport-include/linux/module.h:3,
+                 from /backports-4.14-rc2-1/compat/main.c:1:
+./include/linux/ratelimit.h: In function 'ratelimit_state_exit':
+./include/linux/ratelimit.h:62:11: error: dereferencing pointer to incomplete type 'struct task_struct'
+    current->comm, rs->missed);
+           ^
+./include/linux/printk.h:279:37: note: in definition of macro 'pr_warning'
+  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+                                     ^
+./include/linux/ratelimit.h:61:3: note: in expansion of macro 'pr_warn'
+   pr_warn("%s: %d output lines suppressed due to ratelimiting\n",
+   ^
+
+The backport of the hrtimer_start() functions needs the
+linux/interrupt.h because some parts are defined there. Fix this by
+moving the hrtimer_start() backport to the linux/interrupt.h backport
+header file.
+
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+---
+ backport-include/linux/hrtimer.h   | 17 -----------------
+ backport-include/linux/interrupt.h | 17 ++++++++++++++++-
+ 2 files changed, 16 insertions(+), 18 deletions(-)
+ delete mode 100644 backport-include/linux/hrtimer.h
+
+--- a/backport-include/linux/hrtimer.h
++++ /dev/null
+@@ -1,17 +0,0 @@
+-#ifndef _BP_HRTIMER_H
+-#define _BP_HRTIMER_H
+-#include <linux/version.h>
+-#include_next <linux/hrtimer.h>
+-#include <linux/interrupt.h>
+-
+-#if LINUX_VERSION_IS_LESS(4,10,0)
+-static inline void backport_hrtimer_start(struct hrtimer *timer, s64 time,
+-					  const enum hrtimer_mode mode)
+-{
+-	ktime_t _time = { .tv64 = time };
+-	hrtimer_start(timer, _time, mode);
+-}
+-#define hrtimer_start LINUX_BACKPORT(hrtimer_start)
+-#endif
+-
+-#endif /* _BP_HRTIMER_H */
+--- a/backport-include/linux/interrupt.h
++++ b/backport-include/linux/interrupt.h
+@@ -1,2 +1,17 @@
+-#include <linux/hrtimer.h>
++#ifndef _BP_LINUX_INTERRUPT_H
++#define _BP_LINUX_INTERRUPT_H
++#include <linux/version.h>
+ #include_next <linux/interrupt.h>
++#include <linux/ktime.h>
++
++#if LINUX_VERSION_IS_LESS(4,10,0)
++static inline void backport_hrtimer_start(struct hrtimer *timer, s64 time,
++					  const enum hrtimer_mode mode)
++{
++	ktime_t _time = { .tv64 = time };
++	hrtimer_start(timer, _time, mode);
++}
++#define hrtimer_start LINUX_BACKPORT(hrtimer_start)
++#endif
++
++#endif /* _BP_LINUX_INTERRUPT_H */


From lede-commits at lists.infradead.org  Sun Oct  1 07:44:08 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 01 Oct 2017 10:44:08 -0400
Subject: [source]  kernel: owl-loader: fix compile warning
In-Reply-To: <20171001144407.1765.27953@git-01.infra.lede-project.org>
References: <20171001144407.1765.27953@git-01.infra.lede-project.org>
Message-ID: <mailman.52239.1506869198.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/dbbb4df1631cf2f2e69e640d528ed78f4bdb62ea

commit dbbb4df1631cf2f2e69e640d528ed78f4bdb62ea
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 1 16:11:58 2017 +0200

    kernel: owl-loader: fix compile warning
    
    check if the config option CONFIG_LANTIQ is defined.
    This fixes the following warning:
      CC [M]  drivers/misc/owl-loader.o
    drivers/misc/owl-loader.c: In function 'ath9k_pci_fixup':
    drivers/misc/owl-loader.c:92:5: warning: "CONFIG_LANTIQ" is not defined [-Wundef]
     #if CONFIG_LANTIQ
         ^
    
    Fixes: e9401a2335cc ("kernel: owl-loader for delayed Atheros ath9k fixup")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/files/drivers/misc/owl-loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/misc/owl-loader.c b/target/linux/generic/files/drivers/misc/owl-loader.c
index 30340da..f11cb2b 100644
--- a/target/linux/generic/files/drivers/misc/owl-loader.c
+++ b/target/linux/generic/files/drivers/misc/owl-loader.c
@@ -89,7 +89,7 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
 			val = swahb32(val);
 		}
 
-#if CONFIG_LANTIQ
+#ifdef CONFIG_LANTIQ
 		val = swab32(val);
 #endif
 


From lede-commits at lists.infradead.org  Mon Oct  2 05:01:02 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 02 Oct 2017 08:01:02 -0400
Subject: [source]  tools: cmake: fix librt linking (FS#1032)
In-Reply-To: <20171002120102.6176.20895@git-01.infra.lede-project.org>
References: <20171002120102.6176.20895@git-01.infra.lede-project.org>
Message-ID: <mailman.52316.1506945688.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/64da598c8f8bc3002ae2e8f90f0cf20986493348

commit 64da598c8f8bc3002ae2e8f90f0cf20986493348
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Oct 2 13:56:50 2017 +0200

    tools: cmake: fix librt linking (FS#1032)
    
    Commit 839129b864 "tools/cmake: Update to 3.9.3" improperly rebased the
    librt linking patch, causing FS#381 to resurface.
    
    Fixes FS#1032.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 tools/cmake/patches/130-curl-fix-libressl-linking.patch | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/cmake/patches/130-curl-fix-libressl-linking.patch b/tools/cmake/patches/130-curl-fix-libressl-linking.patch
index 1a15ff4..b5ee61b 100644
--- a/tools/cmake/patches/130-curl-fix-libressl-linking.patch
+++ b/tools/cmake/patches/130-curl-fix-libressl-linking.patch
@@ -20,14 +20,14 @@ Signed-off-by: Jo-Philipp Wich <jo at mein.io>
 ---
 --- a/Utilities/cmcurl/CMakeLists.txt
 +++ b/Utilities/cmcurl/CMakeLists.txt
-@@ -471,6 +471,10 @@ if(CMAKE_USE_OPENSSL)
-   check_symbol_exists(RAND_status "${CURL_INCLUDES}" HAVE_RAND_STATUS)
-   check_symbol_exists(RAND_screen "${CURL_INCLUDES}" HAVE_RAND_SCREEN)
-   check_symbol_exists(RAND_egd    "${CURL_INCLUDES}" HAVE_RAND_EGD)
+@@ -456,6 +456,10 @@ if(CMAKE_USE_OPENSSL)
+   set(USE_OPENSSL ON)
+   set(HAVE_LIBCRYPTO ON)
+   set(HAVE_LIBSSL ON)
 +  check_library_exists("rt" clock_gettime "" HAVE_LIBRT)
 +  if(HAVE_LIBRT)
 +    list(APPEND OPENSSL_LIBRARIES rt)
 +  endif()
- 
-   # Optionally build with a specific CA cert bundle.
-   if(CURL_CA_BUNDLE)
+   list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES})
+   include_directories(${OPENSSL_INCLUDE_DIR})
+   set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})


From lede-commits at lists.infradead.org  Mon Oct  2 09:27:51 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 02 Oct 2017 12:27:51 -0400
Subject: [source]  dnsmasq: bump to v2.78
In-Reply-To: <20171002162751.8458.36195@git-01.infra.lede-project.org>
References: <20171002162751.8458.36195@git-01.infra.lede-project.org>
Message-ID: <mailman.52364.1506961706.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/67ac017fefe8552b4e864d0494e892efe4fb9710

commit 67ac017fefe8552b4e864d0494e892efe4fb9710
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Mon Oct 2 15:17:07 2017 +0100

    dnsmasq: bump to v2.78
    
    Fixes CVE-2017-14491, CVE-2017-14492, CVE-2017-14493, CVE-2017-14494, 2017-CVE-14495, 2017-CVE-14496
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |  6 +-
 ...10-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch | 25 ------
 ...ove-ping-check-of-configured-DHCP-address.patch | 28 -------
 ...ervers-if-first-returns-REFUSED-when-stri.patch | 31 -------
 .../patches/025-backport-fix-CVE-2017-13704.patch  | 94 ----------------------
 .../patches/030-fix-arcount-edns0-behaviour.patch  | 44 ----------
 .../230-fix-poll-h-include-warning-on-musl.patch   |  2 +-
 .../services/dnsmasq/patches/240-ubus.patch        | 36 ++++-----
 8 files changed, 18 insertions(+), 248 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 1e1cc32..9a024ce 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_VERSION:=2.77
-PKG_RELEASE:=13
+PKG_VERSION:=2.78
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
-PKG_HASH:=6eac3b1c50ae25170e3ff8c96ddb55236cf45007633fdb8a35b1f3e02f5f8b8a
+PKG_HASH:=89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/network/services/dnsmasq/patches/010-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch b/package/network/services/dnsmasq/patches/010-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch
deleted file mode 100644
index 571ff36..0000000
--- a/package/network/services/dnsmasq/patches/010-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 4bb68866a8aeb31db8100492bceae051e33be5d0 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Thu, 15 Jun 2017 23:18:44 +0100
-Subject: [PATCH] Tweak ICMP ping check logic for DHCPv4.
-
----
- src/rfc2131.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/rfc2131.c b/src/rfc2131.c
-index 1c850e5..75792da 100644
---- a/src/rfc2131.c
-+++ b/src/rfc2131.c
-@@ -1040,7 +1040,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
- 		  else if (have_config(config, CONFIG_DECLINED) &&
- 			   difftime(now, config->decline_time) < (float)DECLINE_BACKOFF)
- 		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it was previously declined"), addrs);
--		  else if (!do_icmp_ping(now, config->addr, 0, loopback))
-+		  else if ((!lease || lease->addr.s_addr != config->addr.s_addr) && !do_icmp_ping(now, config->addr, 0, loopback))
- 		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it is in use by another host"), addrs);
- 		  else
- 		    conf = config->addr;
--- 
-1.9.1
-
diff --git a/package/network/services/dnsmasq/patches/011-Remove-ping-check-of-configured-DHCP-address.patch b/package/network/services/dnsmasq/patches/011-Remove-ping-check-of-configured-DHCP-address.patch
deleted file mode 100644
index 67f90e1..0000000
--- a/package/network/services/dnsmasq/patches/011-Remove-ping-check-of-configured-DHCP-address.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 1d224949cced9e82440d00b3dbaf32c262bac2ff Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Sat, 8 Jul 2017 20:52:55 +0100
-Subject: [PATCH 1/2] Remove ping-check of configured DHCP address.
-
-This was added in 5ce3e76fbf89e942e8c54ef3e3389facf0d9067a but
-it trips over too many buggy clients that leave an interface configured
-even in DHCPDISCOVER case.
----
- src/rfc2131.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/src/rfc2131.c b/src/rfc2131.c
-index 86230b4..785e15c 100644
---- a/src/rfc2131.c
-+++ b/src/rfc2131.c
-@@ -1040,8 +1040,6 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
- 		  else if (have_config(config, CONFIG_DECLINED) &&
- 			   difftime(now, config->decline_time) < (float)DECLINE_BACKOFF)
- 		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it was previously declined"), addrs);
--		  else if ((!lease || lease->addr.s_addr != config->addr.s_addr) && !do_icmp_ping(now, config->addr, 0, loopback))
--		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it is in use by another host"), addrs);
- 		  else
- 		    conf = config->addr;
- 		}
--- 
-2.13.2
-
diff --git a/package/network/services/dnsmasq/patches/020-Try-other-servers-if-first-returns-REFUSED-when-stri.patch b/package/network/services/dnsmasq/patches/020-Try-other-servers-if-first-returns-REFUSED-when-stri.patch
deleted file mode 100644
index cdab607..0000000
--- a/package/network/services/dnsmasq/patches/020-Try-other-servers-if-first-returns-REFUSED-when-stri.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 9396752c115b3ab733fa476b30da73237e12e7ba Mon Sep 17 00:00:00 2001
-From: Hans Dedecker <dedeckeh at gmail.com>
-Date: Tue, 27 Jun 2017 22:08:47 +0100
-Subject: [PATCH] Try other servers if first returns REFUSED when
- --strict-order active.
-
-If a DNS server replies REFUSED for a given DNS query in strict order mode
-no failover to the next DNS server is triggered as the failover logic only
-covers non strict mode.
-As a result the client will be returned the REFUSED reply without first
-falling back to the secondary DNS server(s).
-
-Make failover support work as well for strict mode config in case REFUSED is
-replied by deleting the strict order check and rely only on forwardall being
-equal to 0 which is the case in non strict mode when a single server has been
-contacted or when strict order mode has been configured.
----
- CHANGELOG     | 4 ++++
- src/forward.c | 1 -
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -790,7 +790,6 @@ void reply_query(int fd, int family, tim
-   /* Note: if we send extra options in the EDNS0 header, we can't recreate
-      the query from the reply. */
-   if (RCODE(header) == REFUSED &&
--      !option_bool(OPT_ORDER) &&
-       forward->forwardall == 0 &&
-       !(forward->flags & FREC_HAS_EXTRADATA))
-     /* for broken servers, attempt to send to another one. */
diff --git a/package/network/services/dnsmasq/patches/025-backport-fix-CVE-2017-13704.patch b/package/network/services/dnsmasq/patches/025-backport-fix-CVE-2017-13704.patch
deleted file mode 100644
index bba9a08..0000000
--- a/package/network/services/dnsmasq/patches/025-backport-fix-CVE-2017-13704.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 63437ffbb58837b214b4b92cb1c54bc5f3279928 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Wed, 6 Sep 2017 22:34:21 +0100
-Subject: [PATCH] Fix CVE-2017-13704, which resulted in a crash on a large DNS
- query.
-
-A DNS query recieved by UDP which exceeds 512 bytes (or the EDNS0 packet size,
-if different.) is enough to cause SIGSEGV.
----
- CHANGELOG     |    7 +++++++
- src/auth.c    |    5 -----
- src/forward.c |    8 ++++++++
- src/rfc1035.c |    5 -----
- 4 files changed, 15 insertions(+), 10 deletions(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index 3a640f3..7e65912 100644
---- a/CHANGELOG
-+++ b/CHANGELOG
-@@ -17,6 +17,13 @@ version 2.78
- 	--strict-order active. Thanks to Hans Dedecker
- 	for the patch
- 
-+	Fix regression in 2.77, ironically added as a security
-+	improvement, which resulted in a crash when a DNS
-+	query exceeded 512 bytes (or the EDNS0 packet size,
-+	if different.) Thanks to Christian Kujau, Arne Woerner
-+	Juan Manuel Fernandez and Kevin Darbyshire-Bryant for
-+	chasing this one down.  CVE-2017-13704 applies.
-+
- 	
- version 2.77
- 	Generate an error when configured with a CNAME loop,
-diff --git a/src/auth.c b/src/auth.c
-index 2c24e16..7f95f98 100644
---- a/src/auth.c
-+++ b/src/auth.c
-@@ -119,11 +119,6 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
-   struct cname *a, *candidate;
-   unsigned int wclen;
-   
--  /* Clear buffer beyond request to avoid risk of
--     information disclosure. */
--  memset(((char *)header) + qlen, 0, 
--	 (limit - ((char *)header)) - qlen);
--  
-   if (ntohs(header->qdcount) == 0 || OPCODE(header) != QUERY )
-     return 0;
- 
-diff --git a/src/forward.c b/src/forward.c
-index f22556a..e3fa94b 100644
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -1188,6 +1188,10 @@ void receive_query(struct listener *listen, time_t now)
-       (msg.msg_flags & MSG_TRUNC) ||
-       (header->hb3 & HB3_QR))
-     return;
-+
-+  /* Clear buffer beyond request to avoid risk of
-+     information disclosure. */
-+  memset(daemon->packet + n, 0, daemon->edns_pktsz - n);
-   
-   source_addr.sa.sa_family = listen->family;
-   
-@@ -1688,6 +1692,10 @@ unsigned char *tcp_request(int confd, time_t now,
-   
-       if (size < (int)sizeof(struct dns_header))
- 	continue;
-+
-+      /* Clear buffer beyond request to avoid risk of
-+	 information disclosure. */
-+      memset(payload + size, 0, 65536 - size);
-       
-       query_count++;
- 
-diff --git a/src/rfc1035.c b/src/rfc1035.c
-index 26f5301..af2fe46 100644
---- a/src/rfc1035.c
-+++ b/src/rfc1035.c
-@@ -1223,11 +1223,6 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-   struct mx_srv_record *rec;
-   size_t len;
- 
--  /* Clear buffer beyond request to avoid risk of
--     information disclosure. */
--  memset(((char *)header) + qlen, 0, 
--	 (limit - ((char *)header)) - qlen);
--  
-   if (ntohs(header->ancount) != 0 ||
-       ntohs(header->nscount) != 0 ||
-       ntohs(header->qdcount) == 0 || 
--- 
-1.7.10.4
-
diff --git a/package/network/services/dnsmasq/patches/030-fix-arcount-edns0-behaviour.patch b/package/network/services/dnsmasq/patches/030-fix-arcount-edns0-behaviour.patch
deleted file mode 100644
index fffc8de..0000000
--- a/package/network/services/dnsmasq/patches/030-fix-arcount-edns0-behaviour.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From a3303e196e5d304ec955c4d63afb923ade66c6e8 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Thu, 7 Sep 2017 20:45:00 +0100
-Subject: [PATCH] Don't return arcount=1 if EDNS0 RR won't fit in the packet.
-
-Omitting the EDNS0 RR but setting arcount gives a malformed packet.
-Also, don't accept UDP packet size less than 512 in recieved EDNS0.
----
- src/edns0.c   |    5 ++++-
- src/forward.c |    2 ++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/src/edns0.c b/src/edns0.c
-index 3fde17f..f5b798c 100644
---- a/src/edns0.c
-+++ b/src/edns0.c
-@@ -208,7 +208,10 @@ size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *l
- 	  free(buff);
- 	  p += rdlen;
- 	}
--      header->arcount = htons(ntohs(header->arcount) + 1);
-+      
-+      /* Only bump arcount if RR is going to fit */ 
-+      if (((ssize_t)optlen) <= (limit - (p + 4)))
-+	header->arcount = htons(ntohs(header->arcount) + 1);
-     }
-   
-   if (((ssize_t)optlen) > (limit - (p + 4)))
-diff --git a/src/forward.c b/src/forward.c
-index e3fa94b..942b02d 100644
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -1412,6 +1412,8 @@ void receive_query(struct listener *listen, time_t now)
- 	 defaults to 512 */
-       if (udp_size > daemon->edns_pktsz)
- 	udp_size = daemon->edns_pktsz;
-+      else if (udp_size < PACKETSZ)
-+	udp_size = PACKETSZ; /* Sanity check - can't reduce below default. RFC 6891 6.2.3 */
-     }
- 
- #ifdef HAVE_AUTH
--- 
-1.7.10.4
-
diff --git a/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch b/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch
index 19300f7..37b11ab 100644
--- a/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch
+++ b/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch
@@ -7,7 +7,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
 
 --- a/src/dnsmasq.h
 +++ b/src/dnsmasq.h
-@@ -82,7 +82,7 @@ typedef unsigned long long u64;
+@@ -88,7 +88,7 @@ typedef unsigned long long u64;
  #if defined(HAVE_SOLARIS_NETWORK)
  #  include <sys/sockio.h>
  #endif
diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch
index 41e2848..2d37b5d 100644
--- a/package/network/services/dnsmasq/patches/240-ubus.patch
+++ b/package/network/services/dnsmasq/patches/240-ubus.patch
@@ -1,16 +1,14 @@
-Index: dnsmasq-2.77/src/dnsmasq.c
-===================================================================
---- dnsmasq-2.77.orig/src/dnsmasq.c
-+++ dnsmasq-2.77/src/dnsmasq.c
-@@ -17,6 +17,8 @@
- /* Declare static char *compiler_opts  in config.h */
- #define DNSMASQ_COMPILE_OPTS
+--- a/src/dnsmasq.c
++++ b/src/dnsmasq.c
+@@ -19,6 +19,8 @@
  
-+#include <libubus.h>
-+
  #include "dnsmasq.h"
  
++#include <libubus.h>
++
  struct daemon *daemon;
+ 
+ static volatile pid_t pid = 0;
 @@ -32,6 +34,62 @@ static void fatal_event(struct event_des
  static int read_event(int fd, struct event_desc *evp, char **msg);
  static void poll_resolv(int force, int do_reload, time_t now);
@@ -91,10 +89,8 @@ Index: dnsmasq-2.77/src/dnsmasq.c
        check_dns_listeners(now);
  
  #ifdef HAVE_TFTP
-Index: dnsmasq-2.77/Makefile
-===================================================================
---- dnsmasq-2.77.orig/Makefile
-+++ dnsmasq-2.77/Makefile
+--- a/Makefile
++++ b/Makefile
 @@ -85,7 +85,7 @@ all : $(BUILDDIR)
  	@cd $(BUILDDIR) && $(MAKE) \
   top="$(top)" \
@@ -104,11 +100,9 @@ Index: dnsmasq-2.77/Makefile
   -f $(top)/Makefile dnsmasq 
  
  mostly_clean :
-Index: dnsmasq-2.77/src/dnsmasq.h
-===================================================================
---- dnsmasq-2.77.orig/src/dnsmasq.h
-+++ dnsmasq-2.77/src/dnsmasq.h
-@@ -1389,6 +1389,8 @@ void emit_dbus_signal(int action, struct
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -1397,6 +1397,8 @@ void emit_dbus_signal(int action, struct
  #  endif
  #endif
  
@@ -117,10 +111,8 @@ Index: dnsmasq-2.77/src/dnsmasq.h
  /* ipset.c */
  #ifdef HAVE_IPSET
  void ipset_init(void);
-Index: dnsmasq-2.77/src/rfc2131.c
-===================================================================
---- dnsmasq-2.77.orig/src/rfc2131.c
-+++ dnsmasq-2.77/src/rfc2131.c
+--- a/src/rfc2131.c
++++ b/src/rfc2131.c
 @@ -1621,6 +1621,10 @@ static void log_packet(char *type, void
  	      daemon->namebuff,
  	      string ? string : "",


From lede-commits at lists.infradead.org  Mon Oct  2 09:36:46 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 02 Oct 2017 12:36:46 -0400
Subject: [source]  dnsmasq: bump to v2.78
In-Reply-To: <20171002163646.10525.71826@git-01.infra.lede-project.org>
References: <20171002163646.10525.71826@git-01.infra.lede-project.org>
Message-ID: <mailman.52371.1506962238.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/4b4a4af814e1602f7ef12c5d07ff15c4fa2570ca

commit 4b4a4af814e1602f7ef12c5d07ff15c4fa2570ca
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Mon Oct 2 15:28:32 2017 +0100

    dnsmasq: bump to v2.78
    
    Fixes CVE-2017-14491, CVE-2017-14492, CVE-2017-14493, CVE-2017-14494, 2017-CVE-14495, 2017-CVE-14496
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile          |  6 +-
 ...10-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch | 25 ------
 ...ove-ping-check-of-configured-DHCP-address.patch | 28 -------
 ...ervers-if-first-returns-REFUSED-when-stri.patch | 31 -------
 .../patches/025-backport-fix-CVE-2017-13704.patch  | 94 ----------------------
 .../patches/030-fix-arcount-edns0-behaviour.patch  | 44 ----------
 .../230-fix-poll-h-include-warning-on-musl.patch   |  2 +-
 7 files changed, 4 insertions(+), 226 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index be7a2d1..94fd702 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_VERSION:=2.77
-PKG_RELEASE:=6
+PKG_VERSION:=2.78
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
-PKG_HASH:=6eac3b1c50ae25170e3ff8c96ddb55236cf45007633fdb8a35b1f3e02f5f8b8a
+PKG_HASH:=89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/network/services/dnsmasq/patches/010-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch b/package/network/services/dnsmasq/patches/010-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch
deleted file mode 100644
index 571ff36..0000000
--- a/package/network/services/dnsmasq/patches/010-Tweak-ICMP-ping-check-logic-for-DHCPv4.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 4bb68866a8aeb31db8100492bceae051e33be5d0 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Thu, 15 Jun 2017 23:18:44 +0100
-Subject: [PATCH] Tweak ICMP ping check logic for DHCPv4.
-
----
- src/rfc2131.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/rfc2131.c b/src/rfc2131.c
-index 1c850e5..75792da 100644
---- a/src/rfc2131.c
-+++ b/src/rfc2131.c
-@@ -1040,7 +1040,7 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
- 		  else if (have_config(config, CONFIG_DECLINED) &&
- 			   difftime(now, config->decline_time) < (float)DECLINE_BACKOFF)
- 		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it was previously declined"), addrs);
--		  else if (!do_icmp_ping(now, config->addr, 0, loopback))
-+		  else if ((!lease || lease->addr.s_addr != config->addr.s_addr) && !do_icmp_ping(now, config->addr, 0, loopback))
- 		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it is in use by another host"), addrs);
- 		  else
- 		    conf = config->addr;
--- 
-1.9.1
-
diff --git a/package/network/services/dnsmasq/patches/011-Remove-ping-check-of-configured-DHCP-address.patch b/package/network/services/dnsmasq/patches/011-Remove-ping-check-of-configured-DHCP-address.patch
deleted file mode 100644
index 67f90e1..0000000
--- a/package/network/services/dnsmasq/patches/011-Remove-ping-check-of-configured-DHCP-address.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 1d224949cced9e82440d00b3dbaf32c262bac2ff Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Sat, 8 Jul 2017 20:52:55 +0100
-Subject: [PATCH 1/2] Remove ping-check of configured DHCP address.
-
-This was added in 5ce3e76fbf89e942e8c54ef3e3389facf0d9067a but
-it trips over too many buggy clients that leave an interface configured
-even in DHCPDISCOVER case.
----
- src/rfc2131.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/src/rfc2131.c b/src/rfc2131.c
-index 86230b4..785e15c 100644
---- a/src/rfc2131.c
-+++ b/src/rfc2131.c
-@@ -1040,8 +1040,6 @@ size_t dhcp_reply(struct dhcp_context *context, char *iface_name, int int_index,
- 		  else if (have_config(config, CONFIG_DECLINED) &&
- 			   difftime(now, config->decline_time) < (float)DECLINE_BACKOFF)
- 		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it was previously declined"), addrs);
--		  else if ((!lease || lease->addr.s_addr != config->addr.s_addr) && !do_icmp_ping(now, config->addr, 0, loopback))
--		    my_syslog(MS_DHCP | LOG_WARNING, _("not using configured address %s because it is in use by another host"), addrs);
- 		  else
- 		    conf = config->addr;
- 		}
--- 
-2.13.2
-
diff --git a/package/network/services/dnsmasq/patches/020-Try-other-servers-if-first-returns-REFUSED-when-stri.patch b/package/network/services/dnsmasq/patches/020-Try-other-servers-if-first-returns-REFUSED-when-stri.patch
deleted file mode 100644
index cdab607..0000000
--- a/package/network/services/dnsmasq/patches/020-Try-other-servers-if-first-returns-REFUSED-when-stri.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 9396752c115b3ab733fa476b30da73237e12e7ba Mon Sep 17 00:00:00 2001
-From: Hans Dedecker <dedeckeh at gmail.com>
-Date: Tue, 27 Jun 2017 22:08:47 +0100
-Subject: [PATCH] Try other servers if first returns REFUSED when
- --strict-order active.
-
-If a DNS server replies REFUSED for a given DNS query in strict order mode
-no failover to the next DNS server is triggered as the failover logic only
-covers non strict mode.
-As a result the client will be returned the REFUSED reply without first
-falling back to the secondary DNS server(s).
-
-Make failover support work as well for strict mode config in case REFUSED is
-replied by deleting the strict order check and rely only on forwardall being
-equal to 0 which is the case in non strict mode when a single server has been
-contacted or when strict order mode has been configured.
----
- CHANGELOG     | 4 ++++
- src/forward.c | 1 -
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -790,7 +790,6 @@ void reply_query(int fd, int family, tim
-   /* Note: if we send extra options in the EDNS0 header, we can't recreate
-      the query from the reply. */
-   if (RCODE(header) == REFUSED &&
--      !option_bool(OPT_ORDER) &&
-       forward->forwardall == 0 &&
-       !(forward->flags & FREC_HAS_EXTRADATA))
-     /* for broken servers, attempt to send to another one. */
diff --git a/package/network/services/dnsmasq/patches/025-backport-fix-CVE-2017-13704.patch b/package/network/services/dnsmasq/patches/025-backport-fix-CVE-2017-13704.patch
deleted file mode 100644
index bba9a08..0000000
--- a/package/network/services/dnsmasq/patches/025-backport-fix-CVE-2017-13704.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 63437ffbb58837b214b4b92cb1c54bc5f3279928 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Wed, 6 Sep 2017 22:34:21 +0100
-Subject: [PATCH] Fix CVE-2017-13704, which resulted in a crash on a large DNS
- query.
-
-A DNS query recieved by UDP which exceeds 512 bytes (or the EDNS0 packet size,
-if different.) is enough to cause SIGSEGV.
----
- CHANGELOG     |    7 +++++++
- src/auth.c    |    5 -----
- src/forward.c |    8 ++++++++
- src/rfc1035.c |    5 -----
- 4 files changed, 15 insertions(+), 10 deletions(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index 3a640f3..7e65912 100644
---- a/CHANGELOG
-+++ b/CHANGELOG
-@@ -17,6 +17,13 @@ version 2.78
- 	--strict-order active. Thanks to Hans Dedecker
- 	for the patch
- 
-+	Fix regression in 2.77, ironically added as a security
-+	improvement, which resulted in a crash when a DNS
-+	query exceeded 512 bytes (or the EDNS0 packet size,
-+	if different.) Thanks to Christian Kujau, Arne Woerner
-+	Juan Manuel Fernandez and Kevin Darbyshire-Bryant for
-+	chasing this one down.  CVE-2017-13704 applies.
-+
- 	
- version 2.77
- 	Generate an error when configured with a CNAME loop,
-diff --git a/src/auth.c b/src/auth.c
-index 2c24e16..7f95f98 100644
---- a/src/auth.c
-+++ b/src/auth.c
-@@ -119,11 +119,6 @@ size_t answer_auth(struct dns_header *header, char *limit, size_t qlen, time_t n
-   struct cname *a, *candidate;
-   unsigned int wclen;
-   
--  /* Clear buffer beyond request to avoid risk of
--     information disclosure. */
--  memset(((char *)header) + qlen, 0, 
--	 (limit - ((char *)header)) - qlen);
--  
-   if (ntohs(header->qdcount) == 0 || OPCODE(header) != QUERY )
-     return 0;
- 
-diff --git a/src/forward.c b/src/forward.c
-index f22556a..e3fa94b 100644
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -1188,6 +1188,10 @@ void receive_query(struct listener *listen, time_t now)
-       (msg.msg_flags & MSG_TRUNC) ||
-       (header->hb3 & HB3_QR))
-     return;
-+
-+  /* Clear buffer beyond request to avoid risk of
-+     information disclosure. */
-+  memset(daemon->packet + n, 0, daemon->edns_pktsz - n);
-   
-   source_addr.sa.sa_family = listen->family;
-   
-@@ -1688,6 +1692,10 @@ unsigned char *tcp_request(int confd, time_t now,
-   
-       if (size < (int)sizeof(struct dns_header))
- 	continue;
-+
-+      /* Clear buffer beyond request to avoid risk of
-+	 information disclosure. */
-+      memset(payload + size, 0, 65536 - size);
-       
-       query_count++;
- 
-diff --git a/src/rfc1035.c b/src/rfc1035.c
-index 26f5301..af2fe46 100644
---- a/src/rfc1035.c
-+++ b/src/rfc1035.c
-@@ -1223,11 +1223,6 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-   struct mx_srv_record *rec;
-   size_t len;
- 
--  /* Clear buffer beyond request to avoid risk of
--     information disclosure. */
--  memset(((char *)header) + qlen, 0, 
--	 (limit - ((char *)header)) - qlen);
--  
-   if (ntohs(header->ancount) != 0 ||
-       ntohs(header->nscount) != 0 ||
-       ntohs(header->qdcount) == 0 || 
--- 
-1.7.10.4
-
diff --git a/package/network/services/dnsmasq/patches/030-fix-arcount-edns0-behaviour.patch b/package/network/services/dnsmasq/patches/030-fix-arcount-edns0-behaviour.patch
deleted file mode 100644
index fffc8de..0000000
--- a/package/network/services/dnsmasq/patches/030-fix-arcount-edns0-behaviour.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From a3303e196e5d304ec955c4d63afb923ade66c6e8 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon at thekelleys.org.uk>
-Date: Thu, 7 Sep 2017 20:45:00 +0100
-Subject: [PATCH] Don't return arcount=1 if EDNS0 RR won't fit in the packet.
-
-Omitting the EDNS0 RR but setting arcount gives a malformed packet.
-Also, don't accept UDP packet size less than 512 in recieved EDNS0.
----
- src/edns0.c   |    5 ++++-
- src/forward.c |    2 ++
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/src/edns0.c b/src/edns0.c
-index 3fde17f..f5b798c 100644
---- a/src/edns0.c
-+++ b/src/edns0.c
-@@ -208,7 +208,10 @@ size_t add_pseudoheader(struct dns_header *header, size_t plen, unsigned char *l
- 	  free(buff);
- 	  p += rdlen;
- 	}
--      header->arcount = htons(ntohs(header->arcount) + 1);
-+      
-+      /* Only bump arcount if RR is going to fit */ 
-+      if (((ssize_t)optlen) <= (limit - (p + 4)))
-+	header->arcount = htons(ntohs(header->arcount) + 1);
-     }
-   
-   if (((ssize_t)optlen) > (limit - (p + 4)))
-diff --git a/src/forward.c b/src/forward.c
-index e3fa94b..942b02d 100644
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -1412,6 +1412,8 @@ void receive_query(struct listener *listen, time_t now)
- 	 defaults to 512 */
-       if (udp_size > daemon->edns_pktsz)
- 	udp_size = daemon->edns_pktsz;
-+      else if (udp_size < PACKETSZ)
-+	udp_size = PACKETSZ; /* Sanity check - can't reduce below default. RFC 6891 6.2.3 */
-     }
- 
- #ifdef HAVE_AUTH
--- 
-1.7.10.4
-
diff --git a/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch b/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch
index 19300f7..37b11ab 100644
--- a/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch
+++ b/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch
@@ -7,7 +7,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
 
 --- a/src/dnsmasq.h
 +++ b/src/dnsmasq.h
-@@ -82,7 +82,7 @@ typedef unsigned long long u64;
+@@ -88,7 +88,7 @@ typedef unsigned long long u64;
  #if defined(HAVE_SOLARIS_NETWORK)
  #  include <sys/sockio.h>
  #endif


From lede-commits at lists.infradead.org  Mon Oct  2 09:52:32 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 02 Oct 2017 12:52:32 -0400
Subject: [source]  odhcpd: backport fixes from master branch (FS#402, FS#524)
In-Reply-To: <20171002165232.13936.77876@git-01.infra.lede-project.org>
References: <20171002165232.13936.77876@git-01.infra.lede-project.org>
Message-ID: <mailman.52395.1506963179.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/c92c1894a53e034661bd4790328ca2ae764581e2

commit c92c1894a53e034661bd4790328ca2ae764581e2
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Mon Oct 2 18:41:34 2017 +0200

    odhcpd: backport fixes from master branch (FS#402, FS#524)
    
    336212c config: fix dhcpv4 server being started
    336212c dhcpv6: assign all viable DHCPv6 addresses by default (FS#402, FS#524)
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 21b50d9..ba8d9fd 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git
-PKG_SOURCE_DATE:=2017-04-28
-PKG_SOURCE_VERSION:=9268ca65d6e000b6cd4ed72d4a8fa427dada6f06
-PKG_MIRROR_HASH:=3c375291de38034f0965c92e509ca17788d3b31fe13abbc8f541b2e2452bc7fe
+PKG_SOURCE_DATE:=2017-10-02
+PKG_SOURCE_VERSION:=c6f3d5d4ea5154e5971fa0b1b1e9a9c07119429f
+PKG_MIRROR_HASH:=5ce8f52b5c6acea27d9733918e9c3bc8a154d516a02eef9b172c5e3d459f494c
 
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Mon Oct  2 09:52:33 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 02 Oct 2017 12:52:33 -0400
Subject: [source]  odhcpd: don't enable server mode on non-static lan port
In-Reply-To: <20171002165232.13936.77876@git-01.infra.lede-project.org>
References: <20171002165232.13936.77876@git-01.infra.lede-project.org>
Message-ID: <mailman.52396.1506963190.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/783465d783b17a66b37e6dd7db732244e30e6913

commit 783465d783b17a66b37e6dd7db732244e30e6913
Author: Karl Palsson <karlp at etactica.com>
AuthorDate: Fri Sep 1 11:22:11 2017 +0000

    odhcpd: don't enable server mode on non-static lan port
    
    Instead of blindly enabling the odhcpd v6 server and RA server on the
    lan port, only do that if the lan port protocol is "static"
    
    This prevents the unhelpful case of a device being a dhcpv4 client and
    v6 server on the same ethernet port.
    
    Signed-off-by: Karl Palsson <karlp at etactica.com>
    [PKG_SOURCE_DATE increase; odhcpd.defaults script cleanup]
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/odhcpd/Makefile              |  2 +-
 package/network/services/odhcpd/files/odhcpd.defaults | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index ba8d9fd..5ba9e7c 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcpd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git
diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults
index d079ec0..175e56e 100644
--- a/package/network/services/odhcpd/files/odhcpd.defaults
+++ b/package/network/services/odhcpd/files/odhcpd.defaults
@@ -2,12 +2,27 @@
 uci -q get dhcp.odhcpd && exit 0
 touch /etc/config/dhcp
 
+. /usr/share/libubox/jshn.sh
+
+json_load "$(cat /etc/board.json)"
+json_select network
+json_select lan
+json_get_vars protocol
+json_select ..
+json_select ..
+
+case "$protocol" in
+# only enable server mode on statically addressed lan ports
+"static") MODE=server ;;
+*) MODE=disabled ;;
+esac
+
 uci batch <<EOF
 set dhcp.odhcpd=odhcpd
 set dhcp.odhcpd.maindhcp=0
 set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd
 set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update
-set dhcp.lan.dhcpv6=server
-set dhcp.lan.ra=server
+set dhcp.lan.dhcpv6=$MODE
+set dhcp.lan.ra=$MODE
 commit dhcp
 EOF


From lede-commits at lists.infradead.org  Tue Oct  3 02:07:44 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 05:07:44 -0400
Subject: [source]  procd: use LN macro
In-Reply-To: <20171003090744.16435.46580@git-01.infra.lede-project.org>
References: <20171003090744.16435.46580@git-01.infra.lede-project.org>
Message-ID: <mailman.52496.1507021959.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/a37655bacab82661c52684fbc474f7acbf19c7ce

commit a37655bacab82661c52684fbc474f7acbf19c7ce
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Tue Oct 3 11:05:01 2017 +0200

    procd: use LN macro
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/system/procd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
index c62877c..67dcf31 100644
--- a/package/system/procd/Makefile
+++ b/package/system/procd/Makefile
@@ -110,7 +110,7 @@ define Package/procd-seccomp/install
 	$(INSTALL_DIR) $(1)/sbin $(1)/lib
 	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/
-	ln -s utrace $(1)/sbin/seccomp-trace
+	$(LN) utrace $(1)/sbin/seccomp-trace
 	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
 endef
 


From lede-commits at lists.infradead.org  Tue Oct  3 02:26:34 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 05:26:34 -0400
Subject: [buildbot] phase2: add hack to derive base feed url from buildroot
In-Reply-To: <20171003092629.21129.30054@git-01.infra.lede-project.org>
References: <20171003092629.21129.30054@git-01.infra.lede-project.org>
Message-ID: <mailman.52497.1507022817.26984.lede-commits@lists.infradead.org>

jow pushed a commit to buildbot.git, branch master:
https://git.lede-project.org/d5ea997f34503914c0dc48a4a8fd22c745322484

commit d5ea997f34503914c0dc48a4a8fd22c745322484
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Tue Oct 3 11:26:14 2017 +0200

    phase2: add hack to derive base feed url from buildroot
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 phase2/master.cfg | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/phase2/master.cfg b/phase2/master.cfg
index 5fcf3d3..49e8e76 100644
--- a/phase2/master.cfg
+++ b/phase2/master.cfg
@@ -137,15 +137,25 @@ feedbranches = dict()
 from buildbot.changes.gitpoller import GitPoller
 c['change_source'] = []
 
+def parse_feed_entry(line):
+	parts = line.strip().split()
+	if parts[0] == "src-git":
+		feeds.append(parts)
+		url = parts[2].strip().split(';')
+		branch = url[1] if len(url) > 1 else 'master'
+		feedbranches[url[0]] = branch
+		c['change_source'].append(GitPoller(url[0], branch=branch, workdir='%s/%s.git' %(os.getcwd(), parts[1]), pollinterval=300))
+
+make = subprocess.Popen(['make', '--no-print-directory', '-C', home_dir+'/source.git/target/sdk/', 'val.BASE_FEED'],
+	env = dict(os.environ, TOPDIR=home_dir+'/source.git'), stdout = subprocess.PIPE)
+
+line = make.stdout.readline()
+if line:
+	parse_feed_entry(line)
+
 with open(home_dir+'/source.git/feeds.conf.default', 'r') as f:
 	for line in f:
-		parts = line.strip().split()
-		if parts[0] == "src-git":
-			feeds.append(parts)
-			url = parts[2].strip().split(';')
-			branch = url[1] if len(url) > 1 else 'master'
-			feedbranches[url[0]] = branch
-			c['change_source'].append(GitPoller(url[0], branch=branch, workdir='%s/%s.git' %(os.getcwd(), parts[1]), pollinterval=300))
+		parse_feed_entry(line)
 
 
 ####### SCHEDULERS


From lede-commits at lists.infradead.org  Tue Oct  3 04:05:19 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 07:05:19 -0400
Subject: [source]  uhttp: update to latest version
In-Reply-To: <20171003110519.11355.86206@git-01.infra.lede-project.org>
References: <20171003110519.11355.86206@git-01.infra.lede-project.org>
Message-ID: <mailman.52520.1507028759.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/d0bf257c46aae0b0d2567c10d6c28c3b2d857f08

commit d0bf257c46aae0b0d2567c10d6c28c3b2d857f08
Author: Adrian Panella <ianchi74 at outlook.com>
AuthorDate: Tue Sep 12 13:29:09 2017 -0500

    uhttp: update to latest version
    
    3fd58e9 2017-08-19 uhttpd: add manifest support
    88c0b4b 2017-07-09 file: fix basic auth regression
    99957f6 2017-07-02 file: remove unused "auth" member from struct
    path_info
    c0a569d 2017-07-02 proc: expose HTTP_AUTH_USER and HTTP_AUTH_PASS
    ad93be7 2017-07-02 auth: store parsed username and password
    fa51d7f 2017-07-02 proc: do not declare empty process variables
    a8bf9c0 2017-01-26 uhttpd: Add TCP_FASTOPEN support
    e6cfc91 2016-10-25 lua: ensure that PATH_INFO starts with a slash
    
    Signed-off-by: Adrian Panella <ianchi74 at outlook.com>
---
 package/network/services/uhttpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index 39e8894..609c9df 100644
--- a/package/network/services/uhttpd/Makefile
+++ b/package/network/services/uhttpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git
-PKG_SOURCE_DATE:=2016-10-25
-PKG_SOURCE_VERSION:=1628fa4b34aa143187353f81e8001b9a15286bda
-PKG_MIRROR_HASH:=2ac4ba8dc0b349d72174aac9ff693a73a214295a9890fe3d2a8eedcad54d06e3
+PKG_SOURCE_DATE:=2017-08-19
+PKG_SOURCE_VERSION:=3fd58e9b6da7d9e1a4710dbeefc2d289baea09fb
+PKG_MIRROR_HASH:=69bba3b04c5e1975b99dee4fc47672ebf5ab282f115249a46be0fe0b961eb34b
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_LICENSE:=ISC
 


From lede-commits at lists.infradead.org  Tue Oct  3 04:49:25 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 07:49:25 -0400
Subject: [keyring]  Add my public usign key
In-Reply-To: <20171003114924.22533.19229@git-01.infra.lede-project.org>
References: <20171003114924.22533.19229@git-01.infra.lede-project.org>
Message-ID: <mailman.52525.1507031390.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to keyring.git, branch master:
https://git.lede-project.org/15cdab46e4fd9fbfa36abc223c694dd7b362392d

commit 15cdab46e4fd9fbfa36abc223c694dd7b362392d
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 3 14:46:46 2017 +0300

    Add my public usign key
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 usign/b26f36ae0f4106d | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usign/b26f36ae0f4106d b/usign/b26f36ae0f4106d
new file mode 100644
index 0000000..8d408eb
--- /dev/null
+++ b/usign/b26f36ae0f4106d
@@ -0,0 +1,2 @@
+untrusted comment: LEDE usign key of Stijn Tintel
+RWQLJvNq4PQQbSGZ05Az9jXSt/xlw/IfWc6USiB2FHEUoWL7QpMibzv6


From lede-commits at lists.infradead.org  Tue Oct  3 04:49:24 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 07:49:24 -0400
Subject: [keyring]  Add my public GPG key
In-Reply-To: <20171003114924.22533.19229@git-01.infra.lede-project.org>
References: <20171003114924.22533.19229@git-01.infra.lede-project.org>
Message-ID: <mailman.52526.1507031391.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to keyring.git, branch master:
https://git.lede-project.org/8921477435cd45ef10633ff0ec93b422bdc9c36c

commit 8921477435cd45ef10633ff0ec93b422bdc9c36c
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 3 14:43:33 2017 +0300

    Add my public GPG key
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 gpg/10F11685.asc | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gpg/10F11685.asc b/gpg/10F11685.asc
new file mode 100644
index 0000000..80b9a7c
--- /dev/null
+++ b/gpg/10F11685.asc
@@ -0,0 +1,63 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Comment: Public key of Stijn Tintel
+

+Ui7u4/0NZ9lb9mu2mw8PhAiKgazrrG8MoJ6F0prEE5hyj80/7l1S2A==
+=3q80
+-----END PGP PUBLIC KEY BLOCK-----


From lede-commits at lists.infradead.org  Tue Oct  3 05:19:34 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 08:19:34 -0400
Subject: [source]  LEDE v17.01.3: revert to branch defaults
In-Reply-To: <20171003121933.31172.61697@git-01.infra.lede-project.org>
References: <20171003121933.31172.61697@git-01.infra.lede-project.org>
Message-ID: <mailman.52529.1507033207.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/ee32de4426daa3599fd9a3ffc0da8225aa016679

commit ee32de4426daa3599fd9a3ffc0da8225aa016679
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 3 15:10:55 2017 +0300

    LEDE v17.01.3: revert to branch defaults
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 feeds.conf.default                 | 8 ++++----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 -
 version.date                       | 1 -
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 001ad62..6181dc6 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,4 +1,4 @@
-src-git packages https://git.lede-project.org/feed/packages.git^21b2e3eb761ea79bf3a8d2b6368435887960f5c2
-src-git luci https://git.lede-project.org/project/luci.git^079f65a628a4c4179578c043d2905efea93bb167
-src-git routing https://git.lede-project.org/feed/routing.git^d11075cd40a88602bf4ba2b275f72100ddcb4767
-src-git telephony https://git.lede-project.org/feed/telephony.git^ac6415e61f147a6892fd2785337aec93ddc68fa9
+src-git packages https://git.lede-project.org/feed/packages.git;lede-17.01
+src-git luci https://git.lede-project.org/project/luci.git;lede-17.01
+src-git routing https://git.lede-project.org/feed/routing.git;lede-17.01
+src-git telephony https://git.lede-project.org/feed/telephony.git;lede-17.01
diff --git a/include/version.mk b/include/version.mk
index 9e4c52f..8a6ab94 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -31,16 +31,16 @@ qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01.3)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01-SNAPSHOT)
 
 VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3533-d0bf257c46)
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
 
 VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
 VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
 
 VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.3)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01-SNAPSHOT)
 
 VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 395575c..b600530 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -190,7 +190,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "http://downloads.lede-project.org/releases/17.01.3"
+		default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -262,7 +262,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default n
+		default y
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
deleted file mode 100644
index d6ed47d..0000000
--- a/version
+++ /dev/null
@@ -1 +0,0 @@
-r3533-d0bf257c46
diff --git a/version.date b/version.date
deleted file mode 100644
index e9d72b9..0000000
--- a/version.date
+++ /dev/null
@@ -1 +0,0 @@
-1507028607


From lede-commits at lists.infradead.org  Tue Oct  3 05:19:33 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 08:19:33 -0400
Subject: [source]  LEDE v17.01.3: adjust config defaults
In-Reply-To: <20171003121933.31172.61697@git-01.infra.lede-project.org>
References: <20171003121933.31172.61697@git-01.infra.lede-project.org>
Message-ID: <mailman.52532.1507033208.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/df54a8f583a9afad356fb99a575d75b69c8c0dd4

commit df54a8f583a9afad356fb99a575d75b69c8c0dd4
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 3 15:10:53 2017 +0300

    LEDE v17.01.3: adjust config defaults
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 feeds.conf.default                 | 8 ++++----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 +
 version.date                       | 1 +
 5 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 6181dc6..001ad62 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,4 +1,4 @@
-src-git packages https://git.lede-project.org/feed/packages.git;lede-17.01
-src-git luci https://git.lede-project.org/project/luci.git;lede-17.01
-src-git routing https://git.lede-project.org/feed/routing.git;lede-17.01
-src-git telephony https://git.lede-project.org/feed/telephony.git;lede-17.01
+src-git packages https://git.lede-project.org/feed/packages.git^21b2e3eb761ea79bf3a8d2b6368435887960f5c2
+src-git luci https://git.lede-project.org/project/luci.git^079f65a628a4c4179578c043d2905efea93bb167
+src-git routing https://git.lede-project.org/feed/routing.git^d11075cd40a88602bf4ba2b275f72100ddcb4767
+src-git telephony https://git.lede-project.org/feed/telephony.git^ac6415e61f147a6892fd2785337aec93ddc68fa9
diff --git a/include/version.mk b/include/version.mk
index 8a6ab94..9e4c52f 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -31,16 +31,16 @@ qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01-SNAPSHOT)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01.3)
 
 VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3533-d0bf257c46)
 
 VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
 VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
 
 VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01-SNAPSHOT)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.3)
 
 VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index b600530..395575c 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -190,7 +190,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT"
+		default "http://downloads.lede-project.org/releases/17.01.3"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -262,7 +262,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default y
+		default n
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
new file mode 100644
index 0000000..d6ed47d
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+r3533-d0bf257c46
diff --git a/version.date b/version.date
new file mode 100644
index 0000000..e9d72b9
--- /dev/null
+++ b/version.date
@@ -0,0 +1 @@
+1507028607


From lede-commits at lists.infradead.org  Tue Oct  3 06:16:31 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 03 Oct 2017 09:16:31 -0400
Subject: [buildbot]  phase1: remove automatic tagging support
In-Reply-To: <20171003131631.12984.83938@git-01.infra.lede-project.org>
References: <20171003131631.12984.83938@git-01.infra.lede-project.org>
Message-ID: <mailman.52539.1507036752.26984.lede-commits@lists.infradead.org>

jow pushed a commit to buildbot.git, branch master:
https://git.lede-project.org/19fa08b9f8f1090f7b4922aa0e04369246633fdc

commit 19fa08b9f8f1090f7b4922aa0e04369246633fdc
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Tue Oct 3 15:16:18 2017 +0200

    phase1: remove automatic tagging support
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 phase1/maketag.sh | 173 ------------------------------------------------------
 phase1/master.cfg |  13 ----
 2 files changed, 186 deletions(-)

diff --git a/phase1/maketag.sh b/phase1/maketag.sh
deleted file mode 100755
index 35c6ee1..0000000
--- a/phase1/maketag.sh
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env bash
-
-git_author="$(git config user.name)"
-git_email="$(git config user.email)"
-gpg_keyid=""
-
-base_url="http://downloads.lede-project.org/releases"
-
-[ -f "./feeds.conf.default" ] || {
-	echo "Please execute as ./${0##*/}" >&2
-	exit 1
-}
-
-usage() {
-	{
-		echo ""
-		echo "Usage: $0 [-i] [-a <Git author>] [-e <Git email>] \\"
-		echo "          [-k <GPG key id>] [-p <GPG passphrase file>] \\"
-		echo "          [-u <Download base url>] -v <version>"
-		echo ""
-		echo "-i"
-		echo "Exit successfully if tag already exists"
-		echo ""
-		echo "-a Git author [$git_author]"
-		echo "Override the author name used for automated Git commits"
-		echo ""
-		echo "-e Git email [$git_email]"
-		echo "Override the email used for automated Git commits"
-		echo ""
-		echo "-k GPG key id [${gpg_keyid:-none}]"
-		echo "Enable GPG signing of tags with given GPG key id"
-		echo ""
-		echo "-p GPG passphrase file [none]"
-		echo "Use the passphrase stored in the given file for signing"
-		echo ""
-		echo "-u Download base url [$base_url]"
-		echo "Use the given URL as base for download repositories"
-		echo ""
-		exit 1
-	} >&2
-}
-
-while getopts "a:e:ik:p:u:v:" opt; do
-	case "$opt" in
-		a) git_author="$OPTARG" ;;
-		e) git_email="$OPTARG" ;;
-		i) ignore_existing=1 ;;
-		k) gpg_keyid="${OPTARG#0x}" ;;
-		p) gpg_passfile="${OPTARG}" ;;
-		u) base_url="${OPTARG%/}" ;;
-		v)
-			case "$OPTARG" in
-				[0-9]*.[0-9]*.[0-9]*)
-					version="$OPTARG"
-					basever="$(echo "$version" | cut -d. -f1-2)"
-				;;
-				*)
-					echo "Unexpected version format: $OPTARG" >&2
-					exit 1
-				;;
-			esac
-		;;
-		\?)
-			echo "Unexpected option: -$OPTARG" >&2
-			usage
-		;;
-		:)
-			echo "Missing argument for option: -$OPTARG" >&2
-			usage
-		;;
-	esac
-done
-
-[ -n "$version" ] || usage
-
-if git rev-parse "v${version}^{tag}" >/dev/null 2>/dev/null; then
-	if [ -z "$ignore_existing" ]; then
-		echo "Tag v${version} already exists!" >&2
-		exit 1
-	fi
-
-	exit 0
-fi
-
-revnum="$(./scripts/getver.sh)"
-epoch="$(./scripts/get_source_date_epoch.sh)"
-
-prev_branch="$(git symbolic-ref -q HEAD)"
-
-case "$prev_branch" in
-	*-$basever) : ;;
-	*)
-		echo "Expecting current branch name to end in \"-$basever\"," \
-		     "but it is \"${prev_branch#refs/heads/}\" - aborting."
-
-		exit 1
-	;;
-esac
-
-export GIT_AUTHOR_NAME="$git_author"
-export GIT_AUTHOR_EMAIL="$git_email"
-export GIT_COMMITTER_NAME="$git_author"
-export GIT_COMMITTER_EMAIL="$git_email"
-
-git checkout -b "release-$version"
-
-while read type name url; do
-	case "$type" in
-		src-git)
-			case "$url" in
-				*^*)  sha1="${url##*^}" ;;
-				*\;*) sha1="$(git ls-remote "${url%;*}" "${url##*;}")" ;;
-				*)    sha1="$(git ls-remote "$url" "master")" ;;
-			esac
-			echo "$type $name ${url%[;^]*}${sha1:+^${sha1:0:40}}"
-		;;
-		src-svn)
-			case "$url" in
-				*\;*) rev="${url##*;}" ;;
-				*)    rev="$(svn log -l 1 "$url" | sed -ne '2s/ .*$//p')" ;;
-			esac
-			echo "$type $name ${url%;*}${rev:+;$rev}"
-		;;
-		src-*)
-			echo "$type $name $url"
-		;;
-	esac
-done < feeds.conf.default > feeds.conf.tagged && \
-	mv feeds.conf.tagged feeds.conf.default
-
-sed -e 's!\(VERSION_NUMBER:=\$(if .*\),[^,]*)!\1,'"$version"')!g' \
-    -e 's!\(VERSION_CODE:=\$(if .*\),[^,]*)!\1,'"$revnum"')!g' \
-    -e 's!\(VERSION_REPO:=\$(if .*\),[^,]*)!\1,'"$base_url/$version"')!g' \
-	include/version.mk > include/version.tagged && \
-		mv include/version.tagged include/version.mk
-
-sed -e 's!http://downloads.lede-project.org/[^"]*!'"$base_url/$version"'!g' \
-	package/base-files/image-config.in > package/base-files/image-config.tagged && \
-		mv package/base-files/image-config.tagged package/base-files/image-config.in
-
-echo "$revnum" > version && git add version
-echo "$epoch" > version.date && git add version.date
-
-git commit -sm "LEDE v$version: adjust config defaults" \
-	feeds.conf.default \
-	include/version.mk \
-	package/base-files/image-config.in \
-	version version.date
-
-
-if [ -n "$gpg_keyid" -a -n "$gpg_passfile" ]; then
-	gpg_script="$(tempfile)"
-
-	cat <<-EOT > "$gpg_script"
-		#!/usr/bin/env bash
-		exec $(which gpg) --batch --passphrase-file $gpg_passfile "\$@"
-	EOT
-
-	chmod 0700 "$gpg_script"
-fi
-
-git ${gpg_script:+-c "gpg.program=$gpg_script"} tag \
-	-a "v$version" \
-	-m "LEDE v$version Release" \
-	${gpg_keyid:+-s -u "$gpg_keyid"}
-
-[ -n "$gpg_script" ] && rm -f "$gpg_script"
-
-git checkout "${prev_branch#refs/heads/}"
-git branch -D "release-$version"
-
-git --no-pager show "v$version"
-git push --follow-tags origin "refs/tags/v$version:refs/tags/v$version"
diff --git a/phase1/master.cfg b/phase1/master.cfg
index fb8f488..a68d067 100644
--- a/phase1/master.cfg
+++ b/phase1/master.cfg
@@ -266,7 +266,6 @@ def MakeEnv(overrides=None):
 c['builders'] = []
 
 dlLock = locks.SlaveLock("slave_dl")
-tagLock = locks.MasterLock("make_tag")
 
 checkBuiltin = re.sub('[\t\n ]+', ' ', """
 	checkBuiltin() {
@@ -384,18 +383,6 @@ for target in targets:
 			doStepIf = IsCleanRequested(tuple[0])
 		))
 
-	factory.addStep(MasterShellCommand(
-		name = "maketag",
-		description = "Tagging Git repository",
-		command = [home_dir+'/maketag.sh', '-i', '-k', str(gpg_keyid or ''),
-		           '-p', str(gpg_passfile or ''), '-v', WithProperties("%(tag:-)s")],
-		path = home_dir+'/source.git',
-		env = {'GNUPGHOME': gpg_home},
-		haltOnFailure = True,
-		doStepIf = IsTaggingRequested,
-		locks = [tagLock.access('exclusive')]
-	))
-
 	# switch to branch
 	factory.addStep(ShellCommand(
 		name = "switchbranch",


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:37 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:37 -0400
Subject: [source]  lantiq: xrx200: fix sorting of kernel config
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52720.1507140676.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/054f01ac169472c3e76bd1abbb0ed955a6cb7403

commit 054f01ac169472c3e76bd1abbb0ed955a6cb7403
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 2 07:42:56 2017 +0200

    lantiq: xrx200: fix sorting of kernel config
    
    Use the kconfig script to sort the kernel config. It makes further
    changes more obvious.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/xrx200/config-default | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/target/linux/lantiq/xrx200/config-default b/target/linux/lantiq/xrx200/config-default
index c307dc8..1477cc2 100644
--- a/target/linux/lantiq/xrx200/config-default
+++ b/target/linux/lantiq/xrx200/config-default
@@ -10,6 +10,7 @@ CONFIG_CRYPTO_LZO=y
 CONFIG_FIRMWARE_IN_KERNEL=y
 CONFIG_HWMON=y
 CONFIG_ICPLUS_PHY=y
+CONFIG_IFX_VPE_EXT=y
 CONFIG_INPUT=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_POLLDEV=y
@@ -24,6 +25,9 @@ CONFIG_MIPS_MT=y
 # CONFIG_MIPS_MT_FPAFF is not set
 CONFIG_MIPS_MT_SMP=y
 CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y
+CONFIG_MIPS_VPE_APSP_API=y
+CONFIG_MIPS_VPE_LOADER=y
+CONFIG_MIPS_VPE_LOADER_TOM=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_PLATFORM=y
@@ -35,10 +39,12 @@ CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
+# CONFIG_MTSCHED is not set
 CONFIG_NET_FLOW_LIMIT=y
 CONFIG_NLS=y
 CONFIG_NR_CPUS=2
 CONFIG_PCIE_LANTIQ=y
+# CONFIG_PERFCTRS is not set
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_GPIO=y
 CONFIG_POWER_SUPPLY=y
@@ -70,9 +76,3 @@ CONFIG_XPS=y
 CONFIG_XRX200_PHY_FW=y
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
-CONFIG_MIPS_VPE_LOADER=y
-CONFIG_MIPS_VPE_LOADER_TOM=y
-CONFIG_MIPS_VPE_APSP_API=y
-CONFIG_IFX_VPE_EXT=y
-CONFIG_PERFCTRS=n
-# CONFIG_MTSCHED is not set


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:39 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:39 -0400
Subject: [source]  lantiq: xway: cleanup kernel config
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52721.1507140679.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/d7a76be980ab987e463c9a184d4a657c62f908e4

commit d7a76be980ab987e463c9a184d4a657c62f908e4
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 2 07:54:58 2017 +0200

    lantiq: xway: cleanup kernel config
    
    CONFIG_SPI_LANTIQ was replaced by CONFIG_SPI_LANTIQ_SSC with the switch
    to the upstreamed driver.
    
    All other removed subtarget kernel config options are already set by
    the target specific or global kernel config.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/xway/config-default | 29 -----------------------------
 1 file changed, 29 deletions(-)

diff --git a/target/linux/lantiq/xway/config-default b/target/linux/lantiq/xway/config-default
index e88e3fe..fde071c 100644
--- a/target/linux/lantiq/xway/config-default
+++ b/target/linux/lantiq/xway/config-default
@@ -1,34 +1,14 @@
 CONFIG_ADM6996_PHY=y
 CONFIG_AR8216_PHY=y
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
-CONFIG_CPU_SUPPORTS_MSA=y
 CONFIG_CRC16=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
 CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HZ_PERIODIC=y
 CONFIG_INPUT=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_POLLDEV=y
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_WORK=y
 # CONFIG_ISDN is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-CONFIG_LIBFDT=y
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 CONFIG_MTD_NAND=y
@@ -36,7 +16,6 @@ CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_PLATFORM=y
 CONFIG_MTD_NAND_XWAY=y
 # CONFIG_MTD_PHYSMAP_OF is not set
-CONFIG_MTD_SPLIT_UIMAGE_FW=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
 CONFIG_MTD_UBI_BLOCK=y
@@ -44,17 +23,10 @@ CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_NLS=y
-# CONFIG_NO_IOPORT_MAP is not set
-CONFIG_OF_ADDRESS_PCI=y
-# CONFIG_RCU_STALL_COMMON is not set
 CONFIG_RTL8306_PHY=y
 CONFIG_RTL8366S_PHY=y
 CONFIG_RTL8367B_PHY=y
 CONFIG_RTL8367_PHY=y
-CONFIG_SPI=y
-CONFIG_SPI_LANTIQ=y
-CONFIG_SPI_MASTER=y
-CONFIG_SYS_SUPPORTS_MIPS16=y
 CONFIG_UBIFS_FS=y
 CONFIG_UBIFS_FS_ADVANCED_COMPR=y
 CONFIG_UBIFS_FS_LZO=y
@@ -64,6 +36,5 @@ CONFIG_USB_COMMON=y
 # CONFIG_USB_EHCI_HCD is not set
 CONFIG_USB_SUPPORT=y
 # CONFIG_USB_UHCI_HCD is not set
-# CONFIG_XRX200_PHY_FW is not set
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:38 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:38 -0400
Subject: [source]  lantiq: xrx200: cleanup kernel config
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52722.1507140679.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/d3f3b817ac1ea2ab75e77345362be905b6401eff

commit d3f3b817ac1ea2ab75e77345362be905b6401eff
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 2 07:47:16 2017 +0200

    lantiq: xrx200: cleanup kernel config
    
    CONFIG_MTSCHED & CONFIG_PERFCTRS were never defined in the kernel.
    
    CONFIG_LANTIQ_PHY was replaced by CONFIG_INTEL_XWAY_PHY with the switch
    to the upstreamed driver.
    
    Add autoselected dependecies to the kernel config.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/xrx200/config-default | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/target/linux/lantiq/xrx200/config-default b/target/linux/lantiq/xrx200/config-default
index 1477cc2..7b09234 100644
--- a/target/linux/lantiq/xrx200/config-default
+++ b/target/linux/lantiq/xrx200/config-default
@@ -5,8 +5,13 @@ CONFIG_CPU_MIPSR2_IRQ_EI=y
 CONFIG_CPU_MIPSR2_IRQ_VI=y
 CONFIG_CPU_RMAP=y
 CONFIG_CRC16=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL2=y
 CONFIG_FIRMWARE_IN_KERNEL=y
 CONFIG_HWMON=y
 CONFIG_ICPLUS_PHY=y
@@ -16,7 +21,6 @@ CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_POLLDEV=y
 CONFIG_INTEL_XWAY_PHY=y
 # CONFIG_ISDN is not set
-CONFIG_LANTIQ_PHY=y
 CONFIG_LANTIQ_XRX200=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_LZO_COMPRESS=y
@@ -26,7 +30,9 @@ CONFIG_MIPS_MT=y
 CONFIG_MIPS_MT_SMP=y
 CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y
 CONFIG_MIPS_VPE_APSP_API=y
+CONFIG_MIPS_VPE_APSP_API_MT=y
 CONFIG_MIPS_VPE_LOADER=y
+CONFIG_MIPS_VPE_LOADER_MT=y
 CONFIG_MIPS_VPE_LOADER_TOM=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
@@ -39,12 +45,11 @@ CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
-# CONFIG_MTSCHED is not set
 CONFIG_NET_FLOW_LIMIT=y
 CONFIG_NLS=y
 CONFIG_NR_CPUS=2
+CONFIG_PADATA=y
 CONFIG_PCIE_LANTIQ=y
-# CONFIG_PERFCTRS is not set
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_GPIO=y
 CONFIG_POWER_SUPPLY=y


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:36 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:36 -0400
Subject: [source]  treewide: drop obsolete kernel config options
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52723.1507140681.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/1c45d11bb331b9df3e52d216c6a6d3ad8c5fa43f

commit 1c45d11bb331b9df3e52d216c6a6d3ad8c5fa43f
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 2 07:39:30 2017 +0200

    treewide: drop obsolete kernel config options
    
    CONFIG_GPIO_DEVRES was removed with kernel commit f9c22ec6c1c5 ("gpio:
    Remove GPIO_DEVRES option") during kernel 4.9 development.
    
    CONFIG_HAVE_BPF_JIT was removed with kernel commit 6077776b5908 ("bpf:
    split HAVE_BPF_JIT into cBPF and eBPF variant") during kernel 4.7
    development.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/xway/config-default | 2 --
 target/linux/rb532/config-4.9           | 2 --
 2 files changed, 4 deletions(-)

diff --git a/target/linux/lantiq/xway/config-default b/target/linux/lantiq/xway/config-default
index bddf027..e88e3fe 100644
--- a/target/linux/lantiq/xway/config-default
+++ b/target/linux/lantiq/xway/config-default
@@ -10,13 +10,11 @@ CONFIG_CRC16=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
 CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_GPIO_DEVRES=y
 CONFIG_HAS_IOPORT_MAP=y
 # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
 CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
 CONFIG_HAVE_ARCH_TRACEHOOK=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
diff --git a/target/linux/rb532/config-4.9 b/target/linux/rb532/config-4.9
index 765f01b..9290a18 100644
--- a/target/linux/rb532/config-4.9
+++ b/target/linux/rb532/config-4.9
@@ -61,7 +61,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_HARDWARE_WATCHPOINTS=y
 CONFIG_HAS_DMA=y
@@ -74,7 +73,6 @@ CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
 CONFIG_HAVE_ARCH_TRACEHOOK=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_C_RECORDMCOUNT=y


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:41 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:41 -0400
Subject: [source]  lantiq: select PCI support in subtargets
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52724.1507140684.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/66a0f3a39709839c1e46141f5e431974e4bd4cdf

commit 66a0f3a39709839c1e46141f5e431974e4bd4cdf
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Oct 3 14:58:53 2017 +0200

    lantiq: select PCI support in subtargets
    
    AmazonSE and Falcon do not have support for PCI and it can't be
    unselected in the subtarget kernel config. This way the enabled PCI
    support is inherit from the higher level config to the subtarget.
    
    If CONFIG_PCI is selected, PCI_SUPPORT will be autoselected as well and
    all packages depending on this config symbol will be build and at least
    some of them fail due to missing pci functions.
    
    The issue can be observed if all kmods and all non-shared packages are
    build. Fix the issue by enabling PCI support only in subtargets with
    PCI support.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/config-4.9                 | 8 --------
 target/linux/lantiq/xrx200/config-default      | 7 +++++++
 target/linux/lantiq/xway/config-default        | 8 ++++++++
 target/linux/lantiq/xway_legacy/config-default | 8 ++++++++
 4 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/target/linux/lantiq/config-4.9 b/target/linux/lantiq/config-4.9
index 387a189..a98509e 100644
--- a/target/linux/lantiq/config-4.9
+++ b/target/linux/lantiq/config-4.9
@@ -12,7 +12,6 @@ CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_BLK_MQ_PCI=y
 CONFIG_CEVT_R4K=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLONE_BACKWARDS=y
@@ -151,20 +150,13 @@ CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 # CONFIG_NO_IOPORT_MAP is not set
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
-CONFIG_OF_ADDRESS_PCI=y
 CONFIG_OF_EARLY_FLATTREE=y
 CONFIG_OF_FLATTREE=y
 CONFIG_OF_GPIO=y
 CONFIG_OF_IRQ=y
 CONFIG_OF_MDIO=y
 CONFIG_OF_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_PCI=y
-# CONFIG_PCIE_LANTIQ is not set
-CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_DRIVERS_LEGACY=y
-CONFIG_PCI_LANTIQ=y
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
diff --git a/target/linux/lantiq/xrx200/config-default b/target/linux/lantiq/xrx200/config-default
index 7b09234..73ccaf3 100644
--- a/target/linux/lantiq/xrx200/config-default
+++ b/target/linux/lantiq/xrx200/config-default
@@ -1,6 +1,7 @@
 CONFIG_ADM6996_PHY=y
 CONFIG_AR8216_PHY=y
 CONFIG_AT803X_PHY=y
+CONFIG_BLK_MQ_PCI=y
 CONFIG_CPU_MIPSR2_IRQ_EI=y
 CONFIG_CPU_MIPSR2_IRQ_VI=y
 CONFIG_CPU_RMAP=y
@@ -48,8 +49,14 @@ CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_NET_FLOW_LIMIT=y
 CONFIG_NLS=y
 CONFIG_NR_CPUS=2
+CONFIG_OF_ADDRESS_PCI=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
 CONFIG_PADATA=y
+CONFIG_PCI=y
 CONFIG_PCIE_LANTIQ=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_LANTIQ=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_GPIO=y
 CONFIG_POWER_SUPPLY=y
diff --git a/target/linux/lantiq/xway/config-default b/target/linux/lantiq/xway/config-default
index fde071c..79064cc 100644
--- a/target/linux/lantiq/xway/config-default
+++ b/target/linux/lantiq/xway/config-default
@@ -1,5 +1,6 @@
 CONFIG_ADM6996_PHY=y
 CONFIG_AR8216_PHY=y
+CONFIG_BLK_MQ_PCI=y
 CONFIG_CRC16=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
@@ -23,6 +24,13 @@ CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_NLS=y
+CONFIG_OF_ADDRESS_PCI=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_PCI=y
+# CONFIG_PCIE_LANTIQ is not set
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_LANTIQ=y
 CONFIG_RTL8306_PHY=y
 CONFIG_RTL8366S_PHY=y
 CONFIG_RTL8367B_PHY=y
diff --git a/target/linux/lantiq/xway_legacy/config-default b/target/linux/lantiq/xway_legacy/config-default
index b838106..c8aa631 100644
--- a/target/linux/lantiq/xway_legacy/config-default
+++ b/target/linux/lantiq/xway_legacy/config-default
@@ -1,5 +1,6 @@
 CONFIG_ADM6996_PHY=y
 CONFIG_AR8216_PHY=y
+CONFIG_BLK_MQ_PCI=y
 CONFIG_CRC16=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
@@ -16,6 +17,13 @@ CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 # CONFIG_MTD_PHYSMAP_OF is not set
 CONFIG_NLS=y
+CONFIG_OF_ADDRESS_PCI=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_PCI=y
+# CONFIG_PCIE_LANTIQ is not set
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_LANTIQ=y
 CONFIG_RTL8306_PHY=y
 CONFIG_RTL8366S_PHY=y
 CONFIG_RTL8367B_PHY=y


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:43 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:43 -0400
Subject: [source]  lantiq: ase: enable USB and wireless
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52725.1507140689.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/aba297b7fd7ba319cb18c8df3d49d62774bc5207

commit aba297b7fd7ba319cb18c8df3d49d62774bc5207
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Oct 3 21:51:51 2017 +0200

    lantiq: ase: enable USB and wireless
    
    Add the missing USB related kernel config options to target config.
    Enable wireless as well, wireless is supported via USB.
    
    Fixes compile/packaging errors with the libertas wireless kernel
    module.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/ase/config-default | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/lantiq/ase/config-default b/target/linux/lantiq/ase/config-default
index 7b76665..b802509 100644
--- a/target/linux/lantiq/ase/config-default
+++ b/target/linux/lantiq/ase/config-default
@@ -12,12 +12,14 @@ CONFIG_GPIO_GENERIC_PLATFORM=y
 # CONFIG_LBDAF is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_MIPS_FPU_EMULATOR=y
+CONFIG_NLS=y
 # CONFIG_PSB6970_PHY is not set
 # CONFIG_RTL8366_SMI is not set
 CONFIG_SOC_AMAZON_SE=y
 # CONFIG_SOC_XWAY is not set
+CONFIG_USB=y
+CONFIG_USB_COMMON=y
+# CONFIG_USB_EHCI_HCD is not set
 CONFIG_USB_SUPPORT=y
-# CONFIG_WIRELESS is not set
-# CONFIG_WLAN is not set
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:40 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:40 -0400
Subject: [source]  lantiq: ase: cleanup kernel config
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52728.1507140689.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/77fee9bcce5cb118be6e1f8168cf5a0fe6dcf2b7

commit 77fee9bcce5cb118be6e1f8168cf5a0fe6dcf2b7
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 2 08:04:06 2017 +0200

    lantiq: ase: cleanup kernel config
    
    The subtarget kernel config options CONFIG_CC_OPTIMIZE_FOR_SIZE and
    CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK are already set by the target or
    global kernel config.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/ase/config-default | 2 --
 1 file changed, 2 deletions(-)

diff --git a/target/linux/lantiq/ase/config-default b/target/linux/lantiq/ase/config-default
index b6cd4f3..b53f6c5 100644
--- a/target/linux/lantiq/ase/config-default
+++ b/target/linux/lantiq/ase/config-default
@@ -1,5 +1,4 @@
 CONFIG_ADM6996_PHY=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_CPU_MIPS32_R1=y
 # CONFIG_CPU_MIPS32_R2 is not set
 CONFIG_CPU_MIPSR1=y
@@ -9,7 +8,6 @@ CONFIG_FIRMWARE_IN_KERNEL=y
 CONFIG_FIRMWARE_MEMMAP=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
-CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
 # CONFIG_ISDN is not set
 # CONFIG_LBDAF is not set
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:42 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:42 -0400
Subject: [source]  lantiq: ase: fix SPI support
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52729.1507140694.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/695645b9ac1c0bcb90b20c49e463be84927a4967

commit 695645b9ac1c0bcb90b20c49e463be84927a4967
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Oct 3 21:44:40 2017 +0200

    lantiq: ase: fix SPI support
    
    Do not disable SPI in the subtarget, otherwise the SPI driver can not
    be used.
    
    Disable SPI by default and enable it in the board specific device tree
    source file.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/ase/config-default | 1 -
 target/linux/lantiq/dts/DGN1000B.dts   | 1 +
 target/linux/lantiq/dts/amazonse.dtsi  | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/lantiq/ase/config-default b/target/linux/lantiq/ase/config-default
index b53f6c5..7b76665 100644
--- a/target/linux/lantiq/ase/config-default
+++ b/target/linux/lantiq/ase/config-default
@@ -16,7 +16,6 @@ CONFIG_MIPS_FPU_EMULATOR=y
 # CONFIG_RTL8366_SMI is not set
 CONFIG_SOC_AMAZON_SE=y
 # CONFIG_SOC_XWAY is not set
-# CONFIG_SPI is not set
 CONFIG_USB_SUPPORT=y
 # CONFIG_WIRELESS is not set
 # CONFIG_WLAN is not set
diff --git a/target/linux/lantiq/dts/DGN1000B.dts b/target/linux/lantiq/dts/DGN1000B.dts
index 5586582..1e409d2 100644
--- a/target/linux/lantiq/dts/DGN1000B.dts
+++ b/target/linux/lantiq/dts/DGN1000B.dts
@@ -60,6 +60,7 @@
 		};
 
 		spi at E100800 {
+			status = "okay";
 			pinctrl-names = "default";
 			pinctrl-0 = <&pins_spi_default>;
 
diff --git a/target/linux/lantiq/dts/amazonse.dtsi b/target/linux/lantiq/dts/amazonse.dtsi
index e88fc16..e6925a3 100644
--- a/target/linux/lantiq/dts/amazonse.dtsi
+++ b/target/linux/lantiq/dts/amazonse.dtsi
@@ -104,6 +104,7 @@
 					"spi_frm";
 			#address-cells = <1>;
 			#size-cells = <1>;
+			status = "disabled";
 		};
 
 		gptu at E100A00 {


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:44 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:44 -0400
Subject: [source]  ltq-ptm: mark AmazonSE support as broken
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52730.1507140694.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/bd523d45733eff0855baa87fcf127b04545f8f4d

commit bd523d45733eff0855baa87fcf127b04545f8f4d
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Oct 3 22:42:33 2017 +0200

    ltq-ptm: mark AmazonSE support as broken
    
    Albeit ltq-ptm is supported on AmazonSE, the package fails to compile.
    Mark the AmazonSE variant as broken to not mark it unnecessary harder
    to fix (and test) the compile error.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 package/kernel/lantiq/ltq-ptm/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/kernel/lantiq/ltq-ptm/Makefile b/package/kernel/lantiq/ltq-ptm/Makefile
index d0743cd..caf958f 100644
--- a/package/kernel/lantiq/ltq-ptm/Makefile
+++ b/package/kernel/lantiq/ltq-ptm/Makefile
@@ -24,6 +24,9 @@ define KernelPackage/ltq-ptm-template
   URL:=http://www.lantiq.com/
   VARIANT:=$(1)
   DEPENDS:=@TARGET_lantiq_$(2)
+ifeq ($(1),ase)
+  DEPENDS+=@BROKEN
+endif
   FILES:=$(PKG_BUILD_DIR)/ltq_ptm_$(1).ko 
 endef
 


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:45 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:45 -0400
Subject: [source]  ltq-vmmc: disable for falcon
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52731.1507140699.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/d07f924978ff75cfa6f83085dfd2891592692e89

commit d07f924978ff75cfa6f83085dfd2891592692e89
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Tue Oct 3 22:56:44 2017 +0200

    ltq-vmmc: disable for falcon
    
    The module fails to compile with falcon. Remove the falcon depends from
    the module to not (try to) compile it for falcon any longer.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 package/kernel/lantiq/ltq-vmmc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile
index ab0ef72..e42d5c0 100644
--- a/package/kernel/lantiq/ltq-vmmc/Makefile
+++ b/package/kernel/lantiq/ltq-vmmc/Makefile
@@ -27,7 +27,7 @@ define KernelPackage/ltq-vmmc
   SUBMENU:=Voice over IP
   TITLE:=TAPI LL driver for Voice Macro
   URL:=http://www.lantiq.com/
-  DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-tapi
+  DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-tapi
   FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.ko
   AUTOLOAD:=$(call AutoProbe,drv_vmmc)
 endef


From lede-commits at lists.infradead.org  Wed Oct  4 11:08:46 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 14:08:46 -0400
Subject: [source]  ramips: keep Archer C20 Power LED On during boot
In-Reply-To: <20171004180836.8741.86205@git-01.infra.lede-project.org>
References: <20171004180836.8741.86205@git-01.infra.lede-project.org>
Message-ID: <mailman.52734.1507141560.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/c9f66b1eb92a3e93bf1564e1923b866cd7d80d7f

commit c9f66b1eb92a3e93bf1564e1923b866cd7d80d7f
Author: Sergey Ryazanov <ryazanov.s.a at gmail.com>
AuthorDate: Mon Oct 2 02:33:17 2017 +0300

    ramips: keep Archer C20 Power LED On during boot
    
    Keep Archer C20 Power LED in the same state as it was configured by
    bootloader (keep it hightlighed) to avoid unexpectable LED turning off
    during kernel boot.
    
    Signed-off-by: Sergey Ryazanov <ryazanov.s.a at gmail.com>
---
 target/linux/ramips/dts/ArcherC20.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/dts/ArcherC20.dts b/target/linux/ramips/dts/ArcherC20.dts
index a0e7c61..ba842d9 100644
--- a/target/linux/ramips/dts/ArcherC20.dts
+++ b/target/linux/ramips/dts/ArcherC20.dts
@@ -24,6 +24,7 @@
 		power {
 			label = "c20:blue:power";
 			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+			default-state = "keep";
 		};
 
 		usb {


From lede-commits at lists.infradead.org  Wed Oct  4 12:29:55 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 15:29:55 -0400
Subject: [source]  libubox: bump to git HEAD version
In-Reply-To: <20171004192955.1386.11604@git-01.infra.lede-project.org>
References: <20171004192955.1386.11604@git-01.infra.lede-project.org>
Message-ID: <mailman.52743.1507145421.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/470b13975de9a3dd5a97094074ac69ee58bc1431

commit 470b13975de9a3dd5a97094074ac69ee58bc1431
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Tue Oct 3 13:31:37 2017 +0200

    libubox: bump to git HEAD version
    
    632688e utils: nuke bitfield functions and macros
    f714be1 uloop: make SIGCHLD signal handling optional
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/libs/libubox/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
index be8d921..5fdf946 100644
--- a/package/libs/libubox/Makefile
+++ b/package/libs/libubox/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git
-PKG_SOURCE_DATE:=2017-09-12
-PKG_SOURCE_VERSION:=7a1057604ed2ad83434ed3be03728065b14a5e9c
-PKG_MIRROR_HASH:=9040b13684de4343e86190d52c4f1a39e9ccee4b62b8c96075c1764280ce5a29
+PKG_SOURCE_DATE:=2017-09-29
+PKG_SOURCE_VERSION:=632688e8d6cde32781e4ec685d59afb0938300ad
+PKG_MIRROR_HASH:=84b5a0bc404e96a2965cadc1beb92664f4c22cc878a0a624eecd4b6884b56625
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=ISC


From lede-commits at lists.infradead.org  Wed Oct  4 12:29:56 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 15:29:56 -0400
Subject: [source]  uci: bump to git HEAD version
In-Reply-To: <20171004192955.1386.11604@git-01.infra.lede-project.org>
References: <20171004192955.1386.11604@git-01.infra.lede-project.org>
Message-ID: <mailman.52744.1507145422.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/7d905f1e95539f9bc43fad4f2892d916ced546cb

commit 7d905f1e95539f9bc43fad4f2892d916ced546cb
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Tue Oct 3 13:24:14 2017 +0200

    uci: bump to git HEAD version
    
    5ad59ad Add bitfield_set function from libubox
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/system/uci/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index 5699c1a..4d11ee1 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -13,9 +13,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE=2017-04-12
-PKG_SOURCE_VERSION:=c4df32b386c7bb29568140d135d7315e76c934b7
-PKG_MIRROR_HASH:=88abfe828f164666e3d3c90141449d9c8f622d32b29df135b1b72fcadbb2cb34
+PKG_SOURCE_DATE=2017-09-29
+PKG_SOURCE_VERSION:=5ad59ad412a784c5c478e31d1701ce39568ffd58
+PKG_MIRROR_HASH:=0c1c40e8c7e08163a4c8d306ab4b676a9c545028e14aa57b5cf2d6f7bfe726cb
 
 PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=


From lede-commits at lists.infradead.org  Wed Oct  4 13:23:39 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 04 Oct 2017 16:23:39 -0400
Subject: [source]  ramips: mt7620: do not pad sysupgrade Archer images
In-Reply-To: <20171004202339.13727.82912@git-01.infra.lede-project.org>
References: <20171004202339.13727.82912@git-01.infra.lede-project.org>
Message-ID: <mailman.52745.1507148652.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/f9a849ca84f596aafd7c167b2410ec5446c84784

commit f9a849ca84f596aafd7c167b2410ec5446c84784
Author: Thibaut VARENE <hacks at slashdirt.org>
AuthorDate: Wed Aug 2 16:28:16 2017 +0200

    ramips: mt7620: do not pad sysupgrade Archer images
    
    The current makefile unnecessarily pads sysupgrade image for Archer devices.
    
    This has three implications:
    1. higher risk of OOM when uploading the binary image to the device
    2. much slower upgrade due to time wasted erasing and writing padding
    3. grows image beyond available flash size if metadata are appended
    
    This is already fixed in master, albeit in a completely different way (the
    whole target have been reworked)
    
    Fixes: FS#1025, FS#1039
    
    Signed-off-by: Thibaut VARENE <hacks at slashdirt.org>
---
 target/linux/ramips/image/mt7620.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index e27c405..c2c0ae2 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -38,7 +38,7 @@ define Device/ArcherC20i
   KERNEL := $(KERNEL_DTB)
   KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC20i -c
   IMAGE/factory.bin := append-kernel | tplink-header ArcherC20i -j
-  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC20i -j | append-metadata
+  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC20i -j -s | append-metadata
   IMAGES += factory.bin
   DEVICE_TITLE := TP-Link ArcherC20i
 endef
@@ -50,7 +50,7 @@ define Device/ArcherC50
   KERNEL := $(KERNEL_DTB)
   KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherC50 -c
   IMAGE/factory.bin := append-kernel | tplink-header ArcherC50 -j
-  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j | append-metadata
+  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherC50 -j -s | append-metadata
   IMAGES += factory.bin
   DEVICE_TITLE := TP-Link ArcherC50
 endef
@@ -61,7 +61,7 @@ define Device/ArcherMR200
   SUPPORTED_DEVICES := mr200
   KERNEL := $(KERNEL_DTB)
   KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-header ArcherMR200 -c
-  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherMR200 -j | append-metadata
+  IMAGE/sysupgrade.bin := append-kernel | tplink-header ArcherMR200 -j -s | append-metadata
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb
   DEVICE_TITLE := TP-Link ArcherMR200
 endef


From lede-commits at lists.infradead.org  Thu Oct  5 12:15:45 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:15:45 -0400
Subject: [source]  cmake: fix build error with Xcode 9 on macOS 12
In-Reply-To: <20171005191542.8874.27004@git-01.infra.lede-project.org>
References: <20171005191542.8874.27004@git-01.infra.lede-project.org>
Message-ID: <mailman.52919.1507230968.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/90805b16b6d17dff861d456edf829858386ec559

commit 90805b16b6d17dff861d456edf829858386ec559
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Oct 5 20:44:52 2017 +0200

    cmake: fix build error with Xcode 9 on macOS 12
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 tools/cmake/patches/010-backport-macos-fix.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/cmake/patches/010-backport-macos-fix.patch b/tools/cmake/patches/010-backport-macos-fix.patch
new file mode 100644
index 0000000..76e92dc
--- /dev/null
+++ b/tools/cmake/patches/010-backport-macos-fix.patch
@@ -0,0 +1,15 @@
+--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx
++++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx
+@@ -265,6 +265,12 @@ int main()
+ #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#if defined(__APPLE__)
++#include <AvailabilityMacros.h>
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
++#error "utimensat not available on macOS < 10.13"
++#endif
++#endif
+ int main()
+ {
+   struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };


From lede-commits at lists.infradead.org  Thu Oct  5 12:15:44 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:15:44 -0400
Subject: [source]  gcc: fix build error with macOS + Xcode 9
In-Reply-To: <20171005191542.8874.27004@git-01.infra.lede-project.org>
References: <20171005191542.8874.27004@git-01.infra.lede-project.org>
Message-ID: <mailman.52920.1507230968.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/07a99a83f21ac6d23ec26affdd032424aff6a6e9

commit 07a99a83f21ac6d23ec26affdd032424aff6a6e9
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Oct 5 19:46:48 2017 +0200

    gcc: fix build error with macOS + Xcode 9
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../gcc/patches/5.4.0/030-macos-header-fix-backport.patch      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/toolchain/gcc/patches/5.4.0/030-macos-header-fix-backport.patch b/toolchain/gcc/patches/5.4.0/030-macos-header-fix-backport.patch
new file mode 100644
index 0000000..37c774e
--- /dev/null
+++ b/toolchain/gcc/patches/5.4.0/030-macos-header-fix-backport.patch
@@ -0,0 +1,10 @@
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -216,6 +216,7 @@ extern int errno;
+ 
+ #ifdef __cplusplus
+ # include <algorithm>
++# include <map>
+ # include <cstring>
+ # include <utility>
+ #endif


From lede-commits at lists.infradead.org  Thu Oct  5 12:15:42 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:15:42 -0400
Subject: [source]  x86: fix reboot on apu2 boards
In-Reply-To: <20171005191542.8874.27004@git-01.infra.lede-project.org>
References: <20171005191542.8874.27004@git-01.infra.lede-project.org>
Message-ID: <mailman.52921.1507230970.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/20f365d70f3d219fe808532fe5892ecb134dbc73

commit 20f365d70f3d219fe808532fe5892ecb134dbc73
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Sep 29 00:01:08 2017 +0200

    x86: fix reboot on apu2 boards
    
    PC Engines apu2 needs to use the PCI reboot method, otherwise it can
    hang.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../x86/patches-4.9/200-pcengines-apu2-reboot.patch   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
new file mode 100644
index 0000000..f4f4860
--- /dev/null
+++ b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch
@@ -0,0 +1,19 @@
+--- a/arch/x86/kernel/reboot.c
++++ b/arch/x86/kernel/reboot.c
+@@ -443,6 +443,16 @@ static struct dmi_system_id __initdata r
+ 		},
+ 	},
+ 
++	/* PC Engines */
++	{	/* Handle problems with rebooting on PC Engines apu2 */
++		.callback = set_pci_reboot,
++		.ident = "PC Engines apu2",
++		.matches = {
++			DMI_MATCH(DMI_BOARD_VENDOR, "PC Engines"),
++			DMI_MATCH(DMI_BOARD_NAME, "apu2"),
++		},
++	},
++
+ 	/* Sony */
+ 	{	/* Handle problems with rebooting on Sony VGN-Z540N */
+ 		.callback = set_bios_reboot,


From lede-commits at lists.infradead.org  Thu Oct  5 12:15:43 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:15:43 -0400
Subject: [source] build: add a darwin sitefile to deal with macOS 10.12 +
 Xcode 9 build errors
In-Reply-To: <20171005191542.8874.27004@git-01.infra.lede-project.org>
References: <20171005191542.8874.27004@git-01.infra.lede-project.org>
Message-ID: <mailman.52922.1507230973.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/603900ef820d20d96a10032160bf6c67203b33e6

commit 603900ef820d20d96a10032160bf6c67203b33e6
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Oct 5 19:45:44 2017 +0200

    build: add a darwin sitefile to deal with macOS 10.12 + Xcode 9 build errors
    
    Certain functions are available in system headers, but only work on
    macOS 10.13
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/host-build.mk | 5 +++++
 include/site/darwin   | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/include/host-build.mk b/include/host-build.mk
index dc70373..113e269 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -78,6 +78,10 @@ HOST_MAKE_FLAGS =
 
 HOST_CONFIGURE_CMD = $(BASH) ./configure
 
+ifeq ($(HOST_OS),Darwin)
+  HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin
+endif
+
 define Host/Configure/Default
 	$(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \
 		if [ -x configure ]; then \
@@ -128,6 +132,7 @@ define Host/Exports/Default
   $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
   $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
   $(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache
+  $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
   $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
 endef
 Host/Exports=$(Host/Exports/Default)
diff --git a/include/site/darwin b/include/site/darwin
new file mode 100644
index 0000000..ec38f67
--- /dev/null
+++ b/include/site/darwin
@@ -0,0 +1,2 @@
+ac_cv_func_futimens=no
+ac_cv_func_utimensat=no


From lede-commits at lists.infradead.org  Thu Oct  5 12:58:35 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:58:35 -0400
Subject: [source]  gcc: fix build error with macOS + Xcode 9
In-Reply-To: <20171005195834.20955.91890@git-01.infra.lede-project.org>
References: <20171005195834.20955.91890@git-01.infra.lede-project.org>
Message-ID: <mailman.52935.1507233547.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/a999f91ca3f9cf0ec57de2dc62d7a77ea45822c2

commit a999f91ca3f9cf0ec57de2dc62d7a77ea45822c2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Oct 5 19:46:48 2017 +0200

    gcc: fix build error with macOS + Xcode 9
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../gcc/patches/5.4.0/030-macos-header-fix-backport.patch      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/toolchain/gcc/patches/5.4.0/030-macos-header-fix-backport.patch b/toolchain/gcc/patches/5.4.0/030-macos-header-fix-backport.patch
new file mode 100644
index 0000000..37c774e
--- /dev/null
+++ b/toolchain/gcc/patches/5.4.0/030-macos-header-fix-backport.patch
@@ -0,0 +1,10 @@
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -216,6 +216,7 @@ extern int errno;
+ 
+ #ifdef __cplusplus
+ # include <algorithm>
++# include <map>
+ # include <cstring>
+ # include <utility>
+ #endif


From lede-commits at lists.infradead.org  Thu Oct  5 12:58:36 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:58:36 -0400
Subject: [source]  cmake: fix build error with Xcode 9 on macOS 12
In-Reply-To: <20171005195834.20955.91890@git-01.infra.lede-project.org>
References: <20171005195834.20955.91890@git-01.infra.lede-project.org>
Message-ID: <mailman.52936.1507233548.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/067221360e87fe7bd66b194feb8a080a9dbdf17c

commit 067221360e87fe7bd66b194feb8a080a9dbdf17c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Oct 5 20:44:52 2017 +0200

    cmake: fix build error with Xcode 9 on macOS 12
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 tools/cmake/patches/010-backport-macos-fix.patch | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/cmake/patches/010-backport-macos-fix.patch b/tools/cmake/patches/010-backport-macos-fix.patch
new file mode 100644
index 0000000..76e92dc
--- /dev/null
+++ b/tools/cmake/patches/010-backport-macos-fix.patch
@@ -0,0 +1,15 @@
+--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx
++++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx
+@@ -265,6 +265,12 @@ int main()
+ #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#if defined(__APPLE__)
++#include <AvailabilityMacros.h>
++#if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
++#error "utimensat not available on macOS < 10.13"
++#endif
++#endif
+ int main()
+ {
+   struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };


From lede-commits at lists.infradead.org  Thu Oct  5 12:58:34 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:58:34 -0400
Subject: [source] build: add a darwin sitefile to deal with macOS 10.12 +
 Xcode 9 build errors
In-Reply-To: <20171005195834.20955.91890@git-01.infra.lede-project.org>
References: <20171005195834.20955.91890@git-01.infra.lede-project.org>
Message-ID: <mailman.52937.1507233556.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/2ce9c84a9233946ca229429d053fcd289b1d1342

commit 2ce9c84a9233946ca229429d053fcd289b1d1342
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Oct 5 19:45:44 2017 +0200

    build: add a darwin sitefile to deal with macOS 10.12 + Xcode 9 build errors
    
    Certain functions are available in system headers, but only work on
    macOS 10.13
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/host-build.mk | 5 +++++
 include/site/darwin   | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/include/host-build.mk b/include/host-build.mk
index 70bf6e5..b5f1a6b 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -77,6 +77,10 @@ HOST_MAKE_FLAGS =
 
 HOST_CONFIGURE_CMD = $(BASH) ./configure
 
+ifeq ($(HOST_OS),Darwin)
+  HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin
+endif
+
 define Host/Configure/Default
 	$(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \
 		if [ -x configure ]; then \
@@ -127,6 +131,7 @@ define Host/Exports/Default
   $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
   $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
   $(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache
+  $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
   $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
 endef
 Host/Exports=$(Host/Exports/Default)
diff --git a/include/site/darwin b/include/site/darwin
new file mode 100644
index 0000000..ec38f67
--- /dev/null
+++ b/include/site/darwin
@@ -0,0 +1,2 @@
+ac_cv_func_futimens=no
+ac_cv_func_utimensat=no


From lede-commits at lists.infradead.org  Thu Oct  5 12:58:37 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 05 Oct 2017 15:58:37 -0400
Subject: [source]  toolchain/gdb: update to version 8.0.1
In-Reply-To: <20171005195834.20955.91890@git-01.infra.lede-project.org>
References: <20171005195834.20955.91890@git-01.infra.lede-project.org>
Message-ID: <mailman.52938.1507233556.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/f67c22e0c2431c0e152adc573bbf46a8607779c4

commit f67c22e0c2431c0e152adc573bbf46a8607779c4
Author: Ryan Mounce <ryan at mounce.com.au>
AuthorDate: Sun Aug 6 14:22:18 2017 +0930

    toolchain/gdb: update to version 8.0.1
    
    Fixes CVE-2017-9778.
    
    Signed-off-by: Ryan Mounce <ryan at mounce.com.au>
    [reference fixed CVE]
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 toolchain/gdb/Makefile                                    | 4 ++--
 toolchain/gdb/patches/110-no_testsuite.patch              | 4 ++--
 toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index 8a18d3e..e6c845a 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -17,11 +17,11 @@ PKG_HASH:=6a91f86cc487c1548d3f5d4f29f7226d2019c0db8a63633aeabd5914a340f3f9
 GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION)
 PATCH_DIR:=./patches-arc
 else
-PKG_VERSION:=7.12.1
+PKG_VERSION:=8.0.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/gdb
-PKG_HASH:=4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186
+PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3
 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION)
 endif
 
diff --git a/toolchain/gdb/patches/110-no_testsuite.patch b/toolchain/gdb/patches/110-no_testsuite.patch
index 68d1c90..e86ba6d 100644
--- a/toolchain/gdb/patches/110-no_testsuite.patch
+++ b/toolchain/gdb/patches/110-no_testsuite.patch
@@ -1,6 +1,6 @@
 --- a/gdb/configure
 +++ b/gdb/configure
-@@ -874,8 +874,7 @@ MAKEINFOFLAGS
+@@ -869,8 +869,7 @@ MAKEINFOFLAGS
  YACC
  YFLAGS
  XMKMF'
@@ -10,7 +10,7 @@
  multi-ice
  gdbserver'
  
-@@ -5617,7 +5616,7 @@ $as_echo "$with_auto_load_safe_path" >&6
+@@ -6473,7 +6472,7 @@ $as_echo "$with_auto_load_safe_path" >&6
  
  
  
diff --git a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch
index 562902c..9ce91a0 100644
--- a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch
+++ b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch
@@ -1,6 +1,6 @@
 --- a/gdb/gdbserver/configure
 +++ b/gdb/gdbserver/configure
-@@ -2476,7 +2476,7 @@ $as_echo "$as_me: error: \`$ac_var' was
+@@ -2469,7 +2469,7 @@ $as_echo "$as_me: error: \`$ac_var' was 
        ac_cache_corrupted=: ;;
      ,);;
      *)


From lede-commits at lists.infradead.org  Thu Oct  5 23:28:54 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 06 Oct 2017 02:28:54 -0400
Subject: [source]  build: add mktplinkfw2 hardcoded values to makefile
In-Reply-To: <20171006062854.28084.75959@git-01.infra.lede-project.org>
References: <20171006062854.28084.75959@git-01.infra.lede-project.org>
Message-ID: <mailman.52969.1507271495.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/254061ee97b9511f0d8981e3ea43406119e35ce4

commit 254061ee97b9511f0d8981e3ea43406119e35ce4
Author: Thibaut VAR?NE <hacks at slashdirt.org>
AuthorDate: Tue Oct 3 12:46:09 2017 +0200

    build: add mktplinkfw2 hardcoded values to makefile
    
    This patch adds all the board-specific values currently hardcoded
    in mktplinkfw2.c back to the respective device declarations in the
    makefiles.
    
    The rationale is to avoid modifying the source code every time a
    new board or board variant is added.
    
    Signed-off-by: Thibaut VAR?NE <hacks at slashdirt.org>
---
 include/image-commands.mk            | 11 ++++++++---
 target/linux/lantiq/image/tp-link.mk | 15 ++++++++++++---
 target/linux/ramips/image/mt7620.mk  | 31 +++++++++++++++++++++----------
 target/linux/ramips/image/mt76x8.mk  | 16 +++++++++++-----
 4 files changed, 52 insertions(+), 21 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index acf25d6..4fe8c0f 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -249,14 +249,19 @@ endef
 
 define Build/tplink-v2-header
 	$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
-		-c -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) -k $@ -o $@.new
+		-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
+		-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
+		-T $(TPLINK_HVERSION) -V "ver. 2.0" \
+		-k $@ -o $@.new $(1)
 	@mv $@.new $@
 endef
 
 define Build/tplink-v2-image
 	$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
-		-a 0x4 -j -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) \
-		-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new
+		-H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
+		-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
+		-T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \
+		-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1)
 	cat $@.new >> $@
 	rm -rf $@.new
 endef
diff --git a/target/linux/lantiq/image/tp-link.mk b/target/linux/lantiq/image/tp-link.mk
index 9761841..5bbc18a 100644
--- a/target/linux/lantiq/image/tp-link.mk
+++ b/target/linux/lantiq/image/tp-link.mk
@@ -1,6 +1,8 @@
-DEVICE_VARS += TPLINK_BOARD_ID
+DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION
 
 define Device/lantiqTpLink
+  TPLINK_HWREVADD := 0
+  TPLINK_HVERSION := 2
   KERNEL := kernel-bin | append-dtb | lzma
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | \
 	tplink-v2-header -s -V "ver. 1.0"
@@ -12,7 +14,9 @@ endef
 define Device/TDW8970
   $(Device/lantiqTpLink)
   DEVICE_PROFILE := TDW8970
-  TPLINK_BOARD_ID := TD-W8970v1
+  TPLINK_FLASHLAYOUT := 8Mltq
+  TPLINK_HWID := 0x89700001
+  TPLINK_HWREV := 1
   IMAGE_SIZE := 7680k
   DEVICE_TITLE := TP-LINK TD-W8970
   DEVICE_PACKAGES:= kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport
@@ -21,7 +25,9 @@ endef
 define Device/TDW8980
   $(Device/lantiqTpLink)
   DEVICE_PROFILE := TDW8980
-  TPLINK_BOARD_ID := TD-W8980v1
+  TPLINK_FLASHLAYOUT := 8Mltq
+  TPLINK_HWID := 0x89800001
+  TPLINK_HWREV := 14
   IMAGE_SIZE := 7680k
   DEVICE_TITLE := TP-LINK TD-W8980
   DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport
@@ -31,6 +37,9 @@ define Device/VR200v
   $(Device/lantiqTpLink)
   DEVICE_PROFILE := VR200v
   TPLINK_BOARD_ID := ArcherVR200V
+  TPLINK_FLASHLAYOUT := 16Mltq
+  TPLINK_HWID := 0x73b70801
+  TPLINK_HWREV := 0x2f
   IMAGE_SIZE := 15808k
   DEVICE_TITLE := TP-LINK Archer VR200v
   DEVICE_PACKAGES:= kmod-usb-dwc2 kmod-usb-ledtrig-usbport
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index f964b3e..8a7eaf4 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -2,7 +2,7 @@
 # MT7620A Profiles
 #
 
-DEVICE_VARS += TPLINK_BOARD_ID
+DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION
 
 define Build/elecom-header
 	cp $@ $(KDIR)/v_0.0.0.bin
@@ -26,17 +26,22 @@ endef
 TARGET_DEVICES += ai-br100
 
 define Device/Archer
+  TPLINK_HWREVADD := 0
+  TPLINK_HVERSION := 3
   KERNEL := $(KERNEL_DTB)
-  KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header
-  IMAGE/factory.bin := tplink-v2-image
-  IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata
+  KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e
+  IMAGE/factory.bin := tplink-v2-image -e
+  IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata
 endef
 
 define Device/ArcherC20
   $(Device/Archer)
   DTS := ArcherC20
   SUPPORTED_DEVICES := c20
-  TPLINK_BOARD_ID := ArcherC20
+  TPLINK_FLASHLAYOUT := 8Mmtk
+  TPLINK_HWID := 0xc2000001
+  TPLINK_HWREV := 0x44
+  TPLINK_HWREVADD := 0x1
   IMAGES += factory.bin
   DEVICE_TITLE := TP-Link ArcherC20
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
@@ -47,7 +52,9 @@ define Device/ArcherC20i
   $(Device/Archer)
   DTS := ArcherC20i
   SUPPORTED_DEVICES := c20i
-  TPLINK_BOARD_ID := ArcherC20i
+  TPLINK_FLASHLAYOUT := 8Mmtk
+  TPLINK_HWID := 0xc2000001
+  TPLINK_HWREV := 58
   IMAGES += factory.bin
   DEVICE_TITLE := TP-Link ArcherC20i
 endef
@@ -57,10 +64,12 @@ define Device/ArcherC50v1
   $(Device/Archer)
   DTS := ArcherC50
   SUPPORTED_DEVICES := c50
-  TPLINK_BOARD_ID := ArcherC50
+  TPLINK_FLASHLAYOUT := 8Mmtk
+  TPLINK_HWID := 0xc7500001
+  TPLINK_HWREV := 69
   IMAGES += factory-us.bin factory-eu.bin
-  IMAGE/factory-us.bin := tplink-v2-image -w 0
-  IMAGE/factory-eu.bin := tplink-v2-image -w 2
+  IMAGE/factory-us.bin := tplink-v2-image -e -w 0
+  IMAGE/factory-eu.bin := tplink-v2-image -e -w 2
   DEVICE_TITLE := TP-Link ArcherC50v1
 endef
 TARGET_DEVICES += ArcherC50v1
@@ -69,7 +78,9 @@ define Device/ArcherMR200
   $(Device/Archer)
   DTS := ArcherMR200
   SUPPORTED_DEVICES := mr200
-  TPLINK_BOARD_ID := ArcherMR200
+  TPLINK_FLASHLAYOUT := 8MLmtk
+  TPLINK_HWID := 0xd7500001
+  TPLINK_HWREV := 0x4a
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem
   DEVICE_TITLE := TP-Link ArcherMR200
 endef
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index f4b3171..db32684 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -2,7 +2,7 @@
 # MT76x8 Profiles
 #
 
-DEVICE_VARS += TPLINK_BOARD_ID
+DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION
 
 define Device/duzun-dm06
   DTS := DUZUN-DM06
@@ -85,12 +85,16 @@ define Device/tl-wr840n-v4
   DTS := TL-WR840NV4
   IMAGE_SIZE := 7808k
   DEVICE_TITLE := TP-Link TL-WR840N v4
-  TPLINK_BOARD_ID := TL-WR840NV4
+  TPLINK_FLASHLAYOUT := 8Mmtk
+  TPLINK_HWID := 0x08400004
+  TPLINK_HWREV := 0x1
+  TPLINK_HWREVADD := 0x4
+  TPLINK_HVERSION := 3
   KERNEL := $(KERNEL_DTB)
   IMAGES += tftp-recovery.bin
-  IMAGE/factory.bin := tplink-v2-image
+  IMAGE/factory.bin := tplink-v2-image -e
   IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin)
-  IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata | \
+  IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \
 	check-size $$$$(IMAGE_SIZE)
 endef
 
@@ -98,7 +102,9 @@ define Device/tl-wr841n-v13
   $(Device/tl-wr840n-v4)
   DTS := TL-WR841NV13
   DEVICE_TITLE := TP-Link TL-WR841N v13
-  TPLINK_BOARD_ID := TL-WR841NV13
+  TPLINK_HWID := 0x08410013
+  TPLINK_HWREV := 0x268
+  TPLINK_HWREVADD := 0x13
 endef
 TARGET_DEVICES += tl-wr840n-v4 tl-wr841n-v13
 


From lede-commits at lists.infradead.org  Thu Oct  5 23:28:55 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 06 Oct 2017 02:28:55 -0400
Subject: [source] tools/firmware-utils: remove hardcoded values from
 mktplinkfw2.c
In-Reply-To: <20171006062854.28084.75959@git-01.infra.lede-project.org>
References: <20171006062854.28084.75959@git-01.infra.lede-project.org>
Message-ID: <mailman.52970.1507271495.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/10832c8e12da66b97c266d493b236ab2c804ea70

commit 10832c8e12da66b97c266d493b236ab2c804ea70
Author: Thibaut VAR?NE <hacks at slashdirt.org>
AuthorDate: Tue Oct 3 12:46:09 2017 +0200

    tools/firmware-utils: remove hardcoded values from mktplinkfw2.c
    
    This patch removes all the hardcoded board-specific values from
    mktplinkfw2.c, and as well as the corresponding support code.
    
    By design, this change also deletes all of the broken matching logic
    that was embedded in mktplinkfw2 and aligns the "inspect" behavior
    with that of mktplinkfw (i.e. print the parsed header content as
    they are without further processing).
    
    Signed-off-by: Thibaut VAR?NE <hacks at slashdirt.org>
---
 tools/firmware-utils/src/mktplinkfw2.c | 185 +++++----------------------------
 1 file changed, 24 insertions(+), 161 deletions(-)

diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index 6ef51db..f1d46bd 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -101,7 +101,6 @@ static uint32_t hdr_ver = 2;
 
 static struct board_info custom_board;
 
-static char *board_id;
 static struct board_info *board;
 static char *layout_id;
 static struct flash_layout *layout;
@@ -169,73 +168,6 @@ static struct flash_layout layouts[] = {
 	}
 };
 
-static struct board_info boards[] = {
-	{
-		.id		= "TD-W8970v1",
-		.hw_id		= 0x89700001,
-		.hw_rev		= 1,
-		.layout_id	= "8Mltq",
-	}, {
-		.id		= "TD-W8980v1",
-		.hw_id		= 0x89800001,
-		.hw_rev		= 14,
-		.layout_id	= "8Mltq",
-	}, {
-		.id		= "ArcherC20",
-		.hw_id		= 0xc2000001,
-		.hw_rev		= 0x44,
-		.hw_ver_add	= 0x1,
-		.layout_id	= "8Mmtk",
-		.hdr_ver	= 3,
-		.flags		= FLAG_LE_KERNEL_LA_EP
-	}, {
-		.id		= "ArcherC20i",
-		.hw_id		= 0xc2000001,
-		.hw_rev		= 58,
-		.layout_id	= "8Mmtk",
-		.hdr_ver	= 3,
-		.flags		= FLAG_LE_KERNEL_LA_EP,
-	}, {
-		.id		= "ArcherVR200V",
-		.hw_id		= 0x73b70801,
-		.hw_rev		= 0x2f,
-		.layout_id	= "16Mltq",
-		.hdr_ver	= 2,
-	}, {
-		.id		= "ArcherC50",
-		.hw_id		= 0xc7500001,
-		.hw_rev		= 69,
-		.layout_id	= "8Mmtk",
-		.hdr_ver	= 3,
-		.flags		= FLAG_LE_KERNEL_LA_EP,
-	}, {
-		.id		= "ArcherMR200",
-		.hw_id		= 0xd7500001,
-		.hw_rev		= 0x4a,
-		.layout_id	= "8MLmtk",
-		.hdr_ver	= 3,
-		.flags		= FLAG_LE_KERNEL_LA_EP,
-	}, {
-		.id		= "TL-WR840NV4",
-		.hw_id		= 0x08400004,
-		.hw_rev		= 0x1,
-		.hw_ver_add	= 0x4,
-		.layout_id	= "8Mmtk",
-		.hdr_ver	= 3,
-		.flags		= FLAG_LE_KERNEL_LA_EP,
-	}, {
-		.id		= "TL-WR841NV13",
-		.hw_id		= 0x08410013,
-		.hw_rev		= 0x268,
-		.hw_ver_add	= 0x13,
-		.layout_id	= "8Mmtk",
-		.hdr_ver	= 3,
-		.flags		= FLAG_LE_KERNEL_LA_EP,
-	}, {
-		/* terminating entry */
-	}
-};
-
 /*
  * Message macros
  */
@@ -256,34 +188,6 @@ static struct board_info boards[] = {
 	fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \
 } while (0)
 
-static struct board_info *find_board(char *id)
-{
-	struct board_info *ret;
-	struct board_info *board;
-
-	ret = NULL;
-	for (board = boards; board->id != NULL; board++){
-		if (strcasecmp(id, board->id) == 0) {
-			ret = board;
-			break;
-		}
-	};
-
-	return ret;
-}
-
-static struct board_info *find_board_by_hwid(uint32_t hw_id)
-{
-	struct board_info *board;
-
-	for (board = boards; board->id != NULL; board++) {
-		if (hw_id == board->hw_id)
-			return board;
-	};
-
-	return NULL;
-}
-
 static struct flash_layout *find_layout(char *id)
 {
 	struct flash_layout *ret;
@@ -309,7 +213,6 @@ static void usage(int status)
 	fprintf(stream,
 "\n"
 "Options:\n"
-"  -B <board>      create image for the board specified with <board>\n"
 "  -c              use combined kernel image\n"
 "  -e              swap endianness in kernel load address and entry point\n"
 "  -E <ep>         overwrite kernel entry point with <ep> (hexval prefixed with 0x)\n"
@@ -406,35 +309,22 @@ static int check_options(void)
 		return -1;
 	}
 
-	if (board_id == NULL && opt_hw_id == NULL) {
-		ERR("either board or hardware id must be specified");
+	if (opt_hw_id == NULL) {
+		ERR("hardware id must be specified");
 		return -1;
 	}
 
-	if (board_id) {
-		board = find_board(board_id);
-		if (board == NULL) {
-			ERR("unknown/unsupported board id \"%s\"", board_id);
-			return -1;
-		}
-		if (layout_id == NULL)
-			layout_id = board->layout_id;
+	board = &custom_board;
 
-		if (board->hdr_ver)
-			hdr_ver = board->hdr_ver;
-	} else {
-		board = &custom_board;
-
-		if (layout_id == NULL) {
-			ERR("flash layout is not specified");
-			return -1;
-		}
+	if (layout_id == NULL) {
+		ERR("flash layout is not specified");
+		return -1;
+	}
 
-		board->hw_id = strtoul(opt_hw_id, NULL, 0);
+	board->hw_id = strtoul(opt_hw_id, NULL, 0);
 
-		board->hw_rev = 1;
-		board->hw_ver_add = 0;
-	}
+	board->hw_rev = 1;
+	board->hw_ver_add = 0;
 
 	if (opt_hw_rev)
 		board->hw_rev = strtoul(opt_hw_rev, NULL, 0);
@@ -799,9 +689,7 @@ static int inspect_fw(void)
 		goto out_free_buf;
 	hdr = (struct fw_header *)buf;
 
-	board = find_board_by_hwid(ntohl(hdr->hw_id));
-	if (!board)
-		board = &custom_board;
+	board = &custom_board;
 
 	if (board->flags & FLAG_LE_KERNEL_LA_EP) {
 		hdr->kernel_la = bswap_32(hdr->kernel_la);
@@ -853,22 +741,12 @@ static int inspect_fw(void)
 
 	inspect_fw_pstr("Firmware version", hdr->fw_version);
 
-	if (board != &custom_board) {
-		layout = find_layout(board->layout_id);
-		inspect_fw_phexpost("Hardware ID",
-		                    ntohl(hdr->hw_id), board->id);
-		inspect_fw_phexexp("Hardware Revision",
-		                   ntohl(hdr->hw_rev), board->hw_rev);
-		inspect_fw_phexexp("Additional HW Version",
-		                   ntohl(hdr->hw_ver_add), board->hw_ver_add);
-	} else {
-		inspect_fw_phexpost("Hardware ID",
-		                    ntohl(hdr->hw_id), "unknown");
-		inspect_fw_phex("Hardware Revision",
-		                ntohl(hdr->hw_rev));
-		inspect_fw_phex("Additional HW Version",
-		                ntohl(hdr->hw_ver_add));
-	}
+	inspect_fw_phexpost("Hardware ID",
+			    ntohl(hdr->hw_id), "unknown");
+	inspect_fw_phex("Hardware Revision",
+			ntohl(hdr->hw_rev));
+	inspect_fw_phex("Additional HW Version",
+			ntohl(hdr->hw_ver_add));
 
 	printf("%-23s: %d.%d.%d-%d.%d\n", "Software version",
 	       hdr->ver_hi, hdr->ver_mid, hdr->ver_lo,
@@ -880,24 +758,12 @@ static int inspect_fw(void)
 	                   ntohl(hdr->kernel_ofs));
 	inspect_fw_phexdec("Kernel data length",
 	                   ntohl(hdr->kernel_len));
-	if (board != &custom_board) {
-		inspect_fw_phexdef("Kernel load address",
-		                   ntohl(hdr->kernel_la),
-		                   layout ? layout->kernel_la : 0xffffffff);
-		inspect_fw_phexdef("Kernel entry point",
-		                   ntohl(hdr->kernel_ep),
-		                   layout ? layout->kernel_ep : 0xffffffff);
-		inspect_fw_phexdecdef("Rootfs data offset",
-		                      ntohl(hdr->rootfs_ofs),
-		                      layout ? layout->rootfs_ofs : 0xffffffff);
-	} else {
-		inspect_fw_phex("Kernel load address",
-		                ntohl(hdr->kernel_la));
-		inspect_fw_phex("Kernel entry point",
-		                ntohl(hdr->kernel_ep));
-		inspect_fw_phexdec("Rootfs data offset",
-		                   ntohl(hdr->rootfs_ofs));
-	}
+	inspect_fw_phex("Kernel load address",
+			ntohl(hdr->kernel_la));
+	inspect_fw_phex("Kernel entry point",
+			ntohl(hdr->kernel_ep));
+	inspect_fw_phexdec("Rootfs data offset",
+			   ntohl(hdr->rootfs_ofs));
 	inspect_fw_phexdec("Rootfs data length",
 	                   ntohl(hdr->rootfs_len));
 	inspect_fw_phexdec("Boot loader data offset",
@@ -962,7 +828,7 @@ int main(int argc, char *argv[])
 	while ( 1 ) {
 		int c;
 
-		c = getopt(argc, argv, "a:B:H:E:F:L:V:N:W:w:ci:k:r:R:o:xhsjv:y:T:e");
+		c = getopt(argc, argv, "a:H:E:F:L:V:N:W:w:ci:k:r:R:o:xhsjv:y:T:e");
 		if (c == -1)
 			break;
 
@@ -970,9 +836,6 @@ int main(int argc, char *argv[])
 		case 'a':
 			sscanf(optarg, "0x%x", &rootfs_align);
 			break;
-		case 'B':
-			board_id = optarg;
-			break;
 		case 'H':
 			opt_hw_id = optarg;
 			break;


From lede-commits at lists.infradead.org  Thu Oct  5 23:28:56 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 06 Oct 2017 02:28:56 -0400
Subject: [source]  tools/firmware-utils: mktplinkfw regroup duplicate code
In-Reply-To: <20171006062854.28084.75959@git-01.infra.lede-project.org>
References: <20171006062854.28084.75959@git-01.infra.lede-project.org>
Message-ID: <mailman.52971.1507271504.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/10324fcb3992cdf40db651ae6ad0b3cda670d81b

commit 10324fcb3992cdf40db651ae6ad0b3cda670d81b
Author: Thibaut VAR?NE <hacks at slashdirt.org>
AuthorDate: Tue Oct 3 18:12:27 2017 +0200

    tools/firmware-utils: mktplinkfw regroup duplicate code
    
    This patch carves out the duplicated code of mktplinfw.c and
    mktplinkfw2.c and moves it to mktplinkfw-lib.c
    
    This change is a semantic NOP (the code is unchanged).
    
    To ensure compatibility with gcc-5.x and newer without changing
    the code, -fgnu89-inline is added to the build flags for these
    two binaries.
    
    Signed-off-by: Thibaut VAR?NE <hacks at slashdirt.org>
---
 tools/firmware-utils/Makefile             |   4 +-
 tools/firmware-utils/src/mktplinkfw-lib.c | 195 +++++++++++++++++++++++
 tools/firmware-utils/src/mktplinkfw-lib.h |  68 ++++++++
 tools/firmware-utils/src/mktplinkfw.c     | 209 +-----------------------
 tools/firmware-utils/src/mktplinkfw2.c    | 254 +-----------------------------
 5 files changed, 276 insertions(+), 454 deletions(-)

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index 4f1f8d7..b7addbb 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -39,8 +39,8 @@ define Host/Compile
 	$(call cc,encode_crc)
 	$(call cc,nand_ecc)
 	$(call cc,mkplanexfw sha1)
-	$(call cc,mktplinkfw md5, -Wall)
-	$(call cc,mktplinkfw2 md5)
+	$(call cc,mktplinkfw mktplinkfw-lib md5, -Wall -fgnu89-inline)
+	$(call cc,mktplinkfw2 mktplinkfw-lib md5, -fgnu89-inline)
 	$(call cc,tplink-safeloader md5, -Wall)
 	$(call cc,pc1crypt)
 	$(call cc,osbridge-crc)
diff --git a/tools/firmware-utils/src/mktplinkfw-lib.c b/tools/firmware-utils/src/mktplinkfw-lib.c
new file mode 100644
index 0000000..838b179
--- /dev/null
+++ b/tools/firmware-utils/src/mktplinkfw-lib.c
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2009 Gabor Juhos <juhosg at openwrt.org>
+ *
+ * This tool was based on:
+ *   TP-Link WR941 V2 firmware checksum fixing tool.
+ *   Copyright (C) 2008,2009 Wang Jian <lark at linux.net.cn>
+ *
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>     /* for unlink() */
+#include <libgen.h>
+#include <getopt.h>     /* for getopt() */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <endian.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+#include "mktplinkfw-lib.h"
+#include "md5.h"
+
+extern char *progname;
+static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde};
+
+struct flash_layout *find_layout(struct flash_layout *layouts, const char *id)
+{
+	struct flash_layout *ret;
+	struct flash_layout *l;
+
+	ret = NULL;
+	for (l = layouts; l->id != NULL; l++){
+		if (strcasecmp(id, l->id) == 0) {
+			ret = l;
+			break;
+		}
+	};
+
+	return ret;
+}
+
+void get_md5(const char *data, int size, uint8_t *md5)
+{
+	MD5_CTX ctx;
+
+	MD5_Init(&ctx);
+	MD5_Update(&ctx, data, size);
+	MD5_Final(md5, &ctx);
+}
+
+int get_file_stat(struct file_info *fdata)
+{
+	struct stat st;
+	int res;
+
+	if (fdata->file_name == NULL)
+		return 0;
+
+	res = stat(fdata->file_name, &st);
+	if (res){
+		ERRS("stat failed on %s", fdata->file_name);
+		return res;
+	}
+
+	fdata->file_size = st.st_size;
+	return 0;
+}
+
+int read_to_buf(const struct file_info *fdata, char *buf)
+{
+	FILE *f;
+	int ret = EXIT_FAILURE;
+
+	f = fopen(fdata->file_name, "r");
+	if (f == NULL) {
+		ERRS("could not open \"%s\" for reading", fdata->file_name);
+		goto out;
+	}
+
+	errno = 0;
+	fread(buf, fdata->file_size, 1, f);
+	if (errno != 0) {
+		ERRS("unable to read from file \"%s\"", fdata->file_name);
+		goto out_close;
+	}
+
+	ret = EXIT_SUCCESS;
+
+out_close:
+	fclose(f);
+out:
+	return ret;
+}
+
+int pad_jffs2(char *buf, int currlen, int maxlen)
+{
+	int len;
+	uint32_t pad_mask;
+
+	len = currlen;
+	pad_mask = (64 * 1024);
+	while ((len < maxlen) && (pad_mask != 0)) {
+		uint32_t mask;
+		int i;
+
+		for (i = 10; i < 32; i++) {
+			mask = 1 << i;
+			if (pad_mask & mask)
+				break;
+		}
+
+		len = ALIGN(len, mask);
+
+		for (i = 10; i < 32; i++) {
+			mask = 1 << i;
+			if ((len & (mask - 1)) == 0)
+				pad_mask &= ~mask;
+		}
+
+		for (i = 0; i < sizeof(jffs2_eof_mark); i++)
+			buf[len + i] = jffs2_eof_mark[i];
+
+		len += sizeof(jffs2_eof_mark);
+	}
+
+	return len;
+}
+
+int write_fw(const char *ofname, const char *data, int len)
+{
+	FILE *f;
+	int ret = EXIT_FAILURE;
+
+	f = fopen(ofname, "w");
+	if (f == NULL) {
+		ERRS("could not open \"%s\" for writing", ofname);
+		goto out;
+	}
+
+	errno = 0;
+	fwrite(data, len, 1, f);
+	if (errno) {
+		ERRS("unable to write output file");
+		goto out_flush;
+	}
+
+	DBG("firmware file \"%s\" completed", ofname);
+
+	ret = EXIT_SUCCESS;
+
+out_flush:
+	fflush(f);
+	fclose(f);
+	if (ret != EXIT_SUCCESS) {
+		unlink(ofname);
+	}
+out:
+	return ret;
+}
+
+/* Helper functions to inspect_fw() representing different output formats */
+inline void inspect_fw_pstr(const char *label, const char *str)
+{
+	printf("%-23s: %s\n", label, str);
+}
+
+inline void inspect_fw_phex(const char *label, uint32_t val)
+{
+	printf("%-23s: 0x%08x\n", label, val);
+}
+
+inline void inspect_fw_phexdec(const char *label, uint32_t val)
+{
+	printf("%-23s: 0x%08x / %8u bytes\n", label, val, val);
+}
+
+inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text)
+{
+	int i;
+
+	printf("%-23s:", label);
+	for (i=0; i<MD5SUM_LEN; i++)
+		printf(" %02x", val[i]);
+	printf(" %s\n", text);
+}
diff --git a/tools/firmware-utils/src/mktplinkfw-lib.h b/tools/firmware-utils/src/mktplinkfw-lib.h
new file mode 100644
index 0000000..38fe065
--- /dev/null
+++ b/tools/firmware-utils/src/mktplinkfw-lib.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2009 Gabor Juhos <juhosg at openwrt.org>
+ *
+ * This tool was based on:
+ *   TP-Link WR941 V2 firmware checksum fixing tool.
+ *   Copyright (C) 2008,2009 Wang Jian <lark at linux.net.cn>
+ *
+ * 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.
+ *
+ */
+
+
+#ifndef mktplinkfw_lib_h
+#define mktplinkfw_lib_h
+
+#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); })
+#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
+
+#define MD5SUM_LEN	16
+
+/*
+ * Message macros
+ */
+#define ERR(fmt, ...) do { \
+	fflush(0); \
+	fprintf(stderr, "[%s] *** error: " fmt "\n", \
+			progname, ## __VA_ARGS__ ); \
+} while (0)
+
+#define ERRS(fmt, ...) do { \
+	int save = errno; \
+	fflush(0); \
+	fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \
+			progname, ## __VA_ARGS__, strerror(save)); \
+} while (0)
+
+#define DBG(fmt, ...) do { \
+	fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \
+} while (0)
+
+
+struct file_info {
+	char		*file_name;	/* name of the file */
+	uint32_t	file_size;	/* length of the file */
+};
+
+struct flash_layout {
+	char		*id;
+	uint32_t	fw_max_len;
+	uint32_t	kernel_la;
+	uint32_t	kernel_ep;
+	uint32_t	rootfs_ofs;
+};
+
+struct flash_layout *find_layout(struct flash_layout *layouts, const char *id);
+void get_md5(const char *data, int size, uint8_t *md5);
+int get_file_stat(struct file_info *fdata);
+int read_to_buf(const struct file_info *fdata, char *buf);
+int pad_jffs2(char *buf, int currlen, int maxlen);
+int write_fw(const char *ofname, const char *data, int len);
+inline void inspect_fw_pstr(const char *label, const char *str);
+inline void inspect_fw_phex(const char *label, uint32_t val);
+inline void inspect_fw_phexdec(const char *label, uint32_t val);
+inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text);
+
+#endif /* mktplinkfw_lib_h */
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index c537862..7dbb290 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -28,20 +28,11 @@
 #include <netinet/in.h>
 
 #include "md5.h"
-
-#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); })
-#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
+#include "mktplinkfw-lib.h"
 
 #define HEADER_VERSION_V1	0x01000000
 #define HEADER_VERSION_V2	0x02000000
 
-#define MD5SUM_LEN	16
-
-struct file_info {
-	char		*file_name;	/* name of the file */
-	uint32_t	file_size;	/* length of the file */
-};
-
 struct fw_header {
 	uint32_t	version;	/* header version */
 	char		vendor_name[24];
@@ -71,14 +62,6 @@ struct fw_header {
 	uint8_t		pad2[160];
 } __attribute__ ((packed));
 
-struct flash_layout {
-	char		*id;
-	uint32_t	fw_max_len;
-	uint32_t	kernel_la;
-	uint32_t	kernel_ep;
-	uint32_t	rootfs_ofs;
-};
-
 struct fw_region {
 	char		name[4];
 	uint32_t	code;
@@ -89,7 +72,7 @@ struct fw_region {
  * Globals
  */
 static char *ofname;
-static char *progname;
+char *progname;
 static char *vendor = "TP-LINK Technologies";
 static char *version = "ver. 1.0";
 static char *fw_ver = "0.0.0";
@@ -118,7 +101,6 @@ static struct file_info boot_info;
 static int combined;
 static int strip_padding;
 static int add_jffs2_eof;
-static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde};
 static uint32_t fw_max_len;
 static uint32_t reserved_space;
 
@@ -190,42 +172,6 @@ static const struct fw_region regions[] = {
 	{"EU", 0},
 };
 
-/*
- * Message macros
- */
-#define ERR(fmt, ...) do { \
-	fflush(0); \
-	fprintf(stderr, "[%s] *** error: " fmt "\n", \
-			progname, ## __VA_ARGS__ ); \
-} while (0)
-
-#define ERRS(fmt, ...) do { \
-	int save = errno; \
-	fflush(0); \
-	fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \
-			progname, ## __VA_ARGS__, strerror(save)); \
-} while (0)
-
-#define DBG(fmt, ...) do { \
-	fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \
-} while (0)
-
-static struct flash_layout *find_layout(const char *id)
-{
-	struct flash_layout *ret;
-	struct flash_layout *l;
-
-	ret = NULL;
-	for (l = layouts; l->id != NULL; l++){
-		if (strcasecmp(id, l->id) == 0) {
-			ret = l;
-			break;
-		}
-	};
-
-	return ret;
-}
-
 static const struct fw_region * find_region(const char *country) {
 	size_t i;
 
@@ -271,59 +217,6 @@ static void usage(int status)
 	exit(status);
 }
 
-static void get_md5(const char *data, int size, uint8_t *md5)
-{
-	MD5_CTX ctx;
-
-	MD5_Init(&ctx);
-	MD5_Update(&ctx, data, size);
-	MD5_Final(md5, &ctx);
-}
-
-static int get_file_stat(struct file_info *fdata)
-{
-	struct stat st;
-	int res;
-
-	if (fdata->file_name == NULL)
-		return 0;
-
-	res = stat(fdata->file_name, &st);
-	if (res){
-		ERRS("stat failed on %s", fdata->file_name);
-		return res;
-	}
-
-	fdata->file_size = st.st_size;
-	return 0;
-}
-
-static int read_to_buf(const struct file_info *fdata, char *buf)
-{
-	FILE *f;
-	int ret = EXIT_FAILURE;
-
-	f = fopen(fdata->file_name, "r");
-	if (f == NULL) {
-		ERRS("could not open \"%s\" for reading", fdata->file_name);
-		goto out;
-	}
-
-	errno = 0;
-	fread(buf, fdata->file_size, 1, f);
-	if (errno != 0) {
-		ERRS("unable to read from file \"%s\"", fdata->file_name);
-		goto out_close;
-	}
-
-	ret = EXIT_SUCCESS;
-
- out_close:
-	fclose(f);
- out:
-	return ret;
-}
-
 static int check_options(void)
 {
 	int ret;
@@ -370,7 +263,7 @@ static int check_options(void)
 			return -1;
 		}
 	} else {
-		layout = find_layout(layout_id);
+		layout = find_layout(layouts, layout_id);
 		if (layout == NULL) {
 			ERR("unknown flash layout \"%s\"", layout_id);
 			return -1;
@@ -515,72 +408,6 @@ static void fill_header(char *buf, int len)
 		get_md5(buf, len, hdr->md5sum1);
 }
 
-static int pad_jffs2(char *buf, int currlen)
-{
-	int len;
-	uint32_t pad_mask;
-
-	len = currlen;
-	pad_mask = (64 * 1024);
-	while ((len < layout->fw_max_len) && (pad_mask != 0)) {
-		uint32_t mask;
-		int i;
-
-		for (i = 10; i < 32; i++) {
-			mask = 1 << i;
-			if (pad_mask & mask)
-				break;
-		}
-
-		len = ALIGN(len, mask);
-
-		for (i = 10; i < 32; i++) {
-			mask = 1 << i;
-			if ((len & (mask - 1)) == 0)
-				pad_mask &= ~mask;
-		}
-
-		for (i = 0; i < sizeof(jffs2_eof_mark); i++)
-			buf[len + i] = jffs2_eof_mark[i];
-
-		len += sizeof(jffs2_eof_mark);
-	}
-
-	return len;
-}
-
-static int write_fw(const char *data, int len)
-{
-	FILE *f;
-	int ret = EXIT_FAILURE;
-
-	f = fopen(ofname, "w");
-	if (f == NULL) {
-		ERRS("could not open \"%s\" for writing", ofname);
-		goto out;
-	}
-
-	errno = 0;
-	fwrite(data, len, 1, f);
-	if (errno) {
-		ERRS("unable to write output file");
-		goto out_flush;
-	}
-
-	DBG("firmware file \"%s\" completed", ofname);
-
-	ret = EXIT_SUCCESS;
-
- out_flush:
-	fflush(f);
-	fclose(f);
-	if (ret != EXIT_SUCCESS) {
-		unlink(ofname);
-	}
- out:
-	return ret;
-}
-
 static int build_fw(void)
 {
 	int buflen;
@@ -625,14 +452,14 @@ static int build_fw(void)
 			writelen = rootfs_ofs + rootfs_info.file_size;
 
 		if (add_jffs2_eof)
-			writelen = pad_jffs2(buf, writelen);
+			writelen = pad_jffs2(buf, writelen, layout->fw_max_len);
 	}
 
 	if (!strip_padding)
 		writelen = buflen;
 
 	fill_header(buf, writelen);
-	ret = write_fw(buf, writelen);
+	ret = write_fw(ofname, buf, writelen);
 	if (ret)
 		goto out_free_buf;
 
@@ -644,32 +471,6 @@ static int build_fw(void)
 	return ret;
 }
 
-/* Helper functions to inspect_fw() representing different output formats */
-static inline void inspect_fw_pstr(const char *label, const char *str)
-{
-	printf("%-23s: %s\n", label, str);
-}
-
-static inline void inspect_fw_phex(const char *label, uint32_t val)
-{
-	printf("%-23s: 0x%08x\n", label, val);
-}
-
-static inline void inspect_fw_phexdec(const char *label, uint32_t val)
-{
-	printf("%-23s: 0x%08x / %8u bytes\n", label, val, val);
-}
-
-static inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text)
-{
-	int i;
-
-	printf("%-23s:", label);
-	for (i=0; i<MD5SUM_LEN; i++)
-		printf(" %02x", val[i]);
-	printf(" %s\n", text);
-}
-
 static int inspect_fw(void)
 {
 	char *buf;
diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index f1d46bd..63dbe8a 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -28,15 +28,7 @@
 #include <netinet/in.h>
 
 #include "md5.h"
-
-#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); })
-
-#define MD5SUM_LEN	16
-
-struct file_info {
-	char		*file_name;	/* name of the file */
-	uint32_t	file_size;	/* length of the file */
-};
+#include "mktplinkfw-lib.h"
 
 struct fw_header {
 	uint32_t	version;			/* 0x00: header version */
@@ -68,14 +60,6 @@ struct fw_header {
 	uint8_t		pad[364];
 } __attribute__ ((packed));
 
-struct flash_layout {
-	char		*id;
-	uint32_t	fw_max_len;
-	uint32_t	kernel_la;
-	uint32_t	kernel_ep;
-	uint32_t	rootfs_ofs;
-};
-
 #define FLAG_LE_KERNEL_LA_EP			0x00000001	/* Little-endian used for kernel load address & entry point */
 
 struct board_info {
@@ -92,7 +76,7 @@ struct board_info {
  * Globals
  */
 static char *ofname;
-static char *progname;
+char *progname;
 static char *vendor = "TP-LINK Technologies";
 static char *version = "ver. 1.0";
 static char *fw_ver = "0.0.0";
@@ -123,7 +107,6 @@ static struct file_info boot_info;
 static int combined;
 static int strip_padding;
 static int add_jffs2_eof;
-static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde};
 
 static struct file_info inspect_info;
 static int extract = 0;
@@ -168,42 +151,6 @@ static struct flash_layout layouts[] = {
 	}
 };
 
-/*
- * Message macros
- */
-#define ERR(fmt, ...) do { \
-	fflush(0); \
-	fprintf(stderr, "[%s] *** error: " fmt "\n", \
-			progname, ## __VA_ARGS__ ); \
-} while (0)
-
-#define ERRS(fmt, ...) do { \
-	int save = errno; \
-	fflush(0); \
-	fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \
-			progname, ## __VA_ARGS__, strerror(save)); \
-} while (0)
-
-#define DBG(fmt, ...) do { \
-	fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \
-} while (0)
-
-static struct flash_layout *find_layout(char *id)
-{
-	struct flash_layout *ret;
-	struct flash_layout *l;
-
-	ret = NULL;
-	for (l = layouts; l->id != NULL; l++){
-		if (strcasecmp(id, l->id) == 0) {
-			ret = l;
-			break;
-		}
-	};
-
-	return ret;
-}
-
 static void usage(int status)
 {
 	FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
@@ -241,59 +188,6 @@ static void usage(int status)
 	exit(status);
 }
 
-static int get_md5(char *data, int size, char *md5)
-{
-	MD5_CTX ctx;
-
-	MD5_Init(&ctx);
-	MD5_Update(&ctx, data, size);
-	MD5_Final(md5, &ctx);
-}
-
-static int get_file_stat(struct file_info *fdata)
-{
-	struct stat st;
-	int res;
-
-	if (fdata->file_name == NULL)
-		return 0;
-
-	res = stat(fdata->file_name, &st);
-	if (res){
-		ERRS("stat failed on %s", fdata->file_name);
-		return res;
-	}
-
-	fdata->file_size = st.st_size;
-	return 0;
-}
-
-static int read_to_buf(struct file_info *fdata, char *buf)
-{
-	FILE *f;
-	int ret = EXIT_FAILURE;
-
-	f = fopen(fdata->file_name, "r");
-	if (f == NULL) {
-		ERRS("could not open \"%s\" for reading", fdata->file_name);
-		goto out;
-	}
-
-	errno = 0;
-	fread(buf, fdata->file_size, 1, f);
-	if (errno != 0) {
-		ERRS("unable to read from file \"%s\"", fdata->file_name);
-		goto out_close;
-	}
-
-	ret = EXIT_SUCCESS;
-
- out_close:
-	fclose(f);
- out:
-	return ret;
-}
-
 static int check_options(void)
 {
 	int ret;
@@ -331,7 +225,7 @@ static int check_options(void)
 	if (opt_hw_ver_add)
 		board->hw_ver_add = strtoul(opt_hw_ver_add, NULL, 0);
 
-	layout = find_layout(layout_id);
+	layout = find_layout(layouts, layout_id);
 	if (layout == NULL) {
 		ERR("unknown flash layout \"%s\"", layout_id);
 		return -1;
@@ -480,72 +374,6 @@ static void fill_header(char *buf, int len)
 	get_md5(buf, len, hdr->md5sum1);
 }
 
-static int pad_jffs2(char *buf, int currlen)
-{
-	int len;
-	uint32_t pad_mask;
-
-	len = currlen;
-	pad_mask = (64 * 1024);
-	while ((len < layout->fw_max_len) && (pad_mask != 0)) {
-		uint32_t mask;
-		int i;
-
-		for (i = 10; i < 32; i++) {
-			mask = 1 << i;
-			if (pad_mask & mask)
-				break;
-		}
-
-		len = ALIGN(len, mask);
-
-		for (i = 10; i < 32; i++) {
-			mask = 1 << i;
-			if ((len & (mask - 1)) == 0)
-				pad_mask &= ~mask;
-		}
-
-		for (i = 0; i < sizeof(jffs2_eof_mark); i++)
-			buf[len + i] = jffs2_eof_mark[i];
-
-		len += sizeof(jffs2_eof_mark);
-	}
-
-	return len;
-}
-
-static int write_fw(char *data, int len)
-{
-	FILE *f;
-	int ret = EXIT_FAILURE;
-
-	f = fopen(ofname, "w");
-	if (f == NULL) {
-		ERRS("could not open \"%s\" for writing", ofname);
-		goto out;
-	}
-
-	errno = 0;
-	fwrite(data, len, 1, f);
-	if (errno) {
-		ERRS("unable to write output file");
-		goto out_flush;
-	}
-
-	DBG("firmware file \"%s\" completed", ofname);
-
-	ret = EXIT_SUCCESS;
-
- out_flush:
-	fflush(f);
-	fclose(f);
-	if (ret != EXIT_SUCCESS) {
-		unlink(ofname);
-	}
- out:
-	return ret;
-}
-
 static int build_fw(void)
 {
 	int buflen;
@@ -586,14 +414,14 @@ static int build_fw(void)
 			writelen = rootfs_ofs + rootfs_info.file_size;
 
 		if (add_jffs2_eof)
-			writelen = pad_jffs2(buf, writelen);
+			writelen = pad_jffs2(buf, writelen, layout->fw_max_len);
 	}
 
 	if (!strip_padding)
 		writelen = buflen;
 
 	fill_header(buf, writelen);
-	ret = write_fw(buf, writelen);
+	ret = write_fw(ofname, buf, writelen);
 	if (ret)
 		goto out_free_buf;
 
@@ -605,71 +433,6 @@ static int build_fw(void)
 	return ret;
 }
 
-/* Helper functions to inspect_fw() representing different output formats */
-static inline void inspect_fw_pstr(char *label, char *str)
-{
-	printf("%-23s: %s\n", label, str);
-}
-
-static inline void inspect_fw_phex(char *label, uint32_t val)
-{
-	printf("%-23s: 0x%08x\n", label, val);
-}
-
-static inline void inspect_fw_phexpost(char *label,
-                                       uint32_t val, char *post)
-{
-	printf("%-23s: 0x%08x (%s)\n", label, val, post);
-}
-
-static inline void inspect_fw_phexdef(char *label,
-                                      uint32_t val, uint32_t defval)
-{
-	printf("%-23s: 0x%08x                  ", label, val);
-
-	if (val == defval)
-		printf("(== OpenWrt default)\n");
-	else
-		printf("(OpenWrt default: 0x%08x)\n", defval);
-}
-
-static inline void inspect_fw_phexexp(char *label,
-                                      uint32_t val, uint32_t expval)
-{
-	printf("%-23s: 0x%08x ", label, val);
-
-	if (val == expval)
-		printf("(ok)\n");
-	else
-		printf("(expected: 0x%08x)\n", expval);
-}
-
-static inline void inspect_fw_phexdec(char *label, uint32_t val)
-{
-	printf("%-23s: 0x%08x / %8u bytes\n", label, val, val);
-}
-
-static inline void inspect_fw_phexdecdef(char *label,
-                                         uint32_t val, uint32_t defval)
-{
-	printf("%-23s: 0x%08x / %8u bytes ", label, val, val);
-
-	if (val == defval)
-		printf("(== OpenWrt default)\n");
-	else
-		printf("(OpenWrt default: 0x%08x)\n", defval);
-}
-
-static inline void inspect_fw_pmd5sum(char *label, uint8_t *val, char *text)
-{
-	int i;
-
-	printf("%-23s:", label);
-	for (i=0; i<MD5SUM_LEN; i++)
-		printf(" %02x", val[i]);
-	printf(" %s\n", text);
-}
-
 static int inspect_fw(void)
 {
 	char *buf;
@@ -740,9 +503,7 @@ static int inspect_fw(void)
 	printf("\n");
 
 	inspect_fw_pstr("Firmware version", hdr->fw_version);
-
-	inspect_fw_phexpost("Hardware ID",
-			    ntohl(hdr->hw_id), "unknown");
+	inspect_fw_phex("Hardware ID", ntohl(hdr->hw_id));
 	inspect_fw_phex("Hardware Revision",
 			ntohl(hdr->hw_rev));
 	inspect_fw_phex("Additional HW Version",
@@ -819,9 +580,6 @@ static int inspect_fw(void)
 int main(int argc, char *argv[])
 {
 	int ret = EXIT_FAILURE;
-	int err;
-
-	FILE *outfile;
 
 	progname = basename(argv[0]);
 


From lede-commits at lists.infradead.org  Thu Oct  5 23:28:57 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 06 Oct 2017 02:28:57 -0400
Subject: [source]  tools/firmware-utils: mktplinkfw move build_fw() to lib
In-Reply-To: <20171006062854.28084.75959@git-01.infra.lede-project.org>
References: <20171006062854.28084.75959@git-01.infra.lede-project.org>
Message-ID: <mailman.52974.1507271504.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/9e768b9aac2367057fc8d6b7d07ea456b5433b9d

commit 9e768b9aac2367057fc8d6b7d07ea456b5433b9d
Author: Thibaut VAR?NE <hacks at slashdirt.org>
AuthorDate: Tue Oct 3 20:19:52 2017 +0200

    tools/firmware-utils: mktplinkfw move build_fw() to lib
    
    This patch moves build_fw() to mktplinkfw-lib.c
    
    The versions of mktplinkfw.c and mktplinkfw2.c had slight
    differences in code flow, the version from mktplinkfw.c has been
    preferred.
    
    While it's expected that this change will not affect mktplinkfw2,
    all use cases could not be tested and so this particular change
    is committed separately.
    
    Signed-off-by: Thibaut VAR?NE <hacks at slashdirt.org>
---
 tools/firmware-utils/src/mktplinkfw-lib.c | 78 ++++++++++++++++++++++++++-
 tools/firmware-utils/src/mktplinkfw-lib.h |  2 +-
 tools/firmware-utils/src/mktplinkfw.c     | 87 +++++--------------------------
 tools/firmware-utils/src/mktplinkfw2.c    | 83 +++++------------------------
 4 files changed, 102 insertions(+), 148 deletions(-)

diff --git a/tools/firmware-utils/src/mktplinkfw-lib.c b/tools/firmware-utils/src/mktplinkfw-lib.c
index 838b179..18da13d 100644
--- a/tools/firmware-utils/src/mktplinkfw-lib.c
+++ b/tools/firmware-utils/src/mktplinkfw-lib.c
@@ -30,9 +30,22 @@
 #include "mktplinkfw-lib.h"
 #include "md5.h"
 
+extern char *ofname;
 extern char *progname;
+extern uint32_t kernel_len;
+extern struct file_info kernel_info;
+extern struct file_info rootfs_info;
+extern struct flash_layout *layout;
+extern uint32_t rootfs_ofs;
+extern uint32_t rootfs_align;
+extern int combined;
+extern int strip_padding;
+extern int add_jffs2_eof;
+
 static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde};
 
+void fill_header(char *buf, int len);
+
 struct flash_layout *find_layout(struct flash_layout *layouts, const char *id)
 {
 	struct flash_layout *ret;
@@ -102,7 +115,7 @@ out:
 	return ret;
 }
 
-int pad_jffs2(char *buf, int currlen, int maxlen)
+static int pad_jffs2(char *buf, int currlen, int maxlen)
 {
 	int len;
 	uint32_t pad_mask;
@@ -193,3 +206,66 @@ inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char
 		printf(" %02x", val[i]);
 	printf(" %s\n", text);
 }
+
+// header_size = sizeof(struct fw_header)
+int build_fw(size_t header_size)
+{
+	int buflen;
+	char *buf;
+	char *p;
+	int ret = EXIT_FAILURE;
+	int writelen = 0;
+
+	writelen = header_size + kernel_len;
+
+	if (combined)
+		buflen = writelen;
+	else
+		buflen = layout->fw_max_len;
+
+	buf = malloc(buflen);
+	if (!buf) {
+		ERR("no memory for buffer\n");
+		goto out;
+	}
+
+	memset(buf, 0xff, buflen);
+	p = buf + header_size;
+	ret = read_to_buf(&kernel_info, p);
+	if (ret)
+		goto out_free_buf;
+
+	if (!combined) {
+		if (rootfs_align)
+			p = buf + writelen;
+		else
+			p = buf + rootfs_ofs;
+
+		ret = read_to_buf(&rootfs_info, p);
+		if (ret)
+			goto out_free_buf;
+
+		if (rootfs_align)
+			writelen += rootfs_info.file_size;
+		else
+			writelen = rootfs_ofs + rootfs_info.file_size;
+
+		if (add_jffs2_eof)
+			writelen = pad_jffs2(buf, writelen, layout->fw_max_len);
+	}
+
+	if (!strip_padding)
+		writelen = buflen;
+
+	fill_header(buf, writelen);
+	ret = write_fw(ofname, buf, writelen);
+	if (ret)
+		goto out_free_buf;
+
+	ret = EXIT_SUCCESS;
+
+out_free_buf:
+	free(buf);
+out:
+	return ret;
+}
diff --git a/tools/firmware-utils/src/mktplinkfw-lib.h b/tools/firmware-utils/src/mktplinkfw-lib.h
index 38fe065..31e6d0b 100644
--- a/tools/firmware-utils/src/mktplinkfw-lib.h
+++ b/tools/firmware-utils/src/mktplinkfw-lib.h
@@ -58,11 +58,11 @@ struct flash_layout *find_layout(struct flash_layout *layouts, const char *id);
 void get_md5(const char *data, int size, uint8_t *md5);
 int get_file_stat(struct file_info *fdata);
 int read_to_buf(const struct file_info *fdata, char *buf);
-int pad_jffs2(char *buf, int currlen, int maxlen);
 int write_fw(const char *ofname, const char *data, int len);
 inline void inspect_fw_pstr(const char *label, const char *str);
 inline void inspect_fw_phex(const char *label, uint32_t val);
 inline void inspect_fw_phexdec(const char *label, uint32_t val);
 inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text);
+int build_fw(size_t header_size);
 
 #endif /* mktplinkfw_lib_h */
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 7dbb290..9bc112f 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -71,7 +71,7 @@ struct fw_region {
 /*
  * Globals
  */
-static char *ofname;
+char *ofname;
 char *progname;
 static char *vendor = "TP-LINK Technologies";
 static char *version = "ver. 1.0";
@@ -79,7 +79,7 @@ static char *fw_ver = "0.0.0";
 static uint32_t hdr_ver = HEADER_VERSION_V1;
 
 static char *layout_id;
-static struct flash_layout *layout;
+struct flash_layout *layout;
 static char *opt_hw_id;
 static uint32_t hw_id;
 static char *opt_hw_rev;
@@ -90,17 +90,17 @@ static const struct fw_region *region;
 static int fw_ver_lo;
 static int fw_ver_mid;
 static int fw_ver_hi;
-static struct file_info kernel_info;
+struct file_info kernel_info;
 static uint32_t kernel_la = 0;
 static uint32_t kernel_ep = 0;
-static uint32_t kernel_len = 0;
-static struct file_info rootfs_info;
-static uint32_t rootfs_ofs = 0;
-static uint32_t rootfs_align;
+uint32_t kernel_len = 0;
+struct file_info rootfs_info;
+uint32_t rootfs_ofs = 0;
+uint32_t rootfs_align;
 static struct file_info boot_info;
-static int combined;
-static int strip_padding;
-static int add_jffs2_eof;
+int combined;
+int strip_padding;
+int add_jffs2_eof;
 static uint32_t fw_max_len;
 static uint32_t reserved_space;
 
@@ -355,7 +355,7 @@ static int check_options(void)
 	return 0;
 }
 
-static void fill_header(char *buf, int len)
+void fill_header(char *buf, int len)
 {
 	struct fw_header *hdr = (struct fw_header *)buf;
 
@@ -408,69 +408,6 @@ static void fill_header(char *buf, int len)
 		get_md5(buf, len, hdr->md5sum1);
 }
 
-static int build_fw(void)
-{
-	int buflen;
-	char *buf;
-	char *p;
-	int ret = EXIT_FAILURE;
-	int writelen = 0;
-
-	writelen = sizeof(struct fw_header) + kernel_len;
-
-	if (combined)
-		buflen = writelen;
-	else
-		buflen = layout->fw_max_len;
-
-	buf = malloc(buflen);
-	if (!buf) {
-		ERR("no memory for buffer\n");
-		goto out;
-	}
-
-	memset(buf, 0xff, buflen);
-	p = buf + sizeof(struct fw_header);
-	ret = read_to_buf(&kernel_info, p);
-	if (ret)
-		goto out_free_buf;
-
-
-	if (!combined) {
-		if (rootfs_align)
-			p = buf + writelen;
-		else
-			p = buf + rootfs_ofs;
-
-		ret = read_to_buf(&rootfs_info, p);
-		if (ret)
-			goto out_free_buf;
-
-		if (rootfs_align)
-			writelen += rootfs_info.file_size;
-		else
-			writelen = rootfs_ofs + rootfs_info.file_size;
-
-		if (add_jffs2_eof)
-			writelen = pad_jffs2(buf, writelen, layout->fw_max_len);
-	}
-
-	if (!strip_padding)
-		writelen = buflen;
-
-	fill_header(buf, writelen);
-	ret = write_fw(ofname, buf, writelen);
-	if (ret)
-		goto out_free_buf;
-
-	ret = EXIT_SUCCESS;
-
- out_free_buf:
-	free(buf);
- out:
-	return ret;
-}
-
 static int inspect_fw(void)
 {
 	char *buf;
@@ -686,7 +623,7 @@ int main(int argc, char *argv[])
 		goto out;
 
 	if (!inspect_info.file_name)
-		ret = build_fw();
+		ret = build_fw(sizeof(struct fw_header));
 	else
 		ret = inspect_fw();
 
diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index 63dbe8a..892c93f 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -75,7 +75,7 @@ struct board_info {
 /*
  * Globals
  */
-static char *ofname;
+char *ofname;
 char *progname;
 static char *vendor = "TP-LINK Technologies";
 static char *version = "ver. 1.0";
@@ -87,7 +87,7 @@ static struct board_info custom_board;
 
 static struct board_info *board;
 static char *layout_id;
-static struct flash_layout *layout;
+struct flash_layout *layout;
 static char *opt_hw_id;
 static char *opt_hw_rev;
 static char *opt_hw_ver_add;
@@ -96,17 +96,17 @@ static int fw_ver_mid;
 static int fw_ver_hi;
 static int sver_lo;
 static int sver_hi;
-static struct file_info kernel_info;
+struct file_info kernel_info;
 static uint32_t kernel_la = 0;
 static uint32_t kernel_ep = 0;
-static uint32_t kernel_len = 0;
-static struct file_info rootfs_info;
-static uint32_t rootfs_ofs = 0;
-static uint32_t rootfs_align;
+uint32_t kernel_len = 0;
+struct file_info rootfs_info;
+uint32_t rootfs_ofs = 0;
+uint32_t rootfs_align;
 static struct file_info boot_info;
-static int combined;
-static int strip_padding;
-static int add_jffs2_eof;
+int combined;
+int strip_padding;
+int add_jffs2_eof;
 
 static struct file_info inspect_info;
 static int extract = 0;
@@ -312,7 +312,7 @@ static int check_options(void)
 	return 0;
 }
 
-static void fill_header(char *buf, int len)
+void fill_header(char *buf, int len)
 {
 	struct fw_header *hdr = (struct fw_header *)buf;
 	unsigned ver_len;
@@ -374,65 +374,6 @@ static void fill_header(char *buf, int len)
 	get_md5(buf, len, hdr->md5sum1);
 }
 
-static int build_fw(void)
-{
-	int buflen;
-	char *buf;
-	char *p;
-	int ret = EXIT_FAILURE;
-	int writelen = 0;
-
-	buflen = layout->fw_max_len;
-
-	buf = malloc(buflen);
-	if (!buf) {
-		ERR("no memory for buffer\n");
-		goto out;
-	}
-
-	memset(buf, 0xff, buflen);
-	p = buf + sizeof(struct fw_header);
-	ret = read_to_buf(&kernel_info, p);
-	if (ret)
-		goto out_free_buf;
-
-	writelen = sizeof(struct fw_header) + kernel_len;
-
-	if (!combined) {
-		if (rootfs_align)
-			p = buf + writelen;
-		else
-			p = buf + rootfs_ofs;
-
-		ret = read_to_buf(&rootfs_info, p);
-		if (ret)
-			goto out_free_buf;
-
-		if (rootfs_align)
-			writelen += rootfs_info.file_size;
-		else
-			writelen = rootfs_ofs + rootfs_info.file_size;
-
-		if (add_jffs2_eof)
-			writelen = pad_jffs2(buf, writelen, layout->fw_max_len);
-	}
-
-	if (!strip_padding)
-		writelen = buflen;
-
-	fill_header(buf, writelen);
-	ret = write_fw(ofname, buf, writelen);
-	if (ret)
-		goto out_free_buf;
-
-	ret = EXIT_SUCCESS;
-
- out_free_buf:
-	free(buf);
- out:
-	return ret;
-}
-
 static int inspect_fw(void)
 {
 	char *buf;
@@ -671,7 +612,7 @@ int main(int argc, char *argv[])
 		goto out;
 
 	if (!inspect_info.file_name)
-		ret = build_fw();
+		ret = build_fw(sizeof(struct fw_header));
 	else
 		ret = inspect_fw();
 


From lede-commits at lists.infradead.org  Fri Oct  6 00:40:27 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 06 Oct 2017 03:40:27 -0400
Subject: [source]  dropbear: fix PKG_CONFIG_DEPENDS
In-Reply-To: <20171006074027.9459.36611@git-01.infra.lede-project.org>
References: <20171006074027.9459.36611@git-01.infra.lede-project.org>
Message-ID: <mailman.52996.1507275650.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/834c93e00bee4f7253a5c64d1a9c8202b1082b1a

commit 834c93e00bee4f7253a5c64d1a9c8202b1082b1a
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Fri Oct 6 09:21:35 2017 +0200

    dropbear: fix PKG_CONFIG_DEPENDS
    
    Add CONFIG_DROPBEAR_UTMP, CONFIG_DROPBEAR_PUTUTLINE to PKG_CONFIG_DEPENDS
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/dropbear/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index 29460ed..2db2f81 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -23,7 +23,10 @@ PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
 
-PKG_CONFIG_DEPENDS:=CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB
+PKG_CONFIG_DEPENDS:= \
+	CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC \
+	CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \
+	CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE
 
 include $(INCLUDE_DIR)/package.mk
 


From lede-commits at lists.infradead.org  Fri Oct  6 13:12:55 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 06 Oct 2017 16:12:55 -0400
Subject: [source]  netifd: update to latest git HEAD version (FS#1030)
In-Reply-To: <20171006201255.18466.20169@git-01.infra.lede-project.org>
References: <20171006201255.18466.20169@git-01.infra.lede-project.org>
Message-ID: <mailman.53123.1507320928.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/bd27331eeaf6cd1db9ad5b44c4f0f10f03b7911f

commit bd27331eeaf6cd1db9ad5b44c4f0f10f03b7911f
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Fri Oct 6 22:05:57 2017 +0200

    netifd: update to latest git HEAD version (FS#1030)
    
    5df3f01 config: suppress error if no wireless config present (FS#1030)
    3429bd8 system-linux: add support for hotplug event 'move'
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/config/netifd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 2efbaf8..eff8417 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2017-08-27
-PKG_SOURCE_VERSION:=7d94ede3c38dd7b8e08c8a2fd8ae5ede71a2059b
-PKG_MIRROR_HASH:=967e993cdb49ddc6d6add23fa8ccbf2af798fdca6708e7937496baa4c2653957
+PKG_SOURCE_DATE:=2017-10-06
+PKG_SOURCE_VERSION:=5df3f01a06b2710a8d8010f353db45b7507b15fb
+PKG_MIRROR_HASH:=d628047714693a689835a9db0c3d63173a3d5cdb8d8a2e75991b399431ea9f69
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Sat Oct  7 00:19:01 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 03:19:01 -0400
Subject: [source]  ar71xx: rework chipidea usb controller patch
In-Reply-To: <20171007071901.26824.79413@git-01.infra.lede-project.org>
References: <20171007071901.26824.79413@git-01.infra.lede-project.org>
Message-ID: <mailman.53142.1507360903.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/00ea16557da754a769d6f7909a85baa3ad387f0a

commit 00ea16557da754a769d6f7909a85baa3ad387f0a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Aug 3 12:43:49 2017 +0100

    ar71xx: rework chipidea usb controller patch
    
    Handle AR9344 as well. Disable the EHCI platform device when device mode
    is active, to avoid resource conflicts.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 .../920-usb-chipidea-AR933x-platform-support.patch | 57 +++++++++++++++++-----
 1 file changed, 44 insertions(+), 13 deletions(-)

diff --git a/target/linux/ar71xx/patches-4.4/920-usb-chipidea-AR933x-platform-support.patch b/target/linux/ar71xx/patches-4.4/920-usb-chipidea-AR933x-platform-support.patch
index 1a78af0..740ffec 100644
--- a/target/linux/ar71xx/patches-4.4/920-usb-chipidea-AR933x-platform-support.patch
+++ b/target/linux/ar71xx/patches-4.4/920-usb-chipidea-AR933x-platform-support.patch
@@ -29,7 +29,7 @@
  
  #include <asm/mach-ath79/ath79.h>
  #include <asm/mach-ath79/ar71xx_regs.h>
-@@ -170,6 +173,51 @@ static void __init ar913x_usb_setup(void
+@@ -170,6 +173,67 @@ static void __init ar913x_usb_setup(void
  			   &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
  }
  
@@ -46,22 +46,29 @@
 +	iounmap(usb_ctrl_base);
 +}
 +
-+static void __init ar933x_ci_usb_setup(void)
++static void __init ar9xxx_ci_usb_setup(void)
 +{
 +	struct ci_hdrc_platform_data ci_pdata;
 +	enum usb_dr_mode dr_mode;
-+	u32 bootstrap;
++	bool host_mode = true;
 +
-+	bootstrap = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
-+	if (bootstrap & AR933X_BOOTSTRAP_USB_MODE_HOST) {
++	if (soc_is_ar933x())
++		host_mode = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP) &
++			    AR933X_BOOTSTRAP_USB_MODE_HOST;
++	else if (soc_is_ar934x() || soc_is_qca955x())
++		host_mode = !(ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP) &
++			      AR934X_BOOTSTRAP_USB_MODE_DEVICE);
++
++	if (host_mode) {
 +		dr_mode = USB_DR_MODE_HOST;
 +	} else {
 +		dr_mode = USB_DR_MODE_PERIPHERAL;
-+		ar933x_usb_setup_ctrl_config();
++		if (soc_is_ar933x())
++			ar933x_usb_setup_ctrl_config();
 +	}
 +
 +	memset(&ci_pdata, 0, sizeof(ci_pdata));
-+	ci_pdata.name = "ci_hdrc_ar933x";
++	ci_pdata.name = "ci_hdrc_ar9xxx";
 +	ci_pdata.capoffset = DEF_CAPOFFSET;
 +	ci_pdata.dr_mode = dr_mode;
 +	ci_pdata.flags = CI_HDRC_DUAL_ROLE_NOT_OTG | CI_HDRC_DP_ALWAYS_PULLUP;
@@ -76,17 +83,41 @@
 +			   AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
 +			   ATH79_CPU_IRQ(3),
 +			   &ci_pdata, sizeof(ci_pdata));
++
++	if (!host_mode)
++		return;
++
++	ath79_usb_register("ehci-platform", -1,
++			   AR934X_EHCI_BASE, AR934X_EHCI_SIZE,
++			   ATH79_CPU_IRQ(3),
++			   &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
++
 +}
 +
  static void __init ar933x_usb_setup(void)
  {
  	ath79_device_reset_set(AR933X_RESET_USBSUS_OVERRIDE);
-@@ -185,6 +233,8 @@ static void __init ar933x_usb_setup(void
- 			   AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
- 			   ATH79_CPU_IRQ(3),
- 			   &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
-+
-+	ar933x_ci_usb_setup();
+@@ -181,10 +245,7 @@ static void __init ar933x_usb_setup(void
+ 	ath79_device_reset_clear(AR933X_RESET_USB_PHY);
+ 	mdelay(10);
+ 
+-	ath79_usb_register("ehci-platform", -1,
+-			   AR933X_EHCI_BASE, AR933X_EHCI_SIZE,
+-			   ATH79_CPU_IRQ(3),
+-			   &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
++	ar9xxx_ci_usb_setup();
  }
  
  static void enable_tx_tx_idp_violation_fix(unsigned base)
+@@ -230,10 +291,7 @@ static void __init ar934x_usb_setup(void
+ 	if (ath79_soc_rev >= 3)
+ 		ath79_ehci_pdata_v2.reset_notifier = ar934x_usb_reset_notifier;
+ 
+-	ath79_usb_register("ehci-platform", -1,
+-			   AR934X_EHCI_BASE, AR934X_EHCI_SIZE,
+-			   ATH79_CPU_IRQ(3),
+-			   &ath79_ehci_pdata_v2, sizeof(ath79_ehci_pdata_v2));
++	ar9xxx_ci_usb_setup();
+ }
+ 
+ static void __init qca953x_usb_setup(void)


From lede-commits at lists.infradead.org  Sat Oct  7 00:21:00 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 03:21:00 -0400
Subject: [source]  ar71xx: ew-dorin target moved from legacy to generic
In-Reply-To: <20171007072100.27114.77252@git-01.infra.lede-project.org>
References: <20171007072100.27114.77252@git-01.infra.lede-project.org>
Message-ID: <mailman.53143.1507361020.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/cd4b60c329646cd8daa6f2a38f1be1ce8d208656

commit cd4b60c329646cd8daa6f2a38f1be1ce8d208656
Author: Catrinel Catrinescu <cc at 80211.de>
AuthorDate: Wed Jul 19 11:44:57 2017 +0200

    ar71xx: ew-dorin target moved from legacy to generic
    
    Embedded Wireless Dorin platform moved from legacy to generic
    
    Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
---
 target/linux/ar71xx/image/generic.mk        | 20 ++++++++++++++++++++
 target/linux/ar71xx/image/legacy-devices.mk | 18 ------------------
 target/linux/ar71xx/image/legacy.mk         |  5 -----
 3 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 3352d15..6f5a701 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -229,6 +229,26 @@ define Device/dragino2
 endef
 TARGET_DEVICES += dragino2
 
+define Device/ew-dorin
+  DEVICE_TITLE := Embedded Wireless Dorin Platform
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea 
+  BOARDNAME = EW-DORIN
+  CONSOLE := ttyATH0,115200
+  IMAGE_SIZE = 16000k
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-dorin
+
+define Device/ew-dorin-router
+  DEVICE_TITLE := Embedded Wireless Dorin Router Platform
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea 
+  BOARDNAME = EW-DORIN-ROUTER
+  CONSOLE := ttyATH0,115200
+  IMAGE_SIZE = 16000k
+  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-dorin-router
+
 define Device/weio
   DEVICE_TITLE := WeIO
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2
diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk
index 7723024..e418282 100644
--- a/target/linux/ar71xx/image/legacy-devices.mk
+++ b/target/linux/ar71xx/image/legacy-devices.mk
@@ -132,24 +132,6 @@ define LegacyDevice/DB120
 endef
 LEGACY_DEVICES += DB120
 
-define LegacyDevice/EWDORINAP
-  DEVICE_TITLE := Embedded Wireless Dorin Platform (4MB flash)
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage
-endef
-LEGACY_DEVICES += EWDORINAP
-
-define LegacyDevice/EWDORINRT
-  DEVICE_TITLE := Embedded Wireless Dorin Router
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage
-endef
-LEGACY_DEVICES += EWDORINRT
-
-define LegacyDevice/EWDORIN16M
-  DEVICE_TITLE := Embedded Wireless Dorin Platform (16MB flash)
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage
-endef
-LEGACY_DEVICES += EWDORIN16M
-
 define LegacyDevice/HORNETUBx2
   DEVICE_TITLE := ALFA Network Hornet-UB-x2 board (16MB flash, 64MB ram)
   DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk
index b400e5d..701116b 100644
--- a/target/linux/ar71xx/image/legacy.mk
+++ b/target/linux/ar71xx/image/legacy.mk
@@ -258,8 +258,6 @@ cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmw
 esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
 esr1750_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
 epg5000_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
-ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)ro
-ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
 f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k at 0x50000(firmware)
 dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k at 0x7f0000(caldata_copy)
 dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k at 0x660000(caldata_orig),6208k at 0x50000(firmware_orig)
@@ -897,9 +895,6 @@ $(eval $(call SingleProfile,AthLzma,64k,AP152_16M,ap152-16M,AP152,ttyS0,115200,$
 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
-$(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
-$(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
-$(eval $(call SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
 $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))


From lede-commits at lists.infradead.org  Sat Oct  7 00:21:01 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 03:21:01 -0400
Subject: [source] ar71xx: update LED definitions for embedded wireless dorin
In-Reply-To: <20171007072100.27114.77252@git-01.infra.lede-project.org>
References: <20171007072100.27114.77252@git-01.infra.lede-project.org>
Message-ID: <mailman.53144.1507361042.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/b9c31c44d719c7749c058aaa13b9c1503e9968f0

commit b9c31c44d719c7749c058aaa13b9c1503e9968f0
Author: Catrinel Catrinescu <cc at 80211.de>
AuthorDate: Wed Jul 19 15:21:33 2017 +0200

    ar71xx: update LED definitions for embedded wireless dorin
    
    Evaluation board 2.2 uses a different status LED pin
    The other removed LEDs were never present
    
    Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c   | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c
index e686b5f..575a976 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c
@@ -2,7 +2,7 @@
  *  EW Dorin board support
  *  (based on Atheros Ref. Design AP121)
  *  Copyright (C) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
- *  Copyright (C) 2012-2015 Embedded Wireless GmbH    www.80211.de
+ *  Copyright (C) 2012-2017 Embedded Wireless GmbH    www.80211.de
  *
  *  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
@@ -27,25 +27,13 @@
 #define DORIN_CALDATA_OFFSET		0x1000
 #define DORIN_WMAC_MAC_OFFSET		0x1002
 
-#define DORIN_GPIO_LED_21		21
-#define DORIN_GPIO_LED_22		22
-#define DORIN_GPIO_LED_STATUS	23
+#define DORIN_GPIO_LED_STATUS		21
 
 #define DORIN_GPIO_BTN_JUMPSTART	11
 #define DORIN_GPIO_BTN_RESET		6
 
 static struct gpio_led dorin_leds_gpio[] __initdata = {
 	{
-		.name		= "dorin:green:led21",
-		.gpio		= DORIN_GPIO_LED_21,
-		.active_low	= 1,
-	},
-	{
-		.name		= "dorin:green:led22",
-		.gpio		= DORIN_GPIO_LED_22,
-		.active_low	= 1,
-	},
-	{
 		.name		= "dorin:green:status",
 		.gpio		= DORIN_GPIO_LED_STATUS,
 		.active_low	= 1,


From lede-commits at lists.infradead.org  Sat Oct  7 06:00:39 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 09:00:39 -0400
Subject: [source]  rbcfg: Implement CPU frequency control
In-Reply-To: <20171007130039.1710.11160@git-01.infra.lede-project.org>
References: <20171007130039.1710.11160@git-01.infra.lede-project.org>
Message-ID: <mailman.53151.1507381276.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/2be307c99852dc859730b531e9b1cc2f9776234b

commit 2be307c99852dc859730b531e9b1cc2f9776234b
Author: Thibaut VARENE <hacks at slashdirt.org>
AuthorDate: Sat Feb 25 17:34:50 2017 +0100

    rbcfg: Implement CPU frequency control
    
    This patch implements CPU frequency control as found on several
    routerboard devices.
    
    Supported SoCs:
    - QCA953X
    - AR9344
    
    Tested on hAP lite and mAP lite (QCA953x): steps of 50MHz
    Tested on LHG 5 (AR9344): steps of 50MHz
    
    On unsupported hardware, this patch is a NOP: it will not alter the
    new field.
    "rbcfg help" will display an empty "cpu_freq" help listing.
    "rbcfg show" will not show the cpu_freq field.
    "rbcfg set/get cpu_freq" will return an error code.
    
    Signed-off-by: Thibaut VARENE <hacks at slashdirt.org>
    [adjusted subject]
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/boot/rbcfg/Makefile    |   2 +-
 package/boot/rbcfg/src/main.c  | 133 ++++++++++++++++++++++++++++++++++++++++-
 package/boot/rbcfg/src/rbcfg.h |   8 +++
 3 files changed, 139 insertions(+), 4 deletions(-)

diff --git a/package/boot/rbcfg/Makefile b/package/boot/rbcfg/Makefile
index 412f7ab..9d9b975 100644
--- a/package/boot/rbcfg/Makefile
+++ b/package/boot/rbcfg/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rbcfg
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/package/boot/rbcfg/src/main.c b/package/boot/rbcfg/src/main.c
index 9aedcc5..2acbfbd 100644
--- a/package/boot/rbcfg/src/main.c
+++ b/package/boot/rbcfg/src/main.c
@@ -2,6 +2,7 @@
  *  RouterBOOT configuration utility
  *
  *  Copyright (C) 2010 Gabor Juhos <juhosg at openwrt.org>
+ *  Copyright (C) 2017 Thibaut VARENE <varenet at parisc-linux.org>
  *
  *  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
@@ -29,6 +30,7 @@
 #define RB_ERR_INVALID		2
 #define RB_ERR_NOMEM		3
 #define RB_ERR_IO		4
+#define RB_ERR_NOTWANTED	5
 
 #define ARRAY_SIZE(_a)	(sizeof((_a)) / sizeof((_a)[0]))
 
@@ -67,6 +69,11 @@ struct rbcfg_command {
 	int		(*exec)(int argc, const char *argv[]);
 };
 
+struct rbcfg_soc {
+	const char	*needle;
+	const int	type;
+};
+
 static void usage(void);
 
 /* Globals */
@@ -135,12 +142,32 @@ static const struct rbcfg_value rbcfg_cpu_mode[] = {
 		RB_CPU_MODE_REGULAR),
 };
 
+static const struct rbcfg_value rbcfg_cpu_freq_dummy[] = {
+};
+
+static const struct rbcfg_value rbcfg_cpu_freq_qca953x[] = {
+	CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2),
+	CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1),
+	CFG_U32("0", "Factory", RB_CPU_FREQ_N0),
+	CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1),
+	CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2),
+};
+
+static const struct rbcfg_value rbcfg_cpu_freq_ar9344[] = {
+	CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2),
+	CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1),
+	CFG_U32("0", "Factory", RB_CPU_FREQ_N0),
+	CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1),
+	CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2),
+	CFG_U32("+3", "+150MHz", RB_CPU_FREQ_H3),
+};
+
 static const struct rbcfg_value rbcfg_booter[] = {
 	CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR),
 	CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP),
 };
 
-static const struct rbcfg_env rbcfg_envs[] = {
+static struct rbcfg_env rbcfg_envs[] = {
 	{
 		.name		= "boot_delay",
 		.id		= RB_ID_BOOT_DELAY,
@@ -178,6 +205,12 @@ static const struct rbcfg_env rbcfg_envs[] = {
 		.values		= rbcfg_cpu_mode,
 		.num_values	= ARRAY_SIZE(rbcfg_cpu_mode),
 	}, {
+		.name		= "cpu_freq",
+		.id		= RB_ID_CPU_FREQ,
+		.type		= RBCFG_ENV_TYPE_U32,
+		.values		= rbcfg_cpu_freq_dummy,
+		.num_values	= ARRAY_SIZE(rbcfg_cpu_freq_dummy),
+	}, {
 		.name		= "uart_speed",
 		.id		= RB_ID_UART_SPEED,
 		.type		= RBCFG_ENV_TYPE_U32,
@@ -240,8 +273,10 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len,
 		buf += 2;
 		buflen -= 2;
 
-		if (id == RB_ID_TERMINATOR)
+		if (id == RB_ID_TERMINATOR) {
+			ret = RB_ERR_NOTWANTED;
 			break;
+		}
 
 		if (buflen < len)
 			break;
@@ -257,7 +292,7 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len,
 		buflen -= len;
 	}
 
-	if (ret)
+	if (RB_ERR_NOTFOUND == ret)
 		fprintf(stderr, "no tag found with id=%u\n", tag_id);
 
 	return ret;
@@ -748,6 +783,96 @@ usage(void)
 	fprintf(stderr, "\n");
 }
 
+#define RBCFG_SOC_UNKNOWN	0
+#define RBCFG_SOC_QCA953X	1
+#define RBCFG_SOC_AR9344	2
+
+static const struct rbcfg_soc rbcfg_socs[] = {
+	{
+		.needle = "QCA953",
+		.type = RBCFG_SOC_QCA953X,
+	}, {
+		.needle = "AR9344",
+		.type = RBCFG_SOC_AR9344,
+	},
+};
+
+#define CPUINFO_BUFSIZE		128	/* lines of interest are < 80 chars */
+
+static int cpuinfo_find_soc(void)
+{
+	FILE *fp;
+	char temp[CPUINFO_BUFSIZE];
+	char *haystack, *needle;
+	int i, found = 0, soc_type = RBCFG_SOC_UNKNOWN;
+
+	fp = fopen("/proc/cpuinfo", "r");
+	if (!fp)
+		goto end;
+
+	/* first, extract the system type line */
+	needle = "system type";
+	while(fgets(temp, CPUINFO_BUFSIZE, fp)) {
+		if (!strncmp(temp, needle, strlen(needle))) {
+			found = 1;
+			break;
+		}
+	}
+
+	fclose(fp);
+
+	/* failsafe in case cpuinfo format changes */
+	if (!found)
+		goto end;
+
+	/* skip the field header */
+	haystack = strchr(temp, ':');
+
+	/* then, try to identify known SoC, stop at first match */
+	for (i = 0; i < ARRAY_SIZE(rbcfg_socs); i++) {
+		if ((strstr(haystack, rbcfg_socs[i].needle))) {
+			soc_type = rbcfg_socs[i].type;
+			break;
+		}
+	}
+
+end:
+	return soc_type;
+}
+
+static void fixup_rbcfg_envs(void)
+{
+	int i, num_val, soc_type;
+	const struct rbcfg_value * env_value;
+
+	/* detect SoC */
+	soc_type = cpuinfo_find_soc();
+
+	/* update rbcfg_envs */
+	switch (soc_type) {
+		case RBCFG_SOC_QCA953X:
+			env_value = rbcfg_cpu_freq_qca953x;
+			num_val = ARRAY_SIZE(rbcfg_cpu_freq_qca953x);
+			break;
+		case RBCFG_SOC_AR9344:
+			env_value = rbcfg_cpu_freq_ar9344;
+			num_val = ARRAY_SIZE(rbcfg_cpu_freq_ar9344);
+			break;
+	}
+
+	for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) {
+		if (RB_ID_CPU_FREQ == rbcfg_envs[i].id) {
+			if (RBCFG_SOC_UNKNOWN == soc_type)
+				rbcfg_envs[i].id = RB_ID_TERMINATOR;
+			else {
+				rbcfg_envs[i].values = env_value;
+				rbcfg_envs[i].num_values = num_val;
+			}
+			break;
+		}
+	}
+}
+
 int main(int argc, const char *argv[])
 {
 	const struct rbcfg_command *cmd = NULL;
@@ -756,6 +881,8 @@ int main(int argc, const char *argv[])
 
 	rbcfg_name = (char *) argv[0];
 
+	fixup_rbcfg_envs();
+
 	if (argc < 2) {
 		usage();
 		return EXIT_FAILURE;
diff --git a/package/boot/rbcfg/src/rbcfg.h b/package/boot/rbcfg/src/rbcfg.h
index 864bc82..88acc13 100644
--- a/package/boot/rbcfg/src/rbcfg.h
+++ b/package/boot/rbcfg/src/rbcfg.h
@@ -32,6 +32,7 @@
 #define RB_ID_BOOT_PROTOCOL	9
 #define RB_ID_SOFT_10		10
 #define RB_ID_SOFT_11		11
+#define RB_ID_CPU_FREQ		12
 #define RB_ID_BOOTER		13
 
 #define RB_UART_SPEED_115200	0
@@ -71,6 +72,13 @@
 #define RB_BOOT_PROTOCOL_BOOTP	0
 #define RB_BOOT_PROTOCOL_DHCP	1
 
+#define RB_CPU_FREQ_L2		(0 << 3)
+#define RB_CPU_FREQ_L1		(1 << 3)
+#define RB_CPU_FREQ_N0		(2 << 3)
+#define RB_CPU_FREQ_H1		(3 << 3)
+#define RB_CPU_FREQ_H2		(4 << 3)
+#define RB_CPU_FREQ_H3		(5 << 3)
+
 #define RB_BOOTER_REGULAR	0
 #define RB_BOOTER_BACKUP	1
 


From lede-commits at lists.infradead.org  Sat Oct  7 10:18:09 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 13:18:09 -0400
Subject: [source]  nghttp2: add libnghttp2 package
In-Reply-To: <20171007171809.5076.29393@git-01.infra.lede-project.org>
References: <20171007171809.5076.29393@git-01.infra.lede-project.org>
Message-ID: <mailman.53167.1507396720.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/0e265dc0c704bced105980f1bee2a95827a29f25

commit 0e265dc0c704bced105980f1bee2a95827a29f25
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Fri Oct 6 10:53:50 2017 +0200

    nghttp2: add libnghttp2 package
    
    The nghttp2 library is an implementation of the Hypertext Transfer
    Protocol version 2 in C; it supports RFC7540 and RFC7541.
    The package enables only the reusable C library; binary size is 130K (X86)
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/libs/nghttp2/Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile
new file mode 100644
index 0000000..0a21d12
--- /dev/null
+++ b/package/libs/nghttp2/Makefile
@@ -0,0 +1,47 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nghttp2
+PKG_VERSION:=1.26.0
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=0389af5724010627e19425237e9e5e0bf343bc6f
+PKG_SOURCE_DIR:=$(PKG_NAME)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=e7d6d6239cb5a6957b9aafe22a15ea01fafefdf472eff84ec959bb31c5023f79
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libnghttp2
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library implementing the framing layer of HTTP/2
+  MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
+endef
+
+define Package/libnghttp2/description
+ C library implementing the framing layer of the HTTP/2 protocol. It can be used to build a HTTP/2-capable HTTP client or server
+endef
+
+CMAKE_OPTIONS += \
+        -DENABLE_LIB_ONLY=ON
+
+define Build/InstallDev
+	$(INSTALL_DIR) $(1)/usr/include/nghttp2
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/nghttp2/*.h $(1)/usr/include/nghttp2/
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib/
+endef
+
+define Package/libnghttp2/install
+	$(INSTALL_DIR) $(1)/usr/lib
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libnghttp2))


From lede-commits at lists.infradead.org  Sat Oct  7 10:18:10 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 13:18:10 -0400
Subject: [source]  curl: add nghttp2 support
In-Reply-To: <20171007171809.5076.29393@git-01.infra.lede-project.org>
References: <20171007171809.5076.29393@git-01.infra.lede-project.org>
Message-ID: <mailman.53168.1507396726.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/778970735bb5ef6727d381f85a03873ec1ca3998

commit 778970735bb5ef6727d381f85a03873ec1ca3998
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Fri Oct 6 10:53:51 2017 +0200

    curl: add nghttp2 support
    
    Add config option support for nghttp2
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/utils/curl/Config.in | 4 ++++
 package/network/utils/curl/Makefile  | 7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/curl/Config.in b/package/network/utils/curl/Config.in
index 6f72134..973da3d 100644
--- a/package/network/utils/curl/Config.in
+++ b/package/network/utils/curl/Config.in
@@ -101,6 +101,10 @@ config LIBCURL_TFTP
 	bool "TFTP protocol"
 	default n
 
+config LIBCURL_NGHTTP2
+	bool "HTTP2 protocol"
+	default n
+
 comment "Miscellaneous"
 
 config LIBCURL_PROXY
diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile
index 330d8d5..634da04 100644
--- a/package/network/utils/curl/Makefile
+++ b/package/network/utils/curl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=curl
 PKG_VERSION:=7.55.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \
@@ -53,6 +53,7 @@ PKG_CONFIG_DEPENDS:= \
   CONFIG_LIBCURL_SMTP \
   CONFIG_LIBCURL_TELNET \
   CONFIG_LIBCURL_TFTP \
+  CONFIG_LIBCURL_NGHTTP2 \
   \
   CONFIG_LIBCURL_COOKIES \
   CONFIG_LIBCURL_CRYPTO_AUTH \
@@ -85,7 +86,8 @@ define Package/libcurl
   SECTION:=libs
   CATEGORY:=Libraries
   DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls
-  DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2
+  DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn
+  DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2
   TITLE:=A client-side URL transfer library
   MENU:=1
 endef
@@ -119,6 +121,7 @@ CONFIGURE_ARGS += \
 	$(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
 	$(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
 	$(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
+	$(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \
 	\
 	$(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \
 	$(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \


From lede-commits at lists.infradead.org  Sat Oct  7 10:55:11 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 13:55:11 -0400
Subject: [source]  kernel: update 4.4 to 4.4.90
In-Reply-To: <20171007175511.16072.65009@git-01.infra.lede-project.org>
References: <20171007175511.16072.65009@git-01.infra.lede-project.org>
Message-ID: <mailman.53169.1507398946.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/ae2a8a3b9b0b68ea7f3c8178531bc213612655d9

commit ae2a8a3b9b0b68ea7f3c8178531bc213612655d9
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Thu Oct 5 17:50:48 2017 +0100

    kernel: update 4.4 to 4.4.90
    
    No patch refresh required.
    
    Compile & run tested: ar71xx Archer C7 v2
    
    Fixes the following CVEs:
    - CVE-2017-1000252
    - CVE-2017-12153
    - CVE-2017-12154
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
    [reference fixed CVEs]
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 include/kernel-version.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 3d32017..bf38d86 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,11 +3,11 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
-LINUX_VERSION-4.4 = .89
+LINUX_VERSION-4.4 = .90
 LINUX_VERSION-4.9 = .52
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
-LINUX_KERNEL_HASH-4.4.89 = a81d1b1306e4fddee5d6f7219090a616073b02f4069e44522a9c0454b17f2b67
+LINUX_KERNEL_HASH-4.4.90 = 6826ccd213ac79bbfd47e63912e89ef7ec70324b7aa3684a4d4560fc2b436331
 LINUX_KERNEL_HASH-4.9.52 = ffdd034f1bf32fa41d1a66a347388c0dc4c3cff6f578a1e29d88b20fbae1048a
 
 ifdef KERNEL_PATCHVER


From lede-commits at lists.infradead.org  Sat Oct  7 10:55:12 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 13:55:12 -0400
Subject: [source]  kernel: update 4.9 to 4.9.53
In-Reply-To: <20171007175511.16072.65009@git-01.infra.lede-project.org>
References: <20171007175511.16072.65009@git-01.infra.lede-project.org>
Message-ID: <mailman.53170.1507398950.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/f625df7ab8cf975dfdde890dbfe61f7081fb1ad7

commit f625df7ab8cf975dfdde890dbfe61f7081fb1ad7
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sat Oct 7 18:08:53 2017 +0300

    kernel: update 4.9 to 4.9.53
    
    Refresh patches.
    Compile-tested on brcm2708/bcm2708, octeon and x86/64.
    Runtime-tested on brcm2708/bcm2708, octeon and x86/64.
    
    Fixes the following CVEs:
    - CVE-2017-1000252
    - CVE-2017-12153
    - CVE-2017-12154
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 include/kernel-version.mk                            | 4 ++--
 target/linux/ramips/patches-4.9/0040-nand-hack.patch | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index bf38d86..75a1e1d 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -4,11 +4,11 @@ LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
 LINUX_VERSION-4.4 = .90
-LINUX_VERSION-4.9 = .52
+LINUX_VERSION-4.9 = .53
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
 LINUX_KERNEL_HASH-4.4.90 = 6826ccd213ac79bbfd47e63912e89ef7ec70324b7aa3684a4d4560fc2b436331
-LINUX_KERNEL_HASH-4.9.52 = ffdd034f1bf32fa41d1a66a347388c0dc4c3cff6f578a1e29d88b20fbae1048a
+LINUX_KERNEL_HASH-4.9.53 = 32915a33bb0b993b779257748f89f31418992edba53acbe1160cb0f8ef3cb324
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/ramips/patches-4.9/0040-nand-hack.patch b/target/linux/ramips/patches-4.9/0040-nand-hack.patch
index 64a3253..fe2b12d 100644
--- a/target/linux/ramips/patches-4.9/0040-nand-hack.patch
+++ b/target/linux/ramips/patches-4.9/0040-nand-hack.patch
@@ -41,7 +41,7 @@
  	}
 --- a/drivers/mtd/nand/nand_device_list.h
 +++ b/drivers/mtd/nand/nand_device_list.h
-@@ -43,6 +43,8 @@ static const flashdev_info gen_FlashTabl
+@@ -44,6 +44,8 @@ static const flashdev_info gen_FlashTabl
  	{0xADBC, 0x905554, 5, 16, 512, 128, 2048, 64, 0x10801011, "H9DA4GH4JJAMC", 0},
      {0x01F1, 0x801D01, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "S34ML01G100TF", 0},
      {0x92F1, 0x8095FF, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "F59L1G81A", 0},


From lede-commits at lists.infradead.org  Sat Oct  7 11:15:31 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 14:15:31 -0400
Subject: [source]  lantiq: remove gen_nand compatible string
In-Reply-To: <20171007181531.21841.76038@git-01.infra.lede-project.org>
References: <20171007181531.21841.76038@git-01.infra.lede-project.org>
Message-ID: <mailman.53176.1507400155.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/a6bd7255ab393ec3a992f2f706cd8177292ef0fc

commit a6bd7255ab393ec3a992f2f706cd8177292ef0fc
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Oct 7 11:03:43 2017 +0200

    lantiq: remove gen_nand compatible string
    
    The generic nand driver fails to load with:
    
      gen_nand 14000000.nand-parts: platform_nand_data is missing
      gen_nand: probe of 14000000.nand-parts failed with error -22
    
    and the xway-nand driver is used afterwards.
    
    Drop the gen_nand compatible to get rid of the error message.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/dts/BTHOMEHUBV2B.dts  | 2 +-
 target/linux/lantiq/dts/BTHOMEHUBV3A.dts  | 2 +-
 target/linux/lantiq/dts/BTHOMEHUBV5A.dts  | 2 +-
 target/linux/lantiq/dts/EASY80920NAND.dts | 2 +-
 target/linux/lantiq/dts/FRITZ3370.dts     | 2 +-
 target/linux/lantiq/dts/P2812HNUF1.dts    | 2 +-
 target/linux/lantiq/dts/P2812HNUF3.dts    | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts
index 87b4dfb..d81a113 100644
--- a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts
+++ b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts
@@ -74,7 +74,7 @@
 			};
 
 			nand-parts at 0 {		  /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */
-				compatible = "gen_nand", "lantiq,nand-xway";
+				compatible = "lantiq,nand-xway";
 				lantiq,cs = <1>;
 				bank-width = <2>;
 				reg = <1 0x0 0x2000000 >;
diff --git a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts
index ca9020b..aa37acd 100644
--- a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts
+++ b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts
@@ -34,7 +34,7 @@
 	fpi at 10000000 {
 		localbus at 0 {
 			nand-parts at 0 {		  /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */
-				compatible = "gen_nand", "lantiq,nand-xway";
+				compatible = "lantiq,nand-xway";
 				lantiq,cs = <1>;
 				bank-width = <2>;
 				reg = <1 0x0 0x2000000 >;
diff --git a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
index a33690c..81c0511 100644
--- a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
+++ b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts
@@ -27,7 +27,7 @@
 	fpi at 10000000 {
 		localbus at 0 {
 			nand-parts at 0 {
-				compatible = "gen_nand", "lantiq,nand-xway";
+				compatible = "lantiq,nand-xway";
 				lantiq,cs = <1>;
 				bank-width = <2>;
 				reg = <0x1 0x0 0x2000000>;
diff --git a/target/linux/lantiq/dts/EASY80920NAND.dts b/target/linux/lantiq/dts/EASY80920NAND.dts
index 332f2fb..cc5fc22 100644
--- a/target/linux/lantiq/dts/EASY80920NAND.dts
+++ b/target/linux/lantiq/dts/EASY80920NAND.dts
@@ -14,7 +14,7 @@
 		localbus at 0 {
 			ranges = <0 0 0x4000000 0x3ffffff>;
 			nand-parts at 0 {
-				compatible = "gen_nand", "lantiq,nand-xway";
+				compatible = "lantiq,nand-xway";
 				lantiq,cs = <1>;
 				bank-width = <2>;
 				reg = <0 0x0 0x2000000>;
diff --git a/target/linux/lantiq/dts/FRITZ3370.dts b/target/linux/lantiq/dts/FRITZ3370.dts
index 3f57f45..b4b98e7 100644
--- a/target/linux/lantiq/dts/FRITZ3370.dts
+++ b/target/linux/lantiq/dts/FRITZ3370.dts
@@ -28,7 +28,7 @@
 	fpi at 10000000 {
 		localbus at 0 {
 			nand-parts at 0 {
-				compatible = "gen_nand", "lantiq,nand-xway";
+				compatible = "lantiq,nand-xway";
 				bank-width = <2>;
 				reg = <1 0x0 0x2000000>;
 				#address-cells = <1>;
diff --git a/target/linux/lantiq/dts/P2812HNUF1.dts b/target/linux/lantiq/dts/P2812HNUF1.dts
index b1d9eed..176aae2 100644
--- a/target/linux/lantiq/dts/P2812HNUF1.dts
+++ b/target/linux/lantiq/dts/P2812HNUF1.dts
@@ -13,7 +13,7 @@
 	fpi at 10000000 {
 		localbus at 0 {
 			nand-parts at 0 {
-				compatible = "gen_nand", "lantiq,nand-xway";
+				compatible = "lantiq,nand-xway";
 				lantiq,cs = <1>;
 				bank-width = <2>;
 				reg = <0 0x0 0x2000000>;
diff --git a/target/linux/lantiq/dts/P2812HNUF3.dts b/target/linux/lantiq/dts/P2812HNUF3.dts
index 366d034..93d2071 100644
--- a/target/linux/lantiq/dts/P2812HNUF3.dts
+++ b/target/linux/lantiq/dts/P2812HNUF3.dts
@@ -36,7 +36,7 @@
 			};
 
 			nand-parts at 0 {
-				compatible = "gen_nand", "lantiq,nand-xway";
+				compatible = "lantiq,nand-xway";
 				lantiq,cs = <1>;
 				bank-width = <2>;
 				reg = <1 0x0 0x2000000>;


From lede-commits at lists.infradead.org  Sat Oct  7 11:15:32 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 14:15:32 -0400
Subject: [source]  lantiq: drop phy id specfic compatible string
In-Reply-To: <20171007181531.21841.76038@git-01.infra.lede-project.org>
References: <20171007181531.21841.76038@git-01.infra.lede-project.org>
Message-ID: <mailman.53177.1507400160.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/d65b1c815aaf56db983a91d31d7957a3a5ef3d44

commit d65b1c815aaf56db983a91d31d7957a3a5ef3d44
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Oct 7 14:12:44 2017 +0200

    lantiq: drop phy id specfic compatible string
    
    With kernel commit 7630ea4bda18 ("Documentation: net: phy: improve
    explanation when to specify the PHY ID") the purpose of using phy id
    specific compatibles was clarified.
    
    Remove the phy id specific compatibles since they are meant to be used
    if the phy reports an incorrect or no phy id at all.
    
    Reported-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/dts/FRITZ7360SL.dts  | 4 ++--
 target/linux/lantiq/dts/VGV7510KW22.dtsi | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/lantiq/dts/FRITZ7360SL.dts b/target/linux/lantiq/dts/FRITZ7360SL.dts
index 496fe2e..672b645 100644
--- a/target/linux/lantiq/dts/FRITZ7360SL.dts
+++ b/target/linux/lantiq/dts/FRITZ7360SL.dts
@@ -191,12 +191,12 @@
 		compatible = "lantiq,xrx200-mdio";
 		phy0: ethernet-phy at 0 {
 			reg = <0x00>;
-			compatible = "ethernet-phy-id004d.d076", "ethernet-phy-ieee802.3-c22";
+			compatible = "ethernet-phy-ieee802.3-c22";
 			reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
 		};
 		phy1: ethernet-phy at 1 {
 			reg = <0x01>;
-			compatible = "ethernet-phy-id004d.d076", "ethernet-phy-ieee802.3-c22";
+			compatible = "ethernet-phy-ieee802.3-c22";
 			reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
 		};
 		phy11: ethernet-phy at 11 {
diff --git a/target/linux/lantiq/dts/VGV7510KW22.dtsi b/target/linux/lantiq/dts/VGV7510KW22.dtsi
index 73240bf..7c3cfbb 100644
--- a/target/linux/lantiq/dts/VGV7510KW22.dtsi
+++ b/target/linux/lantiq/dts/VGV7510KW22.dtsi
@@ -228,7 +228,7 @@
 
 		phy1: ethernet-phy at 1 {
 			reg = <0x1>;
-			compatible = "ethernet-phy-id0243.0c54", "ethernet-phy-ieee802.3-c22";
+			compatible = "ethernet-phy-ieee802.3-c22";
 		};
 
 		phy11: ethernet-phy at 11 {


From lede-commits at lists.infradead.org  Sat Oct  7 11:15:33 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 14:15:33 -0400
Subject: [source]  ar71xx: add rssileds to WA850RE v1 image
In-Reply-To: <20171007181531.21841.76038@git-01.infra.lede-project.org>
References: <20171007181531.21841.76038@git-01.infra.lede-project.org>
Message-ID: <mailman.53180.1507400160.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/1c4a116a300d5447bf037760f64653556824ab77

commit 1c4a116a300d5447bf037760f64653556824ab77
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Oct 7 16:54:19 2017 +0200

    ar71xx: add rssileds to WA850RE v1 image
    
    A default rssileds config exists for the TP-Link WA850RE v1 but the
    rssiled package is not included by default.
    
    The compressed 17.01.3 image size increases by 3302 bytes which should
    be tolerable even for a 4MB flash board.
    
    Fixes: FS#1043
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ar71xx/image/tp-link.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 35d07ee..5d2518b 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -486,6 +486,7 @@ endef
 define Device/tl-wa850re-v1
   $(Device/tplink-4mlzma)
   DEVICE_TITLE := TP-LINK TL-WA850RE v1
+  DEVICE_PACKAGES := rssileds
   BOARDNAME := TL-WA850RE
   DEVICE_PROFILE := TLWA850
   TPLINK_HWID := 0x08500001


From lede-commits at lists.infradead.org  Sat Oct  7 11:16:28 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 07 Oct 2017 14:16:28 -0400
Subject: [source]  ar71xx: add rssileds to WA850RE v1 image
In-Reply-To: <20171007181628.22048.58094@git-01.infra.lede-project.org>
References: <20171007181628.22048.58094@git-01.infra.lede-project.org>
Message-ID: <mailman.53181.1507400225.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/94aa2b8af07fa72565eb0c73a41c1fcd384b2102

commit 94aa2b8af07fa72565eb0c73a41c1fcd384b2102
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sat Oct 7 16:54:19 2017 +0200

    ar71xx: add rssileds to WA850RE v1 image
    
    A default rssileds config exists for the TP-Link WA850RE v1 but the
    rssiled package is not included by default.
    
    The compressed 17.01.3 image size increases by 3302 bytes which should
    be tolerable even for a 4MB flash board.
    
    Fixes: FS#1043
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ar71xx/image/tp-link.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 312152f..b76ed02 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -944,6 +944,7 @@ endef
 define Device/tl-wa850re-v1
     $(Device/tplink-4mlzma)
     DEVICE_TITLE := TP-LINK TL-WA850RE
+    DEVICE_PACKAGES := rssileds
     BOARDNAME := TL-WA850RE
     DEVICE_PROFILE := TLWA850
     TPLINK_HWID := 0x08500001


From lede-commits at lists.infradead.org  Sun Oct  8 04:44:08 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 07:44:08 -0400
Subject: [source]  layerscape: remove wifi config
In-Reply-To: <20171008114407.15982.7031@git-01.infra.lede-project.org>
References: <20171008114407.15982.7031@git-01.infra.lede-project.org>
Message-ID: <mailman.53221.1507463202.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/213512518225580910160ac0a177c433762e18d8

commit 213512518225580910160ac0a177c433762e18d8
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 8 12:33:59 2017 +0200

    layerscape: remove wifi config
    
    This is provided by the mac80211 package
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/layerscape/armv8_32b/config-4.9 | 16 ----------------
 target/linux/layerscape/armv8_64b/config-4.9 | 16 ----------------
 2 files changed, 32 deletions(-)

diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9
index ec7d0c1..c3ee531 100644
--- a/target/linux/layerscape/armv8_32b/config-4.9
+++ b/target/linux/layerscape/armv8_32b/config-4.9
@@ -94,7 +94,6 @@ CONFIG_AT803X_PHY=y
 CONFIG_ATA=y
 CONFIG_ATAGS=y
 CONFIG_ATA_VERBOSE_ERROR=y
-# CONFIG_ATH5K_PCI is not set
 CONFIG_AUTOFS4_FS=y
 CONFIG_AUTO_ZRELADDR=y
 # CONFIG_AXP20X_POWER is not set
@@ -1428,21 +1427,6 @@ CONFIG_VT_CONSOLE_SLEEP=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 CONFIG_WATCHDOG_CORE=y
 # CONFIG_WKUP_M3_RPROC is not set
-CONFIG_WLAN_VENDOR_ADMTEK=y
-CONFIG_WLAN_VENDOR_ATH=y
-CONFIG_WLAN_VENDOR_ATMEL=y
-CONFIG_WLAN_VENDOR_BROADCOM=y
-CONFIG_WLAN_VENDOR_CISCO=y
-CONFIG_WLAN_VENDOR_INTEL=y
-CONFIG_WLAN_VENDOR_INTERSIL=y
-CONFIG_WLAN_VENDOR_MARVELL=y
-CONFIG_WLAN_VENDOR_MEDIATEK=y
-CONFIG_WLAN_VENDOR_RALINK=y
-CONFIG_WLAN_VENDOR_REALTEK=y
-CONFIG_WLAN_VENDOR_RSI=y
-CONFIG_WLAN_VENDOR_ST=y
-CONFIG_WLAN_VENDOR_TI=y
-CONFIG_WLAN_VENDOR_ZYDAS=y
 # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
 CONFIG_XFRM_ALGO=y
 CONFIG_XFRM_USER=y
diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9
index 8fafc1c..22c4913 100644
--- a/target/linux/layerscape/armv8_64b/config-4.9
+++ b/target/linux/layerscape/armv8_64b/config-4.9
@@ -112,7 +112,6 @@ CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
 CONFIG_ATA=y
 CONFIG_ATA_ACPI=y
 CONFIG_ATA_VERBOSE_ERROR=y
-# CONFIG_ATH5K_PCI is not set
 CONFIG_AUDIT=y
 CONFIG_AUDITSYSCALL=y
 CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
@@ -1315,21 +1314,6 @@ CONFIG_VT_CONSOLE=y
 CONFIG_VT_CONSOLE_SLEEP=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 CONFIG_WATCHDOG_CORE=y
-CONFIG_WLAN_VENDOR_ADMTEK=y
-CONFIG_WLAN_VENDOR_ATH=y
-CONFIG_WLAN_VENDOR_ATMEL=y
-CONFIG_WLAN_VENDOR_BROADCOM=y
-CONFIG_WLAN_VENDOR_CISCO=y
-CONFIG_WLAN_VENDOR_INTEL=y
-CONFIG_WLAN_VENDOR_INTERSIL=y
-CONFIG_WLAN_VENDOR_MARVELL=y
-CONFIG_WLAN_VENDOR_MEDIATEK=y
-CONFIG_WLAN_VENDOR_RALINK=y
-CONFIG_WLAN_VENDOR_REALTEK=y
-CONFIG_WLAN_VENDOR_RSI=y
-CONFIG_WLAN_VENDOR_ST=y
-CONFIG_WLAN_VENDOR_TI=y
-CONFIG_WLAN_VENDOR_ZYDAS=y
 # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
 CONFIG_XEN=y
 CONFIG_XENFS=y


From lede-commits at lists.infradead.org  Sun Oct  8 04:44:09 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 07:44:09 -0400
Subject: [source]  kernel: Add some more generic config options
In-Reply-To: <20171008114407.15982.7031@git-01.infra.lede-project.org>
References: <20171008114407.15982.7031@git-01.infra.lede-project.org>
Message-ID: <mailman.53222.1507463202.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/cf17e034bcbba531b7a5f85cf54c261c199c9b07

commit cf17e034bcbba531b7a5f85cf54c261c199c9b07
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 8 12:40:26 2017 +0200

    kernel: Add some more generic config options
    
    These options are deactivating some kernel modules for IP blocks not
    uses on this SoC. I saw the same when working with the ARM64 Marvell
    board so it is better to move them to generic.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/config-4.9              | 9 +++++++++
 target/linux/layerscape/armv8_32b/config-4.9 | 1 -
 target/linux/layerscape/armv8_64b/config-4.9 | 9 ---------
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9
index 930cf76..b73e0ad 100644
--- a/target/linux/generic/config-4.9
+++ b/target/linux/generic/config-4.9
@@ -310,6 +310,7 @@ CONFIG_ARM_GIC_MAX_NR=1
 # CONFIG_ARM_PATCH_PHYS_VIRT is not set
 # CONFIG_ARM_PSCI is not set
 # CONFIG_ARM_PTDUMP is not set
+# CONFIG_ARM_SBSA_WATCHDOG is not set
 # CONFIG_ARM_TIMER_SP804 is not set
 # CONFIG_ARM_UNWIND is not set
 # CONFIG_ARM_VIRT_EXT is not set
@@ -2186,6 +2187,7 @@ CONFIG_LEDS_TRIGGER_TIMER=y
 # CONFIG_LIBIPW_DEBUG is not set
 # CONFIG_LIBNVDIMM is not set
 # CONFIG_LIDAR_LITE_V2 is not set
+# CONFIG_LIQUIDIO is not set
 # CONFIG_LIRC_STAGING is not set
 # CONFIG_LIS3L02DQ is not set
 # CONFIG_LKDTM is not set
@@ -3208,6 +3210,8 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set
 # CONFIG_PCI_HERMES is not set
 # CONFIG_PCI_HOST_GENERIC is not set
+# CONFIG_PCI_HOST_THUNDER_ECAM is not set
+# CONFIG_PCI_HOST_THUNDER_PEM is not set
 # CONFIG_PCI_IOV is not set
 # CONFIG_PCI_LAYERSCAPE is not set
 # CONFIG_PCI_MSI is not set
@@ -3931,6 +3935,7 @@ CONFIG_SERIAL_8250_NR_UARTS=2
 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
 # CONFIG_SERIAL_ALTERA_JTAGUART is not set
 # CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_AMBA_PL010 is not set
 # CONFIG_SERIAL_ARC is not set
 # CONFIG_SERIAL_BCM63XX is not set
 # CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
@@ -4540,6 +4545,10 @@ CONFIG_TEXTSEARCH=y
 # CONFIG_THERMAL_WRITABLE_TRIPS is not set
 # CONFIG_THINKPAD_ACPI is not set
 # CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_THUNDER_NIC_BGX is not set
+# CONFIG_THUNDER_NIC_PF is not set
+# CONFIG_THUNDER_NIC_RGX is not set
+# CONFIG_THUNDER_NIC_VF is not set
 # CONFIG_THUNDERBOLT is not set
 # CONFIG_TICK_CPU_ACCOUNTING is not set
 CONFIG_TICK_ONESHOT=y
diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9
index c3ee531..f0687f3 100644
--- a/target/linux/layerscape/armv8_32b/config-4.9
+++ b/target/linux/layerscape/armv8_32b/config-4.9
@@ -1199,7 +1199,6 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_OMAP is not set
 CONFIG_SERIAL_8250_PCI=y
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SERIAL_AMBA_PL010 is not set
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
 CONFIG_SERIAL_BCM63XX=y
diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9
index 22c4913..91a89a2 100644
--- a/target/linux/layerscape/armv8_64b/config-4.9
+++ b/target/linux/layerscape/armv8_64b/config-4.9
@@ -101,7 +101,6 @@ CONFIG_ARM_GIC_V3_ITS=y
 # CONFIG_ARM_PL172_MPMC is not set
 CONFIG_ARM_PMU=y
 CONFIG_ARM_PSCI_FW=y
-# CONFIG_ARM_SBSA_WATCHDOG is not set
 CONFIG_ARM_SMMU=y
 CONFIG_ARM_SMMU_V3=y
 CONFIG_ARM_SP805_WATCHDOG=y
@@ -740,7 +739,6 @@ CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=16
 CONFIG_LIBCRC32C=y
 CONFIG_LIBFDT=y
-# CONFIG_LIQUIDIO is not set
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
@@ -974,8 +972,6 @@ CONFIG_PCI_ECAM=y
 CONFIG_PCI_HISI=y
 CONFIG_PCI_HOST_COMMON=y
 CONFIG_PCI_HOST_GENERIC=y
-# CONFIG_PCI_HOST_THUNDER_ECAM is not set
-# CONFIG_PCI_HOST_THUNDER_PEM is not set
 CONFIG_PCI_IOV=y
 CONFIG_PCI_LABEL=y
 CONFIG_PCI_LAYERSCAPE=y
@@ -1123,7 +1119,6 @@ CONFIG_SERIAL_8250_PCI=y
 CONFIG_SERIAL_8250_PNP=y
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIAL_8250_SHARE_IRQ=y
-# CONFIG_SERIAL_AMBA_PL010 is not set
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
 CONFIG_SERIAL_FSL_LPUART=y
@@ -1209,10 +1204,6 @@ CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
 CONFIG_THERMAL_GOV_STEP_WISE=y
 CONFIG_THERMAL_HWMON=y
 CONFIG_THERMAL_OF=y
-# CONFIG_THUNDER_NIC_BGX is not set
-# CONFIG_THUNDER_NIC_PF is not set
-# CONFIG_THUNDER_NIC_RGX is not set
-# CONFIG_THUNDER_NIC_VF is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TMPFS_POSIX_ACL=y
 CONFIG_TRANSPARENT_HUGEPAGE=y


From lede-commits at lists.infradead.org  Sun Oct  8 04:44:07 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 07:44:07 -0400
Subject: [source]  kernel: add missing config options for layerscape target
In-Reply-To: <20171008114407.15982.7031@git-01.infra.lede-project.org>
References: <20171008114407.15982.7031@git-01.infra.lede-project.org>
Message-ID: <mailman.53223.1507463205.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/29a6c4fcfb56c24aadcd3d7b5cc004c9d3f465e2

commit 29a6c4fcfb56c24aadcd3d7b5cc004c9d3f465e2
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 8 12:27:23 2017 +0200

    kernel: add missing config options for layerscape target
    
    This fixes some problems found by build bot.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/config-4.9 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9
index 79d7dcb..930cf76 100644
--- a/target/linux/generic/config-4.9
+++ b/target/linux/generic/config-4.9
@@ -1883,6 +1883,7 @@ CONFIG_IO_STRICT_DEVMEM=y
 # CONFIG_IP6_NF_MATCH_RT is not set
 # CONFIG_IP6_NF_NAT is not set
 # CONFIG_IP6_NF_RAW is not set
+# CONFIG_IP6_NF_SECURITY is not set
 # CONFIG_IP6_NF_TARGET_HL is not set
 # CONFIG_IP6_NF_TARGET_REJECT is not set
 # CONFIG_IP6_NF_TARGET_SYNPROXY is not set
@@ -2948,6 +2949,8 @@ CONFIG_NFS_V3=y
 # CONFIG_NFS_V4 is not set
 # CONFIG_NFS_V4_1 is not set
 # CONFIG_NFTL is not set
+# CONFIG_NFT_BRIDGE_META is not set
+# CONFIG_NFT_BRIDGE_REJECT is not set
 # CONFIG_NFT_DUP_IPV4 is not set
 # CONFIG_NFT_DUP_IPV6 is not set
 # CONFIG_NF_CONNTRACK is not set
@@ -4066,6 +4069,7 @@ CONFIG_SND_DRIVERS=y
 # CONFIG_SND_DUMMY is not set
 # CONFIG_SND_DYNAMIC_MINORS is not set
 # CONFIG_SND_ECHO3G is not set
+# CONFIG_SND_EDMA_SOC is not set
 # CONFIG_SND_EMU10K1 is not set
 # CONFIG_SND_EMU10K1X is not set
 # CONFIG_SND_EMU10K1_SEQ is not set
@@ -4735,6 +4739,7 @@ CONFIG_USB_DEFAULT_PERSIST=y
 # CONFIG_USB_EG20T is not set
 # CONFIG_USB_EHCI_ATH79 is not set
 # CONFIG_USB_EHCI_HCD_AT91 is not set
+# CONFIG_USB_EHCI_HCD_OMAP is not set
 # CONFIG_USB_EHCI_HCD_PPC_OF is not set
 # CONFIG_USB_EHCI_MSM is not set
 # CONFIG_USB_EHCI_MV is not set


From lede-commits at lists.infradead.org  Sun Oct  8 06:35:47 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 09:35:47 -0400
Subject: [source]  generic: net: tcp: backport tcp tx performance patches
In-Reply-To: <20171008133541.12192.70272@git-01.infra.lede-project.org>
References: <20171008133541.12192.70272@git-01.infra.lede-project.org>
Message-ID: <mailman.53231.1507469785.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/b2ea46fe236ae02d845f94cf984cbc1786870333

commit b2ea46fe236ae02d845f94cf984cbc1786870333
Author: Pavel Kubelun <be.dissent at gmail.com>
AuthorDate: Tue Jul 25 03:57:31 2017 -0400

    generic: net: tcp: backport tcp tx performance patches
    
    An overall throughput gain of 22 % for heavy TCP use over a single TX queue.
    
    Original patchset comment
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.13&id=3f4888adae7c1619b990d98a9b967536f71822b8
    
    Signed-off-by: Pavel Kubelun <be.dissent at gmail.com>
---
 .../024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch     |  90 +++++++++++
 ...-remove-one-locked-operation-in-tcp_wfree.patch |  48 ++++++
 ...-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch |  71 +++++++++
 ...4-4-tcp-tsq-avoid-one-atomic-in-tcp_wfree.patch |  38 +++++
 ...q-add-a-shortcut-in-tcp_small_queue_check.patch |  37 +++++
 ...tcp-tcp_mtu_probe-is-likely-to-exit-early.patch |  55 +++++++
 ...nize-struct-sock-for-better-data-locality.patch | 157 ++++++++++++++++++
 ...tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch | 176 +++++++++++++++++++++
 ...add-a-missing-barrier-in-tcp_tasklet_func.patch |  40 +++++
 9 files changed, 712 insertions(+)

diff --git a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
new file mode 100644
index 0000000..2031149
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch
@@ -0,0 +1,90 @@
+From 40fc3423b983b864bf70b03199191260ae9b2ea6 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:50 -0800
+Subject: [PATCH 01/10] tcp: tsq: add tsq_flags / tsq_enum
+
+This is a cleanup, to ease code review of following patches.
+
+Old 'enum tsq_flags' is renamed, and a new enumeration is added
+with the flags used in cmpxchg() operations as opposed to
+single bit operations.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ include/linux/tcp.h   | 11 ++++++++++-
+ net/ipv4/tcp_output.c | 16 ++++++++--------
+ 2 files changed, 18 insertions(+), 9 deletions(-)
+
+--- a/include/linux/tcp.h
++++ b/include/linux/tcp.h
+@@ -367,7 +367,7 @@ struct tcp_sock {
+ 	u32	*saved_syn;
+ };
+ 
+-enum tsq_flags {
++enum tsq_enum {
+ 	TSQ_THROTTLED,
+ 	TSQ_QUEUED,
+ 	TCP_TSQ_DEFERRED,	   /* tcp_tasklet_func() found socket was owned */
+@@ -378,6 +378,15 @@ enum tsq_flags {
+ 				    */
+ };
+ 
++enum tsq_flags {
++	TSQF_THROTTLED			= (1UL << TSQ_THROTTLED),
++	TSQF_QUEUED			= (1UL << TSQ_QUEUED),
++	TCPF_TSQ_DEFERRED		= (1UL << TCP_TSQ_DEFERRED),
++	TCPF_WRITE_TIMER_DEFERRED	= (1UL << TCP_WRITE_TIMER_DEFERRED),
++	TCPF_DELACK_TIMER_DEFERRED	= (1UL << TCP_DELACK_TIMER_DEFERRED),
++	TCPF_MTU_REDUCED_DEFERRED	= (1UL << TCP_MTU_REDUCED_DEFERRED),
++};
++
+ static inline struct tcp_sock *tcp_sk(const struct sock *sk)
+ {
+ 	return (struct tcp_sock *)sk;
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -784,10 +784,10 @@ static void tcp_tasklet_func(unsigned lo
+ 	}
+ }
+ 
+-#define TCP_DEFERRED_ALL ((1UL << TCP_TSQ_DEFERRED) |		\
+-			  (1UL << TCP_WRITE_TIMER_DEFERRED) |	\
+-			  (1UL << TCP_DELACK_TIMER_DEFERRED) |	\
+-			  (1UL << TCP_MTU_REDUCED_DEFERRED))
++#define TCP_DEFERRED_ALL (TCPF_TSQ_DEFERRED |		\
++			  TCPF_WRITE_TIMER_DEFERRED |	\
++			  TCPF_DELACK_TIMER_DEFERRED |	\
++			  TCPF_MTU_REDUCED_DEFERRED)
+ /**
+  * tcp_release_cb - tcp release_sock() callback
+  * @sk: socket
+@@ -808,7 +808,7 @@ void tcp_release_cb(struct sock *sk)
+ 		nflags = flags & ~TCP_DEFERRED_ALL;
+ 	} while (cmpxchg(&tp->tsq_flags, flags, nflags) != flags);
+ 
+-	if (flags & (1UL << TCP_TSQ_DEFERRED))
++	if (flags & TCPF_TSQ_DEFERRED)
+ 		tcp_tsq_handler(sk);
+ 
+ 	/* Here begins the tricky part :
+@@ -822,15 +822,15 @@ void tcp_release_cb(struct sock *sk)
+ 	 */
+ 	sock_release_ownership(sk);
+ 
+-	if (flags & (1UL << TCP_WRITE_TIMER_DEFERRED)) {
++	if (flags & TCPF_WRITE_TIMER_DEFERRED) {
+ 		tcp_write_timer_handler(sk);
+ 		__sock_put(sk);
+ 	}
+-	if (flags & (1UL << TCP_DELACK_TIMER_DEFERRED)) {
++	if (flags & TCPF_DELACK_TIMER_DEFERRED) {
+ 		tcp_delack_timer_handler(sk);
+ 		__sock_put(sk);
+ 	}
+-	if (flags & (1UL << TCP_MTU_REDUCED_DEFERRED)) {
++	if (flags & TCPF_MTU_REDUCED_DEFERRED) {
+ 		inet_csk(sk)->icsk_af_ops->mtu_reduced(sk);
+ 		__sock_put(sk);
+ 	}
diff --git a/target/linux/generic/backport-4.9/024-2-tcp-tsq-remove-one-locked-operation-in-tcp_wfree.patch b/target/linux/generic/backport-4.9/024-2-tcp-tsq-remove-one-locked-operation-in-tcp_wfree.patch
new file mode 100644
index 0000000..914be60
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-2-tcp-tsq-remove-one-locked-operation-in-tcp_wfree.patch
@@ -0,0 +1,48 @@
+From 408f0a6c21e124cc4f6c7aa370b38aa47e55428d Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:51 -0800
+Subject: [PATCH 02/10] tcp: tsq: remove one locked operation in tcp_wfree()
+
+Instead of atomically clear TSQ_THROTTLED and atomically set TSQ_QUEUED
+bits, use one cmpxchg() to perform a single locked operation.
+
+Since the following patch will also set TCP_TSQ_DEFERRED here,
+this cmpxchg() will make this addition free.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ net/ipv4/tcp_output.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -860,6 +860,7 @@ void tcp_wfree(struct sk_buff *skb)
+ {
+ 	struct sock *sk = skb->sk;
+ 	struct tcp_sock *tp = tcp_sk(sk);
++	unsigned long flags, nval, oval;
+ 	int wmem;
+ 
+ 	/* Keep one reference on sk_wmem_alloc.
+@@ -877,11 +878,17 @@ void tcp_wfree(struct sk_buff *skb)
+ 	if (wmem >= SKB_TRUESIZE(1) && this_cpu_ksoftirqd() == current)
+ 		goto out;
+ 
+-	if (test_and_clear_bit(TSQ_THROTTLED, &tp->tsq_flags) &&
+-	    !test_and_set_bit(TSQ_QUEUED, &tp->tsq_flags)) {
+-		unsigned long flags;
++	for (oval = READ_ONCE(tp->tsq_flags);; oval = nval) {
+ 		struct tsq_tasklet *tsq;
+ 
++		if (!(oval & TSQF_THROTTLED) || (oval & TSQF_QUEUED))
++			goto out;
++
++		nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED;
++		nval = cmpxchg(&tp->tsq_flags, oval, nval);
++		if (nval != oval)
++			continue;
++
+ 		/* queue this socket to tasklet queue */
+ 		local_irq_save(flags);
+ 		tsq = this_cpu_ptr(&tsq_tasklet);
diff --git a/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch b/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch
new file mode 100644
index 0000000..8f45c23
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch
@@ -0,0 +1,71 @@
+From b223feb9de2a65c533ff95c08e834fa732906ea5 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:52 -0800
+Subject: [PATCH 03/10] tcp: tsq: add shortcut in tcp_tasklet_func()
+
+Under high stress, I've seen tcp_tasklet_func() consuming
+~700 usec, handling ~150 tcp sockets.
+
+By setting TCP_TSQ_DEFERRED in tcp_wfree(), we give a chance
+for other cpus/threads entering tcp_write_xmit() to grab it,
+allowing tcp_tasklet_func() to skip sockets that already did
+an xmit cycle.
+
+In the future, we might give to ACK processing an increased
+budget to reduce even more tcp_tasklet_func() amount of work.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ net/ipv4/tcp_output.c | 22 ++++++++++++----------
+ 1 file changed, 12 insertions(+), 10 deletions(-)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -767,19 +767,19 @@ static void tcp_tasklet_func(unsigned lo
+ 	list_for_each_safe(q, n, &list) {
+ 		tp = list_entry(q, struct tcp_sock, tsq_node);
+ 		list_del(&tp->tsq_node);
++		clear_bit(TSQ_QUEUED, &tp->tsq_flags);
+ 
+ 		sk = (struct sock *)tp;
+-		bh_lock_sock(sk);
+-
+-		if (!sock_owned_by_user(sk)) {
+-			tcp_tsq_handler(sk);
+-		} else {
+-			/* defer the work to tcp_release_cb() */
+-			set_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
++		if (!sk->sk_lock.owned &&
++		    test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags)) {
++			bh_lock_sock(sk);
++			if (!sock_owned_by_user(sk)) {
++				clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
++				tcp_tsq_handler(sk);
++			}
++			bh_unlock_sock(sk);
+ 		}
+-		bh_unlock_sock(sk);
+ 
+-		clear_bit(TSQ_QUEUED, &tp->tsq_flags);
+ 		sk_free(sk);
+ 	}
+ }
+@@ -884,7 +884,7 @@ void tcp_wfree(struct sk_buff *skb)
+ 		if (!(oval & TSQF_THROTTLED) || (oval & TSQF_QUEUED))
+ 			goto out;
+ 
+-		nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED;
++		nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED | TCPF_TSQ_DEFERRED;
+ 		nval = cmpxchg(&tp->tsq_flags, oval, nval);
+ 		if (nval != oval)
+ 			continue;
+@@ -2179,6 +2179,8 @@ static bool tcp_write_xmit(struct sock *
+ 		    unlikely(tso_fragment(sk, skb, limit, mss_now, gfp)))
+ 			break;
+ 
++		if (test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags))
++			clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
+ 		if (tcp_small_queue_check(sk, skb, 0))
+ 			break;
+ 
diff --git a/target/linux/generic/backport-4.9/024-4-tcp-tsq-avoid-one-atomic-in-tcp_wfree.patch b/target/linux/generic/backport-4.9/024-4-tcp-tsq-avoid-one-atomic-in-tcp_wfree.patch
new file mode 100644
index 0000000..a25cdb5
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-4-tcp-tsq-avoid-one-atomic-in-tcp_wfree.patch
@@ -0,0 +1,38 @@
+From a9b204d1564702b704ad6fe74f10a102c7b87ba3 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:53 -0800
+Subject: [PATCH 04/10] tcp: tsq: avoid one atomic in tcp_wfree()
+
+Under high load, tcp_wfree() has an atomic operation trying
+to schedule a tasklet over and over.
+
+We can schedule it only if our per cpu list was empty.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ net/ipv4/tcp_output.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -880,6 +880,7 @@ void tcp_wfree(struct sk_buff *skb)
+ 
+ 	for (oval = READ_ONCE(tp->tsq_flags);; oval = nval) {
+ 		struct tsq_tasklet *tsq;
++		bool empty;
+ 
+ 		if (!(oval & TSQF_THROTTLED) || (oval & TSQF_QUEUED))
+ 			goto out;
+@@ -892,8 +893,10 @@ void tcp_wfree(struct sk_buff *skb)
+ 		/* queue this socket to tasklet queue */
+ 		local_irq_save(flags);
+ 		tsq = this_cpu_ptr(&tsq_tasklet);
++		empty = list_empty(&tsq->head);
+ 		list_add(&tp->tsq_node, &tsq->head);
+-		tasklet_schedule(&tsq->tasklet);
++		if (empty)
++			tasklet_schedule(&tsq->tasklet);
+ 		local_irq_restore(flags);
+ 		return;
+ 	}
diff --git a/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch
new file mode 100644
index 0000000..dd1a37e
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch
@@ -0,0 +1,37 @@
+From 75eefc6c59fd2c5f1ab95a3a113c217237d12a31 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:54 -0800
+Subject: [PATCH 05/10] tcp: tsq: add a shortcut in tcp_small_queue_check()
+
+Always allow the two first skbs in write queue to be sent,
+regardless of sk_wmem_alloc/sk_pacing_rate values.
+
+This helps a lot in situations where TX completions are delayed either
+because of driver latencies or softirq latencies.
+
+Test is done with no cache line misses.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ net/ipv4/tcp_output.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -2084,6 +2084,15 @@ static bool tcp_small_queue_check(struct
+ 	limit <<= factor;
+ 
+ 	if (atomic_read(&sk->sk_wmem_alloc) > limit) {
++		/* Always send the 1st or 2nd skb in write queue.
++		 * No need to wait for TX completion to call us back,
++		 * after softirq/tasklet schedule.
++		 * This helps when TX completions are delayed too much.
++		 */
++		if (skb == sk->sk_write_queue.next ||
++		    skb->prev == sk->sk_write_queue.next)
++			return false;
++
+ 		set_bit(TSQ_THROTTLED, &tcp_sk(sk)->tsq_flags);
+ 		/* It is possible TX completion already happened
+ 		 * before we set TSQ_THROTTLED, so we must
diff --git a/target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch b/target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch
new file mode 100644
index 0000000..f0ae2a9
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-6-tcp-tcp_mtu_probe-is-likely-to-exit-early.patch
@@ -0,0 +1,55 @@
+From 12a59abc22d6664f7d3944f625ceefee92de8820 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:55 -0800
+Subject: [PATCH 06/10] tcp: tcp_mtu_probe() is likely to exit early
+
+Adding a likely() in tcp_mtu_probe() moves its code which used to
+be inlined in front of tcp_write_xmit()
+
+We still have a cache line miss to access icsk->icsk_mtup.enabled,
+we will probably have to reorganize fields to help data locality.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ net/ipv4/tcp_output.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -1925,26 +1925,26 @@ static inline void tcp_mtu_check_reprobe
+  */
+ static int tcp_mtu_probe(struct sock *sk)
+ {
+-	struct tcp_sock *tp = tcp_sk(sk);
+ 	struct inet_connection_sock *icsk = inet_csk(sk);
++	struct tcp_sock *tp = tcp_sk(sk);
+ 	struct sk_buff *skb, *nskb, *next;
+ 	struct net *net = sock_net(sk);
+-	int len;
+ 	int probe_size;
+ 	int size_needed;
+-	int copy;
++	int copy, len;
+ 	int mss_now;
+ 	int interval;
+ 
+ 	/* Not currently probing/verifying,
+ 	 * not in recovery,
+ 	 * have enough cwnd, and
+-	 * not SACKing (the variable headers throw things off) */
+-	if (!icsk->icsk_mtup.enabled ||
+-	    icsk->icsk_mtup.probe_size ||
+-	    inet_csk(sk)->icsk_ca_state != TCP_CA_Open ||
+-	    tp->snd_cwnd < 11 ||
+-	    tp->rx_opt.num_sacks || tp->rx_opt.dsack)
++	 * not SACKing (the variable headers throw things off)
++	 */
++	if (likely(!icsk->icsk_mtup.enabled ||
++		   icsk->icsk_mtup.probe_size ||
++		   inet_csk(sk)->icsk_ca_state != TCP_CA_Open ||
++		   tp->snd_cwnd < 11 ||
++		   tp->rx_opt.num_sacks || tp->rx_opt.dsack))
+ 		return -1;
+ 
+ 	/* Use binary search for probe_size between tcp_mss_base,
diff --git a/target/linux/generic/backport-4.9/024-7-net-reorganize-struct-sock-for-better-data-locality.patch b/target/linux/generic/backport-4.9/024-7-net-reorganize-struct-sock-for-better-data-locality.patch
new file mode 100644
index 0000000..e8c1915
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-7-net-reorganize-struct-sock-for-better-data-locality.patch
@@ -0,0 +1,157 @@
+From 9115e8cd2a0c6eaaa900c462721f12e1d45f326c Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:56 -0800
+Subject: [PATCH 07/10] net: reorganize struct sock for better data locality
+
+Group fields used in TX path, and keep some cache lines mostly read
+to permit sharing among cpus.
+
+Gained two 4 bytes holes on 64bit arches.
+
+Added a place holder for tcp tsq_flags, next to sk_wmem_alloc
+to speed up tcp_wfree() in the following patch.
+
+I have not added ____cacheline_aligned_in_smp, this might be done later.
+I prefer doing this once inet and tcp/udp sockets reorg is also done.
+
+Tested with both TCP and UDP.
+
+UDP receiver performance under flood increased by ~20 % :
+Accessing sk_filter/sk_wq/sk_napi_id no longer stalls because sk_drops
+was moved away from a critical cache line, now mostly read and shared.
+
+	/* --- cacheline 4 boundary (256 bytes) --- */
+	unsigned int               sk_napi_id;           /* 0x100   0x4 */
+	int                        sk_rcvbuf;            /* 0x104   0x4 */
+	struct sk_filter *         sk_filter;            /* 0x108   0x8 */
+	union {
+		struct socket_wq * sk_wq;                /*         0x8 */
+		struct socket_wq * sk_wq_raw;            /*         0x8 */
+	};                                               /* 0x110   0x8 */
+	struct xfrm_policy *       sk_policy[2];         /* 0x118  0x10 */
+	struct dst_entry *         sk_rx_dst;            /* 0x128   0x8 */
+	struct dst_entry *         sk_dst_cache;         /* 0x130   0x8 */
+	atomic_t                   sk_omem_alloc;        /* 0x138   0x4 */
+	int                        sk_sndbuf;            /* 0x13c   0x4 */
+	/* --- cacheline 5 boundary (320 bytes) --- */
+	int                        sk_wmem_queued;       /* 0x140   0x4 */
+	atomic_t                   sk_wmem_alloc;        /* 0x144   0x4 */
+	long unsigned int          sk_tsq_flags;         /* 0x148   0x8 */
+	struct sk_buff *           sk_send_head;         /* 0x150   0x8 */
+	struct sk_buff_head        sk_write_queue;       /* 0x158  0x18 */
+	__s32                      sk_peek_off;          /* 0x170   0x4 */
+	int                        sk_write_pending;     /* 0x174   0x4 */
+	long int                   sk_sndtimeo;          /* 0x178   0x8 */
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Tested-by: Paolo Abeni <pabeni at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ include/net/sock.h | 51 +++++++++++++++++++++++++++------------------------
+ 1 file changed, 27 insertions(+), 24 deletions(-)
+
+--- a/include/net/sock.h
++++ b/include/net/sock.h
+@@ -343,6 +343,9 @@ struct sock {
+ #define sk_rxhash		__sk_common.skc_rxhash
+ 
+ 	socket_lock_t		sk_lock;
++	atomic_t		sk_drops;
++	int			sk_rcvlowat;
++	struct sk_buff_head	sk_error_queue;
+ 	struct sk_buff_head	sk_receive_queue;
+ 	/*
+ 	 * The backlog queue is special, it is always used with
+@@ -359,14 +362,13 @@ struct sock {
+ 		struct sk_buff	*tail;
+ 	} sk_backlog;
+ #define sk_rmem_alloc sk_backlog.rmem_alloc
+-	int			sk_forward_alloc;
+ 
+-	__u32			sk_txhash;
++	int			sk_forward_alloc;
+ #ifdef CONFIG_NET_RX_BUSY_POLL
+-	unsigned int		sk_napi_id;
+ 	unsigned int		sk_ll_usec;
++	/* ===== mostly read cache line ===== */
++	unsigned int		sk_napi_id;
+ #endif
+-	atomic_t		sk_drops;
+ 	int			sk_rcvbuf;
+ 
+ 	struct sk_filter __rcu	*sk_filter;
+@@ -379,11 +381,30 @@ struct sock {
+ #endif
+ 	struct dst_entry	*sk_rx_dst;
+ 	struct dst_entry __rcu	*sk_dst_cache;
+-	/* Note: 32bit hole on 64bit arches */
+-	atomic_t		sk_wmem_alloc;
+ 	atomic_t		sk_omem_alloc;
+ 	int			sk_sndbuf;
++
++	/* ===== cache line for TX ===== */
++	int			sk_wmem_queued;
++	atomic_t		sk_wmem_alloc;
++	unsigned long		sk_tsq_flags;
++	struct sk_buff		*sk_send_head;
+ 	struct sk_buff_head	sk_write_queue;
++	__s32			sk_peek_off;
++	int			sk_write_pending;
++	long			sk_sndtimeo;
++	struct timer_list	sk_timer;
++	__u32			sk_priority;
++	__u32			sk_mark;
++	u32			sk_pacing_rate; /* bytes per second */
++	u32			sk_max_pacing_rate;
++	struct page_frag	sk_frag;
++	netdev_features_t	sk_route_caps;
++	netdev_features_t	sk_route_nocaps;
++	int			sk_gso_type;
++	unsigned int		sk_gso_max_size;
++	gfp_t			sk_allocation;
++	__u32			sk_txhash;
+ 
+ 	/*
+ 	 * Because of non atomicity rules, all
+@@ -399,41 +420,23 @@ struct sock {
+ #define SK_PROTOCOL_MAX U8_MAX
+ 	kmemcheck_bitfield_end(flags);
+ 
+-	int			sk_wmem_queued;
+-	gfp_t			sk_allocation;
+-	u32			sk_pacing_rate; /* bytes per second */
+-	u32			sk_max_pacing_rate;
+-	netdev_features_t	sk_route_caps;
+-	netdev_features_t	sk_route_nocaps;
+-	int			sk_gso_type;
+-	unsigned int		sk_gso_max_size;
+ 	u16			sk_gso_max_segs;
+-	int			sk_rcvlowat;
+ 	unsigned long	        sk_lingertime;
+-	struct sk_buff_head	sk_error_queue;
+ 	struct proto		*sk_prot_creator;
+ 	rwlock_t		sk_callback_lock;
+ 	int			sk_err,
+ 				sk_err_soft;
+ 	u32			sk_ack_backlog;
+ 	u32			sk_max_ack_backlog;
+-	__u32			sk_priority;
+-	__u32			sk_mark;
+ 	struct pid		*sk_peer_pid;
+ 	const struct cred	*sk_peer_cred;
+ 	long			sk_rcvtimeo;
+-	long			sk_sndtimeo;
+-	struct timer_list	sk_timer;
+ 	ktime_t			sk_stamp;
+ 	u16			sk_tsflags;
+ 	u8			sk_shutdown;
+ 	u32			sk_tskey;
+ 	struct socket		*sk_socket;
+ 	void			*sk_user_data;
+-	struct page_frag	sk_frag;
+-	struct sk_buff		*sk_send_head;
+-	__s32			sk_peek_off;
+-	int			sk_write_pending;
+ #ifdef CONFIG_SECURITY
+ 	void			*sk_security;
+ #endif
diff --git a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch
new file mode 100644
index 0000000..545fe60
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch
@@ -0,0 +1,176 @@
+From 7aa5470c2c09265902b5e4289afa82e4e7c2987e Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Sat, 3 Dec 2016 11:14:57 -0800
+Subject: [PATCH 08/10] tcp: tsq: move tsq_flags close to sk_wmem_alloc
+
+tsq_flags being in the same cache line than sk_wmem_alloc
+makes a lot of sense. Both fields are changed from tcp_wfree()
+and more generally by various TSQ related functions.
+
+Prior patch made room in struct sock and added sk_tsq_flags,
+this patch deletes tsq_flags from struct tcp_sock.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ include/linux/tcp.h   |  1 -
+ net/ipv4/tcp.c        |  4 ++--
+ net/ipv4/tcp_ipv4.c   |  2 +-
+ net/ipv4/tcp_output.c | 24 +++++++++++-------------
+ net/ipv4/tcp_timer.c  |  4 ++--
+ net/ipv6/tcp_ipv6.c   |  2 +-
+ 6 files changed, 17 insertions(+), 20 deletions(-)
+
+--- a/include/linux/tcp.h
++++ b/include/linux/tcp.h
+@@ -192,7 +192,6 @@ struct tcp_sock {
+ 	u32	tsoffset;	/* timestamp offset */
+ 
+ 	struct list_head tsq_node; /* anchor in tsq_tasklet.head list */
+-	unsigned long	tsq_flags;
+ 
+ 	/* Data for direct copy to user */
+ 	struct {
+--- a/net/ipv4/tcp.c
++++ b/net/ipv4/tcp.c
+@@ -665,9 +665,9 @@ static void tcp_push(struct sock *sk, in
+ 	if (tcp_should_autocork(sk, skb, size_goal)) {
+ 
+ 		/* avoid atomic op if TSQ_THROTTLED bit is already set */
+-		if (!test_bit(TSQ_THROTTLED, &tp->tsq_flags)) {
++		if (!test_bit(TSQ_THROTTLED, &sk->sk_tsq_flags)) {
+ 			NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPAUTOCORKING);
+-			set_bit(TSQ_THROTTLED, &tp->tsq_flags);
++			set_bit(TSQ_THROTTLED, &sk->sk_tsq_flags);
+ 		}
+ 		/* It is possible TX completion already happened
+ 		 * before we set TSQ_THROTTLED.
+--- a/net/ipv4/tcp_ipv4.c
++++ b/net/ipv4/tcp_ipv4.c
+@@ -446,7 +446,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb
+ 			if (!sock_owned_by_user(sk)) {
+ 				tcp_v4_mtu_reduced(sk);
+ 			} else {
+-				if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, &tp->tsq_flags))
++				if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, &sk->sk_tsq_flags))
+ 					sock_hold(sk);
+ 			}
+ 			goto out;
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -767,14 +767,15 @@ static void tcp_tasklet_func(unsigned lo
+ 	list_for_each_safe(q, n, &list) {
+ 		tp = list_entry(q, struct tcp_sock, tsq_node);
+ 		list_del(&tp->tsq_node);
+-		clear_bit(TSQ_QUEUED, &tp->tsq_flags);
+ 
+ 		sk = (struct sock *)tp;
++		clear_bit(TSQ_QUEUED, &sk->sk_tsq_flags);
++
+ 		if (!sk->sk_lock.owned &&
+-		    test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags)) {
++		    test_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags)) {
+ 			bh_lock_sock(sk);
+ 			if (!sock_owned_by_user(sk)) {
+-				clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
++				clear_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags);
+ 				tcp_tsq_handler(sk);
+ 			}
+ 			bh_unlock_sock(sk);
+@@ -797,16 +798,15 @@ static void tcp_tasklet_func(unsigned lo
+  */
+ void tcp_release_cb(struct sock *sk)
+ {
+-	struct tcp_sock *tp = tcp_sk(sk);
+ 	unsigned long flags, nflags;
+ 
+ 	/* perform an atomic operation only if at least one flag is set */
+ 	do {
+-		flags = tp->tsq_flags;
++		flags = sk->sk_tsq_flags;
+ 		if (!(flags & TCP_DEFERRED_ALL))
+ 			return;
+ 		nflags = flags & ~TCP_DEFERRED_ALL;
+-	} while (cmpxchg(&tp->tsq_flags, flags, nflags) != flags);
++	} while (cmpxchg(&sk->sk_tsq_flags, flags, nflags) != flags);
+ 
+ 	if (flags & TCPF_TSQ_DEFERRED)
+ 		tcp_tsq_handler(sk);
+@@ -878,7 +878,7 @@ void tcp_wfree(struct sk_buff *skb)
+ 	if (wmem >= SKB_TRUESIZE(1) && this_cpu_ksoftirqd() == current)
+ 		goto out;
+ 
+-	for (oval = READ_ONCE(tp->tsq_flags);; oval = nval) {
++	for (oval = READ_ONCE(sk->sk_tsq_flags);; oval = nval) {
+ 		struct tsq_tasklet *tsq;
+ 		bool empty;
+ 
+@@ -886,7 +886,7 @@ void tcp_wfree(struct sk_buff *skb)
+ 			goto out;
+ 
+ 		nval = (oval & ~TSQF_THROTTLED) | TSQF_QUEUED | TCPF_TSQ_DEFERRED;
+-		nval = cmpxchg(&tp->tsq_flags, oval, nval);
++		nval = cmpxchg(&sk->sk_tsq_flags, oval, nval);
+ 		if (nval != oval)
+ 			continue;
+ 
+@@ -2093,7 +2093,7 @@ static bool tcp_small_queue_check(struct
+ 		    skb->prev == sk->sk_write_queue.next)
+ 			return false;
+ 
+-		set_bit(TSQ_THROTTLED, &tcp_sk(sk)->tsq_flags);
++		set_bit(TSQ_THROTTLED, &sk->sk_tsq_flags);
+ 		/* It is possible TX completion already happened
+ 		 * before we set TSQ_THROTTLED, so we must
+ 		 * test again the condition.
+@@ -2191,8 +2191,8 @@ static bool tcp_write_xmit(struct sock *
+ 		    unlikely(tso_fragment(sk, skb, limit, mss_now, gfp)))
+ 			break;
+ 
+-		if (test_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags))
+-			clear_bit(TCP_TSQ_DEFERRED, &tp->tsq_flags);
++		if (test_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags))
++			clear_bit(TCP_TSQ_DEFERRED, &sk->sk_tsq_flags);
+ 		if (tcp_small_queue_check(sk, skb, 0))
+ 			break;
+ 
+@@ -3495,8 +3495,6 @@ void tcp_send_ack(struct sock *sk)
+ 	/* We do not want pure acks influencing TCP Small Queues or fq/pacing
+ 	 * too much.
+ 	 * SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784
+-	 * We also avoid tcp_wfree() overhead (cache line miss accessing
+-	 * tp->tsq_flags) by using regular sock_wfree()
+ 	 */
+ 	skb_set_tcp_pure_ack(buff);
+ 
+--- a/net/ipv4/tcp_timer.c
++++ b/net/ipv4/tcp_timer.c
+@@ -311,7 +311,7 @@ static void tcp_delack_timer(unsigned lo
+ 		inet_csk(sk)->icsk_ack.blocked = 1;
+ 		__NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOCKED);
+ 		/* deleguate our work to tcp_release_cb() */
+-		if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags))
++		if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED, &sk->sk_tsq_flags))
+ 			sock_hold(sk);
+ 	}
+ 	bh_unlock_sock(sk);
+@@ -594,7 +594,7 @@ static void tcp_write_timer(unsigned lon
+ 		tcp_write_timer_handler(sk);
+ 	} else {
+ 		/* delegate our work to tcp_release_cb() */
+-		if (!test_and_set_bit(TCP_WRITE_TIMER_DEFERRED, &tcp_sk(sk)->tsq_flags))
++		if (!test_and_set_bit(TCP_WRITE_TIMER_DEFERRED, &sk->sk_tsq_flags))
+ 			sock_hold(sk);
+ 	}
+ 	bh_unlock_sock(sk);
+--- a/net/ipv6/tcp_ipv6.c
++++ b/net/ipv6/tcp_ipv6.c
+@@ -404,7 +404,7 @@ static void tcp_v6_err(struct sk_buff *s
+ 		if (!sock_owned_by_user(sk))
+ 			tcp_v6_mtu_reduced(sk);
+ 		else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED,
+-					   &tp->tsq_flags))
++					   &sk->sk_tsq_flags))
+ 			sock_hold(sk);
+ 		goto out;
+ 	}
diff --git a/target/linux/generic/backport-4.9/024-9-tcp-add-a-missing-barrier-in-tcp_tasklet_func.patch b/target/linux/generic/backport-4.9/024-9-tcp-add-a-missing-barrier-in-tcp_tasklet_func.patch
new file mode 100644
index 0000000..d2b8de6
--- /dev/null
+++ b/target/linux/generic/backport-4.9/024-9-tcp-add-a-missing-barrier-in-tcp_tasklet_func.patch
@@ -0,0 +1,40 @@
+From 0a9648f1293966c838dc570da73c15a76f4c89d6 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Wed, 21 Dec 2016 05:42:43 -0800
+Subject: [PATCH 09/10] tcp: add a missing barrier in tcp_tasklet_func()
+
+Madalin reported crashes happening in tcp_tasklet_func() on powerpc64
+
+Before TSQ_QUEUED bit is cleared, we must ensure the changes done
+by list_del(&tp->tsq_node); are committed to memory, otherwise
+corruption might happen, as an other cpu could catch TSQ_QUEUED
+clearance too soon.
+
+We can notice that old kernels were immune to this bug, because
+TSQ_QUEUED was cleared after a bh_lock_sock(sk)/bh_unlock_sock(sk)
+section, but they could have missed a kick to write additional bytes,
+when NIC interrupts for a given flow are spread to multiple cpus.
+
+Affected TCP flows would need an incoming ACK or RTO timer to add more
+packets to the pipe. So overall situation should be better now.
+
+Fixes: b223feb9de2a ("tcp: tsq: add shortcut in tcp_tasklet_func()")
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Reported-by: Madalin Bucur <madalin.bucur at nxp.com>
+Tested-by: Madalin Bucur <madalin.bucur at nxp.com>
+Tested-by: Xing Lei <xing.lei at nxp.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ net/ipv4/tcp_output.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -769,6 +769,7 @@ static void tcp_tasklet_func(unsigned lo
+ 		list_del(&tp->tsq_node);
+ 
+ 		sk = (struct sock *)tp;
++		smp_mb__before_atomic();
+ 		clear_bit(TSQ_QUEUED, &sk->sk_tsq_flags);
+ 
+ 		if (!sk->sk_lock.owned &&


From lede-commits at lists.infradead.org  Sun Oct  8 06:35:46 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 09:35:46 -0400
Subject: [source]  kernel: split 82574L patch into multiple files
In-Reply-To: <20171008133541.12192.70272@git-01.infra.lede-project.org>
References: <20171008133541.12192.70272@git-01.infra.lede-project.org>
Message-ID: <mailman.53234.1507469786.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/3a69ad3b2a0df578ca340ba95f35230ee9529c9c

commit 3a69ad3b2a0df578ca340ba95f35230ee9529c9c
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sun Oct 8 14:58:59 2017 +0300

    kernel: split 82574L patch into multiple files
    
    When refreshing patches that cointain multiple patches including headers
    in a single file, quilt will remove the headers from all but the first
    patch. This makes it difficult to review commits that refresh patches.
    Next to that, if only a few of the patch series are accepted in -stable,
    the patch needs to be manually modified. With each patch in a separate
    file, it's just a matter of git rm.
    
    Refresh patches while at it.
    
    Patchwork links:
    [1/5] https://patchwork.kernel.org/patch/9857487/
    [2/5] https://patchwork.kernel.org/patch/9857489/
    [3/5] https://patchwork.kernel.org/patch/9857495/
    [4/5] https://patchwork.kernel.org/patch/9857491/
    [5/5] https://patchwork.kernel.org/patch/9857493/
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 ...5-e1000e-Fix-error-path-in-link-detection.patch |  52 ++++
 ...x-wrong-comment-related-to-link-detection.patch |  43 +++
 .../190-3-5-e1000e-Fix-return-value-test.patch     |  32 ++
 ...Separate-signaling-for-link-check-link-up.patch |  90 ++++++
 ...e-Avoid-receiver-overrun-interrupt-bursts.patch | 109 +++++++
 ...190-e100e-avoid-receiver-interrupt-bursts.patch | 327 ---------------------
 6 files changed, 326 insertions(+), 327 deletions(-)

diff --git a/target/linux/generic/pending-4.9/190-1-5-e1000e-Fix-error-path-in-link-detection.patch b/target/linux/generic/pending-4.9/190-1-5-e1000e-Fix-error-path-in-link-detection.patch
new file mode 100644
index 0000000..8ed91db
--- /dev/null
+++ b/target/linux/generic/pending-4.9/190-1-5-e1000e-Fix-error-path-in-link-detection.patch
@@ -0,0 +1,52 @@
+From patchwork Fri Jul 21 18:36:23 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [1/5] e1000e: Fix error path in link detection
+From: Benjamin Poirier <bpoirier at suse.com>
+X-Patchwork-Id: 9857487
+Message-Id: <20170721183627.13373-1-bpoirier at suse.com>
+To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Cc: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>,
+ intel-wired-lan at lists.osuosl.org, netdev at vger.kernel.org,
+ linux-kernel at vger.kernel.org
+Date: Fri, 21 Jul 2017 11:36:23 -0700
+
+In case of error from e1e_rphy(), the loop will exit early and "success"
+will be set to true erroneously.
+
+Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
+---
+ drivers/net/ethernet/intel/e1000e/phy.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/intel/e1000e/phy.c
++++ b/drivers/net/ethernet/intel/e1000e/phy.c
+@@ -1744,6 +1744,7 @@ s32 e1000e_phy_has_link_generic(struct e
+ 	s32 ret_val = 0;
+ 	u16 i, phy_status;
+ 
++	*success = false;
+ 	for (i = 0; i < iterations; i++) {
+ 		/* Some PHYs require the MII_BMSR register to be read
+ 		 * twice due to the link bit being sticky.  No harm doing
+@@ -1763,16 +1764,16 @@ s32 e1000e_phy_has_link_generic(struct e
+ 		ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
+ 		if (ret_val)
+ 			break;
+-		if (phy_status & BMSR_LSTATUS)
++		if (phy_status & BMSR_LSTATUS) {
++			*success = true;
+ 			break;
++		}
+ 		if (usec_interval >= 1000)
+ 			msleep(usec_interval / 1000);
+ 		else
+ 			udelay(usec_interval);
+ 	}
+ 
+-	*success = (i < iterations);
+-
+ 	return ret_val;
+ }
+ 
diff --git a/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch
new file mode 100644
index 0000000..b3291db
--- /dev/null
+++ b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch
@@ -0,0 +1,43 @@
+From patchwork Fri Jul 21 18:36:24 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [2/5] e1000e: Fix wrong comment related to link detection
+From: Benjamin Poirier <bpoirier at suse.com>
+X-Patchwork-Id: 9857489
+Message-Id: <20170721183627.13373-2-bpoirier at suse.com>
+To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Cc: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>,
+ intel-wired-lan at lists.osuosl.org, netdev at vger.kernel.org,
+ linux-kernel at vger.kernel.org
+Date: Fri, 21 Jul 2017 11:36:24 -0700
+
+Reading e1000e_check_for_copper_link() shows that get_link_status is set to
+false after link has been detected. Therefore, it stays TRUE until then.
+
+Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
+Tested-by: Aaron Brown <aaron.f.brown at intel.com>
+---
+ drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/intel/e1000e/netdev.c
++++ b/drivers/net/ethernet/intel/e1000e/netdev.c
+@@ -5049,7 +5049,7 @@ static bool e1000e_has_link(struct e1000
+ 
+ 	/* get_link_status is set on LSC (link status) interrupt or
+ 	 * Rx sequence error interrupt.  get_link_status will stay
+-	 * false until the check_for_link establishes link
++	 * true until the check_for_link establishes link
+ 	 * for copper adapters ONLY
+ 	 */
+ 	switch (hw->phy.media_type) {
+@@ -5067,7 +5067,7 @@ static bool e1000e_has_link(struct e1000
+ 		break;
+ 	case e1000_media_type_internal_serdes:
+ 		ret_val = hw->mac.ops.check_for_link(hw);
+-		link_active = adapter->hw.mac.serdes_has_link;
++		link_active = hw->mac.serdes_has_link;
+ 		break;
+ 	default:
+ 	case e1000_media_type_unknown:
diff --git a/target/linux/generic/pending-4.9/190-3-5-e1000e-Fix-return-value-test.patch b/target/linux/generic/pending-4.9/190-3-5-e1000e-Fix-return-value-test.patch
new file mode 100644
index 0000000..a777138
--- /dev/null
+++ b/target/linux/generic/pending-4.9/190-3-5-e1000e-Fix-return-value-test.patch
@@ -0,0 +1,32 @@
+From patchwork Fri Jul 21 18:36:25 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [3/5] e1000e: Fix return value test
+From: Benjamin Poirier <bpoirier at suse.com>
+X-Patchwork-Id: 9857495
+Message-Id: <20170721183627.13373-3-bpoirier at suse.com>
+To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Cc: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>,
+ intel-wired-lan at lists.osuosl.org, netdev at vger.kernel.org,
+ linux-kernel at vger.kernel.org
+Date: Fri, 21 Jul 2017 11:36:25 -0700
+
+All the helpers return -E1000_ERR_PHY.
+
+Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
+---
+ drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/intel/e1000e/netdev.c
++++ b/drivers/net/ethernet/intel/e1000e/netdev.c
+@@ -5074,7 +5074,7 @@ static bool e1000e_has_link(struct e1000
+ 		break;
+ 	}
+ 
+-	if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) &&
++	if ((ret_val == -E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) &&
+ 	    (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) {
+ 		/* See e1000_kmrn_lock_loss_workaround_ich8lan() */
+ 		e_info("Gigabit has been disabled, downgrading speed\n");
diff --git a/target/linux/generic/pending-4.9/190-4-5-e1000e-Separate-signaling-for-link-check-link-up.patch b/target/linux/generic/pending-4.9/190-4-5-e1000e-Separate-signaling-for-link-check-link-up.patch
new file mode 100644
index 0000000..cc2cf73
--- /dev/null
+++ b/target/linux/generic/pending-4.9/190-4-5-e1000e-Separate-signaling-for-link-check-link-up.patch
@@ -0,0 +1,90 @@
+From patchwork Fri Jul 21 18:36:26 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [4/5] e1000e: Separate signaling for link check/link up
+From: Benjamin Poirier <bpoirier at suse.com>
+X-Patchwork-Id: 9857491
+Message-Id: <20170721183627.13373-4-bpoirier at suse.com>
+To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Cc: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>,
+ intel-wired-lan at lists.osuosl.org, netdev at vger.kernel.org,
+ linux-kernel at vger.kernel.org
+Date: Fri, 21 Jul 2017 11:36:26 -0700
+
+Lennart reported the following race condition:
+
+\ e1000_watchdog_task
+    \ e1000e_has_link
+        \ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link
+            /* link is up */
+            mac->get_link_status = false;
+
+                            /* interrupt */
+                            \ e1000_msix_other
+                                hw->mac.get_link_status = true;
+
+        link_active = !hw->mac.get_link_status
+        /* link_active is false, wrongly */
+
+This problem arises because the single flag get_link_status is used to
+signal two different states: link status needs checking and link status is
+down.
+
+Avoid the problem by using the return value of .check_for_link to signal
+the link status to e1000e_has_link().
+
+Reported-by: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
+Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
+---
+ drivers/net/ethernet/intel/e1000e/mac.c    | 11 ++++++++---
+ drivers/net/ethernet/intel/e1000e/netdev.c |  2 +-
+ 2 files changed, 9 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/intel/e1000e/mac.c
++++ b/drivers/net/ethernet/intel/e1000e/mac.c
+@@ -410,6 +410,9 @@ void e1000e_clear_hw_cntrs_base(struct e
+  *  Checks to see of the link status of the hardware has changed.  If a
+  *  change in link status has been detected, then we read the PHY registers
+  *  to get the current speed/duplex if link exists.
++ *
++ *  Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link
++ *  up).
+  **/
+ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
+ {
+@@ -423,7 +426,7 @@ s32 e1000e_check_for_copper_link(struct
+ 	 * Change or Rx Sequence Error interrupt.
+ 	 */
+ 	if (!mac->get_link_status)
+-		return 0;
++		return 1;
+ 
+ 	/* First we want to see if the MII Status Register reports
+ 	 * link.  If so, then we want to get the current speed/duplex
+@@ -461,10 +464,12 @@ s32 e1000e_check_for_copper_link(struct
+ 	 * different link partner.
+ 	 */
+ 	ret_val = e1000e_config_fc_after_link_up(hw);
+-	if (ret_val)
++	if (ret_val) {
+ 		e_dbg("Error configuring flow control\n");
++		return ret_val;
++	}
+ 
+-	return ret_val;
++	return 1;
+ }
+ 
+ /**
+--- a/drivers/net/ethernet/intel/e1000e/netdev.c
++++ b/drivers/net/ethernet/intel/e1000e/netdev.c
+@@ -5056,7 +5056,7 @@ static bool e1000e_has_link(struct e1000
+ 	case e1000_media_type_copper:
+ 		if (hw->mac.get_link_status) {
+ 			ret_val = hw->mac.ops.check_for_link(hw);
+-			link_active = !hw->mac.get_link_status;
++			link_active = ret_val > 0;
+ 		} else {
+ 			link_active = true;
+ 		}
diff --git a/target/linux/generic/pending-4.9/190-5-5-e1000e-Avoid-receiver-overrun-interrupt-bursts.patch b/target/linux/generic/pending-4.9/190-5-5-e1000e-Avoid-receiver-overrun-interrupt-bursts.patch
new file mode 100644
index 0000000..b42fed2
--- /dev/null
+++ b/target/linux/generic/pending-4.9/190-5-5-e1000e-Avoid-receiver-overrun-interrupt-bursts.patch
@@ -0,0 +1,109 @@
+From patchwork Fri Jul 21 18:36:27 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [5/5] e1000e: Avoid receiver overrun interrupt bursts
+From: Benjamin Poirier <bpoirier at suse.com>
+X-Patchwork-Id: 9857493
+Message-Id: <20170721183627.13373-5-bpoirier at suse.com>
+To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
+Cc: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>,
+ intel-wired-lan at lists.osuosl.org, netdev at vger.kernel.org,
+ linux-kernel at vger.kernel.org
+Date: Fri, 21 Jul 2017 11:36:27 -0700
+
+When e1000e_poll() is not fast enough to keep up with incoming traffic, the
+adapter (when operating in msix mode) raises the Other interrupt to signal
+Receiver Overrun.
+
+This is a double problem because 1) at the moment e1000_msix_other()
+assumes that it is only called in case of Link Status Change and 2) if the
+condition persists, the interrupt is repeatedly raised again in quick
+succession.
+
+Ideally we would configure the Other interrupt to not be raised in case of
+receiver overrun but this doesn't seem possible on this adapter. Instead,
+we handle the first part of the problem by reverting to the practice of
+reading ICR in the other interrupt handler, like before commit 16ecba59bc33
+("e1000e: Do not read ICR in Other interrupt"). Thanks to commit
+0a8047ac68e5 ("e1000e: Fix msi-x interrupt automask") which cleared IAME
+from CTRL_EXT, reading ICR doesn't interfere with RxQ0, TxQ0 interrupts
+anymore. We handle the second part of the problem by not re-enabling the
+Other interrupt right away when there is overrun. Instead, we wait until
+traffic subsides, napi polling mode is exited and interrupts are
+re-enabled.
+
+Reported-by: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
+Fixes: 16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt")
+Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
+---
+ drivers/net/ethernet/intel/e1000e/defines.h |  1 +
+ drivers/net/ethernet/intel/e1000e/netdev.c  | 33 +++++++++++++++++++++++------
+ 2 files changed, 27 insertions(+), 7 deletions(-)
+
+--- a/drivers/net/ethernet/intel/e1000e/defines.h
++++ b/drivers/net/ethernet/intel/e1000e/defines.h
+@@ -398,6 +398,7 @@
+ #define E1000_ICR_LSC           0x00000004 /* Link Status Change */
+ #define E1000_ICR_RXSEQ         0x00000008 /* Rx sequence error */
+ #define E1000_ICR_RXDMT0        0x00000010 /* Rx desc min. threshold (0) */
++#define E1000_ICR_RXO           0x00000040 /* Receiver Overrun */
+ #define E1000_ICR_RXT0          0x00000080 /* Rx timer intr (ring 0) */
+ #define E1000_ICR_ECCER         0x00400000 /* Uncorrectable ECC Error */
+ /* If this bit asserted, the driver should claim the interrupt */
+--- a/drivers/net/ethernet/intel/e1000e/netdev.c
++++ b/drivers/net/ethernet/intel/e1000e/netdev.c
+@@ -1905,12 +1905,30 @@ static irqreturn_t e1000_msix_other(int
+ 	struct net_device *netdev = data;
+ 	struct e1000_adapter *adapter = netdev_priv(netdev);
+ 	struct e1000_hw *hw = &adapter->hw;
++	u32 icr;
++	bool enable = true;
+ 
+-	hw->mac.get_link_status = true;
++	icr = er32(ICR);
++	if (icr & E1000_ICR_RXO) {
++		ew32(ICR, E1000_ICR_RXO);
++		enable = false;
++		/* napi poll will re-enable Other, make sure it runs */
++		if (napi_schedule_prep(&adapter->napi)) {
++			adapter->total_rx_bytes = 0;
++			adapter->total_rx_packets = 0;
++			__napi_schedule(&adapter->napi);
++		}
++	}
++	if (icr & E1000_ICR_LSC) {
++		ew32(ICR, E1000_ICR_LSC);
++		hw->mac.get_link_status = true;
++		/* guard against interrupt when we're going down */
++		if (!test_bit(__E1000_DOWN, &adapter->state)) {
++			mod_timer(&adapter->watchdog_timer, jiffies + 1);
++		}
++	}
+ 
+-	/* guard against interrupt when we're going down */
+-	if (!test_bit(__E1000_DOWN, &adapter->state)) {
+-		mod_timer(&adapter->watchdog_timer, jiffies + 1);
++	if (enable && !test_bit(__E1000_DOWN, &adapter->state)) {
+ 		ew32(IMS, E1000_IMS_OTHER);
+ 	}
+ 
+@@ -2683,7 +2701,8 @@ static int e1000e_poll(struct napi_struc
+ 		napi_complete_done(napi, work_done);
+ 		if (!test_bit(__E1000_DOWN, &adapter->state)) {
+ 			if (adapter->msix_entries)
+-				ew32(IMS, adapter->rx_ring->ims_val);
++				ew32(IMS, adapter->rx_ring->ims_val |
++				     E1000_IMS_OTHER);
+ 			else
+ 				e1000_irq_enable(adapter);
+ 		}
+@@ -4178,7 +4197,7 @@ static void e1000e_trigger_lsc(struct e1
+ 	struct e1000_hw *hw = &adapter->hw;
+ 
+ 	if (adapter->msix_entries)
+-		ew32(ICS, E1000_ICS_OTHER);
++		ew32(ICS, E1000_ICS_LSC | E1000_ICS_OTHER);
+ 	else
+ 		ew32(ICS, E1000_ICS_LSC);
+ }
diff --git a/target/linux/generic/pending-4.9/190-e100e-avoid-receiver-interrupt-bursts.patch b/target/linux/generic/pending-4.9/190-e100e-avoid-receiver-interrupt-bursts.patch
deleted file mode 100644
index f2966fa..0000000
--- a/target/linux/generic/pending-4.9/190-e100e-avoid-receiver-interrupt-bursts.patch
+++ /dev/null
@@ -1,327 +0,0 @@
-Subject: [1/5] e1000e: Fix error path in link detection
-From: Benjamin Poirier <bpoirier at suse.com>
-X-Patchwork-Id: 792259
-Message-Id: <20170721183627.13373-1-bpoirier at suse.com>
-To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
-Cc: netdev at vger.kernel.org, intel-wired-lan at lists.osuosl.org,
- linux-kernel at vger.kernel.org,
- Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
-Date: Fri, 21 Jul 2017 11:36:23 -0700
-
-In case of error from e1e_rphy(), the loop will exit early and "success"
-will be set to true erroneously.
-
-Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
----
- drivers/net/ethernet/intel/e1000e/phy.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c
-index d78d47b41a71..86ff0969efb6 100644
---- a/drivers/net/ethernet/intel/e1000e/phy.c
-+++ b/drivers/net/ethernet/intel/e1000e/phy.c
-@@ -1744,6 +1744,7 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
- 	s32 ret_val = 0;
- 	u16 i, phy_status;
- 
-+	*success = false;
- 	for (i = 0; i < iterations; i++) {
- 		/* Some PHYs require the MII_BMSR register to be read
- 		 * twice due to the link bit being sticky.  No harm doing
-@@ -1763,16 +1764,16 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
- 		ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
- 		if (ret_val)
- 			break;
--		if (phy_status & BMSR_LSTATUS)
-+		if (phy_status & BMSR_LSTATUS) {
-+			*success = true;
- 			break;
-+		}
- 		if (usec_interval >= 1000)
- 			msleep(usec_interval / 1000);
- 		else
- 			udelay(usec_interval);
- 	}
- 
--	*success = (i < iterations);
--
- 	return ret_val;
- }
- 
-
-Subject: [2/5] e1000e: Fix wrong comment related to link detection
-From: Benjamin Poirier <bpoirier at suse.com>
-X-Patchwork-Id: 792257
-Message-Id: <20170721183627.13373-2-bpoirier at suse.com>
-To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
-Cc: netdev at vger.kernel.org, intel-wired-lan at lists.osuosl.org,
- linux-kernel at vger.kernel.org,
- Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
-Date: Fri, 21 Jul 2017 11:36:24 -0700
-
-Reading e1000e_check_for_copper_link() shows that get_link_status is set to
-false after link has been detected. Therefore, it stays TRUE until then.
-
-Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
----
- drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
-index 2dcb5463d9b8..58a87134d2e5 100644
---- a/drivers/net/ethernet/intel/e1000e/netdev.c
-+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
-@@ -5074,7 +5074,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
- 
- 	/* get_link_status is set on LSC (link status) interrupt or
- 	 * Rx sequence error interrupt.  get_link_status will stay
--	 * false until the check_for_link establishes link
-+	 * true until the check_for_link establishes link
- 	 * for copper adapters ONLY
- 	 */
- 	switch (hw->phy.media_type) {
-@@ -5092,7 +5092,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
- 		break;
- 	case e1000_media_type_internal_serdes:
- 		ret_val = hw->mac.ops.check_for_link(hw);
--		link_active = adapter->hw.mac.serdes_has_link;
-+		link_active = hw->mac.serdes_has_link;
- 		break;
- 	default:
- 	case e1000_media_type_unknown:
-
-Content-Transfer-Encoding: 7bit
-Subject: [3/5] e1000e: Fix return value test
-From: Benjamin Poirier <bpoirier at suse.com>
-X-Patchwork-Id: 792258
-Message-Id: <20170721183627.13373-3-bpoirier at suse.com>
-To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
-Cc: netdev at vger.kernel.org, intel-wired-lan at lists.osuosl.org,
- linux-kernel at vger.kernel.org,
- Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
-Date: Fri, 21 Jul 2017 11:36:25 -0700
-
-All the helpers return -E1000_ERR_PHY.
-
-Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
----
- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
-index 58a87134d2e5..fc6a1d9999b2 100644
---- a/drivers/net/ethernet/intel/e1000e/netdev.c
-+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
-@@ -5099,7 +5099,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
- 		break;
- 	}
- 
--	if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) &&
-+	if ((ret_val == -E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) &&
- 	    (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) {
- 		/* See e1000_kmrn_lock_loss_workaround_ich8lan() */
- 		e_info("Gigabit has been disabled, downgrading speed\n");
-
-Content-Transfer-Encoding: 7bit
-Subject: [4/5] e1000e: Separate signaling for link check/link up
-From: Benjamin Poirier <bpoirier at suse.com>
-X-Patchwork-Id: 792262
-Message-Id: <20170721183627.13373-4-bpoirier at suse.com>
-To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
-Cc: netdev at vger.kernel.org, intel-wired-lan at lists.osuosl.org,
- linux-kernel at vger.kernel.org,
- Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
-Date: Fri, 21 Jul 2017 11:36:26 -0700
-
-Lennart reported the following race condition:
-
-\ e1000_watchdog_task
-    \ e1000e_has_link
-        \ hw->mac.ops.check_for_link() === e1000e_check_for_copper_link
-            /* link is up */
-            mac->get_link_status = false;
-
-                            /* interrupt */
-                            \ e1000_msix_other
-                                hw->mac.get_link_status = true;
-
-        link_active = !hw->mac.get_link_status
-        /* link_active is false, wrongly */
-
-This problem arises because the single flag get_link_status is used to
-signal two different states: link status needs checking and link status is
-down.
-
-Avoid the problem by using the return value of .check_for_link to signal
-the link status to e1000e_has_link().
-
-Reported-by: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
-Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
----
- drivers/net/ethernet/intel/e1000e/mac.c    | 11 ++++++++---
- drivers/net/ethernet/intel/e1000e/netdev.c |  2 +-
- 2 files changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
-index b322011ec282..f457c5703d0c 100644
---- a/drivers/net/ethernet/intel/e1000e/mac.c
-+++ b/drivers/net/ethernet/intel/e1000e/mac.c
-@@ -410,6 +410,9 @@ void e1000e_clear_hw_cntrs_base(struct e1000_hw *hw)
-  *  Checks to see of the link status of the hardware has changed.  If a
-  *  change in link status has been detected, then we read the PHY registers
-  *  to get the current speed/duplex if link exists.
-+ *
-+ *  Returns a negative error code (-E1000_ERR_*) or 0 (link down) or 1 (link
-+ *  up).
-  **/
- s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
- {
-@@ -423,7 +426,7 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
- 	 * Change or Rx Sequence Error interrupt.
- 	 */
- 	if (!mac->get_link_status)
--		return 0;
-+		return 1;
- 
- 	/* First we want to see if the MII Status Register reports
- 	 * link.  If so, then we want to get the current speed/duplex
-@@ -461,10 +464,12 @@ s32 e1000e_check_for_copper_link(struct e1000_hw *hw)
- 	 * different link partner.
- 	 */
- 	ret_val = e1000e_config_fc_after_link_up(hw);
--	if (ret_val)
-+	if (ret_val) {
- 		e_dbg("Error configuring flow control\n");
-+		return ret_val;
-+	}
- 
--	return ret_val;
-+	return 1;
- }
- 
- /**
-diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
-index fc6a1d9999b2..5a8ab1136566 100644
---- a/drivers/net/ethernet/intel/e1000e/netdev.c
-+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
-@@ -5081,7 +5081,7 @@ static bool e1000e_has_link(struct e1000_adapter *adapter)
- 	case e1000_media_type_copper:
- 		if (hw->mac.get_link_status) {
- 			ret_val = hw->mac.ops.check_for_link(hw);
--			link_active = !hw->mac.get_link_status;
-+			link_active = ret_val > 0;
- 		} else {
- 			link_active = true;
- 		}
-
-Content-Transfer-Encoding: 7bit
-Subject: [5/5] e1000e: Avoid receiver overrun interrupt bursts
-From: Benjamin Poirier <bpoirier at suse.com>
-X-Patchwork-Id: 792260
-Message-Id: <20170721183627.13373-5-bpoirier at suse.com>
-To: Jeff Kirsher <jeffrey.t.kirsher at intel.com>
-Cc: netdev at vger.kernel.org, intel-wired-lan at lists.osuosl.org,
- linux-kernel at vger.kernel.org,
- Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
-Date: Fri, 21 Jul 2017 11:36:27 -0700
-
-When e1000e_poll() is not fast enough to keep up with incoming traffic, the
-adapter (when operating in msix mode) raises the Other interrupt to signal
-Receiver Overrun.
-
-This is a double problem because 1) at the moment e1000_msix_other()
-assumes that it is only called in case of Link Status Change and 2) if the
-condition persists, the interrupt is repeatedly raised again in quick
-succession.
-
-Ideally we would configure the Other interrupt to not be raised in case of
-receiver overrun but this doesn't seem possible on this adapter. Instead,
-we handle the first part of the problem by reverting to the practice of
-reading ICR in the other interrupt handler, like before commit 16ecba59bc33
-("e1000e: Do not read ICR in Other interrupt"). Thanks to commit
-0a8047ac68e5 ("e1000e: Fix msi-x interrupt automask") which cleared IAME
-from CTRL_EXT, reading ICR doesn't interfere with RxQ0, TxQ0 interrupts
-anymore. We handle the second part of the problem by not re-enabling the
-Other interrupt right away when there is overrun. Instead, we wait until
-traffic subsides, napi polling mode is exited and interrupts are
-re-enabled.
-
-Reported-by: Lennart Sorensen <lsorense at csclub.uwaterloo.ca>
-Fixes: 16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt")
-Signed-off-by: Benjamin Poirier <bpoirier at suse.com>
----
- drivers/net/ethernet/intel/e1000e/defines.h |  1 +
- drivers/net/ethernet/intel/e1000e/netdev.c  | 33 +++++++++++++++++++++++------
- 2 files changed, 27 insertions(+), 7 deletions(-)
-
-diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h
-index 0641c0098738..afb7ebe20b24 100644
---- a/drivers/net/ethernet/intel/e1000e/defines.h
-+++ b/drivers/net/ethernet/intel/e1000e/defines.h
-@@ -398,6 +398,7 @@
- #define E1000_ICR_LSC           0x00000004 /* Link Status Change */
- #define E1000_ICR_RXSEQ         0x00000008 /* Rx sequence error */
- #define E1000_ICR_RXDMT0        0x00000010 /* Rx desc min. threshold (0) */
-+#define E1000_ICR_RXO           0x00000040 /* Receiver Overrun */
- #define E1000_ICR_RXT0          0x00000080 /* Rx timer intr (ring 0) */
- #define E1000_ICR_ECCER         0x00400000 /* Uncorrectable ECC Error */
- /* If this bit asserted, the driver should claim the interrupt */
-diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
-index 5a8ab1136566..803edd1a6401 100644
---- a/drivers/net/ethernet/intel/e1000e/netdev.c
-+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
-@@ -1910,12 +1910,30 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data)
- 	struct net_device *netdev = data;
- 	struct e1000_adapter *adapter = netdev_priv(netdev);
- 	struct e1000_hw *hw = &adapter->hw;
-+	u32 icr;
-+	bool enable = true;
-+
-+	icr = er32(ICR);
-+	if (icr & E1000_ICR_RXO) {
-+		ew32(ICR, E1000_ICR_RXO);
-+		enable = false;
-+		/* napi poll will re-enable Other, make sure it runs */
-+		if (napi_schedule_prep(&adapter->napi)) {
-+			adapter->total_rx_bytes = 0;
-+			adapter->total_rx_packets = 0;
-+			__napi_schedule(&adapter->napi);
-+		}
-+	}
-+	if (icr & E1000_ICR_LSC) {
-+		ew32(ICR, E1000_ICR_LSC);
-+		hw->mac.get_link_status = true;
-+		/* guard against interrupt when we're going down */
-+		if (!test_bit(__E1000_DOWN, &adapter->state)) {
-+			mod_timer(&adapter->watchdog_timer, jiffies + 1);
-+		}
-+	}
- 
--	hw->mac.get_link_status = true;
--
--	/* guard against interrupt when we're going down */
--	if (!test_bit(__E1000_DOWN, &adapter->state)) {
--		mod_timer(&adapter->watchdog_timer, jiffies + 1);
-+	if (enable && !test_bit(__E1000_DOWN, &adapter->state)) {
- 		ew32(IMS, E1000_IMS_OTHER);
- 	}
- 
-@@ -2687,7 +2705,8 @@ static int e1000e_poll(struct napi_struct *napi, int weight)
- 		napi_complete_done(napi, work_done);
- 		if (!test_bit(__E1000_DOWN, &adapter->state)) {
- 			if (adapter->msix_entries)
--				ew32(IMS, adapter->rx_ring->ims_val);
-+				ew32(IMS, adapter->rx_ring->ims_val |
-+				     E1000_IMS_OTHER);
- 			else
- 				e1000_irq_enable(adapter);
- 		}
-@@ -4204,7 +4223,7 @@ static void e1000e_trigger_lsc(struct e1000_adapter *adapter)
- 	struct e1000_hw *hw = &adapter->hw;
- 
- 	if (adapter->msix_entries)
--		ew32(ICS, E1000_ICS_OTHER);
-+		ew32(ICS, E1000_ICS_LSC | E1000_ICS_OTHER);
- 	else
- 		ew32(ICS, E1000_ICS_LSC);
- }


From lede-commits at lists.infradead.org  Sun Oct  8 06:35:48 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 09:35:48 -0400
Subject: [source]  generic: net: generalize napi_complete_done
In-Reply-To: <20171008133541.12192.70272@git-01.infra.lede-project.org>
References: <20171008133541.12192.70272@git-01.infra.lede-project.org>
Message-ID: <mailman.53237.1507469794.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/9aeb7ce8dc53dc4a83f05b5bb707cb79e7959f66

commit 9aeb7ce8dc53dc4a83f05b5bb707cb79e7959f66
Author: Pavel Kubelun <be.dissent at gmail.com>
AuthorDate: Thu Sep 7 05:52:43 2017 -0400

    generic: net: generalize napi_complete_done
    
    Backport upstream commit that improves ethernet performance by a
    small amount.
    
    Compile and run tested on ipq8065.
    
    Signed-off-by: Pavel Kubelun <be.dissent at gmail.com>
---
 .../090-net-generalize-napi_complete_done.patch    | 1412 ++++++++++++++++++++
 1 file changed, 1412 insertions(+)

diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
new file mode 100644
index 0000000..e1541e9
--- /dev/null
+++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch
@@ -0,0 +1,1412 @@
+From 6ad20165d376fa07919a70e4f43dfae564601829 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet at google.com>
+Date: Mon, 30 Jan 2017 08:22:01 -0800
+Subject: drivers: net: generalize napi_complete_done()
+
+napi_complete_done() allows to opt-in for gro_flush_timeout,
+added back in linux-3.19, commit 3b47d30396ba
+("net: gro: add a per device gro flush timer")
+
+This allows for more efficient GRO aggregation without
+sacrifying latencies.
+
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/can/at91_can.c                          |  2 +-
+ drivers/net/can/c_can/c_can.c                       |  2 +-
+ drivers/net/can/flexcan.c                           |  2 +-
+ drivers/net/can/ifi_canfd/ifi_canfd.c               |  2 +-
+ drivers/net/can/janz-ican3.c                        |  2 +-
+ drivers/net/can/m_can/m_can.c                       |  2 +-
+ drivers/net/can/rcar/rcar_can.c                     |  2 +-
+ drivers/net/can/rcar/rcar_canfd.c                   |  2 +-
+ drivers/net/can/xilinx_can.c                        |  2 +-
+ drivers/net/ethernet/3com/typhoon.c                 |  2 +-
+ drivers/net/ethernet/adi/bfin_mac.c                 |  2 +-
+ drivers/net/ethernet/agere/et131x.c                 |  2 +-
+ drivers/net/ethernet/altera/altera_tse_main.c       |  2 +-
+ drivers/net/ethernet/apm/xgene/xgene_enet_main.c    |  2 +-
+ drivers/net/ethernet/aquantia/atlantic/aq_vec.c     |  2 +-
+ drivers/net/ethernet/arc/emac_main.c                |  2 +-
+ drivers/net/ethernet/atheros/alx/main.c             |  2 +-
+ drivers/net/ethernet/atheros/atl1c/atl1c_main.c     |  2 +-
+ drivers/net/ethernet/atheros/atl1e/atl1e_main.c     |  2 +-
+ drivers/net/ethernet/atheros/atlx/atl1.c            |  2 +-
+ drivers/net/ethernet/broadcom/b44.c                 |  2 +-
+ drivers/net/ethernet/broadcom/bcm63xx_enet.c        |  2 +-
+ drivers/net/ethernet/broadcom/bgmac.c               |  2 +-
+ drivers/net/ethernet/broadcom/bnx2.c                |  4 ++--
+ drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c     |  2 +-
+ drivers/net/ethernet/broadcom/bnxt/bnxt.c           |  2 +-
+ drivers/net/ethernet/broadcom/sb1250-mac.c          |  2 +-
+ drivers/net/ethernet/brocade/bna/bnad.c             |  2 +-
+ drivers/net/ethernet/cadence/macb.c                 |  2 +-
+ drivers/net/ethernet/calxeda/xgmac.c                |  2 +-
+ drivers/net/ethernet/cavium/liquidio/lio_main.c     |  2 +-
+ drivers/net/ethernet/cavium/liquidio/lio_vf_main.c  |  2 +-
+ drivers/net/ethernet/cavium/octeon/octeon_mgmt.c    |  2 +-
+ drivers/net/ethernet/cavium/thunder/nicvf_main.c    |  2 +-
+ drivers/net/ethernet/chelsio/cxgb/sge.c             |  2 +-
+ drivers/net/ethernet/chelsio/cxgb3/sge.c            |  4 ++--
+ drivers/net/ethernet/chelsio/cxgb4vf/sge.c          |  2 +-
+ drivers/net/ethernet/cisco/enic/enic_main.c         |  4 ++--
+ drivers/net/ethernet/dec/tulip/interrupt.c          |  6 +++---
+ drivers/net/ethernet/dnet.c                         |  2 +-
+ drivers/net/ethernet/emulex/benet/be_main.c         |  2 +-
+ drivers/net/ethernet/ethoc.c                        |  2 +-
+ drivers/net/ethernet/ezchip/nps_enet.c              |  2 +-
+ drivers/net/ethernet/freescale/dpaa/dpaa_eth.c      |  2 +-
+ drivers/net/ethernet/freescale/fec_main.c           |  2 +-
+ .../net/ethernet/freescale/fs_enet/fs_enet-main.c   |  2 +-
+ drivers/net/ethernet/freescale/gianfar.c            |  4 ++--
+ drivers/net/ethernet/freescale/ucc_geth.c           |  2 +-
+ drivers/net/ethernet/hisilicon/hip04_eth.c          |  2 +-
+ drivers/net/ethernet/hisilicon/hisi_femac.c         |  2 +-
+ drivers/net/ethernet/hisilicon/hix5hd2_gmac.c       |  2 +-
+ drivers/net/ethernet/ibm/ibmveth.c                  |  2 +-
+ drivers/net/ethernet/ibm/ibmvnic.c                  |  2 +-
+ drivers/net/ethernet/intel/e100.c                   |  2 +-
+ drivers/net/ethernet/intel/ixgb/ixgb_main.c         |  2 +-
+ drivers/net/ethernet/korina.c                       |  2 +-
+ drivers/net/ethernet/lantiq_etop.c                  | 21 +++++++++------------
+ drivers/net/ethernet/marvell/mv643xx_eth.c          |  2 +-
+ drivers/net/ethernet/marvell/mvneta.c               |  6 ++----
+ drivers/net/ethernet/marvell/mvpp2.c                |  2 +-
+ drivers/net/ethernet/marvell/pxa168_eth.c           |  2 +-
+ drivers/net/ethernet/moxa/moxart_ether.c            |  2 +-
+ drivers/net/ethernet/myricom/myri10ge/myri10ge.c    |  2 +-
+ drivers/net/ethernet/natsemi/natsemi.c              |  2 +-
+ drivers/net/ethernet/neterion/s2io.c                |  4 ++--
+ drivers/net/ethernet/neterion/vxge/vxge-main.c      |  6 +++---
+ drivers/net/ethernet/nvidia/forcedeth.c             |  2 +-
+ drivers/net/ethernet/nxp/lpc_eth.c                  |  2 +-
+ .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c    |  2 +-
+ drivers/net/ethernet/pasemi/pasemi_mac.c            |  2 +-
+ .../net/ethernet/qlogic/netxen/netxen_nic_main.c    |  2 +-
+ drivers/net/ethernet/qlogic/qede/qede_fp.c          |  2 +-
+ drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c      | 10 +++++-----
+ drivers/net/ethernet/qlogic/qlge/qlge_main.c        |  2 +-
+ drivers/net/ethernet/qualcomm/emac/emac.c           |  2 +-
+ drivers/net/ethernet/realtek/r8169.c                |  2 +-
+ drivers/net/ethernet/rocker/rocker_main.c           |  2 +-
+ drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c     |  2 +-
+ drivers/net/ethernet/sfc/efx.c                      |  2 +-
+ drivers/net/ethernet/sfc/falcon/efx.c               |  2 +-
+ drivers/net/ethernet/smsc/smsc9420.c                |  2 +-
+ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c   |  2 +-
+ drivers/net/ethernet/sun/niu.c                      |  2 +-
+ drivers/net/ethernet/sun/sungem.c                   |  2 +-
+ drivers/net/ethernet/sun/sunvnet_common.c           |  2 +-
+ drivers/net/ethernet/tehuti/tehuti.c                |  2 +-
+ drivers/net/ethernet/ti/cpsw.c                      |  2 +-
+ drivers/net/ethernet/ti/davinci_emac.c              |  2 +-
+ drivers/net/ethernet/ti/netcp_core.c                |  2 +-
+ drivers/net/ethernet/tile/tilegx.c                  |  2 +-
+ drivers/net/ethernet/tile/tilepro.c                 |  2 +-
+ drivers/net/ethernet/toshiba/ps3_gelic_net.c        |  2 +-
+ drivers/net/ethernet/toshiba/spider_net.c           |  2 +-
+ drivers/net/ethernet/toshiba/tc35815.c              |  2 +-
+ drivers/net/ethernet/tundra/tsi108_eth.c            |  2 +-
+ drivers/net/ethernet/via/via-rhine.c                |  2 +-
+ drivers/net/ethernet/via/via-velocity.c             |  2 +-
+ drivers/net/ethernet/wiznet/w5100.c                 |  2 +-
+ drivers/net/ethernet/wiznet/w5300.c                 |  2 +-
+ drivers/net/fjes/fjes_main.c                        |  2 +-
+ drivers/net/vmxnet3/vmxnet3_drv.c                   |  4 ++--
+ drivers/net/wan/fsl_ucc_hdlc.c                      |  2 +-
+ drivers/net/wan/hd64572.c                           |  2 +-
+ drivers/net/wireless/ath/ath10k/pci.c               |  2 +-
+ drivers/net/wireless/ath/wil6210/netdev.c           |  2 +-
+ drivers/net/xen-netback/interface.c                 |  2 +-
+ drivers/net/xen-netfront.c                          |  2 +-
+ drivers/staging/octeon/ethernet-rx.c                |  2 +-
+ drivers/staging/unisys/visornic/visornic_main.c     |  2 +-
+ 109 files changed, 132 insertions(+), 137 deletions(-)
+
+--- a/drivers/net/can/at91_can.c
++++ b/drivers/net/can/at91_can.c
+@@ -813,7 +813,7 @@ static int at91_poll(struct napi_struct
+ 		u32 reg_ier = AT91_IRQ_ERR_FRAME;
+ 		reg_ier |= get_irq_mb_rx(priv) & ~AT91_MB_MASK(priv->rx_next);
+ 
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		at91_write(priv, AT91_IER, reg_ier);
+ 	}
+ 
+--- a/drivers/net/can/c_can/c_can.c
++++ b/drivers/net/can/c_can/c_can.c
+@@ -1070,7 +1070,7 @@ static int c_can_poll(struct napi_struct
+ 
+ end:
+ 	if (work_done < quota) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		/* enable all IRQs if we are not in bus off state */
+ 		if (priv->can.state != CAN_STATE_BUS_OFF)
+ 			c_can_irq_control(priv, true);
+--- a/drivers/net/can/flexcan.c
++++ b/drivers/net/can/flexcan.c
+@@ -703,7 +703,7 @@ static int flexcan_poll(struct napi_stru
+ 		work_done += flexcan_poll_bus_err(dev, reg_esr);
+ 
+ 	if (work_done < quota) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		/* enable IRQs */
+ 		flexcan_write(FLEXCAN_IFLAG_DEFAULT, &regs->imask1);
+ 		flexcan_write(priv->reg_ctrl_default, &regs->ctrl);
+--- a/drivers/net/can/ifi_canfd/ifi_canfd.c
++++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
+@@ -578,7 +578,7 @@ static int ifi_canfd_poll(struct napi_st
+ 		work_done += ifi_canfd_do_rx_poll(ndev, quota - work_done);
+ 
+ 	if (work_done < quota) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		ifi_canfd_irq_enable(ndev, 1);
+ 	}
+ 
+--- a/drivers/net/can/janz-ican3.c
++++ b/drivers/net/can/janz-ican3.c
+@@ -1475,7 +1475,7 @@ static int ican3_napi(struct napi_struct
+ 	/* We have processed all packets that the adapter had, but it
+ 	 * was less than our budget, stop polling */
+ 	if (received < budget)
+-		napi_complete(napi);
++		napi_complete_done(napi, received);
+ 
+ 	spin_lock_irqsave(&mod->lock, flags);
+ 
+--- a/drivers/net/can/m_can/m_can.c
++++ b/drivers/net/can/m_can/m_can.c
+@@ -730,7 +730,7 @@ static int m_can_poll(struct napi_struct
+ 		work_done += m_can_do_rx_poll(dev, (quota - work_done));
+ 
+ 	if (work_done < quota) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		m_can_enable_all_interrupts(priv);
+ 	}
+ 
+--- a/drivers/net/can/rcar/rcar_can.c
++++ b/drivers/net/can/rcar/rcar_can.c
+@@ -695,7 +695,7 @@ static int rcar_can_rx_poll(struct napi_
+ 	}
+ 	/* All packets processed */
+ 	if (num_pkts < quota) {
+-		napi_complete(napi);
++		napi_complete_done(napi, num_pkts);
+ 		priv->ier |= RCAR_CAN_IER_RXFIE;
+ 		writeb(priv->ier, &priv->regs->ier);
+ 	}
+--- a/drivers/net/can/rcar/rcar_canfd.c
++++ b/drivers/net/can/rcar/rcar_canfd.c
+@@ -1512,7 +1512,7 @@ static int rcar_canfd_rx_poll(struct nap
+ 
+ 	/* All packets processed */
+ 	if (num_pkts < quota) {
+-		napi_complete(napi);
++		napi_complete_done(napi, num_pkts);
+ 		/* Enable Rx FIFO interrupts */
+ 		rcar_canfd_set_bit(priv->base, RCANFD_RFCC(ridx),
+ 				   RCANFD_RFCC_RFIE);
+--- a/drivers/net/can/xilinx_can.c
++++ b/drivers/net/can/xilinx_can.c
+@@ -726,7 +726,7 @@ static int xcan_rx_poll(struct napi_stru
+ 		can_led_event(ndev, CAN_LED_EVENT_RX);
+ 
+ 	if (work_done < quota) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		ier = priv->read_reg(priv, XCAN_IER_OFFSET);
+ 		ier |= (XCAN_IXR_RXOK_MASK | XCAN_IXR_RXNEMP_MASK);
+ 		priv->write_reg(priv, XCAN_IER_OFFSET, ier);
+--- a/drivers/net/ethernet/3com/typhoon.c
++++ b/drivers/net/ethernet/3com/typhoon.c
+@@ -1748,7 +1748,7 @@ typhoon_poll(struct napi_struct *napi, i
+ 	}
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		iowrite32(TYPHOON_INTR_NONE,
+ 				tp->ioaddr + TYPHOON_REG_INTR_MASK);
+ 		typhoon_post_pci_writes(tp->ioaddr);
+--- a/drivers/net/ethernet/adi/bfin_mac.c
++++ b/drivers/net/ethernet/adi/bfin_mac.c
+@@ -1274,7 +1274,7 @@ static int bfin_mac_poll(struct napi_str
+ 	}
+ 
+ 	if (i < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, i);
+ 		if (test_and_clear_bit(BFIN_MAC_RX_IRQ_DISABLED, &lp->flags))
+ 			enable_irq(IRQ_MAC_RX);
+ 	}
+--- a/drivers/net/ethernet/agere/et131x.c
++++ b/drivers/net/ethernet/agere/et131x.c
+@@ -3573,7 +3573,7 @@ static int et131x_poll(struct napi_struc
+ 	et131x_handle_send_pkts(adapter);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(&adapter->napi);
++		napi_complete_done(&adapter->napi, work_done);
+ 		et131x_enable_interrupts(adapter);
+ 	}
+ 
+--- a/drivers/net/ethernet/altera/altera_tse_main.c
++++ b/drivers/net/ethernet/altera/altera_tse_main.c
+@@ -491,7 +491,7 @@ static int tse_poll(struct napi_struct *
+ 
+ 	if (rxcomplete < budget) {
+ 
+-		napi_complete(napi);
++		napi_complete_done(napi, rxcomplete);
+ 
+ 		netdev_dbg(priv->dev,
+ 			   "NAPI Complete, did %d packets with budget %d\n",
+--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
++++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+@@ -651,7 +651,7 @@ static int xgene_enet_napi(struct napi_s
+ 	processed = xgene_enet_process_ring(ring, budget);
+ 
+ 	if (processed != budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, processed);
+ 		enable_irq(ring->irq);
+ 	}
+ 
+--- a/drivers/net/ethernet/arc/emac_main.c
++++ b/drivers/net/ethernet/arc/emac_main.c
+@@ -275,7 +275,7 @@ static int arc_emac_poll(struct napi_str
+ 
+ 	work_done = arc_emac_rx(ndev, budget);
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		arc_reg_or(priv, R_ENABLE, RXINT_MASK | TXINT_MASK);
+ 	}
+ 
+--- a/drivers/net/ethernet/atheros/alx/main.c
++++ b/drivers/net/ethernet/atheros/alx/main.c
+@@ -292,7 +292,7 @@ static int alx_poll(struct napi_struct *
+ 	if (!tx_complete || work == budget)
+ 		return budget;
+ 
+-	napi_complete(&alx->napi);
++	napi_complete_done(&alx->napi, work);
+ 
+ 	/* enable interrupt */
+ 	if (alx->flags & ALX_FLAG_USING_MSIX) {
+--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+@@ -1885,7 +1885,7 @@ static int atl1c_clean(struct napi_struc
+ 
+ 	if (work_done < budget) {
+ quit_polling:
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		adapter->hw.intr_mask |= ISR_RX_PKT;
+ 		AT_WRITE_REG(&adapter->hw, REG_IMR, adapter->hw.intr_mask);
+ 	}
+--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
++++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+@@ -1532,7 +1532,7 @@ static int atl1e_clean(struct napi_struc
+ 	/* If no Tx and not enough Rx work done, exit the polling mode */
+ 	if (work_done < budget) {
+ quit_polling:
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		imr_data = AT_READ_REG(&adapter->hw, REG_IMR);
+ 		AT_WRITE_REG(&adapter->hw, REG_IMR, imr_data | ISR_RX_EVENT);
+ 		/* test debug */
+--- a/drivers/net/ethernet/atheros/atlx/atl1.c
++++ b/drivers/net/ethernet/atheros/atlx/atl1.c
+@@ -2457,7 +2457,7 @@ static int atl1_rings_clean(struct napi_
+ 	if (work_done >= budget)
+ 		return work_done;
+ 
+-	napi_complete(napi);
++	napi_complete_done(napi, work_done);
+ 	/* re-enable Interrupt */
+ 	if (likely(adapter->int_enabled))
+ 		atlx_imr_set(adapter, IMR_NORMAL_MASK);
+--- a/drivers/net/ethernet/broadcom/b44.c
++++ b/drivers/net/ethernet/broadcom/b44.c
+@@ -902,7 +902,7 @@ static int b44_poll(struct napi_struct *
+ 	}
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		b44_enable_ints(bp);
+ 	}
+ 
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -511,7 +511,7 @@ static int bcm_enet_poll(struct napi_str
+ 
+ 	/* no more packet in rx/tx queue, remove device from poll
+ 	 * queue */
+-	napi_complete(napi);
++	napi_complete_done(napi, rx_work_done);
+ 
+ 	/* restore rx/tx interrupt */
+ 	enet_dmac_writel(priv, priv->dma_chan_int_mask,
+--- a/drivers/net/ethernet/broadcom/bgmac.c
++++ b/drivers/net/ethernet/broadcom/bgmac.c
+@@ -1145,7 +1145,7 @@ static int bgmac_poll(struct napi_struct
+ 		return weight;
+ 
+ 	if (handled < weight) {
+-		napi_complete(napi);
++		napi_complete_done(napi, handled);
+ 		bgmac_chip_intrs_on(bgmac);
+ 	}
+ 
+--- a/drivers/net/ethernet/broadcom/bnx2.c
++++ b/drivers/net/ethernet/broadcom/bnx2.c
+@@ -3522,7 +3522,7 @@ static int bnx2_poll_msix(struct napi_st
+ 		rmb();
+ 		if (likely(!bnx2_has_fast_work(bnapi))) {
+ 
+-			napi_complete(napi);
++			napi_complete_done(napi, work_done);
+ 			BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
+ 				BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
+ 				bnapi->last_status_idx);
+@@ -3559,7 +3559,7 @@ static int bnx2_poll(struct napi_struct
+ 
+ 		rmb();
+ 		if (likely(!bnx2_has_work(bnapi))) {
+-			napi_complete(napi);
++			napi_complete_done(napi, work_done);
+ 			if (likely(bp->flags & BNX2_FLAG_USING_MSI_OR_MSIX)) {
+ 				BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
+ 					BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
+--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+@@ -3229,7 +3229,7 @@ static int bnx2x_poll(struct napi_struct
+ 		 * has been updated when NAPI was scheduled.
+ 		 */
+ 		if (IS_FCOE_FP(fp)) {
+-			napi_complete(napi);
++			napi_complete_done(napi, rx_work_done);
+ 		} else {
+ 			bnx2x_update_fpsb_idx(fp);
+ 			/* bnx2x_has_rx_work() reads the status block,
+--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+@@ -1768,7 +1768,7 @@ static int bnxt_poll_nitroa0(struct napi
+ 	}
+ 
+ 	if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_pkts);
+ 		BNXT_CP_DB_REARM(cpr->cp_doorbell, cpr->cp_raw_cons);
+ 	}
+ 	return rx_pkts;
+--- a/drivers/net/ethernet/broadcom/sb1250-mac.c
++++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
+@@ -2545,7 +2545,7 @@ static int sbmac_poll(struct napi_struct
+ 	sbdma_tx_process(sc, &(sc->sbm_txdma), 1);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ #ifdef CONFIG_SBMAC_COALESCE
+ 		__raw_writeq(((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_TX_CH0) |
+--- a/drivers/net/ethernet/brocade/bna/bnad.c
++++ b/drivers/net/ethernet/brocade/bna/bnad.c
+@@ -1881,7 +1881,7 @@ bnad_napi_poll_rx(struct napi_struct *na
+ 		return rcvd;
+ 
+ poll_exit:
+-	napi_complete(napi);
++	napi_complete_done(napi, rcvd);
+ 
+ 	rx_ctrl->rx_complete++;
+ 
+--- a/drivers/net/ethernet/cadence/macb.c
++++ b/drivers/net/ethernet/cadence/macb.c
+@@ -1069,7 +1069,7 @@ static int macb_poll(struct napi_struct
+ 
+ 	work_done = bp->macbgem_ops.mog_rx(bp, budget);
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		/* Packets received while interrupts were disabled */
+ 		status = macb_readl(bp, RSR);
+--- a/drivers/net/ethernet/calxeda/xgmac.c
++++ b/drivers/net/ethernet/calxeda/xgmac.c
+@@ -1247,7 +1247,7 @@ static int xgmac_poll(struct napi_struct
+ 	work_done = xgmac_rx(priv, budget);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		__raw_writel(DMA_INTR_DEFAULT_MASK, priv->base + XGMAC_DMA_INTR_ENA);
+ 	}
+ 	return work_done;
+--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
++++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
+@@ -2433,7 +2433,7 @@ static int liquidio_napi_poll(struct nap
+ 	}
+ 
+ 	if ((work_done < budget) && (tx_done)) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		octeon_process_droq_poll_cmd(droq->oct_dev, droq->q_no,
+ 					     POLL_EVENT_ENABLE_INTR, 0);
+ 		return 0;
+--- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
++++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
+@@ -501,7 +501,7 @@ static int octeon_mgmt_napi_poll(struct
+ 
+ 	if (work_done < budget) {
+ 		/* We stopped because no more packets were available. */
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		octeon_mgmt_enable_rx_irq(p);
+ 	}
+ 	octeon_mgmt_update_rx_stats(netdev);
+--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
++++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+@@ -737,7 +737,7 @@ static int nicvf_poll(struct napi_struct
+ 
+ 	if (work_done < budget) {
+ 		/* Slow packet rate, exit polling */
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		/* Re-enable interrupts */
+ 		cq_head = nicvf_queue_reg_read(nic, NIC_QSET_CQ_0_7_HEAD,
+ 					       cq->cq_idx);
+--- a/drivers/net/ethernet/chelsio/cxgb/sge.c
++++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
+@@ -1605,7 +1605,7 @@ int t1_poll(struct napi_struct *napi, in
+ 	int work_done = process_responses(adapter, budget);
+ 
+ 	if (likely(work_done < budget)) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		writel(adapter->sge->respQ.cidx,
+ 		       adapter->regs + A_SG_SLEEPING);
+ 	}
+--- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
++++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
+@@ -1843,7 +1843,7 @@ static int ofld_poll(struct napi_struct
+ 		__skb_queue_head_init(&queue);
+ 		skb_queue_splice_init(&q->rx_queue, &queue);
+ 		if (skb_queue_empty(&queue)) {
+-			napi_complete(napi);
++			napi_complete_done(napi, work_done);
+ 			spin_unlock_irq(&q->lock);
+ 			return work_done;
+ 		}
+@@ -2414,7 +2414,7 @@ static int napi_rx_handler(struct napi_s
+ 	int work_done = process_responses(adap, qs, budget);
+ 
+ 	if (likely(work_done < budget)) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		/*
+ 		 * Because we don't atomically flush the following
+--- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
++++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
+@@ -1889,7 +1889,7 @@ static int napi_rx_handler(struct napi_s
+ 	u32 val;
+ 
+ 	if (likely(work_done < budget)) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		intr_params = rspq->next_intr_params;
+ 		rspq->next_intr_params = rspq->intr_params;
+ 	} else
+--- a/drivers/net/ethernet/cisco/enic/enic_main.c
++++ b/drivers/net/ethernet/cisco/enic/enic_main.c
+@@ -1339,7 +1339,7 @@ static int enic_poll(struct napi_struct
+ 		 * exit polling
+ 		 */
+ 
+-		napi_complete(napi);
++		napi_complete_done(napi, rq_work_done);
+ 		if (enic->rx_coalesce_setting.use_adaptive_rx_coalesce)
+ 			enic_set_int_moderation(enic, &enic->rq[0]);
+ 		vnic_intr_unmask(&enic->intr[intr]);
+@@ -1496,7 +1496,7 @@ static int enic_poll_msix_rq(struct napi
+ 		 * exit polling
+ 		 */
+ 
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		if (enic->rx_coalesce_setting.use_adaptive_rx_coalesce)
+ 			enic_set_int_moderation(enic, &enic->rq[rq]);
+ 		vnic_intr_unmask(&enic->intr[intr]);
+--- a/drivers/net/ethernet/dec/tulip/interrupt.c
++++ b/drivers/net/ethernet/dec/tulip/interrupt.c
+@@ -319,8 +319,8 @@ int tulip_poll(struct napi_struct *napi,
+ 
+          /* Remove us from polling list and enable RX intr. */
+ 
+-         napi_complete(napi);
+-         iowrite32(tulip_tbl[tp->chip_id].valid_intrs, tp->base_addr+CSR7);
++	napi_complete_done(napi, work_done);
++	iowrite32(tulip_tbl[tp->chip_id].valid_intrs, tp->base_addr+CSR7);
+ 
+          /* The last op happens after poll completion. Which means the following:
+           * 1. it can race with disabling irqs in irq handler
+@@ -355,7 +355,7 @@ int tulip_poll(struct napi_struct *napi,
+           * before we did napi_complete(). See? We would lose it. */
+ 
+          /* remove ourselves from the polling list */
+-         napi_complete(napi);
++         napi_complete_done(napi, work_done);
+ 
+          return work_done;
+ }
+--- a/drivers/net/ethernet/dnet.c
++++ b/drivers/net/ethernet/dnet.c
+@@ -415,7 +415,7 @@ static int dnet_poll(struct napi_struct
+ 		/* We processed all packets available.  Tell NAPI it can
+ 		 * stop polling then re-enable rx interrupts.
+ 		 */
+-		napi_complete(napi);
++		napi_complete_done(napi, npackets);
+ 		int_enable = dnet_readl(bp, INTR_ENB);
+ 		int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
+ 		dnet_writel(bp, int_enable, INTR_ENB);
+--- a/drivers/net/ethernet/emulex/benet/be_main.c
++++ b/drivers/net/ethernet/emulex/benet/be_main.c
+@@ -3346,7 +3346,7 @@ int be_poll(struct napi_struct *napi, in
+ 		be_process_mcc(adapter);
+ 
+ 	if (max_work < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, max_work);
+ 
+ 		/* Skyhawk EQ_DB has a provision to set the rearm to interrupt
+ 		 * delay via a delay multiplier encoding value
+--- a/drivers/net/ethernet/ethoc.c
++++ b/drivers/net/ethernet/ethoc.c
+@@ -614,7 +614,7 @@ static int ethoc_poll(struct napi_struct
+ 	tx_work_done = ethoc_tx(priv->netdev, budget);
+ 
+ 	if (rx_work_done < budget && tx_work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_work_done);
+ 		ethoc_enable_irq(priv, INT_MASK_TX | INT_MASK_RX);
+ 	}
+ 
+--- a/drivers/net/ethernet/ezchip/nps_enet.c
++++ b/drivers/net/ethernet/ezchip/nps_enet.c
+@@ -192,7 +192,7 @@ static int nps_enet_poll(struct napi_str
+ 	if (work_done < budget) {
+ 		u32 buf_int_enable_value = 0;
+ 
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		/* set tx_done and rx_rdy bits */
+ 		buf_int_enable_value |= NPS_ENET_ENABLE << RX_RDY_SHIFT;
+--- a/drivers/net/ethernet/freescale/fec_main.c
++++ b/drivers/net/ethernet/freescale/fec_main.c
+@@ -1615,7 +1615,7 @@ static int fec_enet_rx_napi(struct napi_
+ 	fec_enet_tx(ndev);
+ 
+ 	if (pkts < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, pkts);
+ 		writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
+ 	}
+ 	return pkts;
+--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
++++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+@@ -301,7 +301,7 @@ static int fs_enet_napi(struct napi_stru
+ 
+ 	if (received < budget && tx_left) {
+ 		/* done */
+-		napi_complete(napi);
++		napi_complete_done(napi, received);
+ 		(*fep->ops->napi_enable)(dev);
+ 
+ 		return received;
+--- a/drivers/net/ethernet/freescale/gianfar.c
++++ b/drivers/net/ethernet/freescale/gianfar.c
+@@ -3186,7 +3186,7 @@ static int gfar_poll_rx_sq(struct napi_s
+ 
+ 	if (work_done < budget) {
+ 		u32 imask;
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		/* Clear the halt bit in RSTAT */
+ 		gfar_write(&regs->rstat, gfargrp->rstat);
+ 
+@@ -3275,7 +3275,7 @@ static int gfar_poll_rx(struct napi_stru
+ 
+ 	if (!num_act_queues) {
+ 		u32 imask;
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		/* Clear the halt bit in RSTAT */
+ 		gfar_write(&regs->rstat, gfargrp->rstat);
+--- a/drivers/net/ethernet/freescale/ucc_geth.c
++++ b/drivers/net/ethernet/freescale/ucc_geth.c
+@@ -3303,7 +3303,7 @@ static int ucc_geth_poll(struct napi_str
+ 		howmany += ucc_geth_rx(ugeth, i, budget - howmany);
+ 
+ 	if (howmany < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, howmany);
+ 		setbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS | UCCE_TX_EVENTS);
+ 	}
+ 
+--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
++++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
+@@ -555,7 +555,7 @@ refill:
+ 		priv->reg_inten |= RCV_INT;
+ 		writel_relaxed(priv->reg_inten, priv->base + PPE_INTEN);
+ 	}
+-	napi_complete(napi);
++	napi_complete_done(napi, rx);
+ done:
+ 	/* clean up tx descriptors and start a new timer if necessary */
+ 	tx_remaining = hip04_tx_reclaim(ndev, false);
+--- a/drivers/net/ethernet/hisilicon/hisi_femac.c
++++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
+@@ -330,7 +330,7 @@ static int hisi_femac_poll(struct napi_s
+ 	} while (ints & DEF_INT_MASK);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		hisi_femac_irq_enable(priv, DEF_INT_MASK &
+ 					(~IRQ_INT_TX_PER_PACKET));
+ 	}
+--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
++++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+@@ -578,7 +578,7 @@ static int hix5hd2_poll(struct napi_stru
+ 	} while (ints & DEF_INT_MASK);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		hix5hd2_irq_enable(priv);
+ 	}
+ 
+--- a/drivers/net/ethernet/ibm/ibmveth.c
++++ b/drivers/net/ethernet/ibm/ibmveth.c
+@@ -1320,7 +1320,7 @@ restart_poll:
+ 	ibmveth_replenish_task(adapter);
+ 
+ 	if (frames_processed < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, frames_processed);
+ 
+ 		/* We think we are done - reenable interrupts,
+ 		 * then check once more to make sure we are done.
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -999,7 +999,7 @@ restart_poll:
+ 
+ 	if (frames_processed < budget) {
+ 		enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]);
+-		napi_complete(napi);
++		napi_complete_done(napi, frames_processed);
+ 		if (pending_scrq(adapter, adapter->rx_scrq[scrq_num]) &&
+ 		    napi_reschedule(napi)) {
+ 			disable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]);
+--- a/drivers/net/ethernet/intel/e100.c
++++ b/drivers/net/ethernet/intel/e100.c
+@@ -2253,7 +2253,7 @@ static int e100_poll(struct napi_struct
+ 
+ 	/* If budget not fully consumed, exit the polling mode */
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		e100_enable_irq(nic);
+ 	}
+ 
+--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
++++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+@@ -1825,7 +1825,7 @@ ixgb_clean(struct napi_struct *napi, int
+ 
+ 	/* If budget not fully consumed, exit the polling mode */
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		if (!test_bit(__IXGB_DOWN, &adapter->flags))
+ 			ixgb_irq_enable(adapter);
+ 	}
+--- a/drivers/net/ethernet/korina.c
++++ b/drivers/net/ethernet/korina.c
+@@ -464,7 +464,7 @@ static int korina_poll(struct napi_struc
+ 
+ 	work_done = korina_rx(dev, budget);
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		writel(readl(&lp->rx_dma_regs->dmasm) &
+ 			~(DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR),
+--- a/drivers/net/ethernet/lantiq_etop.c
++++ b/drivers/net/ethernet/lantiq_etop.c
+@@ -156,24 +156,21 @@ ltq_etop_poll_rx(struct napi_struct *nap
+ {
+ 	struct ltq_etop_chan *ch = container_of(napi,
+ 				struct ltq_etop_chan, napi);
+-	int rx = 0;
+-	int complete = 0;
++	int work_done = 0;
+ 
+-	while ((rx < budget) && !complete) {
++	while (work_done < budget) {
+ 		struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
+ 
+-		if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) == LTQ_DMA_C) {
+-			ltq_etop_hw_receive(ch);
+-			rx++;
+-		} else {
+-			complete = 1;
+-		}
++		if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) != LTQ_DMA_C)
++			break;
++		ltq_etop_hw_receive(ch);
++		work_done++;
+ 	}
+-	if (complete || !rx) {
+-		napi_complete(&ch->napi);
++	if (work_done < budget) {
++		napi_complete_done(&ch->napi, work_done);
+ 		ltq_dma_ack_irq(&ch->dma);
+ 	}
+-	return rx;
++	return work_done;
+ }
+ 
+ static int
+--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
++++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
+@@ -2312,7 +2312,7 @@ static int mv643xx_eth_poll(struct napi_
+ 	if (work_done < budget) {
+ 		if (mp->oom)
+ 			mod_timer(&mp->rx_oom, jiffies + (HZ / 10));
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		wrlp(mp, INT_MASK, mp->int_mask);
+ 	}
+ 
+--- a/drivers/net/ethernet/marvell/mvneta.c
++++ b/drivers/net/ethernet/marvell/mvneta.c
+@@ -2696,11 +2696,9 @@ static int mvneta_poll(struct napi_struc
+ 			rx_done = mvneta_rx_swbm(pp, budget, &pp->rxqs[rx_queue]);
+ 	}
+ 
+-	budget -= rx_done;
+-
+-	if (budget > 0) {
++	if (rx_done < budget) {
+ 		cause_rx_tx = 0;
+-		napi_complete(&port->napi);
++		napi_complete_done(&port->napi, rx_done);
+ 		enable_percpu_irq(pp->dev->irq, 0);
+ 	}
+ 
+--- a/drivers/net/ethernet/marvell/mvpp2.c
++++ b/drivers/net/ethernet/marvell/mvpp2.c
+@@ -5405,7 +5405,7 @@ static int mvpp2_poll(struct napi_struct
+ 
+ 	if (budget > 0) {
+ 		cause_rx = 0;
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_done);
+ 
+ 		mvpp2_interrupts_enable(port);
+ 	}
+--- a/drivers/net/ethernet/marvell/pxa168_eth.c
++++ b/drivers/net/ethernet/marvell/pxa168_eth.c
+@@ -1264,7 +1264,7 @@ static int pxa168_rx_poll(struct napi_st
+ 	}
+ 	work_done = rxq_process(dev, budget);
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		wrl(pep, INT_MASK, ALL_INTS);
+ 	}
+ 
+--- a/drivers/net/ethernet/moxa/moxart_ether.c
++++ b/drivers/net/ethernet/moxa/moxart_ether.c
+@@ -269,7 +269,7 @@ rx_next:
+ 	}
+ 
+ 	if (rx < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rx);
+ 	}
+ 
+ 	priv->reg_imr |= RPKT_FINISH_M;
+--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
++++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+@@ -1678,7 +1678,7 @@ static int myri10ge_poll(struct napi_str
+ 
+ 	myri10ge_ss_unlock_napi(ss);
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		put_be32(htonl(3), ss->irq_claim);
+ 	}
+ 	return work_done;
+--- a/drivers/net/ethernet/natsemi/natsemi.c
++++ b/drivers/net/ethernet/natsemi/natsemi.c
+@@ -2261,7 +2261,7 @@ static int natsemi_poll(struct napi_stru
+ 		np->intr_status = readl(ioaddr + IntrStatus);
+ 	} while (np->intr_status);
+ 
+-	napi_complete(napi);
++	napi_complete_done(napi, work_done);
+ 
+ 	/* Reenable interrupts providing nothing is trying to shut
+ 	 * the chip down. */
+--- a/drivers/net/ethernet/neterion/s2io.c
++++ b/drivers/net/ethernet/neterion/s2io.c
+@@ -2783,7 +2783,7 @@ static int s2io_poll_msix(struct napi_st
+ 	s2io_chk_rx_buffers(nic, ring);
+ 
+ 	if (pkts_processed < budget_org) {
+-		napi_complete(napi);
++		napi_complete_done(napi, pkts_processed);
+ 		/*Re Enable MSI-Rx Vector*/
+ 		addr = (u8 __iomem *)&bar0->xmsi_mask_reg;
+ 		addr += 7 - ring->ring_no;
+@@ -2817,7 +2817,7 @@ static int s2io_poll_inta(struct napi_st
+ 			break;
+ 	}
+ 	if (pkts_processed < budget_org) {
+-		napi_complete(napi);
++		napi_complete_done(napi, pkts_processed);
+ 		/* Re enable the Rx interrupts for the ring */
+ 		writeq(0, &bar0->rx_traffic_mask);
+ 		readl(&bar0->rx_traffic_mask);
+--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
++++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
+@@ -1823,8 +1823,8 @@ static int vxge_poll_msix(struct napi_st
+ 	vxge_hw_vpath_poll_rx(ring->handle);
+ 	pkts_processed = ring->pkts_processed;
+ 
+-	if (ring->pkts_processed < budget_org) {
+-		napi_complete(napi);
++	if (pkts_processed < budget_org) {
++		napi_complete_done(napi, pkts_processed);
+ 
+ 		/* Re enable the Rx interrupts for the vpath */
+ 		vxge_hw_channel_msix_unmask(
+@@ -1863,7 +1863,7 @@ static int vxge_poll_inta(struct napi_st
+ 	VXGE_COMPLETE_ALL_TX(vdev);
+ 
+ 	if (pkts_processed < budget_org) {
+-		napi_complete(napi);
++		napi_complete_done(napi, pkts_processed);
+ 		/* Re enable the Rx interrupts for the ring */
+ 		vxge_hw_device_unmask_all(hldev);
+ 		vxge_hw_device_flush_io(hldev);
+--- a/drivers/net/ethernet/nvidia/forcedeth.c
++++ b/drivers/net/ethernet/nvidia/forcedeth.c
+@@ -3756,7 +3756,7 @@ static int nv_napi_poll(struct napi_stru
+ 	if (rx_work < budget) {
+ 		/* re-enable interrupts
+ 		   (msix not enabled in napi) */
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_work);
+ 
+ 		writel(np->irqmask, base + NvRegIrqMask);
+ 	}
+--- a/drivers/net/ethernet/nxp/lpc_eth.c
++++ b/drivers/net/ethernet/nxp/lpc_eth.c
+@@ -999,7 +999,7 @@ static int lpc_eth_poll(struct napi_stru
+ 	rx_done = __lpc_handle_recv(ndev, budget);
+ 
+ 	if (rx_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_done);
+ 		lpc_eth_enable_int(pldat->net_base);
+ 	}
+ 
+--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
++++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+@@ -2391,7 +2391,7 @@ static int pch_gbe_napi_poll(struct napi
+ 		poll_end_flag = true;
+ 
+ 	if (poll_end_flag) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		pch_gbe_irq_enable(adapter);
+ 	}
+ 
+--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
++++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
+@@ -1575,7 +1575,7 @@ static int pasemi_mac_poll(struct napi_s
+ 	pkts = pasemi_mac_clean_rx(rx_ring(mac), budget);
+ 	if (pkts < budget) {
+ 		/* all done, no more packets present */
+-		napi_complete(napi);
++		napi_complete_done(napi, pkts);
+ 
+ 		pasemi_mac_restart_rx_intr(mac);
+ 		pasemi_mac_restart_tx_intr(mac);
+--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
++++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+@@ -2391,7 +2391,7 @@ static int netxen_nic_poll(struct napi_s
+ 		work_done = budget;
+ 
+ 	if (work_done < budget) {
+-		napi_complete(&sds_ring->napi);
++		napi_complete_done(&sds_ring->napi, work_done);
+ 		if (test_bit(__NX_DEV_UP, &adapter->state))
+ 			netxen_nic_enable_int(sds_ring);
+ 	}
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+@@ -975,7 +975,7 @@ static int qlcnic_poll(struct napi_struc
+ 		work_done = budget;
+ 
+ 	if (work_done < budget) {
+-		napi_complete(&sds_ring->napi);
++		napi_complete_done(&sds_ring->napi, work_done);
+ 		if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
+ 			qlcnic_enable_sds_intr(adapter, sds_ring);
+ 			qlcnic_enable_tx_intr(adapter, tx_ring);
+@@ -1019,7 +1019,7 @@ static int qlcnic_rx_poll(struct napi_st
+ 	work_done = qlcnic_process_rcv_ring(sds_ring, budget);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(&sds_ring->napi);
++		napi_complete_done(&sds_ring->napi, work_done);
+ 		if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
+ 			qlcnic_enable_sds_intr(adapter, sds_ring);
+ 	}
+@@ -1966,7 +1966,7 @@ static int qlcnic_83xx_msix_sriov_vf_pol
+ 		work_done = budget;
+ 
+ 	if (work_done < budget) {
+-		napi_complete(&sds_ring->napi);
++		napi_complete_done(&sds_ring->napi, work_done);
+ 		qlcnic_enable_sds_intr(adapter, sds_ring);
+ 	}
+ 
+@@ -1994,7 +1994,7 @@ static int qlcnic_83xx_poll(struct napi_
+ 		work_done = budget;
+ 
+ 	if (work_done < budget) {
+-		napi_complete(&sds_ring->napi);
++		napi_complete_done(&sds_ring->napi, work_done);
+ 		qlcnic_enable_sds_intr(adapter, sds_ring);
+ 	}
+ 
+@@ -2032,7 +2032,7 @@ static int qlcnic_83xx_rx_poll(struct na
+ 	adapter = sds_ring->adapter;
+ 	work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget);
+ 	if (work_done < budget) {
+-		napi_complete(&sds_ring->napi);
++		napi_complete_done(&sds_ring->napi, work_done);
+ 		if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
+ 			qlcnic_enable_sds_intr(adapter, sds_ring);
+ 	}
+--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
++++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+@@ -2334,7 +2334,7 @@ static int ql_napi_poll_msix(struct napi
+ 	}
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		ql_enable_completion_interrupt(qdev, rx_ring->irq);
+ 	}
+ 	return work_done;
+--- a/drivers/net/ethernet/qualcomm/emac/emac.c
++++ b/drivers/net/ethernet/qualcomm/emac/emac.c
+@@ -129,7 +129,7 @@ static int emac_napi_rtx(struct napi_str
+ 	emac_mac_rx_process(adpt, rx_q, &work_done, budget);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		irq->mask |= rx_q->intr;
+ 		writel(irq->mask, adpt->base + EMAC_INT_MASK);
+--- a/drivers/net/ethernet/realtek/r8169.c
++++ b/drivers/net/ethernet/realtek/r8169.c
+@@ -7579,7 +7579,7 @@ static int rtl8169_poll(struct napi_stru
+ 	}
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		rtl_irq_enable(tp, enable_mask);
+ 		mmiowb();
+--- a/drivers/net/ethernet/rocker/rocker_main.c
++++ b/drivers/net/ethernet/rocker/rocker_main.c
+@@ -2480,7 +2480,7 @@ static int rocker_port_poll_rx(struct na
+ 	}
+ 
+ 	if (credits < budget)
+-		napi_complete(napi);
++		napi_complete_done(napi, credits);
+ 
+ 	rocker_dma_ring_credits_set(rocker, &rocker_port->rx_ring, credits);
+ 
+--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
++++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
+@@ -1578,7 +1578,7 @@ static int sxgbe_poll(struct napi_struct
+ 
+ 	work_done = sxgbe_rx(priv, budget);
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		priv->hw->dma->enable_dma_irq(priv->ioaddr, qnum);
+ 	}
+ 
+--- a/drivers/net/ethernet/sfc/efx.c
++++ b/drivers/net/ethernet/sfc/efx.c
+@@ -332,7 +332,7 @@ static int efx_poll(struct napi_struct *
+ 		 * since efx_nic_eventq_read_ack() will have no effect if
+ 		 * interrupts have already been disabled.
+ 		 */
+-		napi_complete(napi);
++		napi_complete_done(napi, spent);
+ 		efx_nic_eventq_read_ack(channel);
+ 	}
+ 
+--- a/drivers/net/ethernet/smsc/smsc9420.c
++++ b/drivers/net/ethernet/smsc/smsc9420.c
+@@ -869,7 +869,7 @@ static int smsc9420_rx_poll(struct napi_
+ 	smsc9420_pci_flush_write(pd);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(&pd->napi);
++		napi_complete_done(&pd->napi, work_done);
+ 
+ 		/* re-enable RX DMA interrupts */
+ 		dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA);
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+@@ -2677,7 +2677,7 @@ static int stmmac_poll(struct napi_struc
+ 
+ 	work_done = stmmac_rx(priv, budget);
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		stmmac_enable_dma_irq(priv);
+ 	}
+ 	return work_done;
+--- a/drivers/net/ethernet/sun/niu.c
++++ b/drivers/net/ethernet/sun/niu.c
+@@ -3786,7 +3786,7 @@ static int niu_poll(struct napi_struct *
+ 	work_done = niu_poll_core(np, lp, budget);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		niu_ldg_rearm(np, lp, 1);
+ 	}
+ 	return work_done;
+--- a/drivers/net/ethernet/sun/sungem.c
++++ b/drivers/net/ethernet/sun/sungem.c
+@@ -922,7 +922,7 @@ static int gem_poll(struct napi_struct *
+ 		gp->status = readl(gp->regs + GREG_STAT);
+ 	} while (gp->status & GREG_STAT_NAPI);
+ 
+-	napi_complete(napi);
++	napi_complete_done(napi, work_done);
+ 	gem_enable_ints(gp);
+ 
+ 	return work_done;
+--- a/drivers/net/ethernet/sun/sunvnet_common.c
++++ b/drivers/net/ethernet/sun/sunvnet_common.c
+@@ -850,7 +850,7 @@ int sunvnet_poll_common(struct napi_stru
+ 	int processed = vnet_event_napi(port, budget);
+ 
+ 	if (processed < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, processed);
+ 		port->rx_event &= ~LDC_EVENT_DATA_READY;
+ 		vio_set_intr(vio->vdev->rx_ino, HV_INTR_ENABLED);
+ 	}
+--- a/drivers/net/ethernet/tehuti/tehuti.c
++++ b/drivers/net/ethernet/tehuti/tehuti.c
+@@ -303,7 +303,7 @@ static int bdx_poll(struct napi_struct *
+ 		 * device lock and allow waiting tasks (eg rmmod) to advance) */
+ 		priv->napi_stop = 0;
+ 
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		bdx_enable_interrupts(priv);
+ 	}
+ 	return work_done;
+--- a/drivers/net/ethernet/ti/cpsw.c
++++ b/drivers/net/ethernet/ti/cpsw.c
+@@ -839,7 +839,7 @@ static int cpsw_rx_poll(struct napi_stru
+ 	}
+ 
+ 	if (num_rx < budget) {
+-		napi_complete(napi_rx);
++		napi_complete_done(napi_rx, num_rx);
+ 		writel(0xff, &cpsw->wr_regs->rx_en);
+ 		if (cpsw->quirk_irq && cpsw->rx_irq_disabled) {
+ 			cpsw->rx_irq_disabled = false;
+--- a/drivers/net/ethernet/ti/davinci_emac.c
++++ b/drivers/net/ethernet/ti/davinci_emac.c
+@@ -1295,7 +1295,7 @@ static int emac_poll(struct napi_struct
+ 					&emac_rxhost_errcodes[cause][0], ch);
+ 		}
+ 	} else if (num_rx_pkts < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, num_rx_pkts);
+ 		emac_int_enable(priv);
+ 	}
+ 
+--- a/drivers/net/ethernet/ti/netcp_core.c
++++ b/drivers/net/ethernet/ti/netcp_core.c
+@@ -939,7 +939,7 @@ static int netcp_rx_poll(struct napi_str
+ 
+ 	netcp_rxpool_refill(netcp);
+ 	if (packets < budget) {
+-		napi_complete(&netcp->rx_napi);
++		napi_complete_done(&netcp->rx_napi, packets);
+ 		knav_queue_enable_notify(netcp->rx_queue);
+ 	}
+ 
+--- a/drivers/net/ethernet/tile/tilegx.c
++++ b/drivers/net/ethernet/tile/tilegx.c
+@@ -678,7 +678,7 @@ static int tile_net_poll(struct napi_str
+ 	}
+ 
+ 	/* There are no packets left. */
+-	napi_complete(&info_mpipe->napi);
++	napi_complete_done(&info_mpipe->napi, work);
+ 
+ 	md = &mpipe_data[instance];
+ 	/* Re-enable hypervisor interrupts. */
+--- a/drivers/net/ethernet/tile/tilepro.c
++++ b/drivers/net/ethernet/tile/tilepro.c
+@@ -842,7 +842,7 @@ static int tile_net_poll(struct napi_str
+ 		}
+ 	}
+ 
+-	napi_complete(&info->napi);
++	napi_complete_done(&info->napi, work);
+ 
+ 	if (!priv->active)
+ 		goto done;
+--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
++++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+@@ -1109,7 +1109,7 @@ static int gelic_net_poll(struct napi_st
+ 	}
+ 
+ 	if (packets_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, packets_done);
+ 		gelic_card_rx_irq_on(card);
+ 	}
+ 	return packets_done;
+--- a/drivers/net/ethernet/toshiba/spider_net.c
++++ b/drivers/net/ethernet/toshiba/spider_net.c
+@@ -1270,7 +1270,7 @@ static int spider_net_poll(struct napi_s
+ 	/* if all packets are in the stack, enable interrupts and return 0 */
+ 	/* if not, return 1 */
+ 	if (packets_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, packets_done);
+ 		spider_net_rx_irq_on(card);
+ 		card->ignore_rx_ramfull = 0;
+ 	}
+--- a/drivers/net/ethernet/toshiba/tc35815.c
++++ b/drivers/net/ethernet/toshiba/tc35815.c
+@@ -1639,7 +1639,7 @@ static int tc35815_poll(struct napi_stru
+ 	spin_unlock(&lp->rx_lock);
+ 
+ 	if (received < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, received);
+ 		/* enable interrupts */
+ 		tc_writel(tc_readl(&tr->DMA_Ctl) & ~DMA_IntMask, &tr->DMA_Ctl);
+ 	}
+--- a/drivers/net/ethernet/tundra/tsi108_eth.c
++++ b/drivers/net/ethernet/tundra/tsi108_eth.c
+@@ -887,7 +887,7 @@ static int tsi108_poll(struct napi_struc
+ 
+ 	if (num_received < budget) {
+ 		data->rxpending = 0;
+-		napi_complete(napi);
++		napi_complete_done(napi, num_received);
+ 
+ 		TSI_WRITE(TSI108_EC_INTMASK,
+ 				     TSI_READ(TSI108_EC_INTMASK)
+--- a/drivers/net/ethernet/via/via-rhine.c
++++ b/drivers/net/ethernet/via/via-rhine.c
+@@ -861,7 +861,7 @@ static int rhine_napipoll(struct napi_st
+ 	}
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		iowrite16(enable_mask, ioaddr + IntrEnable);
+ 		mmiowb();
+ 	}
+--- a/drivers/net/ethernet/via/via-velocity.c
++++ b/drivers/net/ethernet/via/via-velocity.c
+@@ -2160,7 +2160,7 @@ static int velocity_poll(struct napi_str
+ 	velocity_tx_srv(vptr);
+ 	/* If budget not fully consumed, exit the polling mode */
+ 	if (rx_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_done);
+ 		mac_enable_int(vptr->mac_regs);
+ 	}
+ 	spin_unlock_irqrestore(&vptr->lock, flags);
+--- a/drivers/net/ethernet/wiznet/w5100.c
++++ b/drivers/net/ethernet/wiznet/w5100.c
+@@ -915,7 +915,7 @@ static int w5100_napi_poll(struct napi_s
+ 	}
+ 
+ 	if (rx_count < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_count);
+ 		w5100_enable_intr(priv);
+ 	}
+ 
+--- a/drivers/net/ethernet/wiznet/w5300.c
++++ b/drivers/net/ethernet/wiznet/w5300.c
+@@ -417,7 +417,7 @@ static int w5300_napi_poll(struct napi_s
+ 	}
+ 
+ 	if (rx_count < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_count);
+ 		w5300_write(priv, W5300_IMR, IR_S0);
+ 		mmiowb();
+ 	}
+--- a/drivers/net/fjes/fjes_main.c
++++ b/drivers/net/fjes/fjes_main.c
+@@ -1122,7 +1122,7 @@ static int fjes_poll(struct napi_struct
+ 	}
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		if (adapter->unset_rx_last) {
+ 			adapter->rx_last_jiffies = jiffies;
+--- a/drivers/net/vmxnet3/vmxnet3_drv.c
++++ b/drivers/net/vmxnet3/vmxnet3_drv.c
+@@ -1851,7 +1851,7 @@ vmxnet3_poll(struct napi_struct *napi, i
+ 	rxd_done = vmxnet3_do_poll(rx_queue->adapter, budget);
+ 
+ 	if (rxd_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rxd_done);
+ 		vmxnet3_enable_all_intrs(rx_queue->adapter);
+ 	}
+ 	return rxd_done;
+@@ -1882,7 +1882,7 @@ vmxnet3_poll_rx_only(struct napi_struct
+ 	rxd_done = vmxnet3_rq_rx_complete(rq, adapter, budget);
+ 
+ 	if (rxd_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, rxd_done);
+ 		vmxnet3_enable_intr(adapter, rq->comp_ring.intr_idx);
+ 	}
+ 	return rxd_done;
+--- a/drivers/net/wan/fsl_ucc_hdlc.c
++++ b/drivers/net/wan/fsl_ucc_hdlc.c
+@@ -573,7 +573,7 @@ static int ucc_hdlc_poll(struct napi_str
+ 	howmany += hdlc_rx_done(priv, budget - howmany);
+ 
+ 	if (howmany < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, howmany);
+ 		qe_setbits32(priv->uccf->p_uccm,
+ 			     (UCCE_HDLC_RX_EVENTS | UCCE_HDLC_TX_EVENTS) << 16);
+ 	}
+--- a/drivers/net/wan/hd64572.c
++++ b/drivers/net/wan/hd64572.c
+@@ -341,7 +341,7 @@ static int sca_poll(struct napi_struct *
+ 		received = sca_rx_done(port, budget);
+ 
+ 	if (received < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, received);
+ 		enable_intr(port);
+ 	}
+ 
+--- a/drivers/net/wireless/ath/ath10k/pci.c
++++ b/drivers/net/wireless/ath/ath10k/pci.c
+@@ -2800,7 +2800,7 @@ static int ath10k_pci_napi_poll(struct n
+ 	done = ath10k_htt_txrx_compl_task(ar, budget);
+ 
+ 	if (done < budget) {
+-		napi_complete(ctx);
++		napi_complete_done(ctx, done);
+ 		/* In case of MSI, it is possible that interrupts are received
+ 		 * while NAPI poll is inprogress. So pending interrupts that are
+ 		 * received after processing all copy engine pipes by NAPI poll
+--- a/drivers/net/wireless/ath/wil6210/netdev.c
++++ b/drivers/net/wireless/ath/wil6210/netdev.c
+@@ -84,7 +84,7 @@ static int wil6210_netdev_poll_rx(struct
+ 	done = budget - quota;
+ 
+ 	if (done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, done);
+ 		wil6210_unmask_irq_rx(wil);
+ 		wil_dbg_txrx(wil, "NAPI RX complete\n");
+ 	}
+--- a/drivers/net/xen-netback/interface.c
++++ b/drivers/net/xen-netback/interface.c
+@@ -104,7 +104,7 @@ static int xenvif_poll(struct napi_struc
+ 	work_done = xenvif_tx_action(queue, budget);
+ 
+ 	if (work_done < budget) {
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 		/* If the queue is rate-limited, it shall be
+ 		 * rescheduled in the timer callback.
+ 		 */
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1059,7 +1059,7 @@ err:
+ 	if (work_done < budget) {
+ 		int more_to_do = 0;
+ 
+-		napi_complete(napi);
++		napi_complete_done(napi, work_done);
+ 
+ 		RING_FINAL_CHECK_FOR_RESPONSES(&queue->rx, more_to_do);
+ 		if (more_to_do)
+--- a/drivers/staging/octeon/ethernet-rx.c
++++ b/drivers/staging/octeon/ethernet-rx.c
+@@ -429,7 +429,7 @@ static int cvm_oct_napi_poll(struct napi
+ 
+ 	if (rx_count < budget) {
+ 		/* No more work */
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_count);
+ 		enable_irq(rx_group->irq);
+ 	}
+ 	return rx_count;
+--- a/drivers/staging/unisys/visornic/visornic_main.c
++++ b/drivers/staging/unisys/visornic/visornic_main.c
+@@ -1657,7 +1657,7 @@ static int visornic_poll(struct napi_str
+ 
+ 	/* If there aren't any more packets to receive stop the poll */
+ 	if (rx_count < budget)
+-		napi_complete(napi);
++		napi_complete_done(napi, rx_count);
+ 
+ 	return rx_count;
+ }


From lede-commits at lists.infradead.org  Sun Oct  8 09:09:36 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 12:09:36 -0400
Subject: [source]  sunxi: build image for the NanoPi NEO
In-Reply-To: <20171008160929.17318.44260@git-01.infra.lede-project.org>
References: <20171008160929.17318.44260@git-01.infra.lede-project.org>
Message-ID: <mailman.53245.1507478999.26984.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/34b153d7adc0aa9c34db75a5d324bf03c4159b4b

commit 34b153d7adc0aa9c34db75a5d324bf03c4159b4b
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Wed Sep 20 19:32:01 2017 +0200

    sunxi: build image for the NanoPi NEO
    
    The NanoPi NEO is a small Allwinner H3 based board available with
    different DRAM configurations.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 target/linux/sunxi/image/cortex-a7.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/target/linux/sunxi/image/cortex-a7.mk b/target/linux/sunxi/image/cortex-a7.mk
index 29c30ef..d0b7aa0 100644
--- a/target/linux/sunxi/image/cortex-a7.mk
+++ b/target/linux/sunxi/image/cortex-a7.mk
@@ -118,6 +118,15 @@ endef
 TARGET_DEVICES += sun8i-h2-plus-orangepi-r1
 
 
+define Device/sun8i-h3-nanopi-neo
+  DEVICE_TITLE:=FriendlyARM NanoPi NEO
+  SUPPORTED_DEVICES:=friendlyarm,nanopi-neo
+  SUNXI_DTS:=sun8i-h3-nanopi-neo
+endef
+
+TARGET_DEVICES += sun8i-h3-nanopi-neo
+
+
 define Device/sun8i-h3-orangepi-plus
   DEVICE_TITLE:=Xunlong Orange Pi Plus
   DEVICE_PACKAGES:=kmod-rtc-sunxi


From lede-commits at lists.infradead.org  Sun Oct  8 09:09:35 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 12:09:35 -0400
Subject: [source]  sunxi: kernel: add patches for NanoPi NEO
In-Reply-To: <20171008160929.17318.44260@git-01.infra.lede-project.org>
References: <20171008160929.17318.44260@git-01.infra.lede-project.org>
Message-ID: <mailman.53246.1507478999.26984.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/333f90347e76e6c0c121c1c7df917780eef8b59e

commit 333f90347e76e6c0c121c1c7df917780eef8b59e
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Tue Sep 26 20:05:31 2017 +0200

    sunxi: kernel: add patches for NanoPi NEO
    
    Enable dwmac-sun8i Ethernet core to use the built-in FastEthernet port.
    Enable exposed UART, USB and I2C pins.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 ...M-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch | 26 +++++++
 ...8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch | 82 ++++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/target/linux/sunxi/patches-4.9/0080-ARM-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch b/target/linux/sunxi/patches-4.9/0080-ARM-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch
new file mode 100644
index 0000000..ef65719
--- /dev/null
+++ b/target/linux/sunxi/patches-4.9/0080-ARM-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch
@@ -0,0 +1,26 @@
+Index: linux-4.9.51/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
+===================================================================
+--- linux-4.9.51.orig/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
++++ linux-4.9.51/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
+@@ -53,6 +53,7 @@
+ 
+ 	aliases {
+ 		serial0 = &uart0;
++		ethernet0 = &emac;
+ 	};
+ 
+ 	chosen {
+@@ -81,6 +82,13 @@
+ 	status = "okay";
+ };
+ 
++&emac {
++	phy-handle = <&int_mii_phy>;
++	phy-mode = "mii";
++	allwinner,leds-active-low;
++	status = "okay";
++};
++
+ &mmc0 {
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
diff --git a/target/linux/sunxi/patches-4.9/0081-ARM-dts-sun8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch b/target/linux/sunxi/patches-4.9/0081-ARM-dts-sun8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch
new file mode 100644
index 0000000..7b57b8a
--- /dev/null
+++ b/target/linux/sunxi/patches-4.9/0081-ARM-dts-sun8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch
@@ -0,0 +1,82 @@
+From e036def69972b9db9d2695f45cbf4e84c707b3c5 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel at makrotopia.org>
+Date: Fri, 23 Dec 2016 07:28:51 +0100
+Subject: [PATCH] ARM: dts: sun8i: nanopi-neo: enable UART, USB and I2C pins
+
+---
+ arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 43 ++++++++++++++++++++++++++++---
+ 1 file changed, 40 insertions(+), 3 deletions(-)
+
+Index: linux-4.9.51/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
+===================================================================
+--- linux-4.9.51.orig/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
++++ linux-4.9.51/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts
+@@ -78,10 +78,30 @@
+ 	};
+ };
+ 
++&ehci1 {
++	status = "okay";
++};
++
++&ohci1 {
++	status = "okay";
++};
++
++&ehci2 {
++	status = "okay";
++};
++
++&ohci2 {
++	status = "okay";
++};
++
+ &ehci3 {
+ 	status = "okay";
+ };
+ 
++&ohci3 {
++	status = "okay";
++};
++
+ &emac {
+ 	phy-handle = <&int_mii_phy>;
+ 	phy-mode = "mii";
+@@ -99,9 +119,6 @@
+ 	status = "okay";
+ };
+ 
+-&ohci3 {
+-	status = "okay";
+-};
+ 
+ &pio {
+ 	leds_opc: led-pins {
+@@ -127,7 +144,27 @@
+ 	status = "okay";
+ };
+ 
++&uart1 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&uart1_pins>;
++	status = "okay";
++};
++
++&uart2 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&uart2_pins>;
++	status = "okay";
++};
++
+ &usbphy {
+ 	/* USB VBUS is always on */
+ 	status = "okay";
+ };
++
++&i2c0 {
++	status = "okay";
++};
++
++&i2c1 {
++	status = "okay";
++};


From lede-commits at lists.infradead.org  Sun Oct  8 09:09:34 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 12:09:34 -0400
Subject: [source]  uboot-sunxi: build for NanoPi NEO
In-Reply-To: <20171008160929.17318.44260@git-01.infra.lede-project.org>
References: <20171008160929.17318.44260@git-01.infra.lede-project.org>
Message-ID: <mailman.53247.1507479004.26984.lede-commits@lists.infradead.org>

dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/b80f6a5876086afebde1b80383219504863636fc

commit b80f6a5876086afebde1b80383219504863636fc
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sat Sep 23 02:47:19 2017 +0200

    uboot-sunxi: build for NanoPi NEO
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/boot/uboot-sunxi/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 13fb8cb..50c6b06 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -126,6 +126,12 @@ define U-Boot/Lamobo_R1
   BUILD_DEVICES:=sun7i-a20-lamobo-r1
 endef
 
+define U-Boot/nanopi_neo
+  BUILD_SUBTARGET:=cortexa7
+  NAME:=U-Boot for NanoPi NEO (H3)
+  BUILD_DEVICES:=sun8i-h3-nanopi-neo
+endef
+
 define U-Boot/orangepi_r1
   BUILD_SUBTARGET:=cortexa7
   NAME:=Orange Pi R1 (H2+)
@@ -170,6 +176,7 @@ UBOOT_TARGETS := \
 	Linksprite_pcDuino \
 	Linksprite_pcDuino3 \
 	Lamobo_R1 \
+	nanopi_neo \
 	orangepi_r1 \
 	orangepi_plus \
 	pangolin \


From lede-commits at lists.infradead.org  Sun Oct  8 11:20:32 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 08 Oct 2017 14:20:32 -0400
Subject: [source]  treewide: switch git.netfilter.org to HTTPS
In-Reply-To: <20171008182032.23001.35050@git-01.infra.lede-project.org>
References: <20171008182032.23001.35050@git-01.infra.lede-project.org>
Message-ID: <mailman.53250.1507486999.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/9e9696afc8f295b5abd1a8bc0b1826d7ec5e54ca

commit 9e9696afc8f295b5abd1a8bc0b1826d7ec5e54ca
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sun Oct 8 21:09:46 2017 +0300

    treewide: switch git.netfilter.org to HTTPS
    
    As git.netfilter.org seems to support HTTPS, use that instead of HTTP
    which is insecure, or GIT which is blocked on many corporate networks.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/libs/libnetfilter-queue/Makefile | 2 +-
 package/libs/libnftnl/Makefile           | 2 +-
 package/network/utils/arptables/Makefile | 2 +-
 package/network/utils/ebtables/Makefile  | 2 +-
 package/network/utils/nftables/Makefile  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/libs/libnetfilter-queue/Makefile b/package/libs/libnetfilter-queue/Makefile
index dd8fd9f..3bbc2d1 100644
--- a/package/libs/libnetfilter-queue/Makefile
+++ b/package/libs/libnetfilter-queue/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=libnetfilter_queue
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL=http://git.netfilter.org/libnetfilter_queue
+PKG_SOURCE_URL=https://git.netfilter.org/libnetfilter_queue
 PKG_SOURCE_DATE:=2016-07-03
 PKG_SOURCE_VERSION:=981025e103d887fb6a9c9bb49c74ec323108d098
 PKG_MIRROR_HASH:=85c124be0e19162e1ebd1aba6e7e86bb4106e9dab4267baaf66d3ccb48d56e3f
diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile
index f7d6875..f4a1bb1 100644
--- a/package/libs/libnftnl/Makefile
+++ b/package/libs/libnftnl/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=libnftnl
 PKG_VERSION:=1.0.7
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=git://git.netfilter.org/libnftnl
+PKG_SOURCE_URL:=https://git.netfilter.org/libnftnl
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=libnftnl-1.0.7
 PKG_MIRROR_HASH:=d38a409d52074a5b20f5b7477b385506692a9a05ec6f4ac3d14a8a80aa4f81d9
diff --git a/package/network/utils/arptables/Makefile b/package/network/utils/arptables/Makefile
index d2fd259..d1168ae 100644
--- a/package/network/utils/arptables/Makefile
+++ b/package/network/utils/arptables/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=arptables
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=git://git.netfilter.org/arptables
+PKG_SOURCE_URL:=https://git.netfilter.org/arptables
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2015-05-20
 PKG_SOURCE_VERSION:=f4ab8f63f11a72f14687a6646d04ae1bae3fa45f
diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile
index da7b741..7a3a825 100644
--- a/package/network/utils/ebtables/Makefile
+++ b/package/network/utils/ebtables/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=ebtables
 PKG_SOURCE_DATE:=2015-10-28
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=git://git.netfilter.org/ebtables
+PKG_SOURCE_URL:=https://git.netfilter.org/ebtables
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=4c3e5cd3dbae3ea773e9dcca7cf019b2713af70d
 PKG_MIRROR_HASH:=997a877da02d6e2141e6d31c5d4dd005737facecfdbea07308c0e1286db8591c
diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile
index b454403..266bd4b 100644
--- a/package/network/utils/nftables/Makefile
+++ b/package/network/utils/nftables/Makefile
@@ -10,7 +10,7 @@ PKG_NAME:=nftables
 PKG_VERSION:=0.7
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=git://git.netfilter.org/nftables
+PKG_SOURCE_URL:=https://git.netfilter.org/nftables
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=79cbd19e7437680561b26109bbf4f48cb2e8e0a7
 PKG_MIRROR_HASH:=6b06a114c5a1b397b0ae616d5d292859611b0eb05b647182b3c00421909338b8


From lede-commits at lists.infradead.org  Mon Oct  9 02:30:07 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 09 Oct 2017 05:30:07 -0400
Subject: [source] mediatek: fix a sleep while atomic bug inside the ethernet
 driver
In-Reply-To: <20171009093002.6538.42511@git-01.infra.lede-project.org>
References: <20171009093002.6538.42511@git-01.infra.lede-project.org>
Message-ID: <mailman.53309.1507541432.26984.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/c972779e9875a3b69ae607bdb691bf5ff52710cf

commit c972779e9875a3b69ae607bdb691bf5ff52710cf
Author: John Crispin <john at phrozen.org>
AuthorDate: Mon Oct 9 11:29:01 2017 +0200

    mediatek: fix a sleep while atomic bug inside the ethernet driver
    
    this sometimes happens when we have hw nat enabled.
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 .../mediatek/patches-4.9/0063-atomic-sleep.patch   | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/target/linux/mediatek/patches-4.9/0063-atomic-sleep.patch b/target/linux/mediatek/patches-4.9/0063-atomic-sleep.patch
new file mode 100644
index 0000000..3a8cd59
--- /dev/null
+++ b/target/linux/mediatek/patches-4.9/0063-atomic-sleep.patch
@@ -0,0 +1,40 @@
+Index: linux-4.9.50/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+===================================================================
+--- linux-4.9.50.orig/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ linux-4.9.50/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -1533,7 +1533,10 @@ static void mtk_hwlro_rx_uninit(struct m
+ 	for (i = 0; i < 10; i++) {
+ 		val = mtk_r32(eth, MTK_PDMA_LRO_CTRL_DW0);
+ 		if (val & MTK_LRO_RING_RELINQUISH_DONE) {
+-			msleep(20);
++			if (in_atomic())
++				mdelay(20);
++			else
++				msleep(20);
+ 			continue;
+ 		}
+ 		break;
+@@ -1951,7 +1954,10 @@ static void mtk_stop_dma(struct mtk_eth
+ 	for (i = 0; i < 10; i++) {
+ 		val = mtk_r32(eth, glo_cfg);
+ 		if (val & (MTK_TX_DMA_BUSY | MTK_RX_DMA_BUSY)) {
+-			msleep(20);
++			if (in_atomic())
++				mdelay(20);
++			else
++				msleep(20);
+ 			continue;
+ 		}
+ 		break;
+@@ -1996,7 +2002,10 @@ static void ethsys_reset(struct mtk_eth
+ 			   reset_bits,
+ 			   reset_bits);
+ 
+-	usleep_range(1000, 1100);
++	if (in_atomic())
++		udelay(1000);
++	else
++		usleep_range(1000, 1100);
+ 	regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL,
+ 			   reset_bits,
+ 			   ~reset_bits);


From lede-commits at lists.infradead.org  Mon Oct  9 06:56:09 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 09 Oct 2017 09:56:09 -0400
Subject: [source]  libnetfilter_queue: bump to git HEAD
In-Reply-To: <20171009135604.10378.46306@git-01.infra.lede-project.org>
References: <20171009135604.10378.46306@git-01.infra.lede-project.org>
Message-ID: <mailman.53360.1507557405.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/bcfc39b763e8f748aa0383711691492430ef6e65

commit bcfc39b763e8f748aa0383711691492430ef6e65
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sun Oct 8 21:46:44 2017 +0300

    libnetfilter_queue: bump to git HEAD
    
    b39cac7 src: Correct typo in the location of internal.h in #include
    58cb066 src: Declare the define visibility attribute together
    e84b559 Revert "src: Declare the define visibility attribute together"
    003c2b1 examples: set dummy connmark value to show use of NFQA_CT nested attribute
    63973da doc: extend the doxygen section about NFQA_CFG_F_GSO
    d7f74c7 build: bump version to 1.0.3
    3f9eb57 build: bump library release version too
    601abd1 doc: Add information about retrieving UID/GID/SECCTX fields
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/libs/libnetfilter-queue/Makefile               |  6 +++---
 .../patches/100-checksum_computation.patch             | 18 ++++++++----------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/package/libs/libnetfilter-queue/Makefile b/package/libs/libnetfilter-queue/Makefile
index 3bbc2d1..8a11d07 100644
--- a/package/libs/libnetfilter-queue/Makefile
+++ b/package/libs/libnetfilter-queue/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=https://git.netfilter.org/libnetfilter_queue
-PKG_SOURCE_DATE:=2016-07-03
-PKG_SOURCE_VERSION:=981025e103d887fb6a9c9bb49c74ec323108d098
-PKG_MIRROR_HASH:=85c124be0e19162e1ebd1aba6e7e86bb4106e9dab4267baaf66d3ccb48d56e3f
+PKG_SOURCE_DATE:=2017-06-27
+PKG_SOURCE_VERSION:=601abd1c71ccdf90753cf294c120ad43fb25dc54
+PKG_MIRROR_HASH:=283b99cfe5856dc87fd6bab8f78c0c59b72462d6b4f2b13111f928cf33020eb3
 
 PKG_FIXUP:=autoreconf
 PKG_LICENSE:=GPL-2.0+
diff --git a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch
index 81faffe..92e750d 100644
--- a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch
+++ b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch
@@ -8,7 +8,7 @@
  #include <arpa/inet.h>
  #include <netinet/ip.h>
  #include <netinet/ip6.h>
-@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size)
+@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint
  		sum += *buf++;
  		size -= sizeof(uint16_t);
  	}
@@ -24,7 +24,7 @@
  
  	sum = (sum >> 16) + (sum & 0xffff);
  	sum += (sum >>16);
-@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size)
+@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint
  	return (uint16_t)(~sum);
  }
  
@@ -33,7 +33,7 @@
  {
  	uint32_t sum = 0;
  	uint32_t iph_len = iph->ihl*4;
-@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph)
+@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct
  	sum += (iph->saddr) & 0xFFFF;
  	sum += (iph->daddr >> 16) & 0xFFFF;
  	sum += (iph->daddr) & 0xFFFF;
@@ -49,7 +49,7 @@
  {
  	uint32_t sum = 0;
  	uint32_t hdr_len = (uint32_t *)transport_hdr - (uint32_t *)ip6h;
-@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr)
+@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct
  		sum += (ip6h->ip6_dst.s6_addr16[i] >> 16) & 0xFFFF;
  		sum += (ip6h->ip6_dst.s6_addr16[i]) & 0xFFFF;
  	}
@@ -58,11 +58,9 @@
  	sum += htons(ip6h->ip6_plen);
  
  	return nfq_checksum(sum, (uint16_t *)payload, len);
-diff --git a/src/extra/tcp.c b/src/extra/tcp.c
-index d1cd79d..a66f392 100644
 --- a/src/extra/tcp.c
 +++ b/src/extra/tcp.c
-@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph)
+@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcp
  {
  	/* checksum field in header needs to be zero for calculation. */
  	tcph->check = 0;
@@ -71,7 +69,7 @@ index d1cd79d..a66f392 100644
  }
  EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4);
  
-@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h)
+@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcp
  {
  	/* checksum field in header needs to be zero for calculation. */
  	tcph->check = 0;
@@ -82,7 +80,7 @@ index d1cd79d..a66f392 100644
  
 --- a/src/extra/udp.c
 +++ b/src/extra/udp.c
-@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph)
+@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udp
  {
  	/* checksum field in header needs to be zero for calculation. */
  	udph->check = 0;
@@ -91,7 +89,7 @@ index d1cd79d..a66f392 100644
  }
  EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4);
  
-@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h)
+@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udp
  {
  	/* checksum field in header needs to be zero for calculation. */
  	udph->check = 0;


From lede-commits at lists.infradead.org  Mon Oct  9 06:56:10 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 09 Oct 2017 09:56:10 -0400
Subject: [source]  libnetfilter_conntrack: switch to git
In-Reply-To: <20171009135604.10378.46306@git-01.infra.lede-project.org>
References: <20171009135604.10378.46306@git-01.infra.lede-project.org>
Message-ID: <mailman.53361.1507557408.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/7695f144ebaab13c130c58903c7519af21c085f6

commit 7695f144ebaab13c130c58903c7519af21c085f6
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Sep 20 15:54:30 2017 +0300

    libnetfilter_conntrack: switch to git
    
    In order to build conntrack-tools from git, a newer version of
    libnetfilter_conntrack is required. As 1.0.6 is currently the latest
    release, switch to git.
    
    b0a7cf7 include: expose a copy of nf_conntrack_common.h
    f68f7b3 conntrack: fix missing break in setobjopt_undo_dnat()
    79dac5a conntrack: revert getobjopt_is_nat() condition
    b266523 libnetfilter_conntrack: bump version to 1.0.7
    e870432 labels: don't crash on NULL labelmap
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/libs/libnetfilter-conntrack/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile
index 399aa6c..be82285 100644
--- a/package/libs/libnetfilter-conntrack/Makefile
+++ b/package/libs/libnetfilter-conntrack/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnetfilter_conntrack
-PKG_VERSION:=1.0.6
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:= \
-	http://www.netfilter.org/projects/libnetfilter_conntrack/files/ \
-	ftp://ftp.netfilter.org/pub/libnetfilter_conntrack/
-PKG_HASH:=efcc08021284e75f4d96d3581c5155a11f08fd63316b1938cbcb269c87f37feb
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://git.netfilter.org/libnetfilter_conntrack
+PKG_SOURCE_DATE:=2017-07-25
+PKG_SOURCE_VERSION:=e870432649955d377a73ee5a72cb23f0f6b5e4c5
+PKG_MIRROR_HASH:=6891e6bea956d5d3514524918f439dfe8b5806397d8d40d1afc69b9bfebc1d57
+
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 
 PKG_FIXUP:=autoreconf


From lede-commits at lists.infradead.org  Mon Oct  9 06:56:11 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 09 Oct 2017 09:56:11 -0400
Subject: [source]  conntrack-tools: switch to git
In-Reply-To: <20171009135604.10378.46306@git-01.infra.lede-project.org>
References: <20171009135604.10378.46306@git-01.infra.lede-project.org>
Message-ID: <mailman.53362.1507557426.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/f8595a51d9558bbccb904eb39f43479bda8a8797

commit f8595a51d9558bbccb904eb39f43479bda8a8797
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Sep 20 15:58:54 2017 +0300

    conntrack-tools: switch to git
    
    There have been a number of interesting fixes in conntrack-tools since
    the current latest release. Most notable is that this fixes IPv6
    conntrack table syncing when cross-compiling conntrack-tools.
    
    7e7748d src/main: refresh help message
    fe32043 conntrackd.8: refresh file
    47a4dda conntrackd.8: add reference to systemd
    0cfe7ff doc/manual: include some bits about init systems
    74a418b conntrackd: cthelper: ftp: Set match offset/len for PORT mangling
    d833bed conntrackd: cthelper: ftp: Fix debug print
    dd4b5a1 conntrackd: cthelper: Add new mdns helper
    498d698 Link nfct and helper modules with `-z lazy`
    9e94e85 sync-mode: print errno message on failure
    ab81c35 log: print messages to stdout/sderr if running in console mode
    631d92b log: introduce a mechanism to know if log was initialized
    ccb1c8b conntrackd: replace error reporting in the config parser with dlog()
    bee121e conntrackd: replace fprintf calls with dlog()
    5a51b04 conntrack-tools: update Arturo Borrero Gonzalez email address
    abb9984 helper: remove copy and paste from uapi kernel header
    a91a004 src: add log message when resync is requested by other node
    c2d8be1 systemd: fix missing log.h include
    f6ca216 config: drop old/obsolete/deprecated conntrackd.conf config options
    8b83771 conntrack: send mark filter to kernel iff set
    1ba5e76 conntrackd: cthelper: Don't leak nat_tuple
    832166d conntrackd: cthelper: Free pktb after use
    ff843bc conntrackd: config: Do not strdup() tokens
    b61c454 conntrackd: cthelper: ssdp: Track UPnP eventing
    8ea394e conntrackd: Remove obsolete rule to catch ambiguous Checksum option
    39398cd conntrackd: CommitTimeout breaks DisableExternalCache set On
    29b390a conntrack: Support IPv6 NAT
    381827a conntrackd: factorice tx_queue functions
    131df89 conntrackd: factorize resync operations
    d31bacc conntrackd: consolidate more code to use resync_send()
    3d98496 conntrackd: request resync at startup
    ef410bf conntrackd: remove use of HAVE_INET_PTON_IPV6
    9d38445 conntrackd: evaluate configuration earlier
    6feded7 conntrackd: cleanup if failed forking
    dbfdea7 conntrackd: deprecate unix backlog configuration
    210f542 conntrackd: make the daemon run in RT mode by default
    37cc7f0 conntrackd: remove warning for -S
    d2849d1 conntrack: Show multiple CPUs stats from proc
    bc0b49a conntrackd: cthelper: ssdp: fix build with musl
    0c77a25 tests: don't fail on modprobe since the driver might be built-in
    eefe649 conntrack.8: refresh manpage
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/network/utils/conntrack-tools/Makefile | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile
index 128fa9e..e2aa77a 100644
--- a/package/network/utils/conntrack-tools/Makefile
+++ b/package/network/utils/conntrack-tools/Makefile
@@ -8,15 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=conntrack-tools
-PKG_VERSION:=1.4.4
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:= \
-	http://www.netfilter.org/projects/conntrack-tools/files \
-	ftp://ftp.netfilter.org/pub/conntrack-tools \
-	http://mirrors.evolva.ro/netfilter.org/conntrack-tools
-PKG_HASH:=b7caf4fcc4c03575df57d25e5216584d597fd916c891f191dac616ce68bdba6c
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://git.netfilter.org/conntrack-tools
+PKG_SOURCE_DATE:=2017-09-27
+PKG_SOURCE_VERSION:=eefe649ca51ed0cbb995454cdc366f5072f6443c
+PKG_MIRROR_HASH:=1c207c3e423d741fbb31e3c29486a811e6dad493f26ec47a2df75b6262a1b4bd
 
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Mon Oct  9 08:35:56 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 09 Oct 2017 11:35:56 -0400
Subject: [source] image-commands: tplink-v2-header: pass kernel loadaddr and
 entry
In-Reply-To: <20171009153555.311.20980@git-01.infra.lede-project.org>
References: <20171009153555.311.20980@git-01.infra.lede-project.org>
Message-ID: <mailman.53381.1507563380.26984.lede-commits@lists.infradead.org>

lynxis pushed a commit to source.git, branch master:
https://git.lede-project.org/49b84624eb694ed8238472db758708384fe62ce6

commit 49b84624eb694ed8238472db758708384fe62ce6
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Mon Oct 9 13:50:03 2017 +0200

    image-commands: tplink-v2-header: pass kernel loadaddr and entry
    
    Initramfs images won't boot if the default loadaddr and entrypont is
    different.
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 include/image-commands.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 4fe8c0f..aaece70 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -249,7 +249,8 @@ endef
 
 define Build/tplink-v2-header
 	$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
-		-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
+		-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
+		-E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR))  \
 		-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
 		-T $(TPLINK_HVERSION) -V "ver. 2.0" \
 		-k $@ -o $@.new $(1)


From lede-commits at lists.infradead.org  Mon Oct  9 08:35:55 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 09 Oct 2017 11:35:55 -0400
Subject: [source] net: uqmi: fix blocking in endless loops when unplugging
 device
In-Reply-To: <20171009153555.311.20980@git-01.infra.lede-project.org>
References: <20171009153555.311.20980@git-01.infra.lede-project.org>
Message-ID: <mailman.53382.1507563380.26984.lede-commits@lists.infradead.org>

lynxis pushed a commit to source.git, branch master:
https://git.lede-project.org/a5d016f3615c10a326a507dcb24afe8adcd48396

commit a5d016f3615c10a326a507dcb24afe8adcd48396
Author: Alexandru Ardelean <ardeleanalex at gmail.com>
AuthorDate: Fri Sep 29 16:35:30 2017 +0300

    net: uqmi: fix blocking in endless loops when unplugging device
    
    If you unplug a QMI device, the /dev/cdc-wdmX device
    disappears but uqmi will continue to poll it endlessly.
    
    Then, when you plug it back, you have 2 uqmi processes,
    and that's bad, because 2 processes talking QMI to the
    same device [and the same time] doesn't seem to work well.
    
    Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
---
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 35de6c5..f5c8768 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -65,6 +65,7 @@ proto_qmi_setup() {
 	[ -n "$delay" ] && sleep "$delay"
 
 	while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
+		[ -e "$device" ] || return 1
 		sleep 1;
 	done
 
@@ -102,6 +103,7 @@ proto_qmi_setup() {
 
 	echo "Waiting for network registration"
 	while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do
+		[ -e "$device" ] || return 1
 		sleep 5;
 	done
 


From lede-commits at lists.infradead.org  Mon Oct  9 08:35:57 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 09 Oct 2017 11:35:57 -0400
Subject: [source]  ramips/mt76x8: add initramfs support for tplink 841n v13
In-Reply-To: <20171009153555.311.20980@git-01.infra.lede-project.org>
References: <20171009153555.311.20980@git-01.infra.lede-project.org>
Message-ID: <mailman.53385.1507563383.26984.lede-commits@lists.infradead.org>

lynxis pushed a commit to source.git, branch master:
https://git.lede-project.org/b73986a8264016883a8a7d666687a340cb810934

commit b73986a8264016883a8a7d666687a340cb810934
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Mon Oct 9 13:51:21 2017 +0200

    ramips/mt76x8: add initramfs support for tplink 841n v13
    
    The tplink 841n v13 requires an tplink v2 image header in
    front of an initramfs image.
    
    To boot an initramfs image:
    - break the uboot by holding the '4' key
    - setup your tftp server 192.168.0.255
    - tftp 81000000 lede-ramips-mt76x8-tl-wr841n-v13-initramfs-kernel.bin
    - bootm
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 target/linux/ramips/image/mt76x8.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index db32684..56da7b1 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -91,6 +91,7 @@ define Device/tl-wr840n-v4
   TPLINK_HWREVADD := 0x4
   TPLINK_HVERSION := 3
   KERNEL := $(KERNEL_DTB)
+  KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e
   IMAGES += tftp-recovery.bin
   IMAGE/factory.bin := tplink-v2-image -e
   IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin)


From lede-commits at lists.infradead.org  Tue Oct 10 01:22:50 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 10 Oct 2017 04:22:50 -0400
Subject: [source] bcm53xx: backport DTS changes up to the first 4.15 queued
 commits
In-Reply-To: <20171010082250.16838.56985@git-01.infra.lede-project.org>
References: <20171010082250.16838.56985@git-01.infra.lede-project.org>
Message-ID: <mailman.53512.1507623811.26984.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/f98f83eadaf6fc84fb33eaff50b9efd37c2cc5ed

commit f98f83eadaf6fc84fb33eaff50b9efd37c2cc5ed
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Oct 10 09:19:10 2017 +0200

    bcm53xx: backport DTS changes up to the first 4.15 queued commits
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...53573-Add-Broadcom-BCM947189ACDBMR-board-.patch | 135 +++++++++++++++++++++
 ...3-Specify-ports-for-USB-LED-for-Tenda-AC9.patch |  58 +++++++++
 ...5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch |  30 +++++
 ...RM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch |  96 +++++++++++++++
 ...RM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch |  96 +++++++++++++++
 ...ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch | 120 ++++++++++++++++++
 ...RM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch |  83 +++++++++++++
 ...M-dts-BCM5301X-Add-serial-to-the-bootargs.patch |  44 +++++++
 ...53573-Add-Broadcom-BCM947189ACDBMR-board-.patch | 135 +++++++++++++++++++++
 ...3-Specify-ports-for-USB-LED-for-Tenda-AC9.patch |  58 +++++++++
 ...5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch |  30 +++++
 ...RM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch |  96 +++++++++++++++
 ...RM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch |  96 +++++++++++++++
 ...ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch | 120 ++++++++++++++++++
 ...RM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch |  83 +++++++++++++
 ...M-dts-BCM5301X-Add-serial-to-the-bootargs.patch |  44 +++++++
 16 files changed, 1324 insertions(+)

diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch b/target/linux/bcm53xx/patches-4.4/049-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch
new file mode 100644
index 0000000..69deca1
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch
@@ -0,0 +1,135 @@
+From 092ccf0415c720a1e9458a46fe75f77574027a55 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Tue, 18 Jul 2017 12:37:37 -0700
+Subject: [PATCH] ARM: dts: BCM53573: Add Broadcom BCM947189ACDBMR board
+ support
+
+Adds support for the Broadcom reference board BCM947189ACDMBR which
+features the following:
+
+* 128MB of DRAM
+* External MoCA support through a Broadcom BCM6802 chip
+* 1x external Gigabit PHY through the external BCM6802
+* 1x USB 2.0 port
+* 1x PCIE slot
+* Few configurable buttons and LEDs
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile            |  3 +-
+ arch/arm/boot/dts/bcm947189acdbmr.dts | 97 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 99 insertions(+), 1 deletion(-)
+ create mode 100644 arch/arm/boot/dts/bcm947189acdbmr.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -93,7 +93,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
+-	bcm47189-tenda-ac9.dtb
++	bcm47189-tenda-ac9.dtb \
++	bcm947189acdbmr.dtb
+ dtb-$(CONFIG_ARCH_BCM_63XX) += \
+ 	bcm963138dvt.dtb
+ dtb-$(CONFIG_ARCH_BCM_CYGNUS) += \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm947189acdbmr.dts
+@@ -0,0 +1,97 @@
++/*
++ * Copyright (C) 2017 Broadcom
++ * Author: Florian Fainelli <f.fainelli at gmail.com>
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "brcm,bcm947189acdbmr", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Broadcom BCM947189ACDBMR";
++
++	chosen {
++		bootargs = "console=ttyS0,115200 earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wps {
++			label = "bcm53xx:blue:wps";
++			gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
++		};
++
++		5ghz {
++			label = "bcm53xx:blue:5ghz";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>;
++		};
++
++		2ghz {
++			label = "bcm53xx:blue:2ghz";
++			gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>;
++		};
++
++		wps {
++			label = "WPS";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	spi {
++		compatible = "spi-gpio";
++		num-chipselects = <1>;
++		gpio-sck = <&chipcommon 21 0>;
++		gpio-miso = <&chipcommon 22 0>;
++		gpio-mosi = <&chipcommon 23 0>;
++		cs-gpios = <&chipcommon 24 0>;
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		/* External BCM6802 MoCA chip is connected */
++	};
++};
++
++&pcie0 {
++	ranges = <0x00000000 0 0 0 0 0x00100000>;
++	#address-cells = <3>;
++	#size-cells = <2>;
++
++	bridge at 0,0,0 {
++		reg = <0x0000 0 0 0 0>;
++		ranges = <0x00000000 0 0 0 0 0 0 0x00100000>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++
++		wifi at 0,1,0 {
++			reg = <0x0000 0 0 0 0>;
++			ranges = <0x00000000 0 0 0 0x00100000>;
++			#address-cells = <1>;
++			#size-cells = <1>;
++		};
++	};
++};
++
++&usb2 {
++	vcc-gpio = <&chipcommon 8 GPIO_ACTIVE_HIGH>;
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch b/target/linux/bcm53xx/patches-4.4/049-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch
new file mode 100644
index 0000000..75f1d17
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch
@@ -0,0 +1,58 @@
+From 0173b2cd6948b5b96ac4e8dbc3bcb4dd0b45c296 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Thu, 17 Aug 2017 11:05:14 +0200
+Subject: [PATCH] ARM: BCM53573: Specify ports for USB LED for Tenda AC9
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This uses trigger-sources documented in commit 80dc6e1cd85fc ("dt-bindings:
+leds: document new trigger-sources property") to specify USB ports. Such an
+information can be used by operating system to setup LEDs behavior.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 2 ++
+ arch/arm/boot/dts/bcm53573.dtsi          | 4 ++++
+ 2 files changed, 6 insertions(+)
+
+--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts
++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts
+@@ -26,6 +26,8 @@
+ 		usb {
+ 			label = "bcm53xx:blue:usb";
+ 			gpios = <&chipcommon 1 GPIO_ACTIVE_HIGH>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>;
++			linux,default-trigger = "usbport";
+ 		};
+ 
+ 		wps {
+--- a/arch/arm/boot/dts/bcm53573.dtsi
++++ b/arch/arm/boot/dts/bcm53573.dtsi
+@@ -138,10 +138,12 @@
+ 
+ 				ehci_port1: port at 1 {
+ 					reg = <1>;
++					#trigger-source-cells = <0>;
+ 				};
+ 
+ 				ehci_port2: port at 2 {
+ 					reg = <2>;
++					#trigger-source-cells = <0>;
+ 				};
+ 			};
+ 
+@@ -158,10 +160,12 @@
+ 
+ 				ohci_port1: port at 1 {
+ 					reg = <1>;
++					#trigger-source-cells = <0>;
+ 				};
+ 
+ 				ohci_port2: port at 2 {
+ 					reg = <2>;
++					#trigger-source-cells = <0>;
+ 				};
+ 			};
+ 		};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch
new file mode 100644
index 0000000..3148f6c
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch
@@ -0,0 +1,30 @@
+From 2460266f21f140936e627f28f28d1a4f30887ae9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 6 Oct 2017 10:52:35 +0200
+Subject: [PATCH] ARM: dts: BCM5301X: Specify USB ports for USB LED of Luxul
+ XWR-1200
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This info can be used by operating system to setup LED behavior.
+
+Reported-by: Dan Haab <dhaab at luxul.com>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts
++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts
+@@ -57,7 +57,8 @@
+ 		usb {
+ 			label = "bcm53xx:green:usb";
+ 			gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>;
+-			linux,default-trigger = "none";
++			trigger-sources = <&ohci_port2>, <&ehci_port2>;
++			linux,default-trigger = "usbport";
+ 		};
+ 
+ 		status {
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch
new file mode 100644
index 0000000..fbe8f54
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch
@@ -0,0 +1,96 @@
+From 1f4b0d5596d2e3ea8e953d578ab8444ce860d35d Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:22 -0600
+Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Luxul XBR-4500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM47094 (AKA BCM4709C0) based router with ports-on-the-front
+board design.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 63 +++++++++++++++++++++++++++
+ 2 files changed, 64 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -85,6 +85,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-tplink-archer-c9-v1.dtb \
+ 	bcm47094-dlink-dir-885l.dtb \
+ 	bcm47094-linksys-panamera.dtb \
++	bcm47094-luxul-xbr-4500.dtb \
+ 	bcm47094-luxul-xwr-3100.dtb \
+ 	bcm47094-netgear-r8500.dtb \
+ 	bcm94708.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (C) 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "luxul,xbr-4500-v1", "brcm,bcm47094", "brcm,bcm4708";
++	model = "Luxul XBR-4500 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000
++		       0x88000000 0x18000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		status {
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 20 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "timer";
++		};
++
++		usb3 {
++			label = "bcm53xx:green:usb3";
++			gpios = <&chipcommon 19 GPIO_ACTIVE_HIGH>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>,
++				<&xhci_port1>;
++			linux,default-trigger = "usbport";
++		};
++
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&usb3 {
++	vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
++};
++
++&spi_nor {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch
new file mode 100644
index 0000000..b5ba1dd
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch
@@ -0,0 +1,96 @@
+From 65f78c4c41a9b9a7637e1dda2d5e41cf26ea971c Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:23 -0600
+Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Luxul ABR-4500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM47094 (AKA BCM4709C0) based router with rear-facing ports
+board design.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 63 +++++++++++++++++++++++++++
+ 2 files changed, 64 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -85,6 +85,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-tplink-archer-c9-v1.dtb \
+ 	bcm47094-dlink-dir-885l.dtb \
+ 	bcm47094-linksys-panamera.dtb \
++	bcm47094-luxul-abr-4500.dtb \
+ 	bcm47094-luxul-xbr-4500.dtb \
+ 	bcm47094-luxul-xwr-3100.dtb \
+ 	bcm47094-netgear-r8500.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (C) 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "luxul,abr-4500-v1", "brcm,bcm47094", "brcm,bcm4708";
++	model = "Luxul ABR-4500 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000
++		       0x88000000 0x18000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		status {
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++
++		usb3 {
++			label = "bcm53xx:green:usb3";
++			gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>,
++				<&xhci_port1>;
++			linux,default-trigger = "usbport";
++		};
++
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&usb3 {
++	vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
++};
++
++&spi_nor {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch
new file mode 100644
index 0000000..407537f
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch
@@ -0,0 +1,120 @@
+From 0aa052ce1c3340850a7e5980b6d24b3ea5779591 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:59 -0600
+Subject: [PATCH] ARM: dts: BCM53573: Add DT for Luxul XAP-810
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM53573 WiSoC based access point with an extra BCM43217 chipset
+used for 2.4 GHz.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                   |  1 +
+ arch/arm/boot/dts/bcm47189-luxul-xap-810.dts | 87 ++++++++++++++++++++++++++++
+ 2 files changed, 88 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -95,6 +95,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
++	bcm47189-luxul-xap-810.dtb \
+ 	bcm47189-tenda-ac9.dtb \
+ 	bcm947189acdbmr.dtb
+ dtb-$(CONFIG_ARCH_BCM_63XX) += \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+@@ -0,0 +1,87 @@
++/*
++ * Copyright 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "luxul,xap-810-v1", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Luxul XAP-810 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		5ghz {
++			label = "bcm53xx:blue:5ghz";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-off";
++		};
++
++		system {
++			label = "bcm53xx:green:system";
++			gpios = <&chipcommon 15 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "timer";
++		};
++	};
++
++	pcie0_leds {
++		compatible = "gpio-leds";
++
++		2ghz {
++			label = "bcm53xx:blue:2ghz";
++			gpios = <&pcie0_chipcommon 3 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-off";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&pcie0 {
++	ranges = <0x00000000 0 0 0 0 0x00100000>;
++	#address-cells = <3>;
++	#size-cells = <2>;
++
++	bridge at 0,0,0 {
++		reg = <0x0000 0 0 0 0>;
++		ranges = <0x00000000 0 0 0 0 0 0 0x00100000>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++
++		wifi at 0,1,0 {
++			reg = <0x0000 0 0 0 0>;
++			ranges = <0x00000000 0 0 0 0x00100000>;
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			pcie0_chipcommon: chipcommon at 0 {
++				reg = <0 0x1000>;
++
++				gpio-controller;
++				#gpio-cells = <2>;
++			};
++		};
++	};
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch
new file mode 100644
index 0000000..51b3dc7
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch
@@ -0,0 +1,83 @@
+From 7030ea600d560026b91726f2eb79c856b813afa9 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:47:00 -0600
+Subject: [PATCH] ARM: dts: BCM53573: Add DT for Luxul XAP-1440
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM53573 WiSoC based outdoor access point with an extra BCM43217
+chipset used for 2.4 GHz.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts | 50 +++++++++++++++++++++++++++
+ 2 files changed, 51 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -95,6 +95,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
++	bcm47189-luxul-xap-1440.dtb \
+ 	bcm47189-luxul-xap-810.dtb \
+ 	bcm47189-tenda-ac9.dtb \
+ 	bcm947189acdbmr.dtb
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+@@ -0,0 +1,50 @@
++/*
++ * Copyright 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "luxul,xap-1440-v1", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Luxul XAP-1440 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wlan {
++			label = "bcm53xx:blue:wlan";
++			gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		system {
++			label = "bcm53xx:green:system";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
diff --git a/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch b/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
index 171e6b3..710d94f 100644
--- a/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
+++ b/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
@@ -24,3 +24,47 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  	};
  
  	memory {
+--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+@@ -14,7 +14,7 @@
+ 	model = "Luxul ABR-4500 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+@@ -14,7 +14,7 @@
+ 	model = "Luxul XBR-4500 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+@@ -13,7 +13,7 @@
+ 	model = "Luxul XAP-1440 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+@@ -13,7 +13,7 @@
+ 	model = "Luxul XAP-810 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
diff --git a/target/linux/bcm53xx/patches-4.9/035-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch b/target/linux/bcm53xx/patches-4.9/035-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch
new file mode 100644
index 0000000..1057ffc
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/035-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch
@@ -0,0 +1,135 @@
+From 092ccf0415c720a1e9458a46fe75f77574027a55 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Tue, 18 Jul 2017 12:37:37 -0700
+Subject: [PATCH] ARM: dts: BCM53573: Add Broadcom BCM947189ACDBMR board
+ support
+
+Adds support for the Broadcom reference board BCM947189ACDMBR which
+features the following:
+
+* 128MB of DRAM
+* External MoCA support through a Broadcom BCM6802 chip
+* 1x external Gigabit PHY through the external BCM6802
+* 1x USB 2.0 port
+* 1x PCIE slot
+* Few configurable buttons and LEDs
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile            |  3 +-
+ arch/arm/boot/dts/bcm947189acdbmr.dts | 97 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 99 insertions(+), 1 deletion(-)
+ create mode 100644 arch/arm/boot/dts/bcm947189acdbmr.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -103,7 +103,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
+-	bcm47189-tenda-ac9.dtb
++	bcm47189-tenda-ac9.dtb \
++	bcm947189acdbmr.dtb
+ dtb-$(CONFIG_ARCH_BCM_63XX) += \
+ 	bcm963138dvt.dtb
+ dtb-$(CONFIG_ARCH_BCM_CYGNUS) += \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm947189acdbmr.dts
+@@ -0,0 +1,97 @@
++/*
++ * Copyright (C) 2017 Broadcom
++ * Author: Florian Fainelli <f.fainelli at gmail.com>
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "brcm,bcm947189acdbmr", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Broadcom BCM947189ACDBMR";
++
++	chosen {
++		bootargs = "console=ttyS0,115200 earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wps {
++			label = "bcm53xx:blue:wps";
++			gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
++		};
++
++		5ghz {
++			label = "bcm53xx:blue:5ghz";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>;
++		};
++
++		2ghz {
++			label = "bcm53xx:blue:2ghz";
++			gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>;
++		};
++
++		wps {
++			label = "WPS";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	spi {
++		compatible = "spi-gpio";
++		num-chipselects = <1>;
++		gpio-sck = <&chipcommon 21 0>;
++		gpio-miso = <&chipcommon 22 0>;
++		gpio-mosi = <&chipcommon 23 0>;
++		cs-gpios = <&chipcommon 24 0>;
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		/* External BCM6802 MoCA chip is connected */
++	};
++};
++
++&pcie0 {
++	ranges = <0x00000000 0 0 0 0 0x00100000>;
++	#address-cells = <3>;
++	#size-cells = <2>;
++
++	bridge at 0,0,0 {
++		reg = <0x0000 0 0 0 0>;
++		ranges = <0x00000000 0 0 0 0 0 0 0x00100000>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++
++		wifi at 0,1,0 {
++			reg = <0x0000 0 0 0 0>;
++			ranges = <0x00000000 0 0 0 0x00100000>;
++			#address-cells = <1>;
++			#size-cells = <1>;
++		};
++	};
++};
++
++&usb2 {
++	vcc-gpio = <&chipcommon 8 GPIO_ACTIVE_HIGH>;
++};
diff --git a/target/linux/bcm53xx/patches-4.9/035-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch b/target/linux/bcm53xx/patches-4.9/035-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch
new file mode 100644
index 0000000..75f1d17
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/035-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch
@@ -0,0 +1,58 @@
+From 0173b2cd6948b5b96ac4e8dbc3bcb4dd0b45c296 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Thu, 17 Aug 2017 11:05:14 +0200
+Subject: [PATCH] ARM: BCM53573: Specify ports for USB LED for Tenda AC9
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This uses trigger-sources documented in commit 80dc6e1cd85fc ("dt-bindings:
+leds: document new trigger-sources property") to specify USB ports. Such an
+information can be used by operating system to setup LEDs behavior.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 2 ++
+ arch/arm/boot/dts/bcm53573.dtsi          | 4 ++++
+ 2 files changed, 6 insertions(+)
+
+--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts
++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts
+@@ -26,6 +26,8 @@
+ 		usb {
+ 			label = "bcm53xx:blue:usb";
+ 			gpios = <&chipcommon 1 GPIO_ACTIVE_HIGH>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>;
++			linux,default-trigger = "usbport";
+ 		};
+ 
+ 		wps {
+--- a/arch/arm/boot/dts/bcm53573.dtsi
++++ b/arch/arm/boot/dts/bcm53573.dtsi
+@@ -138,10 +138,12 @@
+ 
+ 				ehci_port1: port at 1 {
+ 					reg = <1>;
++					#trigger-source-cells = <0>;
+ 				};
+ 
+ 				ehci_port2: port at 2 {
+ 					reg = <2>;
++					#trigger-source-cells = <0>;
+ 				};
+ 			};
+ 
+@@ -158,10 +160,12 @@
+ 
+ 				ohci_port1: port at 1 {
+ 					reg = <1>;
++					#trigger-source-cells = <0>;
+ 				};
+ 
+ 				ohci_port2: port at 2 {
+ 					reg = <2>;
++					#trigger-source-cells = <0>;
+ 				};
+ 			};
+ 		};
diff --git a/target/linux/bcm53xx/patches-4.9/035-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch b/target/linux/bcm53xx/patches-4.9/035-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch
new file mode 100644
index 0000000..3148f6c
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/035-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch
@@ -0,0 +1,30 @@
+From 2460266f21f140936e627f28f28d1a4f30887ae9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 6 Oct 2017 10:52:35 +0200
+Subject: [PATCH] ARM: dts: BCM5301X: Specify USB ports for USB LED of Luxul
+ XWR-1200
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This info can be used by operating system to setup LED behavior.
+
+Reported-by: Dan Haab <dhaab at luxul.com>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts
++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts
+@@ -57,7 +57,8 @@
+ 		usb {
+ 			label = "bcm53xx:green:usb";
+ 			gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>;
+-			linux,default-trigger = "none";
++			trigger-sources = <&ohci_port2>, <&ehci_port2>;
++			linux,default-trigger = "usbport";
+ 		};
+ 
+ 		status {
diff --git a/target/linux/bcm53xx/patches-4.9/035-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch b/target/linux/bcm53xx/patches-4.9/035-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch
new file mode 100644
index 0000000..3d88f82
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/035-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch
@@ -0,0 +1,96 @@
+From 1f4b0d5596d2e3ea8e953d578ab8444ce860d35d Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:22 -0600
+Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Luxul XBR-4500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM47094 (AKA BCM4709C0) based router with ports-on-the-front
+board design.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 63 +++++++++++++++++++++++++++
+ 2 files changed, 64 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -95,6 +95,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-tplink-archer-c9-v1.dtb \
+ 	bcm47094-dlink-dir-885l.dtb \
+ 	bcm47094-linksys-panamera.dtb \
++	bcm47094-luxul-xbr-4500.dtb \
+ 	bcm47094-luxul-xwr-3100.dtb \
+ 	bcm47094-netgear-r8500.dtb \
+ 	bcm94708.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (C) 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "luxul,xbr-4500-v1", "brcm,bcm47094", "brcm,bcm4708";
++	model = "Luxul XBR-4500 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000
++		       0x88000000 0x18000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		status {
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 20 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "timer";
++		};
++
++		usb3 {
++			label = "bcm53xx:green:usb3";
++			gpios = <&chipcommon 19 GPIO_ACTIVE_HIGH>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>,
++				<&xhci_port1>;
++			linux,default-trigger = "usbport";
++		};
++
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&usb3 {
++	vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
++};
++
++&spi_nor {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.9/035-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch b/target/linux/bcm53xx/patches-4.9/035-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch
new file mode 100644
index 0000000..71384a7
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/035-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch
@@ -0,0 +1,96 @@
+From 65f78c4c41a9b9a7637e1dda2d5e41cf26ea971c Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:23 -0600
+Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Luxul ABR-4500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM47094 (AKA BCM4709C0) based router with rear-facing ports
+board design.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 63 +++++++++++++++++++++++++++
+ 2 files changed, 64 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -95,6 +95,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-tplink-archer-c9-v1.dtb \
+ 	bcm47094-dlink-dir-885l.dtb \
+ 	bcm47094-linksys-panamera.dtb \
++	bcm47094-luxul-abr-4500.dtb \
+ 	bcm47094-luxul-xbr-4500.dtb \
+ 	bcm47094-luxul-xwr-3100.dtb \
+ 	bcm47094-netgear-r8500.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (C) 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "luxul,abr-4500-v1", "brcm,bcm47094", "brcm,bcm4708";
++	model = "Luxul ABR-4500 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000
++		       0x88000000 0x18000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		status {
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++
++		usb3 {
++			label = "bcm53xx:green:usb3";
++			gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>,
++				<&xhci_port1>;
++			linux,default-trigger = "usbport";
++		};
++
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&usb3 {
++	vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
++};
++
++&spi_nor {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.9/035-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch b/target/linux/bcm53xx/patches-4.9/035-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch
new file mode 100644
index 0000000..c0abc5f
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/035-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch
@@ -0,0 +1,120 @@
+From 0aa052ce1c3340850a7e5980b6d24b3ea5779591 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:59 -0600
+Subject: [PATCH] ARM: dts: BCM53573: Add DT for Luxul XAP-810
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM53573 WiSoC based access point with an extra BCM43217 chipset
+used for 2.4 GHz.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                   |  1 +
+ arch/arm/boot/dts/bcm47189-luxul-xap-810.dts | 87 ++++++++++++++++++++++++++++
+ 2 files changed, 88 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -105,6 +105,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
++	bcm47189-luxul-xap-810.dtb \
+ 	bcm47189-tenda-ac9.dtb \
+ 	bcm947189acdbmr.dtb
+ dtb-$(CONFIG_ARCH_BCM_63XX) += \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+@@ -0,0 +1,87 @@
++/*
++ * Copyright 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "luxul,xap-810-v1", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Luxul XAP-810 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		5ghz {
++			label = "bcm53xx:blue:5ghz";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-off";
++		};
++
++		system {
++			label = "bcm53xx:green:system";
++			gpios = <&chipcommon 15 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "timer";
++		};
++	};
++
++	pcie0_leds {
++		compatible = "gpio-leds";
++
++		2ghz {
++			label = "bcm53xx:blue:2ghz";
++			gpios = <&pcie0_chipcommon 3 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-off";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&pcie0 {
++	ranges = <0x00000000 0 0 0 0 0x00100000>;
++	#address-cells = <3>;
++	#size-cells = <2>;
++
++	bridge at 0,0,0 {
++		reg = <0x0000 0 0 0 0>;
++		ranges = <0x00000000 0 0 0 0 0 0 0x00100000>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++
++		wifi at 0,1,0 {
++			reg = <0x0000 0 0 0 0>;
++			ranges = <0x00000000 0 0 0 0x00100000>;
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			pcie0_chipcommon: chipcommon at 0 {
++				reg = <0 0x1000>;
++
++				gpio-controller;
++				#gpio-cells = <2>;
++			};
++		};
++	};
++};
diff --git a/target/linux/bcm53xx/patches-4.9/035-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch b/target/linux/bcm53xx/patches-4.9/035-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch
new file mode 100644
index 0000000..72bd695
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.9/035-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch
@@ -0,0 +1,83 @@
+From 7030ea600d560026b91726f2eb79c856b813afa9 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:47:00 -0600
+Subject: [PATCH] ARM: dts: BCM53573: Add DT for Luxul XAP-1440
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM53573 WiSoC based outdoor access point with an extra BCM43217
+chipset used for 2.4 GHz.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts | 50 +++++++++++++++++++++++++++
+ 2 files changed, 51 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -105,6 +105,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
++	bcm47189-luxul-xap-1440.dtb \
+ 	bcm47189-luxul-xap-810.dtb \
+ 	bcm47189-tenda-ac9.dtb \
+ 	bcm947189acdbmr.dtb
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+@@ -0,0 +1,50 @@
++/*
++ * Copyright 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "luxul,xap-1440-v1", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Luxul XAP-1440 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wlan {
++			label = "bcm53xx:blue:wlan";
++			gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		system {
++			label = "bcm53xx:green:system";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
diff --git a/target/linux/bcm53xx/patches-4.9/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch b/target/linux/bcm53xx/patches-4.9/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
index 171e6b3..710d94f 100644
--- a/target/linux/bcm53xx/patches-4.9/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
+++ b/target/linux/bcm53xx/patches-4.9/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
@@ -24,3 +24,47 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  	};
  
  	memory {
+--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+@@ -14,7 +14,7 @@
+ 	model = "Luxul ABR-4500 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+@@ -14,7 +14,7 @@
+ 	model = "Luxul XBR-4500 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+@@ -13,7 +13,7 @@
+ 	model = "Luxul XAP-1440 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+@@ -13,7 +13,7 @@
+ 	model = "Luxul XAP-810 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {


From lede-commits at lists.infradead.org  Tue Oct 10 01:48:42 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 10 Oct 2017 04:48:42 -0400
Subject: [source] bcm53xx: backport DTS changes up to the first 4.15 queued
 commits
In-Reply-To: <20171010084842.22708.74171@git-01.infra.lede-project.org>
References: <20171010084842.22708.74171@git-01.infra.lede-project.org>
Message-ID: <mailman.53519.1507625362.26984.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/baa8eaaba66c0195650bf06513c30f5b091a150f

commit baa8eaaba66c0195650bf06513c30f5b091a150f
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Oct 10 09:19:10 2017 +0200

    bcm53xx: backport DTS changes up to the first 4.15 queued commits
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...53573-Add-Broadcom-BCM947189ACDBMR-board-.patch | 135 +++++++++++++++++++++
 ...3-Specify-ports-for-USB-LED-for-Tenda-AC9.patch |  58 +++++++++
 ...5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch |  30 +++++
 ...RM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch |  96 +++++++++++++++
 ...RM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch |  96 +++++++++++++++
 ...ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch | 120 ++++++++++++++++++
 ...RM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch |  83 +++++++++++++
 ...M-dts-BCM5301X-Add-serial-to-the-bootargs.patch |  44 +++++++
 8 files changed, 662 insertions(+)

diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch b/target/linux/bcm53xx/patches-4.4/049-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch
new file mode 100644
index 0000000..69deca1
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.14-0003-ARM-dts-BCM53573-Add-Broadcom-BCM947189ACDBMR-board-.patch
@@ -0,0 +1,135 @@
+From 092ccf0415c720a1e9458a46fe75f77574027a55 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Tue, 18 Jul 2017 12:37:37 -0700
+Subject: [PATCH] ARM: dts: BCM53573: Add Broadcom BCM947189ACDBMR board
+ support
+
+Adds support for the Broadcom reference board BCM947189ACDMBR which
+features the following:
+
+* 128MB of DRAM
+* External MoCA support through a Broadcom BCM6802 chip
+* 1x external Gigabit PHY through the external BCM6802
+* 1x USB 2.0 port
+* 1x PCIE slot
+* Few configurable buttons and LEDs
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile            |  3 +-
+ arch/arm/boot/dts/bcm947189acdbmr.dts | 97 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 99 insertions(+), 1 deletion(-)
+ create mode 100644 arch/arm/boot/dts/bcm947189acdbmr.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -93,7 +93,8 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
+-	bcm47189-tenda-ac9.dtb
++	bcm47189-tenda-ac9.dtb \
++	bcm947189acdbmr.dtb
+ dtb-$(CONFIG_ARCH_BCM_63XX) += \
+ 	bcm963138dvt.dtb
+ dtb-$(CONFIG_ARCH_BCM_CYGNUS) += \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm947189acdbmr.dts
+@@ -0,0 +1,97 @@
++/*
++ * Copyright (C) 2017 Broadcom
++ * Author: Florian Fainelli <f.fainelli at gmail.com>
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "brcm,bcm947189acdbmr", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Broadcom BCM947189ACDBMR";
++
++	chosen {
++		bootargs = "console=ttyS0,115200 earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wps {
++			label = "bcm53xx:blue:wps";
++			gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>;
++		};
++
++		5ghz {
++			label = "bcm53xx:blue:5ghz";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>;
++		};
++
++		2ghz {
++			label = "bcm53xx:blue:2ghz";
++			gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>;
++		};
++
++		wps {
++			label = "WPS";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	spi {
++		compatible = "spi-gpio";
++		num-chipselects = <1>;
++		gpio-sck = <&chipcommon 21 0>;
++		gpio-miso = <&chipcommon 22 0>;
++		gpio-mosi = <&chipcommon 23 0>;
++		cs-gpios = <&chipcommon 24 0>;
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		/* External BCM6802 MoCA chip is connected */
++	};
++};
++
++&pcie0 {
++	ranges = <0x00000000 0 0 0 0 0x00100000>;
++	#address-cells = <3>;
++	#size-cells = <2>;
++
++	bridge at 0,0,0 {
++		reg = <0x0000 0 0 0 0>;
++		ranges = <0x00000000 0 0 0 0 0 0 0x00100000>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++
++		wifi at 0,1,0 {
++			reg = <0x0000 0 0 0 0>;
++			ranges = <0x00000000 0 0 0 0x00100000>;
++			#address-cells = <1>;
++			#size-cells = <1>;
++		};
++	};
++};
++
++&usb2 {
++	vcc-gpio = <&chipcommon 8 GPIO_ACTIVE_HIGH>;
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch b/target/linux/bcm53xx/patches-4.4/049-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch
new file mode 100644
index 0000000..75f1d17
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.14-0004-ARM-BCM53573-Specify-ports-for-USB-LED-for-Tenda-AC9.patch
@@ -0,0 +1,58 @@
+From 0173b2cd6948b5b96ac4e8dbc3bcb4dd0b45c296 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Thu, 17 Aug 2017 11:05:14 +0200
+Subject: [PATCH] ARM: BCM53573: Specify ports for USB LED for Tenda AC9
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This uses trigger-sources documented in commit 80dc6e1cd85fc ("dt-bindings:
+leds: document new trigger-sources property") to specify USB ports. Such an
+information can be used by operating system to setup LEDs behavior.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 2 ++
+ arch/arm/boot/dts/bcm53573.dtsi          | 4 ++++
+ 2 files changed, 6 insertions(+)
+
+--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts
++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts
+@@ -26,6 +26,8 @@
+ 		usb {
+ 			label = "bcm53xx:blue:usb";
+ 			gpios = <&chipcommon 1 GPIO_ACTIVE_HIGH>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>;
++			linux,default-trigger = "usbport";
+ 		};
+ 
+ 		wps {
+--- a/arch/arm/boot/dts/bcm53573.dtsi
++++ b/arch/arm/boot/dts/bcm53573.dtsi
+@@ -138,10 +138,12 @@
+ 
+ 				ehci_port1: port at 1 {
+ 					reg = <1>;
++					#trigger-source-cells = <0>;
+ 				};
+ 
+ 				ehci_port2: port at 2 {
+ 					reg = <2>;
++					#trigger-source-cells = <0>;
+ 				};
+ 			};
+ 
+@@ -158,10 +160,12 @@
+ 
+ 				ohci_port1: port at 1 {
+ 					reg = <1>;
++					#trigger-source-cells = <0>;
+ 				};
+ 
+ 				ohci_port2: port at 2 {
+ 					reg = <2>;
++					#trigger-source-cells = <0>;
+ 				};
+ 			};
+ 		};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch
new file mode 100644
index 0000000..3148f6c
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch
@@ -0,0 +1,30 @@
+From 2460266f21f140936e627f28f28d1a4f30887ae9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 6 Oct 2017 10:52:35 +0200
+Subject: [PATCH] ARM: dts: BCM5301X: Specify USB ports for USB LED of Luxul
+ XWR-1200
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This info can be used by operating system to setup LED behavior.
+
+Reported-by: Dan Haab <dhaab at luxul.com>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts
++++ b/arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts
+@@ -57,7 +57,8 @@
+ 		usb {
+ 			label = "bcm53xx:green:usb";
+ 			gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>;
+-			linux,default-trigger = "none";
++			trigger-sources = <&ohci_port2>, <&ehci_port2>;
++			linux,default-trigger = "usbport";
+ 		};
+ 
+ 		status {
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch
new file mode 100644
index 0000000..fbe8f54
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch
@@ -0,0 +1,96 @@
+From 1f4b0d5596d2e3ea8e953d578ab8444ce860d35d Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:22 -0600
+Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Luxul XBR-4500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM47094 (AKA BCM4709C0) based router with ports-on-the-front
+board design.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts | 63 +++++++++++++++++++++++++++
+ 2 files changed, 64 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -85,6 +85,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-tplink-archer-c9-v1.dtb \
+ 	bcm47094-dlink-dir-885l.dtb \
+ 	bcm47094-linksys-panamera.dtb \
++	bcm47094-luxul-xbr-4500.dtb \
+ 	bcm47094-luxul-xwr-3100.dtb \
+ 	bcm47094-netgear-r8500.dtb \
+ 	bcm94708.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (C) 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "luxul,xbr-4500-v1", "brcm,bcm47094", "brcm,bcm4708";
++	model = "Luxul XBR-4500 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000
++		       0x88000000 0x18000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		status {
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 20 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "timer";
++		};
++
++		usb3 {
++			label = "bcm53xx:green:usb3";
++			gpios = <&chipcommon 19 GPIO_ACTIVE_HIGH>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>,
++				<&xhci_port1>;
++			linux,default-trigger = "usbport";
++		};
++
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&usb3 {
++	vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
++};
++
++&spi_nor {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch
new file mode 100644
index 0000000..b5ba1dd
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch
@@ -0,0 +1,96 @@
+From 65f78c4c41a9b9a7637e1dda2d5e41cf26ea971c Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:23 -0600
+Subject: [PATCH] ARM: dts: BCM5301X: Add DT for Luxul ABR-4500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM47094 (AKA BCM4709C0) based router with rear-facing ports
+board design.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts | 63 +++++++++++++++++++++++++++
+ 2 files changed, 64 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -85,6 +85,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm4709-tplink-archer-c9-v1.dtb \
+ 	bcm47094-dlink-dir-885l.dtb \
+ 	bcm47094-linksys-panamera.dtb \
++	bcm47094-luxul-abr-4500.dtb \
+ 	bcm47094-luxul-xbr-4500.dtb \
+ 	bcm47094-luxul-xwr-3100.dtb \
+ 	bcm47094-netgear-r8500.dtb \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+@@ -0,0 +1,63 @@
++/*
++ * Copyright (C) 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm4708.dtsi"
++#include "bcm5301x-nand-cs0-bch8.dtsi"
++
++/ {
++	compatible = "luxul,abr-4500-v1", "brcm,bcm47094", "brcm,bcm4708";
++	model = "Luxul ABR-4500 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000
++		       0x88000000 0x18000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		status {
++			label = "bcm53xx:green:status";
++			gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++
++		usb3 {
++			label = "bcm53xx:green:usb3";
++			gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
++			trigger-sources = <&ohci_port1>, <&ehci_port1>,
++				<&xhci_port1>;
++			linux,default-trigger = "usbport";
++		};
++
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&usb3 {
++	vcc-gpio = <&chipcommon 18 GPIO_ACTIVE_HIGH>;
++};
++
++&spi_nor {
++	status = "okay";
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch
new file mode 100644
index 0000000..407537f
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch
@@ -0,0 +1,120 @@
+From 0aa052ce1c3340850a7e5980b6d24b3ea5779591 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:46:59 -0600
+Subject: [PATCH] ARM: dts: BCM53573: Add DT for Luxul XAP-810
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM53573 WiSoC based access point with an extra BCM43217 chipset
+used for 2.4 GHz.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                   |  1 +
+ arch/arm/boot/dts/bcm47189-luxul-xap-810.dts | 87 ++++++++++++++++++++++++++++
+ 2 files changed, 88 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -95,6 +95,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
++	bcm47189-luxul-xap-810.dtb \
+ 	bcm47189-tenda-ac9.dtb \
+ 	bcm947189acdbmr.dtb
+ dtb-$(CONFIG_ARCH_BCM_63XX) += \
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+@@ -0,0 +1,87 @@
++/*
++ * Copyright 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "luxul,xap-810-v1", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Luxul XAP-810 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		5ghz {
++			label = "bcm53xx:blue:5ghz";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-off";
++		};
++
++		system {
++			label = "bcm53xx:green:system";
++			gpios = <&chipcommon 15 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "timer";
++		};
++	};
++
++	pcie0_leds {
++		compatible = "gpio-leds";
++
++		2ghz {
++			label = "bcm53xx:blue:2ghz";
++			gpios = <&pcie0_chipcommon 3 GPIO_ACTIVE_HIGH>;
++			linux,default-trigger = "default-off";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&pcie0 {
++	ranges = <0x00000000 0 0 0 0 0x00100000>;
++	#address-cells = <3>;
++	#size-cells = <2>;
++
++	bridge at 0,0,0 {
++		reg = <0x0000 0 0 0 0>;
++		ranges = <0x00000000 0 0 0 0 0 0 0x00100000>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++
++		wifi at 0,1,0 {
++			reg = <0x0000 0 0 0 0>;
++			ranges = <0x00000000 0 0 0 0x00100000>;
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			pcie0_chipcommon: chipcommon at 0 {
++				reg = <0 0x1000>;
++
++				gpio-controller;
++				#gpio-cells = <2>;
++			};
++		};
++	};
++};
diff --git a/target/linux/bcm53xx/patches-4.4/049-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch b/target/linux/bcm53xx/patches-4.4/049-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch
new file mode 100644
index 0000000..51b3dc7
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/049-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch
@@ -0,0 +1,83 @@
+From 7030ea600d560026b91726f2eb79c856b813afa9 Mon Sep 17 00:00:00 2001
+From: Dan Haab <dhaab at luxul.com>
+Date: Mon, 9 Oct 2017 09:47:00 -0600
+Subject: [PATCH] ARM: dts: BCM53573: Add DT for Luxul XAP-1440
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is BCM53573 WiSoC based outdoor access point with an extra BCM43217
+chipset used for 2.4 GHz.
+
+Signed-off-by: Dan Haab <dhaab at luxul.com>
+Acked-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ arch/arm/boot/dts/Makefile                    |  1 +
+ arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts | 50 +++++++++++++++++++++++++++
+ 2 files changed, 51 insertions(+)
+ create mode 100644 arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -95,6 +95,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
+ 	bcm953012hr.dtb \
+ 	bcm953012k.dtb
+ dtb-$(CONFIG_ARCH_BCM_53573) += \
++	bcm47189-luxul-xap-1440.dtb \
+ 	bcm47189-luxul-xap-810.dtb \
+ 	bcm47189-tenda-ac9.dtb \
+ 	bcm947189acdbmr.dtb
+--- /dev/null
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+@@ -0,0 +1,50 @@
++/*
++ * Copyright 2017 Luxul Inc.
++ *
++ * Licensed under the ISC license.
++ */
++
++/dts-v1/;
++
++#include "bcm53573.dtsi"
++
++/ {
++	compatible = "luxul,xap-1440-v1", "brcm,bcm47189", "brcm,bcm53573";
++	model = "Luxul XAP-1440 V1";
++
++	chosen {
++		bootargs = "earlycon";
++	};
++
++	memory {
++		reg = <0x00000000 0x08000000>;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		wlan {
++			label = "bcm53xx:blue:wlan";
++			gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "default-off";
++		};
++
++		system {
++			label = "bcm53xx:green:system";
++			gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
++			linux,default-trigger = "timer";
++		};
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		restart {
++			label = "Reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
diff --git a/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch b/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
index 171e6b3..710d94f 100644
--- a/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
+++ b/target/linux/bcm53xx/patches-4.4/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch
@@ -24,3 +24,47 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  	};
  
  	memory {
+--- a/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
++++ b/arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
+@@ -14,7 +14,7 @@
+ 	model = "Luxul ABR-4500 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
++++ b/arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
+@@ -14,7 +14,7 @@
+ 	model = "Luxul XBR-4500 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
+@@ -13,7 +13,7 @@
+ 	model = "Luxul XAP-1440 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {
+--- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
+@@ -13,7 +13,7 @@
+ 	model = "Luxul XAP-810 V1";
+ 
+ 	chosen {
+-		bootargs = "earlycon";
++		bootargs = "console=ttyS0,115200 earlycon";
+ 	};
+ 
+ 	memory {


From lede-commits at lists.infradead.org  Wed Oct 11 12:55:09 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 11 Oct 2017 15:55:09 -0400
Subject: [source]  brcm47xx: relocate loader to higher address
In-Reply-To: <20171011195509.16837.47831@git-01.infra.lede-project.org>
References: <20171011195509.16837.47831@git-01.infra.lede-project.org>
Message-ID: <mailman.53814.1507751863.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/d5cf4a5aa4a3211012967748569d9a631ee19466

commit d5cf4a5aa4a3211012967748569d9a631ee19466
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 8 16:52:28 2017 +0200

    brcm47xx: relocate loader to higher address
    
    The boot process on a WRT54GL works the following way:
    1. CFE gets loaded by the boot rom from flash
    2. CFE loads the loader from the flash and gzip uncompresses it
    3. CFE starts the loader
    4. The loader stores the FW arguments and relocates itself to
       BZ_TEXT_START (now 0x80600000)
    5. The loader reads the Linux image from flash
    6. The loader lzma decompresses the Linux image to LOADADDR (0x80001000)
    7. The loader executes the uncompress Linux image at LOADADDR
    
    The BZ_TEXT_START was set to 0x80400000 before. When the kernel gets
    uncompressed and is bigger than BZ_TEXT_START - LOADADDR it overwrote
    the loader which was currently uncompressing it and made the board
    crash. Increase the BZ_TEXT_START my 2 MB to have more space for the
    kernel. Even on 16MB RAM devices the memory goes till 0x80FFFFFF so this
    should not be a problem.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/brcm47xx/image/lzma-loader/src/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/brcm47xx/image/lzma-loader/src/Makefile b/target/linux/brcm47xx/image/lzma-loader/src/Makefile
index 3320e56..444039c 100644
--- a/target/linux/brcm47xx/image/lzma-loader/src/Makefile
+++ b/target/linux/brcm47xx/image/lzma-loader/src/Makefile
@@ -18,7 +18,7 @@
 #
 
 TEXT_START	:= 0x80001000
-BZ_TEXT_START	:= 0x80400000
+BZ_TEXT_START	:= 0x80600000
 
 OBJCOPY		:= $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S
 


From lede-commits at lists.infradead.org  Wed Oct 11 12:55:10 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 11 Oct 2017 15:55:10 -0400
Subject: [source]  brcm47xx: relocate the stack in loader
In-Reply-To: <20171011195509.16837.47831@git-01.infra.lede-project.org>
References: <20171011195509.16837.47831@git-01.infra.lede-project.org>
Message-ID: <mailman.53815.1507751863.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/2909a4b78e2bce5f6b9c35361866d5e9477a1bdc

commit 2909a4b78e2bce5f6b9c35361866d5e9477a1bdc
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 8 18:31:03 2017 +0200

    brcm47xx: relocate the stack in loader
    
    By default we are reusing the stack provided by CFE, like it is intended
    by CFE. On my WRT54GS it is located at 0x8043BF30, so a big kernel image
    could overwrite it. Relocate it to a different memory region which is
    still under the 8MB RAM, but in the higher area. We only need this
    memory region for the stack of the loader, Linux will set up this
    for its own.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/brcm47xx/image/lzma-loader/src/Makefile | 5 +++--
 target/linux/brcm47xx/image/lzma-loader/src/head.S   | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/brcm47xx/image/lzma-loader/src/Makefile b/target/linux/brcm47xx/image/lzma-loader/src/Makefile
index 444039c..a08fc05 100644
--- a/target/linux/brcm47xx/image/lzma-loader/src/Makefile
+++ b/target/linux/brcm47xx/image/lzma-loader/src/Makefile
@@ -19,6 +19,7 @@
 
 TEXT_START	:= 0x80001000
 BZ_TEXT_START	:= 0x80600000
+BZ_STACK_START	:= 0x80700000
 
 OBJCOPY		:= $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S
 
@@ -28,9 +29,9 @@ CFLAGS		= -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
 		  -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap
 CFLAGS		+= -DLOADADDR=$(TEXT_START) -D_LZMA_IN_CB
 
-ASFLAGS		= $(CFLAGS) -D__ASSEMBLY__ -DBZ_TEXT_START=$(BZ_TEXT_START)
+ASFLAGS		= $(CFLAGS) -D__ASSEMBLY__ -DBZ_TEXT_START=$(BZ_TEXT_START) -DBZ_STACK_START=$(BZ_STACK_START)
 
-SEDFLAGS	:= s/BZ_TEXT_START/$(BZ_TEXT_START)/;s/TEXT_START/$(TEXT_START)/
+SEDFLAGS	:= s/BZ_TEXT_START/$(BZ_TEXT_START)/;s/BZ_STACK_START/$(BZ_STACK_START)/;s/TEXT_START/$(TEXT_START)/
 
 OBJECTS		:= head.o data.o
 
diff --git a/target/linux/brcm47xx/image/lzma-loader/src/head.S b/target/linux/brcm47xx/image/lzma-loader/src/head.S
index 930c9ba..50c159c 100644
--- a/target/linux/brcm47xx/image/lzma-loader/src/head.S
+++ b/target/linux/brcm47xx/image/lzma-loader/src/head.S
@@ -38,6 +38,7 @@
 	.text
 	LEAF(startup)
 	.set noreorder
+	li	sp, BZ_STACK_START
 	addi    sp, -48
 	sw      a0, 16(sp)
 	sw      a1, 20(sp)


From lede-commits at lists.infradead.org  Thu Oct 12 14:41:48 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 12 Oct 2017 17:41:48 -0400
Subject: [source] layerscape: only support 64-bit for ls1088ardb/ls2088ardb
In-Reply-To: <20171012214147.20681.80414@git-01.infra.lede-project.org>
References: <20171012214147.20681.80414@git-01.infra.lede-project.org>
Message-ID: <mailman.54029.1507844540.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/67c0c5978d5419c6dc5908c912ade316134c4f34

commit 67c0c5978d5419c6dc5908c912ade316134c4f34
Author: Yangbo Lu <yangbo.lu at nxp.com>
AuthorDate: Tue Oct 10 19:17:37 2017 +0800

    layerscape: only support 64-bit for ls1088ardb/ls2088ardb
    
    This is no requirement and plan to support 32-bit for ls1088ardb
    and ls2088ardb. Current 32-bit firmware for them couldn't work,
    so only keep 64-bit support for these two boards in menuconfig.
    
    Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
---
 target/linux/layerscape/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile
index 92206a3..5577b16 100644
--- a/target/linux/layerscape/image/Makefile
+++ b/target/linux/layerscape/image/Makefile
@@ -87,6 +87,7 @@ define Device/ls1012ardb
 endef
 TARGET_DEVICES += ls1012ardb
 
+ifeq ($(SUBTARGET),armv8_64b)
 define Device/ls1088ardb
   DEVICE_TITLE := ls1088ardb-$(SUBTARGET)
   DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb mc-binary-ls1088ardb
@@ -106,5 +107,6 @@ define Device/ls2088ardb
 			append-rootfs | pad-rootfs | check-size 51380225
 endef
 TARGET_DEVICES += ls2088ardb
+endif
 
 $(eval $(call BuildImage))


From lede-commits at lists.infradead.org  Thu Oct 12 14:41:47 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 12 Oct 2017 17:41:47 -0400
Subject: [source]  layerscape: fix compile issue for usb ehci-fsl driver
In-Reply-To: <20171012214147.20681.80414@git-01.infra.lede-project.org>
References: <20171012214147.20681.80414@git-01.infra.lede-project.org>
Message-ID: <mailman.54030.1507844540.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/4f3ddcb0e9db60630daba0671f84a08d78198b81

commit 4f3ddcb0e9db60630daba0671f84a08d78198b81
Author: Yangbo Lu <yangbo.lu at nxp.com>
AuthorDate: Tue Oct 10 16:25:22 2017 +0800

    layerscape: fix compile issue for usb ehci-fsl driver
    
    When build firmware for layerscape target with CONFIG_ALL_NONSHARED=y,
    there would be a compile issue of usb ehci-fsl driver. Actually this
    driver was for PPC platforms initially and was not ready for non-PPC
    now, but a kernel kconfig patch removed PPC dependency for it. So that
    kernel patch should be reverted.
    
    Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
---
 ...kconfig-remove-dependency-FSL_SOC-for-ehc.patch | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/target/linux/layerscape/patches-4.9/819-Revert-usb-kconfig-remove-dependency-FSL_SOC-for-ehc.patch b/target/linux/layerscape/patches-4.9/819-Revert-usb-kconfig-remove-dependency-FSL_SOC-for-ehc.patch
new file mode 100644
index 0000000..c2081b2
--- /dev/null
+++ b/target/linux/layerscape/patches-4.9/819-Revert-usb-kconfig-remove-dependency-FSL_SOC-for-ehc.patch
@@ -0,0 +1,28 @@
+From ba4f9dd74ccb9da91195b3570310754716064ef2 Mon Sep 17 00:00:00 2001
+From: Yangbo Lu <yangbo.lu at nxp.com>
+Date: Tue, 10 Oct 2017 15:55:31 +0800
+Subject: [PATCH] Revert "usb: kconfig: remove dependency FSL_SOC for ehci fsl
+ driver"
+
+This reverts commit 92042e8b3622a9bbfce0ebfc90edf6cd14d45708 on
+LSDK linux (https://github.com/qoriq-open-source/linux).
+
+The patch reverted allowed to build ehci-fsl driver for non-PPC
+platforms, but actually the driver was not ready.
+
+Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
+---
+ drivers/usb/host/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/host/Kconfig
++++ b/drivers/usb/host/Kconfig
+@@ -165,7 +165,7 @@ config XPS_USB_HCD_XILINX
+ 
+ config USB_EHCI_FSL
+ 	tristate "Support for Freescale PPC on-chip EHCI USB controller"
+-	depends on USB_EHCI_HCD
++	depends on FSL_SOC
+ 	select USB_EHCI_ROOT_HUB_TT
+ 	---help---
+ 	  Variation of ARC USB block used in some Freescale chips.


From lede-commits at lists.infradead.org  Thu Oct 12 14:41:49 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 12 Oct 2017 17:41:49 -0400
Subject: [source] ath10k-ct firmware: Tx-hang and EAPOL handling fixes for
 wave-2 firmware.
In-Reply-To: <20171012214147.20681.80414@git-01.infra.lede-project.org>
References: <20171012214147.20681.80414@git-01.infra.lede-project.org>
Message-ID: <mailman.54031.1507844543.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/d8c559d6146db7e53fbabfc20bff9b959d20507e

commit d8c559d6146db7e53fbabfc20bff9b959d20507e
Author: Ben Greear <greearb at candelatech.com>
AuthorDate: Mon Oct 2 12:57:59 2017 -0700

    ath10k-ct firmware: Tx-hang and EAPOL handling fixes for wave-2 firmware.
    
    Changes since last LEDE release include:
    
      *  Fix key-setting bug that broke sending the EAPOL 2/4 in some cases.  This was a
         bug I introduced some time back while trying to fix .11r and simplify the key
         handling logic.  (Patch to wpa_supplicant fixed the race with sending the 4/4
         and setting the key...un-patched supplicant will still have this race and the 4-way
         auth will not work as reliably.)
    
      *  Increase amount of active-tids that can be scheduled.  This fixes a tx-stall
         seen with many station vdevs.
    
      *  Fix bug in upstream code that would cause the maximum peer to never be scheduled
         for tx.
    
    Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/firmware/ath10k-firmware/Makefile | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index 1a23f9f..b8e1265 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -57,38 +57,38 @@ define Download/ct-firmware
   URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
 endef
 
-QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19-rc5-lede
+QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-19.bin.lede
 define Download/ath10k-firmware-qca988x-ct
   $(call Download/ct-firmware,QCA988X,)
-  HASH:=556d6a4df50cd94a229a240d6d1d108ed5910069902f1e0cbb57b02ede27690f
+  HASH:=bff98f028062dae9fc638c7596aec3c79bf9eddaff65cfacba067f6d72f217cd
 endef
 $(eval $(call Download,ath10k-firmware-qca988x-ct))
 
-QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community.bin-19-rc5-lede
+QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-19.bin.lede
 define Download/ath10k-firmware-qca9887-ct
   $(call Download/ct-firmware,QCA9887,ath10k-9887)
-  HASH:=725982694156e0b891dcd1b1b18ba5318fbbe173f4ec9603ff7acbd08f7c4050
+  HASH:=95dc106f98672bd9c7d3fe6881ed79ab079cb49b0a995650991b1beaff2b0101
 endef
 $(eval $(call Download,ath10k-firmware-qca9887-ct))
 
-QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.002
+QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
 define Download/ath10k-firmware-qca99x0-ct
   $(call Download/ct-firmware,QCA99X0,ath10k-10-4)
-  HASH:=e3c77077b47d55219f90816a51bf046f5b40c32be5e96bf629b083d873a879ad
+  HASH:=993c29fd64bb2a59b86d34f58601a1a48b83b541750bc511f78cc17152829b4d
 endef
 $(eval $(call Download,ath10k-firmware-qca99x0-ct))
 
-QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.002
+QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
 define Download/ath10k-firmware-qca9984-ct
   $(call Download/ct-firmware,QCA9984,ath10k-9984-10-4)
-  HASH:=610f7747db6b101f4fc21431b776ac640b5977357e5be9aece2349447b9b1d85
+  HASH:=d997eed9a8bc6809c01d367759ba8545c10e3be93ea1f33d6d753127ef0f7c5e
 endef
 $(eval $(call Download,ath10k-firmware-qca9984-ct))
 
-QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.002
+QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-9.bin-lede.004
 define Download/ath10k-firmware-qca9888-ct
   $(call Download/ct-firmware,QCA9888,ath10k-9888-10-4)
-  HASH:=f92e7d7968698af7c6f2d76b31b3645589e03839e15838010ce457c635e5aae6
+  HASH:=bbaa71bc7dcaa264c5875e86639f174908fed09fbace975e325959d42f3754ff
 endef
 $(eval $(call Download,ath10k-firmware-qca9888-ct))
 


From lede-commits at lists.infradead.org  Thu Oct 12 14:41:50 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 12 Oct 2017 17:41:50 -0400
Subject: [source]  ath10k-ct driver: use dma_alloc_coherent, 4.13 based driver
In-Reply-To: <20171012214147.20681.80414@git-01.infra.lede-project.org>
References: <20171012214147.20681.80414@git-01.infra.lede-project.org>
Message-ID: <mailman.54032.1507844543.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/3888e77c1c686d8135be2aaa3a820ac96e4c8111

commit 3888e77c1c686d8135be2aaa3a820ac96e4c8111
Author: Ben Greear <greearb at candelatech.com>
AuthorDate: Tue Oct 3 15:45:37 2017 -0700

    ath10k-ct driver: use dma_alloc_coherent, 4.13 based driver
    
    This should help ath10k work on systems with little or no IOMMU
    memory.  apu2 can boot two 9888 NICs now, for instance.  From
    upstream patch by Adrian Chadd.
    
    And, start building the 4.13 based CT ath10k driver.
    
    Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 package/kernel/ath10k-ct/Makefile | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index 85fe4eb..a894773 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -8,13 +8,18 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2017-05-16
-PKG_SOURCE_VERSION:=c048ef0c3eedf99b41bc12b3f4e47ef3d9fab484
-PKG_MIRROR_HASH:=7936293962a10a0da7469759623013fc151019a6a584cfc6416bc0b605bd74d7
+PKG_SOURCE_DATE:=2017-06-13
+PKG_SOURCE_VERSION:=bded1823912549017d819d1796273b3134c3de20
+PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
 
 PKG_MAINTAINER:=Ben Greear <greearb at candelatech.com>
 PKG_BUILD_PARALLEL:=1
 
+# Build the 4.13 ath10k-ct driver version.  Other options are "-4.9", or
+# leave un-defined for 4.7 kernel.  Probably this should match as closely as
+# possible to whatever mac80211 backports version is being used.
+CT_KVER="-4.13"
+
 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
 
 include $(INCLUDE_DIR)/kernel.mk
@@ -25,8 +30,8 @@ define KernelPackage/ath10k-ct
   TITLE:=ath10k-ct driver optimized for CT ath10k firmware
   DEPENDS:=+kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT @PCI_SUPPORT + at KERNEL_RELAY +kmod-hwmon-core
   FILES:=\
-	$(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
-	$(PKG_BUILD_DIR)/ath10k/ath10k_core.ko
+	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
+	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
   AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
 endef
 
@@ -75,7 +80,7 @@ define Build/Compile
 	+$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
 		ARCH="$(LINUX_KARCH)" \
 		CROSS_COMPILE="$(TARGET_CROSS)" \
-		SUBDIRS="$(PKG_BUILD_DIR)/ath10k" \
+		SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
 		NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
 		modules
 endef


From lede-commits at lists.infradead.org  Thu Oct 12 14:41:51 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 12 Oct 2017 17:41:51 -0400
Subject: [source]  ath10k-ct: activate user space firmware loading again
In-Reply-To: <20171012214147.20681.80414@git-01.infra.lede-project.org>
References: <20171012214147.20681.80414@git-01.infra.lede-project.org>
Message-ID: <mailman.54033.1507844548.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/efbd4e721d0bc6aa99614ef9d893f9cfe2264907

commit efbd4e721d0bc6aa99614ef9d893f9cfe2264907
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Oct 12 22:44:06 2017 +0200

    ath10k-ct: activate user space firmware loading again
    
    This backports a patch from kernel 4.14 to the ath10k-ct version based
    on kernel 4.13.
    Some devices are using a user space script to load the calibration data
    from the flash and this was not trigged any more.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../ath10k-ct/patches/100-kernel_compat.patch      | 12 ++++----
 package/kernel/ath10k-ct/patches/110-api_fix.patch |  2 +-
 .../ath10k-ct/patches/120-mac80211-4-14-api.patch  |  6 ++--
 ...ctivate-user-space-firmware-loading-again.patch | 36 ++++++++++++++++++++++
 4 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/package/kernel/ath10k-ct/patches/100-kernel_compat.patch b/package/kernel/ath10k-ct/patches/100-kernel_compat.patch
index 58d6b54..beb0abf 100644
--- a/package/kernel/ath10k-ct/patches/100-kernel_compat.patch
+++ b/package/kernel/ath10k-ct/patches/100-kernel_compat.patch
@@ -17,7 +17,7 @@
  
  	firmware = ar->normal_mode_fw.fw_file.firmware;
  	if (firmware)
-@@ -3413,7 +3413,7 @@ int ath10k_debug_register(struct ath10k
+@@ -3422,7 +3422,7 @@ int ath10k_debug_register(struct ath10k
  	debugfs_create_file("nf_cal_period", S_IRUSR | S_IWUSR,
  			    ar->debug.debugfs_phy, ar, &fops_nf_cal_period);
  
@@ -28,7 +28,7 @@
  				    &fops_simulate_radar);
 --- a/ath10k/mac.c
 +++ b/ath10k/mac.c
-@@ -3596,7 +3596,7 @@ static void ath10k_regd_update(struct at
+@@ -3604,7 +3604,7 @@ static void ath10k_regd_update(struct at
  
  	regpair = ar->ath_common.regulatory.regpair;
  
@@ -37,7 +37,7 @@
  		nl_dfs_reg = ar->dfs_detector->region;
  		wmi_dfs_reg = ath10k_mac_get_dfs_region(nl_dfs_reg);
  		ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
-@@ -3630,7 +3630,7 @@ static void ath10k_reg_notifier(struct w
+@@ -3638,7 +3638,7 @@ static void ath10k_reg_notifier(struct w
  
  	ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory);
  
@@ -46,7 +46,7 @@
  		ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "reg-notifier: dfs region 0x%x\n",
  			   request->dfs_region);
  		result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector,
-@@ -8925,7 +8925,7 @@ int ath10k_mac_register(struct ath10k *a
+@@ -8938,7 +8938,7 @@ int ath10k_mac_register(struct ath10k *a
  	if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
  		ar->hw->netdev_features = NETIF_F_HW_CSUM;
  
@@ -55,7 +55,7 @@
  		/* Init ath dfs pattern detector */
  		ar->ath_common.debug_mask = ATH_DBG_DFS;
  		ar->dfs_detector = dfs_pattern_detector_init(&ar->ath_common,
-@@ -8970,7 +8970,7 @@ err_unregister:
+@@ -8983,7 +8983,7 @@ err_unregister:
  	ieee80211_unregister_hw(ar->hw);
  
  err_dfs_detector_exit:
@@ -64,7 +64,7 @@
  		ar->dfs_detector->exit(ar->dfs_detector);
  
  err_free:
-@@ -8985,7 +8985,7 @@ void ath10k_mac_unregister(struct ath10k
+@@ -8998,7 +8998,7 @@ void ath10k_mac_unregister(struct ath10k
  {
  	ieee80211_unregister_hw(ar->hw);
  
diff --git a/package/kernel/ath10k-ct/patches/110-api_fix.patch b/package/kernel/ath10k-ct/patches/110-api_fix.patch
index 5f7de4a..9439dd7 100644
--- a/package/kernel/ath10k-ct/patches/110-api_fix.patch
+++ b/package/kernel/ath10k-ct/patches/110-api_fix.patch
@@ -1,6 +1,6 @@
 --- a/ath10k/htt_rx.c
 +++ b/ath10k/htt_rx.c
-@@ -2497,7 +2497,7 @@ bool ath10k_htt_t2h_msg_handler(struct a
+@@ -2514,7 +2514,7 @@ bool ath10k_htt_t2h_msg_handler(struct a
  		u32 freq = __le32_to_cpu(resp->chan_change.freq);
  
  		ar->tgt_oper_chan =
diff --git a/package/kernel/ath10k-ct/patches/120-mac80211-4-14-api.patch b/package/kernel/ath10k-ct/patches/120-mac80211-4-14-api.patch
index 032a0bc..d587632 100644
--- a/package/kernel/ath10k-ct/patches/120-mac80211-4-14-api.patch
+++ b/package/kernel/ath10k-ct/patches/120-mac80211-4-14-api.patch
@@ -51,7 +51,7 @@
  		break;
  	default:
  		break;
-@@ -883,13 +883,10 @@ static void ath10k_htt_rx_h_ppdu(struct
+@@ -900,13 +900,10 @@ static void ath10k_htt_rx_h_ppdu(struct
  		/* New PPDU starts so clear out the old per-PPDU status. */
  		status->freq = 0;
  		status->rate_idx = 0;
@@ -69,7 +69,7 @@
  		status->flag |= RX_FLAG_NO_SIGNAL_VAL;
  
  		ath10k_htt_rx_h_signal(ar, status, rxd);
-@@ -942,7 +939,7 @@ static void ath10k_process_rx(struct ath
+@@ -959,7 +956,7 @@ static void ath10k_process_rx(struct ath
  	*status = *rx_status;
  
  	ath10k_dbg(ar, ATH10K_DBG_DATA,
@@ -78,7 +78,7 @@
  		   skb,
  		   skb->len,
  		   ieee80211_get_SA(hdr),
-@@ -950,15 +947,15 @@ static void ath10k_process_rx(struct ath
+@@ -967,15 +964,15 @@ static void ath10k_process_rx(struct ath
  		   is_multicast_ether_addr(ieee80211_get_DA(hdr)) ?
  							"mcast" : "ucast",
  		   (__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4,
diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch b/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
new file mode 100644
index 0000000..dc02a9d
--- /dev/null
+++ b/package/kernel/ath10k-ct/patches/130-ath10k-activate-user-space-firmware-loading-again.patch
@@ -0,0 +1,36 @@
+From c0cc00f250e19c717fc9cdbdb7f55aaa569c7498 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Thu, 24 Aug 2017 23:06:41 +0200
+Subject: [PATCH] ath10k: activate user space firmware loading again
+
+In commit 9f5bcfe93315 ("ath10k: silence firmware file probing
+warnings") the firmware loading was changed from request_firmware() to
+request_firmware_direct() to silence some warnings in case it fails.
+request_firmware_direct() directly searches in the file system only and
+does not send a hotplug event to user space in case it could not find
+the firmware directly.
+In LEDE we use a user space script to extract the calibration data from
+the flash memory which gets triggered by the hotplug event. This way the
+firmware gets extracted from some vendor specific partition when the
+driver requests this firmware. This mechanism does not work any more
+after this change.
+
+Fixes: 9f5bcfe93315 ("ath10k: silence firmware file probing warnings")
+Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
+Cc: Michal Kazior <michal.kazior at tieto.com>
+Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
+---
+ ath10k-4.13/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/ath10k-4.13/core.c
++++ b/ath10k-4.13/core.c
+@@ -556,7 +556,7 @@ static const struct firmware *ath10k_fet
+ 		dir = ".";
+ 
+ 	snprintf(filename, sizeof(filename), "%s/%s", dir, file);
+-	ret = request_firmware_direct(&fw, filename, ar->dev);
++	ret = request_firmware(&fw, filename, ar->dev);
+ 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n",
+ 		   filename, ret);
+ 


From lede-commits at lists.infradead.org  Fri Oct 13 02:57:09 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 05:57:09 -0400
Subject: [source]  mt76: sync with version 878456caf60d from master
In-Reply-To: <20171013095709.20471.27361@git-01.infra.lede-project.org>
References: <20171013095709.20471.27361@git-01.infra.lede-project.org>
Message-ID: <mailman.54128.1507888789.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/c1023c8075b0590390020d65fd077b908cefad63

commit c1023c8075b0590390020d65fd077b908cefad63
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Oct 12 11:49:00 2017 +0200

    mt76: sync with version 878456caf60d from master
    
    Backport required DT changes from commit dabdd123c90c.
    Significantly improves stability and performance for MT76x2 and MT7603
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mt76/Makefile             |  8 ++++----
 target/linux/ramips/dts/ArcherC20i.dts   |  1 -
 target/linux/ramips/dts/ArcherC50.dts    |  2 +-
 target/linux/ramips/dts/ArcherMR200.dts  |  1 -
 target/linux/ramips/dts/DIR-860L-B1.dts  |  4 ++--
 target/linux/ramips/dts/FIREWRT.dts      |  4 ++--
 target/linux/ramips/dts/GL-MT750.dts     |  1 -
 target/linux/ramips/dts/MAC1200RV2.dts   |  2 +-
 target/linux/ramips/dts/MIWIFI-MINI.dts  |  2 +-
 target/linux/ramips/dts/MZK-750DHP.dts   |  1 -
 target/linux/ramips/dts/MZK-EX750NP.dts  |  1 -
 target/linux/ramips/dts/Newifi-D1.dts    |  3 +--
 target/linux/ramips/dts/PBR-M1.dts       |  3 +--
 target/linux/ramips/dts/PSG1208.dts      |  2 +-
 target/linux/ramips/dts/PSG1218.dts      |  2 +-
 target/linux/ramips/dts/RE6500.dts       |  4 ++--
 target/linux/ramips/dts/SAP-G3200U3.dts  |  4 ++--
 target/linux/ramips/dts/SK-WB8.dts       |  3 +--
 target/linux/ramips/dts/W2914NSV2.dtsi   | 11 +++++------
 target/linux/ramips/dts/WF-2881.dts      |  4 ++--
 target/linux/ramips/dts/WHR-1166D.dts    |  2 +-
 target/linux/ramips/dts/WITI.dts         |  4 ++--
 target/linux/ramips/dts/WL-WN575A3.dts   |  2 +-
 target/linux/ramips/dts/WNDR3700V5.dts   |  3 +--
 target/linux/ramips/dts/WSR-1166.dts     |  3 +--
 target/linux/ramips/dts/WSR-600.dts      |  1 -
 target/linux/ramips/dts/Y1.dtsi          |  2 +-
 target/linux/ramips/dts/ZBT-APE522II.dts |  2 +-
 target/linux/ramips/dts/ZBT-WG2626.dts   |  4 ++--
 target/linux/ramips/dts/ZBT-WG3526.dtsi  |  3 +--
 target/linux/ramips/dts/mt7628an.dtsi    |  1 -
 31 files changed, 38 insertions(+), 52 deletions(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 8a6e414..06b9eb0 100644
--- a/package/kernel/mt76/Makefile
+++ b/package/kernel/mt76/Makefile
@@ -1,16 +1,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mt76
-PKG_RELEASE=2
+PKG_RELEASE=1
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/openwrt/mt76
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2017-01-31
-PKG_SOURCE_VERSION:=3c8caafc5e150db79f714b958a51cee8f242f309
-PKG_MIRROR_HASH:=c03c166466cb7ea825e52cd085511045e3847d927ba2bde2b8fb46595a3ed13a
+PKG_SOURCE_DATE:=2017-10-12
+PKG_SOURCE_VERSION:=1be430fc8ae486e61f51f76925b30d6ff64c37dd
+PKG_MIRROR_HASH:=992e3d86d493b976ec23fb4f1179a72c3e34199c6ec5a93f37069555c9b19d9c
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_BUILD_PARALLEL:=1
diff --git a/target/linux/ramips/dts/ArcherC20i.dts b/target/linux/ramips/dts/ArcherC20i.dts
index b1001bf..5d0fc30 100644
--- a/target/linux/ramips/dts/ArcherC20i.dts
+++ b/target/linux/ramips/dts/ArcherC20i.dts
@@ -147,7 +147,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&radio 32768>;
-			mediatek,2ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/ArcherC50.dts b/target/linux/ramips/dts/ArcherC50.dts
index 465260b..c581787 100644
--- a/target/linux/ramips/dts/ArcherC50.dts
+++ b/target/linux/ramips/dts/ArcherC50.dts
@@ -181,7 +181,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&radio 32768>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 			mtd-mac-address = <&rom 0xf100>;
 			mtd-mac-address-increment = <(-1)>;
 		};
diff --git a/target/linux/ramips/dts/ArcherMR200.dts b/target/linux/ramips/dts/ArcherMR200.dts
index bbbf0af..f41014b 100644
--- a/target/linux/ramips/dts/ArcherMR200.dts
+++ b/target/linux/ramips/dts/ArcherMR200.dts
@@ -188,7 +188,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&radio 32768>;
-			mediatek,2ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts b/target/linux/ramips/dts/DIR-860L-B1.dts
index 98c9d8a..cc6c32b 100644
--- a/target/linux/ramips/dts/DIR-860L-B1.dts
+++ b/target/linux/ramips/dts/DIR-860L-B1.dts
@@ -116,7 +116,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&radio 0x2000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -125,7 +125,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&radio 0>;
-			mediatek,5ghz = <0>;
+			ieee80211-freq-limit = <2400000 2500000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/FIREWRT.dts b/target/linux/ramips/dts/FIREWRT.dts
index 1871de9..c1509cc 100644
--- a/target/linux/ramips/dts/FIREWRT.dts
+++ b/target/linux/ramips/dts/FIREWRT.dts
@@ -93,7 +93,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -102,7 +102,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
+			ieee80211-freq-limit = <2400000 2500000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/GL-MT750.dts b/target/linux/ramips/dts/GL-MT750.dts
index 8bf96c7..ad1e3f9 100644
--- a/target/linux/ramips/dts/GL-MT750.dts
+++ b/target/linux/ramips/dts/GL-MT750.dts
@@ -143,7 +143,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MAC1200RV2.dts b/target/linux/ramips/dts/MAC1200RV2.dts
index 45c26e1..73ba493 100644
--- a/target/linux/ramips/dts/MAC1200RV2.dts
+++ b/target/linux/ramips/dts/MAC1200RV2.dts
@@ -87,7 +87,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&art 0x1000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/MIWIFI-MINI.dts
index 101ae8d..45e1f2e 100644
--- a/target/linux/ramips/dts/MIWIFI-MINI.dts
+++ b/target/linux/ramips/dts/MIWIFI-MINI.dts
@@ -134,7 +134,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MZK-750DHP.dts b/target/linux/ramips/dts/MZK-750DHP.dts
index 4107c6f..dfefb0e 100644
--- a/target/linux/ramips/dts/MZK-750DHP.dts
+++ b/target/linux/ramips/dts/MZK-750DHP.dts
@@ -122,7 +122,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/MZK-EX750NP.dts b/target/linux/ramips/dts/MZK-EX750NP.dts
index 3aa2a57..29a1189 100644
--- a/target/linux/ramips/dts/MZK-EX750NP.dts
+++ b/target/linux/ramips/dts/MZK-EX750NP.dts
@@ -143,7 +143,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/Newifi-D1.dts b/target/linux/ramips/dts/Newifi-D1.dts
index 2d128ac..89bc851 100644
--- a/target/linux/ramips/dts/Newifi-D1.dts
+++ b/target/linux/ramips/dts/Newifi-D1.dts
@@ -117,7 +117,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -126,7 +126,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/PBR-M1.dts b/target/linux/ramips/dts/PBR-M1.dts
index 9a0c713..7baf074 100644
--- a/target/linux/ramips/dts/PBR-M1.dts
+++ b/target/linux/ramips/dts/PBR-M1.dts
@@ -149,7 +149,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -158,7 +158,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/PSG1208.dts b/target/linux/ramips/dts/PSG1208.dts
index 6ae56f2..6680f5d 100644
--- a/target/linux/ramips/dts/PSG1208.dts
+++ b/target/linux/ramips/dts/PSG1208.dts
@@ -103,7 +103,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/PSG1218.dts b/target/linux/ramips/dts/PSG1218.dts
index 5e90d1b..1e53dce 100644
--- a/target/linux/ramips/dts/PSG1218.dts
+++ b/target/linux/ramips/dts/PSG1218.dts
@@ -109,7 +109,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/RE6500.dts b/target/linux/ramips/dts/RE6500.dts
index 3fe875d..07439fa 100644
--- a/target/linux/ramips/dts/RE6500.dts
+++ b/target/linux/ramips/dts/RE6500.dts
@@ -103,7 +103,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -112,7 +112,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,5ghz = <0>;
+			ieee80211-freq-limit = <2400000 2500000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/SAP-G3200U3.dts b/target/linux/ramips/dts/SAP-G3200U3.dts
index 7be6e03..dbaa6a3 100644
--- a/target/linux/ramips/dts/SAP-G3200U3.dts
+++ b/target/linux/ramips/dts/SAP-G3200U3.dts
@@ -95,7 +95,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -104,7 +104,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
+			ieee80211-freq-limit = <2400000 2500000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/SK-WB8.dts b/target/linux/ramips/dts/SK-WB8.dts
index 87adc9a..f5da941 100644
--- a/target/linux/ramips/dts/SK-WB8.dts
+++ b/target/linux/ramips/dts/SK-WB8.dts
@@ -92,7 +92,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -101,7 +101,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/W2914NSV2.dtsi b/target/linux/ramips/dts/W2914NSV2.dtsi
index 7b11a0f..51ec161 100644
--- a/target/linux/ramips/dts/W2914NSV2.dtsi
+++ b/target/linux/ramips/dts/W2914NSV2.dtsi
@@ -72,20 +72,19 @@
 	status = "okay";
 
 	pcie0 {
-		wifi at 14c3,7662 {
-			compatible = "pci14c3,7662";
+		wifi at 14c3,7603 {
+			compatible = "pci14c3,7603";
 			reg = <0x0000 0 0 0 0>;
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 
 	pcie1 {
-		wifi at 14c3,7603 {
-			compatible = "pci14c3,7603";
+		wifi at 14c3,7662 {
+			compatible = "pci14c3,7662";
 			reg = <0x0000 0 0 0 0>;
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/WF-2881.dts b/target/linux/ramips/dts/WF-2881.dts
index 84a14e4..80676fa 100644
--- a/target/linux/ramips/dts/WF-2881.dts
+++ b/target/linux/ramips/dts/WF-2881.dts
@@ -85,7 +85,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -94,7 +94,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
+			ieee80211-freq-limit = <2400000 2500000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/WHR-1166D.dts b/target/linux/ramips/dts/WHR-1166D.dts
index 66fcc9b..a0eb5c0 100644
--- a/target/linux/ramips/dts/WHR-1166D.dts
+++ b/target/linux/ramips/dts/WHR-1166D.dts
@@ -165,7 +165,7 @@
 			compatible = "pci0,0";
 			reg = <0x0000 0 0 0 0>;
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/WITI.dts b/target/linux/ramips/dts/WITI.dts
index de0c517..91f6693 100644
--- a/target/linux/ramips/dts/WITI.dts
+++ b/target/linux/ramips/dts/WITI.dts
@@ -89,7 +89,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 			mtd-mac-address = <&factory 0xe000>;
 		};
 	};
@@ -99,7 +99,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
+			ieee80211-freq-limit = <2400000 2500000>;
 			mtd-mac-address = <&factory 0xe000>;
 		};
 	};
diff --git a/target/linux/ramips/dts/WL-WN575A3.dts b/target/linux/ramips/dts/WL-WN575A3.dts
index 63eff77..98716be 100644
--- a/target/linux/ramips/dts/WL-WN575A3.dts
+++ b/target/linux/ramips/dts/WL-WN575A3.dts
@@ -77,7 +77,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/WNDR3700V5.dts b/target/linux/ramips/dts/WNDR3700V5.dts
index bb879a1..ec97ac8 100644
--- a/target/linux/ramips/dts/WNDR3700V5.dts
+++ b/target/linux/ramips/dts/WNDR3700V5.dts
@@ -111,7 +111,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -120,7 +120,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/WSR-1166.dts b/target/linux/ramips/dts/WSR-1166.dts
index ab6a9a4..5d5725c 100644
--- a/target/linux/ramips/dts/WSR-1166.dts
+++ b/target/linux/ramips/dts/WSR-1166.dts
@@ -170,7 +170,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -179,7 +179,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/WSR-600.dts b/target/linux/ramips/dts/WSR-600.dts
index 63206b4..3f7238c 100644
--- a/target/linux/ramips/dts/WSR-600.dts
+++ b/target/linux/ramips/dts/WSR-600.dts
@@ -173,7 +173,6 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/Y1.dtsi
index 8e6133a..0ac04c4 100644
--- a/target/linux/ramips/dts/Y1.dtsi
+++ b/target/linux/ramips/dts/Y1.dtsi
@@ -84,7 +84,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/ZBT-APE522II.dts b/target/linux/ramips/dts/ZBT-APE522II.dts
index 5eca65f..9a8b700 100644
--- a/target/linux/ramips/dts/ZBT-APE522II.dts
+++ b/target/linux/ramips/dts/ZBT-APE522II.dts
@@ -124,7 +124,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/ZBT-WG2626.dts b/target/linux/ramips/dts/ZBT-WG2626.dts
index a75ca89..65541a5 100644
--- a/target/linux/ramips/dts/ZBT-WG2626.dts
+++ b/target/linux/ramips/dts/ZBT-WG2626.dts
@@ -93,7 +93,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 
@@ -102,7 +102,7 @@
 			reg = <0x0000 0 0 0 0>;
 			device_type = "pci";
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
+			ieee80211-freq-limit = <2400000 2500000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/ZBT-WG3526.dtsi
index e48ef3a..582e420 100644
--- a/target/linux/ramips/dts/ZBT-WG3526.dtsi
+++ b/target/linux/ramips/dts/ZBT-WG3526.dtsi
@@ -88,7 +88,6 @@
 			compatible = "pci14c3,7603";
 			reg = <0x0000 0 0 0 0>;
 			mediatek,mtd-eeprom = <&factory 0x0000>;
-			mediatek,5ghz = <0>;
 		};
 	};
 
@@ -97,7 +96,7 @@
 			compatible = "pci14c3,7662";
 			reg = <0x0000 0 0 0 0>;
 			mediatek,mtd-eeprom = <&factory 0x8000>;
-			mediatek,2ghz = <0>;
+			ieee80211-freq-limit = <5000000 6000000>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi
index dc3ba9e..b64a87a 100644
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -474,6 +474,5 @@
 		status = "disabled";
 
 		mediatek,mtd-eeprom = <&factory 0x0000>;
-		mediatek,5ghz = <0>;
 	};
 };


From lede-commits at lists.infradead.org  Fri Oct 13 04:54:49 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 07:54:49 -0400
Subject: [source]  kernel: add fix for bgmac with B50212E B1 PHY
In-Reply-To: <20171013115449.17036.93817@git-01.infra.lede-project.org>
References: <20171013115449.17036.93817@git-01.infra.lede-project.org>
Message-ID: <mailman.54161.1507895727.26984.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch master:
https://git.lede-project.org/2cd32a3304cd52411da2dfac6db429efcad74ac8

commit 2cd32a3304cd52411da2dfac6db429efcad74ac8
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Fri Oct 13 10:22:41 2017 +0200

    kernel: add fix for bgmac with B50212E B1 PHY
    
    This PHY requires some extra programming to work reliably with all
    devices. Backport upstream fix for it.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...nable-master-mode-for-BCM54210E-and-B5021.patch | 50 ++++++++++++++++++++
 ...adcom-support-new-device-flag-for-setting.patch | 54 ++++++++++++++++++++++
 .../hack-4.9/773-bgmac-add-srab-switch.patch       |  2 +-
 ...nable-master-mode-for-BCM54210E-and-B5021.patch | 50 ++++++++++++++++++++
 ...rry-pick-Broadcom-drivers-updates-from-v4.patch |  3 +-
 ...ry-pick-Broadcom-drivers-updates-from-v4.patch} | 12 ++++-
 ...rry-pick-Broadcom-drivers-updates-from-v4.patch | 37 +++++++++++++++
 .../pending-4.4/773-bgmac-add-srab-switch.patch    |  2 +-
 8 files changed, 204 insertions(+), 6 deletions(-)

diff --git a/target/linux/generic/backport-4.9/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch b/target/linux/generic/backport-4.9/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch
new file mode 100644
index 0000000..c371e63
--- /dev/null
+++ b/target/linux/generic/backport-4.9/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch
@@ -0,0 +1,50 @@
+From 12acd136913ccdf394eeb2bc8686ff5505368119 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Thu, 12 Oct 2017 10:21:26 +0200
+Subject: [PATCH] net: bgmac: enable master mode for BCM54210E and B50212E PHYs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There are 4 very similar PHYs:
+0x600d84a1: BCM54210E (rev B0)
+0x600d84a2: BCM54210E (rev B1)
+0x600d84a5: B50212E (rev B0)
+0x600d84a6: B50212E (rev B1)
+that need setting master mode manually. It's because they run in slave
+mode by default with Automatic Slave/Master configuration disabled which
+can lead to unreliable connection with massive ping loss.
+
+So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY
+connected to the bgmac supported ethernet device. Telling PHY driver to
+setup PHY properly solves this issue.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+@@ -159,13 +159,19 @@ static int bgmac_probe(struct bcma_devic
+ 
+ 	if (!bgmac_is_bcm4707_family(core) &&
+ 	    !(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) {
++		struct phy_device *phydev;
++
+ 		mii_bus = bcma_mdio_mii_register(bgmac);
+ 		if (IS_ERR(mii_bus)) {
+ 			err = PTR_ERR(mii_bus);
+ 			goto err;
+ 		}
+-
+ 		bgmac->mii_bus = mii_bus;
++
++		phydev = mdiobus_get_phy(bgmac->mii_bus, bgmac->phyaddr);
++		if (ci->id == BCMA_CHIP_ID_BCM53573 && phydev &&
++		    (phydev->drv->phy_id & phydev->drv->phy_id_mask) == PHY_ID_BCM54210E)
++			phydev->dev_flags |= PHY_BRCM_EN_MASTER_MODE;
+ 	}
+ 
+ 	if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) {
diff --git a/target/linux/generic/backport-4.9/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch b/target/linux/generic/backport-4.9/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch
new file mode 100644
index 0000000..334c444
--- /dev/null
+++ b/target/linux/generic/backport-4.9/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch
@@ -0,0 +1,54 @@
+From 2355a6546a053b1c16ebefd6ce1f0cccc00e1da5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Thu, 12 Oct 2017 10:21:25 +0200
+Subject: [PATCH] net: phy: broadcom: support new device flag for setting
+ master mode
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Some of Broadcom's PHYs run by default in slave mode with Automatic
+Slave/Master configuration disabled. It stops them from working properly
+with some devices.
+
+So far it has been verified for BCM54210E and BCM50212E which don't
+work well with Intel's I217-LM and I218-LM:
+http://ark.intel.com/products/60019/Intel-Ethernet-Connection-I217-LM
+http://ark.intel.com/products/71307/Intel-Ethernet-Connection-I218-LM
+I was told there is massive ping loss.
+
+This commit adds support for a new flag which can be set by an ethernet
+driver to fixup PHY setup.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 6 ++++++
+ include/linux/brcmphy.h    | 1 +
+ 2 files changed, 7 insertions(+)
+
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct
+ 	val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
+ 	bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
+ 
++	if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
++		val = phy_read(phydev, MII_CTRL1000);
++		val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
++		phy_write(phydev, MII_CTRL1000, val);
++	}
++
+ 	return 0;
+ }
+ 
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -59,6 +59,7 @@
+ #define PHY_BRCM_EXT_IBND_TX_ENABLE	0x00002000
+ #define PHY_BRCM_CLEAR_RGMII_MODE	0x00004000
+ #define PHY_BRCM_DIS_TXCRXC_NOENRGY	0x00008000
++#define PHY_BRCM_EN_MASTER_MODE		0x00010000
+ 
+ /* Broadcom BCM7xxx specific workarounds */
+ #define PHY_BRCM_7XXX_REV(x)		(((x) >> 8) & 0xff)
diff --git a/target/linux/generic/hack-4.9/773-bgmac-add-srab-switch.patch b/target/linux/generic/hack-4.9/773-bgmac-add-srab-switch.patch
index c865177..e6ad0a5 100644
--- a/target/linux/generic/hack-4.9/773-bgmac-add-srab-switch.patch
+++ b/target/linux/generic/hack-4.9/773-bgmac-add-srab-switch.patch
@@ -14,7 +14,7 @@ Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
 
 --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
 +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
-@@ -230,6 +230,7 @@ static int bgmac_probe(struct bcma_devic
+@@ -236,6 +236,7 @@ static int bgmac_probe(struct bcma_devic
  		bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
  		bgmac->feature_flags |= BGMAC_FEAT_NO_RESET;
  		bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;
diff --git a/target/linux/generic/pending-4.4/073-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch b/target/linux/generic/pending-4.4/073-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch
new file mode 100644
index 0000000..27cd660
--- /dev/null
+++ b/target/linux/generic/pending-4.4/073-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch
@@ -0,0 +1,50 @@
+From 12acd136913ccdf394eeb2bc8686ff5505368119 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Thu, 12 Oct 2017 10:21:26 +0200
+Subject: [PATCH] net: bgmac: enable master mode for BCM54210E and B50212E PHYs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There are 4 very similar PHYs:
+0x600d84a1: BCM54210E (rev B0)
+0x600d84a2: BCM54210E (rev B1)
+0x600d84a5: B50212E (rev B0)
+0x600d84a6: B50212E (rev B1)
+that need setting master mode manually. It's because they run in slave
+mode by default with Automatic Slave/Master configuration disabled which
+can lead to unreliable connection with massive ping loss.
+
+So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY
+connected to the bgmac supported ethernet device. Telling PHY driver to
+setup PHY properly solves this issue.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+@@ -159,13 +159,19 @@ static int bgmac_probe(struct bcma_devic
+ 
+ 	if (!bgmac_is_bcm4707_family(core) &&
+ 	    !(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) {
++		struct phy_device *phydev;
++
+ 		mii_bus = bcma_mdio_mii_register(bgmac);
+ 		if (IS_ERR(mii_bus)) {
+ 			err = PTR_ERR(mii_bus);
+ 			goto err;
+ 		}
+-
+ 		bgmac->mii_bus = mii_bus;
++
++		phydev = bgmac->mii_bus->phy_map[bgmac->phyaddr];
++		if (ci->id == BCMA_CHIP_ID_BCM53573 && phydev &&
++		    (phydev->drv->phy_id & phydev->drv->phy_id_mask) == PHY_ID_BCM54210E)
++			phydev->dev_flags |= PHY_BRCM_EN_MASTER_MODE;
+ 	}
+ 
+ 	if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) {
diff --git a/target/linux/generic/pending-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch b/target/linux/generic/pending-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
index bf88189..1d943d6 100644
--- a/target/linux/generic/pending-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
+++ b/target/linux/generic/pending-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
@@ -1,6 +1,5 @@
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
-Subject: [PATCH 1/2] net: phy: cherry-pick Broadcom drivers updates from
- v4.10-rc1
+Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.10
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
diff --git a/target/linux/generic/pending-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch b/target/linux/generic/pending-4.4/078-0004-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
similarity index 93%
rename from target/linux/generic/pending-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch
rename to target/linux/generic/pending-4.4/078-0004-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
index 794753f..269c4e7 100644
--- a/target/linux/generic/pending-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch
+++ b/target/linux/generic/pending-4.4/078-0004-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
@@ -1,10 +1,18 @@
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
-Subject: [PATCH 2/2] net: phy: pick Broadcom drivers updates from net-next for
- 4.11
+Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.11
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
+This includes following upstream commits:
+62e13097c46c net: phy: broadcom: rehook BCM54612E specific init
+0fc9ae107669 net: phy: broadcom: add support for BCM54210E
+5e7bfa6cb0a9 net: phy: bcm-phy-lib: clean up remaining AUXCTL register defines
+8293c7bcdef1 net: phy: broadcom: drop duplicated define for RGMII SKEW delay
+85b4685da52f net: phy: broadcom: use auxctl reading helper in BCM54612E code
+039a7b8592ab net: phy: bcm7xxx: Implement EGPHY workaround for 7278
+582d0ac397ca net: phy: bcm7xxx: Add entry for BCM7278
+
 Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
 ---
 
diff --git a/target/linux/generic/pending-4.4/078-0006-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch b/target/linux/generic/pending-4.4/078-0006-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
new file mode 100644
index 0000000..c39995d
--- /dev/null
+++ b/target/linux/generic/pending-4.4/078-0006-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
@@ -0,0 +1,37 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.15
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This includes following upstream commits:
+2355a6546a05 net: phy: broadcom: support new device flag for setting master mode
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct
+ 	val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
+ 	bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
+ 
++	if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
++		val = phy_read(phydev, MII_CTRL1000);
++		val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
++		phy_write(phydev, MII_CTRL1000, val);
++	}
++
+ 	return 0;
+ }
+ 
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -59,6 +59,7 @@
+ #define PHY_BRCM_EXT_IBND_TX_ENABLE	0x00002000
+ #define PHY_BRCM_CLEAR_RGMII_MODE	0x00004000
+ #define PHY_BRCM_DIS_TXCRXC_NOENRGY	0x00008000
++#define PHY_BRCM_EN_MASTER_MODE		0x00010000
+ 
+ /* Broadcom BCM7xxx specific workarounds */
+ #define PHY_BRCM_7XXX_REV(x)		(((x) >> 8) & 0xff)
diff --git a/target/linux/generic/pending-4.4/773-bgmac-add-srab-switch.patch b/target/linux/generic/pending-4.4/773-bgmac-add-srab-switch.patch
index 5e358c3..b3cb087 100644
--- a/target/linux/generic/pending-4.4/773-bgmac-add-srab-switch.patch
+++ b/target/linux/generic/pending-4.4/773-bgmac-add-srab-switch.patch
@@ -78,7 +78,7 @@ Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
  struct bgmac *bgmac_alloc(struct device *dev);
 --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
 +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
-@@ -230,6 +230,7 @@ static int bgmac_probe(struct bcma_devic
+@@ -236,6 +236,7 @@ static int bgmac_probe(struct bcma_devic
  		bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
  		bgmac->feature_flags |= BGMAC_FEAT_NO_RESET;
  		bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;


From lede-commits at lists.infradead.org  Fri Oct 13 05:52:41 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 08:52:41 -0400
Subject: [source]  kernel: add fix for bgmac with B50212E B1 PHY
In-Reply-To: <20171013125241.30533.1784@git-01.infra.lede-project.org>
References: <20171013125241.30533.1784@git-01.infra.lede-project.org>
Message-ID: <mailman.54176.1507899199.26984.lede-commits@lists.infradead.org>

rmilecki pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/8ad1b09c6dcff814eb04084ef349f975025b7dc1

commit 8ad1b09c6dcff814eb04084ef349f975025b7dc1
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Fri Oct 13 14:06:18 2017 +0200

    kernel: add fix for bgmac with B50212E B1 PHY
    
    This PHY requires some extra programming to work reliably with all
    devices. Backport upstream fix for it.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...nable-master-mode-for-BCM54210E-and-B5021.patch | 50 ++++++++++++++++++++++
 ...rry-pick-Broadcom-drivers-updates-from-v4.patch |  3 +-
 ...ry-pick-Broadcom-drivers-updates-from-v4.patch} |  9 ++++
 ...rry-pick-Broadcom-drivers-updates-from-v4.patch | 37 ++++++++++++++++
 .../patches-4.4/773-bgmac-add-srab-switch.patch    |  2 +-
 5 files changed, 98 insertions(+), 3 deletions(-)

diff --git a/target/linux/generic/patches-4.4/073-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch b/target/linux/generic/patches-4.4/073-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch
new file mode 100644
index 0000000..27cd660
--- /dev/null
+++ b/target/linux/generic/patches-4.4/073-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch
@@ -0,0 +1,50 @@
+From 12acd136913ccdf394eeb2bc8686ff5505368119 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Thu, 12 Oct 2017 10:21:26 +0200
+Subject: [PATCH] net: bgmac: enable master mode for BCM54210E and B50212E PHYs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There are 4 very similar PHYs:
+0x600d84a1: BCM54210E (rev B0)
+0x600d84a2: BCM54210E (rev B1)
+0x600d84a5: B50212E (rev B0)
+0x600d84a6: B50212E (rev B1)
+that need setting master mode manually. It's because they run in slave
+mode by default with Automatic Slave/Master configuration disabled which
+can lead to unreliable connection with massive ping loss.
+
+So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY
+connected to the bgmac supported ethernet device. Telling PHY driver to
+setup PHY properly solves this issue.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+@@ -159,13 +159,19 @@ static int bgmac_probe(struct bcma_devic
+ 
+ 	if (!bgmac_is_bcm4707_family(core) &&
+ 	    !(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) {
++		struct phy_device *phydev;
++
+ 		mii_bus = bcma_mdio_mii_register(bgmac);
+ 		if (IS_ERR(mii_bus)) {
+ 			err = PTR_ERR(mii_bus);
+ 			goto err;
+ 		}
+-
+ 		bgmac->mii_bus = mii_bus;
++
++		phydev = bgmac->mii_bus->phy_map[bgmac->phyaddr];
++		if (ci->id == BCMA_CHIP_ID_BCM53573 && phydev &&
++		    (phydev->drv->phy_id & phydev->drv->phy_id_mask) == PHY_ID_BCM54210E)
++			phydev->dev_flags |= PHY_BRCM_EN_MASTER_MODE;
+ 	}
+ 
+ 	if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) {
diff --git a/target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch b/target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
index 1186559..b5c5281 100644
--- a/target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
+++ b/target/linux/generic/patches-4.4/078-0003-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
@@ -1,6 +1,5 @@
 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
-Subject: [PATCH 1/2] net: phy: cherry-pick Broadcom drivers updates from
- v4.10-rc1
+Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.10
 
 Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
 ---
diff --git a/target/linux/generic/patches-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch b/target/linux/generic/patches-4.4/078-0004-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
similarity index 95%
rename from target/linux/generic/patches-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch
rename to target/linux/generic/patches-4.4/078-0004-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
index d050691..14e4f37 100644
--- a/target/linux/generic/patches-4.4/078-0004-net-phy-pick-Broadcom-drivers-updates-from-net-next-.patch
+++ b/target/linux/generic/patches-4.4/078-0004-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
@@ -1,3 +1,12 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.11
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+
 --- a/drivers/net/phy/broadcom.c
 +++ b/drivers/net/phy/broadcom.c
 @@ -30,6 +30,50 @@ MODULE_DESCRIPTION("Broadcom PHY driver"
diff --git a/target/linux/generic/patches-4.4/078-0006-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch b/target/linux/generic/patches-4.4/078-0006-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
new file mode 100644
index 0000000..0723a35
--- /dev/null
+++ b/target/linux/generic/patches-4.4/078-0006-net-phy-cherry-pick-Broadcom-drivers-updates-from-v4.patch
@@ -0,0 +1,37 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Subject: [PATCH] net: phy: cherry-pick Broadcom drivers updates from v4.15
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This includes following upstream commits:
+2355a6546a05 net: phy: broadcom: support new device flag for setting master mode
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct
+ 	val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN;
+ 	bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val);
+ 
++	if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) {
++		val = phy_read(phydev, MII_CTRL1000);
++		val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER;
++		phy_write(phydev, MII_CTRL1000, val);
++	}
++
+ 	return 0;
+ }
+ 
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -55,6 +55,7 @@
+ #define PHY_BRCM_EXT_IBND_TX_ENABLE	0x00002000
+ #define PHY_BRCM_CLEAR_RGMII_MODE	0x00004000
+ #define PHY_BRCM_DIS_TXCRXC_NOENRGY	0x00008000
++#define PHY_BRCM_EN_MASTER_MODE		0x00010000
+ 
+ /* Broadcom BCM7xxx specific workarounds */
+ #define PHY_BRCM_7XXX_REV(x)		(((x) >> 8) & 0xff)
diff --git a/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch b/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch
index 5e358c3..b3cb087 100644
--- a/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch
+++ b/target/linux/generic/patches-4.4/773-bgmac-add-srab-switch.patch
@@ -78,7 +78,7 @@ Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
  struct bgmac *bgmac_alloc(struct device *dev);
 --- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
 +++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
-@@ -230,6 +230,7 @@ static int bgmac_probe(struct bcma_devic
+@@ -236,6 +236,7 @@ static int bgmac_probe(struct bcma_devic
  		bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
  		bgmac->feature_flags |= BGMAC_FEAT_NO_RESET;
  		bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500;


From lede-commits at lists.infradead.org  Fri Oct 13 07:55:21 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 10:55:21 -0400
Subject: [source]  dnsmasq: add listen_address parameter
In-Reply-To: <20171013145521.28750.35851@git-01.infra.lede-project.org>
References: <20171013145521.28750.35851@git-01.infra.lede-project.org>
Message-ID: <mailman.54200.1507906550.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/7ffb707576e8c635321275e9f118c8ad27d4c798

commit 7ffb707576e8c635321275e9f118c8ad27d4c798
Author: Christian Lamparter <chunkeey at gmail.com>
AuthorDate: Thu Oct 12 23:16:06 2017 +0200

    dnsmasq: add listen_address parameter
    
    This patch adds a parser for the uci representation of
    dnsmasq's "-a | --listen-address" option.
    
    In summary, this option forces dnsmasq to listen on the
    given IP address(es). Both interface and listen-address
    options may be given, in which case the set of both
    interfaces and addresses is used.
    
    Note that if no interface option is given, but listen_address is,
    dnsmasq will not automatically listen on the loopback interface.
    To achieve this, the loopback IP addresses, 127.0.0.1 and/or ::1
    must be explicitly added.
    
    This option is useful for ujailed dnsmasq instances, that would
    otherwise fail to work properly, because listening to the
    "This host on this network" address (aka 0.0.0.0 see rfc1700 page 4)
    may not be allowed.
    
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com> (PKG_RELEASE increase)
---
 package/network/services/dnsmasq/Makefile           | 2 +-
 package/network/services/dnsmasq/files/dnsmasq.init | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 9a024ce..7646fbd 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.78
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 0149643..3d3d833 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -142,6 +142,10 @@ append_interface() {
 	xappend "--interface=$ifname"
 }
 
+append_listenaddress() {
+	xappend "--listen-address=$1"
+}
+
 append_notinterface() {
 	network_get_device ifname "$1" || ifname="$1"
 	xappend "--except-interface=$ifname"
@@ -835,6 +839,7 @@ dnsmasq_start()
 	append_parm "$cfg" "maxport" "--max-port"
 	append_parm "$cfg" "domain" "--domain"
 	append_parm "$cfg" "local" "--server"
+	config_list_foreach "$cfg" "listen_address" append_listenaddress
 	config_list_foreach "$cfg" "server" append_server
 	config_list_foreach "$cfg" "rev_server" append_rev_server
 	config_list_foreach "$cfg" "address" append_address


From lede-commits at lists.infradead.org  Fri Oct 13 11:28:55 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 14:28:55 -0400
Subject: [source]  mac80211: fix tx power regression
In-Reply-To: <20171013182855.8064.85645@git-01.infra.lede-project.org>
References: <20171013182855.8064.85645@git-01.infra.lede-project.org>
Message-ID: <mailman.54250.1507919495.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/5bd006aa2689d1ec813936b13eb1eb85ef4a0ab8

commit 5bd006aa2689d1ec813936b13eb1eb85ef4a0ab8
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Oct 13 20:27:33 2017 +0200

    mac80211: fix tx power regression
    
    Revert an accidental change that was introduced by having an old version
    of the patch in my git tree, which was merged in 609208597b6d
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../315-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/patches/315-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch b/package/kernel/mac80211/patches/315-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
index 59e4dde..7808351 100644
--- a/package/kernel/mac80211/patches/315-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
+++ b/package/kernel/mac80211/patches/315-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
@@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 +	/* FCC allows maximum antenna gain of 3 dBi */
 +	if (reg->region == NL80211_DFS_FCC)
-+		ant_reduction = min_t(int, ant_reduction - 6, 0);
++		ant_reduction = max_t(int, ant_reduction - 6, 0);
 +
  	ah->eep_ops->set_txpower(ah, chan, ctl, ant_reduction, new_pwr, test);
  }


From lede-commits at lists.infradead.org  Fri Oct 13 12:48:50 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 15:48:50 -0400
Subject: [source]  iproute2: bump to 4.13
In-Reply-To: <20171013194850.26420.75149@git-01.infra.lede-project.org>
References: <20171013194850.26420.75149@git-01.infra.lede-project.org>
Message-ID: <mailman.54271.1507924162.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/db18cee2d75d88e2ae88e3d1f75b5b3359ed6f19

commit db18cee2d75d88e2ae88e3d1f75b5b3359ed6f19
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sun Oct 1 21:46:27 2017 +0200

    iproute2: bump to 4.13
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/utils/iproute2/Makefile            | 34 +++++++++++++++++++---
 .../utils/iproute2/patches/001-config.patch        |  3 +-
 .../utils/iproute2/patches/004-darwin_fixes.patch  |  2 +-
 .../utils/iproute2/patches/006-no_sctp.patch       |  4 +--
 .../utils/iproute2/patches/008-no_netem.patch      |  6 ++--
 .../utils/iproute2/patches/110-extra-ccopts.patch  |  2 +-
 .../iproute2/patches/120-libnetlink-pic.patch      |  4 +--
 ...er.h-prevent-redefinition-of-struct-ethhd.patch | 12 --------
 .../utils/iproute2/patches/300-ip_tiny.patch       | 16 +++++-----
 .../iproute2/patches/900-drop_FAILED_POLICY.patch  |  2 +-
 .../iproute2/patches/950-add-cake-to-tc.patch      |  4 +--
 11 files changed, 51 insertions(+), 38 deletions(-)

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index 364c1b2..14a33c5 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
-PKG_VERSION:=4.11.0
+PKG_VERSION:=4.13.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
-PKG_HASH:=72671028bda696d0cb8f48ec8e702581c3a501caeed33eec3a81d7041cbc8026
+PKG_HASH:=9cfb81edf8c8509e03daa77cf62aead01c4a827132f6c506578f94cc19415c50
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=iptables
 PKG_LICENSE:=GPL-2.0
@@ -28,7 +28,6 @@ define Package/iproute2/Default
   URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
   SUBMENU:=Routing and Redirection
   MAINTAINER:=Russell Senior <russell at personaltelco.net>
-  DEPENDS:= +libnl-tiny
 endef
 
 define Package/ip-tiny
@@ -37,6 +36,7 @@ $(call Package/iproute2/Default)
  VARIANT:=tiny
  PROVIDES:=ip
  ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny
+ DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/ip-full
@@ -45,32 +45,37 @@ $(call Package/iproute2/Default)
  VARIANT:=full
  PROVIDES:=ip
  ALTERNATIVES:=300:/sbin/ip:/sbin/ip-full
+ DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/tc
 $(call Package/iproute2/Default)
   TITLE:=Traffic control utility
-  DEPENDS:=+kmod-sched-core
+  DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/genl
 $(call Package/iproute2/Default)
   TITLE:=General netlink utility frontend
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/ip-bridge
 $(call Package/iproute2/Default)
   TITLE:=Bridge configuration utility from iproute2
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/ss
 $(call Package/iproute2/Default)
   TITLE:=Socket statistics utility
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/nstat
 $(call Package/iproute2/Default)
   TITLE:=Network statistics utility
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
 endef
 
 define Package/devlink
@@ -79,10 +84,24 @@ $(call Package/iproute2/Default)
   DEPENDS:=+libmnl
 endef
 
+define Package/rdma
+$(call Package/iproute2/Default)
+  TITLE:=Network rdma utility
+  DEPENDS:=+libmnl
+endef
+
 ifeq ($(BUILD_VARIANT),tiny)
   IP_CONFIG_TINY:=y
 endif
 
+ifdef CONFIG_PACKAGE_devlink
+  HAVE_MNL:=y
+endif
+
+ifdef CONFIG_PACKAGE_rdma
+  HAVE_MNL:=y
+endif
+
 define Build/Configure
 	$(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
 	$(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
@@ -101,6 +120,7 @@ MAKE_FLAGS += \
 	SHARED_LIBS="" \
 	LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \
 	IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
+	HAVE_MNL=$(HAVE_MNL) \
 	IPT_LIB_DIR=/usr/lib/iptables \
 	FPIC="$(FPIC)"
 
@@ -157,6 +177,11 @@ define Package/devlink/install
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/devlink/devlink $(1)/usr/sbin/
 endef
 
+define Package/rdma/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/rdma/rdma $(1)/usr/sbin/
+endef
+
 $(eval $(call BuildPackage,ip-tiny))
 $(eval $(call BuildPackage,ip-full))
 $(eval $(call BuildPackage,tc))
@@ -165,3 +190,4 @@ $(eval $(call BuildPackage,ip-bridge))
 $(eval $(call BuildPackage,ss))
 $(eval $(call BuildPackage,nstat))
 $(eval $(call BuildPackage,devlink))
+$(eval $(call BuildPackage,rdma))
diff --git a/package/network/utils/iproute2/patches/001-config.patch b/package/network/utils/iproute2/patches/001-config.patch
index b3208e0..7f23cfc 100644
--- a/package/network/utils/iproute2/patches/001-config.patch
+++ b/package/network/utils/iproute2/patches/001-config.patch
@@ -1,8 +1,7 @@
 --- /dev/null
 +++ b/Config
-@@ -0,0 +1,5 @@
+@@ -0,0 +1,4 @@
 +# Fixed config to disable ATM support even if present on host system
 +IP_CONFIG_SETNS:=y
 +TC_CONFIG_ATM:=n
 +TC_CONFIG_XT:=y
-+HAVE_MNL:=y
diff --git a/package/network/utils/iproute2/patches/004-darwin_fixes.patch b/package/network/utils/iproute2/patches/004-darwin_fixes.patch
index e1a5e97..1f3eb10 100644
--- a/package/network/utils/iproute2/patches/004-darwin_fixes.patch
+++ b/package/network/utils/iproute2/patches/004-darwin_fixes.patch
@@ -42,7 +42,7 @@
  #define TABLESIZE	16384
 --- a/netem/paretonormal.c
 +++ b/netem/paretonormal.c
-@@ -15,10 +15,13 @@
+@@ -14,10 +14,13 @@
  #include <string.h>
  #include <math.h>
  #include <limits.h>
diff --git a/package/network/utils/iproute2/patches/006-no_sctp.patch b/package/network/utils/iproute2/patches/006-no_sctp.patch
index 0f6f269..e23fbcd 100644
--- a/package/network/utils/iproute2/patches/006-no_sctp.patch
+++ b/package/network/utils/iproute2/patches/006-no_sctp.patch
@@ -1,6 +1,6 @@
 --- a/ip/ipxfrm.c
 +++ b/ip/ipxfrm.c
-@@ -465,7 +465,6 @@ void xfrm_selector_print(struct xfrm_sel
+@@ -454,7 +454,6 @@ void xfrm_selector_print(struct xfrm_sel
  	switch (sel->proto) {
  	case IPPROTO_TCP:
  	case IPPROTO_UDP:
@@ -8,7 +8,7 @@
  	case IPPROTO_DCCP:
  	default: /* XXX */
  		if (sel->sport_mask)
-@@ -1321,7 +1320,6 @@ static int xfrm_selector_upspec_parse(st
+@@ -1329,7 +1328,6 @@ static int xfrm_selector_upspec_parse(st
  		switch (sel->proto) {
  		case IPPROTO_TCP:
  		case IPPROTO_UDP:
diff --git a/package/network/utils/iproute2/patches/008-no_netem.patch b/package/network/utils/iproute2/patches/008-no_netem.patch
index 47ffd99..6489638 100644
--- a/package/network/utils/iproute2/patches/008-no_netem.patch
+++ b/package/network/utils/iproute2/patches/008-no_netem.patch
@@ -1,11 +1,11 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -52,7 +52,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
+@@ -49,7 +49,7 @@ WFLAGS += -Wmissing-declarations -Wold-s
  CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS)
  YACCFLAGS = -d -t -v
  
--SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man
-+SUBDIRS=lib ip tc bridge misc genl tipc devlink man
+-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man
++SUBDIRS=lib ip tc bridge misc genl tipc devlink rdma man
  
  LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
  LDLIBS += $(LIBNETLINK)
diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch b/package/network/utils/iproute2/patches/110-extra-ccopts.patch
index b28e19d..e779934 100644
--- a/package/network/utils/iproute2/patches/110-extra-ccopts.patch
+++ b/package/network/utils/iproute2/patches/110-extra-ccopts.patch
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -45,7 +45,7 @@ HOSTCC ?= $(CC)
+@@ -42,7 +42,7 @@ HOSTCC ?= $(CC)
  DEFINES += -D_GNU_SOURCE
  # Turn on transparent support for LFS
  DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
diff --git a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch
index 1f397f7..ebe122e 100644
--- a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch
+++ b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch
@@ -1,7 +1,7 @@
 --- a/lib/Makefile
 +++ b/lib/Makefile
-@@ -4,7 +4,7 @@ ifeq ($(IP_CONFIG_SETNS),y)
- 	CFLAGS += -DHAVE_SETNS
+@@ -12,7 +12,7 @@ ifeq ($(HAVE_MNL),y)
+ 	CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
  endif
  
 -CFLAGS += -fPIC
diff --git a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
index 42e2932..c022d17 100644
--- a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
+++ b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch
@@ -65,15 +65,3 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /* Definitions for in.h */
  #define __UAPI_DEF_IN_ADDR		1
  #define __UAPI_DEF_IN_IPPROTO		1
---- a/ip/iplink_bridge.c
-+++ b/ip/iplink_bridge.c
-@@ -14,8 +14,8 @@
- #include <string.h>
- #include <netinet/in.h>
- #include <linux/if_link.h>
--#include <linux/if_bridge.h>
- #include <netinet/ether.h>
-+#include <linux/if_bridge.h>
- #include <net/if.h>
- 
- #include "rt_names.h"
diff --git a/package/network/utils/iproute2/patches/300-ip_tiny.patch b/package/network/utils/iproute2/patches/300-ip_tiny.patch
index e1b1da4..d48ea85 100644
--- a/package/network/utils/iproute2/patches/300-ip_tiny.patch
+++ b/package/network/utils/iproute2/patches/300-ip_tiny.patch
@@ -1,7 +1,7 @@
 --- a/ip/Makefile
 +++ b/ip/Makefile
-@@ -19,6 +19,13 @@ ifeq ($(IP_CONFIG_SETNS),y)
- 	CFLAGS += -DHAVE_SETNS
+@@ -28,6 +28,13 @@ ifeq ($(HAVE_MNL),y)
+ 	LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
  endif
  
 +STATIC_SYM_FILTER:=
@@ -14,7 +14,7 @@
  ALLOBJ=$(IPOBJ) $(RTMONOBJ)
  SCRIPTS=ifcfg rtpr routel routef
  TARGETS=ip rtmon
-@@ -48,7 +55,7 @@ else
+@@ -57,7 +64,7 @@ else
  
  ip: static-syms.o
  static-syms.o: static-syms.h
@@ -68,11 +68,11 @@
  	{ "netconf",	do_ipnetconf },
 +#endif
  	{ "vrf",	do_ipvrf},
+ 	{ "sr",		do_seg6 },
  	{ "help",	do_help },
- 	{ 0 }
 --- a/lib/utils.c
 +++ b/lib/utils.c
-@@ -777,6 +777,7 @@ const char *rt_addr_n2a_r(int af, int le
+@@ -787,6 +787,7 @@ const char *rt_addr_n2a_r(int af, int le
  		return inet_ntop(af, addr, buf, buflen);
  	case AF_MPLS:
  		return mpls_ntop(af, addr, buf, buflen);
@@ -80,7 +80,7 @@
  	case AF_IPX:
  		return ipx_ntop(af, addr, buf, buflen);
  	case AF_DECnet:
-@@ -786,6 +787,7 @@ const char *rt_addr_n2a_r(int af, int le
+@@ -796,6 +797,7 @@ const char *rt_addr_n2a_r(int af, int le
  		memcpy(dna.a_addr, addr, 2);
  		return dnet_ntop(af, &dna, buf, buflen);
  	}
@@ -90,8 +90,8 @@
  	default:
 --- a/lib/Makefile
 +++ b/lib/Makefile
-@@ -4,6 +4,10 @@ ifeq ($(IP_CONFIG_SETNS),y)
- 	CFLAGS += -DHAVE_SETNS
+@@ -12,6 +12,10 @@ ifeq ($(HAVE_MNL),y)
+ 	CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
  endif
  
 +ifeq ($(IP_CONFIG_TINY),y)
diff --git a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch
index 44f198f..a0fd154 100644
--- a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch
+++ b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch
@@ -24,7 +24,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
  
 --- a/include/linux/rtnetlink.h
 +++ b/include/linux/rtnetlink.h
-@@ -215,6 +215,7 @@ enum {
+@@ -220,6 +220,7 @@ enum {
  	RTN_THROW,		/* Not in this table		*/
  	RTN_NAT,		/* Translate this address	*/
  	RTN_XRESOLVE,		/* Use external resolver	*/
diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch
index 0705eb1..eacad07 100644
--- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch
+++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch
@@ -1,6 +1,6 @@
 --- a/include/linux/pkt_sched.h
 +++ b/include/linux/pkt_sched.h
-@@ -863,4 +863,60 @@ struct tc_pie_xstats {
+@@ -871,4 +871,60 @@ struct tc_pie_xstats {
  	__u32 maxq;             /* maximum queue size */
  	__u32 ecn_mark;         /* packets marked with ecn*/
  };
@@ -63,7 +63,7 @@
  #endif
 --- a/tc/Makefile
 +++ b/tc/Makefile
-@@ -67,6 +67,7 @@ TCMODULES += q_codel.o
+@@ -69,6 +69,7 @@ TCMODULES += q_codel.o
  TCMODULES += q_fq_codel.o
  TCMODULES += q_fq.o
  TCMODULES += q_pie.o


From lede-commits at lists.infradead.org  Fri Oct 13 15:35:35 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 18:35:35 -0400
Subject: [source]  kernel: bump 4.4 to 4.4.92
In-Reply-To: <20171013223535.26394.10425@git-01.infra.lede-project.org>
References: <20171013223535.26394.10425@git-01.infra.lede-project.org>
Message-ID: <mailman.54292.1507934170.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/f251a795f2cc6491dd48fe5c77ef57a34e6b46b3

commit f251a795f2cc6491dd48fe5c77ef57a34e6b46b3
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Thu Oct 12 20:06:34 2017 +0100

    kernel: bump 4.4 to 4.4.92
    
    No patch refresh changes required.
    
    Compile tested for: ar71xx Archer C7 v2
    Run tested: ar71xx Archer C7 v2
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 include/kernel-version.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index eb41da3..405e5fd 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,11 +3,11 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .71
-LINUX_VERSION-4.4 = .91
+LINUX_VERSION-4.4 = .92
 LINUX_VERSION-4.9 = .54
 
 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
-LINUX_KERNEL_HASH-4.4.91 = cb9d2b8c1afe58414de5bc7d65429cc9f5f37c80fc229d0e83c55c5c3c254ffb
+LINUX_KERNEL_HASH-4.4.92 = 53f8cd8b024444df0f242f8e6ab5147b0b009d7a30e8b2ed3854e8d17937460d
 LINUX_KERNEL_HASH-4.9.54 = 651005db6efbce4fcd607415ebd697dd8d2f5a2abc2c632b11ece03a1a210fc5
 
 ifdef KERNEL_PATCHVER


From lede-commits at lists.infradead.org  Fri Oct 13 15:35:37 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 18:35:37 -0400
Subject: [source]  at91: refresh kernel configuration
In-Reply-To: <20171013223535.26394.10425@git-01.infra.lede-project.org>
References: <20171013223535.26394.10425@git-01.infra.lede-project.org>
Message-ID: <mailman.54293.1507934170.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/c4f720b19a2699b577584f970254163853cea1d1

commit c4f720b19a2699b577584f970254163853cea1d1
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Oct 14 00:00:43 2017 +0200

    at91: refresh kernel configuration
    
    This was done by running "make kernel_oldconfig" and
    "make kernel_oldconfig CONFIG_TARGET=subtarget"
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/at91/config-4.4            |  5 ----
 target/linux/at91/legacy/config-default | 33 ------------------------
 target/linux/at91/sama5/config-default  | 45 +++++++++++++++++++++++++--------
 3 files changed, 35 insertions(+), 48 deletions(-)

diff --git a/target/linux/at91/config-4.4 b/target/linux/at91/config-4.4
index 4e3b036..526ef09 100644
--- a/target/linux/at91/config-4.4
+++ b/target/linux/at91/config-4.4
@@ -135,11 +135,6 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
 CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
 CONFIG_HAVE_MEMBLOCK=y
 CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
diff --git a/target/linux/at91/legacy/config-default b/target/linux/at91/legacy/config-default
index 12beb46..e69de29 100644
--- a/target/linux/at91/legacy/config-default
+++ b/target/linux/at91/legacy/config-default
@@ -1,33 +0,0 @@
-# CONFIG_ARCH_AT91RM9200 is not set
-# CONFIG_ARCH_AT91SAM9260 is not set
-# CONFIG_ARCH_AT91SAM9261 is not set
-# CONFIG_ARCH_AT91SAM9263 is not set
-# CONFIG_ARCH_AT91SAM9G10 is not set
-# CONFIG_ARCH_AT91SAM9G20 is not set
-# CONFIG_ARCH_AT91SAM9G45 is not set
-# CONFIG_ARCH_AT91SAM9RL is not set
-CONFIG_ARCH_AT91_NONE=y
-CONFIG_ARM_L1_CACHE_SHIFT=5
-CONFIG_CPU_32v5=y
-CONFIG_CPU_ABRT_EV5TJ=y
-CONFIG_CPU_ARM926T=y
-# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
-CONFIG_CPU_CACHE_VIVT=y
-CONFIG_CPU_COPY_V4WB=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
-# CONFIG_CPU_ICACHE_DISABLE is not set
-CONFIG_CPU_PABRT_LEGACY=y
-CONFIG_CPU_TLB_V4WBI=y
-# CONFIG_SOC_AT91RM9200 is not set
-CONFIG_SOC_AT91SAM9=y
-CONFIG_SOC_AT91SAM9260=y
-CONFIG_SOC_AT91SAM9261=y
-CONFIG_SOC_AT91SAM9263=y
-CONFIG_SOC_AT91SAM9G45=y
-CONFIG_SOC_AT91SAM9N12=y
-CONFIG_SOC_AT91SAM9RL=y
-CONFIG_SOC_AT91SAM9X5=y
-CONFIG_SOC_SAM_V4_V5=y
-# CONFIG_SOC_SAM_V7 is not set
diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
index 660e27e..aeb0b3c 100644
--- a/target/linux/at91/sama5/config-default
+++ b/target/linux/at91/sama5/config-default
@@ -1,20 +1,45 @@
-# CONFIG_ARCH_MULTI_V4_V5 is not set
-# CONFIG_ARCH_MULTI_V5 is not set
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+CONFIG_ARCH_MULTI_V6_V7=y
 CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARM_HEAVY_MB=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
 # CONFIG_ARM_LPAE is not set
 # CONFIG_ARM_THUMBEE is not set
-# CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_ATMEL_AIC5_IRQ=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
 # CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_SOC_SAMA5=y
-# CONFIG_SOC_SAM_V4_V5 is not set
-CONFIG_SOC_SAM_V7=y
-CONFIG_SOC_SAMA5D2=y
-CONFIG_SOC_SAMA5D3=y
-CONFIG_SOC_SAMA5D4=y
-CONFIG_MACH_SAMA5_DT=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_V7=y
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_GENERIC_PINCONF=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_HAVE_AT91_GENERATED_CLK=y
+CONFIG_HAVE_AT91_H32MX=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_HAVE_SMP=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+CONFIG_OUTER_CACHE=y
+CONFIG_OUTER_CACHE_SYNC=y
+CONFIG_PINCTRL_AT91PIO4=y
 CONFIG_PL310_ERRATA_588369=y
 CONFIG_PL310_ERRATA_727915=y
 CONFIG_PL310_ERRATA_753970=y
 CONFIG_PL310_ERRATA_769419=y
+CONFIG_SOC_SAMA5=y
+CONFIG_SOC_SAMA5D2=y
+CONFIG_SOC_SAMA5D3=y
+CONFIG_SOC_SAMA5D4=y
+CONFIG_SOC_SAM_V7=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_SWP_EMULATE is not set
 # CONFIG_THUMB2_KERNEL is not set


From lede-commits at lists.infradead.org  Fri Oct 13 15:35:38 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 18:35:38 -0400
Subject: [source]  at91bootstrap: Add BUILD_SUBTARGET variable
In-Reply-To: <20171013223535.26394.10425@git-01.infra.lede-project.org>
References: <20171013223535.26394.10425@git-01.infra.lede-project.org>
Message-ID: <mailman.54294.1507934175.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/cc443e894a1b01093f5abba0c2884eb64c2f1778

commit cc443e894a1b01093f5abba0c2884eb64c2f1778
Author: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
AuthorDate: Wed Oct 4 16:14:39 2017 -0700

    at91bootstrap: Add BUILD_SUBTARGET variable
    
    Added sama5 to BUILD_SUBTARGET variable.This will populate at91bootstrap
    menu options in bootloader menu only when SAMA5 devices are selected as
    SUBTARGET and to avoid showing up this menu when legacy device is
    selected as SUBTARGET and fixed typo mistake: sama5d3 -> sama5d2.
    
    Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 package/boot/at91bootstrap/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile
index ae60fad..4571fed 100644
--- a/package/boot/at91bootstrap/Makefile
+++ b/package/boot/at91bootstrap/Makefile
@@ -24,13 +24,14 @@ include $(INCLUDE_DIR)/package.mk
 
 define AT91Bootstrap/Default
   BUILD_TARGET:=at91
+  BUILD_SUBTARGET:=sama5
   AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin
 endef
 
 define at91bootstrap/sama5d2_xplaineddf_uboot
-  TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (SPI Flash)
+  TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SPI Flash)
   BUILD_SUBTARGET:=sama5
-  BUILD_DEVICES:=at91-sama5d3_xplained
+  BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
 define at91bootstrap/sama5d2_xplaineddf_qspi_uboot


From lede-commits at lists.infradead.org  Fri Oct 13 15:35:36 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 18:35:36 -0400
Subject: [source]  uboot-at91: multiple build fixes
In-Reply-To: <20171013223535.26394.10425@git-01.infra.lede-project.org>
References: <20171013223535.26394.10425@git-01.infra.lede-project.org>
Message-ID: <mailman.54297.1507934175.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/b4c357066695181864a9f9e91bb1bc5ef18e18c8

commit b4c357066695181864a9f9e91bb1bc5ef18e18c8
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Fri Oct 13 23:40:03 2017 +0200

    uboot-at91: multiple build fixes
    
    This fixes the following problems:
     * Add BUILD_DEVICES for legacy subtarget
     * Use features from u-boot.mk for sama5 subtarget This is mainly done
       by changing the prefix from uboot to U-Boot. This makes them depend
       on the sama5 subtarget and not selectable for the legacy subtarget
       any more
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/boot/uboot-at91/Makefile | 44 +++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile
index 8dc5e3e..7c420f1 100644
--- a/package/boot/uboot-at91/Makefile
+++ b/package/boot/uboot-at91/Makefile
@@ -23,51 +23,53 @@ endef
 define U-Boot/at91sam9m10g45ek_nandflash
   NAME:=AT91SAM9M10G45-EK board (NandFlash)
   BUILD_SUBTARGET:=legacy
+  BUILD_DEVICES:=at91sam9m10g45ek
 endef
 
 define U-Boot/at91sam9x5ek_nandflash
   NAME:=AT91SAM9X5-EK board (NandFlash)
   BUILD_SUBTARGET:=legacy
+  BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek
 endef
 
-define uboot/sama5d3_xplained_nandflash
-  TITLE:=U-Boot for the SAMA5D3 Xplained board (NandFlash)
+define U-Boot/sama5d3_xplained_nandflash
+  NAME:=SAMA5D3 Xplained board (NandFlash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
-define uboot/sama5d3_xplained_mmc
-  TITLE:=U-Boot for the SAMA5D3 Xplained board (SDcard)
+define U-Boot/sama5d3_xplained_mmc
+  NAME:=SAMA5D3 Xplained board (SDcard)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d3_xplained
 endef
 
-define uboot/sama5d2_xplained_spiflash
-  TITLE:=U-Boot for the SAMA5D2 Xplained board (SPI Flash)
+define U-Boot/sama5d2_xplained_spiflash
+  NAME:=SAMA5D2 Xplained board (SPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define uboot/sama5d2_xplained_mmc
-  TITLE:=U-Boot for the SAMA5D2 Xplained board (SDcard/EMMC)
+define U-Boot/sama5d2_xplained_mmc
+  NAME:=SAMA5D2 Xplained board (SDcard/EMMC)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d2_xplained
 endef
 
-define uboot/sama5d4_xplained_spiflash
-  TITLE:=U-Boot for the SAMA5D4 Xplained board (SPI Flash)
+define U-Boot/sama5d4_xplained_spiflash
+  NAME:=SAMA5D4 Xplained board (SPI Flash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
-define uboot/sama5d4_xplained_mmc
-  TITLE:=U-Boot for the SAMA5D4 Xplained board (SDcard)
+define U-Boot/sama5d4_xplained_mmc
+  NAME:=SAMA5D4 Xplained board (SDcard)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
 
-define uboot/sama5d4_xplained_nandflash
-  TITLE:=U-Boot for the SAMA5D4 Xplained board (NandFlash)
+define U-Boot/sama5d4_xplained_nandflash
+  NAME:=SAMA5D4 Xplained board (NandFlash)
   BUILD_SUBTARGET:=sama5
   BUILD_DEVICES:=at91-sama5d4_xplained
 endef
@@ -75,13 +77,13 @@ endef
 UBOOT_TARGETS := \
 	at91sam9m10g45ek_nandflash \
 	at91sam9x5ek_nandflash \
-    sama5d3_xplained_nandflash \
-    sama5d3_xplained_mmc \
-    sama5d2_xplained_mmc \
-    sama5d2_xplained_spiflash \
-    sama5d4_xplained_mmc \
-    sama5d4_xplained_spiflash \
-    sama5d4_xplained_nandflash
+	sama5d3_xplained_nandflash \
+	sama5d3_xplained_mmc \
+	sama5d2_xplained_mmc \
+	sama5d2_xplained_spiflash \
+	sama5d4_xplained_mmc \
+	sama5d4_xplained_spiflash \
+	sama5d4_xplained_nandflash
 
 define Build/Compile
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \


From lede-commits at lists.infradead.org  Fri Oct 13 15:35:39 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 18:35:39 -0400
Subject: [source]  at91bootstrap: remove manual copy of binaries to BIN_DIR
In-Reply-To: <20171013223535.26394.10425@git-01.infra.lede-project.org>
References: <20171013223535.26394.10425@git-01.infra.lede-project.org>
Message-ID: <mailman.54298.1507934185.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/0a919afae4e0056a70004484144f8ac5b0582c0b

commit 0a919afae4e0056a70004484144f8ac5b0582c0b
Author: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
AuthorDate: Wed Oct 4 16:14:40 2017 -0700

    at91bootstrap: remove manual copy of binaries to BIN_DIR
    
    removed copying of binaries to BIN_DIR during install and using
    default/install to install binaries to BIN_DIR folder.
    
    Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 package/boot/at91bootstrap/at91bootstrap.mk | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/package/boot/at91bootstrap/at91bootstrap.mk b/package/boot/at91bootstrap/at91bootstrap.mk
index 732d643..dda5fa4 100644
--- a/package/boot/at91bootstrap/at91bootstrap.mk
+++ b/package/boot/at91bootstrap/at91bootstrap.mk
@@ -1,6 +1,15 @@
 
+PKG_TARGETS := bin
+PKG_FLAGS:=nonshared
+
 export GCC_HONOUR_COPTS=s
 
+define Package/at91bootstrap/install/default
+  $(CP) $(PKG_BUILD_DIR)/binaries/*uboot* $(1)/
+endef
+
+Package/at91bootstrap/install = $(Package/at91bootstrap/install/default)
+
 define AT91Bootstrap/Init
   BUILD_TARGET:=
   BUILD_SUBTARGET:=
@@ -46,8 +55,7 @@ define Build/AT91Bootstrap/Target
   endef
 
   define Package/at91bootstrap-$(1)/install
-    $(CP) $(PKG_BUILD_DIR)/binaries/*uboot*.bin \
-      $(BIN_DIR)/at91bootstrap-$(1).bin
+    $$(Package/at91bootstrap/install)
   endef
 endef
 


From lede-commits at lists.infradead.org  Fri Oct 13 15:35:40 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 18:35:40 -0400
Subject: [source]  at91: Enable SDHCI for sama5 in default config
In-Reply-To: <20171013223535.26394.10425@git-01.infra.lede-project.org>
References: <20171013223535.26394.10425@git-01.infra.lede-project.org>
Message-ID: <mailman.54299.1507934185.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/43a0b72c3cb5d67169b4046b71a6bede0c83e0f4

commit 43a0b72c3cb5d67169b4046b71a6bede0c83e0f4
Author: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
AuthorDate: Fri Oct 13 10:21:50 2017 -0700

    at91: Enable SDHCI for sama5 in default config
    
    Enabled SDHCI for sama5 in kernel default config and this is needed
    to mount sdcard rootfs partition during boot.
    
    Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 target/linux/at91/sama5/config-default | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
index aeb0b3c..032a0cb 100644
--- a/target/linux/at91/sama5/config-default
+++ b/target/linux/at91/sama5/config-default
@@ -28,6 +28,10 @@ CONFIG_HAVE_AT91_H32MX=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_HAVE_SMP=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_IO_ACCESSORS=y
+CONFIG_MMC_SDHCI_OF_AT91=y
+CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_OUTER_CACHE=y
 CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PINCTRL_AT91PIO4=y


From lede-commits at lists.infradead.org  Fri Oct 13 15:35:41 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 18:35:41 -0400
Subject: [source]  at91: Add ext4 filesystem
In-Reply-To: <20171013223535.26394.10425@git-01.infra.lede-project.org>
References: <20171013223535.26394.10425@git-01.infra.lede-project.org>
Message-ID: <mailman.54300.1507934189.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/1b368f164131f21bb6870a1e75421d30e6acd0ac

commit 1b368f164131f21bb6870a1e75421d30e6acd0ac
Author: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
AuthorDate: Fri Oct 13 10:21:51 2017 -0700

    at91: Add ext4 filesystem
    
    Add ext4 filesystem for creating sdcard image with ext4 rootfs and
    removing ext2 as it superset of ext4.
    
    Signed-off-by: Sandeep Sheriker Mallikarjun <sandeepsheriker.mallikarjun at microchip.com>
---
 target/linux/at91/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
index 948419a..c4de685 100644
--- a/target/linux/at91/Makefile
+++ b/target/linux/at91/Makefile
@@ -10,7 +10,7 @@ ARCH:=arm
 BOARD:=at91
 MAINTAINER:=Claudio Mignanti <c.mignanti at gmail.com>
 BOARDNAME:=Microchip (Atmel AT91)
-FEATURES:=squashfs targz ext2 usb usbgadget ubifs
+FEATURES:=ext4 squashfs targz usb usbgadget ubifs
 SUBTARGETS:=sama5 legacy
 
 KERNEL_PATCHVER:=4.4


From lede-commits at lists.infradead.org  Fri Oct 13 16:25:50 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 19:25:50 -0400
Subject: [source]  mpc85xx: Enable initramfs for p1020 subtarget
In-Reply-To: <20171013232550.4579.75832@git-01.infra.lede-project.org>
References: <20171013232550.4579.75832@git-01.infra.lede-project.org>
Message-ID: <mailman.54305.1507937180.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/a92f73e922e259fca4b357f402dd0bffe79f0bab

commit a92f73e922e259fca4b357f402dd0bffe79f0bab
Author: Chris Blake <chrisrblake93 at gmail.com>
AuthorDate: Sat Sep 30 11:13:35 2017 -0500

    mpc85xx: Enable initramfs for p1020 subtarget
    
    The following patch enables building of initramfs images by default for
    the P1020 subtarget in mpc85xx.
    
    Signed-off-by: Chris Blake <chrisrblake93 at gmail.com>
---
 config/Config-images.in              | 1 +
 target/linux/mpc85xx/p1020/target.mk | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 55aff7d..6076591 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -17,6 +17,7 @@ menu "Target Images"
 			default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ar71xx
 			default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
 			default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
+			default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
 			default TARGET_INITRAMFS_COMPRESSION_NONE
 			depends on TARGET_ROOTFS_INITRAMFS
 			help
diff --git a/target/linux/mpc85xx/p1020/target.mk b/target/linux/mpc85xx/p1020/target.mk
index c111d7a..5d84d83 100644
--- a/target/linux/mpc85xx/p1020/target.mk
+++ b/target/linux/mpc85xx/p1020/target.mk
@@ -1,6 +1,6 @@
 BOARDNAME:=P1020
+FEATURES += ramdisk
 
 define Target/Description
 	Build firmware images for Freescale P1020 based boards.
 endef
-


From lede-commits at lists.infradead.org  Fri Oct 13 16:25:51 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 13 Oct 2017 19:25:51 -0400
Subject: [source]  mpc85xx: Add cmdline override patch
In-Reply-To: <20171013232550.4579.75832@git-01.infra.lede-project.org>
References: <20171013232550.4579.75832@git-01.infra.lede-project.org>
Message-ID: <mailman.54306.1507937180.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/8cd6686ef81effb3c30f0508368db3d0600f289d

commit 8cd6686ef81effb3c30f0508368db3d0600f289d
Author: Chris Blake <chrisrblake93 at gmail.com>
AuthorDate: Sat Sep 30 11:14:20 2017 -0500

    mpc85xx: Add cmdline override patch
    
    This patch adds a new kernel option called CONFIG_CMDLINE_OVERRIDE. This
    setting is for devices with locked down u-boot environments, where users
    are unable to change the default bootargs. When set, the fdt driver will
    propagate the cmdline for the kernel from chosen/bootargs-override
    instead of chosen/bootargs as long as it exists within the DTB.
    
    Signed-off-by: Chris Blake <chrisrblake93 at gmail.com>
---
 target/linux/mpc85xx/config-4.9                    |  1 +
 .../102-powerpc-add-cmdline-override.patch         | 37 ++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/target/linux/mpc85xx/config-4.9 b/target/linux/mpc85xx/config-4.9
index 64ab239..9086ba9 100644
--- a/target/linux/mpc85xx/config-4.9
+++ b/target/linux/mpc85xx/config-4.9
@@ -37,6 +37,7 @@ CONFIG_CLONE_BACKWARDS=y
 CONFIG_CLZ_TAB=y
 CONFIG_CMDLINE="console=ttyS0,115200"
 CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE_OVERRIDE=y
 # CONFIG_CORENET_GENERIC is not set
 # CONFIG_CPM2 is not set
 CONFIG_CPU_BIG_ENDIAN=y
diff --git a/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch b/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch
new file mode 100644
index 0000000..3d59927
--- /dev/null
+++ b/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch
@@ -0,0 +1,37 @@
+--- a/arch/powerpc/Kconfig
++++ b/arch/powerpc/Kconfig
+@@ -707,6 +707,14 @@ config CMDLINE_FORCE
+ 	  This is useful if you cannot or don't want to change the
+ 	  command-line options your boot loader passes to the kernel.
+ 
++config CMDLINE_OVERRIDE
++	bool "Use alternative cmdline from device tree"
++	help
++	  Some bootloaders may have uneditable bootargs. While CMDLINE_FORCE can
++	  be used, this is not a good option for kernels that are shared across
++	  devices. This setting enables using "chosen/cmdline-override" as the
++	  cmdline if it exists in the device tree.
++
+ config EXTRA_TARGETS
+ 	string "Additional default image types"
+ 	help
+--- a/drivers/of/fdt.c
++++ b/drivers/of/fdt.c
+@@ -1079,6 +1079,17 @@ int __init early_init_dt_scan_chosen(uns
+ 	if (p != NULL && l > 0)
+ 		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
+ 
++	/* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different
++	 * device tree option of chosen/bootargs-override. This is
++	 * helpful on boards where u-boot sets bootargs, and is unable
++	 * to be modified.
++	 */
++#ifdef CONFIG_CMDLINE_OVERRIDE
++	p = of_get_flat_dt_prop(node, "bootargs-override", &l);
++	if (p != NULL && l > 0)
++		strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
++#endif
++
+ 	/*
+ 	 * CONFIG_CMDLINE is meant to be a default in case nothing else
+ 	 * managed to set the command line, unless CONFIG_CMDLINE_FORCE


From lede-commits at lists.infradead.org  Sat Oct 14 11:24:08 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 14:24:08 -0400
Subject: [source]  busybox: provide "ip"
In-Reply-To: <20171014182408.6082.13702@git-01.infra.lede-project.org>
References: <20171014182408.6082.13702@git-01.infra.lede-project.org>
Message-ID: <mailman.54376.1508005482.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/1cec4d4ef0145b48094ec0df40c18b8fbb315cf0

commit 1cec4d4ef0145b48094ec0df40c18b8fbb315cf0
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sat Oct 14 20:13:29 2017 +0200

    busybox: provide "ip"
    
    Let busybox provide "ip" as it supports the ip applets link, address,
    route, rule and neighbor
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/utils/busybox/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 941e828..35f63d9 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -47,6 +47,7 @@ define Package/busybox
   URL:=http://busybox.net/
   DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter
   MENU:=1
+  PROVIDES:=ip
   ALTERNATIVES:=\
     $(call BUSYBOX_IF_ENABLED,KILL,	100:/bin/kill:/bin/busybox) \
     $(call BUSYBOX_IF_ENABLED,PS,	100:/bin/ps:/bin/busybox) \


From lede-commits at lists.infradead.org  Sat Oct 14 16:11:48 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 19:11:48 -0400
Subject: [source] at91: separate MKUBIFS opts to defaults in the sub target
In-Reply-To: <20171014231146.22260.40585@git-01.infra.lede-project.org>
References: <20171014231146.22260.40585@git-01.infra.lede-project.org>
Message-ID: <mailman.54383.1508022865.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/a7c8112a0ff609e85bfd58e21efec6322f946285

commit a7c8112a0ff609e85bfd58e21efec6322f946285
Author: Ben Whitten <ben.whitten at gmail.com>
AuthorDate: Thu Jun 1 23:04:52 2017 +0100

    at91: separate MKUBIFS opts to defaults in the sub target
    
    Instead of applying global defaults based on selected board, transition
    to using a per board setting for UBIFS and UBINIZE.
    
    Signed-off-by: Ben Whitten <ben.whitten at gmail.com>
---
 target/linux/at91/image/Makefile  | 12 +-----------
 target/linux/at91/image/legacy.mk |  7 +++++++
 target/linux/at91/image/sama5.mk  | 12 ++++++++++--
 3 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile
index 9333709..db480ac 100644
--- a/target/linux/at91/image/Makefile
+++ b/target/linux/at91/image/Makefile
@@ -11,29 +11,19 @@ KERNEL_LOADADDR := 0x20008000
 
 ifeq ($(SUBTARGET),legacy)
 include ./legacy.mk
-UBIFS_OPTS := -m 2048 -e 126KiB -c 2048
 endif
-
 ifeq ($(SUBTARGET),sama5)
 include ./sama5.mk
-ifeq ($(TARGET_DEVICES),at91-sama5d4_xplained)
-  UBIFS_OPTS := -e 0x3e000 -c 2082 -m 0x1000 -x lzo
-  UBINIZE_OPTS := -m 0x1000 -p 0x40000
-else
-  UBIFS_OPTS := -m 2048 -e 124KiB -c 2048
-endif
 endif
 
 define Device/Default
+  $(Device/default-nand)
   PROFILES := Default
   FILESYSTEMS := squashfs ubifs
   DEVICE_DTS := $(1)
   KERNEL_NAME := zImage
   KERNEL_SIZE := 4096k
   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
-  BLOCKSIZE := 128k
-  PAGESIZE := 2048
-  SUBPAGESIZE := 512
   DTB_SIZE :=
 endef
 
diff --git a/target/linux/at91/image/legacy.mk b/target/linux/at91/image/legacy.mk
index 7fe3881..be8c2db 100644
--- a/target/linux/at91/image/legacy.mk
+++ b/target/linux/at91/image/legacy.mk
@@ -1,3 +1,10 @@
+define Device/default-nand
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  SUBPAGESIZE := 512
+  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 126KiB -c 2048
+endef
+
 define Device/at91sam9263ek
   $(Device/evaluation-dtb)
   DEVICE_TITLE := Atmel AT91SAM9263-EK
diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk
index 580b51e..1c779ca 100644
--- a/target/linux/at91/image/sama5.mk
+++ b/target/linux/at91/image/sama5.mk
@@ -1,8 +1,14 @@
+define Device/default-nand
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  SUBPAGESIZE := 2048
+  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048
+endef
+
 define Device/at91-sama5d3_xplained
   $(Device/evaluation-dtb)
   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained
   KERNEL_SIZE := 6144k
-  SUBPAGESIZE := 2048
 endef
 TARGET_DEVICES += at91-sama5d3_xplained
 
@@ -10,7 +16,6 @@ define Device/at91-sama5d2_xplained
   $(Device/evaluation-dtb)
   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained
   KERNEL_SIZE := 6144k
-  SUBPAGESIZE := 2048
 endef
 TARGET_DEVICES += at91-sama5d2_xplained
 
@@ -18,6 +23,9 @@ define Device/at91-sama5d4_xplained
   $(Device/evaluation-dtb)
   DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained
   KERNEL_SIZE := 6144k
+  BLOCKSIZE := 256k
+  PAGESIZE := 4096
   SUBPAGESIZE := 2048
+  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 -x lzo
 endef
 TARGET_DEVICES += at91-sama5d4_xplained


From lede-commits at lists.infradead.org  Sat Oct 14 16:11:47 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 19:11:47 -0400
Subject: [source]  at91: refresh kernel config, enable UBI block and DMA
In-Reply-To: <20171014231146.22260.40585@git-01.infra.lede-project.org>
References: <20171014231146.22260.40585@git-01.infra.lede-project.org>
Message-ID: <mailman.54384.1508022865.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/3b6f9978d32e3922cfd68c811a9b0f41997743bf

commit 3b6f9978d32e3922cfd68c811a9b0f41997743bf
Author: Ben Whitten <ben.whitten at gmail.com>
AuthorDate: Mon Sep 18 13:09:21 2017 +0100

    at91: refresh kernel config, enable UBI block and DMA
    
    The platform generates squashfs images in a UBI block but misses the
    kernel module to be able to mount the block.
    DMA is also enabled to allow systems which include them in the DTS to
    use it.
    
    Signed-off-by: Ben Whitten <ben.whitten at gmail.com>
---
 target/linux/at91/config-4.4 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/target/linux/at91/config-4.4 b/target/linux/at91/config-4.4
index 526ef09..d90f0e7 100644
--- a/target/linux/at91/config-4.4
+++ b/target/linux/at91/config-4.4
@@ -39,6 +39,8 @@ CONFIG_ATMEL_AIC_IRQ=y
 CONFIG_ATMEL_PIT=y
 CONFIG_ATMEL_SDRAMC=y
 # CONFIG_ATMEL_TCLIB is not set
+CONFIG_AT_HDMAC=y
+# CONFIG_AT_XDMAC is not set
 CONFIG_AUTO_ZRELADDR=y
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CACHE_L2X0 is not set
@@ -76,6 +78,9 @@ CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 # CONFIG_DEBUG_UART_8250 is not set
 # CONFIG_DEBUG_USER is not set
 CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_OF=y
 CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
@@ -181,7 +186,7 @@ CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
-# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_MTD_UBI_BLOCK=y
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
 CONFIG_MTD_UBI_WL_THRESHOLD=4096


From lede-commits at lists.infradead.org  Sat Oct 14 16:11:51 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 19:11:51 -0400
Subject: [source]  at91: add support for the WB45N module from Laird
In-Reply-To: <20171014231146.22260.40585@git-01.infra.lede-project.org>
References: <20171014231146.22260.40585@git-01.infra.lede-project.org>
Message-ID: <mailman.54385.1508022869.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/86d037e4a27fcf8f465fb1e79db727995ad5c684

commit 86d037e4a27fcf8f465fb1e79db727995ad5c684
Author: Ben Whitten <ben.whitten at gmail.com>
AuthorDate: Fri Jun 10 20:07:32 2016 +0100

    at91: add support for the WB45N module from Laird
    
    This module from Laird includes the following:
      - CPU Atmel SoC ARM926EJS
      - Wifi AR6003
      - Bluetooth CSR8510
      - RAM 64MB LPDDR
      - FLASH 128MB
    
    The flash is a dual image layout, kernel a/b, rootfs a/b, and a user
    partition.
    
    Signed-off-by: Ben Whitten <ben.whitten at gmail.com>
---
 .../linux/at91/files/arch/arm/boot/dts/wb45n.dts   | 220 +++++++++++++++++++++
 target/linux/at91/image/Makefile                   |   6 +
 target/linux/at91/image/legacy.mk                  |  15 ++
 .../102-ARM-at91-build-dtb-for-wb45n.patch         |  12 ++
 4 files changed, 253 insertions(+)

diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts
new file mode 100644
index 0000000..2d1fe0c
--- /dev/null
+++ b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts
@@ -0,0 +1,220 @@
+/*
+ * wb45n.dts - Device Tree file for WB45NBT board
+ *
+ *  Copyright (C) 2015 Laird
+ *
+ * Licensed under GPLv2 or later.
+ */
+/dts-v1/;
+#include "at91sam9g25.dtsi"
+
+/ {
+	model = "Laird Workgroup Bridge 45N - Atmel AT91SAM (dt)";
+	compatible = "laird,wb45n", "laird,wbxx", "atmel,at91sam9x5", "atmel,at91sam9";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs";
+	};
+
+	memory {
+		reg = <0x20000000 0x4000000>;
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		main_clock: clock at 0 {
+			compatible = "atmel,osc", "fixed-clock";
+			clock-frequency = <12000000>;
+		};
+
+		slow_xtal {
+			clock-frequency = <32768>;
+		};
+
+		main_xtal {
+			clock-frequency = <12000000>;
+		};
+	};
+
+	ahb {
+		apb {
+
+			rstc at fffffe00 {
+				compatible = "atmel,sama5d3-rstc";
+			};
+
+			pinctrl at fffff400 {
+				nand {
+					pinctrl_nand: nand-0 {
+						atmel,pins =
+							<AT91_PIOD 0 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PD0 periph A Read Enable */
+							 AT91_PIOD 1 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PD1 periph A Write Enable */
+							 AT91_PIOD 2 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PD2 periph A Address Latch Enable */
+							 AT91_PIOD 3 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PD3 periph A Command Latch Enable */
+							 AT91_PIOD 4 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP	/* PD4 gpio Chip Enable pin pull_up */
+							 AT91_PIOD 5 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;  /* PD5 gpio RDY/BUSY pin pull_up */
+					};
+				};
+
+				usb2 {
+					pinctrl_board_usb2: usb2-board {
+						atmel,pins =
+							<AT91_PIOB 11 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;		/* PB11 gpio vbus sense, deglitch */
+					};
+				};
+			};
+
+			dbgu: serial at fffff200 {
+				status = "okay";
+			};
+
+			usart0: serial at f801c000 {
+				status = "okay";
+			};
+
+			usart3: serial at f8028000 {
+				status = "okay";
+			};
+
+			spi0: spi at f0000000 {
+				status = "okay";
+				cs-gpios = <&pioA 14 0>, <&pioA 7 0>, <0>, <0>;
+			};
+
+			mmc0: mmc at f0008000 {
+				pinctrl-0 = <
+					&pinctrl_mmc0_slot0_clk_cmd_dat0
+					&pinctrl_mmc0_slot0_dat1_3>;
+				status = "okay";
+				/delete-property/dmas;
+				/delete-property/dma-names;
+				slot at 0 {
+					reg = <0>;
+					bus-width = <4>;
+				};
+			};
+
+			macb0: ethernet at f802c000 {
+				phy-mode = "rmii";
+				status = "okay";
+			};
+
+			usb2: gadget at f803c000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_board_usb2>;
+				atmel,vbus-gpio = <&pioB 11 GPIO_ACTIVE_HIGH>;
+				status = "okay";
+			};
+
+			i2c1: i2c at f8014000 {
+				status = "okay";
+			};
+
+			watchdog at fffffe40 {
+				status = "okay";
+			};
+
+			shdwc at fffffe10 {
+				atmel,wakeup-mode = "low";
+			};
+
+			rtc at fffffeb0 {
+				status = "okay";
+			};
+		};
+
+		usb0: ohci at 00600000 {
+			status = "okay";
+			num-ports = <2>;
+			atmel,vbus-gpio = <
+					   &pioB 12 GPIO_ACTIVE_HIGH
+					   &pioA 31 GPIO_ACTIVE_HIGH
+					  >;
+			atmel,oc-gpio = <&pioB 13 GPIO_ACTIVE_LOW>;
+		};
+
+		usb1: ehci at 00700000 {
+			status = "okay";
+		};
+
+		nand0: nand at 40000000 {
+			nand-bus-width = <8>;
+			nand-ecc-mode = "hw";
+			atmel,has-pmecc;	/* Enable PMECC */
+			atmel,pmecc-cap = <4>;
+			atmel,pmecc-sector-size = <512>;
+			nand-on-flash-bbt;
+			status = "okay";
+
+			at91bootstrap at 0 {
+				label = "at91bs";
+				reg = <0x0 0x20000>;
+			};
+
+			uboot at 20000 {
+				label = "u-boot";
+				reg = <0x20000 0x80000>;
+			};
+
+			ubootenv at a0000 {
+				label = "u-boot-env";
+				reg = <0xa0000 0x20000>;
+			};
+
+			ubootenv at c0000 {
+				label = "redund-env";
+				reg = <0xc0000 0x20000>;
+			};
+
+			kernel-a at e0000 {
+				label = "kernel-a";
+				reg = <0xe0000 0x280000>;
+			};
+
+			kernel-b at 360000 {
+				label = "kernel-b";
+				reg = <0x360000 0x280000>;
+			};
+
+			rootfs-a at 5e0000 {
+				label = "rootfs-a";
+				reg = <0x5e0000 0x2600000>;
+			};
+
+			rootfs-b at 2be0000 {
+				label = "rootfs-b";
+				reg = <0x2be0000 0x2600000>;
+			};
+
+			user at 51e0000 {
+				label = "user";
+				reg = <0x51e0000 0x2dc0000>;
+			};
+
+			logs at 7fa0000 {
+				label = "logs";
+				reg = <0x7fa0000 0x60000>;
+			};
+		};
+	};
+
+	atheros {
+		compatible = "atheros,ath6kl";
+		atheros,board-id = "SD32";
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		irqbtn at pb18 {
+			label = "IRQBTN";
+			linux,code = <99>;
+			gpios = <&pioB 18 GPIO_ACTIVE_LOW>;
+			gpio-key,wakeup = <1>;
+		};
+	};
+};
diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile
index db480ac..fedefe4 100644
--- a/target/linux/at91/image/Makefile
+++ b/target/linux/at91/image/Makefile
@@ -51,6 +51,12 @@ define Device/evaluation-dtb
   IMAGE/dtb := install-dtb
 endef
 
+define Device/evaluation-fit
+  $(Device/evaluation)
+  KERNEL_SUFFIX := -fit-uImage.itb
+  KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
+endef
+
 define Device/production
   UBINIZE_OPTS := -E 5
   IMAGES := factory.bin
diff --git a/target/linux/at91/image/legacy.mk b/target/linux/at91/image/legacy.mk
index be8c2db..c6d9ed8 100644
--- a/target/linux/at91/image/legacy.mk
+++ b/target/linux/at91/image/legacy.mk
@@ -116,3 +116,18 @@ define Device/at91-q5xr5
   KERNEL_SIZE := 2048k
 endef
 TARGET_DEVICES += at91-q5xr5
+
+define Device/wb45n
+  $(Device/evaluation-fit)
+  DEVICE_TITLE := Laird WB45N
+  DEVICE_PACKAGES := \
+	kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
+	kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
+	kmod-leds-gpio
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  SUBPAGESIZE := 2048
+  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
+endef
+TARGET_DEVICES += wb45n
+
diff --git a/target/linux/at91/patches-4.4/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-4.4/102-ARM-at91-build-dtb-for-wb45n.patch
new file mode 100644
index 0000000..b748662
--- /dev/null
+++ b/target/linux/at91/patches-4.4/102-ARM-at91-build-dtb-for-wb45n.patch
@@ -0,0 +1,12 @@
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -40,7 +40,8 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \
+ 	at91sam9g25ek.dtb \
+ 	at91sam9g35ek.dtb \
+ 	at91sam9x25ek.dtb \
+-	at91sam9x35ek.dtb
++	at91sam9x35ek.dtb \
++	wb45n.dtb
+ dtb-$(CONFIG_SOC_SAM_V7) += \
+ 	at91-kizbox2.dtb \
+ 	at91-sama5d2_xplained.dtb \


From lede-commits at lists.infradead.org  Sat Oct 14 16:11:49 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 19:11:49 -0400
Subject: [source]  linux-firmware: add ath6k firmware to package
In-Reply-To: <20171014231146.22260.40585@git-01.infra.lede-project.org>
References: <20171014231146.22260.40585@git-01.infra.lede-project.org>
Message-ID: <mailman.54386.1508022869.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/76662637fadba33d698c60f754e67645edf3ce50

commit 76662637fadba33d698c60f754e67645edf3ce50
Author: Ben Whitten <ben.whitten at gmail.com>
AuthorDate: Sun Jun 19 23:49:16 2016 +0100

    linux-firmware: add ath6k firmware to package
    
    Systems which include the ath6k chipset need to have the firmware included
    in the image.
    
    Signed-off-by: Ben Whitten <ben.whitten at gmail.com>
---
 package/firmware/linux-firmware/qca.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/firmware/linux-firmware/qca.mk b/package/firmware/linux-firmware/qca.mk
index 7ad27ef..0a809d1 100644
--- a/package/firmware/linux-firmware/qca.mk
+++ b/package/firmware/linux-firmware/qca.mk
@@ -7,6 +7,16 @@ define Package/ar3k-firmware/install
 endef
 $(eval $(call BuildPackage,ar3k-firmware))
 
+
+Package/ath6k-firmware = $(call Package/firmware-default,AR600X firmware)
+define Package/ath6k-firmware/install
+	$(INSTALL_DIR) $(1)/lib/firmware/ath6k
+	$(CP) \
+		$(PKG_BUILD_DIR)/ath6k/* \
+		$(1)/lib/firmware/ath6k
+endef
+$(eval $(call BuildPackage,ath6k-firmware))
+
 Package/ath9k-htc-firmware = $(call Package/firmware-default,AR9271/AR7010 firmware)
 define Package/ath9k-htc-firmware/install
 	$(INSTALL_DIR) $(1)/lib/firmware/ath9k_htc


From lede-commits at lists.infradead.org  Sat Oct 14 16:11:50 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 19:11:50 -0400
Subject: [source]  mac80211: add ath6kl kernel modules
In-Reply-To: <20171014231146.22260.40585@git-01.infra.lede-project.org>
References: <20171014231146.22260.40585@git-01.infra.lede-project.org>
Message-ID: <mailman.54387.1508022869.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/618ed77a17422a9e167aed1eeec23a70235d0048

commit 618ed77a17422a9e167aed1eeec23a70235d0048
Author: Ben Whitten <ben.whitten at gmail.com>
AuthorDate: Tue Dec 1 17:42:39 2015 +0000

    mac80211: add ath6kl kernel modules
    
    Allow board to include the ath6kl kernel modules.
    
    Signed-off-by: Ben Whitten <ben.whitten at gmail.com>
---
 package/kernel/mac80211/Makefile | 49 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 47 insertions(+), 2 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 424b2ca..c0a4300 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -24,7 +24,7 @@ PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_DRIVERS = \
 	adm8211 \
 	airo \
-	ath ath5k ath9k ath9k-common ath9k-htc ath10k \
+	ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k \
 	b43 b43legacy \
 	carl9170 \
 	hermes hermes-pci hermes-pcmcia hermes-plx\
@@ -217,6 +217,43 @@ define KernelPackage/ath5k/description
  Atheros 5xxx chipset.
 endef
 
+define KernelPackage/ath6kl
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb)
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
+  HIDDEN:=1
+  DEPENDS+= +kmod-ath + at DRIVER_11N_SUPPORT + at KERNEL_RELAY
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko
+endef
+
+define KernelPackage/ath6kl-sdio
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11n SDIO wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
+  DEPENDS+= +kmod-mmc +kmod-ath6kl
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko
+  AUTOLOAD:=$(call AutoProbe,ath6kl_sdio)
+endef
+
+define KernelPackage/ath6kl-sdio/description
+This module adds support for wireless adapters based on
+Atheros IEEE 802.11n AR6003 and AR6004 family of chipsets.
+endef
+
+define KernelPackage/ath6kl-usb
+  $(call KernelPackage/mac80211/Default)
+  TITLE:=Atheros 802.11n USB wireless cards support
+  URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
+  DEPENDS+= @USB_SUPPORT +kmod-ath6kl
+  FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko
+  AUTOLOAD:=$(call AutoProbe,ath6kl_usb)
+endef
+
+define KernelPackage/ath6kl-usb/description
+This module adds support for wireless adapters based on the
+Atheros IEEE 802.11n AR6004 chipset.
+endef
+
 define KernelPackage/ath9k-common
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
@@ -1513,7 +1550,8 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
 	ATH9K_HTC_DEBUGFS \
 	ATH10K_DEBUGFS \
 	CARL9170_DEBUGFS \
-	ATH5K_DEBUG
+	ATH5K_DEBUG \
+	ATH6KL_DEBUG
 endif
 
 ifdef CONFIG_PACKAGE_MAC80211_TRACING
@@ -1554,6 +1592,10 @@ else
   config-y += ATH5K_PCI
 endif
 
+config-$(call config_package,ath6kl) += ATH6KL
+config-$(call config_package,ath6kl-sdio) += ATH6KL_SDIO
+config-$(call config_package,ath6kl-usb) += ATH6KL_USB
+
 config-$(call config_package,carl9170) += CARL9170
 
 config-$(call config_package,b43) += B43
@@ -1795,6 +1837,9 @@ $(eval $(call KernelPackage,airo))
 $(eval $(call KernelPackage,ath))
 $(eval $(call KernelPackage,ath10k))
 $(eval $(call KernelPackage,ath5k))
+$(eval $(call KernelPackage,ath6kl))
+$(eval $(call KernelPackage,ath6kl-sdio))
+$(eval $(call KernelPackage,ath6kl-usb))
 $(eval $(call KernelPackage,ath9k))
 $(eval $(call KernelPackage,ath9k-common))
 $(eval $(call KernelPackage,ath9k-htc))


From lede-commits at lists.infradead.org  Sat Oct 14 16:11:46 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 19:11:46 -0400
Subject: [source] sunxi: backport support for Allwinner Security System PRNG
In-Reply-To: <20171014231146.22260.40585@git-01.infra.lede-project.org>
References: <20171014231146.22260.40585@git-01.infra.lede-project.org>
Message-ID: <mailman.54390.1508022869.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/b4fefe7b6e638815ea88b235187ab7abd5f148c3

commit b4fefe7b6e638815ea88b235187ab7abd5f148c3
Author: Lucian Cristian <lucian.cristian at gmail.com>
AuthorDate: Sun Oct 1 18:29:22 2017 +0300

    sunxi: backport support for Allwinner Security System PRNG
    
    Signed-off-by: Lucian Cristian <lucian.cristian at gmail.com>
---
 target/linux/sunxi/cortexa7/config-default         |   1 +
 target/linux/sunxi/cortexa8/config-default         |   1 +
 ...sun4i-ss_support_the_Security_System_PRNG.patch | 206 +++++++++++++++++++++
 3 files changed, 208 insertions(+)

diff --git a/target/linux/sunxi/cortexa7/config-default b/target/linux/sunxi/cortexa7/config-default
index fe974c1..1491298 100644
--- a/target/linux/sunxi/cortexa7/config-default
+++ b/target/linux/sunxi/cortexa7/config-default
@@ -1,4 +1,5 @@
 CONFIG_DWMAC_SUN8I=y
+CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG=y
 # CONFIG_MACH_SUN4I is not set
 # CONFIG_MACH_SUN5I is not set
 # CONFIG_PINCTRL_GR8 is not set
diff --git a/target/linux/sunxi/cortexa8/config-default b/target/linux/sunxi/cortexa8/config-default
index fa40deb..93e4895 100644
--- a/target/linux/sunxi/cortexa8/config-default
+++ b/target/linux/sunxi/cortexa8/config-default
@@ -1,6 +1,7 @@
 # CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
 # CONFIG_ARM_ERRATA_643719 is not set
 # CONFIG_ARM_LPAE is not set
+CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG=y
 # CONFIG_MACH_SUN6I is not set
 # CONFIG_MACH_SUN7I is not set
 # CONFIG_MACH_SUN8I is not set
diff --git a/target/linux/sunxi/patches-4.9/0054-crypto-sun4i-ss_support_the_Security_System_PRNG.patch b/target/linux/sunxi/patches-4.9/0054-crypto-sun4i-ss_support_the_Security_System_PRNG.patch
new file mode 100644
index 0000000..f2bac1f
--- /dev/null
+++ b/target/linux/sunxi/patches-4.9/0054-crypto-sun4i-ss_support_the_Security_System_PRNG.patch
@@ -0,0 +1,206 @@
+From b8ae5c7387ad075ee61e8c8774ce2bca46bc9236 Mon Sep 17 00:00:00 2001
+From: Corentin LABBE <clabbe.montjoie at gmail.com>
+Date: Mon, 3 Jul 2017 20:48:48 +0200
+Subject: crypto: sun4i-ss - support the Security System PRNG
+
+The Security System has a PRNG, this patch adds support for it via
+crypto_rng.
+
+Signed-off-by: Corentin Labbe <clabbe.montjoie at gmail.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+---
+ drivers/crypto/Kconfig                  |  8 +++++
+ drivers/crypto/sunxi-ss/Makefile        |  1 +
+ drivers/crypto/sunxi-ss/sun4i-ss-core.c | 30 ++++++++++++++++++
+ drivers/crypto/sunxi-ss/sun4i-ss-prng.c | 56 +++++++++++++++++++++++++++++++++
+ drivers/crypto/sunxi-ss/sun4i-ss.h      | 11 +++++++
+ 5 files changed, 106 insertions(+)
+ create mode 100644 drivers/crypto/sunxi-ss/sun4i-ss-prng.c
+
+--- a/drivers/crypto/Kconfig
++++ b/drivers/crypto/Kconfig
+@@ -538,6 +538,14 @@ config CRYPTO_DEV_SUN4I_SS
+ 	  To compile this driver as a module, choose M here: the module
+ 	  will be called sun4i-ss.
+ 
++config CRYPTO_DEV_SUN4I_SS_PRNG
++	bool "Support for Allwinner Security System PRNG"
++	depends on CRYPTO_DEV_SUN4I_SS
++	select CRYPTO_RNG
++	help
++	  Select this option if you want to provide kernel-side support for
++	  the Pseudo-Random Number Generator found in the Security System.
++
+ config CRYPTO_DEV_ROCKCHIP
+ 	tristate "Rockchip's Cryptographic Engine driver"
+ 	depends on OF && ARCH_ROCKCHIP
+--- a/drivers/crypto/sunxi-ss/Makefile
++++ b/drivers/crypto/sunxi-ss/Makefile
+@@ -1,2 +1,3 @@
+ obj-$(CONFIG_CRYPTO_DEV_SUN4I_SS) += sun4i-ss.o
+ sun4i-ss-y += sun4i-ss-core.o sun4i-ss-hash.o sun4i-ss-cipher.o
++sun4i-ss-$(CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG) += sun4i-ss-prng.o
+--- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c
++++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
+@@ -214,6 +214,23 @@ static struct sun4i_ss_alg_template ss_a
+ 		}
+ 	}
+ },
++#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG
++{
++	.type = CRYPTO_ALG_TYPE_RNG,
++	.alg.rng = {
++		.base = {
++			.cra_name		= "stdrng",
++			.cra_driver_name	= "sun4i_ss_rng",
++			.cra_priority		= 300,
++			.cra_ctxsize		= 0,
++			.cra_module		= THIS_MODULE,
++		},
++		.generate               = sun4i_ss_prng_generate,
++		.seed                   = sun4i_ss_prng_seed,
++		.seedsize               = SS_SEED_LEN / BITS_PER_BYTE,
++	}
++},
++#endif
+ };
+ 
+ static int sun4i_ss_probe(struct platform_device *pdev)
+@@ -356,6 +373,13 @@ static int sun4i_ss_probe(struct platfor
+ 				goto error_alg;
+ 			}
+ 			break;
++		case CRYPTO_ALG_TYPE_RNG:
++			err = crypto_register_rng(&ss_algs[i].alg.rng);
++			if (err) {
++				dev_err(ss->dev, "Fail to register %s\n",
++					ss_algs[i].alg.rng.base.cra_name);
++			}
++			break;
+ 		}
+ 	}
+ 	platform_set_drvdata(pdev, ss);
+@@ -370,6 +394,9 @@ error_alg:
+ 		case CRYPTO_ALG_TYPE_AHASH:
+ 			crypto_unregister_ahash(&ss_algs[i].alg.hash);
+ 			break;
++		case CRYPTO_ALG_TYPE_RNG:
++			crypto_unregister_rng(&ss_algs[i].alg.rng);
++			break;
+ 		}
+ 	}
+ 	if (ss->reset)
+@@ -394,6 +421,9 @@ static int sun4i_ss_remove(struct platfo
+ 		case CRYPTO_ALG_TYPE_AHASH:
+ 			crypto_unregister_ahash(&ss_algs[i].alg.hash);
+ 			break;
++		case CRYPTO_ALG_TYPE_RNG:
++			crypto_unregister_rng(&ss_algs[i].alg.rng);
++			break;
+ 		}
+ 	}
+ 
+--- /dev/null
++++ b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c
+@@ -0,0 +1,56 @@
++#include "sun4i-ss.h"
++
++int sun4i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed,
++		       unsigned int slen)
++{
++	struct sun4i_ss_alg_template *algt;
++	struct rng_alg *alg = crypto_rng_alg(tfm);
++
++	algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng);
++	memcpy(algt->ss->seed, seed, slen);
++
++	return 0;
++}
++
++int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src,
++			   unsigned int slen, u8 *dst, unsigned int dlen)
++{
++	struct sun4i_ss_alg_template *algt;
++	struct rng_alg *alg = crypto_rng_alg(tfm);
++	int i;
++	u32 v;
++	u32 *data = (u32 *)dst;
++	const u32 mode = SS_OP_PRNG | SS_PRNG_CONTINUE | SS_ENABLED;
++	size_t len;
++	struct sun4i_ss_ctx *ss;
++	unsigned int todo = (dlen / 4) * 4;
++
++	algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng);
++	ss = algt->ss;
++
++	spin_lock(&ss->slock);
++
++	writel(mode, ss->base + SS_CTL);
++
++	while (todo > 0) {
++		/* write the seed */
++		for (i = 0; i < SS_SEED_LEN / BITS_PER_LONG; i++)
++			writel(ss->seed[i], ss->base + SS_KEY0 + i * 4);
++
++		/* Read the random data */
++		len = min_t(size_t, SS_DATA_LEN / BITS_PER_BYTE, todo);
++		readsl(ss->base + SS_TXFIFO, data, len / 4);
++		data += len / 4;
++		todo -= len;
++
++		/* Update the seed */
++		for (i = 0; i < SS_SEED_LEN / BITS_PER_LONG; i++) {
++			v = readl(ss->base + SS_KEY0 + i * 4);
++			ss->seed[i] = v;
++		}
++	}
++
++	writel(0, ss->base + SS_CTL);
++	spin_unlock(&ss->slock);
++	return dlen;
++}
+--- a/drivers/crypto/sunxi-ss/sun4i-ss.h
++++ b/drivers/crypto/sunxi-ss/sun4i-ss.h
+@@ -30,6 +30,7 @@
+ #include <crypto/aes.h>
+ #include <crypto/des.h>
+ #include <crypto/internal/rng.h>
++#include <crypto/rng.h>
+ 
+ #define SS_CTL            0x00
+ #define SS_KEY0           0x04
+@@ -125,6 +126,9 @@
+ #define SS_RXFIFO_EMP_INT_ENABLE	(1 << 2)
+ #define SS_TXFIFO_AVA_INT_ENABLE	(1 << 0)
+ 
++#define SS_SEED_LEN 192
++#define SS_DATA_LEN 160
++
+ struct sun4i_ss_ctx {
+ 	void __iomem *base;
+ 	int irq;
+@@ -134,6 +138,9 @@ struct sun4i_ss_ctx {
+ 	struct device *dev;
+ 	struct resource *res;
+ 	spinlock_t slock; /* control the use of the device */
++#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG
++	u32 seed[SS_SEED_LEN / BITS_PER_LONG];
++#endif
+ };
+ 
+ struct sun4i_ss_alg_template {
+@@ -142,6 +149,7 @@ struct sun4i_ss_alg_template {
+ 	union {
+ 		struct crypto_alg crypto;
+ 		struct ahash_alg hash;
++		struct rng_alg rng;
+ 	} alg;
+ 	struct sun4i_ss_ctx *ss;
+ };
+@@ -199,3 +207,6 @@ int sun4i_ss_des_setkey(struct crypto_ab
+ 			unsigned int keylen);
+ int sun4i_ss_des3_setkey(struct crypto_ablkcipher *tfm, const u8 *key,
+ 			 unsigned int keylen);
++int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src,
++			   unsigned int slen, u8 *dst, unsigned int dlen);
++int sun4i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed, unsigned int slen);


From lede-commits at lists.infradead.org  Sat Oct 14 16:11:52 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 14 Oct 2017 19:11:52 -0400
Subject: [source]  at91: add support for the WB50N module from Laird
In-Reply-To: <20171014231146.22260.40585@git-01.infra.lede-project.org>
References: <20171014231146.22260.40585@git-01.infra.lede-project.org>
Message-ID: <mailman.54391.1508022872.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/f81b353c9f33f5afa32eebe0ee1dc290e927e5ee

commit f81b353c9f33f5afa32eebe0ee1dc290e927e5ee
Author: Ben Whitten <ben.whitten at gmail.com>
AuthorDate: Wed Jun 28 11:28:12 2017 +0100

    at91: add support for the WB50N module from Laird
    
    This module from Laird includes the following:
      - CPU Atmel SoC SAMA5D31
      - Wifi QCA6004
      - Bluetooth CSR8811
      - RAM 64MB LPDDR
      - FLASH 128MB
    
    The flash is a dual image layout, kernel a/b, rootfs a/b, and a user
    partition.
    
    Signed-off-by: Ben Whitten <ben.whitten at gmail.com>
---
 .../linux/at91/files/arch/arm/boot/dts/wb50n.dts   | 117 ++++++++++++
 .../linux/at91/files/arch/arm/boot/dts/wb50n.dtsi  | 205 +++++++++++++++++++++
 target/linux/at91/image/sama5.mk                   |  14 ++
 .../103-ARM-at91-build-dtb-for-wb50n.patch         |  12 ++
 4 files changed, 348 insertions(+)

diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts
new file mode 100644
index 0000000..9c28a21
--- /dev/null
+++ b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts
@@ -0,0 +1,117 @@
+/*
+ * wb50n.dts - Device Tree file for wb50n board
+ *
+ *  Copyright (C) 2015 Laird
+ *
+ * Licensed under GPLv2 or later.
+ */
+/dts-v1/;
+#include "wb50n.dtsi"
+
+/ {
+	model = "Laird Workgroup Bridge 50N - Atmel SAMA5D";
+	compatible = "laird,wb50n", "atmel,sama5d31ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk loglevel=4 mem=64M";
+	};
+
+	ahb {
+
+		apb {
+			mmc0: mmc at f0000000 {
+				status = "okay";
+			};
+
+			macb1: ethernet at f802c000 {
+				status = "okay";
+			};
+
+			dbgu: serial at ffffee00 {
+				status = "okay";
+			};
+
+			/* On BB40 this port is labeled UART1 */
+			usart0: serial at f001c000 {
+				status = "okay";
+			};
+
+			/* On BB40 this port is labeled UART0 */
+			usart1: serial at f0020000 {
+				status = "okay";
+			};
+
+			i2c0: i2c at f0014000 {
+				status = "okay";
+			};
+
+			spi1: spi at f8008000 {
+				status = "okay";
+
+			        spidev at 0 {
+				          compatible = "spidev";
+				          reg = <0>;
+				          spi-max-frequency = <8000000>;
+			         };
+			};
+
+			watchdog at fffffe40 {
+				status = "okay";
+			};
+		};
+
+		usb0: gadget at 00500000 {
+			status = "okay";
+		};
+
+		usb1: ohci at 00600000 {
+			status = "okay";
+		};
+
+		usb2: ehci at 00700000 {
+			status = "okay";
+		};
+
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		btn0 at pa10 {
+			label = "BTNESC";
+			linux,code = <1>; /* ESC button */
+			gpios = <&pioA 10 GPIO_ACTIVE_LOW>;
+			gpio-key,wakeup = <1>;
+		};
+
+		irqbtn at pe31 {
+			label = "IRQBTN";
+			linux,code = <99>; /* SysReq button */
+			gpios = <&pioE 31 GPIO_ACTIVE_LOW>;
+			gpio-key,wakeup = <1>;
+		};
+	};
+
+    leds {
+        compatible = "gpio-leds";
+
+        led0 {
+            label = "wb50n:blue:led0";
+            gpios = <&pioA 12 GPIO_ACTIVE_LOW>;
+            default-state = "off";
+        };
+
+        led1 {
+            label = "wb50n:green:led1";
+            gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
+            default-state = "off";
+        };
+
+        led2 {
+            label = "wb50n:red:led2";
+            gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
+            default-state = "off";
+        };
+    };
+};
diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi
new file mode 100644
index 0000000..8d30424
--- /dev/null
+++ b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi
@@ -0,0 +1,205 @@
+/*
+ * wb50n.dts - Device Tree file for wb50n board
+ *
+ *  Copyright (C) 2015 Laird
+ *
+ * Licensed under GPLv2 or later.
+ */
+#include "sama5d31.dtsi"
+
+/ {
+	model = "Laird Workgroup Bridge 50N - Atmel SAMA5D";
+	compatible = "laird,wb50n", "atmel,sama5d31ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";
+
+	chosen {
+		bootargs = "console=ttyS0,115200 earlyprintk loglevel=4 mem=64M";
+	};
+
+	memory {
+		reg = <0x20000000 0x4000000>;
+	};
+
+	clocks {
+		slow_xtal {
+			clock-frequency = <32768>;
+		};
+
+		main_xtal {
+			clock-frequency = <12000000>;
+		};
+	};
+
+	ahb {
+
+		apb {
+			pmc: pmc at fffffc00 {
+				main: mainck {
+					clock-frequency = <12000000>;
+				};
+
+				periphck {
+					usart1_clk: usart1_clk {
+						#clock-cells = <0>;
+						reg = <13>;
+						atmel,clk-output-range = <0 132000000>;
+					};
+				};
+			};
+
+			pinctrl at fffff200 {
+				board {
+					pinctrl_mmc0_cd: mmc0_cd {
+						atmel,pins =
+							<AT91_PIOC 26 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; /* PC26 GPIO with pullup deglitch */
+					};
+
+					pinctrl_usba_vbus: usba_vbus {
+						atmel,pins =
+							<AT91_PIOB 13 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PB13 GPIO with deglitch */
+					};
+				};
+			};
+
+			mmc0: mmc at f0000000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>;
+				cd-gpios = <&pioC 26 GPIO_ACTIVE_LOW>;
+				slot at 0 {
+					reg = <0>;
+					bus-width = <4>;
+				};
+			};
+
+			mmc1: mmc at f8000000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
+				status = "okay";
+				slot at 0 {
+					reg = <0>;
+					bus-width = <4>;
+				};
+			};
+
+			macb1: ethernet at f802c000 {
+				phy-mode = "rmii";
+			};
+
+
+			dbgu: serial at ffffee00 {
+				dmas = <0>, <0>;	/*  Do not use DMA for dbgu */
+			};
+
+			/* On BB40 this port is labeled UART1 */
+			usart0: serial at f001c000 {
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts_cts>;
+			};
+
+			/* On BB40 this port is labeled UART0 */
+			usart1: serial at f0020000 {
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>;
+				dtr-gpios = <&pioD 13 GPIO_ACTIVE_LOW>;
+				dsr-gpios = <&pioD 11 GPIO_ACTIVE_LOW>;
+				dcd-gpios = <&pioD 7 GPIO_ACTIVE_LOW>;
+				rng-gpios = <&pioD 8 GPIO_ACTIVE_LOW>;
+			};
+
+			/* USART3 is direct-connect to the Bluetooth UART on the radio SIP */
+			usart3: serial at f8024000 {
+				atmel,use-dma-rx;
+				atmel,use-dma-tx;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts_cts>;
+				status = "okay";
+			};
+
+			spi1: spi at f8008000 {
+				cs-gpios = <&pioC 25 0>, <0>, <0>, <0>;
+			};
+
+			sckc at fffffe50 {
+				slow_osc: slow_osc {
+					atmel,osc-bypass;
+				};
+			};
+		};
+
+		nand0: nand at 60000000 {
+			nand-bus-width = <8>;
+			nand-ecc-mode = "hw";
+			atmel,has-pmecc;
+			atmel,pmecc-cap = <8>;
+			atmel,pmecc-sector-size = <512>;
+			nand-on-flash-bbt;
+			status = "okay";
+
+			at91bootstrap at 0 {
+				label = "at91bs";
+				reg = <0x0 0x20000>;
+			};
+
+			uboot at 20000 {
+				label = "u-boot";
+				reg = <0x20000 0x80000>;
+			};
+
+			ubootenv at a0000 {
+				label = "u-boot-env";
+				reg = <0xa0000 0x20000>;
+			};
+
+			ubootenv at c0000 {
+				label = "u-boot-env";
+				reg = <0xc0000 0x20000>;
+			};
+
+			kernel-a at e0000 {
+				label = "kernel-a";
+				reg = <0xe0000 0x500000>;
+			};
+
+			kernel-b at 5e0000 {
+				label = "kernel-b";
+				reg = <0x5e0000 0x500000>;
+			};
+
+			rootfs-a at ae0000 {
+				label = "rootfs-a";
+				reg = <0xae0000 0x3000000>;
+			};
+
+			rootfs-b at 3ae0000 {
+				label = "rootfs-b";
+				reg = <0x3ae0000 0x3000000>;
+			};
+
+			user at 6ae0000 {
+				label = "user";
+				reg = <0x6ae0000 0x14e0000>;
+			};
+
+		};
+
+		usb0: gadget at 00500000 {
+			atmel,vbus-gpio = <&pioB 13 GPIO_ACTIVE_LOW>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_usba_vbus>;
+		};
+
+		usb1: ohci at 00600000 {
+			num-ports = <3>;
+			atmel,vbus-gpio = <&pioA 2 GPIO_ACTIVE_LOW>;
+			atmel,oc-gpio = <&pioA 4 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	atheros {
+		compatible = "atheros,ath6kl";
+		atheros,board-id = "SD32";
+ 	};
+};
diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk
index 1c779ca..b26715b 100644
--- a/target/linux/at91/image/sama5.mk
+++ b/target/linux/at91/image/sama5.mk
@@ -29,3 +29,17 @@ define Device/at91-sama5d4_xplained
   MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 -x lzo
 endef
 TARGET_DEVICES += at91-sama5d4_xplained
+
+define Device/wb50n
+  $(Device/evaluation-fit)
+  DEVICE_TITLE := Laird WB50N
+  DEVICE_PACKAGES := \
+	  kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \
+	  kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \
+	  kmod-leds-gpio
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  SUBPAGESIZE := 2048
+  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955
+endef
+TARGET_DEVICES += wb50n
diff --git a/target/linux/at91/patches-4.4/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-4.4/103-ARM-at91-build-dtb-for-wb50n.patch
new file mode 100644
index 0000000..00ffe09
--- /dev/null
+++ b/target/linux/at91/patches-4.4/103-ARM-at91-build-dtb-for-wb50n.patch
@@ -0,0 +1,12 @@
+--- a/arch/arm/boot/dts/Makefile
++++ b/arch/arm/boot/dts/Makefile
+@@ -52,7 +52,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \
+ 	sama5d35ek.dtb \
+ 	sama5d36ek.dtb \
+ 	at91-sama5d4_xplained.dtb \
+-	at91-sama5d4ek.dtb
++	at91-sama5d4ek.dtb \
++	wb50n.dtb
+ dtb-$(CONFIG_ARCH_ATLAS6) += \
+ 	atlas6-evb.dtb
+ dtb-$(CONFIG_ARCH_ATLAS7) += \


From lede-commits at lists.infradead.org  Sun Oct 15 01:55:46 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 15 Oct 2017 04:55:46 -0400
Subject: [source] mac80211: ath6kl: add missing usb-core dependency to
 kmod-ath6kl-usb
In-Reply-To: <20171015085546.20513.64572@git-01.infra.lede-project.org>
References: <20171015085546.20513.64572@git-01.infra.lede-project.org>
Message-ID: <mailman.54410.1508057900.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/08bbb804c88a74cd7a04cea548cebf85bcf09b8f

commit 08bbb804c88a74cd7a04cea548cebf85bcf09b8f
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 10:53:46 2017 +0200

    mac80211: ath6kl: add missing usb-core dependency to kmod-ath6kl-usb
    
    This fixes a build problem with many targets.
    
    Fixes 618ed77a17422a ("mac80211: add ath6kl kernel modules")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/mac80211/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index c0a4300..7e9b5ad 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -244,7 +244,7 @@ define KernelPackage/ath6kl-usb
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 802.11n USB wireless cards support
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
-  DEPENDS+= @USB_SUPPORT +kmod-ath6kl
+  DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-ath6kl
   FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko
   AUTOLOAD:=$(call AutoProbe,ath6kl_usb)
 endef


From lede-commits at lists.infradead.org  Sun Oct 15 07:04:48 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 15 Oct 2017 10:04:48 -0400
Subject: [source]  malta: add 64 bit qemu commands to README
In-Reply-To: <20171015140447.5529.97822@git-01.infra.lede-project.org>
References: <20171015140447.5529.97822@git-01.infra.lede-project.org>
Message-ID: <mailman.54438.1508076316.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/8fa9b2ce89025d245a816a38fe21c8c4f58e34e4

commit 8fa9b2ce89025d245a816a38fe21c8c4f58e34e4
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 14:18:40 2017 +0200

    malta: add 64 bit qemu commands to README
    
    This shows how to boot up the 64 bit images.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/malta/README | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/target/linux/malta/README b/target/linux/malta/README
index c34afe1..e486659 100644
--- a/target/linux/malta/README
+++ b/target/linux/malta/README
@@ -4,10 +4,16 @@ troubleshoot MIPS applications without access to real hardware.
 
 To use the images built by OpenWrt with qemu, use the following commands:
 
-For the little-endian image:
+For the 32 bit little-endian image:
 qemu-system-mipsel -kernel bin/targets/malta/le/lede-malta-le-vmlinux-initramfs.elf -nographic -m 256
 
-For the big-endian image:
+For the 32 bit big-endian image:
 qemu-system-mips -kernel bin/targets/malta/be/lede-malta-be-vmlinux-initramfs.elf -nographic -m 256
 
+For the 64 bit little-endian image:
+qemu-system-mips64el -kernel bin/targets/malta/le64/lede-malta-le64-vmlinux-initramfs.elf -nographic -m 256
+
+For the 64 bit big-endian image:
+qemu-system-mips64 -kernel bin/targets/malta/be64/lede-malta-be64-vmlinux-initramfs.elf -nographic -m 256
+
 and enjoy the system bootin.


From lede-commits at lists.infradead.org  Sun Oct 15 07:04:47 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 15 Oct 2017 10:04:47 -0400
Subject: [source]  ppp: fix compile warning
In-Reply-To: <20171015140447.5529.97822@git-01.infra.lede-project.org>
References: <20171015140447.5529.97822@git-01.infra.lede-project.org>
Message-ID: <mailman.54441.1508076316.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/f40fd43ab2fe0f5c707a07eb036e84af086f3066

commit f40fd43ab2fe0f5c707a07eb036e84af086f3066
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 14:19:20 2017 +0200

    ppp: fix compile warning
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/services/ppp/patches/500-add-pptp-plugin.patch | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch
index d984e1b..54a160d 100644
--- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch
+++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch
@@ -1083,6 +1083,7 @@
 +#include <string.h>
 +#include <ctype.h>
 +#include <fcntl.h>
++#include "pppd.h"
 +#include "pptp_msg.h"
 +#include "pptp_ctrl.h"
 +#include "pptp_options.h"


From lede-commits at lists.infradead.org  Sun Oct 15 07:04:50 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 15 Oct 2017 10:04:50 -0400
Subject: [source]  malta: activate some more standard kernel features
In-Reply-To: <20171015140447.5529.97822@git-01.infra.lede-project.org>
References: <20171015140447.5529.97822@git-01.infra.lede-project.org>
Message-ID: <mailman.54442.1508076322.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/0d5c1d7f238cd5aca207268950edc70ed6cf0a05

commit 0d5c1d7f238cd5aca207268950edc70ed6cf0a05
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 14:33:56 2017 +0200

    malta: activate some more standard kernel features
    
    These options where deactivated in the malta kernel, take the default
    options form the generic kernel configuration now to better match the
    other targets.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/malta/config-4.9 | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target/linux/malta/config-4.9 b/target/linux/malta/config-4.9
index c6dd350..0e9daf6 100644
--- a/target/linux/malta/config-4.9
+++ b/target/linux/malta/config-4.9
@@ -76,7 +76,6 @@ CONFIG_CRYPTO_NULL2=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_CSRC_R4K=y
-# CONFIG_DEBUG_FS is not set
 CONFIG_DMA_MAYBE_COHERENT=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_DNOTIFY=y
@@ -164,7 +163,6 @@ CONFIG_ISA_DMA_API=y
 CONFIG_JBD2=y
 CONFIG_JFFS2_FS_POSIX_ACL=y
 CONFIG_JFFS2_FS_SECURITY=y
-# CONFIG_JFFS2_SUMMARY is not set
 CONFIG_KALLSYMS=y
 CONFIG_KERNEL_GZIP=y
 # CONFIG_KERNEL_XZ is not set
@@ -264,7 +262,6 @@ CONFIG_SG_POOL=y
 CONFIG_SMP=y
 CONFIG_SMP_UP=y
 CONFIG_SRCU=y
-# CONFIG_STAGING is not set
 CONFIG_SWAP_IO_SPACE=y
 CONFIG_SYNC_R4K=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
@@ -296,7 +293,6 @@ CONFIG_SYS_SUPPORTS_SCHED_SMT=y
 CONFIG_SYS_SUPPORTS_SMARTMIPS=y
 CONFIG_SYS_SUPPORTS_SMP=y
 CONFIG_SYS_SUPPORTS_ZBOOT=y
-# CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TREE_RCU=y
 CONFIG_USB_SUPPORT=y
@@ -308,5 +304,4 @@ CONFIG_VT=y
 CONFIG_VT_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 CONFIG_VXFS_FS=y
-# CONFIG_WATCHDOG is not set
 CONFIG_XPS=y


From lede-commits at lists.infradead.org  Sun Oct 15 07:04:49 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 15 Oct 2017 10:04:49 -0400
Subject: [source]  malta: upgrade to kernel 4.9
In-Reply-To: <20171015140447.5529.97822@git-01.infra.lede-project.org>
References: <20171015140447.5529.97822@git-01.infra.lede-project.org>
Message-ID: <mailman.54443.1508076323.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/19f0c7d11ceb1a0d4bc8734e928d5c6ceb4b8d59

commit 19f0c7d11ceb1a0d4bc8734e928d5c6ceb4b8d59
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 12:42:33 2017 +0200

    malta: upgrade to kernel 4.9
    
    This brings the MIPS malta target to kernel 4.9.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/malta/Makefile                   |  2 +-
 target/linux/malta/be/config-default          |  6 ----
 target/linux/malta/be64/config-default        | 10 ++-----
 target/linux/malta/{config-4.4 => config-4.9} | 42 +++++++++++++++++----------
 target/linux/malta/le/config-default          |  6 ----
 target/linux/malta/le64/config-default        | 10 ++-----
 6 files changed, 32 insertions(+), 44 deletions(-)

diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile
index 34818f1..c2b50f5 100644
--- a/target/linux/malta/Makefile
+++ b/target/linux/malta/Makefile
@@ -14,7 +14,7 @@ INITRAMFS_EXTRA_FILES:=
 MAINTAINER:=Florian Fainelli <florian at openwrt.org>
 FEATURES:=ramdisk
 
-KERNEL_PATCHVER:=4.4
+KERNEL_PATCHVER:=4.9
 
 include $(INCLUDE_DIR)/target.mk
 
diff --git a/target/linux/malta/be/config-default b/target/linux/malta/be/config-default
index 2772ed7..f51301a 100644
--- a/target/linux/malta/be/config-default
+++ b/target/linux/malta/be/config-default
@@ -1,9 +1,3 @@
 CONFIG_CPU_BIG_ENDIAN=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_CPU_MIPS32=y
-# CONFIG_CPU_MIPS32_R1 is not set
 CONFIG_CPU_MIPS32_R2=y
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
diff --git a/target/linux/malta/be64/config-default b/target/linux/malta/be64/config-default
index 374e29a..2c0c9d2 100644
--- a/target/linux/malta/be64/config-default
+++ b/target/linux/malta/be64/config-default
@@ -1,6 +1,7 @@
 # CONFIG_32BIT is not set
 CONFIG_64BIT=y
 CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
 CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
 CONFIG_BINFMT_ELF32=y
@@ -8,15 +9,10 @@ CONFIG_BLOCK_COMPAT=y
 CONFIG_COMPAT=y
 CONFIG_COMPAT_NETLINK_MESSAGES=y
 CONFIG_CPU_BIG_ENDIAN=y
-# CONFIG_LIQUIDIO is not set
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-# CONFIG_CPU_MIPS32_R1 is not set
-# CONFIG_CPU_MIPS32_R2 is not set
 CONFIG_CPU_MIPS64=y
 CONFIG_CPU_MIPS64_R1=y
-# CONFIG_CPU_MIPS64_R2 is not set
 CONFIG_CPU_MIPSR1=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_HUGEPAGES=y
 CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y
@@ -25,13 +21,11 @@ CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_MIPS32_N32=y
 CONFIG_MIPS32_O32=y
+# CONFIG_MIPS_VA_BITS_48 is not set
 CONFIG_MODULES_USE_ELF_RELA=y
 CONFIG_PCI_BUS_ADDR_T_64BIT=y
 CONFIG_PGTABLE_LEVELS=3
 CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SYS_SUPPORTS_HUGETLBFS=y
-# CONFIG_THUNDER_NIC_BGX is not set
-# CONFIG_THUNDER_NIC_PF is not set
-# CONFIG_THUNDER_NIC_VF is not set
 CONFIG_ZONE_DMA32=y
diff --git a/target/linux/malta/config-4.4 b/target/linux/malta/config-4.9
similarity index 90%
rename from target/linux/malta/config-4.4
rename to target/linux/malta/config-4.9
index d027c9d..c6dd350 100644
--- a/target/linux/malta/config-4.4
+++ b/target/linux/malta/config-4.9
@@ -1,7 +1,6 @@
 CONFIG_ARCH_BINFMT_ELF_STATE=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
 CONFIG_ARCH_DISCARD_MEMBLOCK=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
 # CONFIG_ARCH_HAS_SG_CHAIN is not set
@@ -10,7 +9,6 @@ CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
 CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
 CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ATA=y
 CONFIG_ATA_PIIX=y
@@ -23,11 +21,11 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_MQ_PCI=y
 CONFIG_BOARD_SCACHE=y
 CONFIG_BOOT_ELF32=y
 CONFIG_BOUNCE=y
 CONFIG_BUILTIN_DTB=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_CEVT_R4K=y
 CONFIG_CLKBLD_I8253=y
 CONFIG_CLKDEV_LOOKUP=y
@@ -41,12 +39,18 @@ CONFIG_COMMON_CLK=y
 CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_CPU_GENERIC_DUMP_TLB=y
 CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_RIXI=y
 # CONFIG_CPU_HAS_SMARTMIPS is not set
 CONFIG_CPU_HAS_SYNC=y
 # CONFIG_CPU_MICROMIPS is not set
+CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_MIPS32_3_5_FEATURES is not set
+# CONFIG_CPU_MIPS32_R1 is not set
+# CONFIG_CPU_MIPS32_R2 is not set
 # CONFIG_CPU_MIPS32_R5_FEATURES is not set
 # CONFIG_CPU_MIPS32_R6 is not set
+# CONFIG_CPU_MIPS64_R1 is not set
+# CONFIG_CPU_MIPS64_R2 is not set
 # CONFIG_CPU_MIPS64_R6 is not set
 CONFIG_CPU_MIPSR2=y
 CONFIG_CPU_MIPSR2_IRQ_EI=y
@@ -57,12 +61,18 @@ CONFIG_CPU_R4K_CACHE_TLB=y
 CONFIG_CPU_R4K_FPU=y
 # CONFIG_CPU_RM7000 is not set
 CONFIG_CPU_RMAP=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_HIGHMEM=y
 CONFIG_CPU_SUPPORTS_MSA=y
 CONFIG_CRC16=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_CRC32C=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL2=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_CSRC_R4K=y
@@ -82,6 +92,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_GENERIC_IO=y
 CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_IPI=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_ISA_DMA=y
 CONFIG_GENERIC_PCI_IOMAP=y
@@ -89,17 +100,19 @@ CONFIG_GENERIC_SCHED_CLOCK=y
 CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GLOB=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDWARE_WATCHPOINTS=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
 # CONFIG_HAVE_ARCH_BITREVERSE is not set
 CONFIG_HAVE_ARCH_JUMP_LABEL=y
 CONFIG_HAVE_ARCH_KGDB=y
 CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
 CONFIG_HAVE_ARCH_TRACEHOOK=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
+CONFIG_HAVE_CBPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CLK=y
 CONFIG_HAVE_CLK_PREPARE=y
@@ -108,7 +121,6 @@ CONFIG_HAVE_C_RECORDMCOUNT=y
 CONFIG_HAVE_DEBUG_KMEMLEAK=y
 CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
 CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
 CONFIG_HAVE_DMA_CONTIGUOUS=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
@@ -116,13 +128,8 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
 CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_BZIP2=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_KVM=y
 CONFIG_HAVE_LATENCYTOP_SUPPORT=y
 CONFIG_HAVE_MEMBLOCK=y
@@ -132,6 +139,7 @@ CONFIG_HAVE_NET_DSA=y
 CONFIG_HAVE_OPROFILE=y
 CONFIG_HAVE_PCSPKR_PLATFORM=y
 CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
 CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HW_CONSOLE=y
@@ -148,6 +156,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_IP_MROUTE is not set
 CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_MIPS_CPU=y
 CONFIG_IRQ_WORK=y
@@ -165,6 +174,8 @@ CONFIG_LEGACY_PTY_COUNT=256
 CONFIG_LIBFDT=y
 CONFIG_MD=y
 CONFIG_MIPS=y
+CONFIG_MIPS_ASID_BITS=8
+CONFIG_MIPS_ASID_SHIFT=0
 CONFIG_MIPS_BONITO64=y
 CONFIG_MIPS_CLOCK_VSYSCALL=y
 CONFIG_MIPS_CM=y
@@ -177,7 +188,6 @@ CONFIG_MIPS_CPU_SCACHE=y
 # CONFIG_MIPS_ELF_APPENDED_DTB is not set
 CONFIG_MIPS_EXTERNAL_TIMER=y
 CONFIG_MIPS_GIC=y
-CONFIG_MIPS_GIC_IPI=y
 # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
 CONFIG_MIPS_L1_CACHE_SHIFT=6
 CONFIG_MIPS_L1_CACHE_SHIFT_6=y
@@ -193,7 +203,6 @@ CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y
 # CONFIG_MIPS_RAW_APPENDED_DTB is not set
 CONFIG_MIPS_SPRAM=y
 # CONFIG_MIPS_VPE_LOADER is not set
-# CONFIG_MIPS_ZBOOT_APPENDED_DTB is not set
 CONFIG_MODULES_TREE_LOOKUP=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MODULE_FORCE_UNLOAD=y
@@ -214,13 +223,14 @@ CONFIG_OF_ADDRESS_PCI=y
 CONFIG_OF_EARLY_FLATTREE=y
 CONFIG_OF_FLATTREE=y
 CONFIG_OF_IRQ=y
-CONFIG_OF_MTD=y
 CONFIG_OF_NET=y
 CONFIG_OF_PCI=y
 CONFIG_OF_PCI_IRQ=y
+CONFIG_PADATA=y
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DRIVERS_LEGACY=y
 CONFIG_PCI_GT64XXX_PCI0=y
 CONFIG_PCSPKR_PLATFORM=y
 CONFIG_PERF_EVENTS=y
@@ -240,6 +250,7 @@ CONFIG_RELAY=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_MC146818_LIB=y
 # CONFIG_SCHED_INFO is not set
 CONFIG_SCSI=y
 CONFIG_SECCOMP=y
@@ -249,11 +260,11 @@ CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
 CONFIG_SERIO=y
 CONFIG_SERIO_SERPORT=y
+CONFIG_SG_POOL=y
 CONFIG_SMP=y
 CONFIG_SMP_UP=y
 CONFIG_SRCU=y
 # CONFIG_STAGING is not set
-# CONFIG_SUNXI_SRAM is not set
 CONFIG_SWAP_IO_SPACE=y
 CONFIG_SYNC_R4K=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
@@ -280,6 +291,7 @@ CONFIG_SYS_SUPPORTS_MIPS16=y
 CONFIG_SYS_SUPPORTS_MIPS_CMP=y
 CONFIG_SYS_SUPPORTS_MIPS_CPS=y
 CONFIG_SYS_SUPPORTS_MULTITHREADING=y
+CONFIG_SYS_SUPPORTS_RELOCATABLE=y
 CONFIG_SYS_SUPPORTS_SCHED_SMT=y
 CONFIG_SYS_SUPPORTS_SMARTMIPS=y
 CONFIG_SYS_SUPPORTS_SMP=y
diff --git a/target/linux/malta/le/config-default b/target/linux/malta/le/config-default
index b5634c6..aab569b 100644
--- a/target/linux/malta/le/config-default
+++ b/target/linux/malta/le/config-default
@@ -1,9 +1,3 @@
 # CONFIG_CPU_BIG_ENDIAN is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_CPU_MIPS32=y
-# CONFIG_CPU_MIPS32_R1 is not set
 CONFIG_CPU_MIPS32_R2=y
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
diff --git a/target/linux/malta/le64/config-default b/target/linux/malta/le64/config-default
index 725c3e4..2895453 100644
--- a/target/linux/malta/le64/config-default
+++ b/target/linux/malta/le64/config-default
@@ -1,6 +1,7 @@
 # CONFIG_32BIT is not set
 CONFIG_64BIT=y
 CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
 CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y
 CONFIG_BINFMT_ELF32=y
@@ -8,15 +9,10 @@ CONFIG_BLOCK_COMPAT=y
 CONFIG_COMPAT=y
 CONFIG_COMPAT_NETLINK_MESSAGES=y
 # CONFIG_CPU_BIG_ENDIAN is not set
-# CONFIG_LIQUIDIO is not set
 CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_MIPS32_R1 is not set
-# CONFIG_CPU_MIPS32_R2 is not set
 CONFIG_CPU_MIPS64=y
 CONFIG_CPU_MIPS64_R1=y
-# CONFIG_CPU_MIPS64_R2 is not set
 CONFIG_CPU_MIPSR1=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_HUGEPAGES=y
 CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y
@@ -25,13 +21,11 @@ CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
 CONFIG_MIPS32_COMPAT=y
 CONFIG_MIPS32_N32=y
 CONFIG_MIPS32_O32=y
+# CONFIG_MIPS_VA_BITS_48 is not set
 CONFIG_MODULES_USE_ELF_RELA=y
 CONFIG_PCI_BUS_ADDR_T_64BIT=y
 CONFIG_PGTABLE_LEVELS=3
 CONFIG_PHYS_ADDR_T_64BIT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_SYS_SUPPORTS_HUGETLBFS=y
-# CONFIG_THUNDER_NIC_BGX is not set
-# CONFIG_THUNDER_NIC_PF is not set
-# CONFIG_THUNDER_NIC_VF is not set
 CONFIG_ZONE_DMA32=y


From lede-commits at lists.infradead.org  Mon Oct 16 02:05:23 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 05:05:23 -0400
Subject: [source] x86: Fix xen serial console by removing conflicting PATA
 driver
In-Reply-To: <20171016090512.5587.12070@git-01.infra.lede-project.org>
References: <20171016090512.5587.12070@git-01.infra.lede-project.org>
Message-ID: <mailman.54514.1508144758.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/da0219ed9f990e5a951197c2c9c6a916d17109d1

commit da0219ed9f990e5a951197c2c9c6a916d17109d1
Author: Baptiste Jonglez <git at bitsofnetworks.org>
AuthorDate: Sat Jul 15 22:57:54 2017 +0200

    x86: Fix xen serial console by removing conflicting PATA driver
    
    The Xen serial console has been broken since the xen_domu subtarget
    was merged in the generic x86 subtarget (commits 296772f9 and b36e24f3).
    
    The reason for the broken serial console seems to be an IRQ conflict
    between the serial console driver and the PATA_LEGACY driver:
    
    [    1.330125] genirq: Flags mismatch irq 8. 00000000 (hvc_console) vs. 00000000 (platform[pata_legacy.4])
    [    1.330134] hvc_open: request_irq failed with rc -16.
    [    1.330148] Warning: unable to open an initial console.
    
    Just drop the PATA_LEGACY driver from the x86/generic and x86_64
    subtargets, since this driver is marked experimental and only supports
    very old ISA devices anyway.  It is still included in the x86/legacy
    subtarget where it rightfully belongs.
    
    Fixes: FS#787
    
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
---
 target/linux/x86/64/config-default      | 1 -
 target/linux/x86/generic/config-default | 1 -
 2 files changed, 2 deletions(-)

diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default
index 848f041..9948c28 100644
--- a/target/linux/x86/64/config-default
+++ b/target/linux/x86/64/config-default
@@ -204,7 +204,6 @@ CONFIG_PARAVIRT_SPINLOCKS=y
 # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
 CONFIG_PATA_AMD=y
 CONFIG_PATA_ATIIXP=y
-CONFIG_PATA_LEGACY=y
 CONFIG_PATA_MPIIX=y
 CONFIG_PATA_OLDPIIX=y
 CONFIG_PATA_PLATFORM=y
diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default
index c4ca4fd..a0472f3 100644
--- a/target/linux/x86/generic/config-default
+++ b/target/linux/x86/generic/config-default
@@ -260,7 +260,6 @@ CONFIG_PARAVIRT_SPINLOCKS=y
 # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
 CONFIG_PATA_AMD=y
 CONFIG_PATA_ATIIXP=y
-CONFIG_PATA_LEGACY=y
 CONFIG_PATA_MPIIX=y
 CONFIG_PATA_OLDPIIX=y
 CONFIG_PATA_PLATFORM=y


From lede-commits at lists.infradead.org  Mon Oct 16 02:05:22 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 05:05:22 -0400
Subject: [source] x86/generic: use HIGHMEM64G instead of HIGHMEM4G to fix
 PAE and Xen
In-Reply-To: <20171016090512.5587.12070@git-01.infra.lede-project.org>
References: <20171016090512.5587.12070@git-01.infra.lede-project.org>
Message-ID: <mailman.54515.1508144758.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/f52b404aeea328b4e021a245c640ed3b0e095fa8

commit f52b404aeea328b4e021a245c640ed3b0e095fa8
Author: Baptiste Jonglez <git at bitsofnetworks.org>
AuthorDate: Sat Jul 15 22:57:53 2017 +0200

    x86/generic: use HIGHMEM64G instead of HIGHMEM4G to fix PAE and Xen
    
    This is a backport of 641a65fd062987a456216cc4fa91ff2910528261 in master.
    
    This change re-enables PAE for the 32-bit x86 subtarget, which is
    interesting in its own right but also necessary for Xen support.
    
    Commit af1d1ebd ("x86: enable 4G high memory support for generic (32bit)
    subtarget") inadvertently disabled both PAE and Xen support.
    
    Fixes: FS#908
    
    Cc: Daniel Golle <daniel at makrotopia.org>
    Cc: Jo-Philipp Wich <jo at mein.io>
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
---
 target/linux/x86/generic/config-default | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default
index 1a14c27..c4ca4fd 100644
--- a/target/linux/x86/generic/config-default
+++ b/target/linux/x86/generic/config-default
@@ -42,6 +42,7 @@ CONFIG_AGP_INTEL=y
 # CONFIG_AGP_SWORKS is not set
 # CONFIG_AGP_VIA is not set
 # CONFIG_APM is not set
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y
 CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
 CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
 CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
@@ -165,7 +166,8 @@ CONFIG_HDMI=y
 CONFIG_HIBERNATE_CALLBACKS=y
 CONFIG_HID=y
 CONFIG_HID_BATTERY_STRENGTH=y
-# CONFIG_HIGHMEM64G is not set
+# CONFIG_HIGHMEM4G is not set
+CONFIG_HIGHMEM64G=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HPET=y
 CONFIG_HPET_MMAP=y
@@ -267,6 +269,7 @@ CONFIG_PATA_VIA=y
 CONFIG_PCIEAER=y
 CONFIG_PCIEPORTBUS=y
 CONFIG_PCIE_PME=y
+CONFIG_PCI_BUS_ADDR_T_64BIT=y
 CONFIG_PCI_MMCONFIG=y
 CONFIG_PCI_XEN=y
 # CONFIG_PCWATCHDOG is not set


From lede-commits at lists.infradead.org  Mon Oct 16 02:05:24 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 05:05:24 -0400
Subject: [source]  x86: Refresh subtargets kernel config
In-Reply-To: <20171016090512.5587.12070@git-01.infra.lede-project.org>
References: <20171016090512.5587.12070@git-01.infra.lede-project.org>
Message-ID: <mailman.54516.1508144761.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/cabf775e64ba337d96f393447bf0347e129e9157

commit cabf775e64ba337d96f393447bf0347e129e9157
Author: Baptiste Jonglez <git at bitsofnetworks.org>
AuthorDate: Sat Jul 15 22:57:55 2017 +0200

    x86: Refresh subtargets kernel config
    
    This was done by simply running `make kernel_menuconfig CONFIG_TARGET=subtarget`
    and then saving without changing any option.
    
    Having consistent kernel config is important to avoid surprises, such
    as the issue fixed with 6f0367c9 (where Xen support was silently
    disabled when building the kernel, although it was present in the
    initial config)
    
    As far as I understand the build system, this shouldn't have any
    user-visible impact, because the build system already merges the
    various kernel configs during build.
    
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
---
 target/linux/x86/64/config-default     | 17 +++++++++++++++--
 target/linux/x86/geode/config-default  |  3 ---
 target/linux/x86/legacy/config-default | 10 +---------
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default
index 9948c28..9ca2cc9 100644
--- a/target/linux/x86/64/config-default
+++ b/target/linux/x86/64/config-default
@@ -30,7 +30,6 @@ CONFIG_ACPI_THERMAL=y
 # CONFIG_ACPI_WMI is not set
 CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
 CONFIG_ARCH_DMA_ADDR_T_64BIT=y
-CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y
 CONFIG_ARCH_HAS_PMEM_API=y
 CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
@@ -52,8 +51,11 @@ CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
 CONFIG_CONNECTOR=y
 CONFIG_CPU_RMAP=y
 CONFIG_CRC_T10DIF=y
-CONFIG_CRYPTO_AES_X86_64=y
+CONFIG_CRYPTO_ABLK_HELPER=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
 CONFIG_CRYPTO_AES_NI_INTEL=y
+CONFIG_CRYPTO_AES_X86_64=y
 # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set
 # CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set
 # CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set
@@ -63,7 +65,14 @@ CONFIG_CRYPTO_AES_NI_INTEL=y
 # CONFIG_CRYPTO_CHACHA20_X86_64 is not set
 CONFIG_CRYPTO_CRCT10DIF=y
 # CONFIG_CRYPTO_CRCT10DIF_PCLMUL is not set
+CONFIG_CRYPTO_CRYPTD=y
 # CONFIG_CRYPTO_DES3_EDE_X86_64 is not set
+CONFIG_CRYPTO_GF128MUL=y
+CONFIG_CRYPTO_GLUE_HELPER_X86=y
+CONFIG_CRYPTO_LRW=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL2=y
 # CONFIG_CRYPTO_POLY1305_X86_64 is not set
 # CONFIG_CRYPTO_SALSA20_X86_64 is not set
 # CONFIG_CRYPTO_SERPENT_AVX2_X86_64 is not set
@@ -77,6 +86,7 @@ CONFIG_CRYPTO_CRCT10DIF=y
 # CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set
 # CONFIG_CRYPTO_TWOFISH_X86_64 is not set
 # CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set
+CONFIG_CRYPTO_XTS=y
 # CONFIG_EARLY_PRINTK_EFI is not set
 CONFIG_EFI=y
 CONFIG_EFIVAR_FS=m
@@ -111,7 +121,9 @@ CONFIG_GENERIC_CPU=y
 CONFIG_GENERIC_PENDING_IRQ=y
 CONFIG_GPIOLIB=y
 # CONFIG_GPIO_104_IDIO_16 is not set
+CONFIG_GPIO_ACPI=y
 # CONFIG_GPIO_AMDPT is not set
+CONFIG_GPIO_DEVRES=y
 # CONFIG_GPIO_F7188X is not set
 # CONFIG_GPIO_INTEL_MID is not set
 # CONFIG_GPIO_IT87 is not set
@@ -197,6 +209,7 @@ CONFIG_NET_FLOW_LIMIT=y
 CONFIG_NR_CPUS=8
 # CONFIG_NUMA is not set
 CONFIG_OUTPUT_FORMAT="elf64-x86-64"
+CONFIG_PADATA=y
 CONFIG_PARAVIRT=y
 CONFIG_PARAVIRT_CLOCK=y
 # CONFIG_PARAVIRT_DEBUG is not set
diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default
index 16c439d..d1c8f5a 100644
--- a/target/linux/x86/geode/config-default
+++ b/target/linux/x86/geode/config-default
@@ -30,12 +30,10 @@ CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
 # CONFIG_ACPI_SBS is not set
 CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
 CONFIG_ACPI_THERMAL=y
-# CONFIG_ACPI_VIDEO is not set
 # CONFIG_ACPI_WMI is not set
 CONFIG_ALIX=y
 CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
 # CONFIG_ATA_PIIX is not set
-# CONFIG_BACKLIGHT_APPLE is not set
 CONFIG_CS5535_CLOCK_EVENT_SRC=y
 CONFIG_CS5535_MFGPT=y
 CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7
@@ -133,4 +131,3 @@ CONFIG_X86_PM_TIMER=y
 # CONFIG_X86_PPRO_FENCE is not set
 CONFIG_X86_REBOOTFIXUPS=y
 CONFIG_X86_TSC=y
-# CONFIG_X86_X2APIC is not set
diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default
index 1983ab4..02cd851 100644
--- a/target/linux/x86/legacy/config-default
+++ b/target/linux/x86/legacy/config-default
@@ -1,7 +1,6 @@
 # CONFIG_3C515 is not set
 CONFIG_ACPI=y
 CONFIG_ACPI_AC=y
-# CONFIG_ACPI_ALS is not set
 CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
 # CONFIG_ACPI_CMPC is not set
@@ -39,13 +38,11 @@ CONFIG_AGP_INTEL=y
 # CONFIG_AGP_SIS is not set
 # CONFIG_AGP_SWORKS is not set
 # CONFIG_AGP_VIA is not set
-# CONFIG_APPLE_GMUX is not set
 CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
 # CONFIG_BACKLIGHT_APPLE is not set
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_GENERIC=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
-# CONFIG_BACKLIGHT_SAHARA is not set
 CONFIG_BLK_DEV_SR=y
 # CONFIG_BLK_DEV_SR_VENDOR is not set
 CONFIG_CLKDEV_LOOKUP=y
@@ -111,7 +108,6 @@ CONFIG_FONT_SUPPORT=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
-# CONFIG_FUJITSU_LAPTOP is not set
 CONFIG_HAVE_ACPI_APEI=y
 CONFIG_HAVE_ACPI_APEI_NMI=y
 CONFIG_HAVE_CLK=y
@@ -164,10 +160,8 @@ CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_VSXXXAA is not set
-CONFIG_NLS=y
 CONFIG_NOHIGHMEM=y
 CONFIG_NO_HZ=y
-# CONFIG_PANASONIC_LAPTOP is not set
 CONFIG_PATA_AMD=y
 CONFIG_PATA_ATIIXP=y
 CONFIG_PATA_LEGACY=y
@@ -178,7 +172,6 @@ CONFIG_PATA_SC1200=y
 CONFIG_PATA_VIA=y
 CONFIG_PCIEAER=y
 CONFIG_PCIEPORTBUS=y
-CONFIG_PCI_LABEL=y
 CONFIG_PCI_MMCONFIG=y
 # CONFIG_PCWATCHDOG is not set
 # CONFIG_PMIC_OPREGION is not set
@@ -207,7 +200,6 @@ CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
 # CONFIG_WDT is not set
 CONFIG_X86_ACPI_CPUFREQ=y
 # CONFIG_X86_ACPI_CPUFREQ_CPB is not set
-# CONFIG_X86_POWERNOW_K8 is not set
 # CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
 # CONFIG_X86_AMD_PLATFORM_DEVICE is not set
 # CONFIG_X86_E_POWERSAVER is not set
@@ -216,4 +208,4 @@ CONFIG_X86_ACPI_CPUFREQ=y
 # CONFIG_X86_PAE is not set
 # CONFIG_X86_PCC_CPUFREQ is not set
 CONFIG_X86_PM_TIMER=y
-# CONFIG_X86_X2APIC is not set
+# CONFIG_X86_POWERNOW_K8 is not set


From lede-commits at lists.infradead.org  Mon Oct 16 02:05:25 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 05:05:25 -0400
Subject: [source]  x86/64: add xen DomU support
In-Reply-To: <20171016090512.5587.12070@git-01.infra.lede-project.org>
References: <20171016090512.5587.12070@git-01.infra.lede-project.org>
Message-ID: <mailman.54517.1508144761.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/cdd093b5399d5962a44680aef74e2034f4bcf64a

commit cdd093b5399d5962a44680aef74e2034f4bcf64a
Author: Baptiste Jonglez <git at bitsofnetworks.org>
AuthorDate: Sat Jul 15 22:57:56 2017 +0200

    x86/64: add xen DomU support
    
    Xen support for x86/generic was added in 296772f9.  This commit also
    enables it for x86/64.
    
    This was successfully tested with Xen 4.5.
    
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
---
 target/linux/x86/64/config-default | 59 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default
index 9ca2cc9..b7028e4 100644
--- a/target/linux/x86/64/config-default
+++ b/target/linux/x86/64/config-default
@@ -5,7 +5,7 @@ CONFIG_ACPI_BATTERY=y
 # CONFIG_ACPI_BGRT is not set
 CONFIG_ACPI_BUTTON=y
 # CONFIG_ACPI_CMPC is not set
-# CONFIG_ACPI_CONTAINER is not set
+CONFIG_ACPI_CONTAINER=y
 CONFIG_ACPI_CPU_FREQ_PSS=y
 # CONFIG_ACPI_CUSTOM_DSDT is not set
 # CONFIG_ACPI_DEBUG is not set
@@ -13,6 +13,7 @@ CONFIG_ACPI_CPU_FREQ_PSS=y
 # CONFIG_ACPI_DOCK is not set
 # CONFIG_ACPI_EC_DEBUGFS is not set
 CONFIG_ACPI_FAN=y
+CONFIG_ACPI_HOTPLUG_CPU=y
 CONFIG_ACPI_HOTPLUG_IOAPIC=y
 # CONFIG_ACPI_INITRD_TABLE_OVERRIDE is not set
 CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y
@@ -46,6 +47,7 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_GENERIC=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_BLK_DEV_INTEGRITY=y
+# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set
 CONFIG_CALGARY_IOMMU=y
 CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y
 CONFIG_CONNECTOR=y
@@ -87,6 +89,7 @@ CONFIG_CRYPTO_NULL2=y
 # CONFIG_CRYPTO_TWOFISH_X86_64 is not set
 # CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set
 CONFIG_CRYPTO_XTS=y
+# CONFIG_DEBUG_HOTPLUG_CPU0 is not set
 # CONFIG_EARLY_PRINTK_EFI is not set
 CONFIG_EFI=y
 CONFIG_EFIVAR_FS=m
@@ -103,9 +106,14 @@ CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_IMAGEBLIT=y
 CONFIG_FB_CMDLINE=y
+CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_EFI is not set
 CONFIG_FB_HYPERV=y
 CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_FOPS=y
+CONFIG_FB_SYS_IMAGEBLIT=y
 CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_VESA is not set
 # CONFIG_FONTS is not set
@@ -115,6 +123,7 @@ CONFIG_FONT_SUPPORT=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+CONFIG_FREEZER=y
 CONFIG_GART_IOMMU=y
 CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
 CONFIG_GENERIC_CPU=y
@@ -142,10 +151,12 @@ CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
 CONFIG_HAVE_LIVEPATCH=y
 CONFIG_HAVE_MEMORY_PRESENT=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HIBERNATE_CALLBACKS=y
 CONFIG_HID=y
 CONFIG_HID_BATTERY_STRENGTH=y
 CONFIG_HID_GENERIC=y
 CONFIG_HID_HYPERV_MOUSE=y
+CONFIG_HOTPLUG_CPU=y
 CONFIG_HOTPLUG_PCI=y
 CONFIG_HOTPLUG_PCI_ACPI=y
 # CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
@@ -156,6 +167,9 @@ CONFIG_HPET=y
 CONFIG_HPET_MMAP=y
 # CONFIG_HP_ACCEL is not set
 CONFIG_HVC_DRIVER=y
+CONFIG_HVC_IRQ=y
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
 CONFIG_HW_RANDOM_AMD=y
 CONFIG_HW_RANDOM_INTEL=y
 CONFIG_HW_RANDOM_VIRTIO=y
@@ -169,6 +183,7 @@ CONFIG_HYPERV_UTILS=y
 # CONFIG_I7300_IDLE is not set
 # CONFIG_IA32_EMULATION is not set
 CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
 # CONFIG_INTEL_IPS is not set
 # CONFIG_INTEL_MENLOW is not set
 # CONFIG_INTEL_MIC_BUS is not set
@@ -201,6 +216,7 @@ CONFIG_MMC_SDHCI_PCI=y
 # CONFIG_MMC_SDHCI_PLTFM is not set
 # CONFIG_MMC_TIFM_SD is not set
 # CONFIG_MMC_WBSD is not set
+CONFIG_MMU_NOTIFIER=y
 CONFIG_MODULES_USE_ELF_RELA=y
 # CONFIG_MPSC is not set
 CONFIG_MUTEX_SPIN_ON_OWNER=y
@@ -223,12 +239,18 @@ CONFIG_PATA_PLATFORM=y
 CONFIG_PATA_VIA=y
 CONFIG_PCIEAER=y
 CONFIG_PCIEPORTBUS=y
+CONFIG_PCIE_PME=y
 CONFIG_PCI_BUS_ADDR_T_64BIT=y
 # CONFIG_PCI_MMCONFIG is not set
+CONFIG_PCI_XEN=y
 CONFIG_PGTABLE_LEVELS=4
 CONFIG_PHYSICAL_ALIGN=0x1000000
 CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_PM=y
 # CONFIG_PMIC_OPREGION is not set
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_PM_SLEEP_SMP=y
 CONFIG_PNP=y
 CONFIG_PNPACPI=y
 CONFIG_PNP_DEBUG_MESSAGES=y
@@ -259,6 +281,8 @@ CONFIG_SPARSEMEM_MANUAL=y
 CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 # CONFIG_SURFACE_PRO3_BUTTON is not set
 CONFIG_SWIOTLB=y
+CONFIG_SWIOTLB_XEN=y
+CONFIG_SYS_HYPERVISOR=y
 # CONFIG_THUNDER_NIC_BGX is not set
 # CONFIG_THUNDER_NIC_PF is not set
 # CONFIG_THUNDER_NIC_VF is not set
@@ -297,6 +321,7 @@ CONFIG_VMWARE_VMCI=y
 CONFIG_VMWARE_VMCI_VSOCKETS=y
 CONFIG_VMXNET3=y
 CONFIG_VSOCKETS=y
+CONFIG_VT_CONSOLE_SLEEP=y
 CONFIG_WATCHDOG_CORE=y
 CONFIG_X86_64=y
 CONFIG_X86_64_SMP=y
@@ -320,5 +345,37 @@ CONFIG_X86_TSC=y
 # CONFIG_X86_VSYSCALL_EMULATION is not set
 CONFIG_X86_X2APIC=y
 # CONFIG_X86_X32 is not set
+CONFIG_XEN=y
+CONFIG_XENFS=y
+CONFIG_XEN_512GB=y
+CONFIG_XEN_ACPI=y
+CONFIG_XEN_ACPI_PROCESSOR=y
+CONFIG_XEN_AUTO_XLATE=y
+# CONFIG_XEN_BACKEND is not set
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_DEBUG_FS=y
+CONFIG_XEN_DEV_EVTCHN=y
+CONFIG_XEN_DOM0=y
+CONFIG_XEN_EFI=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+CONFIG_XEN_HAVE_PVMMU=y
+CONFIG_XEN_HAVE_VPMU=y
+# CONFIG_XEN_MCE_LOG is not set
+CONFIG_XEN_NETDEV_FRONTEND=y
+CONFIG_XEN_PCIDEV_FRONTEND=y
+CONFIG_XEN_PRIVCMD=y
+CONFIG_XEN_PVH=y
+CONFIG_XEN_PVHVM=y
+CONFIG_XEN_SAVE_RESTORE=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_SCSI_FRONTEND=y
+CONFIG_XEN_SYMS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_WDT=y
+CONFIG_XEN_XENBUS_FRONTEND=y
 CONFIG_XPS=y
 CONFIG_ZONE_DMA32=y


From lede-commits at lists.infradead.org  Mon Oct 16 03:02:16 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 06:02:16 -0400
Subject: [source] hostapd: merge fixes for WPA packet number reuse with
 replayed messages and key reinstallation
In-Reply-To: <20171016100211.23156.81680@git-01.infra.lede-project.org>
References: <20171016100211.23156.81680@git-01.infra.lede-project.org>
Message-ID: <mailman.54527.1508148178.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/bbda81ce3077dfade2a43a39f772cfec2e82a9a5

commit bbda81ce3077dfade2a43a39f772cfec2e82a9a5
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Oct 16 11:39:23 2017 +0200

    hostapd: merge fixes for WPA packet number reuse with replayed messages and key reinstallation
    
    Fixes:
    - CERT case ID: VU#228519
    - CVE-2017-13077
    - CVE-2017-13078
    - CVE-2017-13079
    - CVE-2017-13080
    - CVE-2017-13081
    - CVE-2017-13082
    - CVE-2017-13086
    - CVE-2017-13087
    - CVE-2017-13088
    
    For more information see:
    https://w1.fi/security/2017-1/wpa-packet-number-reuse-with-replayed-messages.txt
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...-Avoid-key-reinstallation-in-FT-handshake.patch | 154 +++++++++++++
 ...nstallation-of-an-already-in-use-group-ke.patch | 244 +++++++++++++++++++++
 ...ection-of-GTK-IGTK-reinstallation-of-WNM-.patch | 182 +++++++++++++++
 ...03-Prevent-installation-of-an-all-zero-TK.patch |  73 ++++++
 ...Fix-PTK-rekeying-to-generate-a-new-ANonce.patch |  56 +++++
 .../005-TDLS-Reject-TPK-TK-reconfiguration.patch   | 124 +++++++++++
 ...WNM-Sleep-Mode-Response-without-pending-r.patch |  35 +++
 ...llow-multiple-Reassociation-Response-fram.patch |  68 ++++++
 .../services/hostapd/patches/200-multicall.patch   |   2 +-
 .../patches/350-nl80211_del_beacon_bss.patch       |  12 +-
 .../hostapd/patches/370-ap_sta_support.patch       |   2 +-
 .../patches/380-disable_ctrl_iface_mib.patch       |   8 +-
 .../hostapd/patches/430-hostapd_cli_ifdef.patch    |   8 +-
 .../hostapd/patches/600-ubus_support.patch         |  26 +--
 14 files changed, 965 insertions(+), 29 deletions(-)

diff --git a/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch b/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
new file mode 100644
index 0000000..14b2d7c
--- /dev/null
+++ b/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
@@ -0,0 +1,154 @@
+From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+Date: Fri, 14 Jul 2017 15:15:35 +0200
+Subject: [PATCH] hostapd: Avoid key reinstallation in FT handshake
+
+Do not reinstall TK to the driver during Reassociation Response frame
+processing if the first attempt of setting the TK succeeded. This avoids
+issues related to clearing the TX/RX PN that could result in reusing
+same PN values for transmitted frames (e.g., due to CCM nonce reuse and
+also hitting replay protection on the receiver) and accepting replayed
+frames on RX side.
+
+This issue was introduced by the commit
+0e84c25434e6a1f283c7b4e62e483729085b78d2 ('FT: Fix PTK configuration in
+authenticator') which allowed wpa_ft_install_ptk() to be called multiple
+times with the same PTK. While the second configuration attempt is
+needed with some drivers, it must be done only if the first attempt
+failed.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+---
+
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -2522,6 +2522,7 @@ static int add_associated_sta(struct hos
+ {
+ 	struct ieee80211_ht_capabilities ht_cap;
+ 	struct ieee80211_vht_capabilities vht_cap;
++	int set = 1;
+ 
+ 	/*
+ 	 * Remove the STA entry to ensure the STA PS state gets cleared and
+@@ -2529,9 +2530,18 @@ static int add_associated_sta(struct hos
+ 	 * FT-over-the-DS, where a station re-associates back to the same AP but
+ 	 * skips the authentication flow, or if working with a driver that
+ 	 * does not support full AP client state.
++	 *
++	 * Skip this if the STA has already completed FT reassociation and the
++	 * TK has been configured since the TX/RX PN must not be reset to 0 for
++	 * the same key.
+ 	 */
+-	if (!sta->added_unassoc)
++	if (!sta->added_unassoc &&
++	    (!(sta->flags & WLAN_STA_AUTHORIZED) ||
++	     !wpa_auth_sta_ft_tk_already_set(sta->wpa_sm))) {
+ 		hostapd_drv_sta_remove(hapd, sta->addr);
++		wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
++		set = 0;
++	}
+ 
+ #ifdef CONFIG_IEEE80211N
+ 	if (sta->flags & WLAN_STA_HT)
+@@ -2554,11 +2564,11 @@ static int add_associated_sta(struct hos
+ 			    sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
+ 			    sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
+ 			    sta->vht_opmode, sta->p2p_ie ? 1 : 0,
+-			    sta->added_unassoc)) {
++			    set)) {
+ 		hostapd_logger(hapd, sta->addr,
+ 			       HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
+ 			       "Could not %s STA to kernel driver",
+-			       sta->added_unassoc ? "set" : "add");
++			       set ? "set" : "add");
+ 
+ 		if (sta->added_unassoc) {
+ 			hostapd_drv_sta_remove(hapd, sta->addr);
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1783,6 +1783,9 @@ int wpa_auth_sm_event(struct wpa_state_m
+ #else /* CONFIG_FILS */
+ 		break;
+ #endif /* CONFIG_FILS */
++	case WPA_DRV_STA_REMOVED:
++		sm->tk_already_set = FALSE;
++		return 0;
+ 	}
+ 
+ #ifdef CONFIG_IEEE80211R_AP
+@@ -3922,6 +3925,14 @@ int wpa_auth_sta_wpa_version(struct wpa_
+ }
+ 
+ 
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm)
++{
++	if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt))
++		return 0;
++	return sm->tk_already_set;
++}
++
++
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry)
+ {
+--- a/src/ap/wpa_auth.h
++++ b/src/ap/wpa_auth.h
+@@ -300,7 +300,7 @@ void wpa_receive(struct wpa_authenticato
+ 		 u8 *data, size_t data_len);
+ enum wpa_event {
+ 	WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
+-	WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS
++	WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS, WPA_DRV_STA_REMOVED
+ };
+ void wpa_remove_ptk(struct wpa_state_machine *sm);
+ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event);
+@@ -313,6 +313,7 @@ int wpa_auth_pairwise_set(struct wpa_sta
+ int wpa_auth_get_pairwise(struct wpa_state_machine *sm);
+ int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
+ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry);
+ struct rsn_pmksa_cache_entry *
+--- a/src/ap/wpa_auth_ft.c
++++ b/src/ap/wpa_auth_ft.c
+@@ -1937,6 +1937,14 @@ void wpa_ft_install_ptk(struct wpa_state
+ 		return;
+ 	}
+ 
++	if (sm->tk_already_set) {
++		/* Must avoid TK reconfiguration to prevent clearing of TX/RX
++		 * PN in the driver */
++		wpa_printf(MSG_DEBUG,
++			   "FT: Do not re-install same PTK to the driver");
++		return;
++	}
++
+ 	/* FIX: add STA entry to kernel/driver here? The set_key will fail
+ 	 * most likely without this.. At the moment, STA entry is added only
+ 	 * after association has been completed. This function will be called
+@@ -1949,6 +1957,7 @@ void wpa_ft_install_ptk(struct wpa_state
+ 
+ 	/* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */
+ 	sm->pairwise_set = TRUE;
++	sm->tk_already_set = TRUE;
+ }
+ 
+ 
+@@ -2152,6 +2161,7 @@ static int wpa_ft_process_auth_req(struc
+ 
+ 	sm->pairwise = pairwise;
+ 	sm->PTK_valid = TRUE;
++	sm->tk_already_set = FALSE;
+ 	wpa_ft_install_ptk(sm);
+ 
+ 	buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+--- a/src/ap/wpa_auth_i.h
++++ b/src/ap/wpa_auth_i.h
+@@ -61,6 +61,7 @@ struct wpa_state_machine {
+ 	struct wpa_ptk PTK;
+ 	Boolean PTK_valid;
+ 	Boolean pairwise_set;
++	Boolean tk_already_set;
+ 	int keycount;
+ 	Boolean Pair;
+ 	struct wpa_key_replay_counter {
diff --git a/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch b/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
new file mode 100644
index 0000000..b283bf8
--- /dev/null
+++ b/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
@@ -0,0 +1,244 @@
+From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+Date: Wed, 12 Jul 2017 16:03:24 +0200
+Subject: [PATCH] Prevent reinstallation of an already in-use group key
+
+Track the current GTK and IGTK that is in use and when receiving a
+(possibly retransmitted) Group Message 1 or WNM-Sleep Mode Response, do
+not install the given key if it is already in use. This prevents an
+attacker from trying to trick the client into resetting or lowering the
+sequence counter associated to the group key.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+---
+
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -218,6 +218,17 @@ struct wpa_ptk {
+ 	size_t tk_len;
+ };
+ 
++struct wpa_gtk {
++	u8 gtk[WPA_GTK_MAX_LEN];
++	size_t gtk_len;
++};
++
++#ifdef CONFIG_IEEE80211W
++struct wpa_igtk {
++	u8 igtk[WPA_IGTK_MAX_LEN];
++	size_t igtk_len;
++};
++#endif /* CONFIG_IEEE80211W */
+ 
+ /* WPA IE version 1
+  * 00-50-f2:1 (OUI:OUI type)
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -800,6 +800,15 @@ static int wpa_supplicant_install_gtk(st
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
++	/* Detect possible key reinstallation */
++	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
++			gd->keyidx, gd->tx, gd->gtk_len);
++		return 0;
++	}
++
+ 	wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len);
+ 	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 		"WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)",
+@@ -834,6 +843,9 @@ static int wpa_supplicant_install_gtk(st
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
++	sm->gtk.gtk_len = gd->gtk_len;
++	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++
+ 	return 0;
+ }
+ 
+@@ -940,6 +952,48 @@ static int wpa_supplicant_pairwise_gtk(s
+ }
+ 
+ 
++#ifdef CONFIG_IEEE80211W
++static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
++				       const struct wpa_igtk_kde *igtk)
++{
++	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
++	u16 keyidx = WPA_GET_LE16(igtk->keyid);
++
++	/* Detect possible key reinstallation */
++	if (sm->igtk.igtk_len == len &&
++	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
++			keyidx);
++		return  0;
++	}
++
++	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++		"WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
++		keyidx, MAC2STR(igtk->pn));
++	wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
++	if (keyidx > 4095) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Invalid IGTK KeyID %d", keyidx);
++		return -1;
++	}
++	if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
++			   broadcast_ether_addr,
++			   keyidx, 0, igtk->pn, sizeof(igtk->pn),
++			   igtk->igtk, len) < 0) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Failed to configure IGTK to the driver");
++		return -1;
++	}
++
++	sm->igtk.igtk_len = len;
++	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++
++	return 0;
++}
++#endif /* CONFIG_IEEE80211W */
++
++
+ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 			       struct wpa_eapol_ie_parse *ie)
+ {
+@@ -950,30 +1004,14 @@ static int ieee80211w_set_keys(struct wp
+ 	if (ie->igtk) {
+ 		size_t len;
+ 		const struct wpa_igtk_kde *igtk;
+-		u16 keyidx;
++
+ 		len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 		if (ie->igtk_len != WPA_IGTK_KDE_PREFIX_LEN + len)
+ 			return -1;
++
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		keyidx = WPA_GET_LE16(igtk->keyid);
+-		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: IGTK keyid %d "
+-			"pn %02x%02x%02x%02x%02x%02x",
+-			keyidx, MAC2STR(igtk->pn));
+-		wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK",
+-				igtk->igtk, len);
+-		if (keyidx > 4095) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Invalid IGTK KeyID %d", keyidx);
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igtk->pn, sizeof(igtk->pn),
+-				   igtk->igtk, len) < 0) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Failed to configure IGTK to the driver");
+-			return -1;
+-		}
+ 	}
+ 
+ 	return 0;
+@@ -2491,7 +2529,7 @@ void wpa_sm_deinit(struct wpa_sm *sm)
+  */
+ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ {
+-	int clear_ptk = 1;
++	int clear_keys = 1;
+ 
+ 	if (sm == NULL)
+ 		return;
+@@ -2517,7 +2555,7 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		/* Prepare for the next transition */
+ 		wpa_ft_prepare_auth_request(sm, NULL);
+ 
+-		clear_ptk = 0;
++		clear_keys = 0;
+ 	}
+ #endif /* CONFIG_IEEE80211R */
+ #ifdef CONFIG_FILS
+@@ -2527,11 +2565,11 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		 * AUTHENTICATED state to get the EAPOL port Authorized.
+ 		 */
+ 		wpa_supplicant_key_neg_complete(sm, sm->bssid, 1);
+-		clear_ptk = 0;
++		clear_keys = 0;
+ 	}
+ #endif /* CONFIG_FILS */
+ 
+-	if (clear_ptk) {
++	if (clear_keys) {
+ 		/*
+ 		 * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if
+ 		 * this is not part of a Fast BSS Transition.
+@@ -2541,6 +2579,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+ #ifdef CONFIG_TDLS
+@@ -3117,6 +3159,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(sm->pmk, 0, sizeof(sm->pmk));
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+ 	os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0));
+@@ -3189,29 +3235,11 @@ int wpa_wnmsleep_install_key(struct wpa_
+ 		os_memset(&gd, 0, sizeof(gd));
+ #ifdef CONFIG_IEEE80211W
+ 	} else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) {
+-		struct wpa_igtk_kde igd;
+-		u16 keyidx;
++		const struct wpa_igtk_kde *igtk;
+ 
+-		os_memset(&igd, 0, sizeof(igd));
+-		keylen = wpa_cipher_key_len(sm->mgmt_group_cipher);
+-		os_memcpy(igd.keyid, buf + 2, 2);
+-		os_memcpy(igd.pn, buf + 4, 6);
+-
+-		keyidx = WPA_GET_LE16(igd.keyid);
+-		os_memcpy(igd.igtk, buf + 10, keylen);
+-
+-		wpa_hexdump_key(MSG_DEBUG, "Install IGTK (WNM SLEEP)",
+-				igd.igtk, keylen);
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igd.pn, sizeof(igd.pn),
+-				   igd.igtk, keylen) < 0) {
+-			wpa_printf(MSG_DEBUG, "Failed to install the IGTK in "
+-				   "WNM mode");
+-			os_memset(&igd, 0, sizeof(igd));
++		igtk = (const struct wpa_igtk_kde *) (buf + 2);
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+-		os_memset(&igd, 0, sizeof(igd));
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+ 		wpa_printf(MSG_DEBUG, "Unknown element id");
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -31,6 +31,10 @@ struct wpa_sm {
+ 	u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
++	struct wpa_gtk gtk;
++#ifdef CONFIG_IEEE80211W
++	struct wpa_igtk igtk;
++#endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+ 
diff --git a/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch b/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
new file mode 100644
index 0000000..2093d25
--- /dev/null
+++ b/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
@@ -0,0 +1,182 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Sun, 1 Oct 2017 12:12:24 +0300
+Subject: [PATCH] Extend protection of GTK/IGTK reinstallation of WNM-Sleep
+ Mode cases
+
+This extends the protection to track last configured GTK/IGTK value
+separately from EAPOL-Key frames and WNM-Sleep Mode frames to cover a
+corner case where these two different mechanisms may get used when the
+GTK/IGTK has changed and tracking a single value is not sufficient to
+detect a possible key reconfiguration.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -795,14 +795,17 @@ struct wpa_gtk_data {
+ 
+ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 				      const struct wpa_gtk_data *gd,
+-				      const u8 *key_rsc)
++				      const u8 *key_rsc, int wnm_sleep)
+ {
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
+-	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++	if ((sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) ||
++	    (sm->gtk_wnm_sleep.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk_wnm_sleep.gtk, gd->gtk,
++		       sm->gtk_wnm_sleep.gtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
+ 			gd->keyidx, gd->tx, gd->gtk_len);
+@@ -843,8 +846,14 @@ static int wpa_supplicant_install_gtk(st
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
+-	sm->gtk.gtk_len = gd->gtk_len;
+-	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	if (wnm_sleep) {
++		sm->gtk_wnm_sleep.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk_wnm_sleep.gtk, gd->gtk,
++			  sm->gtk_wnm_sleep.gtk_len);
++	} else {
++		sm->gtk.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -938,7 +947,7 @@ static int wpa_supplicant_pairwise_gtk(s
+ 	    (wpa_supplicant_check_group_cipher(sm, sm->group_cipher,
+ 					       gtk_len, gtk_len,
+ 					       &gd.key_rsc_len, &gd.alg) ||
+-	     wpa_supplicant_install_gtk(sm, &gd, key_rsc))) {
++	     wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0))) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"RSN: Failed to install GTK");
+ 		os_memset(&gd, 0, sizeof(gd));
+@@ -954,14 +963,18 @@ static int wpa_supplicant_pairwise_gtk(s
+ 
+ #ifdef CONFIG_IEEE80211W
+ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+-				       const struct wpa_igtk_kde *igtk)
++				       const struct wpa_igtk_kde *igtk,
++				       int wnm_sleep)
+ {
+ 	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 	u16 keyidx = WPA_GET_LE16(igtk->keyid);
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->igtk.igtk_len == len &&
+-	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++	if ((sm->igtk.igtk_len == len &&
++	     os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) ||
++	    (sm->igtk_wnm_sleep.igtk_len == len &&
++	     os_memcmp(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++		       sm->igtk_wnm_sleep.igtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
+ 			keyidx);
+@@ -986,8 +999,14 @@ static int wpa_supplicant_install_igtk(s
+ 		return -1;
+ 	}
+ 
+-	sm->igtk.igtk_len = len;
+-	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	if (wnm_sleep) {
++		sm->igtk_wnm_sleep.igtk_len = len;
++		os_memcpy(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++			  sm->igtk_wnm_sleep.igtk_len);
++	} else {
++		sm->igtk.igtk_len = len;
++		os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -1010,7 +1029,7 @@ static int ieee80211w_set_keys(struct wp
+ 			return -1;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 0) < 0)
+ 			return -1;
+ 	}
+ 
+@@ -1659,7 +1678,7 @@ static void wpa_supplicant_process_1_of_
+ 	if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc))
+ 		key_rsc = null_rsc;
+ 
+-	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc) ||
++	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0) ||
+ 	    wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0)
+ 		goto failed;
+ 	os_memset(&gd, 0, sizeof(gd));
+@@ -2580,8 +2599,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++		os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++		os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+@@ -3160,8 +3181,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++	os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++	os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+@@ -3226,7 +3249,7 @@ int wpa_wnmsleep_install_key(struct wpa_
+ 
+ 		wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)",
+ 				gd.gtk, gd.gtk_len);
+-		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc)) {
++		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 1)) {
+ 			os_memset(&gd, 0, sizeof(gd));
+ 			wpa_printf(MSG_DEBUG, "Failed to install the GTK in "
+ 				   "WNM mode");
+@@ -3238,7 +3261,7 @@ int wpa_wnmsleep_install_key(struct wpa_
+ 		const struct wpa_igtk_kde *igtk;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) (buf + 2);
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0)
+ 			return -1;
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+@@ -4121,7 +4144,7 @@ int fils_process_assoc_resp(struct wpa_s
+ 	os_memcpy(gd.gtk, kde.gtk + 2, kde.gtk_len - 2);
+ 
+ 	wpa_printf(MSG_DEBUG, "FILS: Set GTK to driver");
+-	if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery) < 0) {
++	if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery, 0) < 0) {
+ 		wpa_printf(MSG_DEBUG, "FILS: Failed to set GTK");
+ 		goto fail;
+ 	}
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -32,8 +32,10 @@ struct wpa_sm {
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
+ 	struct wpa_gtk gtk;
++	struct wpa_gtk gtk_wnm_sleep;
+ #ifdef CONFIG_IEEE80211W
+ 	struct wpa_igtk igtk;
++	struct wpa_igtk igtk_wnm_sleep;
+ #endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
diff --git a/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch b/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch
new file mode 100644
index 0000000..30679e2
--- /dev/null
+++ b/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch
@@ -0,0 +1,73 @@
+From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+Date: Fri, 29 Sep 2017 04:22:51 +0200
+Subject: [PATCH] Prevent installation of an all-zero TK
+
+Properly track whether a PTK has already been installed to the driver
+and the TK part cleared from memory. This prevents an attacker from
+trying to trick the client into installing an all-zero TK.
+
+This fixes the earlier fix in commit
+ad00d64e7d8827b3cebd665a0ceb08adabf15e1e ('Fix TK configuration to the
+driver in EAPOL-Key 3/4 retry case') which did not take into account
+possibility of an extra message 1/4 showing up between retries of
+message 3/4.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+---
+
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -216,6 +216,7 @@ struct wpa_ptk {
+ 	size_t kck_len;
+ 	size_t kek_len;
+ 	size_t tk_len;
++	int installed; /* 1 if key has already been installed to driver */
+ };
+ 
+ struct wpa_gtk {
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -594,7 +594,6 @@ static void wpa_supplicant_process_1_of_
+ 		os_memset(buf, 0, sizeof(buf));
+ 	}
+ 	sm->tptk_set = 1;
+-	sm->tk_to_set = 1;
+ 
+ 	kde = sm->assoc_wpa_ie;
+ 	kde_len = sm->assoc_wpa_ie_len;
+@@ -701,7 +700,7 @@ static int wpa_supplicant_install_ptk(st
+ 	enum wpa_alg alg;
+ 	const u8 *key_rsc;
+ 
+-	if (!sm->tk_to_set) {
++	if (sm->ptk.installed) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Do not re-install same PTK to the driver");
+ 		return 0;
+@@ -745,7 +744,7 @@ static int wpa_supplicant_install_ptk(st
+ 
+ 	/* TK is not needed anymore in supplicant */
+ 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
+-	sm->tk_to_set = 0;
++	sm->ptk.installed = 1;
+ 
+ 	if (sm->wpa_ptk_rekey) {
+ 		eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL);
+@@ -4172,6 +4171,7 @@ int fils_process_assoc_resp(struct wpa_s
+ 	 * takes care of association frame encryption/decryption. */
+ 	/* TK is not needed anymore in supplicant */
+ 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
++	sm->ptk.installed = 1;
+ 
+ 	/* FILS HLP Container */
+ 	fils_process_hlp_container(sm, ie_start, end - ie_start);
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -24,7 +24,6 @@ struct wpa_sm {
+ 	struct wpa_ptk ptk, tptk;
+ 	int ptk_set, tptk_set;
+ 	unsigned int msg_3_of_4_ok:1;
+-	unsigned int tk_to_set:1;
+ 	u8 snonce[WPA_NONCE_LEN];
+ 	u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
+ 	int renew_snonce;
diff --git a/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch b/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
new file mode 100644
index 0000000..6f28e74
--- /dev/null
+++ b/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
@@ -0,0 +1,56 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Sun, 1 Oct 2017 12:32:57 +0300
+Subject: [PATCH] Fix PTK rekeying to generate a new ANonce
+
+The Authenticator state machine path for PTK rekeying ended up bypassing
+the AUTHENTICATION2 state where a new ANonce is generated when going
+directly to the PTKSTART state since there is no need to try to
+determine the PMK again in such a case. This is far from ideal since the
+new PTK would depend on a new nonce only from the supplicant.
+
+Fix this by generating a new ANonce when moving to the PTKSTART state
+for the purpose of starting new 4-way handshake to rekey PTK.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1951,6 +1951,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2)
+ }
+ 
+ 
++static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm)
++{
++	if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
++		wpa_printf(MSG_ERROR,
++			   "WPA: Failed to get random data for ANonce");
++		sm->Disconnect = TRUE;
++		return -1;
++	}
++	wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce,
++		    WPA_NONCE_LEN);
++	sm->TimeoutCtr = 0;
++	return 0;
++}
++
++
+ SM_STATE(WPA_PTK, INITPMK)
+ {
+ 	u8 msk[2 * PMK_LEN];
+@@ -3116,9 +3131,12 @@ SM_STEP(WPA_PTK)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION);
+ 	else if (sm->ReAuthenticationRequest)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION2);
+-	else if (sm->PTKRequest)
+-		SM_ENTER(WPA_PTK, PTKSTART);
+-	else switch (sm->wpa_ptk_state) {
++	else if (sm->PTKRequest) {
++		if (wpa_auth_sm_ptk_update(sm) < 0)
++			SM_ENTER(WPA_PTK, DISCONNECTED);
++		else
++			SM_ENTER(WPA_PTK, PTKSTART);
++	} else switch (sm->wpa_ptk_state) {
+ 	case WPA_PTK_INITIALIZE:
+ 		break;
+ 	case WPA_PTK_DISCONNECT:
diff --git a/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch b/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch
new file mode 100644
index 0000000..2ca05dd
--- /dev/null
+++ b/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch
@@ -0,0 +1,124 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 22 Sep 2017 11:03:15 +0300
+Subject: [PATCH] TDLS: Reject TPK-TK reconfiguration
+
+Do not try to reconfigure the same TPK-TK to the driver after it has
+been successfully configured. This is an explicit check to avoid issues
+related to resetting the TX/RX packet number. There was already a check
+for this for TPK M2 (retries of that message are ignored completely), so
+that behavior does not get modified.
+
+For TPK M3, the TPK-TK could have been reconfigured, but that was
+followed by immediate teardown of the link due to an issue in updating
+the STA entry. Furthermore, for TDLS with any real security (i.e.,
+ignoring open/WEP), the TPK message exchange is protected on the AP path
+and simple replay attacks are not feasible.
+
+As an additional corner case, make sure the local nonce gets updated if
+the peer uses a very unlikely "random nonce" of all zeros.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/rsn_supp/tdls.c
++++ b/src/rsn_supp/tdls.c
+@@ -112,6 +112,7 @@ struct wpa_tdls_peer {
+ 		u8 tk[16]; /* TPK-TK; assuming only CCMP will be used */
+ 	} tpk;
+ 	int tpk_set;
++	int tk_set; /* TPK-TK configured to the driver */
+ 	int tpk_success;
+ 	int tpk_in_progress;
+ 
+@@ -192,6 +193,20 @@ static int wpa_tdls_set_key(struct wpa_s
+ 	u8 rsc[6];
+ 	enum wpa_alg alg;
+ 
++	if (peer->tk_set) {
++		/*
++		 * This same TPK-TK has already been configured to the driver
++		 * and this new configuration attempt (likely due to an
++		 * unexpected retransmitted frame) would result in clearing
++		 * the TX/RX sequence number which can break security, so must
++		 * not allow that to happen.
++		 */
++		wpa_printf(MSG_INFO, "TDLS: TPK-TK for the peer " MACSTR
++			   " has already been configured to the driver - do not reconfigure",
++			   MAC2STR(peer->addr));
++		return -1;
++	}
++
+ 	os_memset(rsc, 0, 6);
+ 
+ 	switch (peer->cipher) {
+@@ -209,12 +224,15 @@ static int wpa_tdls_set_key(struct wpa_s
+ 		return -1;
+ 	}
+ 
++	wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR,
++		   MAC2STR(peer->addr));
+ 	if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1,
+ 			   rsc, sizeof(rsc), peer->tpk.tk, key_len) < 0) {
+ 		wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the "
+ 			   "driver");
+ 		return -1;
+ 	}
++	peer->tk_set = 1;
+ 	return 0;
+ }
+ 
+@@ -695,7 +713,7 @@ static void wpa_tdls_peer_clear(struct w
+ 	peer->cipher = 0;
+ 	peer->qos_info = 0;
+ 	peer->wmm_capable = 0;
+-	peer->tpk_set = peer->tpk_success = 0;
++	peer->tk_set = peer->tpk_set = peer->tpk_success = 0;
+ 	peer->chan_switch_enabled = 0;
+ 	os_memset(&peer->tpk, 0, sizeof(peer->tpk));
+ 	os_memset(peer->inonce, 0, WPA_NONCE_LEN);
+@@ -1158,6 +1176,7 @@ skip_rsnie:
+ 		wpa_tdls_peer_free(sm, peer);
+ 		return -1;
+ 	}
++	peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	wpa_hexdump(MSG_DEBUG, "TDLS: Initiator Nonce for TPK handshake",
+ 		    peer->inonce, WPA_NONCE_LEN);
+ 	os_memcpy(ftie->Snonce, peer->inonce, WPA_NONCE_LEN);
+@@ -1751,6 +1770,19 @@ static int wpa_tdls_addset_peer(struct w
+ }
+ 
+ 
++static int tdls_nonce_set(const u8 *nonce)
++{
++	int i;
++
++	for (i = 0; i < WPA_NONCE_LEN; i++) {
++		if (nonce[i])
++			return 1;
++	}
++
++	return 0;
++}
++
++
+ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
+ 				   const u8 *buf, size_t len)
+ {
+@@ -2004,7 +2036,8 @@ skip_rsn:
+ 	peer->rsnie_i_len = kde.rsn_ie_len;
+ 	peer->cipher = cipher;
+ 
+-	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
++	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0 ||
++	    !tdls_nonce_set(peer->inonce)) {
+ 		/*
+ 		 * There is no point in updating the RNonce for every obtained
+ 		 * TPK M1 frame (e.g., retransmission due to timeout) with the
+@@ -2020,6 +2053,7 @@ skip_rsn:
+ 				"TDLS: Failed to get random data for responder nonce");
+ 			goto error;
+ 		}
++		peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	}
+ 
+ #if 0
diff --git a/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch b/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
new file mode 100644
index 0000000..13d78b8
--- /dev/null
+++ b/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
@@ -0,0 +1,35 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 22 Sep 2017 11:25:02 +0300
+Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Response without pending
+ request
+
+Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
+Mode Response if WNM-Sleep Mode has not been used') started ignoring the
+response when no WNM-Sleep Mode Request had been used during the
+association. This can be made tighter by clearing the used flag when
+successfully processing a response. This adds an additional layer of
+protection against unexpected retransmissions of the response frame.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/wpa_supplicant/wnm_sta.c
++++ b/wpa_supplicant/wnm_sta.c
+@@ -260,7 +260,7 @@ static void ieee802_11_rx_wnmsleep_resp(
+ 
+ 	if (!wpa_s->wnmsleep_used) {
+ 		wpa_printf(MSG_DEBUG,
+-			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode has not been used in this association");
++			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested");
+ 		return;
+ 	}
+ 
+@@ -299,6 +299,8 @@ static void ieee802_11_rx_wnmsleep_resp(
+ 		return;
+ 	}
+ 
++	wpa_s->wnmsleep_used = 0;
++
+ 	if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT ||
+ 	    wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) {
+ 		wpa_printf(MSG_DEBUG, "Successfully recv WNM-Sleep Response "
diff --git a/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch b/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
new file mode 100644
index 0000000..7712ce5
--- /dev/null
+++ b/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
@@ -0,0 +1,68 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 22 Sep 2017 12:06:37 +0300
+Subject: [PATCH] FT: Do not allow multiple Reassociation Response frames
+
+The driver is expected to not report a second association event without
+the station having explicitly request a new association. As such, this
+case should not be reachable. However, since reconfiguring the same
+pairwise or group keys to the driver could result in nonce reuse issues,
+be extra careful here and do an additional state check to avoid this
+even if the local driver ends up somehow accepting an unexpected
+Reassociation Response frame.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -2637,6 +2637,9 @@ void wpa_sm_notify_disassoc(struct wpa_s
+ #ifdef CONFIG_FILS
+ 	sm->fils_completed = 0;
+ #endif /* CONFIG_FILS */
++#ifdef CONFIG_IEEE80211R
++	sm->ft_reassoc_completed = 0;
++#endif /* CONFIG_IEEE80211R */
+ 
+ 	/* Keys are not needed in the WPA state machine anymore */
+ 	wpa_sm_drop_sa(sm);
+--- a/src/rsn_supp/wpa_ft.c
++++ b/src/rsn_supp/wpa_ft.c
+@@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wp
+ 	u16 capab;
+ 
+ 	sm->ft_completed = 0;
++	sm->ft_reassoc_completed = 0;
+ 
+ 	buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+ 		2 + sm->r0kh_id_len + ric_ies_len + 100;
+@@ -687,6 +688,11 @@ int wpa_ft_validate_reassoc_resp(struct
+ 		return -1;
+ 	}
+ 
++	if (sm->ft_reassoc_completed) {
++		wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
++		return 0;
++	}
++
+ 	if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
+ 		wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
+ 		return -1;
+@@ -787,6 +793,8 @@ int wpa_ft_validate_reassoc_resp(struct
+ 		return -1;
+ 	}
+ 
++	sm->ft_reassoc_completed = 1;
++
+ 	if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
+ 		return -1;
+ 
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -128,6 +128,7 @@ struct wpa_sm {
+ 	size_t r0kh_id_len;
+ 	u8 r1kh_id[FT_R1KH_ID_LEN];
+ 	int ft_completed;
++	int ft_reassoc_completed;
+ 	int over_the_ds_in_progress;
+ 	u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
+ 	int set_ptk_after_assoc;
diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch
index 7d33c7f..0d289d5 100644
--- a/package/network/services/hostapd/patches/200-multicall.patch
+++ b/package/network/services/hostapd/patches/200-multicall.patch
@@ -297,7 +297,7 @@
  #ifdef CONFIG_WPS
  static int gen_uuid(const char *txt_addr)
 @@ -670,6 +675,8 @@ int main(int argc, char *argv[])
-	dl_list_init(&interfaces.eth_p_oui);
+ 	dl_list_init(&interfaces.eth_p_oui);
  #endif /* CONFIG_ETH_P_OUI */
  
 +	wpa_supplicant_event = hostapd_wpa_event;
diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
index d77ab44..92e6ae9 100644
--- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
+++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch
@@ -2,7 +2,7 @@
 +++ b/src/drivers/driver_nl80211.c
 @@ -2536,10 +2536,15 @@ static int wpa_driver_nl80211_del_beacon
  	struct nl_msg *msg;
-	struct wpa_driver_nl80211_data *drv = bss->drv;
+ 	struct wpa_driver_nl80211_data *drv = bss->drv;
  
 +	if (!bss->beacon_set)
 +		return 0;
@@ -12,7 +12,7 @@
  	wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)",
 -		   drv->ifindex);
 +		   bss->ifindex);
-	nl80211_put_wiphy_data_ap(bss);
+ 	nl80211_put_wiphy_data_ap(bss);
 -	msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON);
 +	msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON);
  	return send_and_recv_msgs(drv, msg, NULL, NULL);
@@ -20,8 +20,8 @@
  
 @@ -4753,7 +4758,7 @@ static void nl80211_teardown_ap(struct i
  		nl80211_mgmt_unsubscribe(bss, "AP teardown");
-
-	nl80211_put_wiphy_data_ap(bss);
+ 
+ 	nl80211_put_wiphy_data_ap(bss);
 -	bss->beacon_set = 0;
 +	wpa_driver_nl80211_del_beacon(bss);
  }
@@ -39,7 +39,7 @@
 @@ -7225,7 +7228,6 @@ static int wpa_driver_nl80211_deinit_ap(
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
-	wpa_driver_nl80211_del_beacon(bss);
+ 	wpa_driver_nl80211_del_beacon(bss);
 -	bss->beacon_set = 0;
  
  	/*
@@ -47,7 +47,7 @@
 @@ -7245,7 +7247,6 @@ static int wpa_driver_nl80211_stop_ap(vo
  	if (!is_ap_interface(drv->nlmode))
  		return -1;
-	wpa_driver_nl80211_del_beacon(bss);
+ 	wpa_driver_nl80211_del_beacon(bss);
 -	bss->beacon_set = 0;
  	return 0;
  }
diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch
index ea31371..a37b193 100644
--- a/package/network/services/hostapd/patches/370-ap_sta_support.patch
+++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch
@@ -47,7 +47,7 @@
 +++ b/wpa_supplicant/wpa_supplicant.c
 @@ -118,6 +118,55 @@ const char *const wpa_supplicant_full_li
  static void wpa_bss_tmp_disallow_timeout(void *eloop_ctx, void *timeout_ctx);
-
+ 
  
 +static int hostapd_stop(struct wpa_supplicant *wpa_s)
 +{
diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
index 330cf48..908641f 100644
--- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
+++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
@@ -129,7 +129,7 @@
  static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
 --- a/src/ap/wpa_auth.c
 +++ b/src/ap/wpa_auth.c
-@@ -3741,6 +3741,7 @@ static const char * wpa_bool_txt(int val
+@@ -3762,6 +3762,7 @@ static const char * wpa_bool_txt(int val
  	return val ? "TRUE" : "FALSE";
  }
  
@@ -137,7 +137,7 @@
  
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
-@@ -3885,7 +3886,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
+@@ -3906,7 +3907,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  
  	return len;
  }
@@ -148,7 +148,7 @@
  {
 --- a/src/rsn_supp/wpa.c
 +++ b/src/rsn_supp/wpa.c
-@@ -2283,6 +2283,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
+@@ -2339,6 +2339,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  }
  
  
@@ -157,7 +157,7 @@
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
-@@ -2366,6 +2368,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
+@@ -2422,6 +2424,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  
  	return (int) len;
  }
diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
index 2c77548..32cab7f 100644
--- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
+++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch
@@ -17,7 +17,7 @@
  
  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc,
 @@ -1476,7 +1474,6 @@ static const struct hostapd_cli_cmd host
-	{ "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations,
+ 	{ "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations,
  	  "<addr> = send SA Query to a station" },
  #endif /* CONFIG_IEEE80211W */
 -#ifdef CONFIG_WPS
@@ -29,6 +29,6 @@
  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL,
  	  "= show current WPS status" },
 -#endif /* CONFIG_WPS */
-	{ "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL,
-	  "= send Disassociation Imminent notification" },
-	{ "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL,
+ 	{ "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL,
+ 	  "= send Disassociation Imminent notification" },
+ 	{ "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL,
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch
index 86f3889..0c85a27 100644
--- a/package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/package/network/services/hostapd/patches/600-ubus_support.patch
@@ -104,8 +104,8 @@
 +		.frame_info = fi,
 +	};
  
-	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
-		wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
+ 	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) {
+ 		wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)",
 @@ -1757,6 +1763,12 @@ static void handle_auth(struct hostapd_d
  		resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
  		goto fail;
@@ -116,10 +116,10 @@
 +		resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
 +		goto fail;
 +	}
-	if (res == HOSTAPD_ACL_PENDING)
-		return;
-
-@@ -2860,7 +2872,7 @@ void fils_hlp_timeout(void *eloop_ctx, v
+ 	if (res == HOSTAPD_ACL_PENDING)
+ 		return;
+ 
+@@ -2870,7 +2882,7 @@ void fils_hlp_timeout(void *eloop_ctx, v
  
  static void handle_assoc(struct hostapd_data *hapd,
  			 const struct ieee80211_mgmt *mgmt, size_t len,
@@ -128,9 +128,9 @@
  {
  	u16 capab_info, listen_interval, seq_ctrl, fc;
  	u16 resp = WLAN_STATUS_SUCCESS, reply_res;
-@@ -2874,6 +2886,11 @@ static void handle_assoc(struct hostapd_
+@@ -2884,6 +2896,11 @@ static void handle_assoc(struct hostapd_
  #ifdef CONFIG_FILS
-	int delay_assoc = 0;
+ 	int delay_assoc = 0;
  #endif /* CONFIG_FILS */
 +	struct hostapd_ubus_request req = {
 +		.type = HOSTAPD_UBUS_ASSOC_REQ,
@@ -140,7 +140,7 @@
  
  	if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
  				      sizeof(mgmt->u.assoc_req))) {
-@@ -3041,6 +3058,13 @@ static void handle_assoc(struct hostapd_
+@@ -3051,6 +3068,13 @@ static void handle_assoc(struct hostapd_
  	}
  #endif /* CONFIG_MBO */
  
@@ -154,7 +154,7 @@
  	/*
  	 * sta->capability is used in check_assoc_ies() for RRM enabled
  	 * capability element.
-@@ -3248,6 +3272,7 @@ static void handle_disassoc(struct hosta
+@@ -3258,6 +3282,7 @@ static void handle_disassoc(struct hosta
  	wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d",
  		   MAC2STR(mgmt->sa),
  		   le_to_host16(mgmt->u.disassoc.reason_code));
@@ -162,7 +162,7 @@
  
  	sta = ap_get_sta(hapd, mgmt->sa);
  	if (sta == NULL) {
-@@ -3313,6 +3338,8 @@ static void handle_deauth(struct hostapd
+@@ -3323,6 +3348,8 @@ static void handle_deauth(struct hostapd
  		" reason_code=%d",
  		MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code));
  
@@ -171,7 +171,7 @@
  	sta = ap_get_sta(hapd, mgmt->sa);
  	if (sta == NULL) {
  		wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
-@@ -3627,7 +3654,7 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3637,7 +3664,7 @@ int ieee802_11_mgmt(struct hostapd_data
  
  
  	if (stype == WLAN_FC_STYPE_PROBE_REQ) {
@@ -180,7 +180,7 @@
  		return 1;
  	}
  
-@@ -3647,17 +3674,17 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3657,17 +3684,17 @@ int ieee802_11_mgmt(struct hostapd_data
  	switch (stype) {
  	case WLAN_FC_STYPE_AUTH:
  		wpa_printf(MSG_DEBUG, "mgmt::auth");


From lede-commits at lists.infradead.org  Mon Oct 16 03:26:21 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 06:26:21 -0400
Subject: [source]  ramips: fix typo in MT7621 NAND driver
In-Reply-To: <20171016102621.313.56464@git-01.infra.lede-project.org>
References: <20171016102621.313.56464@git-01.infra.lede-project.org>
Message-ID: <mailman.54539.1508149613.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/fe3c3aed4454663d455af1216177d867ef4a7696

commit fe3c3aed4454663d455af1216177d867ef4a7696
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Oct 16 12:15:08 2017 +0200

    ramips: fix typo in MT7621 NAND driver
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch b/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch
index ed9f1dc..f5b1d82 100644
--- a/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch
+++ b/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch
@@ -3379,7 +3379,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +	data |= ((0x2<<18) |(0x2<<16));
 +	DRV_WriteReg32(RALINK_SYSCTL_BASE+0x60, data);
 +
-+	hw = &mt7621_nand_hw,
++	hw = &mt7621_nand_hw;
 +	BUG_ON(!hw);
 +	/* Allocate memory for the device structure (and zero it) */
 +	host = kzalloc(sizeof(struct mtk_nand_host), GFP_KERNEL);


From lede-commits at lists.infradead.org  Mon Oct 16 03:33:52 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 06:33:52 -0400
Subject: [source]  ramips: fix typo in MT7621 NAND driver
In-Reply-To: <20171016103346.3605.54242@git-01.infra.lede-project.org>
References: <20171016103346.3605.54242@git-01.infra.lede-project.org>
Message-ID: <mailman.54540.1508150065.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/2e9f3c6225ffbb67862abbb503c4d77d691edaa3

commit 2e9f3c6225ffbb67862abbb503c4d77d691edaa3
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Oct 16 12:15:08 2017 +0200

    ramips: fix typo in MT7621 NAND driver
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch b/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch
index b63018f..2a69521 100644
--- a/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch
+++ b/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch
@@ -3344,7 +3344,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +	data |= ((0x2<<18) |(0x2<<16));
 +	DRV_WriteReg32(RALINK_SYSCTL_BASE+0x60, data);
 +
-+	hw = &mt7621_nand_hw,
++	hw = &mt7621_nand_hw;
 +	BUG_ON(!hw);
 +	/* Allocate memory for the device structure (and zero it) */
 +	host = kzalloc(sizeof(struct mtk_nand_host), GFP_KERNEL);


From lede-commits at lists.infradead.org  Mon Oct 16 03:33:53 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 06:33:53 -0400
Subject: [source]  ramips: fix compile warning in MT7621 NAND driver
In-Reply-To: <20171016103346.3605.54242@git-01.infra.lede-project.org>
References: <20171016103346.3605.54242@git-01.infra.lede-project.org>
Message-ID: <mailman.54541.1508150068.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/e6fd17d04c7d738598414c55cd091f7fb9c6567a

commit e6fd17d04c7d738598414c55cd091f7fb9c6567a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Oct 16 12:07:31 2017 +0200

    ramips: fix compile warning in MT7621 NAND driver
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch b/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch
index 2a69521..7bb996a 100644
--- a/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch
+++ b/target/linux/ramips/patches-4.4/0039-mtd-add-mt7621-nand-support.patch
@@ -2667,7 +2667,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +}
 +
 +static int
-+mtk_nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, const uint8_t * buf, int oob_required)
++mtk_nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, const uint8_t * buf, int oob_required, int page)
 +{
 +	mtk_nand_write_buf(mtd, buf, mtd->writesize);
 +	mtk_nand_write_buf(mtd, chip->oob_poi, mtd->oobsize);


From lede-commits at lists.infradead.org  Mon Oct 16 03:33:51 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 06:33:51 -0400
Subject: [source] hostapd: merge fixes for WPA packet number reuse with
 replayed messages and key reinstallation
In-Reply-To: <20171016103346.3605.54242@git-01.infra.lede-project.org>
References: <20171016103346.3605.54242@git-01.infra.lede-project.org>
Message-ID: <mailman.54542.1508150069.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/63c17142c865618977a540485eea7a9487a58029

commit 63c17142c865618977a540485eea7a9487a58029
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Oct 16 12:05:09 2017 +0200

    hostapd: merge fixes for WPA packet number reuse with replayed messages and key reinstallation
    
    Fixes:
    - CERT case ID: VU#228519
    - CVE-2017-13077
    - CVE-2017-13078
    - CVE-2017-13079
    - CVE-2017-13080
    - CVE-2017-13081
    - CVE-2017-13082
    - CVE-2017-13086
    - CVE-2017-13087
    - CVE-2017-13088
    
    For more information see:
    https://w1.fi/security/2017-1/wpa-packet-number-reuse-with-replayed-messages.txt
    
    Backport of bbda81ce3077dfade2a43a39f772cfec2e82a9a5
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/Makefile          |   2 +-
 ...-Avoid-key-reinstallation-in-FT-handshake.patch | 154 +++++++++++++
 ...nstallation-of-an-already-in-use-group-ke.patch | 244 +++++++++++++++++++++
 ...ection-of-GTK-IGTK-reinstallation-of-WNM-.patch | 173 +++++++++++++++
 ...08-Prevent-installation-of-an-all-zero-TK.patch |  65 ++++++
 ...Fix-PTK-rekeying-to-generate-a-new-ANonce.patch |  56 +++++
 .../010-TDLS-Reject-TPK-TK-reconfiguration.patch   | 124 +++++++++++
 ...WNM-Sleep-Mode-Response-without-pending-r.patch |  35 +++
 ...llow-multiple-Reassociation-Response-fram.patch |  68 ++++++
 .../patches/380-disable_ctrl_iface_mib.patch       |   8 +-
 .../hostapd/patches/600-ubus_support.patch         |  10 +-
 11 files changed, 929 insertions(+), 10 deletions(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 8a1f083..0e729a8 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch b/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
new file mode 100644
index 0000000..2136bb9
--- /dev/null
+++ b/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch
@@ -0,0 +1,154 @@
+From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+Date: Fri, 14 Jul 2017 15:15:35 +0200
+Subject: [PATCH] hostapd: Avoid key reinstallation in FT handshake
+
+Do not reinstall TK to the driver during Reassociation Response frame
+processing if the first attempt of setting the TK succeeded. This avoids
+issues related to clearing the TX/RX PN that could result in reusing
+same PN values for transmitted frames (e.g., due to CCM nonce reuse and
+also hitting replay protection on the receiver) and accepting replayed
+frames on RX side.
+
+This issue was introduced by the commit
+0e84c25434e6a1f283c7b4e62e483729085b78d2 ('FT: Fix PTK configuration in
+authenticator') which allowed wpa_ft_install_ptk() to be called multiple
+times with the same PTK. While the second configuration attempt is
+needed with some drivers, it must be done only if the first attempt
+failed.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+---
+
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -2154,6 +2154,7 @@ static int add_associated_sta(struct hos
+ {
+ 	struct ieee80211_ht_capabilities ht_cap;
+ 	struct ieee80211_vht_capabilities vht_cap;
++	int set = 1;
+ 
+ 	/*
+ 	 * Remove the STA entry to ensure the STA PS state gets cleared and
+@@ -2161,9 +2162,18 @@ static int add_associated_sta(struct hos
+ 	 * FT-over-the-DS, where a station re-associates back to the same AP but
+ 	 * skips the authentication flow, or if working with a driver that
+ 	 * does not support full AP client state.
++	 *
++	 * Skip this if the STA has already completed FT reassociation and the
++	 * TK has been configured since the TX/RX PN must not be reset to 0 for
++	 * the same key.
+ 	 */
+-	if (!sta->added_unassoc)
++	if (!sta->added_unassoc &&
++	    (!(sta->flags & WLAN_STA_AUTHORIZED) ||
++	     !wpa_auth_sta_ft_tk_already_set(sta->wpa_sm))) {
+ 		hostapd_drv_sta_remove(hapd, sta->addr);
++		wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
++		set = 0;
++	}
+ 
+ #ifdef CONFIG_IEEE80211N
+ 	if (sta->flags & WLAN_STA_HT)
+@@ -2186,11 +2196,11 @@ static int add_associated_sta(struct hos
+ 			    sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
+ 			    sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
+ 			    sta->vht_opmode, sta->p2p_ie ? 1 : 0,
+-			    sta->added_unassoc)) {
++			    set)) {
+ 		hostapd_logger(hapd, sta->addr,
+ 			       HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
+ 			       "Could not %s STA to kernel driver",
+-			       sta->added_unassoc ? "set" : "add");
++			       set ? "set" : "add");
+ 
+ 		if (sta->added_unassoc) {
+ 			hostapd_drv_sta_remove(hapd, sta->addr);
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1751,6 +1751,9 @@ int wpa_auth_sm_event(struct wpa_state_m
+ #else /* CONFIG_IEEE80211R_AP */
+ 		break;
+ #endif /* CONFIG_IEEE80211R_AP */
++	case WPA_DRV_STA_REMOVED:
++		sm->tk_already_set = FALSE;
++		return 0;
+ 	}
+ 
+ #ifdef CONFIG_IEEE80211R_AP
+@@ -3725,6 +3728,14 @@ int wpa_auth_sta_wpa_version(struct wpa_
+ }
+ 
+ 
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm)
++{
++	if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt))
++		return 0;
++	return sm->tk_already_set;
++}
++
++
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry)
+ {
+--- a/src/ap/wpa_auth_ft.c
++++ b/src/ap/wpa_auth_ft.c
+@@ -794,6 +794,14 @@ void wpa_ft_install_ptk(struct wpa_state
+ 		return;
+ 	}
+ 
++	if (sm->tk_already_set) {
++		/* Must avoid TK reconfiguration to prevent clearing of TX/RX
++		 * PN in the driver */
++		wpa_printf(MSG_DEBUG,
++			   "FT: Do not re-install same PTK to the driver");
++		return;
++	}
++
+ 	/* FIX: add STA entry to kernel/driver here? The set_key will fail
+ 	 * most likely without this.. At the moment, STA entry is added only
+ 	 * after association has been completed. This function will be called
+@@ -806,6 +814,7 @@ void wpa_ft_install_ptk(struct wpa_state
+ 
+ 	/* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */
+ 	sm->pairwise_set = TRUE;
++	sm->tk_already_set = TRUE;
+ }
+ 
+ 
+@@ -1002,6 +1011,7 @@ static int wpa_ft_process_auth_req(struc
+ 
+ 	sm->pairwise = pairwise;
+ 	sm->PTK_valid = TRUE;
++	sm->tk_already_set = FALSE;
+ 	wpa_ft_install_ptk(sm);
+ 
+ 	buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+--- a/src/ap/wpa_auth.h
++++ b/src/ap/wpa_auth.h
+@@ -268,7 +268,7 @@ void wpa_receive(struct wpa_authenticato
+ 		 u8 *data, size_t data_len);
+ enum wpa_event {
+ 	WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
+-	WPA_REAUTH_EAPOL, WPA_ASSOC_FT
++	WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_DRV_STA_REMOVED
+ };
+ void wpa_remove_ptk(struct wpa_state_machine *sm);
+ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event);
+@@ -281,6 +281,7 @@ int wpa_auth_pairwise_set(struct wpa_sta
+ int wpa_auth_get_pairwise(struct wpa_state_machine *sm);
+ int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
+ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ 			     struct rsn_pmksa_cache_entry *entry);
+ struct rsn_pmksa_cache_entry *
+--- a/src/ap/wpa_auth_i.h
++++ b/src/ap/wpa_auth_i.h
+@@ -65,6 +65,7 @@ struct wpa_state_machine {
+ 	struct wpa_ptk PTK;
+ 	Boolean PTK_valid;
+ 	Boolean pairwise_set;
++	Boolean tk_already_set;
+ 	int keycount;
+ 	Boolean Pair;
+ 	struct wpa_key_replay_counter {
diff --git a/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch b/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
new file mode 100644
index 0000000..71c681e
--- /dev/null
+++ b/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch
@@ -0,0 +1,244 @@
+From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+Date: Wed, 12 Jul 2017 16:03:24 +0200
+Subject: [PATCH] Prevent reinstallation of an already in-use group key
+
+Track the current GTK and IGTK that is in use and when receiving a
+(possibly retransmitted) Group Message 1 or WNM-Sleep Mode Response, do
+not install the given key if it is already in use. This prevents an
+attacker from trying to trick the client into resetting or lowering the
+sequence counter associated to the group key.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+---
+
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -207,6 +207,17 @@ struct wpa_ptk {
+ 	size_t tk_len;
+ };
+ 
++struct wpa_gtk {
++	u8 gtk[WPA_GTK_MAX_LEN];
++	size_t gtk_len;
++};
++
++#ifdef CONFIG_IEEE80211W
++struct wpa_igtk {
++	u8 igtk[WPA_IGTK_MAX_LEN];
++	size_t igtk_len;
++};
++#endif /* CONFIG_IEEE80211W */
+ 
+ /* WPA IE version 1
+  * 00-50-f2:1 (OUI:OUI type)
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -785,6 +785,15 @@ static int wpa_supplicant_install_gtk(st
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
++	/* Detect possible key reinstallation */
++	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
++			gd->keyidx, gd->tx, gd->gtk_len);
++		return 0;
++	}
++
+ 	wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len);
+ 	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 		"WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)",
+@@ -819,6 +828,9 @@ static int wpa_supplicant_install_gtk(st
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
++	sm->gtk.gtk_len = gd->gtk_len;
++	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++
+ 	return 0;
+ }
+ 
+@@ -925,6 +937,48 @@ static int wpa_supplicant_pairwise_gtk(s
+ }
+ 
+ 
++#ifdef CONFIG_IEEE80211W
++static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
++				       const struct wpa_igtk_kde *igtk)
++{
++	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
++	u16 keyidx = WPA_GET_LE16(igtk->keyid);
++
++	/* Detect possible key reinstallation */
++	if (sm->igtk.igtk_len == len &&
++	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
++			keyidx);
++		return  0;
++	}
++
++	wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++		"WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
++		keyidx, MAC2STR(igtk->pn));
++	wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
++	if (keyidx > 4095) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Invalid IGTK KeyID %d", keyidx);
++		return -1;
++	}
++	if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
++			   broadcast_ether_addr,
++			   keyidx, 0, igtk->pn, sizeof(igtk->pn),
++			   igtk->igtk, len) < 0) {
++		wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++			"WPA: Failed to configure IGTK to the driver");
++		return -1;
++	}
++
++	sm->igtk.igtk_len = len;
++	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++
++	return 0;
++}
++#endif /* CONFIG_IEEE80211W */
++
++
+ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ 			       struct wpa_eapol_ie_parse *ie)
+ {
+@@ -935,30 +989,14 @@ static int ieee80211w_set_keys(struct wp
+ 	if (ie->igtk) {
+ 		size_t len;
+ 		const struct wpa_igtk_kde *igtk;
+-		u16 keyidx;
++
+ 		len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 		if (ie->igtk_len != WPA_IGTK_KDE_PREFIX_LEN + len)
+ 			return -1;
++
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		keyidx = WPA_GET_LE16(igtk->keyid);
+-		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: IGTK keyid %d "
+-			"pn %02x%02x%02x%02x%02x%02x",
+-			keyidx, MAC2STR(igtk->pn));
+-		wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK",
+-				igtk->igtk, len);
+-		if (keyidx > 4095) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Invalid IGTK KeyID %d", keyidx);
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igtk->pn, sizeof(igtk->pn),
+-				   igtk->igtk, len) < 0) {
+-			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+-				"WPA: Failed to configure IGTK to the driver");
+-			return -1;
+-		}
+ 	}
+ 
+ 	return 0;
+@@ -2451,7 +2489,7 @@ void wpa_sm_deinit(struct wpa_sm *sm)
+  */
+ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ {
+-	int clear_ptk = 1;
++	int clear_keys = 1;
+ 
+ 	if (sm == NULL)
+ 		return;
+@@ -2477,7 +2515,7 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		/* Prepare for the next transition */
+ 		wpa_ft_prepare_auth_request(sm, NULL);
+ 
+-		clear_ptk = 0;
++		clear_keys = 0;
+ 	}
+ #endif /* CONFIG_IEEE80211R */
+ #ifdef CONFIG_FILS
+@@ -2487,11 +2525,11 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		 * AUTHENTICATED state to get the EAPOL port Authorized.
+ 		 */
+ 		wpa_supplicant_key_neg_complete(sm, sm->bssid, 1);
+-		clear_ptk = 0;
++		clear_keys = 0;
+ 	}
+ #endif /* CONFIG_FILS */
+ 
+-	if (clear_ptk) {
++	if (clear_keys) {
+ 		/*
+ 		 * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if
+ 		 * this is not part of a Fast BSS Transition.
+@@ -2501,6 +2539,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+ #ifdef CONFIG_TDLS
+@@ -3052,6 +3094,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(sm->pmk, 0, sizeof(sm->pmk));
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+ 	os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0));
+@@ -3124,29 +3170,11 @@ int wpa_wnmsleep_install_key(struct wpa_
+ 		os_memset(&gd, 0, sizeof(gd));
+ #ifdef CONFIG_IEEE80211W
+ 	} else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) {
+-		struct wpa_igtk_kde igd;
+-		u16 keyidx;
++		const struct wpa_igtk_kde *igtk;
+ 
+-		os_memset(&igd, 0, sizeof(igd));
+-		keylen = wpa_cipher_key_len(sm->mgmt_group_cipher);
+-		os_memcpy(igd.keyid, buf + 2, 2);
+-		os_memcpy(igd.pn, buf + 4, 6);
+-
+-		keyidx = WPA_GET_LE16(igd.keyid);
+-		os_memcpy(igd.igtk, buf + 10, keylen);
+-
+-		wpa_hexdump_key(MSG_DEBUG, "Install IGTK (WNM SLEEP)",
+-				igd.igtk, keylen);
+-		if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+-				   broadcast_ether_addr,
+-				   keyidx, 0, igd.pn, sizeof(igd.pn),
+-				   igd.igtk, keylen) < 0) {
+-			wpa_printf(MSG_DEBUG, "Failed to install the IGTK in "
+-				   "WNM mode");
+-			os_memset(&igd, 0, sizeof(igd));
++		igtk = (const struct wpa_igtk_kde *) (buf + 2);
++		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ 			return -1;
+-		}
+-		os_memset(&igd, 0, sizeof(igd));
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+ 		wpa_printf(MSG_DEBUG, "Unknown element id");
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -31,6 +31,10 @@ struct wpa_sm {
+ 	u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
++	struct wpa_gtk gtk;
++#ifdef CONFIG_IEEE80211W
++	struct wpa_igtk igtk;
++#endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+ 
diff --git a/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch b/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
new file mode 100644
index 0000000..650bf43
--- /dev/null
+++ b/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch
@@ -0,0 +1,173 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Sun, 1 Oct 2017 12:12:24 +0300
+Subject: [PATCH] Extend protection of GTK/IGTK reinstallation of WNM-Sleep
+ Mode cases
+
+This extends the protection to track last configured GTK/IGTK value
+separately from EAPOL-Key frames and WNM-Sleep Mode frames to cover a
+corner case where these two different mechanisms may get used when the
+GTK/IGTK has changed and tracking a single value is not sufficient to
+detect a possible key reconfiguration.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -780,14 +780,17 @@ struct wpa_gtk_data {
+ 
+ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ 				      const struct wpa_gtk_data *gd,
+-				      const u8 *key_rsc)
++				      const u8 *key_rsc, int wnm_sleep)
+ {
+ 	const u8 *_gtk = gd->gtk;
+ 	u8 gtk_buf[32];
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
+-	    os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++	if ((sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) ||
++	    (sm->gtk_wnm_sleep.gtk_len == (size_t) gd->gtk_len &&
++	     os_memcmp(sm->gtk_wnm_sleep.gtk, gd->gtk,
++		       sm->gtk_wnm_sleep.gtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
+ 			gd->keyidx, gd->tx, gd->gtk_len);
+@@ -828,8 +831,14 @@ static int wpa_supplicant_install_gtk(st
+ 	}
+ 	os_memset(gtk_buf, 0, sizeof(gtk_buf));
+ 
+-	sm->gtk.gtk_len = gd->gtk_len;
+-	os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	if (wnm_sleep) {
++		sm->gtk_wnm_sleep.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk_wnm_sleep.gtk, gd->gtk,
++			  sm->gtk_wnm_sleep.gtk_len);
++	} else {
++		sm->gtk.gtk_len = gd->gtk_len;
++		os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -923,7 +932,7 @@ static int wpa_supplicant_pairwise_gtk(s
+ 	    (wpa_supplicant_check_group_cipher(sm, sm->group_cipher,
+ 					       gtk_len, gtk_len,
+ 					       &gd.key_rsc_len, &gd.alg) ||
+-	     wpa_supplicant_install_gtk(sm, &gd, key_rsc))) {
++	     wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0))) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"RSN: Failed to install GTK");
+ 		os_memset(&gd, 0, sizeof(gd));
+@@ -939,14 +948,18 @@ static int wpa_supplicant_pairwise_gtk(s
+ 
+ #ifdef CONFIG_IEEE80211W
+ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+-				       const struct wpa_igtk_kde *igtk)
++				       const struct wpa_igtk_kde *igtk,
++				       int wnm_sleep)
+ {
+ 	size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ 	u16 keyidx = WPA_GET_LE16(igtk->keyid);
+ 
+ 	/* Detect possible key reinstallation */
+-	if (sm->igtk.igtk_len == len &&
+-	    os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++	if ((sm->igtk.igtk_len == len &&
++	     os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) ||
++	    (sm->igtk_wnm_sleep.igtk_len == len &&
++	     os_memcmp(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++		       sm->igtk_wnm_sleep.igtk_len) == 0)) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
+ 			keyidx);
+@@ -971,8 +984,14 @@ static int wpa_supplicant_install_igtk(s
+ 		return -1;
+ 	}
+ 
+-	sm->igtk.igtk_len = len;
+-	os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	if (wnm_sleep) {
++		sm->igtk_wnm_sleep.igtk_len = len;
++		os_memcpy(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++			  sm->igtk_wnm_sleep.igtk_len);
++	} else {
++		sm->igtk.igtk_len = len;
++		os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++	}
+ 
+ 	return 0;
+ }
+@@ -995,7 +1014,7 @@ static int ieee80211w_set_keys(struct wp
+ 			return -1;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) ie->igtk;
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 0) < 0)
+ 			return -1;
+ 	}
+ 
+@@ -1641,7 +1660,7 @@ static void wpa_supplicant_process_1_of_
+ 	if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc))
+ 		key_rsc = null_rsc;
+ 
+-	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc) ||
++	if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0) ||
+ 	    wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0)
+ 		goto failed;
+ 	os_memset(&gd, 0, sizeof(gd));
+@@ -2540,8 +2559,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ 		sm->tptk_set = 0;
+ 		os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 		os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++		os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 		os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++		os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ 	}
+ 
+@@ -3095,8 +3116,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ 	os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ 	os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ 	os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++	os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ 	os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++	os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ 	os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+@@ -3161,7 +3184,7 @@ int wpa_wnmsleep_install_key(struct wpa_
+ 
+ 		wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)",
+ 				gd.gtk, gd.gtk_len);
+-		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc)) {
++		if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 1)) {
+ 			os_memset(&gd, 0, sizeof(gd));
+ 			wpa_printf(MSG_DEBUG, "Failed to install the GTK in "
+ 				   "WNM mode");
+@@ -3173,7 +3196,7 @@ int wpa_wnmsleep_install_key(struct wpa_
+ 		const struct wpa_igtk_kde *igtk;
+ 
+ 		igtk = (const struct wpa_igtk_kde *) (buf + 2);
+-		if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++		if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0)
+ 			return -1;
+ #endif /* CONFIG_IEEE80211W */
+ 	} else {
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -32,8 +32,10 @@ struct wpa_sm {
+ 	int rx_replay_counter_set;
+ 	u8 request_counter[WPA_REPLAY_COUNTER_LEN];
+ 	struct wpa_gtk gtk;
++	struct wpa_gtk gtk_wnm_sleep;
+ #ifdef CONFIG_IEEE80211W
+ 	struct wpa_igtk igtk;
++	struct wpa_igtk igtk_wnm_sleep;
+ #endif /* CONFIG_IEEE80211W */
+ 
+ 	struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
diff --git a/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch b/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch
new file mode 100644
index 0000000..e0f1773
--- /dev/null
+++ b/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch
@@ -0,0 +1,65 @@
+From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+Date: Fri, 29 Sep 2017 04:22:51 +0200
+Subject: [PATCH] Prevent installation of an all-zero TK
+
+Properly track whether a PTK has already been installed to the driver
+and the TK part cleared from memory. This prevents an attacker from
+trying to trick the client into installing an all-zero TK.
+
+This fixes the earlier fix in commit
+ad00d64e7d8827b3cebd665a0ceb08adabf15e1e ('Fix TK configuration to the
+driver in EAPOL-Key 3/4 retry case') which did not take into account
+possibility of an extra message 1/4 showing up between retries of
+message 3/4.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+---
+
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -205,6 +205,7 @@ struct wpa_ptk {
+ 	size_t kck_len;
+ 	size_t kek_len;
+ 	size_t tk_len;
++	int installed; /* 1 if key has already been installed to driver */
+ };
+ 
+ struct wpa_gtk {
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -581,7 +581,6 @@ static void wpa_supplicant_process_1_of_
+ 		os_memset(buf, 0, sizeof(buf));
+ 	}
+ 	sm->tptk_set = 1;
+-	sm->tk_to_set = 1;
+ 
+ 	kde = sm->assoc_wpa_ie;
+ 	kde_len = sm->assoc_wpa_ie_len;
+@@ -686,7 +685,7 @@ static int wpa_supplicant_install_ptk(st
+ 	enum wpa_alg alg;
+ 	const u8 *key_rsc;
+ 
+-	if (!sm->tk_to_set) {
++	if (sm->ptk.installed) {
+ 		wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ 			"WPA: Do not re-install same PTK to the driver");
+ 		return 0;
+@@ -730,7 +729,7 @@ static int wpa_supplicant_install_ptk(st
+ 
+ 	/* TK is not needed anymore in supplicant */
+ 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
+-	sm->tk_to_set = 0;
++	sm->ptk.installed = 1;
+ 
+ 	if (sm->wpa_ptk_rekey) {
+ 		eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL);
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -24,7 +24,6 @@ struct wpa_sm {
+ 	struct wpa_ptk ptk, tptk;
+ 	int ptk_set, tptk_set;
+ 	unsigned int msg_3_of_4_ok:1;
+-	unsigned int tk_to_set:1;
+ 	u8 snonce[WPA_NONCE_LEN];
+ 	u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
+ 	int renew_snonce;
diff --git a/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch b/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
new file mode 100644
index 0000000..8d9bd42
--- /dev/null
+++ b/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch
@@ -0,0 +1,56 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Sun, 1 Oct 2017 12:32:57 +0300
+Subject: [PATCH] Fix PTK rekeying to generate a new ANonce
+
+The Authenticator state machine path for PTK rekeying ended up bypassing
+the AUTHENTICATION2 state where a new ANonce is generated when going
+directly to the PTKSTART state since there is no need to try to
+determine the PMK again in such a case. This is far from ideal since the
+new PTK would depend on a new nonce only from the supplicant.
+
+Fix this by generating a new ANonce when moving to the PTKSTART state
+for the purpose of starting new 4-way handshake to rekey PTK.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1912,6 +1912,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2)
+ }
+ 
+ 
++static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm)
++{
++	if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
++		wpa_printf(MSG_ERROR,
++			   "WPA: Failed to get random data for ANonce");
++		sm->Disconnect = TRUE;
++		return -1;
++	}
++	wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce,
++		    WPA_NONCE_LEN);
++	sm->TimeoutCtr = 0;
++	return 0;
++}
++
++
+ SM_STATE(WPA_PTK, INITPMK)
+ {
+ 	u8 msk[2 * PMK_LEN];
+@@ -2932,9 +2947,12 @@ SM_STEP(WPA_PTK)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION);
+ 	else if (sm->ReAuthenticationRequest)
+ 		SM_ENTER(WPA_PTK, AUTHENTICATION2);
+-	else if (sm->PTKRequest)
+-		SM_ENTER(WPA_PTK, PTKSTART);
+-	else switch (sm->wpa_ptk_state) {
++	else if (sm->PTKRequest) {
++		if (wpa_auth_sm_ptk_update(sm) < 0)
++			SM_ENTER(WPA_PTK, DISCONNECTED);
++		else
++			SM_ENTER(WPA_PTK, PTKSTART);
++	} else switch (sm->wpa_ptk_state) {
+ 	case WPA_PTK_INITIALIZE:
+ 		break;
+ 	case WPA_PTK_DISCONNECT:
diff --git a/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch b/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch
new file mode 100644
index 0000000..d6e500b
--- /dev/null
+++ b/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch
@@ -0,0 +1,124 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 22 Sep 2017 11:03:15 +0300
+Subject: [PATCH] TDLS: Reject TPK-TK reconfiguration
+
+Do not try to reconfigure the same TPK-TK to the driver after it has
+been successfully configured. This is an explicit check to avoid issues
+related to resetting the TX/RX packet number. There was already a check
+for this for TPK M2 (retries of that message are ignored completely), so
+that behavior does not get modified.
+
+For TPK M3, the TPK-TK could have been reconfigured, but that was
+followed by immediate teardown of the link due to an issue in updating
+the STA entry. Furthermore, for TDLS with any real security (i.e.,
+ignoring open/WEP), the TPK message exchange is protected on the AP path
+and simple replay attacks are not feasible.
+
+As an additional corner case, make sure the local nonce gets updated if
+the peer uses a very unlikely "random nonce" of all zeros.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/rsn_supp/tdls.c
++++ b/src/rsn_supp/tdls.c
+@@ -112,6 +112,7 @@ struct wpa_tdls_peer {
+ 		u8 tk[16]; /* TPK-TK; assuming only CCMP will be used */
+ 	} tpk;
+ 	int tpk_set;
++	int tk_set; /* TPK-TK configured to the driver */
+ 	int tpk_success;
+ 	int tpk_in_progress;
+ 
+@@ -192,6 +193,20 @@ static int wpa_tdls_set_key(struct wpa_s
+ 	u8 rsc[6];
+ 	enum wpa_alg alg;
+ 
++	if (peer->tk_set) {
++		/*
++		 * This same TPK-TK has already been configured to the driver
++		 * and this new configuration attempt (likely due to an
++		 * unexpected retransmitted frame) would result in clearing
++		 * the TX/RX sequence number which can break security, so must
++		 * not allow that to happen.
++		 */
++		wpa_printf(MSG_INFO, "TDLS: TPK-TK for the peer " MACSTR
++			   " has already been configured to the driver - do not reconfigure",
++			   MAC2STR(peer->addr));
++		return -1;
++	}
++
+ 	os_memset(rsc, 0, 6);
+ 
+ 	switch (peer->cipher) {
+@@ -209,12 +224,15 @@ static int wpa_tdls_set_key(struct wpa_s
+ 		return -1;
+ 	}
+ 
++	wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR,
++		   MAC2STR(peer->addr));
+ 	if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1,
+ 			   rsc, sizeof(rsc), peer->tpk.tk, key_len) < 0) {
+ 		wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the "
+ 			   "driver");
+ 		return -1;
+ 	}
++	peer->tk_set = 1;
+ 	return 0;
+ }
+ 
+@@ -696,7 +714,7 @@ static void wpa_tdls_peer_clear(struct w
+ 	peer->cipher = 0;
+ 	peer->qos_info = 0;
+ 	peer->wmm_capable = 0;
+-	peer->tpk_set = peer->tpk_success = 0;
++	peer->tk_set = peer->tpk_set = peer->tpk_success = 0;
+ 	peer->chan_switch_enabled = 0;
+ 	os_memset(&peer->tpk, 0, sizeof(peer->tpk));
+ 	os_memset(peer->inonce, 0, WPA_NONCE_LEN);
+@@ -1159,6 +1177,7 @@ skip_rsnie:
+ 		wpa_tdls_peer_free(sm, peer);
+ 		return -1;
+ 	}
++	peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	wpa_hexdump(MSG_DEBUG, "TDLS: Initiator Nonce for TPK handshake",
+ 		    peer->inonce, WPA_NONCE_LEN);
+ 	os_memcpy(ftie->Snonce, peer->inonce, WPA_NONCE_LEN);
+@@ -1751,6 +1770,19 @@ static int wpa_tdls_addset_peer(struct w
+ }
+ 
+ 
++static int tdls_nonce_set(const u8 *nonce)
++{
++	int i;
++
++	for (i = 0; i < WPA_NONCE_LEN; i++) {
++		if (nonce[i])
++			return 1;
++	}
++
++	return 0;
++}
++
++
+ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
+ 				   const u8 *buf, size_t len)
+ {
+@@ -2004,7 +2036,8 @@ skip_rsn:
+ 	peer->rsnie_i_len = kde.rsn_ie_len;
+ 	peer->cipher = cipher;
+ 
+-	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
++	if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0 ||
++	    !tdls_nonce_set(peer->inonce)) {
+ 		/*
+ 		 * There is no point in updating the RNonce for every obtained
+ 		 * TPK M1 frame (e.g., retransmission due to timeout) with the
+@@ -2020,6 +2053,7 @@ skip_rsn:
+ 				"TDLS: Failed to get random data for responder nonce");
+ 			goto error;
+ 		}
++		peer->tk_set = 0; /* A new nonce results in a new TK */
+ 	}
+ 
+ #if 0
diff --git a/package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch b/package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
new file mode 100644
index 0000000..13d78b8
--- /dev/null
+++ b/package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch
@@ -0,0 +1,35 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 22 Sep 2017 11:25:02 +0300
+Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Response without pending
+ request
+
+Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
+Mode Response if WNM-Sleep Mode has not been used') started ignoring the
+response when no WNM-Sleep Mode Request had been used during the
+association. This can be made tighter by clearing the used flag when
+successfully processing a response. This adds an additional layer of
+protection against unexpected retransmissions of the response frame.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/wpa_supplicant/wnm_sta.c
++++ b/wpa_supplicant/wnm_sta.c
+@@ -260,7 +260,7 @@ static void ieee802_11_rx_wnmsleep_resp(
+ 
+ 	if (!wpa_s->wnmsleep_used) {
+ 		wpa_printf(MSG_DEBUG,
+-			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode has not been used in this association");
++			   "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested");
+ 		return;
+ 	}
+ 
+@@ -299,6 +299,8 @@ static void ieee802_11_rx_wnmsleep_resp(
+ 		return;
+ 	}
+ 
++	wpa_s->wnmsleep_used = 0;
++
+ 	if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT ||
+ 	    wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) {
+ 		wpa_printf(MSG_DEBUG, "Successfully recv WNM-Sleep Response "
diff --git a/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch b/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
new file mode 100644
index 0000000..12904fa
--- /dev/null
+++ b/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch
@@ -0,0 +1,68 @@
+From: Jouni Malinen <j at w1.fi>
+Date: Fri, 22 Sep 2017 12:06:37 +0300
+Subject: [PATCH] FT: Do not allow multiple Reassociation Response frames
+
+The driver is expected to not report a second association event without
+the station having explicitly request a new association. As such, this
+case should not be reachable. However, since reconfiguring the same
+pairwise or group keys to the driver could result in nonce reuse issues,
+be extra careful here and do an additional state check to avoid this
+even if the local driver ends up somehow accepting an unexpected
+Reassociation Response frame.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -2568,6 +2568,9 @@ void wpa_sm_notify_assoc(struct wpa_sm *
+ #ifdef CONFIG_TDLS
+ 	wpa_tdls_assoc(sm);
+ #endif /* CONFIG_TDLS */
++#ifdef CONFIG_IEEE80211R
++	sm->ft_reassoc_completed = 0;
++#endif /* CONFIG_IEEE80211R */
+ 
+ #ifdef CONFIG_P2P
+ 	os_memset(sm->p2p_ip_addr, 0, sizeof(sm->p2p_ip_addr));
+--- a/src/rsn_supp/wpa_ft.c
++++ b/src/rsn_supp/wpa_ft.c
+@@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wp
+ 	u16 capab;
+ 
+ 	sm->ft_completed = 0;
++	sm->ft_reassoc_completed = 0;
+ 
+ 	buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+ 		2 + sm->r0kh_id_len + ric_ies_len + 100;
+@@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct
+ 		return -1;
+ 	}
+ 
++	if (sm->ft_reassoc_completed) {
++		wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
++		return 0;
++	}
++
+ 	if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
+ 		wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
+ 		return -1;
+@@ -781,6 +787,8 @@ int wpa_ft_validate_reassoc_resp(struct
+ 		return -1;
+ 	}
+ 
++	sm->ft_reassoc_completed = 1;
++
+ 	if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
+ 		return -1;
+ 
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -128,6 +128,7 @@ struct wpa_sm {
+ 	size_t r0kh_id_len;
+ 	u8 r1kh_id[FT_R1KH_ID_LEN];
+ 	int ft_completed;
++	int ft_reassoc_completed;
+ 	int over_the_ds_in_progress;
+ 	u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
+ 	int set_ptk_after_assoc;
diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
index 1403fe0..b472958 100644
--- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
+++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
@@ -129,7 +129,7 @@
  static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
 --- a/src/ap/wpa_auth.c
 +++ b/src/ap/wpa_auth.c
-@@ -3544,6 +3544,7 @@ static const char * wpa_bool_txt(int val
+@@ -3565,6 +3565,7 @@ static const char * wpa_bool_txt(int val
  	return val ? "TRUE" : "FALSE";
  }
  
@@ -137,7 +137,7 @@
  
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
-@@ -3688,7 +3689,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
+@@ -3709,7 +3710,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  
  	return len;
  }
@@ -148,7 +148,7 @@
  {
 --- a/src/rsn_supp/wpa.c
 +++ b/src/rsn_supp/wpa.c
-@@ -2252,6 +2252,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
+@@ -2308,6 +2308,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  }
  
  
@@ -157,7 +157,7 @@
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
-@@ -2335,6 +2337,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
+@@ -2391,6 +2393,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  
  	return (int) len;
  }
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch
index ee892e2..0d9aca9 100644
--- a/package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/package/network/services/hostapd/patches/600-ubus_support.patch
@@ -121,7 +121,7 @@
  	if (res == HOSTAPD_ACL_PENDING) {
  		wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR
  			   " waiting for an external authentication",
-@@ -2391,7 +2405,7 @@ static u16 send_assoc_resp(struct hostap
+@@ -2401,7 +2415,7 @@ static u16 send_assoc_resp(struct hostap
  
  static void handle_assoc(struct hostapd_data *hapd,
  			 const struct ieee80211_mgmt *mgmt, size_t len,
@@ -130,7 +130,7 @@
  {
  	u16 capab_info, listen_interval, seq_ctrl, fc;
  	u16 resp = WLAN_STATUS_SUCCESS, reply_res;
-@@ -2399,6 +2413,11 @@ static void handle_assoc(struct hostapd_
+@@ -2409,6 +2423,11 @@ static void handle_assoc(struct hostapd_
  	int left, i;
  	struct sta_info *sta;
  	u8 *tmp = NULL;
@@ -142,7 +142,7 @@
  
  	if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
  				      sizeof(mgmt->u.assoc_req))) {
-@@ -2518,6 +2537,13 @@ static void handle_assoc(struct hostapd_
+@@ -2528,6 +2547,13 @@ static void handle_assoc(struct hostapd_
  	}
  #endif /* CONFIG_MBO */
  
@@ -156,7 +156,7 @@
  	/*
  	 * sta->capability is used in check_assoc_ies() for RRM enabled
  	 * capability element.
-@@ -3025,7 +3051,7 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3035,7 +3061,7 @@ int ieee802_11_mgmt(struct hostapd_data
  
  
  	if (stype == WLAN_FC_STYPE_PROBE_REQ) {
@@ -165,7 +165,7 @@
  		return 1;
  	}
  
-@@ -3043,17 +3069,17 @@ int ieee802_11_mgmt(struct hostapd_data
+@@ -3053,17 +3079,17 @@ int ieee802_11_mgmt(struct hostapd_data
  	switch (stype) {
  	case WLAN_FC_STYPE_AUTH:
  		wpa_printf(MSG_DEBUG, "mgmt::auth");


From lede-commits at lists.infradead.org  Mon Oct 16 03:40:16 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 06:40:16 -0400
Subject: [source]  kernel: bump 4.4 to 4.4.92
In-Reply-To: <20171016104010.6909.6912@git-01.infra.lede-project.org>
References: <20171016104010.6909.6912@git-01.infra.lede-project.org>
Message-ID: <mailman.54545.1508150444.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/fa0b5fce1f53c3520cacff49e9d371fb2c5c3685

commit fa0b5fce1f53c3520cacff49e9d371fb2c5c3685
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Mon Oct 16 13:32:51 2017 +0300

    kernel: bump 4.4 to 4.4.92
    
    Refresh patches.
    
    Fixes the following CVEs:
    - CVE-2017-1000252
    - CVE-2017-12153
    - CVE-2017-12154
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 include/kernel-version.mk                                      |  4 ++--
 .../0527-Support-for-Blokas-Labs-pisound-board.patch           |  4 ++--
 target/linux/cns3xxx/patches-4.4/200-broadcom_phy_reinit.patch |  2 +-
 .../680-NET-skip-GRO-for-foreign-MAC-addresses.patch           | 10 +++++-----
 target/linux/generic/patches-4.4/721-phy_packets.patch         |  2 +-
 .../oxnas/patches-4.4/250-add-plxtech-vendor-prefix.patch      |  2 +-
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index b4e29ff..51e0dcf 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .89
+LINUX_VERSION-4.4 = .92
 
 LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.89 = a81d1b1306e4fddee5d6f7219090a616073b02f4069e44522a9c0454b17f2b67
+LINUX_KERNEL_HASH-4.4.92 = 53f8cd8b024444df0f242f8e6ab5147b0b009d7a30e8b2ed3854e8d17937460d
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/brcm2708/patches-4.4/0527-Support-for-Blokas-Labs-pisound-board.patch b/target/linux/brcm2708/patches-4.4/0527-Support-for-Blokas-Labs-pisound-board.patch
index 44335f1..72c2aad 100644
--- a/target/linux/brcm2708/patches-4.4/0527-Support-for-Blokas-Labs-pisound-board.patch
+++ b/target/linux/brcm2708/patches-4.4/0527-Support-for-Blokas-Labs-pisound-board.patch
@@ -19,8 +19,8 @@ Subject: [PATCH] Support for Blokas Labs pisound board
 
 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
 +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
-@@ -33,6 +33,7 @@ auo	AU Optronics Corporation
- avago	Avago Technologies
+@@ -34,6 +34,7 @@ avago	Avago Technologies
+ avia	avia semiconductor
  avic	Shanghai AVIC Optoelectronics Co., Ltd.
  axis	Axis Communications AB
 +blokaslabs	Vilniaus Blokas UAB
diff --git a/target/linux/cns3xxx/patches-4.4/200-broadcom_phy_reinit.patch b/target/linux/cns3xxx/patches-4.4/200-broadcom_phy_reinit.patch
index f3ae5e6..0352a89 100644
--- a/target/linux/cns3xxx/patches-4.4/200-broadcom_phy_reinit.patch
+++ b/target/linux/cns3xxx/patches-4.4/200-broadcom_phy_reinit.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/phy/broadcom.c
 +++ b/drivers/net/phy/broadcom.c
-@@ -414,6 +414,11 @@ static int bcm5481_config_aneg(struct ph
+@@ -420,6 +420,11 @@ static int bcm5481_config_aneg(struct ph
  		/* Write bits 14:0. */
  		reg |= (1 << 15);
  		phy_write(phydev, 0x18, reg);
diff --git a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index 0616eaa..b7ba384 100644
--- a/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/patches-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -4256,6 +4256,9 @@ static enum gro_result dev_gro_receive(s
+@@ -4259,6 +4259,9 @@ static enum gro_result dev_gro_receive(s
  	enum gro_result ret;
  	int grow;
  
@@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!(skb->dev->features & NETIF_F_GRO))
  		goto normal;
  
-@@ -5422,6 +5425,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -5425,6 +5428,48 @@ static void __netdev_adjacent_dev_unlink
  					   &upper_dev->adj_list.lower);
  }
  
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int __netdev_upper_dev_link(struct net_device *dev,
  				   struct net_device *upper_dev, bool master,
  				   void *private)
-@@ -5493,6 +5538,7 @@ static int __netdev_upper_dev_link(struc
+@@ -5496,6 +5541,7 @@ static int __netdev_upper_dev_link(struc
  			goto rollback_lower_mesh;
  	}
  
@@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
  				      &changeupper_info.info);
  	return 0;
-@@ -5619,6 +5665,7 @@ void netdev_upper_dev_unlink(struct net_
+@@ -5622,6 +5668,7 @@ void netdev_upper_dev_unlink(struct net_
  	list_for_each_entry(i, &upper_dev->all_adj_list.upper, list)
  		__netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr);
  
@@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev,
  				      &changeupper_info.info);
  }
-@@ -6159,6 +6206,7 @@ int dev_set_mac_address(struct net_devic
+@@ -6162,6 +6209,7 @@ int dev_set_mac_address(struct net_devic
  	if (err)
  		return err;
  	dev->addr_assign_type = NET_ADDR_SET;
diff --git a/target/linux/generic/patches-4.4/721-phy_packets.patch b/target/linux/generic/patches-4.4/721-phy_packets.patch
index 89ffdc5..a7a2327 100644
--- a/target/linux/generic/patches-4.4/721-phy_packets.patch
+++ b/target/linux/generic/patches-4.4/721-phy_packets.patch
@@ -86,7 +86,7 @@
  	help
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -2743,10 +2743,20 @@ static int xmit_one(struct sk_buff *skb,
+@@ -2746,10 +2746,20 @@ static int xmit_one(struct sk_buff *skb,
  	if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all))
  		dev_queue_xmit_nit(skb, dev);
  
diff --git a/target/linux/oxnas/patches-4.4/250-add-plxtech-vendor-prefix.patch b/target/linux/oxnas/patches-4.4/250-add-plxtech-vendor-prefix.patch
index d6c5c62..a94ac22 100644
--- a/target/linux/oxnas/patches-4.4/250-add-plxtech-vendor-prefix.patch
+++ b/target/linux/oxnas/patches-4.4/250-add-plxtech-vendor-prefix.patch
@@ -1,6 +1,6 @@
 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
 +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
-@@ -174,6 +174,7 @@ picochip	Picochip Ltd
+@@ -175,6 +175,7 @@ picochip	Picochip Ltd
  plathome	Plat'Home Co., Ltd.
  plda	PLDA
  pixcir  PIXCIR MICROELECTRONICS Co., Ltd


From lede-commits at lists.infradead.org  Mon Oct 16 04:29:43 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 07:29:43 -0400
Subject: [source]  mac80211: Update wireless-regdb to master-2017-03-07
In-Reply-To: <20171016112943.31641.39160@git-01.infra.lede-project.org>
References: <20171016112943.31641.39160@git-01.infra.lede-project.org>
Message-ID: <mailman.54559.1508153412.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/707305a19dbd235a55fe5fee45d92485f40022b8

commit 707305a19dbd235a55fe5fee45d92485f40022b8
Author: Ryan Mounce <ryan at mounce.com.au>
AuthorDate: Wed Mar 8 00:11:42 2017 +1030

    mac80211: Update wireless-regdb to master-2017-03-07
    
    The short log of changes since the 2016-06-10 release is below.
    
    Jouni Malinen (1):
          wireless-regdb: Remove DFS requirement for India (IN)
    
    Ryan Mounce (1):
          wireless-regdb: Update rules for Australia (AU) and add 60GHz rules
    
    Seth Forshee (2):
          wireless-regdb: Update 5 GHz rules for Canada
          wireless-regdb: update regulatory.bin based on preceding changes
    
    Signed-off-by: Ryan Mounce <ryan at mounce.com.au>
    (cherry picked from commit 8b12e62e9cd6ba2e3bb2e7f2555180df0173c7c6)
---
 package/kernel/mac80211/files/regdb.txt | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt
index c4a9b2d..d583887 100644
--- a/package/kernel/mac80211/files/regdb.txt
+++ b/package/kernel/mac80211/files/regdb.txt
@@ -85,12 +85,20 @@ country AT: DFS-ETSI
 	# 60 GHz band channels 1-4, ref: Etsi En 302 567
 	(57000 - 66000 @ 2160), (40)
 
+# Source:
+# https://www.legislation.gov.au/Details/F2016C00432
+# Both DFS-ETSI and DFS-FCC are acceptable per AS/NZS 4268 Appendix B.
+# The EIRP for DFS bands can be increased by 3dB if TPC is implemented.
+# In order to allow 80MHz operation between 5650-5730MHz the upper boundary
+# of this more restrictive band has been shifted up by 5MHz from 5725MHz.
 country AU: DFS-ETSI
-	(2402 - 2482 @ 40), (20)
-	(5170 - 5250 @ 80), (17), AUTO-BW
-	(5250 - 5330 @ 80), (24), DFS, AUTO-BW
-	(5490 - 5710 @ 160), (24), DFS
-	(5735 - 5835 @ 80), (30)
+	(2400 - 2483.5 @ 40), (36)
+	(5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW
+	(5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS
+	(5470 - 5600 @ 80), (27), DFS
+	(5650 - 5730 @ 80), (27), DFS
+	(5730 - 5850 @ 80), (36)
+	(57000 - 66000 @ 2160), (43), NO-OUTDOOR
 
 country AW: DFS-ETSI
 	(2402 - 2482 @ 40), (20)
@@ -230,9 +238,9 @@ country BZ: DFS-JP
 
 country CA: DFS-FCC
 	(2402 - 2472 @ 40), (30)
-	(5170 - 5250 @ 80), (17), AUTO-BW
-	(5250 - 5330 @ 80), (24), DFS, AUTO-BW
-	(5490 - 5600 @ 80), (24), DFS
+	(5150 - 5250 @ 80), (23), AUTO-BW
+	(5250 - 5350 @ 80), (24), DFS, AUTO-BW
+	(5470 - 5600 @ 80), (24), DFS
 	(5650 - 5730 @ 80), (24), DFS
 	(5735 - 5835 @ 80), (30)
 
@@ -580,11 +588,10 @@ country IL: DFS-ETSI
 	(5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW
 	(5250 - 5350 @ 80), (200 mW), NO-OUTDOOR, DFS, AUTO-BW
 
-country IN: DFS-JP
+country IN:
 	(2402 - 2482 @ 40), (20)
-	(5170 - 5250 @ 80), (20), AUTO-BW
-	(5250 - 5330 @ 80), (20), DFS, AUTO-BW
-	(5735 - 5835 @ 80), (20)
+	(5150 - 5350 @ 160), (23)
+	(5725 - 5875 @ 80), (23)
 
 country IR: DFS-JP
 	(2402 - 2482 @ 40), (20)


From lede-commits at lists.infradead.org  Mon Oct 16 08:29:32 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 11:29:32 -0400
Subject: [source]  x86: partly revert cabf775
In-Reply-To: <20171016152932.16232.91723@git-01.infra.lede-project.org>
References: <20171016152932.16232.91723@git-01.infra.lede-project.org>
Message-ID: <mailman.54669.1508168976.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/46e29bd0788c9549cca9fb927da2c5e49ccbe6f6

commit 46e29bd0788c9549cca9fb927da2c5e49ccbe6f6
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Oct 16 17:21:43 2017 +0200

    x86: partly revert cabf775
    
    The subtarget cleanups made in cabf775 "x86: Refresh subtargets kernel config"
    removed some important symbol disable statements, so revert the changes to the
    subtarget configs for now.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 target/linux/x86/geode/config-default  |  3 +++
 target/linux/x86/legacy/config-default | 10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default
index d1c8f5a..16c439d 100644
--- a/target/linux/x86/geode/config-default
+++ b/target/linux/x86/geode/config-default
@@ -30,10 +30,12 @@ CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y
 # CONFIG_ACPI_SBS is not set
 CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y
 CONFIG_ACPI_THERMAL=y
+# CONFIG_ACPI_VIDEO is not set
 # CONFIG_ACPI_WMI is not set
 CONFIG_ALIX=y
 CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
 # CONFIG_ATA_PIIX is not set
+# CONFIG_BACKLIGHT_APPLE is not set
 CONFIG_CS5535_CLOCK_EVENT_SRC=y
 CONFIG_CS5535_MFGPT=y
 CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7
@@ -131,3 +133,4 @@ CONFIG_X86_PM_TIMER=y
 # CONFIG_X86_PPRO_FENCE is not set
 CONFIG_X86_REBOOTFIXUPS=y
 CONFIG_X86_TSC=y
+# CONFIG_X86_X2APIC is not set
diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default
index 02cd851..1983ab4 100644
--- a/target/linux/x86/legacy/config-default
+++ b/target/linux/x86/legacy/config-default
@@ -1,6 +1,7 @@
 # CONFIG_3C515 is not set
 CONFIG_ACPI=y
 CONFIG_ACPI_AC=y
+# CONFIG_ACPI_ALS is not set
 CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
 # CONFIG_ACPI_CMPC is not set
@@ -38,11 +39,13 @@ CONFIG_AGP_INTEL=y
 # CONFIG_AGP_SIS is not set
 # CONFIG_AGP_SWORKS is not set
 # CONFIG_AGP_VIA is not set
+# CONFIG_APPLE_GMUX is not set
 CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y
 # CONFIG_BACKLIGHT_APPLE is not set
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_GENERIC=y
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_BACKLIGHT_SAHARA is not set
 CONFIG_BLK_DEV_SR=y
 # CONFIG_BLK_DEV_SR_VENDOR is not set
 CONFIG_CLKDEV_LOOKUP=y
@@ -108,6 +111,7 @@ CONFIG_FONT_SUPPORT=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FUJITSU_LAPTOP is not set
 CONFIG_HAVE_ACPI_APEI=y
 CONFIG_HAVE_ACPI_APEI_NMI=y
 CONFIG_HAVE_CLK=y
@@ -160,8 +164,10 @@ CONFIG_MOUSE_PS2_SYNAPTICS=y
 CONFIG_MOUSE_PS2_TRACKPOINT=y
 # CONFIG_MOUSE_SERIAL is not set
 # CONFIG_MOUSE_VSXXXAA is not set
+CONFIG_NLS=y
 CONFIG_NOHIGHMEM=y
 CONFIG_NO_HZ=y
+# CONFIG_PANASONIC_LAPTOP is not set
 CONFIG_PATA_AMD=y
 CONFIG_PATA_ATIIXP=y
 CONFIG_PATA_LEGACY=y
@@ -172,6 +178,7 @@ CONFIG_PATA_SC1200=y
 CONFIG_PATA_VIA=y
 CONFIG_PCIEAER=y
 CONFIG_PCIEPORTBUS=y
+CONFIG_PCI_LABEL=y
 CONFIG_PCI_MMCONFIG=y
 # CONFIG_PCWATCHDOG is not set
 # CONFIG_PMIC_OPREGION is not set
@@ -200,6 +207,7 @@ CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
 # CONFIG_WDT is not set
 CONFIG_X86_ACPI_CPUFREQ=y
 # CONFIG_X86_ACPI_CPUFREQ_CPB is not set
+# CONFIG_X86_POWERNOW_K8 is not set
 # CONFIG_X86_AMD_FREQ_SENSITIVITY is not set
 # CONFIG_X86_AMD_PLATFORM_DEVICE is not set
 # CONFIG_X86_E_POWERSAVER is not set
@@ -208,4 +216,4 @@ CONFIG_X86_ACPI_CPUFREQ=y
 # CONFIG_X86_PAE is not set
 # CONFIG_X86_PCC_CPUFREQ is not set
 CONFIG_X86_PM_TIMER=y
-# CONFIG_X86_POWERNOW_K8 is not set
+# CONFIG_X86_X2APIC is not set


From lede-commits at lists.infradead.org  Mon Oct 16 11:11:24 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 14:11:24 -0400
Subject: [source]  ppp: make the patches apply correctly again
In-Reply-To: <20171016181124.27521.8228@git-01.infra.lede-project.org>
References: <20171016181124.27521.8228@git-01.infra.lede-project.org>
Message-ID: <mailman.54688.1508177515.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/a29848c67180396656e4e8a7ef47ae5b441a7325

commit a29848c67180396656e4e8a7ef47ae5b441a7325
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Oct 16 20:08:56 2017 +0200

    ppp: make the patches apply correctly again
    
    This fixes a compile problem recently introduced by me.
    
    Fixes: f40fd43ab2f ("ppp: fix compile warning")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/services/ppp/patches/500-add-pptp-plugin.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch
index 54a160d..5ed861d 100644
--- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch
+++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch
@@ -1064,7 +1064,7 @@
 +			   struct in_addr localbind);
 --- /dev/null
 +++ b/pppd/plugins/pptp/pptp_ctrl.c
-@@ -0,0 +1,1077 @@
+@@ -0,0 +1,1078 @@
 +/* pptp_ctrl.c ... handle PPTP control connection.
 + *                 C. Scott Ananian <cananian at alumni.princeton.edu>
 + *


From lede-commits at lists.infradead.org  Mon Oct 16 14:06:36 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 17:06:36 -0400
Subject: [source]  at91: fix legacy build
In-Reply-To: <20171016210636.1904.33275@git-01.infra.lede-project.org>
References: <20171016210636.1904.33275@git-01.infra.lede-project.org>
Message-ID: <mailman.54719.1508188025.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/61048c901189d3d24ffc35e2e0ab2355f6ec0dbc

commit 61048c901189d3d24ffc35e2e0ab2355f6ec0dbc
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Oct 16 21:36:17 2017 +0200

    at91: fix legacy build
    
    The build system took the DTB_SIZE definition from Default and not from
    production-dtb under some conditions. Move the size definitions to
    Default now as it is only used in production-dtb anyway.
    
    Thanks Mathias Kresin for helping me with this.
    
    Fixes: c2f052acaeb ("at91: convert boards to generic build target")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/at91/image/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile
index fedefe4..1260707 100644
--- a/target/linux/at91/image/Makefile
+++ b/target/linux/at91/image/Makefile
@@ -24,7 +24,7 @@ define Device/Default
   KERNEL_NAME := zImage
   KERNEL_SIZE := 4096k
   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
-  DTB_SIZE :=
+  DTB_SIZE := 128k
 endef
 
 define Device/dtb
@@ -66,7 +66,6 @@ endef
 define Device/production-dtb
   $(Device/production)
   $(Device/dtb)
-  DTB_SIZE := 128k
   IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
 	  | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
 endef


From lede-commits at lists.infradead.org  Mon Oct 16 16:00:25 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 19:00:25 -0400
Subject: [source]  mac80211: backport kernel fix for CVE-2017-13080
In-Reply-To: <20171016230025.5865.58652@git-01.infra.lede-project.org>
References: <20171016230025.5865.58652@git-01.infra.lede-project.org>
Message-ID: <mailman.54734.1508194858.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/2f701194c29da50bfda968a83c6609843f74a7f4

commit 2f701194c29da50bfda968a83c6609843f74a7f4
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 17 01:49:58 2017 +0300

    mac80211: backport kernel fix for CVE-2017-13080
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 ...cept-key-reinstall-without-changing-anyth.patch | 81 ++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch
new file mode 100644
index 0000000..7d0be03
--- /dev/null
+++ b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch
@@ -0,0 +1,81 @@
+From fdf7cb4185b60c68e1a75e61691c4afdc15dea0e Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg at intel.com>
+Date: Tue, 5 Sep 2017 14:54:54 +0200
+Subject: [PATCH] mac80211: accept key reinstall without changing anything
+
+When a key is reinstalled we can reset the replay counters
+etc. which can lead to nonce reuse and/or replay detection
+being impossible, breaking security properties, as described
+in the "KRACK attacks".
+
+In particular, CVE-2017-13080 applies to GTK rekeying that
+happened in firmware while the host is in D3, with the second
+part of the attack being done after the host wakes up. In
+this case, the wpa_supplicant mitigation isn't sufficient
+since wpa_supplicant doesn't know the GTK material.
+
+In case this happens, simply silently accept the new key
+coming from userspace but don't take any action on it since
+it's the same key; this keeps the PN replay counters intact.
+
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+ net/mac80211/key.c | 21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/net/mac80211/key.c b/net/mac80211/key.c
+index a98fc2b5e0dc..ae995c8480db 100644
+--- a/net/mac80211/key.c
++++ b/net/mac80211/key.c
+@@ -4,7 +4,7 @@
+  * Copyright 2006-2007	Jiri Benc <jbenc at suse.cz>
+  * Copyright 2007-2008	Johannes Berg <johannes at sipsolutions.net>
+  * Copyright 2013-2014  Intel Mobile Communications GmbH
+- * Copyright 2015	Intel Deutschland GmbH
++ * Copyright 2015-2017	Intel Deutschland GmbH
+  *
+  * 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
+@@ -620,9 +620,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
+ 
+ 	pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE;
+ 	idx = key->conf.keyidx;
+-	key->local = sdata->local;
+-	key->sdata = sdata;
+-	key->sta = sta;
+ 
+ 	mutex_lock(&sdata->local->key_mtx);
+ 
+@@ -633,6 +630,21 @@ int ieee80211_key_link(struct ieee80211_key *key,
+ 	else
+ 		old_key = key_mtx_dereference(sdata->local, sdata->keys[idx]);
+ 
++	/*
++	 * Silently accept key re-installation without really installing the
++	 * new version of the key to avoid nonce reuse or replay issues.
++	 */
++	if (old_key && key->conf.keylen == old_key->conf.keylen &&
++	    !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) {
++		ieee80211_key_free_unused(key);
++		ret = 0;
++		goto out;
++	}
++
++	key->local = sdata->local;
++	key->sdata = sdata;
++	key->sta = sta;
++
+ 	increment_tailroom_need_count(sdata);
+ 
+ 	ieee80211_key_replace(sdata, sta, pairwise, old_key, key);
+@@ -648,6 +660,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
+ 		ret = 0;
+ 	}
+ 
++ out:
+ 	mutex_unlock(&sdata->local->key_mtx);
+ 
+ 	return ret;
+-- 
+2.13.6
+


From lede-commits at lists.infradead.org  Mon Oct 16 16:00:52 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 19:00:52 -0400
Subject: [source]  mac80211: backport kernel fix for CVE-2017-13080
In-Reply-To: <20171016230052.6307.61629@git-01.infra.lede-project.org>
References: <20171016230052.6307.61629@git-01.infra.lede-project.org>
Message-ID: <mailman.54735.1508194888.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/a5e1f7f5ef63eb4036d7f1299d1da97687719ca1

commit a5e1f7f5ef63eb4036d7f1299d1da97687719ca1
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 17 01:49:58 2017 +0300

    mac80211: backport kernel fix for CVE-2017-13080
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
    (cherry picked from commit 2f701194c29da50bfda968a83c6609843f74a7f4)
---
 ...cept-key-reinstall-without-changing-anyth.patch | 81 ++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch
new file mode 100644
index 0000000..7d0be03
--- /dev/null
+++ b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch
@@ -0,0 +1,81 @@
+From fdf7cb4185b60c68e1a75e61691c4afdc15dea0e Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg at intel.com>
+Date: Tue, 5 Sep 2017 14:54:54 +0200
+Subject: [PATCH] mac80211: accept key reinstall without changing anything
+
+When a key is reinstalled we can reset the replay counters
+etc. which can lead to nonce reuse and/or replay detection
+being impossible, breaking security properties, as described
+in the "KRACK attacks".
+
+In particular, CVE-2017-13080 applies to GTK rekeying that
+happened in firmware while the host is in D3, with the second
+part of the attack being done after the host wakes up. In
+this case, the wpa_supplicant mitigation isn't sufficient
+since wpa_supplicant doesn't know the GTK material.
+
+In case this happens, simply silently accept the new key
+coming from userspace but don't take any action on it since
+it's the same key; this keeps the PN replay counters intact.
+
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+ net/mac80211/key.c | 21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/net/mac80211/key.c b/net/mac80211/key.c
+index a98fc2b5e0dc..ae995c8480db 100644
+--- a/net/mac80211/key.c
++++ b/net/mac80211/key.c
+@@ -4,7 +4,7 @@
+  * Copyright 2006-2007	Jiri Benc <jbenc at suse.cz>
+  * Copyright 2007-2008	Johannes Berg <johannes at sipsolutions.net>
+  * Copyright 2013-2014  Intel Mobile Communications GmbH
+- * Copyright 2015	Intel Deutschland GmbH
++ * Copyright 2015-2017	Intel Deutschland GmbH
+  *
+  * 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
+@@ -620,9 +620,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
+ 
+ 	pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE;
+ 	idx = key->conf.keyidx;
+-	key->local = sdata->local;
+-	key->sdata = sdata;
+-	key->sta = sta;
+ 
+ 	mutex_lock(&sdata->local->key_mtx);
+ 
+@@ -633,6 +630,21 @@ int ieee80211_key_link(struct ieee80211_key *key,
+ 	else
+ 		old_key = key_mtx_dereference(sdata->local, sdata->keys[idx]);
+ 
++	/*
++	 * Silently accept key re-installation without really installing the
++	 * new version of the key to avoid nonce reuse or replay issues.
++	 */
++	if (old_key && key->conf.keylen == old_key->conf.keylen &&
++	    !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) {
++		ieee80211_key_free_unused(key);
++		ret = 0;
++		goto out;
++	}
++
++	key->local = sdata->local;
++	key->sdata = sdata;
++	key->sta = sta;
++
+ 	increment_tailroom_need_count(sdata);
+ 
+ 	ieee80211_key_replace(sdata, sta, pairwise, old_key, key);
+@@ -648,6 +660,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
+ 		ret = 0;
+ 	}
+ 
++ out:
+ 	mutex_unlock(&sdata->local->key_mtx);
+ 
+ 	return ret;
+-- 
+2.13.6
+


From lede-commits at lists.infradead.org  Mon Oct 16 16:14:19 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 16 Oct 2017 19:14:19 -0400
Subject: [source]  hostapd: bump PKG_RELEASE
In-Reply-To: <20171016231419.12427.98563@git-01.infra.lede-project.org>
References: <20171016231419.12427.98563@git-01.infra.lede-project.org>
Message-ID: <mailman.54739.1508195690.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/5fff2f44d5892ea34d66cfb5e638b035b7f6d1fd

commit 5fff2f44d5892ea34d66cfb5e638b035b7f6d1fd
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 17 02:13:34 2017 +0300

    hostapd: bump PKG_RELEASE
    
    The previous CVE bugfix commit did not adjust PKG_RELEASE, therefore the
    fixed hostapd/wpad/wpa_supplicant packages do not appear as opkg update.
    
    Bump the PKG_RELEASE to signify upgrades to downstream users.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/network/services/hostapd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 344896c..1113e4f 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git


From lede-commits at lists.infradead.org  Tue Oct 17 07:03:26 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 17 Oct 2017 10:03:26 -0400
Subject: [source]  Revert "ar71xx: Add GRO support to ag71xx"
In-Reply-To: <20171017140326.15803.62998@git-01.infra.lede-project.org>
References: <20171017140326.15803.62998@git-01.infra.lede-project.org>
Message-ID: <mailman.54944.1508249041.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/3db529d5ccdd5d8cec96d1e0f64583a1c9449a82

commit 3db529d5ccdd5d8cec96d1e0f64583a1c9449a82
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Oct 17 15:52:08 2017 +0200

    Revert "ar71xx: Add GRO support to ag71xx"
    
    This reverts commit 13e5e473699b92f171205e0f5c57c9ebe7922492.
    This commit causes a severe regression in LAN->WAN routing performance
    for several devices. This appears to be caused by the extra requirement
    to validate the SKB checksum early in the rx path, which the ethernet
    hardware does not do
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index ae1bdf6..566e951 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -1089,7 +1089,7 @@ next:
 
 	while ((skb = __skb_dequeue(&queue)) != NULL) {
 		skb->protocol = eth_type_trans(skb, dev);
-		napi_gro_receive(&ag->napi, skb);
+		netif_receive_skb(skb);
 	}
 
 	DBG("%s: rx finish, curr=%u, dirty=%u, done=%d\n",
@@ -1141,7 +1141,7 @@ static int ag71xx_poll(struct napi_struct *napi, int limit)
 		DBG("%s: disable polling mode, rx=%d, tx=%d,limit=%d\n",
 			dev->name, rx_done, tx_done, limit);
 
-		napi_complete_done(napi, rx_done);
+		napi_complete(napi);
 
 		/* enable interrupts */
 		spin_lock_irqsave(&ag->lock, flags);
@@ -1160,7 +1160,7 @@ oom:
 		pr_info("%s: out of memory\n", dev->name);
 
 	mod_timer(&ag->oom_timer, jiffies + AG71XX_OOM_REFILL);
-	napi_complete_done(napi, rx_done);
+	napi_complete(napi);
 	return 0;
 }
 


From lede-commits at lists.infradead.org  Tue Oct 17 07:25:33 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 17 Oct 2017 10:25:33 -0400
Subject: [source]  hostapd: add wpa_disable_eapol_key_retries option
In-Reply-To: <20171017142527.22120.95723@git-01.infra.lede-project.org>
References: <20171017142527.22120.95723@git-01.infra.lede-project.org>
Message-ID: <mailman.54949.1508250370.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/c5f97c9372da3229350184fb263c97d9ea8944c5

commit c5f97c9372da3229350184fb263c97d9ea8944c5
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 17 16:35:03 2017 +0300

    hostapd: add wpa_disable_eapol_key_retries option
    
    Commit 2127425434046ae2b9f02fdbbdd37cac447af19c introduced an AP-side
    workaround for key reinstallation attacks. This option can be used to
    mitigate KRACK on the station side, in case those stations cannot be
    updated. Since many devices are out there will not receive an update
    anytime soon (if at all), it makes sense to include this workaround.
    
    Unfortunately this can cause interoperability issues and reduced
    robustness of key negotiation, so disable the workaround by default, and
    add an option to allow the user to enable it if he deems necessary.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/network/services/hostapd/files/hostapd.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 3766b7a..16925d5 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -149,6 +149,7 @@ hostapd_common_add_bss_config() {
 	config_add_int \
 		wep_rekey eap_reauth_period \
 		wpa_group_rekey wpa_pair_rekey wpa_master_rekey
+	config_add_boolean wpa_disable_eapol_key_retries
 
 	config_add_boolean rsn_preauth auth_cache
 	config_add_int ieee80211w
@@ -214,6 +215,7 @@ hostapd_set_bss_options() {
 
 	json_get_vars \
 		wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \
+		wpa_disable_eapol_key_retries \
 		maxassoc max_inactivity disassoc_low_ack isolate auth_cache \
 		wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \
 		wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \
@@ -229,6 +231,7 @@ hostapd_set_bss_options() {
 	set_default hidden 0
 	set_default wmm 1
 	set_default uapsd 1
+	set_default wpa_disable_eapol_key_retries 0
 	set_default eapol_version 0
 	set_default acct_port 1813
 
@@ -416,6 +419,8 @@ hostapd_set_bss_options() {
 			done
 		fi
 
+		append bss_conf "wpa_disable_eapol_key_retries=$wpa_disable_eapol_key_retries" "$N"
+
 		hostapd_append_wpa_key_mgmt
 		[ -n "$wpa_key_mgmt" ] && append bss_conf "wpa_key_mgmt=$wpa_key_mgmt" "$N"
 	fi


From lede-commits at lists.infradead.org  Tue Oct 17 07:25:32 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 17 Oct 2017 10:25:32 -0400
Subject: [source]  hostapd: backport extra changes related to KRACK
In-Reply-To: <20171017142527.22120.95723@git-01.infra.lede-project.org>
References: <20171017142527.22120.95723@git-01.infra.lede-project.org>
Message-ID: <mailman.54952.1508250375.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/2127425434046ae2b9f02fdbbdd37cac447af19c

commit 2127425434046ae2b9f02fdbbdd37cac447af19c
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Tue Oct 17 16:24:14 2017 +0300

    hostapd: backport extra changes related to KRACK
    
    While these changes are not included in the advisory, upstream
    encourages users to merge them.
    See http://lists.infradead.org/pipermail/hostap/2017-October/037989.html
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 ...efense-against-PTK-reinstalls-in-4-way-ha.patch |  34 ++++
 ...ength-and-check-for-this-when-deriving-PT.patch |  53 +++++
 ...-side-workaround-for-key-reinstallation-a.patch | 221 +++++++++++++++++++++
 ...consistentcy-checks-for-PTK-component-len.patch | 100 ++++++++++
 ...-information-in-supplicant-state-machine-.patch |  25 +++
 .../services/hostapd/patches/300-noscan.patch      |   4 +-
 .../patches/380-disable_ctrl_iface_mib.patch       |   8 +-
 .../patches/390-wpa_ie_cap_workaround.patch        |   4 +-
 .../hostapd/patches/600-ubus_support.patch         |   2 +-
 9 files changed, 442 insertions(+), 9 deletions(-)

diff --git a/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch b/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch
new file mode 100644
index 0000000..40f6b56
--- /dev/null
+++ b/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch
@@ -0,0 +1,34 @@
+From a00e946c1c9a1f9cc65c72900d2a444ceb1f872e Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+Date: Thu, 5 Oct 2017 23:53:01 +0200
+Subject: [PATCH] WPA: Extra defense against PTK reinstalls in 4-way handshake
+
+Currently, reinstallations of the PTK are prevented by (1) assuring the
+same TPTK is only set once as the PTK, and (2) that one particular PTK
+is only installed once. This patch makes it more explicit that point (1)
+is required to prevent key reinstallations. At the same time, this patch
+hardens wpa_supplicant such that future changes do not accidentally
+break this property.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at cs.kuleuven.be>
+---
+ src/rsn_supp/wpa.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -1728,6 +1728,14 @@ static int wpa_supplicant_verify_eapol_k
+ 			sm->ptk_set = 1;
+ 			os_memcpy(&sm->ptk, &sm->tptk, sizeof(sm->ptk));
+ 			os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++			/*
++			 * This assures the same TPTK in sm->tptk can never be
++			 * copied twice to sm->pkt as the new PTK. In
++			 * combination with the installed flag in the wpa_ptk
++			 * struct, this assures the same PTK is only installed
++			 * once.
++			 */
++			sm->renew_snonce = 1;
+ 		}
+ 	}
+ 
diff --git a/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch b/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch
new file mode 100644
index 0000000..ed7d79e
--- /dev/null
+++ b/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch
@@ -0,0 +1,53 @@
+From b488a12948751f57871f09baa345e59b23959a41 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Sun, 8 Oct 2017 13:18:02 +0300
+Subject: [PATCH] Clear PMK length and check for this when deriving PTK
+
+Instead of setting the default PMK length for the cleared PMK, set the
+length to 0 and explicitly check for this when deriving PTK to avoid
+unexpected key derivation with an all-zeroes key should it be possible
+to somehow trigger PTK derivation to happen before PMK derivation.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/common/wpa_common.c | 5 +++++
+ src/rsn_supp/wpa.c      | 7 ++++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+--- a/src/common/wpa_common.c
++++ b/src/common/wpa_common.c
+@@ -225,6 +225,11 @@ int wpa_pmk_to_ptk(const u8 *pmk, size_t
+ 	u8 tmp[WPA_KCK_MAX_LEN + WPA_KEK_MAX_LEN + WPA_TK_MAX_LEN];
+ 	size_t ptk_len;
+ 
++	if (pmk_len == 0) {
++		wpa_printf(MSG_ERROR, "WPA: No PMK set for PT derivation");
++		return -1;
++	}
++
+ 	if (os_memcmp(addr1, addr2, ETH_ALEN) < 0) {
+ 		os_memcpy(data, addr1, ETH_ALEN);
+ 		os_memcpy(data + ETH_ALEN, addr2, ETH_ALEN);
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -584,7 +584,8 @@ static void wpa_supplicant_process_1_of_
+ 	/* Calculate PTK which will be stored as a temporary PTK until it has
+ 	 * been verified when processing message 3/4. */
+ 	ptk = &sm->tptk;
+-	wpa_derive_ptk(sm, src_addr, key, ptk);
++	if (wpa_derive_ptk(sm, src_addr, key, ptk) < 0)
++		goto failed;
+ 	if (sm->pairwise_cipher == WPA_CIPHER_TKIP) {
+ 		u8 buf[8];
+ 		/* Supplicant: swap tx/rx Mic keys */
+@@ -2705,8 +2706,8 @@ void wpa_sm_set_pmk_from_pmksa(struct wp
+ 		sm->pmk_len = sm->cur_pmksa->pmk_len;
+ 		os_memcpy(sm->pmk, sm->cur_pmksa->pmk, sm->pmk_len);
+ 	} else {
+-		sm->pmk_len = PMK_LEN;
+-		os_memset(sm->pmk, 0, PMK_LEN);
++		sm->pmk_len = 0;
++		os_memset(sm->pmk, 0, PMK_LEN_MAX);
+ 	}
+ }
+ 
diff --git a/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch b/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch
new file mode 100644
index 0000000..19165cc
--- /dev/null
+++ b/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch
@@ -0,0 +1,221 @@
+From 6f234c1e2ee1ede29f2412b7012b3345ed8e52d3 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Mon, 16 Oct 2017 18:37:43 +0300
+Subject: [PATCH] Optional AP side workaround for key reinstallation attacks
+
+This adds a new hostapd configuration parameter
+wpa_disable_eapol_key_retries=1 that can be used to disable
+retransmission of EAPOL-Key frames that are used to install
+keys (EAPOL-Key message 3/4 and group message 1/2). This is
+similar to setting wpa_group_update_count=1 and
+wpa_pairwise_update_count=1, but with no impact to message 1/4
+retries and with extended timeout for messages 4/4 and group
+message 2/2 to avoid causing issues with stations that may use
+aggressive power saving have very long time in replying to the
+EAPOL-Key messages.
+
+This option can be used to work around key reinstallation attacks
+on the station (supplicant) side in cases those station devices
+cannot be updated for some reason. By removing the
+retransmissions the attacker cannot cause key reinstallation with
+a delayed frame transmission. This is related to the station side
+vulnerabilities CVE-2017-13077, CVE-2017-13078, CVE-2017-13079,
+CVE-2017-13080, and CVE-2017-13081.
+
+This workaround might cause interoperability issues and reduced
+robustness of key negotiation especially in environments with
+heavy traffic load due to the number of attempts to perform the
+key exchange is reduced significantly. As such, this workaround
+is disabled by default (unless overridden in build
+configuration). To enable this, set the parameter to 1.
+
+It is also possible to enable this in the build by default by
+adding the following to the build configuration:
+
+CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ hostapd/config_file.c  |  2 ++
+ hostapd/defconfig      |  4 ++++
+ hostapd/hostapd.conf   | 24 ++++++++++++++++++++++++
+ src/ap/ap_config.c     |  6 ++++++
+ src/ap/ap_config.h     |  1 +
+ src/ap/wpa_auth.c      | 22 ++++++++++++++++++++--
+ src/ap/wpa_auth.h      |  1 +
+ src/ap/wpa_auth_glue.c |  2 ++
+ 8 files changed, 60 insertions(+), 2 deletions(-)
+
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -2542,6 +2542,8 @@ static int hostapd_config_fill(struct ho
+ 			return 1;
+ 		}
+ 		bss->wpa_pairwise_update_count = (u32) val;
++	} else if (os_strcmp(buf, "wpa_disable_eapol_key_retries") == 0) {
++		bss->wpa_disable_eapol_key_retries = atoi(pos);
+ 	} else if (os_strcmp(buf, "wpa_passphrase") == 0) {
+ 		int len = os_strlen(pos);
+ 		if (len < 8 || len > 63) {
+--- a/hostapd/defconfig
++++ b/hostapd/defconfig
+@@ -372,3 +372,7 @@ CONFIG_IPV6=y
+ # Opportunistic Wireless Encryption (OWE)
+ # Experimental implementation of draft-harkins-owe-07.txt
+ #CONFIG_OWE=y
++
++# Override default value for the wpa_disable_eapol_key_retries configuration
++# parameter. See that parameter in hostapd.conf for more details.
++#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1
+--- a/hostapd/hostapd.conf
++++ b/hostapd/hostapd.conf
+@@ -1315,6 +1315,30 @@ own_ip_addr=127.0.0.1
+ # Range 1..4294967295; default: 4
+ #wpa_pairwise_update_count=4
+ 
++# Workaround for key reinstallation attacks
++#
++# This parameter can be used to disable retransmission of EAPOL-Key frames that
++# are used to install keys (EAPOL-Key message 3/4 and group message 1/2). This
++# is similar to setting wpa_group_update_count=1 and
++# wpa_pairwise_update_count=1, but with no impact to message 1/4 and with
++# extended timeout on the response to avoid causing issues with stations that
++# may use aggressive power saving have very long time in replying to the
++# EAPOL-Key messages.
++#
++# This option can be used to work around key reinstallation attacks on the
++# station (supplicant) side in cases those station devices cannot be updated
++# for some reason. By removing the retransmissions the attacker cannot cause
++# key reinstallation with a delayed frame transmission. This is related to the
++# station side vulnerabilities CVE-2017-13077, CVE-2017-13078, CVE-2017-13079,
++# CVE-2017-13080, and CVE-2017-13081.
++#
++# This workaround might cause interoperability issues and reduced robustness of
++# key negotiation especially in environments with heavy traffic load due to the
++# number of attempts to perform the key exchange is reduced significantly. As
++# such, this workaround is disabled by default (unless overridden in build
++# configuration). To enable this, set the parameter to 1.
++#wpa_disable_eapol_key_retries=1
++
+ # Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up
+ # roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN
+ # authentication and key handshake before actually associating with a new AP.
+--- a/src/ap/ap_config.c
++++ b/src/ap/ap_config.c
+@@ -37,6 +37,10 @@ static void hostapd_config_free_vlan(str
+ }
+ 
+ 
++#ifndef DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES
++#define DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES 0
++#endif /* DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES */
++
+ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
+ {
+ 	dl_list_init(&bss->anqp_elem);
+@@ -58,6 +62,8 @@ void hostapd_config_defaults_bss(struct
+ 	bss->wpa_gmk_rekey = 86400;
+ 	bss->wpa_group_update_count = 4;
+ 	bss->wpa_pairwise_update_count = 4;
++	bss->wpa_disable_eapol_key_retries =
++		DEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES;
+ 	bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK;
+ 	bss->wpa_pairwise = WPA_CIPHER_TKIP;
+ 	bss->wpa_group = WPA_CIPHER_TKIP;
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -333,6 +333,7 @@ struct hostapd_bss_config {
+ 	int wpa_ptk_rekey;
+ 	u32 wpa_group_update_count;
+ 	u32 wpa_pairwise_update_count;
++	int wpa_disable_eapol_key_retries;
+ 	int rsn_pairwise;
+ 	int rsn_preauth;
+ 	char *rsn_preauth_interfaces;
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -65,6 +65,7 @@ static u8 * ieee80211w_kde_add(struct wp
+ static const u32 eapol_key_timeout_first = 100; /* ms */
+ static const u32 eapol_key_timeout_subseq = 1000; /* ms */
+ static const u32 eapol_key_timeout_first_group = 500; /* ms */
++static const u32 eapol_key_timeout_no_retrans = 4000; /* ms */
+ 
+ /* TODO: make these configurable */
+ static const int dot11RSNAConfigPMKLifetime = 43200;
+@@ -1653,6 +1654,9 @@ static void wpa_send_eapol(struct wpa_au
+ 			eapol_key_timeout_first_group;
+ 	else
+ 		timeout_ms = eapol_key_timeout_subseq;
++	if (wpa_auth->conf.wpa_disable_eapol_key_retries &&
++	    (!pairwise || (key_info & WPA_KEY_INFO_MIC)))
++		timeout_ms = eapol_key_timeout_no_retrans;
+ 	if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC))
+ 		sm->pending_1_of_4_timeout = 1;
+ 	wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry "
+@@ -2882,6 +2886,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING)
+ 	sm->TimeoutEvt = FALSE;
+ 
+ 	sm->TimeoutCtr++;
++	if (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
++	    sm->TimeoutCtr > 1) {
++		/* Do not allow retransmission of EAPOL-Key msg 3/4 */
++		return;
++	}
+ 	if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) {
+ 		/* No point in sending the EAPOL-Key - we will disconnect
+ 		 * immediately following this. */
+@@ -3220,7 +3229,9 @@ SM_STEP(WPA_PTK)
+ 			 sm->EAPOLKeyPairwise && sm->MICVerified)
+ 			SM_ENTER(WPA_PTK, PTKINITDONE);
+ 		else if (sm->TimeoutCtr >
+-			 sm->wpa_auth->conf.wpa_pairwise_update_count) {
++			 sm->wpa_auth->conf.wpa_pairwise_update_count ||
++			 (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
++			  sm->TimeoutCtr > 1)) {
+ 			wpa_auth->dot11RSNA4WayHandshakeFailures++;
+ 			wpa_auth_vlogger(
+ 				sm->wpa_auth, sm->addr, LOGGER_DEBUG,
+@@ -3260,6 +3271,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING
+ 	SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group);
+ 
+ 	sm->GTimeoutCtr++;
++	if (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
++	    sm->GTimeoutCtr > 1) {
++		/* Do not allow retransmission of EAPOL-Key group msg 1/2 */
++		return;
++	}
+ 	if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) {
+ 		/* No point in sending the EAPOL-Key - we will disconnect
+ 		 * immediately following this. */
+@@ -3363,7 +3379,9 @@ SM_STEP(WPA_PTK_GROUP)
+ 		    !sm->EAPOLKeyPairwise && sm->MICVerified)
+ 			SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED);
+ 		else if (sm->GTimeoutCtr >
+-			 sm->wpa_auth->conf.wpa_group_update_count)
++			 sm->wpa_auth->conf.wpa_group_update_count ||
++			 (sm->wpa_auth->conf.wpa_disable_eapol_key_retries &&
++			  sm->GTimeoutCtr > 1))
+ 			SM_ENTER(WPA_PTK_GROUP, KEYERROR);
+ 		else if (sm->TimeoutEvt)
+ 			SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING);
+--- a/src/ap/wpa_auth.h
++++ b/src/ap/wpa_auth.h
+@@ -165,6 +165,7 @@ struct wpa_auth_config {
+ 	int wpa_ptk_rekey;
+ 	u32 wpa_group_update_count;
+ 	u32 wpa_pairwise_update_count;
++	int wpa_disable_eapol_key_retries;
+ 	int rsn_pairwise;
+ 	int rsn_preauth;
+ 	int eapol_version;
+--- a/src/ap/wpa_auth_glue.c
++++ b/src/ap/wpa_auth_glue.c
+@@ -45,6 +45,8 @@ static void hostapd_wpa_auth_conf(struct
+ 	wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey;
+ 	wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey;
+ 	wconf->wpa_group_update_count = conf->wpa_group_update_count;
++	wconf->wpa_disable_eapol_key_retries =
++		conf->wpa_disable_eapol_key_retries;
+ 	wconf->wpa_pairwise_update_count = conf->wpa_pairwise_update_count;
+ 	wconf->rsn_pairwise = conf->rsn_pairwise;
+ 	wconf->rsn_preauth = conf->rsn_preauth;
diff --git a/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch b/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch
new file mode 100644
index 0000000..5cc2f7b
--- /dev/null
+++ b/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch
@@ -0,0 +1,100 @@
+From a6ea665300919d6a3af22b1f4237203647fda93a Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Tue, 17 Oct 2017 00:01:11 +0300
+Subject: [PATCH] Additional consistentcy checks for PTK component lengths
+
+Verify that TK, KCK, and KEK lengths are set to consistent values within
+struct wpa_ptk before using them in supplicant. This is an additional
+layer of protection against unexpected states.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/common/wpa_common.c |  6 ++++++
+ src/rsn_supp/wpa.c      | 26 ++++++++++++++++++++------
+ 2 files changed, 26 insertions(+), 6 deletions(-)
+
+--- a/src/common/wpa_common.c
++++ b/src/common/wpa_common.c
+@@ -100,6 +100,12 @@ int wpa_eapol_key_mic(const u8 *key, siz
+ {
+ 	u8 hash[SHA512_MAC_LEN];
+ 
++	if (key_len == 0) {
++		wpa_printf(MSG_DEBUG,
++			   "WPA: KCK not set - cannot calculate MIC");
++		return -1;
++	}
++
+ 	switch (ver) {
+ #ifndef CONFIG_FIPS
+ 	case WPA_KEY_INFO_TYPE_HMAC_MD5_RC4:
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -725,6 +725,11 @@ static int wpa_supplicant_install_ptk(st
+ 
+ 	alg = wpa_cipher_to_alg(sm->pairwise_cipher);
+ 	keylen = wpa_cipher_key_len(sm->pairwise_cipher);
++	if (keylen <= 0 || (unsigned int) keylen != sm->ptk.tk_len) {
++		wpa_printf(MSG_DEBUG, "WPA: TK length mismatch: %d != %lu",
++			   keylen, (long unsigned int) sm->ptk.tk_len);
++		return -1;
++	}
+ 	rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
+ 
+ 	if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) {
+@@ -745,6 +750,7 @@ static int wpa_supplicant_install_ptk(st
+ 
+ 	/* TK is not needed anymore in supplicant */
+ 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
++	sm->ptk.tk_len = 0;
+ 	sm->ptk.installed = 1;
+ 
+ 	if (sm->wpa_ptk_rekey) {
+@@ -1717,9 +1723,10 @@ static int wpa_supplicant_verify_eapol_k
+ 	os_memcpy(mic, key + 1, mic_len);
+ 	if (sm->tptk_set) {
+ 		os_memset(key + 1, 0, mic_len);
+-		wpa_eapol_key_mic(sm->tptk.kck, sm->tptk.kck_len, sm->key_mgmt,
+-				  ver, buf, len, (u8 *) (key + 1));
+-		if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
++		if (wpa_eapol_key_mic(sm->tptk.kck, sm->tptk.kck_len,
++				      sm->key_mgmt,
++				      ver, buf, len, (u8 *) (key + 1)) < 0 ||
++		    os_memcmp_const(mic, key + 1, mic_len) != 0) {
+ 			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+ 				"WPA: Invalid EAPOL-Key MIC "
+ 				"when using TPTK - ignoring TPTK");
+@@ -1742,9 +1749,10 @@ static int wpa_supplicant_verify_eapol_k
+ 
+ 	if (!ok && sm->ptk_set) {
+ 		os_memset(key + 1, 0, mic_len);
+-		wpa_eapol_key_mic(sm->ptk.kck, sm->ptk.kck_len, sm->key_mgmt,
+-				  ver, buf, len, (u8 *) (key + 1));
+-		if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
++		if (wpa_eapol_key_mic(sm->ptk.kck, sm->ptk.kck_len,
++				      sm->key_mgmt,
++				      ver, buf, len, (u8 *) (key + 1)) < 0 ||
++		    os_memcmp_const(mic, key + 1, mic_len) != 0) {
+ 			wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+ 				"WPA: Invalid EAPOL-Key MIC - "
+ 				"dropping packet");
+@@ -4167,6 +4175,11 @@ int fils_process_assoc_resp(struct wpa_s
+ 
+ 	alg = wpa_cipher_to_alg(sm->pairwise_cipher);
+ 	keylen = wpa_cipher_key_len(sm->pairwise_cipher);
++	if (keylen <= 0 || (unsigned int) keylen != sm->ptk.tk_len) {
++		wpa_printf(MSG_DEBUG, "FILS: TK length mismatch: %u != %lu",
++			   keylen, (long unsigned int) sm->ptk.tk_len);
++		goto fail;
++	}
+ 	rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
+ 	wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver",
+ 			sm->ptk.tk, keylen);
+@@ -4183,6 +4196,7 @@ int fils_process_assoc_resp(struct wpa_s
+ 	 * takes care of association frame encryption/decryption. */
+ 	/* TK is not needed anymore in supplicant */
+ 	os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
++	sm->ptk.tk_len = 0;
+ 	sm->ptk.installed = 1;
+ 
+ 	/* FILS HLP Container */
diff --git a/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch b/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch
new file mode 100644
index 0000000..808d345
--- /dev/null
+++ b/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch
@@ -0,0 +1,25 @@
+From c0fe5f125a9d4a6564e1f4956ccc3809bf2fd69d Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j at w1.fi>
+Date: Tue, 17 Oct 2017 01:15:24 +0300
+Subject: [PATCH] Clear BSSID information in supplicant state machine on
+ disconnection
+
+This fixes a corner case where RSN pre-authentication candidate from
+scan results was ignored if the station was associated with that BSS
+just before running the new scan for the connection.
+
+Signed-off-by: Jouni Malinen <j at w1.fi>
+---
+ src/rsn_supp/wpa.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -2662,6 +2662,7 @@ void wpa_sm_notify_disassoc(struct wpa_s
+ 	wpa_sm_drop_sa(sm);
+ 
+ 	sm->msg_3_of_4_ok = 0;
++	os_memset(sm->bssid, 0, ETH_ALEN);
+ }
+ 
+ 
diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch
index 6db16c9..c8ca369 100644
--- a/package/network/services/hostapd/patches/300-noscan.patch
+++ b/package/network/services/hostapd/patches/300-noscan.patch
@@ -1,6 +1,6 @@
 --- a/hostapd/config_file.c
 +++ b/hostapd/config_file.c
-@@ -3014,6 +3014,10 @@ static int hostapd_config_fill(struct ho
+@@ -3016,6 +3016,10 @@ static int hostapd_config_fill(struct ho
  		}
  #endif /* CONFIG_IEEE80211W */
  #ifdef CONFIG_IEEE80211N
@@ -13,7 +13,7 @@
  	} else if (os_strcmp(buf, "ht_capab") == 0) {
 --- a/src/ap/ap_config.h
 +++ b/src/ap/ap_config.h
-@@ -734,6 +734,8 @@ struct hostapd_config {
+@@ -735,6 +735,8 @@ struct hostapd_config {
  
  	int ht_op_mode_fixed;
  	u16 ht_capab;
diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
index 908641f..e977f00 100644
--- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
+++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch
@@ -129,7 +129,7 @@
  static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx)
 --- a/src/ap/wpa_auth.c
 +++ b/src/ap/wpa_auth.c
-@@ -3762,6 +3762,7 @@ static const char * wpa_bool_txt(int val
+@@ -3780,6 +3780,7 @@ static const char * wpa_bool_txt(int val
  	return val ? "TRUE" : "FALSE";
  }
  
@@ -137,7 +137,7 @@
  
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
-@@ -3906,7 +3907,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
+@@ -3924,7 +3925,7 @@ int wpa_get_mib_sta(struct wpa_state_mac
  
  	return len;
  }
@@ -148,7 +148,7 @@
  {
 --- a/src/rsn_supp/wpa.c
 +++ b/src/rsn_supp/wpa.c
-@@ -2339,6 +2339,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
+@@ -2356,6 +2356,8 @@ static u32 wpa_key_mgmt_suite(struct wpa
  }
  
  
@@ -157,7 +157,7 @@
  #define RSN_SUITE "%02x-%02x-%02x-%d"
  #define RSN_SUITE_ARG(s) \
  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff
-@@ -2422,6 +2424,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
+@@ -2439,6 +2441,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch
  
  	return (int) len;
  }
diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
index bdbae9b..8f7a687 100644
--- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
+++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch
@@ -1,6 +1,6 @@
 --- a/src/common/wpa_common.c
 +++ b/src/common/wpa_common.c
-@@ -1664,6 +1664,31 @@ u32 wpa_akm_to_suite(int akm)
+@@ -1675,6 +1675,31 @@ u32 wpa_akm_to_suite(int akm)
  }
  
  
@@ -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)
-@@ -1671,8 +1696,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
+@@ -1682,8 +1707,19 @@ int wpa_compare_rsn_ie(int ft_initial_as
  	if (ie1 == NULL || ie2 == NULL)
  		return -1;
  
diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch
index 0c85a27..31e3e79 100644
--- a/package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/package/network/services/hostapd/patches/600-ubus_support.patch
@@ -298,7 +298,7 @@
  }
 --- a/src/ap/wpa_auth_glue.c
 +++ b/src/ap/wpa_auth_glue.c
-@@ -173,6 +173,7 @@ static void hostapd_wpa_auth_psk_failure
+@@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure
  	struct hostapd_data *hapd = ctx;
  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
  		MAC2STR(addr));


From lede-commits at lists.infradead.org  Tue Oct 17 10:45:23 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 17 Oct 2017 13:45:23 -0400
Subject: [source]  wireguard: version bump to 0.0.20171017
In-Reply-To: <20171017174523.2782.54736@git-01.infra.lede-project.org>
References: <20171017174523.2782.54736@git-01.infra.lede-project.org>
Message-ID: <mailman.55006.1508262360.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/f6c4a9c045797d9be12310eebc6341050fd260ce

commit f6c4a9c045797d9be12310eebc6341050fd260ce
Author: Jason A. Donenfeld <Jason at zx2c4.com>
AuthorDate: Tue Oct 17 19:34:20 2017 +0200

    wireguard: version bump to 0.0.20171017
    
    This is a simple version bump. Changes:
    
      * noise: handshake constants can be read-only after init
      * noise: no need to take the RCU lock if we're not dereferencing
      * send: improve dead packet control flow
      * receive: improve control flow
      * socket: eliminate dead code
      * device: our use of queues means this check is worthless
      * device: no need to take lock for integer comparison
      * blake2s: modernize API and have faster _final
      * compat: support READ_ONCE
      * compat: just make ro_after_init read_mostly
    
      Assorted cleanups to the module, including nice things like marking our
      precomputations as const.
    
      * Makefile: even prettier output
      * Makefile: do not clean before cloc
      * selftest: better test index for rate limiter
      * netns: disable accept_dad for all interfaces
    
      Fixes in our testing and build infrastructure. Now works on the 4.14 rc
      series.
    
      * qemu: add build-only target
      * qemu: work on ubuntu toolchain
      * qemu: add more debugging options to main makefile
      * qemu: simplify shutdown
      * qemu: open /dev/console if we're started early
      * qemu: phase out bitbanging
      * qemu: always create directory before untarring
      * qemu: newer packages
      * qemu: put hvc directive into configuration
    
      This is the beginning of working out a cross building test suite, so we do
      several tricks to be less platform independent.
    
      * tools: encoding: be more paranoid
      * tools: retry resolution except when fatal
      * tools: don't insist on having a private key
      * tools: add pass example to wg-quick man page
      * tools: style
      * tools: newline after warning
      * tools: account for padding being in zero attribute
    
      Several important tools fixes, one of which suppresses a needless warning.
    
    Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
---
 package/network/services/wireguard/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile
index 90d74ad..26d83e4 100644
--- a/package/network/services/wireguard/Makefile
+++ b/package/network/services/wireguard/Makefile
@@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=wireguard
 
-PKG_VERSION:=0.0.20171011
+PKG_VERSION:=0.0.20171017
 PKG_RELEASE:=1
 
 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
-PKG_HASH:=e2e44ff658743507bca0f6b443c2f85aacc48d507ba2dcd4812717145df10b96
+PKG_HASH:=57b79a62874d9b99659a744513d4f6f9d88cb772deaa99e485b6fed3004a35cd
 
 PKG_LICENSE:=GPL-2.0 Apache-2.0
 PKG_LICENSE_FILES:=COPYING


From lede-commits at lists.infradead.org  Tue Oct 17 10:46:31 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 17 Oct 2017 13:46:31 -0400
Subject: [source]  wireguard: version bump to 0.0.20171017
In-Reply-To: <20171017174631.3282.11382@git-01.infra.lede-project.org>
References: <20171017174631.3282.11382@git-01.infra.lede-project.org>
Message-ID: <mailman.55009.1508262477.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/79f57e422d229bb21837f588f40259835893837b

commit 79f57e422d229bb21837f588f40259835893837b
Author: Jason A. Donenfeld <Jason at zx2c4.com>
AuthorDate: Tue Oct 17 19:34:20 2017 +0200

    wireguard: version bump to 0.0.20171017
    
    This is a simple version bump. Changes:
    
      * noise: handshake constants can be read-only after init
      * noise: no need to take the RCU lock if we're not dereferencing
      * send: improve dead packet control flow
      * receive: improve control flow
      * socket: eliminate dead code
      * device: our use of queues means this check is worthless
      * device: no need to take lock for integer comparison
      * blake2s: modernize API and have faster _final
      * compat: support READ_ONCE
      * compat: just make ro_after_init read_mostly
    
      Assorted cleanups to the module, including nice things like marking our
      precomputations as const.
    
      * Makefile: even prettier output
      * Makefile: do not clean before cloc
      * selftest: better test index for rate limiter
      * netns: disable accept_dad for all interfaces
    
      Fixes in our testing and build infrastructure. Now works on the 4.14 rc
      series.
    
      * qemu: add build-only target
      * qemu: work on ubuntu toolchain
      * qemu: add more debugging options to main makefile
      * qemu: simplify shutdown
      * qemu: open /dev/console if we're started early
      * qemu: phase out bitbanging
      * qemu: always create directory before untarring
      * qemu: newer packages
      * qemu: put hvc directive into configuration
    
      This is the beginning of working out a cross building test suite, so we do
      several tricks to be less platform independent.
    
      * tools: encoding: be more paranoid
      * tools: retry resolution except when fatal
      * tools: don't insist on having a private key
      * tools: add pass example to wg-quick man page
      * tools: style
      * tools: newline after warning
      * tools: account for padding being in zero attribute
    
      Several important tools fixes, one of which suppresses a needless warning.
    
    Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
    (cherry picked from commit f6c4a9c045797d9be12310eebc6341050fd260ce)
---
 package/network/services/wireguard/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile
index 90d74ad..26d83e4 100644
--- a/package/network/services/wireguard/Makefile
+++ b/package/network/services/wireguard/Makefile
@@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=wireguard
 
-PKG_VERSION:=0.0.20171011
+PKG_VERSION:=0.0.20171017
 PKG_RELEASE:=1
 
 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
-PKG_HASH:=e2e44ff658743507bca0f6b443c2f85aacc48d507ba2dcd4812717145df10b96
+PKG_HASH:=57b79a62874d9b99659a744513d4f6f9d88cb772deaa99e485b6fed3004a35cd
 
 PKG_LICENSE:=GPL-2.0 Apache-2.0
 PKG_LICENSE_FILES:=COPYING


From lede-commits at lists.infradead.org  Wed Oct 18 01:58:47 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 04:58:47 -0400
Subject: [source]  LEDE v17.01.4: adjust config defaults
In-Reply-To: <20171018085846.7421.56456@git-01.infra.lede-project.org>
References: <20171018085846.7421.56456@git-01.infra.lede-project.org>
Message-ID: <mailman.55139.1508317154.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/444add156f2a6d92fc15005c5ade2208a978966c

commit 444add156f2a6d92fc15005c5ade2208a978966c
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Oct 18 11:54:32 2017 +0300

    LEDE v17.01.4: adjust config defaults
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 feeds.conf.default                 | 8 ++++----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 +
 version.date                       | 1 +
 5 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 6181dc6..d86737e 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,4 +1,4 @@
-src-git packages https://git.lede-project.org/feed/packages.git;lede-17.01
-src-git luci https://git.lede-project.org/project/luci.git;lede-17.01
-src-git routing https://git.lede-project.org/feed/routing.git;lede-17.01
-src-git telephony https://git.lede-project.org/feed/telephony.git;lede-17.01
+src-git packages https://git.lede-project.org/feed/packages.git^cd5c448758f30868770b9ebf8b656c1a4211a240
+src-git luci https://git.lede-project.org/project/luci.git^d3f0685d63c1291359dc5dd089c82fa1e150e0c6
+src-git routing https://git.lede-project.org/feed/routing.git^d11075cd40a88602bf4ba2b275f72100ddcb4767
+src-git telephony https://git.lede-project.org/feed/telephony.git^ac6415e61f147a6892fd2785337aec93ddc68fa9
diff --git a/include/version.mk b/include/version.mk
index 8a6ab94..c5dc9a1 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -31,16 +31,16 @@ qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01-SNAPSHOT)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01.4)
 
 VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3560-79f57e422d)
 
 VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
 VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
 
 VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01-SNAPSHOT)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.4)
 
 VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index b600530..0e12190 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -190,7 +190,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT"
+		default "http://downloads.lede-project.org/releases/17.01.4"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -262,7 +262,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default y
+		default n
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
new file mode 100644
index 0000000..8d5fc75
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+r3560-79f57e422d
diff --git a/version.date b/version.date
new file mode 100644
index 0000000..7bc4b45
--- /dev/null
+++ b/version.date
@@ -0,0 +1 @@
+1508262380


From lede-commits at lists.infradead.org  Wed Oct 18 01:58:48 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 04:58:48 -0400
Subject: [source]  LEDE v17.01.4: revert to branch defaults
In-Reply-To: <20171018085846.7421.56456@git-01.infra.lede-project.org>
References: <20171018085846.7421.56456@git-01.infra.lede-project.org>
Message-ID: <mailman.55140.1508317168.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/cdb2684dce91626c9e18b886e04e00b5732202ea

commit cdb2684dce91626c9e18b886e04e00b5732202ea
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Oct 18 11:54:32 2017 +0300

    LEDE v17.01.4: revert to branch defaults
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 feeds.conf.default                 | 8 ++++----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 -
 version.date                       | 1 -
 5 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index d86737e..6181dc6 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,4 +1,4 @@
-src-git packages https://git.lede-project.org/feed/packages.git^cd5c448758f30868770b9ebf8b656c1a4211a240
-src-git luci https://git.lede-project.org/project/luci.git^d3f0685d63c1291359dc5dd089c82fa1e150e0c6
-src-git routing https://git.lede-project.org/feed/routing.git^d11075cd40a88602bf4ba2b275f72100ddcb4767
-src-git telephony https://git.lede-project.org/feed/telephony.git^ac6415e61f147a6892fd2785337aec93ddc68fa9
+src-git packages https://git.lede-project.org/feed/packages.git;lede-17.01
+src-git luci https://git.lede-project.org/project/luci.git;lede-17.01
+src-git routing https://git.lede-project.org/feed/routing.git;lede-17.01
+src-git telephony https://git.lede-project.org/feed/telephony.git;lede-17.01
diff --git a/include/version.mk b/include/version.mk
index c5dc9a1..8a6ab94 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -31,16 +31,16 @@ qstrip_escape=$(subst ','\'',$(call qstrip,$(1)))
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip_escape,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01.4)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),17.01-SNAPSHOT)
 
 VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r3560-79f57e422d)
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
 
 VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK))
 VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE))
 
 VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.4)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01-SNAPSHOT)
 
 VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 0e12190..b600530 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -190,7 +190,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "http://downloads.lede-project.org/releases/17.01.4"
+		default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -262,7 +262,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default n
+		default y
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
deleted file mode 100644
index 8d5fc75..0000000
--- a/version
+++ /dev/null
@@ -1 +0,0 @@
-r3560-79f57e422d
diff --git a/version.date b/version.date
deleted file mode 100644
index 7bc4b45..0000000
--- a/version.date
+++ /dev/null
@@ -1 +0,0 @@
-1508262380


From lede-commits at lists.infradead.org  Wed Oct 18 04:02:12 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 07:02:12 -0400
Subject: [source]  hostapd: bump PKG_RELEASE
In-Reply-To: <20171018110212.15421.72679@git-01.infra.lede-project.org>
References: <20171018110212.15421.72679@git-01.infra.lede-project.org>
Message-ID: <mailman.55169.1508324563.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/060e37567e90665d2cb26b9eaa5384ec60b19478

commit 060e37567e90665d2cb26b9eaa5384ec60b19478
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Oct 18 13:01:23 2017 +0300

    hostapd: bump PKG_RELEASE
    
    The previous commit did not adjust PKG_RELEASE, therefore the
    hostapd/wpad/wpa_supplicant packages containing the AP-side workaround
    for KRACK do not appear as opkg update.
    
    Bump the PKG_RELEASE to signify upgrades to downstream users.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/network/services/hostapd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 1113e4f..5a353e6 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git


From lede-commits at lists.infradead.org  Wed Oct 18 05:20:25 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 08:20:25 -0400
Subject: [source]  mountd: bump to git HEAD version (fixes SIGSEV crashes)
In-Reply-To: <20171018122025.11960.29056@git-01.infra.lede-project.org>
References: <20171018122025.11960.29056@git-01.infra.lede-project.org>
Message-ID: <mailman.55211.1508329253.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/586a721d3fb4ce974d1c003cd78b9bdc5f4a31d2

commit 586a721d3fb4ce974d1c003cd78b9bdc5f4a31d2
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Wed Oct 18 14:17:48 2017 +0200

    mountd: bump to git HEAD version (fixes SIGSEV crashes)
    
    6efeb19 autofs: register SIGTERM for gracefull exit
    01bb2b0 mount: fix SIGSEV crashes
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/system/mountd/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/system/mountd/Makefile b/package/system/mountd/Makefile
index 7027561..c3a9cca 100644
--- a/package/system/mountd/Makefile
+++ b/package/system/mountd/Makefile
@@ -4,13 +4,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mountd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/mountd.git
-PKG_SOURCE_DATE:=2016-12-19
-PKG_SOURCE_VERSION:=dd5799c9f8cc7a01c0572c067bf907b37cdd7d04
-PKG_MIRROR_HASH:=cdc9f61bf4ad4b5d02b7cad435de1566b53306ed532fe39d099ed91eec6c405c
+PKG_SOURCE_DATE:=2017-10-18
+PKG_SOURCE_VERSION:=6efeb198451a46bb8039d2892986c7f625c92649
+PKG_MIRROR_HASH:=af36387c30dd67f30ec9748e0b2f601f827637ca914446522793be44d5c3356d
 CMAKE_INSTALL:=1
 
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>


From lede-commits at lists.infradead.org  Wed Oct 18 10:00:51 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 13:00:51 -0400
Subject: [source]  kernel: bump 4.4 to 4.4.93 for 17.01
In-Reply-To: <20171018170051.8087.79662@git-01.infra.lede-project.org>
References: <20171018170051.8087.79662@git-01.infra.lede-project.org>
Message-ID: <mailman.55338.1508346214.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/373fa54d355479c9be13af13f1e71d1b829fc5d0

commit 373fa54d355479c9be13af13f1e71d1b829fc5d0
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Wed Oct 18 16:17:28 2017 +0100

    kernel: bump 4.4 to 4.4.93 for 17.01
    
    Refresh patches.
    Compile-tested for ar71xx - Archer C7 v2
    Runtime-tested on  ar71xx - Archer C7 v2
    
    Fixes CVE-2017-15265.
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
    [remove 2nd CVE as it was fixed in mac80211 in commit bff16304b0bf]
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 include/kernel-version.mk                                             | 4 ++--
 .../0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 51e0dcf..6b4a224 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -3,10 +3,10 @@
 LINUX_RELEASE?=1
 
 LINUX_VERSION-3.18 = .43
-LINUX_VERSION-4.4 = .92
+LINUX_VERSION-4.4 = .93
 
 LINUX_KERNEL_HASH-3.18.43 = 1236e8123a6ce537d5029232560966feed054ae31776fe8481dd7d18cdd5492c
-LINUX_KERNEL_HASH-4.4.92 = 53f8cd8b024444df0f242f8e6ab5147b0b009d7a30e8b2ed3854e8d17937460d
+LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36
 
 ifdef KERNEL_PATCHVER
   LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
diff --git a/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch b/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch
index 7914e06..2eb1a7b 100644
--- a/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch
+++ b/target/linux/brcm2708/patches-4.4/0069-hid-Reduce-default-mouse-polling-interval-to-60Hz.patch
@@ -19,7 +19,7 @@ Reduces overhead when using X
  module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
  MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
  
-@@ -1083,8 +1083,12 @@ static int usbhid_start(struct hid_devic
+@@ -1093,8 +1093,12 @@ static int usbhid_start(struct hid_devic
  		}
  
  		/* Change the polling interval of mice. */


From lede-commits at lists.infradead.org  Wed Oct 18 13:13:47 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 16:13:47 -0400
Subject: [source]  lantiq: ARV752DPW22: set correct wireless led trigger
In-Reply-To: <20171018201347.31195.89919@git-01.infra.lede-project.org>
References: <20171018201347.31195.89919@git-01.infra.lede-project.org>
Message-ID: <mailman.55364.1508357658.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/a02a866519538714bb74ca2da0fbdcc412b43269

commit a02a866519538714bb74ca2da0fbdcc412b43269
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 16 22:36:35 2017 +0200

    lantiq: ARV752DPW22: set correct wireless led trigger
    
    The ARV752DPW22 has a ralink based wireless and can not use the ath9k
    only phy0tpt trigger.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/base-files/etc/board.d/01_leds | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/lantiq/base-files/etc/board.d/01_leds b/target/linux/lantiq/base-files/etc/board.d/01_leds
index 3584b0b..5a692c4 100755
--- a/target/linux/lantiq/base-files/etc/board.d/01_leds
+++ b/target/linux/lantiq/base-files/etc/board.d/01_leds
@@ -47,6 +47,9 @@ ARV7506PW11)
 ARV7519RW22)
 	ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1"
 	;;
+ARV752DPW22)
+	ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio"
+	;;
 BTHOMEHUBV5A)
 	ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0"
 	;;


From lede-commits at lists.infradead.org  Wed Oct 18 13:13:48 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 16:13:48 -0400
Subject: [source]  lantiq: ARV752DPW22: fix wireless mac address
In-Reply-To: <20171018201347.31195.89919@git-01.infra.lede-project.org>
References: <20171018201347.31195.89919@git-01.infra.lede-project.org>
Message-ID: <mailman.55365.1508357660.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/36d2884d553aa4cc98b1df5ed43a16ab336dd660

commit 36d2884d553aa4cc98b1df5ed43a16ab336dd660
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Oct 18 06:59:38 2017 +0200

    lantiq: ARV752DPW22: fix wireless mac address
    
    The ARV752DPW22 has the same generic mac address in the EEPROM as it
    was already noticed for other lantiq boards using a ralink wireless.
    
    Use the base mac address from the boardconfig partition as it is done
    by the stock firmware.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/dts/ARV752DPW22.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/lantiq/dts/ARV752DPW22.dts b/target/linux/lantiq/dts/ARV752DPW22.dts
index d5a6d31..54b4e20 100644
--- a/target/linux/lantiq/dts/ARV752DPW22.dts
+++ b/target/linux/lantiq/dts/ARV752DPW22.dts
@@ -253,5 +253,6 @@
 		reg = <0x7000 0 0 0 0>;
 		ralink,mtd-eeprom = <&boardconfig 0x410>;
 		ralink,mtd-eeprom-swap;
+		mtd-mac-address = <&boardconfig 0x16>;
 	};
 };


From lede-commits at lists.infradead.org  Wed Oct 18 13:14:49 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 16:14:49 -0400
Subject: [source]  lantiq: ARV752DPW22: set correct wireless led trigger
In-Reply-To: <20171018201449.31608.88320@git-01.infra.lede-project.org>
References: <20171018201449.31608.88320@git-01.infra.lede-project.org>
Message-ID: <mailman.55366.1508357716.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/50db9a40041e251835457dcba8361e0679ab16b8

commit 50db9a40041e251835457dcba8361e0679ab16b8
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 16 22:36:35 2017 +0200

    lantiq: ARV752DPW22: set correct wireless led trigger
    
    The ARV752DPW22 has a ralink based wireless and can not use the ath9k
    only phy0tpt trigger.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/base-files/etc/board.d/01_leds | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/lantiq/base-files/etc/board.d/01_leds b/target/linux/lantiq/base-files/etc/board.d/01_leds
index 0698d6c..9d28495 100755
--- a/target/linux/lantiq/base-files/etc/board.d/01_leds
+++ b/target/linux/lantiq/base-files/etc/board.d/01_leds
@@ -44,6 +44,9 @@ ARV7506PW11)
 ARV7519RW22)
 	ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1"
 	;;
+ARV752DPW22)
+	ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio"
+	;;
 BTHOMEHUBV5A)
 	ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0"
 	;;


From lede-commits at lists.infradead.org  Wed Oct 18 13:14:50 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 16:14:50 -0400
Subject: [source]  lantiq: ARV752DPW22: fix wireless mac address
In-Reply-To: <20171018201449.31608.88320@git-01.infra.lede-project.org>
References: <20171018201449.31608.88320@git-01.infra.lede-project.org>
Message-ID: <mailman.55367.1508357721.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/98c003e3da5993779b9011a24072e2bac4492d86

commit 98c003e3da5993779b9011a24072e2bac4492d86
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Oct 18 06:59:38 2017 +0200

    lantiq: ARV752DPW22: fix wireless mac address
    
    The ARV752DPW22 has the same generic mac address in the EEPROM as it
    was already noticed for other lantiq boards using a ralink wireless.
    
    Use the base mac address from the boardconfig partition as it is done
    by the stock firmware.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/dts/ARV752DPW22.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/lantiq/dts/ARV752DPW22.dts b/target/linux/lantiq/dts/ARV752DPW22.dts
index 225dfaa..82e8262 100644
--- a/target/linux/lantiq/dts/ARV752DPW22.dts
+++ b/target/linux/lantiq/dts/ARV752DPW22.dts
@@ -253,5 +253,6 @@
 		reg = <0x7000 0 0 0 0>;
 		ralink,mtd-eeprom = <&boardconfig 0x410>;
 		ralink,mtd-eeprom-swap;
+		mtd-mac-address = <&boardconfig 0x16>;
 	};
 };


From lede-commits at lists.infradead.org  Wed Oct 18 13:59:22 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 16:59:22 -0400
Subject: [source]  kernel: fix ftrace support on 4.9
In-Reply-To: <20171018205921.11919.55296@git-01.infra.lede-project.org>
References: <20171018205921.11919.55296@git-01.infra.lede-project.org>
Message-ID: <mailman.55368.1508360396.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/7c42f15c2406481784d654d99244539d71522582

commit 7c42f15c2406481784d654d99244539d71522582
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Oct 18 22:46:29 2017 +0200

    kernel: fix ftrace support on 4.9
    
    When porting the kernel patches from 4.4 to 4.9, they were missing a
    small chunk that ensures that ftrace sections are kept in the vmlinux
    image, even when linked with --gc-sections
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../linux/generic/hack-4.9/220-gc_sections.patch   | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch
index 428fcb6..eda8bb8 100644
--- a/target/linux/generic/hack-4.9/220-gc_sections.patch
+++ b/target/linux/generic/hack-4.9/220-gc_sections.patch
@@ -201,6 +201,33 @@ Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
  
 --- a/include/asm-generic/vmlinux.lds.h
 +++ b/include/asm-generic/vmlinux.lds.h
+@@ -105,7 +105,7 @@
+ #ifdef CONFIG_FTRACE_MCOUNT_RECORD
+ #define MCOUNT_REC()	. = ALIGN(8);				\
+ 			VMLINUX_SYMBOL(__start_mcount_loc) = .; \
+-			*(__mcount_loc)				\
++			KEEP(*(__mcount_loc))			\
+ 			VMLINUX_SYMBOL(__stop_mcount_loc) = .;
+ #else
+ #define MCOUNT_REC()
+@@ -113,7 +113,7 @@
+ 
+ #ifdef CONFIG_TRACE_BRANCH_PROFILING
+ #define LIKELY_PROFILE()	VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \
+-				*(_ftrace_annotated_branch)			      \
++				KEEP(*(_ftrace_annotated_branch))		      \
+ 				VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .;
+ #else
+ #define LIKELY_PROFILE()
+@@ -121,7 +121,7 @@
+ 
+ #ifdef CONFIG_PROFILE_ALL_BRANCHES
+ #define BRANCH_PROFILE()	VMLINUX_SYMBOL(__start_branch_profile) = .;   \
+-				*(_ftrace_branch)			      \
++				KEEP(*(_ftrace_branch))			      \
+ 				VMLINUX_SYMBOL(__stop_branch_profile) = .;
+ #else
+ #define BRANCH_PROFILE()
 @@ -130,7 +130,7 @@
  #ifdef CONFIG_KPROBES
  #define KPROBE_BLACKLIST()	. = ALIGN(8);				      \


From lede-commits at lists.infradead.org  Wed Oct 18 14:26:56 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 17:26:56 -0400
Subject: [source]  broadcom-wl: fix compile with kernel 4.9
In-Reply-To: <20171018212656.19638.92934@git-01.infra.lede-project.org>
References: <20171018212656.19638.92934@git-01.infra.lede-project.org>
Message-ID: <mailman.55369.1508362039.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/db4550c4c812c5bf146e654845008e78c62c16d1

commit db4550c4c812c5bf146e654845008e78c62c16d1
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Oct 18 22:55:59 2017 +0200

    broadcom-wl: fix compile with kernel 4.9
    
    ENOENT could not be found by the compiler when compiling again kernel
    4.9.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/broadcom-wl/patches/120-fixup-mac-addresses.patch | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/kernel/broadcom-wl/patches/120-fixup-mac-addresses.patch b/package/kernel/broadcom-wl/patches/120-fixup-mac-addresses.patch
index a07176d..422f7f7 100644
--- a/package/kernel/broadcom-wl/patches/120-fixup-mac-addresses.patch
+++ b/package/kernel/broadcom-wl/patches/120-fixup-mac-addresses.patch
@@ -1,14 +1,15 @@
 --- a/driver/nvram_stub.c
 +++ b/driver/nvram_stub.c
-@@ -5,6 +5,7 @@
+@@ -5,6 +5,8 @@
  #include <siutils.h>
  #include <bcmendian.h>
  #include <bcmnvram.h>
 +#include <proto/ethernet.h>
++#include <linux/errno.h>
  
  #ifdef BCMDBG_ERR
  #define NVR_MSG(x) printf x
-@@ -24,6 +25,7 @@ typedef struct _vars {
+@@ -24,6 +26,7 @@ typedef struct _vars {
  static vars_t *vars = NULL;
  static int nvram_init_done = 0;
  extern char *nvram_buf[];
@@ -16,7 +17,7 @@
  
  int
  BCMATTACHFN(nvram_init)(void *si)
-@@ -55,6 +57,7 @@ BCMATTACHFN(nvram_init)(void *si)
+@@ -55,6 +58,7 @@ BCMATTACHFN(nvram_init)(void *si)
  	vars = new;
  
  	bcopy((char *)(&nvh[1]), new->vars, nvs);
@@ -24,7 +25,7 @@
  	return 0;
  }
  
-@@ -164,3 +167,65 @@ nvram_getall(char *buf, int count)
+@@ -164,3 +168,65 @@ nvram_getall(char *buf, int count)
  	*buf = '\0';
  	return 0;
  }


From lede-commits at lists.infradead.org  Wed Oct 18 14:46:06 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 18 Oct 2017 17:46:06 -0400
Subject: [source]  brcm47xx: use kernel 4.9 by default
In-Reply-To: <20171018214606.23855.69800@git-01.infra.lede-project.org>
References: <20171018214606.23855.69800@git-01.infra.lede-project.org>
Message-ID: <mailman.55374.1508363190.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/2af10c30fe5a7f1d13a790187868c1ee2209a575

commit 2af10c30fe5a7f1d13a790187868c1ee2209a575
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Oct 18 21:53:31 2017 +0200

    brcm47xx: use kernel 4.9 by default
    
    Kernel 4.9 is now working on the brcm47xx boards, we just recently fixed
    the problem that some boards did not boot at all, by changing the memory
    regions used to relocate the kernel to in the loader.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/brcm47xx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/brcm47xx/Makefile b/target/linux/brcm47xx/Makefile
index 73b7bff..f0ac7f9 100644
--- a/target/linux/brcm47xx/Makefile
+++ b/target/linux/brcm47xx/Makefile
@@ -13,7 +13,7 @@ FEATURES:=squashfs usb
 SUBTARGETS:=generic mips74k legacy
 MAINTAINER:=Hauke Mehrtens <hauke at hauke-m.de>
 
-KERNEL_PATCHVER:=4.4
+KERNEL_PATCHVER:=4.9
 
 define Target/Description
 	Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.


From lede-commits at lists.infradead.org  Thu Oct 19 12:49:01 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 19 Oct 2017 15:49:01 -0400
Subject: [source]  netifd: bump to git HEAD version (FS#1037)
In-Reply-To: <20171019194901.27900.51072@git-01.infra.lede-project.org>
References: <20171019194901.27900.51072@git-01.infra.lede-project.org>
Message-ID: <mailman.55619.1508442572.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/fbde9ac718409720a937671f3354837223b5db76

commit fbde9ac718409720a937671f3354837223b5db76
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Thu Oct 19 21:36:25 2017 +0200

    netifd: bump to git HEAD version (FS#1037)
    
    0f96606 proto: add point-to-point IPv4 address config support (FS#1037)
    1ee788d ubus: display the point-to-point IPv4 address
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/config/netifd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index eff8417..40bee6c 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2017-10-06
-PKG_SOURCE_VERSION:=5df3f01a06b2710a8d8010f353db45b7507b15fb
-PKG_MIRROR_HASH:=d628047714693a689835a9db0c3d63173a3d5cdb8d8a2e75991b399431ea9f69
+PKG_SOURCE_DATE:=2017-10-19
+PKG_SOURCE_VERSION:=0f96606b7040b8e14190ff055d5761744bc15f6d
+PKG_MIRROR_HASH:=9dcfc837b519d021bd2d51acf61c610df0a7e58f9a87d46472fbe0960d3d5dff
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Sun Oct 22 06:19:15 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 22 Oct 2017 09:19:15 -0400
Subject: [source]  kernel: add config option
In-Reply-To: <20171022131915.25883.68990@git-01.infra.lede-project.org>
References: <20171022131915.25883.68990@git-01.infra.lede-project.org>
Message-ID: <mailman.55963.1508678508.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/f73ed33be121c8fa0fa81e9c2f29ce98ed863f42

commit f73ed33be121c8fa0fa81e9c2f29ce98ed863f42
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 19:21:38 2017 +0200

    kernel: add config option
    
    When the kmod-at91-adc package is activated for the at91 target the new
    option CONFIG_AT91_SAMA5D2_ADC is selectable and not handled. Add this
    option to the kernel 4.9 configuration.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/config-4.9 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9
index 8a294e8..4d2c911 100644
--- a/target/linux/generic/config-4.9
+++ b/target/linux/generic/config-4.9
@@ -324,6 +324,7 @@ CONFIG_ARM_GIC_MAX_NR=1
 # CONFIG_ASYNC_TX_DMA is not set
 # CONFIG_AT76C50X_USB is not set
 # CONFIG_AT803X_PHY is not set
+# CONFIG_AT91_SAMA5D2_ADC is not set
 # CONFIG_ATA is not set
 # CONFIG_ATAGS is not set
 CONFIG_ATAGS_PROC=y


From lede-commits at lists.infradead.org  Sun Oct 22 06:19:16 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 22 Oct 2017 09:19:16 -0400
Subject: [source]  at91: update to kernel 4.9
In-Reply-To: <20171022131915.25883.68990@git-01.infra.lede-project.org>
References: <20171022131915.25883.68990@git-01.infra.lede-project.org>
Message-ID: <mailman.55964.1508678511.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/95627665cbcb03c20a4356df3123b19285f5c083

commit 95627665cbcb03c20a4356df3123b19285f5c083
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 19:06:08 2017 +0200

    at91: update to kernel 4.9
    
    This brings the at91 target to kernel 4.9.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Tested-by: Ben Whitten <ben.whitten at gmail.com>
---
 target/linux/at91/Makefile                         |  2 +-
 target/linux/at91/{config-4.4 => config-4.9}       | 24 +++++++++++-----------
 .../at91/files/arch/arm/boot/dts/at91-q5xr5.dts    |  2 +-
 .../linux/at91/files/arch/arm/boot/dts/lmu5000.dts |  2 +-
 .../100-ARM-at91-build-dtb-for-LMU5000.patch       |  2 +-
 .../101-ARM-at91-build-dtb-for-q5xr5.patch         |  2 +-
 .../102-ARM-at91-build-dtb-for-wb45n.patch         |  2 +-
 .../103-ARM-at91-build-dtb-for-wb50n.patch         | 10 ++++-----
 target/linux/at91/sama5/config-default             |  3 +++
 9 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile
index c4de685..cae3c62 100644
--- a/target/linux/at91/Makefile
+++ b/target/linux/at91/Makefile
@@ -13,7 +13,7 @@ BOARDNAME:=Microchip (Atmel AT91)
 FEATURES:=ext4 squashfs targz usb usbgadget ubifs
 SUBTARGETS:=sama5 legacy
 
-KERNEL_PATCHVER:=4.4
+KERNEL_PATCHVER:=4.9
 
 include $(INCLUDE_DIR)/target.mk
 
diff --git a/target/linux/at91/config-4.4 b/target/linux/at91/config-4.9
similarity index 95%
rename from target/linux/at91/config-4.4
rename to target/linux/at91/config-4.9
index d90f0e7..c0151a5 100644
--- a/target/linux/at91/config-4.4
+++ b/target/linux/at91/config-4.9
@@ -1,6 +1,6 @@
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_AT91=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
@@ -14,7 +14,6 @@ CONFIG_ARCH_MULTI_CPU_AUTO=y
 CONFIG_ARCH_MULTI_V4_V5=y
 CONFIG_ARCH_MULTI_V5=y
 CONFIG_ARCH_NR_GPIO=0
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
 # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
 # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
 CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
@@ -24,7 +23,6 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y
 CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
 CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
 CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 CONFIG_ARM=y
 CONFIG_ARM_APPENDED_DTB=y
 # CONFIG_ARM_ATAG_DTB_COMPAT is not set
@@ -36,6 +34,7 @@ CONFIG_ARM_THUMB=y
 CONFIG_AT91SAM9X_WATCHDOG=y
 CONFIG_ATAGS=y
 CONFIG_ATMEL_AIC_IRQ=y
+CONFIG_ATMEL_EBI=y
 CONFIG_ATMEL_PIT=y
 CONFIG_ATMEL_SDRAMC=y
 # CONFIG_ATMEL_TCLIB is not set
@@ -44,7 +43,6 @@ CONFIG_AT_HDMAC=y
 CONFIG_AUTO_ZRELADDR=y
 # CONFIG_BLK_DEV_INITRD is not set
 # CONFIG_CACHE_L2X0 is not set
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_OF=y
 CONFIG_CLKSRC_PROBE=y
@@ -77,7 +75,6 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 # CONFIG_DEBUG_UART_8250 is not set
 # CONFIG_DEBUG_USER is not set
-CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
 CONFIG_DMADEVICES=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_OF=y
@@ -85,6 +82,7 @@ CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_EXT4_FS=y
+CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FRAME_POINTER=y
 CONFIG_FS_MBCACHE=y
@@ -92,6 +90,7 @@ CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ATOMIC64=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
 CONFIG_GENERIC_IO=y
 CONFIG_GENERIC_IRQ_CHIP=y
@@ -104,7 +103,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y
 CONFIG_GENERIC_STRNLEN_USER=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIOLIB_IRQCHIP=y
-CONFIG_GPIO_DEVRES=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
@@ -123,7 +121,7 @@ CONFIG_HAVE_AT91_SMD=y
 CONFIG_HAVE_AT91_USB_CLK=y
 CONFIG_HAVE_AT91_UTMI=y
 # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
+CONFIG_HAVE_CBPF_JIT=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_HAVE_CLK=y
 CONFIG_HAVE_CLK_PREPARE=y
@@ -131,7 +129,6 @@ CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_C_RECORDMCOUNT=y
 CONFIG_HAVE_DEBUG_KMEMLEAK=y
 CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
 CONFIG_HAVE_DMA_CONTIGUOUS=y
 CONFIG_HAVE_DYNAMIC_FTRACE=y
 CONFIG_HAVE_FB_ATMEL=y
@@ -140,7 +137,6 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
 CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_GENERIC_DMA_COHERENT=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
 CONFIG_HAVE_MEMBLOCK=y
 CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
 CONFIG_HAVE_NET_DSA=y
@@ -171,6 +167,7 @@ CONFIG_LZO_DECOMPRESS=y
 CONFIG_MACB=y
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_MEMORY=y
+CONFIG_MFD_SYSCON=y
 CONFIG_MICREL_PHY=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MMC=y
@@ -203,13 +200,11 @@ CONFIG_OF_FLATTREE=y
 CONFIG_OF_GPIO=y
 CONFIG_OF_IRQ=y
 CONFIG_OF_MDIO=y
-CONFIG_OF_MTD=y
 CONFIG_OF_NET=y
 CONFIG_OF_RESERVED_MEM=y
 CONFIG_OLD_SIGACTION=y
 CONFIG_OLD_SIGSUSPEND3=y
 CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_PCI is not set
 # CONFIG_PCI_DOMAINS_GENERIC is not set
 # CONFIG_PCI_SYSCALL is not set
 CONFIG_PERF_USE_VMALLOC=y
@@ -222,13 +217,18 @@ CONFIG_PINCTRL_AT91=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_AT91_POWEROFF=y
 CONFIG_POWER_RESET_AT91_RESET=y
+# CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC is not set
 CONFIG_POWER_SUPPLY=y
 CONFIG_RATIONAL=y
 # CONFIG_RCU_STALL_COMMON is not set
+CONFIG_REGMAP=y
+CONFIG_REGMAP_MMIO=y
+CONFIG_REGMAP_SPI=y
 CONFIG_RTC_CLASS=y
 # CONFIG_RTC_DRV_AT91RM9200 is not set
 # CONFIG_RTC_DRV_AT91SAM9 is not set
 # CONFIG_RTC_DRV_CMOS is not set
+CONFIG_RTC_I2C_AND_SPI=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_SAMA5D4_WATCHDOG is not set
 # CONFIG_SCHED_INFO is not set
@@ -251,6 +251,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=999999
 CONFIG_SRCU=y
 # CONFIG_STAGING is not set
 CONFIG_SWIOTLB=y
+CONFIG_SWPHY=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_UBIFS_FS=y
@@ -270,4 +271,3 @@ CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_ZBOOT_ROM_TEXT=0
 CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts b/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts
index 2aa04ca..728553b 100644
--- a/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts
+++ b/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts
@@ -168,7 +168,7 @@
 			};
 		};
 		
-		usb0: ohci at 00500000 {
+		usb0: ohci at 500000 {
 			num-ports = <2>;
 			status = "okay";
 		};
diff --git a/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts b/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts
index 921d44b..fb3dd56 100644
--- a/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts
+++ b/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts
@@ -117,7 +117,7 @@
 			};
 		};
 
-		usb0: ohci at 00500000 {
+		usb0: ohci at 500000 {
 			num-ports = <2>;
 			status = "okay";
 		};
diff --git a/target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch
similarity index 80%
rename from target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch
rename to target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch
index aac5b3d..2a64fb8 100644
--- a/target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch
+++ b/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -27,6 +27,7 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \
+@@ -32,6 +32,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
  	usb_a9g20.dtb \
  	usb_a9g20_lpw.dtb \
  	at91sam9m10g45ek.dtb \
diff --git a/target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch b/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch
similarity index 81%
rename from target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch
rename to target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch
index d6bf7ae..1cee558 100644
--- a/target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch
+++ b/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -35,6 +35,7 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \
+@@ -40,6 +40,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
  	at91-ariettag25.dtb \
  	at91-cosino_mega2560.dtb \
  	at91-kizboxmini.dtb \
diff --git a/target/linux/at91/patches-4.4/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch
similarity index 84%
rename from target/linux/at91/patches-4.4/102-ARM-at91-build-dtb-for-wb45n.patch
rename to target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch
index b748662..aeb523a 100644
--- a/target/linux/at91/patches-4.4/102-ARM-at91-build-dtb-for-wb45n.patch
+++ b/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -40,7 +40,8 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \
+@@ -45,7 +45,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \
  	at91sam9g25ek.dtb \
  	at91sam9g35ek.dtb \
  	at91sam9x25ek.dtb \
diff --git a/target/linux/at91/patches-4.4/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch
similarity index 57%
rename from target/linux/at91/patches-4.4/103-ARM-at91-build-dtb-for-wb50n.patch
rename to target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch
index 00ffe09..a30a803 100644
--- a/target/linux/at91/patches-4.4/103-ARM-at91-build-dtb-for-wb50n.patch
+++ b/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch
@@ -1,11 +1,11 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -52,7 +52,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \
- 	sama5d35ek.dtb \
- 	sama5d36ek.dtb \
+@@ -59,7 +59,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \
+ 	at91-sama5d4_ma5d4evk.dtb \
  	at91-sama5d4_xplained.dtb \
--	at91-sama5d4ek.dtb
-+	at91-sama5d4ek.dtb \
+ 	at91-sama5d4ek.dtb \
+-	at91-vinco.dtb
++	at91-vinco.dtb \
 +	wb50n.dtb
  dtb-$(CONFIG_ARCH_ATLAS6) += \
  	atlas6-evb.dtb
diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
index 032a0cb..00d4cf9 100644
--- a/target/linux/at91/sama5/config-default
+++ b/target/linux/at91/sama5/config-default
@@ -5,6 +5,7 @@ CONFIG_ARM_HEAVY_MB=y
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
 # CONFIG_ARM_LPAE is not set
+CONFIG_ARM_PATCH_IDIV=y
 # CONFIG_ARM_THUMBEE is not set
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_ATMEL_AIC5_IRQ=y
@@ -23,6 +24,7 @@ CONFIG_CPU_V7=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_GENERIC_PINCONF=y
 CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_HAVE_ARM_SMCCC=y
 CONFIG_HAVE_AT91_GENERATED_CLK=y
 CONFIG_HAVE_AT91_H32MX=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -39,6 +41,7 @@ CONFIG_PL310_ERRATA_588369=y
 CONFIG_PL310_ERRATA_727915=y
 CONFIG_PL310_ERRATA_753970=y
 CONFIG_PL310_ERRATA_769419=y
+CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y
 CONFIG_SOC_SAMA5=y
 CONFIG_SOC_SAMA5D2=y
 CONFIG_SOC_SAMA5D3=y


From lede-commits at lists.infradead.org  Sun Oct 22 06:19:17 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 22 Oct 2017 09:19:17 -0400
Subject: [source]  at91: remove unused at91part driver
In-Reply-To: <20171022131915.25883.68990@git-01.infra.lede-project.org>
References: <20171022131915.25883.68990@git-01.infra.lede-project.org>
Message-ID: <mailman.55965.1508678516.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/8464d2f64a552793bc9dd8ccfa0603ee17f0d3e6

commit 8464d2f64a552793bc9dd8ccfa0603ee17f0d3e6
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 15 19:06:31 2017 +0200

    at91: remove unused at91part driver
    
    There is no patch in the kernel 4.4 and 4.9 patches which adds this
    driver to the build system.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/at91/files/drivers/mtd/at91part.c | 122 -------------------------
 1 file changed, 122 deletions(-)

diff --git a/target/linux/at91/files/drivers/mtd/at91part.c b/target/linux/at91/files/drivers/mtd/at91part.c
deleted file mode 100644
index 31f3bbd..0000000
--- a/target/linux/at91/files/drivers/mtd/at91part.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 
- * Copyright (C) 2007 OpenWrt.org
- * 
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Atmel AT91 flash partition table. (Modified by Hamish Guthrie).
- * Based on ar7 map by Felix Fietkau.
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/slab.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-#include <linux/bootmem.h>
-#include <linux/squashfs_fs.h>
-
-static struct mtd_partition at91_parts[6];
-
-static int create_mtd_partitions(struct mtd_info *master, 
-				 struct mtd_partition **pparts, 
-				 unsigned long origin)
-{
-	unsigned int offset, len;
-	unsigned int pre_size = 0x42000, root_max = 0x362400;
-	unsigned char buf[512];
-	struct squashfs_super_block *sb = (struct squashfs_super_block *) buf;
-
-	printk("Parsing AT91 partition map...\n");
-
-	at91_parts[0].name = "loaders";
-	at91_parts[0].offset = 0;
-	at91_parts[0].size = 0x21000;
-	at91_parts[0].mask_flags = MTD_WRITEABLE;
-
-	at91_parts[1].name = "ubparams";
-	at91_parts[1].offset = 0x21000;
-	at91_parts[1].size = 0x8400;
-	at91_parts[1].mask_flags = 0;
-
-	at91_parts[2].name = "kernel";
-	at91_parts[2].offset = pre_size;
-	at91_parts[2].size = 0;
-	at91_parts[2].mask_flags = 0;
-
-	at91_parts[3].name = "rootfs";
-	at91_parts[3].offset = 0;
-	at91_parts[3].size = 0;
-	at91_parts[3].mask_flags = 0;
-
-	for(offset = pre_size; offset < root_max; offset += master->erasesize) {
-
-		memset(&buf, 0xe5, sizeof(buf));
-
-		if (master->read(master, offset, sizeof(buf), &len, buf) || len != sizeof(buf))
-			break;
-
-		if (*((__u32 *) buf) == SQUASHFS_MAGIC) {
-			printk(KERN_INFO "%s: Filesystem type: squashfs, size=0x%x\n",
-							master->name, (u32) sb->bytes_used);
-
-			at91_parts[3].size = sb->bytes_used;
-			at91_parts[3].offset = offset;
-			len = at91_parts[3].offset + at91_parts[3].size;
-			len = ((len / (master->erasesize * 8)) + 1) * master->erasesize * 8;
-			at91_parts[3].size = len - at91_parts[3].offset;
-			at91_parts[2].size = offset - at91_parts[2].offset;
-			break;
-			}
-		}
-
-	if (at91_parts[3].size == 0) {
-		printk(KERN_NOTICE "%s: Couldn't find root filesystem\n", master->name);
-		return -1;
-		}
-
-	at91_parts[4].name = "rootfs_data";
-	at91_parts[4].offset = root_max;
-	at91_parts[4].size = master->size - root_max;
-	at91_parts[4].mask_flags = 0;
-
-	at91_parts[5].name = "complete";
-	at91_parts[5].offset = 0;
-	at91_parts[5].size = master->size;
-	at91_parts[5].mask_flags = 0;
-
-	*pparts = at91_parts;
-	return 6;
-}
-
-static struct mtd_part_parser at91_parser = {
-	.owner = THIS_MODULE,
-	.parse_fn = create_mtd_partitions,
-	.name = "at91part",
-};
-
-static int __init at91_parser_init(void)
-{
-	register_mtd_parser(&at91_parser);
-
-	return 0;
-}
-
-module_init(at91_parser_init);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Felix Fietkau, Eugene Konev, Hamish Guthrie");
-MODULE_DESCRIPTION("MTD partitioning for Atmel at91");


From lede-commits at lists.infradead.org  Sun Oct 22 08:02:14 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 22 Oct 2017 11:02:14 -0400
Subject: [source]  ar71xx: use kernel 4.9 by default
In-Reply-To: <20171022150214.17051.52819@git-01.infra.lede-project.org>
References: <20171022150214.17051.52819@git-01.infra.lede-project.org>
Message-ID: <mailman.55969.1508684564.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/c84b7eaedd1b3c9b7e3e30248ab3d0050477f6d5

commit c84b7eaedd1b3c9b7e3e30248ab3d0050477f6d5
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 22 15:20:39 2017 +0200

    ar71xx: use kernel 4.9 by default
    
    Kernel 4.9 support was added about 2 weeks ago and we haven't seen any
    major regression so far. This patch was not ported to kernel 4.9, this
    needs some additional work:
    821-serial-core-add-support-for-boot-console-with-arbitr.patch
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ar71xx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile
index 3f5bc67..6d5b4c5 100644
--- a/target/linux/ar71xx/Makefile
+++ b/target/linux/ar71xx/Makefile
@@ -13,7 +13,7 @@ FEATURES:=usbgadget
 CPU_TYPE:=24kc
 SUBTARGETS:=generic nand mikrotik
 
-KERNEL_PATCHVER:=4.4
+KERNEL_PATCHVER:=4.9
 
 include $(INCLUDE_DIR)/target.mk
 


From lede-commits at lists.infradead.org  Sun Oct 22 14:19:13 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 22 Oct 2017 17:19:13 -0400
Subject: [source] ar71xx: deactivate some boards with too small kernel
 partitions
In-Reply-To: <20171022211908.30209.66903@git-01.infra.lede-project.org>
References: <20171022211908.30209.66903@git-01.infra.lede-project.org>
Message-ID: <mailman.55984.1508707316.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/f7a6fd31539be54d14d7c52b491b40b26bf8f740

commit f7a6fd31539be54d14d7c52b491b40b26bf8f740
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 22 23:10:08 2017 +0200

    ar71xx: deactivate some boards with too small kernel partitions
    
    This affects the following boards:
     * dr344
     * archer-c58-v1
     * archer-c60-v1
     * tl-wr902ac-v1
     * tl-wr942n-v1
     * ubnt-uap-pro
     * ubnt-unifi-outdoor-plus
    
    The build fails for any of these boards because the resulting kernel
    image will not fit into the kernel partition.
    
    When CONFIG_KERNEL_KALLSYMS  is not set it could be that the kernel will
    fit onto the board again, this is the case for release images.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ar71xx/image/generic.mk | 1 -
 target/linux/ar71xx/image/tp-link.mk | 5 ++---
 target/linux/ar71xx/image/ubnt.mk    | 1 -
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 6f5a701..3c5fcc3 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -358,7 +358,6 @@ define Device/dr344
   MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k at 0x50000(firmware)
   IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE)
 endef
-TARGET_DEVICES += dr344
 
 define Device/dr531
   DEVICE_TITLE := Wallys DR531
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index ae711e7..868bbda 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -150,7 +150,7 @@ define Device/archer-c60-v1
   MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1344k(kernel),6592k(rootfs),64k(tplink)ro,64k(art)ro,7936k at 0x20000(firmware)
   SUPPORTED_DEVICES := archer-c60-v1
 endef
-TARGET_DEVICES += archer-c25-v1 archer-c58-v1 archer-c59-v1 archer-c60-v1
+TARGET_DEVICES += archer-c25-v1 archer-c59-v1
 
 define Device/archer-c5-v1
   $(Device/tplink-16mlzma)
@@ -1043,7 +1043,6 @@ define Device/tl-wr902ac-v1
 	append-metadata | check-size $$$$(IMAGE_SIZE)
   MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro
 endef
-TARGET_DEVICES += tl-wr902ac-v1
 
 define Device/tl-wr940n-v4
   $(Device/tplink-4mlzma)
@@ -1118,4 +1117,4 @@ define Device/tl-wr942n-v1
   MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),13120k(rootfs),64k(product-info)ro,64k(partition-table)ro,256k(oem-config)ro,1344k(oem-vars)ro,64k(ART)ro,14464k at 0x20000(firmware)
   SUPPORTED_DEVICES := tl-wr942n-v1
 endef
-TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr942n-v1
+TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn
diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk
index f80f2f1..dfc795b 100644
--- a/target/linux/ar71xx/image/ubnt.mk
+++ b/target/linux/ar71xx/image/ubnt.mk
@@ -256,4 +256,3 @@ define Device/ubnt-unifi-outdoor-plus
   BOARDNAME := UBNT-UOP
   DEVICE_PROFILE := UBNT
 endef
-TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus


From lede-commits at lists.infradead.org  Mon Oct 23 07:24:04 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 23 Oct 2017 10:24:04 -0400
Subject: [source]  brcm2708: restore /boot/config.txt before reboot
In-Reply-To: <20171023142404.29775.45946@git-01.infra.lede-project.org>
References: <20171023142404.29775.45946@git-01.infra.lede-project.org>
Message-ID: <mailman.56089.1508768678.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/a48e5bea12911da1647a499a7b74c2408a04ac90

commit a48e5bea12911da1647a499a7b74c2408a04ac90
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Sat Oct 21 14:51:14 2017 +0300

    brcm2708: restore /boot/config.txt before reboot
    
    The Raspberry Pi bootloader reads configuration values from config.txt
    in the boot partition. This file allows to specify the amount of memory
    to assign to the GPU, the license keys for hardware MPEG-2 and VC-1
    decoding, Device Tree parameters and overlays, and lots of other things.
    
    Since sysupgrade only restores the configuration after booting the newly
    flashed image, these values will not be active, even if sysupgrade would
    save /boot/config.txt. To solve this, add the file to the files to be
    backed up, and restore it in platform_copy_config, before reboot.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform | 1 +
 target/linux/brcm2708/base-files/lib/upgrade/platform.sh     | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform b/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform
new file mode 100644
index 0000000..7867965
--- /dev/null
+++ b/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform
@@ -0,0 +1 @@
+/boot/config.txt
diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
index 2f2aeb0..b7613b4 100644
--- a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
+++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh
@@ -27,6 +27,7 @@ platform_copy_config() {
 	mkdir -p /boot
 	[ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime /dev/mmcblk0p1 /boot
 	cp -af "$CONF_TAR" /boot/
+	tar --directory / -xvf "$CONF_TAR" boot/config.txt
 	sync
 	umount /boot
 }


From lede-commits at lists.infradead.org  Mon Oct 23 07:24:05 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 23 Oct 2017 10:24:05 -0400
Subject: [source]  kernel: move IIO modules to iio.mk
In-Reply-To: <20171023142404.29775.45946@git-01.infra.lede-project.org>
References: <20171023142404.29775.45946@git-01.infra.lede-project.org>
Message-ID: <mailman.56090.1508768680.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/19a7f44a5a340cb74f03c6dcc11d9541806d5495

commit 19a7f44a5a340cb74f03c6dcc11d9541806d5495
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Oct 18 20:13:27 2017 +0300

    kernel: move IIO modules to iio.mk
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/kernel/linux/modules/iio.mk   | 72 +++++++++++++++++++++++++++++++++++
 package/kernel/linux/modules/other.mk | 65 -------------------------------
 2 files changed, 72 insertions(+), 65 deletions(-)

diff --git a/package/kernel/linux/modules/iio.mk b/package/kernel/linux/modules/iio.mk
new file mode 100644
index 0000000..29ccd6a
--- /dev/null
+++ b/package/kernel/linux/modules/iio.mk
@@ -0,0 +1,72 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+IIO_MENU:=Industrial I/O Modules
+
+
+define KernelPackage/iio-core
+  SUBMENU:=$(IIO_MENU)
+  TITLE:=Industrial IO core
+  KCONFIG:= \
+	CONFIG_IIO \
+	CONFIG_IIO_BUFFER=y \
+	CONFIG_IIO_KFIFO_BUF \
+	CONFIG_IIO_TRIGGER=y \
+	CONFIG_IIO_TRIGGERED_BUFFER
+  FILES:= \
+	$(LINUX_DIR)/drivers/iio/industrialio.ko \
+	$(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/industrialio-triggered-buffer.ko at lt4.4) \
+	$(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/buffer/industrialio-triggered-buffer.ko at ge4.4) \
+	$(LINUX_DIR)/drivers/iio/kfifo_buf.ko at lt4.4 \
+	$(LINUX_DIR)/drivers/iio/buffer/kfifo_buf.ko at ge4.4
+  AUTOLOAD:=$(call AutoLoad,55,industrialio kfifo_buf industrialio-triggered-buffer)
+endef
+
+define KernelPackage/iio-core/description
+ The industrial I/O subsystem provides a unified framework for
+ drivers for many different types of embedded sensors using a
+ number of different physical interfaces (i2c, spi, etc)
+endef
+
+$(eval $(call KernelPackage,iio-core))
+
+
+define KernelPackage/iio-ad799x
+  SUBMENU:=$(IIO_MENU)
+  DEPENDS:=+kmod-i2c-core +kmod-iio-core
+  TITLE:=Analog Devices AD799x ADC driver
+  KCONFIG:= \
+	CONFIG_AD799X_RING_BUFFER=y \
+	CONFIG_AD799X
+  FILES:=$(LINUX_DIR)/drivers/iio/adc/ad799x.ko
+  AUTOLOAD:=$(call AutoLoad,56,ad799x)
+endef
+
+define KernelPackage/iio-ad799x/description
+ support for Analog Devices:
+ ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997, ad7998
+ i2c analog to digital converters (ADC).
+endef
+
+$(eval $(call KernelPackage,iio-ad799x))
+
+
+define KernelPackage/iio-dht11
+  SUBMENU:=$(IIO_MENU)
+  DEPENDS:=+kmod-iio-core @GPIO_SUPPORT @USES_DEVICETREE
+  TITLE:=DHT11 (and compatible) humidity and temperature sensors
+  KCONFIG:= \
+	CONFIG_DHT11
+  FILES:=$(LINUX_DIR)/drivers/iio/humidity/dht11.ko
+  AUTOLOAD:=$(call AutoLoad,56,dht11)
+endef
+
+define KernelPackage/iio-dht11/description
+ support for DHT11 and DHT22 digitial humidity and temperature sensors
+ attached at GPIO lines. You will need a custom device tree file to
+ specify the GPIO line to use.
+endef
+
+$(eval $(call KernelPackage,iio-dht11))
diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index ddbe6b9..a08134c 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -284,71 +284,6 @@ endef
 
 $(eval $(call KernelPackage,gpio-pcf857x))
 
-define KernelPackage/iio-core
-  SUBMENU:=$(OTHER_MENU)
-  TITLE:=Industrial IO core
-  KCONFIG:= \
-	CONFIG_IIO \
-	CONFIG_IIO_BUFFER=y \
-	CONFIG_IIO_KFIFO_BUF \
-	CONFIG_IIO_TRIGGER=y \
-	CONFIG_IIO_TRIGGERED_BUFFER
-  FILES:= \
-	$(LINUX_DIR)/drivers/iio/industrialio.ko \
-	$(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/industrialio-triggered-buffer.ko at lt4.4) \
-	$(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/buffer/industrialio-triggered-buffer.ko at ge4.4) \
-	$(LINUX_DIR)/drivers/iio/kfifo_buf.ko at lt4.4 \
-	$(LINUX_DIR)/drivers/iio/buffer/kfifo_buf.ko at ge4.4
-  AUTOLOAD:=$(call AutoLoad,55,industrialio kfifo_buf industrialio-triggered-buffer)
-endef
-
-define KernelPackage/iio-core/description
- The industrial I/O subsystem provides a unified framework for
- drivers for many different types of embedded sensors using a
- number of different physical interfaces (i2c, spi, etc)
-endef
-
-$(eval $(call KernelPackage,iio-core))
-
-
-define KernelPackage/iio-ad799x
-  SUBMENU:=$(OTHER_MENU)
-  DEPENDS:=kmod-i2c-core kmod-iio-core
-  TITLE:=Analog Devices AD799x ADC driver
-  KCONFIG:= \
-	CONFIG_AD799X_RING_BUFFER=y \
-	CONFIG_AD799X
-  FILES:=$(LINUX_DIR)/drivers/iio/adc/ad799x.ko
-  AUTOLOAD:=$(call AutoLoad,56,ad799x)
-endef
-
-define KernelPackage/iio-ad799x/description
- support for Analog Devices:
- ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997, ad7998
- i2c analog to digital converters (ADC).
-endef
-
-$(eval $(call KernelPackage,iio-ad799x))
-
-
-define KernelPackage/iio-dht11
-  SUBMENU:=$(OTHER_MENU)
-  DEPENDS:=kmod-iio-core @GPIO_SUPPORT @USES_DEVICETREE
-  TITLE:=DHT11 (and compatible) humidity and temperature sensors
-  KCONFIG:= \
-	CONFIG_DHT11
-  FILES:=$(LINUX_DIR)/drivers/iio/humidity/dht11.ko
-  AUTOLOAD:=$(call AutoLoad,56,dht11)
-endef
-
-define KernelPackage/iio-dht11/description
- support for DHT11 and DHT22 digitial humidity and temperature sensors
- attached at GPIO lines. You will need a custom device tree file to
- specify the GPIO line to use.
-endef
-
-$(eval $(call KernelPackage,iio-dht11))
-
 
 define KernelPackage/lp
   SUBMENU:=$(OTHER_MENU)


From lede-commits at lists.infradead.org  Mon Oct 23 07:24:06 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 23 Oct 2017 10:24:06 -0400
Subject: [source]  kernel: add kmod-iio-bmp280
In-Reply-To: <20171023142404.29775.45946@git-01.infra.lede-project.org>
References: <20171023142404.29775.45946@git-01.infra.lede-project.org>
Message-ID: <mailman.56091.1508768685.26984.lede-commits@lists.infradead.org>

stintel pushed a commit to source.git, branch master:
https://git.lede-project.org/683350873e18f592124cb2cce771d5459d27b2bd

commit 683350873e18f592124cb2cce771d5459d27b2bd
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Oct 18 20:17:56 2017 +0300

    kernel: add kmod-iio-bmp280
    
    This driver supports the Bosch Sensortec BMP180/BMP280 pressure and
    temperature sensors. It also supports the BME280 sensors with an
    additional humidity channel.
    
    Tested I2C and SPI modes with a BME280 sensor on a Raspberry Pi Zero W.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/kernel/linux/modules/iio.mk | 48 +++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/package/kernel/linux/modules/iio.mk b/package/kernel/linux/modules/iio.mk
index 29ccd6a..396ee7f 100644
--- a/package/kernel/linux/modules/iio.mk
+++ b/package/kernel/linux/modules/iio.mk
@@ -70,3 +70,51 @@ define KernelPackage/iio-dht11/description
 endef
 
 $(eval $(call KernelPackage,iio-dht11))
+
+define KernelPackage/iio-bmp280
+  SUBMENU:=$(IIO_MENU)
+  TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor
+  DEPENDS:=@LINUX_4_9 +kmod-iio-core +kmod-regmap
+  KCONFIG:=CONFIG_BMP280
+  FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280.ko
+endef
+
+define KernelPackage/iio-bmp280/description
+ This driver adds support for Bosch Sensortec BMP180 and BMP280 pressure and
+ temperature sensors. Also supports the BME280 with an additional humidity
+ sensor channel.
+endef
+
+$(eval $(call KernelPackage,iio-bmp280))
+
+
+define KernelPackage/iio-bmp280-i2c
+  SUBMENU:=$(IIO_MENU)
+  TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (I2C)
+  DEPENDS:=+kmod-iio-bmp280 +kmod-i2c-core
+  KCONFIG:=CONFIG_BMP280_I2C
+  FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-i2c.ko
+  AUTOLOAD:=$(call AutoProbe,iio-bmp280-i2c)
+endef
+define KernelPackage/iio-bmp280-i2c/description
+ This driver adds support for Bosch Sensortec's digital pressure and
+ temperature sensor connected via I2C.
+endef
+
+$(eval $(call KernelPackage,iio-bmp280-i2c))
+
+
+define KernelPackage/iio-bmp280-spi
+  SUBMENU:=$(IIO_MENU)
+  TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (SPI)
+  DEPENDS:=+kmod-iio-bmp280 +kmod-spi-bitbang
+  KCONFIG:=CONFIG_BMP280_SPI
+  FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-spi.ko
+  AUTOLOAD:=$(call AutoProbe,iio-bmp280-spi)
+endef
+define KernelPackage/iio-bmp280-spi/description
+ This driver adds support for Bosch Sensortec's digital pressure and
+ temperature sensor connected via SPI.
+endef
+
+$(eval $(call KernelPackage,iio-bmp280-spi))


From lede-commits at lists.infradead.org  Mon Oct 23 14:54:44 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 23 Oct 2017 17:54:44 -0400
Subject: [source]  opkg: bump to 2017-10-23 (lede-17.01)
In-Reply-To: <20171023215439.28665.85740@git-01.infra.lede-project.org>
References: <20171023215439.28665.85740@git-01.infra.lede-project.org>
Message-ID: <mailman.56176.1508795711.26984.lede-commits@lists.infradead.org>

neoraider pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/0780e12483fc65e49111c7c4a2344281e5c3e104

commit 0780e12483fc65e49111c7c4a2344281e5c3e104
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Mon Oct 23 23:48:25 2017 +0200

    opkg: bump to 2017-10-23 (lede-17.01)
    
    A lede-17.01 branch for bugfix backports has been added to the opkg-lede
    repo.
    
    c6caf07 pkg_parse: fix segfault when parsing descriptions with leading newlines
    5bb5fd5 opkg: add --no-check-certificate argument
    7a96972 libbb: xreadlink: fix memory leak on failure case
    3f13edd pkg_run_script: use pkg->dest in half installed case
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 package/system/opkg/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 1101169..4c6c080 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -16,9 +16,9 @@ PKG_FLAGS:=essential
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.lede-project.org/project/opkg-lede.git
-PKG_SOURCE_DATE:=2017-03-23
-PKG_SOURCE_VERSION:=1d0263bb40e3c099501fc1f2431907636230e7f2
-PKG_MIRROR_HASH:=1f527179e60b9404affa5f3c9c506d4249e085bf521f770819b8648273a1010c
+PKG_SOURCE_DATE:=2017-10-23
+PKG_SOURCE_VERSION:=c6caf07212150f5ec3b0c5f895c496452f9b1e21
+PKG_MIRROR_HASH:=8d1d608d7b7bb0a8dddc8801b9aaf2993cc028e6dde5dfc7641c24c7e64cd6a0
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING


From lede-commits at lists.infradead.org  Mon Oct 23 18:43:22 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 23 Oct 2017 21:43:22 -0400
Subject: [source]  include: Include new location for DT bindings
In-Reply-To: <20171024014322.19750.91007@git-01.infra.lede-project.org>
References: <20171024014322.19750.91007@git-01.infra.lede-project.org>
Message-ID: <mailman.56192.1508809425.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/818f36aa140d930e5de957eeb81f32f4d96a4bbb

commit 818f36aa140d930e5de957eeb81f32f4d96a4bbb
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Mon Oct 9 20:33:34 2017 -0700

    include: Include new location for DT bindings
    
    Starting with commit d5d332d3f7e8 ("devicetree: Move include prefixes
    from arch to separate directory") included in 4.12 and newer relocated
    the dt-bindings directory, so account for that while passing CPPFLAGS
    before DTC runs.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 include/image.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/image.mk b/include/image.mk
index 3f5b454..fc6bf06 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -161,6 +161,7 @@ define Image/BuildDTB
 	$(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \
 		-I$(DTS_DIR) \
 		-I$(DTS_DIR)/include \
+		-I$(LINUX_DIR)/include/ \
 		-undef -D__DTS__ $(3) \
 		-o $(2).tmp $(1)
 	$(LINUX_DIR)/scripts/dtc/dtc -O dtb \


From lede-commits at lists.infradead.org  Mon Oct 23 18:43:23 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 23 Oct 2017 21:43:23 -0400
Subject: [source]  bcm53xx: Fix SmartRG SR400AC initramfs image
In-Reply-To: <20171024014322.19750.91007@git-01.infra.lede-project.org>
References: <20171024014322.19750.91007@git-01.infra.lede-project.org>
Message-ID: <mailman.56193.1508809429.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/7f0a32e21ca9edaa5607b98724e1eca05c8c50ba

commit 7f0a32e21ca9edaa5607b98724e1eca05c8c50ba
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Mon Oct 9 20:50:27 2017 -0700

    bcm53xx: Fix SmartRG SR400AC initramfs image
    
    The SmartRG SR400AC CFE does not accept a TRX image, just a normal
    binary image.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 target/linux/bcm53xx/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 0d20c16..e4dca0c 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -307,6 +307,8 @@ define Device/smartrg-sr400ac
   DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES)
   IMAGES := trx
   IMAGE/trx := append-rootfs | trx-serial
+  KERNEL_INITRAMFS_SUFFIX := .bin
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma-d16
 endef
 TARGET_DEVICES += smartrg-sr400ac
 


From lede-commits at lists.infradead.org  Mon Oct 23 18:43:24 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 23 Oct 2017 21:43:24 -0400
Subject: [source] uboot-sunxi: Backport fix for stale CONFIG_SUNXIG_GMAC
 references
In-Reply-To: <20171024014322.19750.91007@git-01.infra.lede-project.org>
References: <20171024014322.19750.91007@git-01.infra.lede-project.org>
Message-ID: <mailman.56194.1508809432.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/1a533159519142753b79b2efcc8ea1d4146fe14b

commit 1a533159519142753b79b2efcc8ea1d4146fe14b
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Sat Oct 14 13:24:07 2017 -0700

    uboot-sunxi: Backport fix for stale CONFIG_SUNXIG_GMAC references
    
    This backports the upstream commit fixing stale references to
    CONFIG_SUNXI_GMAC which have been later replaced by CONFIG_SUN7I_GMAC.
    This fixes the designware MAC pinmuxing on e.g: Lamobo R1.
    
    Refresh patches while we are at it.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 ...Makefile-Build-python-libfdt-library-if-n.patch |  9 +--
 ...pts-Makefile.lib-Always-have-.-u-boot.dts.patch |  5 --
 ...2-Revert-Avoid-non-portable-sed-construct.patch |  5 --
 ...-Revert-sunxi-Use-binman-for-sunxi-boards.patch | 10 ---
 ...02-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch | 83 ++++++++++++++++++++++
 5 files changed, 84 insertions(+), 28 deletions(-)

diff --git a/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch
index dcf16c7..25edf51 100644
--- a/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch
+++ b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch
@@ -10,8 +10,6 @@ This reverts commit e38ffc42674fedc750ca895046be0bd983b56dd5.
  scripts/Makefile.spl | 17 ++++-------------
  2 files changed, 6 insertions(+), 28 deletions(-)
 
-diff --git a/Makefile b/Makefile
-index 119ad49eec..071efa8926 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -1116,7 +1116,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
@@ -33,7 +31,7 @@ index 119ad49eec..071efa8926 100644
  	$(call if_changed,binman)
  endif
  
-@@ -1355,18 +1354,6 @@ $(version_h): include/config/uboot.release FORCE
+@@ -1355,18 +1354,6 @@ $(version_h): include/config/uboot.relea
  $(timestamp_h): $(srctree)/Makefile FORCE
  	$(call filechk,timestamp.h)
  
@@ -52,8 +50,6 @@ index 119ad49eec..071efa8926 100644
  # ---------------------------------------------------------------------------
  quiet_cmd_cpp_lds = LDS     $@
  cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \
-diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
-index ac3c2c7f13..135706f21d 100644
 --- a/scripts/Makefile.spl
 +++ b/scripts/Makefile.spl
 @@ -257,12 +257,14 @@ PHONY += dts_dir
@@ -91,6 +87,3 @@ index ac3c2c7f13..135706f21d 100644
  PHONY += FORCE
  FORCE:
  
--- 
-2.11.0
-
diff --git a/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch
index 8f68caf..d40238d 100644
--- a/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch
+++ b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch
@@ -9,8 +9,6 @@ This reverts commit 7452946e7f3742b3ff1cb4a50603e7492aceea88.
  scripts/Makefile.lib | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
-index 80ddb08474..66f8dcbe07 100644
 --- a/scripts/Makefile.lib
 +++ b/scripts/Makefile.lib
 @@ -306,10 +306,10 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
@@ -26,6 +24,3 @@ index 80ddb08474..66f8dcbe07 100644
  		$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
  	$(DTC) -O dtb -o $@ -b 0 \
  		-i $(dir $<) $(DTC_FLAGS) \
--- 
-2.11.0
-
diff --git a/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch
index 1633ec7..1a56034 100644
--- a/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch
+++ b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch
@@ -8,8 +8,6 @@ This reverts commit 208db781cad4c24f538658a9cb17e24fa43ca3c9.
  scripts/Makefile.lib | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
-index 66f8dcbe07..54bcb166b0 100644
 --- a/scripts/Makefile.lib
 +++ b/scripts/Makefile.lib
 @@ -309,7 +309,7 @@ quiet_cmd_dtc = DTC     $@
@@ -21,6 +19,3 @@ index 66f8dcbe07..54bcb166b0 100644
  		$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
  	$(DTC) -O dtb -o $@ -b 0 \
  		-i $(dir $<) $(DTC_FLAGS) \
--- 
-2.11.0
-
diff --git a/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch
index a3e529c..6f75259 100644
--- a/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch
+++ b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch
@@ -11,8 +11,6 @@ This reverts commit 61b994a386eb6f631dc1c2194d4cce9b1a43542c.
  3 files changed, 6 insertions(+), 18 deletions(-)
  delete mode 100644 arch/arm/dts/sunxi-u-boot.dtsi
 
-diff --git a/Makefile b/Makefile
-index 071efa8926..5349621baf 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -1125,8 +1125,10 @@ u-boot-x86-16bit.bin: u-boot FORCE
@@ -28,9 +26,6 @@ index 071efa8926..5349621baf 100644
  endif
  
  ifneq ($(CONFIG_TEGRA),)
-diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
-deleted file mode 100644
-index 5adfd9bca2..0000000000
 --- a/arch/arm/dts/sunxi-u-boot.dtsi
 +++ /dev/null
 @@ -1,14 +0,0 @@
@@ -48,8 +43,6 @@ index 5adfd9bca2..0000000000
 -		};
 -	};
 -};
-diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
-index 54bcb166b0..6246265c91 100644
 --- a/scripts/Makefile.lib
 +++ b/scripts/Makefile.lib
 @@ -308,8 +308,8 @@ quiet_cmd_dtc = DTC     $@
@@ -63,6 +56,3 @@ index 54bcb166b0..6246265c91 100644
  		$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
  	$(DTC) -O dtb -o $@ -b 0 \
  		-i $(dir $<) $(DTC_FLAGS) \
--- 
-2.11.0
-
diff --git a/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch
new file mode 100644
index 0000000..d884173
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch
@@ -0,0 +1,83 @@
+From 6ff005cf19363382fc867d7876a75fd8a386e894 Mon Sep 17 00:00:00 2001
+From: Dave Prue <dave at prue.com>
+Date: Thu, 31 Aug 2017 19:21:01 +0200
+Subject: [PATCH] sunxi: Fix CONFIG_SUNXI_GMAC references
+
+SUNXI_GMAC was still used to configure the code where as the
+same has been renamed and moved to Kconfig in below commit
+"sunxi: Move SUNXI_GMAC to Kconfig"
+(sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb)
+
+Signed-off-by: Dave Prue <dave at prue.com>
+Reviewed-by: Simon Glass <sjg at chromium.org>
+Reviewed-by: Jagan Teki <jagan at openedev.com>
+Reviewed-by: Mark Kettenis <kettenis at openbsd.org>
+Tested-by: Mark Kettenis <kettenis at openbsd.org>
+[Tweek commit message, config_whitelist.txt, build-whitelist.sh]
+Signed-off-by: Jagan Teki <jagan at openedev.com>
+---
+ arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
+ board/sunxi/Makefile                        | 2 +-
+ include/configs/sunxi-common.h              | 2 +-
+ scripts/build-whitelist.sh                  | 4 ++--
+ scripts/config_whitelist.txt                | 1 -
+ 5 files changed, 5 insertions(+), 6 deletions(-)
+
+--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
++++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
+@@ -24,7 +24,7 @@ void sdelay(unsigned long);
+ void return_to_fel(uint32_t lr, uint32_t sp);
+ 
+ /* Board / SoC level designware gmac init */
+-#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
++#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC
+ void eth_init_board(void);
+ #else
+ static inline void eth_init_board(void) {}
+--- a/board/sunxi/Makefile
++++ b/board/sunxi/Makefile
+@@ -9,7 +9,7 @@
+ # SPDX-License-Identifier:	GPL-2.0+
+ #
+ obj-y	+= board.o
+-obj-$(CONFIG_SUNXI_GMAC)	+= gmac.o
++obj-$(CONFIG_SUN7I_GMAC)	+= gmac.o
+ obj-$(CONFIG_SUNXI_AHCI)	+= ahci.o
+ obj-$(CONFIG_MACH_SUN4I)	+= dram_sun4i_auto.o
+ obj-$(CONFIG_MACH_SUN5I)	+= dram_sun5i_auto.o
+--- a/include/configs/sunxi-common.h
++++ b/include/configs/sunxi-common.h
+@@ -302,7 +302,7 @@ extern int soft_i2c_gpio_scl;
+ #define CONFIG_PHYLIB
+ #endif
+ 
+-#ifdef CONFIG_SUNXI_GMAC
++#ifdef CONFIG_SUN7I_GMAC
+ #define CONFIG_PHY_GIGE			/* GMAC can use gigabit PHY	*/
+ #define CONFIG_PHY_ADDR		1
+ #define CONFIG_MII			/* MII PHY management		*/
+--- a/scripts/build-whitelist.sh
++++ b/scripts/build-whitelist.sh
+@@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C
+ # There are two independent greps. The first pulls out the component parts
+ # of CONFIG_SYS_EXTRA_OPTIONS. An example is:
+ #
+-#	SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
++#	SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8)
+ #
+ # We want this to produce:
+-#	CONFIG_SUNXI_GMAC
++#	CONFIG_SUN7I_GMAC
+ #	CONFIG_AHCI
+ #	CONFIG_SATAPWR
+ #
+--- a/scripts/config_whitelist.txt
++++ b/scripts/config_whitelist.txt
+@@ -2371,7 +2371,6 @@ CONFIG_STV0991_HZ_CLOCK
+ CONFIG_ST_SMI
+ CONFIG_SUNXI_AHCI
+ CONFIG_SUNXI_EMAC
+-CONFIG_SUNXI_GMAC
+ CONFIG_SUNXI_GPIO
+ CONFIG_SUNXI_MAX_FB_SIZE
+ CONFIG_SUNXI_USB_PHYS


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:34 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:34 -0400
Subject: [source]  include/site: add powerpc64 config
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56288.1508844305.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/555985ac905a13fde3a1a5acb79e7ee072eab16e

commit 555985ac905a13fde3a1a5acb79e7ee072eab16e
Author: Florian Larysch <fl at n621.de>
AuthorDate: Thu Nov 3 13:45:58 2016 +0100

    include/site: add powerpc64 config
    
    Signed-off-by: Florian Larysch <fl at n621.de>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/site/powerpc64 | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/include/site/powerpc64 b/include/site/powerpc64
new file mode 100644
index 0000000..6a66346
--- /dev/null
+++ b/include/site/powerpc64
@@ -0,0 +1,26 @@
+#!/bin/sh
+. $TOPDIR/include/site/linux
+ac_cv_c_littleendian=${ac_cv_c_littleendian=no}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
+
+ac_cv_sizeof_char=1
+ac_cv_sizeof_char_p=8
+ac_cv_sizeof_double=8
+ac_cv_sizeof_float=4
+ac_cv_sizeof_int=4
+ac_cv_sizeof_long=8
+ac_cv_sizeof_long_double=16
+ac_cv_sizeof_long_int=8
+ac_cv_sizeof_long_long=8
+ac_cv_sizeof_long_long_int=8
+ac_cv_sizeof_short=2
+ac_cv_sizeof_short_int=2
+ac_cv_sizeof_signed_char=1
+ac_cv_sizeof_unsigned_char=1
+ac_cv_sizeof_unsigned_int=4
+ac_cv_sizeof_unsigned_long=8
+ac_cv_sizeof_unsigned_long_int=8
+ac_cv_sizeof_unsigned_long_long_int=8
+ac_cv_sizeof_unsigned_short=2
+ac_cv_sizeof_unsigned_short_int=2
+ac_cv_sizeof_void_p=8


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:36 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:36 -0400
Subject: [source]  toolchain: use glibc for powerpc64 builds
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56289.1508844309.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/0de93311e1575ab6f8e9e90b5023b6fb2cedcf1f

commit 0de93311e1575ab6f8e9e90b5023b6fb2cedcf1f
Author: Florian Larysch <fl at n621.de>
AuthorDate: Thu Nov 3 14:30:40 2016 +0100

    toolchain: use glibc for powerpc64 builds
    
    Neither uClibc nor musl currently have working support for powerpc64 in
    big endian mode. Thus, default to using glibc for this architecture.
    
    Signed-off-by: Florian Larysch <fl at n621.de>
---
 toolchain/Config.in | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index cb29fe5..bf7b9c3 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -238,6 +238,7 @@ comment "C Library"
 choice
 	prompt "C Library implementation" if TOOLCHAINOPTS
 	default LIBC_USE_UCLIBC if arc
+	default LIBC_USE_GLIBC if powerpc64
 	default LIBC_USE_MUSL
 	help
 	  Select the C library implementation.
@@ -250,13 +251,13 @@ choice
 	config LIBC_USE_UCLIBC
 		select USE_UCLIBC
 		bool "Use uClibc"
-		depends on !(aarch64 || aarch64_be)
+		depends on !(aarch64 || aarch64_be || powerpc64)
 		depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc)
 
 	config LIBC_USE_MUSL
 		select USE_MUSL
 		bool "Use musl"
-		depends on !(arc)
+		depends on !(arc || powerpc64)
 
 endchoice
 
@@ -274,6 +275,7 @@ config GDB
 	  Enable if you want to build the gdb.
 
 config USE_GLIBC
+	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (powerpc64)
 	bool
 
 config USE_UCLIBC
@@ -281,7 +283,7 @@ config USE_UCLIBC
 	bool
 
 config USE_MUSL
-	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
+	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64)
 	bool
 
 config USE_EXTERNAL_LIBC


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:35 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:35 -0400
Subject: [source]  toolchain: remove powerpc64 feature
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56292.1508844309.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/9e91d3271848fb9093b1a7f92ac9542ced8da88d

commit 9e91d3271848fb9093b1a7f92ac9542ced8da88d
Author: Florian Larysch <fl at n621.de>
AuthorDate: Thu Nov 3 14:30:53 2016 +0100

    toolchain: remove powerpc64 feature
    
    The powerpc64 feature flag was introduced with the PS3 support, which
    has been removed for quite a while and is now unused. Remove it and the
    special biarch handling it triggered during the toolchain build.
    
    Signed-off-by: Florian Larysch <fl at n621.de>
---
 toolchain/Config.in | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index f6753ad..cb29fe5 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -168,7 +168,6 @@ menuconfig EXTRA_TARGET_ARCH
 	bool
 	prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
 	depends on !sparc
-	default y	if powerpc64
 	default n
 	help
 	  Some builds may require a 'biarch' toolchain. This option
@@ -178,7 +177,6 @@ menuconfig EXTRA_TARGET_ARCH
 
 	config EXTRA_TARGET_ARCH_NAME
 		string
-		default "powerpc64"	if powerpc64
 		prompt "Extra architecture name" if EXTRA_TARGET_ARCH
 		help
 		  Specify the cpu name (eg powerpc64 or x86_64) of the
@@ -186,7 +184,6 @@ menuconfig EXTRA_TARGET_ARCH
 
 	config EXTRA_TARGET_ARCH_OPTS
 		string
-		default "-m64"		if powerpc64
 		prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
 		help
 		  If you're specifying an addition target architecture,


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:37 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:37 -0400
Subject: [source]  target: add cpu flags for powerpc64
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56293.1508844313.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/56ed89f0787b9c366e24e360c542bbeebe6e2423

commit 56ed89f0787b9c366e24e360c542bbeebe6e2423
Author: Florian Larysch <fl at n621.de>
AuthorDate: Thu Nov 3 15:54:19 2016 +0100

    target: add cpu flags for powerpc64
    
    Signed-off-by: Florian Larysch <fl at n621.de>
---
 include/target.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/target.mk b/include/target.mk
index c5f6e8b..ef7d855 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -205,6 +205,10 @@ ifeq ($(DUMP),1)
     CPU_CFLAGS_440:=-mcpu=440
     CPU_CFLAGS_464fp:=-mcpu=464fp
   endif
+  ifeq ($(ARCH),powerpc64)
+    CPU_TYPE ?= powerpc64
+    CPU_CFLAGS_powerpc64:=-mcpu=powerpc64
+  endif
   ifeq ($(ARCH),sparc)
     CPU_TYPE = sparc
     CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:38 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:38 -0400
Subject: [source] config: set ARCH if powerpc64 is selected in the
 configuration
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56294.1508844318.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/7ea6261b4344bde08be0e72ab018f772e8d25da2

commit 7ea6261b4344bde08be0e72ab018f772e8d25da2
Author: Florian Larysch <fl at n621.de>
AuthorDate: Thu Nov 3 13:46:23 2016 +0100

    config: set ARCH if powerpc64 is selected in the configuration
    
    Signed-off-by: Florian Larysch <fl at n621.de>
---
 target/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/Config.in b/target/Config.in
index cb876c6..3aef768 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -199,6 +199,7 @@ config ARCH
 	default "mips64"    if mips64
 	default "mips64el"  if mips64el
 	default "powerpc"   if powerpc
+	default "powerpc64" if powerpc64
 	default "sh3"       if sh3
 	default "sh3eb"     if sh3eb
 	default "sh4"       if sh4


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:41 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:41 -0400
Subject: [source]  ar71xx: fix lzma loader performance issues
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56295.1508844328.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/8c5702f2a07cebfbee6f9e628b63d88b8806ca1b

commit 8c5702f2a07cebfbee6f9e628b63d88b8806ca1b
Author: Julien Dusser <julien.dusser at free.fr>
AuthorDate: Wed Jul 19 14:52:35 2017 +0200

    ar71xx: fix lzma loader performance issues
    
    Some bootloaders set a cache cohenrency to a very slow mode. Use code from
    Linux kernel to set it to "Cacheable, noncoherent, write-back, write
    allocate".
    
    Perfomance impact is significant on TP-Link EAP245 board, kernel
    decompression time fall from 33 seconds to less than 1.
    
    Signed-off-by: Julien Dusser <julien.dusser at free.fr>
---
 target/linux/ar71xx/image/lzma-loader/src/head.S | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/target/linux/ar71xx/image/lzma-loader/src/head.S b/target/linux/ar71xx/image/lzma-loader/src/head.S
index 47a7c9b..d414b14 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/head.S
+++ b/target/linux/ar71xx/image/lzma-loader/src/head.S
@@ -42,6 +42,19 @@ LEAF(startup)
 	mtc0	t0, CP0_STATUS
 	ehb
 
+	/*
+	 * Some bootloaders set the 'Kseg0 coherency algorithm' to
+	 * 'Cacheable, noncoherent, write-through, no write allocate'
+	 * and this cause performance issues. Let's go and change it to
+	 * 'Cacheable, noncoherent, write-back, write allocate'
+	 */
+	mfc0	t0, CP0_CONFIG
+	li	t1, ~7			#~CONF_CM_CMASK
+	and	t0, t1
+	ori	t0, 3			#CONF_CM_CACHABLE_NONCOHERENT
+	mtc0	t0, CP0_CONFIG
+	nop
+
 	mtc0	zero, CP0_COUNT
 	mtc0	zero, CP0_COMPARE
 	ehb


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:40 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:40 -0400
Subject: [source]  libs/lzo: Reenable unaligned access on ARM, PPC, ...
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56296.1508844328.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/06e41056aab12f5fb6c35789d0bde71bcf1dc90e

commit 06e41056aab12f5fb6c35789d0bde71bcf1dc90e
Author: Stefan Oberhumer <stefan at obssys.com>
AuthorDate: Wed May 31 07:37:03 2017 +0200

    libs/lzo: Reenable unaligned access on ARM, PPC, ...
    
    Due a compiler bug on ARM targets
     ( https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64516 )
    unaligned access was disabled on all targets other than i386 and
    x86_64 with commit 061319ec3dfe9b6d14af1286a1d9979db56048d7 .
    
    A fix has been added to lzo-2.09 so it is not necessary to disable
    unaligned access within the Makefile anymore.
    
    Signed-off-by: Stefan Oberhumer <stefan at obssys.com>
---
 package/libs/lzo/Makefile | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile
index 8d85e46..ef33619 100644
--- a/package/libs/lzo/Makefile
+++ b/package/libs/lzo/Makefile
@@ -42,10 +42,6 @@ CONFIGURE_ARGS += \
 TARGET_CFLAGS += $(FPIC)
 MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)"
 
-ifeq ($(CONFIG_i386)$(CONFIG_x86_64),)
-  TARGET_CFLAGS += -DLZO_CFG_NO_UNALIGNED=1
-endif
-
 define Build/InstallDev
 	$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
 	$(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:42 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:42 -0400
Subject: [source]  ar71xx: lzma loader use LTO
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56297.1508844332.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8

commit 8d9ff6b6f7b2ba0c3dcba926099f819af871e0a8
Author: Julien Dusser <julien.dusser at free.fr>
AuthorDate: Wed Jul 19 15:45:08 2017 +0200

    ar71xx: lzma loader use LTO
    
    Change the Makefile to use LTO for better code optimisations. Gains are
    very low, only 270 bytes saved, but it's only Makefile changes.
    
    Signed-off-by: Julien Dusser <julien.dusser at free.fr>
---
 target/linux/ar71xx/image/lzma-loader/src/Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile
index 5f10bdb..682b31f 100644
--- a/target/linux/ar71xx/image/lzma-loader/src/Makefile
+++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile
@@ -37,11 +37,13 @@ CFLAGS		= -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
 		  -mabi=32 -march=mips32r2 \
 		  -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap
 CFLAGS		+= -D_LZMA_PROB32
+CFLAGS		+= -flto
 
 ASFLAGS		= $(CFLAGS) -D__ASSEMBLY__
 
-LDFLAGS		= -static --gc-sections -no-warn-mismatch
-LDFLAGS		+= -e startup -T loader.lds -Ttext $(LZMA_TEXT_START)
+LDFLAGS		= -static -Wl,--gc-sections -Wl,-no-warn-mismatch
+LDFLAGS		+= -Wl,-e,startup -T loader.lds -Wl,-Ttext,$(LZMA_TEXT_START)
+LDFLAGS		+= -flto -fwhole-program
 
 O_FORMAT 	= $(shell $(OBJDUMP) -i | head -2 | grep elf32)
 
@@ -86,7 +88,7 @@ data.o: $(LOADER_DATA)
 	$(LD) -r -b binary --oformat $(O_FORMAT) -T lzma-data.lds -o $@ $<
 
 loader: $(OBJECTS)
-	$(LD) $(LDFLAGS) -o $@ $(OBJECTS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS)
 
 loader.bin: loader
 	$(OBJCOPY) $(BIN_FLAGS) $< $@


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:39 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:39 -0400
Subject: [source]  kernel: fixup KARCH for powerpc64 builds
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56298.1508844333.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/f28b3bb56af4cb870f5b9b8a6e5bd0b3021de837

commit f28b3bb56af4cb870f5b9b8a6e5bd0b3021de837
Author: Florian Larysch <fl at n621.de>
AuthorDate: Thu Nov 3 13:58:24 2016 +0100

    kernel: fixup KARCH for powerpc64 builds
    
    The kernel calls both ppc64 and ppc32 "powerpc", so we need to fixup
    LINUX_KARCH when building with ARCH=powerpc64.
    
    Signed-off-by: Florian Larysch <fl at n621.de>
---
 include/kernel.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/kernel.mk b/include/kernel.mk
index 7674f0d..a84c755 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -85,6 +85,8 @@ else ifneq (,$(findstring $(ARCH) , armeb ))
   LINUX_KARCH := arm
 else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
   LINUX_KARCH := mips
+else ifneq (,$(findstring $(ARCH) , powerpc64 ))
+  LINUX_KARCH := powerpc
 else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
   LINUX_KARCH := sh
 else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:43 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:43 -0400
Subject: [source]  ar71xx: fix secondary gpio controller base values
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56299.1508844333.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/65da6f9ca164cc321a84f28c81785a21af6af6fd

commit 65da6f9ca164cc321a84f28c81785a21af6af6fd
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Oct 24 10:32:21 2017 +0200

    ar71xx: fix secondary gpio controller base values
    
    In 4.9, gpio count is rounded up to 32 due to the use of bgpio in the
    ath79 gpio controller driver.
    Fix base values in mach files to account for that
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c  | 18 +++++++++---------
 .../ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c  | 18 +++++++++---------
 .../ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c   |  2 +-
 target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c |  2 +-
 .../ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c   | 18 +++++++++---------
 5 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c
index 9e08c15..c6c6463 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c
@@ -35,15 +35,15 @@
 #define ARCHER_C25_GPIO_SHIFT_SRCLR	19 /* MR,   Master Reset */
 #define ARCHER_C25_GPIO_SHIFT_RCLK	16 /* STCP, Storage Reg Clock Input */
 
-#define ARCHER_C25_74HC_GPIO_BASE		QCA956X_GPIO_COUNT
-#define ARCHER_C25_74HC_GPIO_LED_WAN_AMBER	27
-#define ARCHER_C25_74HC_GPIO_LED_WAN_GREEN	28
-#define ARCHER_C25_74HC_GPIO_LED_WLAN2		29
-#define ARCHER_C25_74HC_GPIO_LED_WLAN5		30
-#define ARCHER_C25_74HC_GPIO_LED_LAN1		23
-#define ARCHER_C25_74HC_GPIO_LED_LAN2		24
-#define ARCHER_C25_74HC_GPIO_LED_LAN3		25
-#define ARCHER_C25_74HC_GPIO_LED_LAN4		26
+#define ARCHER_C25_74HC_GPIO_BASE		32
+#define ARCHER_C25_74HC_GPIO_LED_WAN_AMBER	(ARCHER_C25_74HC_GPIO_BASE + 4)
+#define ARCHER_C25_74HC_GPIO_LED_WAN_GREEN	(ARCHER_C25_74HC_GPIO_BASE + 5)
+#define ARCHER_C25_74HC_GPIO_LED_WLAN2		(ARCHER_C25_74HC_GPIO_BASE + 6)
+#define ARCHER_C25_74HC_GPIO_LED_WLAN5		(ARCHER_C25_74HC_GPIO_BASE + 7)
+#define ARCHER_C25_74HC_GPIO_LED_LAN1		(ARCHER_C25_74HC_GPIO_BASE + 0)
+#define ARCHER_C25_74HC_GPIO_LED_LAN2		(ARCHER_C25_74HC_GPIO_BASE + 1)
+#define ARCHER_C25_74HC_GPIO_LED_LAN3		(ARCHER_C25_74HC_GPIO_BASE + 2)
+#define ARCHER_C25_74HC_GPIO_LED_LAN4		(ARCHER_C25_74HC_GPIO_BASE + 3)
 
 #define ARCHER_C25_V1_SSR_BIT_0			0
 #define ARCHER_C25_V1_SSR_BIT_1			1
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c
index da15919..3c85a20 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c
@@ -43,15 +43,15 @@
 #define ARCHER_C59_GPIO_SHIFT_SRCLR		19
 #define ARCHER_C59_GPIO_SHIFT_RCLK		20
 
-#define ARCHER_C59_74HC_GPIO_BASE		QCA956X_GPIO_COUNT
-#define ARCHER_C59_74HC_GPIO_LED_POWER		23
-#define ARCHER_C59_74HC_GPIO_LED_WLAN2		24
-#define ARCHER_C59_74HC_GPIO_LED_WLAN5		25
-#define ARCHER_C59_74HC_GPIO_LED_LAN		26
-#define ARCHER_C59_74HC_GPIO_LED_WAN_GREEN	27
-#define ARCHER_C59_74HC_GPIO_LED_WAN_AMBER	28
-#define ARCHER_C59_74HC_GPIO_LED_WPS		29
-#define ARCHER_C59_74HC_GPIO_LED_USB		30
+#define ARCHER_C59_74HC_GPIO_BASE		32
+#define ARCHER_C59_74HC_GPIO_LED_POWER		(ARCHER_C59_74HC_GPIO_BASE + 0)
+#define ARCHER_C59_74HC_GPIO_LED_WLAN2		(ARCHER_C59_74HC_GPIO_BASE + 1)
+#define ARCHER_C59_74HC_GPIO_LED_WLAN5		(ARCHER_C59_74HC_GPIO_BASE + 2)
+#define ARCHER_C59_74HC_GPIO_LED_LAN		(ARCHER_C59_74HC_GPIO_BASE + 3)
+#define ARCHER_C59_74HC_GPIO_LED_WAN_GREEN	(ARCHER_C59_74HC_GPIO_BASE + 4)
+#define ARCHER_C59_74HC_GPIO_LED_WAN_AMBER	(ARCHER_C59_74HC_GPIO_BASE + 5)
+#define ARCHER_C59_74HC_GPIO_LED_WPS		(ARCHER_C59_74HC_GPIO_BASE + 6)
+#define ARCHER_C59_74HC_GPIO_LED_USB		(ARCHER_C59_74HC_GPIO_BASE + 7)
 
 #define ARCHER_C59_V1_SSR_BIT_0			0
 #define ARCHER_C59_V1_SSR_BIT_1			1
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
index 64955c7..21b8e8c 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
@@ -56,7 +56,7 @@
 #define ARCHER_C7_GPIO_LED_USB1		7
 #define ARCHER_C7_GPIO_LED_USB2		8
 
-#define ARCHER_C7_74HC_GPIO_BASE	QCA956X_GPIO_COUNT
+#define ARCHER_C7_74HC_GPIO_BASE	32
 #define ARCHER_C7_GPIO_LED_WPS		(ARCHER_C7_74HC_GPIO_BASE + 0)
 #define ARCHER_C7_GPIO_LED_LAN1		(ARCHER_C7_74HC_GPIO_BASE + 1)
 #define ARCHER_C7_GPIO_LED_LAN2		(ARCHER_C7_74HC_GPIO_BASE + 2)
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
index 64f927d..691566f 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
@@ -53,7 +53,7 @@
 #define RB91X_FLAG_USB		BIT(0)
 #define RB91X_FLAG_PCIE		BIT(1)
 
-#define RB91X_LATCH_GPIO_BASE	AR934X_GPIO_COUNT
+#define RB91X_LATCH_GPIO_BASE	32
 #define RB91X_LATCH_GPIO(_x)	(RB91X_LATCH_GPIO_BASE + (_x))
 
 #define RB91X_SSR_GPIO_BASE	(RB91X_LATCH_GPIO_BASE + AR934X_GPIO_COUNT)
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c
index 76f6a07..32e2bc9 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c
@@ -49,15 +49,15 @@
 #define TL_WR942N_V1_GPIO_LED_WPS		21
 #define TL_WR942N_V1_GPIO_LED_STATUS		22
 
-#define TL_WR942N_V1_74HC_GPIO_BASE		QCA956X_GPIO_COUNT
-#define TL_WR942N_V1_74HC_GPIO_LED_LAN4		23
-#define TL_WR942N_V1_74HC_GPIO_LED_LAN3		24
-#define TL_WR942N_V1_74HC_GPIO_LED_LAN2		25
-#define TL_WR942N_V1_74HC_GPIO_LED_LAN1		26
-#define TL_WR942N_V1_74HC_GPIO_LED_WAN_GREEN	27
-#define TL_WR942N_V1_74HC_GPIO_LED_WAN_AMBER	28
-#define TL_WR942N_V1_74HC_GPIO_LED_WLAN		29
-#define TL_WR942N_V1_74HC_GPIO_HUB_RESET	30 /* from u-boot sources */
+#define TL_WR942N_V1_74HC_GPIO_BASE		32
+#define TL_WR942N_V1_74HC_GPIO_LED_LAN4		(TL_WR942N_V1_74HC_GPIO_BASE + 0)
+#define TL_WR942N_V1_74HC_GPIO_LED_LAN3		(TL_WR942N_V1_74HC_GPIO_BASE + 1)
+#define TL_WR942N_V1_74HC_GPIO_LED_LAN2		(TL_WR942N_V1_74HC_GPIO_BASE + 2)
+#define TL_WR942N_V1_74HC_GPIO_LED_LAN1		(TL_WR942N_V1_74HC_GPIO_BASE + 3)
+#define TL_WR942N_V1_74HC_GPIO_LED_WAN_GREEN	(TL_WR942N_V1_74HC_GPIO_BASE + 4)
+#define TL_WR942N_V1_74HC_GPIO_LED_WAN_AMBER	(TL_WR942N_V1_74HC_GPIO_BASE + 5)
+#define TL_WR942N_V1_74HC_GPIO_LED_WLAN		(TL_WR942N_V1_74HC_GPIO_BASE + 6)
+#define TL_WR942N_V1_74HC_GPIO_HUB_RESET	(TL_WR942N_V1_74HC_GPIO_BASE + 7) /* from u-boot sources */
 
 #define TL_WR942N_V1_SSR_BIT_0			0
 #define TL_WR942N_V1_SSR_BIT_1			1


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:46 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:46 -0400
Subject: [source]  tools/squashfs: use host cflags
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56302.1508844366.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/20d363aed395e07ff42fe648f898b17f2077cc82

commit 20d363aed395e07ff42fe648f898b17f2077cc82
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Oct 24 13:22:09 2017 +0200

    tools/squashfs: use host cflags
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 tools/squashfs/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/squashfs/Makefile b/tools/squashfs/Makefile
index 27adca1..87f6e8f 100644
--- a/tools/squashfs/Makefile
+++ b/tools/squashfs/Makefile
@@ -21,6 +21,7 @@ include $(INCLUDE_DIR)/host-build.mk
 define Host/Compile
 	$(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \
 		CC="$(HOSTCC)" \
+		CFLAGS="$(HOST_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I." \
 		CXX="$(CXX)" \
 		LZMAPATH=$(STAGING_DIR_HOST)/lib \
 		mksquashfs-lzma unsquashfs-lzma 


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:45 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:45 -0400
Subject: [source]  ar71xx: re-enable 4k sectors for the mikrotik subtargets
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56303.1508844391.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/b7ea14150f767caaf443fdb84f87ddf6e21e0ebe

commit b7ea14150f767caaf443fdb84f87ddf6e21e0ebe
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Oct 24 12:33:46 2017 +0200

    ar71xx: re-enable 4k sectors for the mikrotik subtargets
    
    On RB91x (and possibly others), there is a small SPI flash to store boot
    loader and configuration. It needs 4K sectors to be able to write the
    configuration using rbcfg
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ar71xx/mikrotik/config-default | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
index e333166..42f9882 100644
--- a/target/linux/ar71xx/mikrotik/config-default
+++ b/target/linux/ar71xx/mikrotik/config-default
@@ -231,6 +231,7 @@ CONFIG_MTD_NAND_RB4XX=y
 CONFIG_MTD_NAND_RB750=y
 CONFIG_MTD_NAND_RB91X=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
 # CONFIG_MTD_SPLIT_EVA_FW is not set
 # CONFIG_MTD_SPLIT_TPLINK_FW is not set
 # CONFIG_MTD_TPLINK_PARTS is not set


From lede-commits at lists.infradead.org  Tue Oct 24 04:24:44 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 07:24:44 -0400
Subject: [source] ar71xx: fix mikrotik routerboard nand driver issues with
 linux 4.9
In-Reply-To: <20171024112434.5986.33647@git-01.infra.lede-project.org>
References: <20171024112434.5986.33647@git-01.infra.lede-project.org>
Message-ID: <mailman.56304.1508844542.26984.lede-commits@lists.infradead.org>

nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/7c09fa4a7492ca436f2c94bd9a465b7c5bbeed6f

commit 7c09fa4a7492ca436f2c94bd9a465b7c5bbeed6f
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Oct 24 12:30:48 2017 +0200

    ar71xx: fix mikrotik routerboard nand driver issues with linux 4.9
    
    The mtd device is now embedded inside the nand chip data structure
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../ar71xx/files/drivers/mtd/nand/rb4xx_nand.c     | 48 ++++++++++++++++++----
 .../ar71xx/files/drivers/mtd/nand/rb750_nand.c     | 43 +++++++++++++++----
 .../ar71xx/files/drivers/mtd/nand/rb91x_nand.c     | 44 ++++++++++++++++----
 3 files changed, 108 insertions(+), 27 deletions(-)

diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c
index b397575..5bbe978 100644
--- a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c
+++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c
@@ -39,9 +39,31 @@
 
 struct rb4xx_nand_info {
 	struct nand_chip	chip;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 	struct mtd_info		mtd;
+#endif
 };
 
+static inline struct rb4xx_nand_info *mtd_to_rbinfo(struct mtd_info *mtd)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	return container_of(mtd, struct rb4xx_nand_info, mtd);
+#else
+	struct nand_chip *chip = mtd_to_nand(mtd);
+
+	return container_of(chip, struct rb4xx_nand_info, chip);
+#endif
+}
+
+static struct mtd_info *rbinfo_to_mtd(struct rb4xx_nand_info *nfc)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	return &nfc->mtd;
+#else
+	return nand_to_mtd(&nfc->chip);
+#endif
+}
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 /*
  * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
@@ -191,6 +213,7 @@ static void rb4xx_nand_read_buf(struct mtd_info *mtd, unsigned char *buf,
 static int rb4xx_nand_probe(struct platform_device *pdev)
 {
 	struct rb4xx_nand_info	*info;
+	struct mtd_info *mtd;
 	int ret;
 
 	printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
@@ -259,8 +282,12 @@ static int rb4xx_nand_probe(struct platform_device *pdev)
 	}
 
 	info->chip.priv	= &info;
-	info->mtd.priv	= &info->chip;
-	info->mtd.owner	= THIS_MODULE;
+	mtd = rbinfo_to_mtd(info);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	mtd->priv	= &info->chip;
+#endif
+	mtd->owner	= THIS_MODULE;
 
 	info->chip.cmd_ctrl	= rb4xx_nand_cmd_ctrl;
 	info->chip.dev_ready	= rb4xx_nand_dev_ready;
@@ -270,30 +297,33 @@ static int rb4xx_nand_probe(struct platform_device *pdev)
 
 	info->chip.chip_delay	= 25;
 	info->chip.ecc.mode	= NAND_ECC_SOFT;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+	info->chip.ecc.algo = NAND_ECC_HAMMING;
+#endif
 	info->chip.options = NAND_NO_SUBPAGE_WRITE;
 
 	platform_set_drvdata(pdev, info);
 
-	ret = nand_scan_ident(&info->mtd, 1, NULL);
+	ret = nand_scan_ident(mtd, 1, NULL);
 	if (ret) {
 		ret = -ENXIO;
 		goto err_free_info;
 	}
 
-	if (info->mtd.writesize == 512)
+	if (mtd->writesize == 512)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 		info->chip.ecc.layout = &rb4xx_nand_ecclayout;
 #else
-		mtd_set_ooblayout(&info->mtd, &rb4xx_nand_ecclayout_ops);
+		mtd_set_ooblayout(mtd, &rb4xx_nand_ecclayout_ops);
 #endif
 
-	ret = nand_scan_tail(&info->mtd);
+	ret = nand_scan_tail(mtd);
 	if (ret) {
 		return -ENXIO;
 		goto err_set_drvdata;
 	}
 
-	mtd_device_register(&info->mtd, rb4xx_nand_partitions,
+	mtd_device_register(mtd, rb4xx_nand_partitions,
 				ARRAY_SIZE(rb4xx_nand_partitions));
 	if (ret)
 		goto err_release_nand;
@@ -301,7 +331,7 @@ static int rb4xx_nand_probe(struct platform_device *pdev)
 	return 0;
 
 err_release_nand:
-	nand_release(&info->mtd);
+	nand_release(mtd);
 err_set_drvdata:
 	platform_set_drvdata(pdev, NULL);
 err_free_info:
@@ -322,7 +352,7 @@ static int rb4xx_nand_remove(struct platform_device *pdev)
 {
 	struct rb4xx_nand_info *info = platform_get_drvdata(pdev);
 
-	nand_release(&info->mtd);
+	nand_release(rbinfo_to_mtd(info));
 	platform_set_drvdata(pdev, NULL);
 	kfree(info);
 	gpio_free(RB4XX_NAND_GPIO_NCE);
diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c
index f8a6722..dbada68 100644
--- a/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c
+++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c
@@ -41,13 +41,30 @@
 
 struct rb750_nand_info {
 	struct nand_chip	chip;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 	struct mtd_info		mtd;
+#endif
 	struct rb7xx_nand_platform_data *pdata;
 };
 
 static inline struct rb750_nand_info *mtd_to_rbinfo(struct mtd_info *mtd)
 {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 	return container_of(mtd, struct rb750_nand_info, mtd);
+#else
+	struct nand_chip *chip = mtd_to_nand(mtd);
+
+	return container_of(chip, struct rb750_nand_info, chip);
+#endif
+}
+
+static struct mtd_info *rbinfo_to_mtd(struct rb750_nand_info *nfc)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	return &nfc->mtd;
+#else
+	return nand_to_mtd(&nfc->chip);
+#endif
 }
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
@@ -304,6 +321,7 @@ static int rb750_nand_probe(struct platform_device *pdev)
 {
 	struct rb750_nand_info	*info;
 	struct rb7xx_nand_platform_data *pdata;
+	struct mtd_info *mtd;
 	int ret;
 
 	printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
@@ -317,8 +335,12 @@ static int rb750_nand_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	info->chip.priv	= &info;
-	info->mtd.priv	= &info->chip;
-	info->mtd.owner	= THIS_MODULE;
+
+	mtd = rbinfo_to_mtd(info);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	mtd->priv	= &info->chip;
+#endif
+	mtd->owner	= THIS_MODULE;
 
 	info->chip.select_chip	= rb750_nand_select_chip;
 	info->chip.cmd_ctrl	= rb750_nand_cmd_ctrl;
@@ -329,6 +351,9 @@ static int rb750_nand_probe(struct platform_device *pdev)
 
 	info->chip.chip_delay	= 25;
 	info->chip.ecc.mode	= NAND_ECC_SOFT;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+	info->chip.ecc.algo = NAND_ECC_HAMMING;
+#endif
 	info->chip.options = NAND_NO_SUBPAGE_WRITE;
 
 	info->pdata = pdata;
@@ -337,26 +362,26 @@ static int rb750_nand_probe(struct platform_device *pdev)
 
 	rb750_nand_gpio_init(info);
 
-	ret = nand_scan_ident(&info->mtd, 1, NULL);
+	ret = nand_scan_ident(mtd, 1, NULL);
 	if (ret) {
 		ret = -ENXIO;
 		goto err_free_info;
 	}
 
-	if (info->mtd.writesize == 512)
+	if (mtd->writesize == 512)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 		info->chip.ecc.layout = &rb750_nand_ecclayout;
 #else
-		mtd_set_ooblayout(&info->mtd, &rb750_nand_ecclayout_ops);
+		mtd_set_ooblayout(mtd, &rb750_nand_ecclayout_ops);
 #endif
 
-	ret = nand_scan_tail(&info->mtd);
+	ret = nand_scan_tail(mtd);
 	if (ret) {
 		return -ENXIO;
 		goto err_set_drvdata;
 	}
 
-	ret = mtd_device_register(&info->mtd, rb750_nand_partitions,
+	ret = mtd_device_register(mtd, rb750_nand_partitions,
 				 ARRAY_SIZE(rb750_nand_partitions));
 	if (ret)
 		goto err_release_nand;
@@ -364,7 +389,7 @@ static int rb750_nand_probe(struct platform_device *pdev)
 	return 0;
 
 err_release_nand:
-	nand_release(&info->mtd);
+	nand_release(mtd);
 err_set_drvdata:
 	platform_set_drvdata(pdev, NULL);
 err_free_info:
@@ -376,7 +401,7 @@ static int rb750_nand_remove(struct platform_device *pdev)
 {
 	struct rb750_nand_info *info = platform_get_drvdata(pdev);
 
-	nand_release(&info->mtd);
+	nand_release(rbinfo_to_mtd(info));
 	platform_set_drvdata(pdev, NULL);
 	kfree(info);
 
diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c
index 15b1816..c808f39 100644
--- a/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c
+++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c
@@ -40,7 +40,9 @@
 
 struct rb91x_nand_info {
 	struct nand_chip chip;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 	struct mtd_info mtd;
+#endif
 	struct device *dev;
 
 	int gpio_nce;
@@ -54,9 +56,25 @@ struct rb91x_nand_info {
 
 static inline struct rb91x_nand_info *mtd_to_rbinfo(struct mtd_info *mtd)
 {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 	return container_of(mtd, struct rb91x_nand_info, mtd);
+#else
+	struct nand_chip *chip = mtd_to_nand(mtd);
+
+	return container_of(chip, struct rb91x_nand_info, chip);
+#endif
 }
 
+static struct mtd_info *rbinfo_to_mtd(struct rb91x_nand_info *nfc)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	return &nfc->mtd;
+#else
+	return nand_to_mtd(&nfc->chip);
+#endif
+}
+
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 /*
  * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader
@@ -340,6 +358,7 @@ static int rb91x_nand_probe(struct platform_device *pdev)
 {
 	struct rb91x_nand_info	*rbni;
 	struct rb91x_nand_platform_data *pdata;
+	struct mtd_info *mtd;
 	int ret;
 
 	pr_info(DRV_DESC "\n");
@@ -362,8 +381,12 @@ static int rb91x_nand_probe(struct platform_device *pdev)
 	rbni->gpio_nle = pdata->gpio_nle;
 
 	rbni->chip.priv	= &rbni;
-	rbni->mtd.priv	= &rbni->chip;
-	rbni->mtd.owner	= THIS_MODULE;
+	mtd = rbinfo_to_mtd(rbni);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
+	mtd->priv	= &rbni->chip;
+#endif
+	mtd->owner	= THIS_MODULE;
 
 	rbni->chip.cmd_ctrl	= rb91x_nand_cmd_ctrl;
 	rbni->chip.dev_ready	= rb91x_nand_dev_ready;
@@ -373,6 +396,9 @@ static int rb91x_nand_probe(struct platform_device *pdev)
 
 	rbni->chip.chip_delay	= 25;
 	rbni->chip.ecc.mode	= NAND_ECC_SOFT;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0)
+	rbni->chip.ecc.algo = NAND_ECC_HAMMING;
+#endif
 	rbni->chip.options = NAND_NO_SUBPAGE_WRITE;
 
 	platform_set_drvdata(pdev, rbni);
@@ -381,22 +407,22 @@ static int rb91x_nand_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = nand_scan_ident(&rbni->mtd, 1, NULL);
+	ret = nand_scan_ident(mtd, 1, NULL);
 	if (ret)
 		return ret;
 
-	if (rbni->mtd.writesize == 512)
+	if (mtd->writesize == 512)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
 		rbni->chip.ecc.layout = &rb91x_nand_ecclayout;
 #else
-		mtd_set_ooblayout(&rbni->mtd, &rb91x_nand_ecclayout_ops);
+		mtd_set_ooblayout(mtd, &rb91x_nand_ecclayout_ops);
 #endif
 
-	ret = nand_scan_tail(&rbni->mtd);
+	ret = nand_scan_tail(mtd);
 	if (ret)
 		return ret;
 
-	ret = mtd_device_register(&rbni->mtd, rb91x_nand_partitions,
+	ret = mtd_device_register(mtd, rb91x_nand_partitions,
 				 ARRAY_SIZE(rb91x_nand_partitions));
 	if (ret)
 		goto err_release_nand;
@@ -404,7 +430,7 @@ static int rb91x_nand_probe(struct platform_device *pdev)
 	return 0;
 
 err_release_nand:
-	nand_release(&rbni->mtd);
+	nand_release(mtd);
 	return ret;
 }
 
@@ -412,7 +438,7 @@ static int rb91x_nand_remove(struct platform_device *pdev)
 {
 	struct rb91x_nand_info *info = platform_get_drvdata(pdev);
 
-	nand_release(&info->mtd);
+	nand_release(rbinfo_to_mtd(info));
 
 	return 0;
 }


From lede-commits at lists.infradead.org  Tue Oct 24 13:21:15 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 16:21:15 -0400
Subject: [source] pending-4.9: 610-netfilter_match_bypass_default_check: fix
 32bit compat layer
In-Reply-To: <20171024202113.12727.87118@git-01.infra.lede-project.org>
References: <20171024202113.12727.87118@git-01.infra.lede-project.org>
Message-ID: <mailman.56380.1508876498.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/5e425ad42445750b3b995a93b3083f41ae381a3f

commit 5e425ad42445750b3b995a93b3083f41ae381a3f
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Tue Oct 24 22:08:54 2017 +0200

    pending-4.9: 610-netfilter_match_bypass_default_check: fix 32bit compat layer
    
    Patch 610-netfilter_match_bypass_default_check added an extra flag IPT_F_NO_DEF_MATCH
    which is copied to user space in function copy_entries_to_user. The 32bit compat
    layer function was missing the same logic to copy the flag IPT_F_NO_DEF_MATCH to
    user space for a 64bit kernel and 32 bit user space.
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
    Signed-off-by: Thierry Dutre <thierry.dutre at dtsystems.be>
---
 ...610-netfilter_match_bypass_default_checks.patch | 25 ++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch
index de17074..6e653ef 100644
--- a/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch
+++ b/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch
@@ -76,11 +76,10 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	counters = alloc_counters(table);
  	if (IS_ERR(counters))
-@@ -850,6 +879,14 @@ copy_entries_to_user(unsigned int total_
- 			ret = -EFAULT;
+@@ -851,6 +880,14 @@ copy_entries_to_user(unsigned int total_
  			goto free_counters;
  		}
-+
+ 
 +		flags = e->ip.flags & IPT_F_MASK;
 +		if (copy_to_user(userptr + off
 +				 + offsetof(struct ipt_entry, ip.flags),
@@ -88,6 +87,24 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +			ret = -EFAULT;
 +			goto free_counters;
 +		}
- 
++
  		for (i = sizeof(struct ipt_entry);
  		     i < e->target_offset;
+ 		     i += m->u.match_size) {
+@@ -1240,12 +1277,15 @@ compat_copy_entry_to_user(struct ipt_ent
+ 	compat_uint_t origsize;
+ 	const struct xt_entry_match *ematch;
+ 	int ret = 0;
++	u8 flags = e->ip.flags & IPT_F_MASK;
+ 
+ 	origsize = *size;
+ 	ce = (struct compat_ipt_entry __user *)*dstptr;
+ 	if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 ||
+ 	    copy_to_user(&ce->counters, &counters[i],
+-	    sizeof(counters[i])) != 0)
++	    sizeof(counters[i])) != 0 ||
++	    copy_to_user(&ce->ip.flags, &flags,
++	    sizeof(flags)) != 0)
+ 		return -EFAULT;
+ 
+ 	*dstptr += sizeof(struct compat_ipt_entry);


From lede-commits at lists.infradead.org  Tue Oct 24 13:21:13 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 16:21:13 -0400
Subject: [source] pending-3.18: 610-netfilter_match_bypass_default_check:
 fix 32bit compat layer
In-Reply-To: <20171024202113.12727.87118@git-01.infra.lede-project.org>
References: <20171024202113.12727.87118@git-01.infra.lede-project.org>
Message-ID: <mailman.56381.1508876498.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/02ccffff3e28b7dd09b8ecc83826e6af7d824c21

commit 02ccffff3e28b7dd09b8ecc83826e6af7d824c21
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Tue Oct 24 16:46:53 2017 +0200

    pending-3.18: 610-netfilter_match_bypass_default_check: fix 32bit compat layer
    
    Patch 610-netfilter_match_bypass_default_check added an extra flag IPT_F_NO_DEF_MATCH
    which is copied to user space in function copy_entries_to_user. The 32bit compat
    layer function was missing the same logic to copy the flag IPT_F_NO_DEF_MATCH to
    user space for a 64bit kernel and 32 bit user space.
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
    Signed-off-by: Thierry Dutre <thierry.dutre at dtsystems.be>
---
 ...610-netfilter_match_bypass_default_checks.patch | 25 ++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch
index 74be425..e5c7a77 100644
--- a/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch
+++ b/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch
@@ -67,11 +67,10 @@
  
  	counters = alloc_counters(table);
  	if (IS_ERR(counters))
-@@ -972,6 +1001,14 @@ copy_entries_to_user(unsigned int total_
- 			ret = -EFAULT;
+@@ -973,6 +1002,14 @@ copy_entries_to_user(unsigned int total_
  			goto free_counters;
  		}
-+
+ 
 +		flags = e->ip.flags & IPT_F_MASK;
 +		if (copy_to_user(userptr + off
 +				 + offsetof(struct ipt_entry, ip.flags),
@@ -79,6 +78,24 @@
 +			ret = -EFAULT;
 +			goto free_counters;
 +		}
- 
++
  		for (i = sizeof(struct ipt_entry);
  		     i < e->target_offset;
+ 		     i += m->u.match_size) {
+@@ -1379,12 +1416,15 @@ compat_copy_entry_to_user(struct ipt_ent
+ 	compat_uint_t origsize;
+ 	const struct xt_entry_match *ematch;
+ 	int ret = 0;
++	u8 flags = e->ip.flags & IPT_F_MASK;
+ 
+ 	origsize = *size;
+ 	ce = (struct compat_ipt_entry __user *)*dstptr;
+ 	if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 ||
+ 	    copy_to_user(&ce->counters, &counters[i],
+-	    sizeof(counters[i])) != 0)
++	    sizeof(counters[i])) != 0 ||
++	    copy_to_user(&ce->ip.flags, &flags,
++	    sizeof(flags)) != 0)
+ 		return -EFAULT;
+ 
+ 	*dstptr += sizeof(struct compat_ipt_entry);


From lede-commits at lists.infradead.org  Tue Oct 24 13:21:14 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 16:21:14 -0400
Subject: [source] pending-4.4: 610-netfilter_match_bypass_default_check: fix
 32bit compat layer
In-Reply-To: <20171024202113.12727.87118@git-01.infra.lede-project.org>
References: <20171024202113.12727.87118@git-01.infra.lede-project.org>
Message-ID: <mailman.56382.1508876502.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/856c53f1751ece9a44ab0b9ed1acb344913bf20c

commit 856c53f1751ece9a44ab0b9ed1acb344913bf20c
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Mon Oct 16 11:29:55 2017 +0200

    pending-4.4: 610-netfilter_match_bypass_default_check: fix 32bit compat layer
    
    Patch 610-netfilter_match_bypass_default_check added an extra flag IPT_F_NO_DEF_MATCH
    which is copied to user space in function copy_entries_to_user. The 32bit compat
    layer function was missing the same logic to copy the flag IPT_F_NO_DEF_MATCH to
    user space for a 64bit kernel and 32 bit user space.
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
    Signed-off-by: Thierry Dutre <thierry.dutre at dtsystems.be>
---
 ...610-netfilter_match_bypass_default_checks.patch | 25 ++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch
index ea9558f..8b96639 100644
--- a/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch
+++ b/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch
@@ -67,11 +67,10 @@
  
  	counters = alloc_counters(table);
  	if (IS_ERR(counters))
-@@ -974,6 +1003,14 @@ copy_entries_to_user(unsigned int total_
- 			ret = -EFAULT;
+@@ -975,6 +1004,14 @@ copy_entries_to_user(unsigned int total_
  			goto free_counters;
  		}
-+
+ 
 +		flags = e->ip.flags & IPT_F_MASK;
 +		if (copy_to_user(userptr + off
 +				 + offsetof(struct ipt_entry, ip.flags),
@@ -79,6 +78,24 @@
 +			ret = -EFAULT;
 +			goto free_counters;
 +		}
- 
++
  		for (i = sizeof(struct ipt_entry);
  		     i < e->target_offset;
+ 		     i += m->u.match_size) {
+@@ -1380,12 +1417,15 @@ compat_copy_entry_to_user(struct ipt_ent
+ 	compat_uint_t origsize;
+ 	const struct xt_entry_match *ematch;
+ 	int ret = 0;
++	u8 flags = e->ip.flags & IPT_F_MASK;
+ 
+ 	origsize = *size;
+ 	ce = (struct compat_ipt_entry __user *)*dstptr;
+ 	if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 ||
+ 	    copy_to_user(&ce->counters, &counters[i],
+-	    sizeof(counters[i])) != 0)
++	    sizeof(counters[i])) != 0 ||
++	    copy_to_user(&ce->ip.flags, &flags,
++	    sizeof(flags)) != 0)
+ 		return -EFAULT;
+ 
+ 	*dstptr += sizeof(struct compat_ipt_entry);


From lede-commits at lists.infradead.org  Tue Oct 24 16:45:58 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 19:45:58 -0400
Subject: [source]  uml: Switch to 4.9 kernel
In-Reply-To: <20171024234557.21117.4377@git-01.infra.lede-project.org>
References: <20171024234557.21117.4377@git-01.infra.lede-project.org>
Message-ID: <mailman.56403.1508888787.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/bb71847da5a1b69a3080c580ba104276c432a334

commit bb71847da5a1b69a3080c580ba104276c432a334
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Tue Oct 24 15:10:05 2017 -0700

    uml: Switch to 4.9 kernel
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 target/linux/uml/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile
index 6967e40..0b46032 100644
--- a/target/linux/uml/Makefile
+++ b/target/linux/uml/Makefile
@@ -22,7 +22,7 @@ BOARDNAME:=User Mode Linux
 FEATURES:=squashfs ext4 audio source-only
 MAINTAINER:=Florian Fainelli <florian at openwrt.org>
 
-KERNEL_PATCHVER:=4.4
+KERNEL_PATCHVER:=4.9
 
 include $(INCLUDE_DIR)/target.mk
 


From lede-commits at lists.infradead.org  Tue Oct 24 16:45:57 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 19:45:57 -0400
Subject: [source]  uml: Add 4.9 kernel patches
In-Reply-To: <20171024234557.21117.4377@git-01.infra.lede-project.org>
References: <20171024234557.21117.4377@git-01.infra.lede-project.org>
Message-ID: <mailman.56404.1508888789.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/fd75e4d264d305347647a29ae2dab56c9f3967c9

commit fd75e4d264d305347647a29ae2dab56c9f3967c9
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Sun Oct 22 14:56:12 2017 -0700

    uml: Add 4.9 kernel patches
    
    102-pseudo-random-mac.patch required an update to the new style asynchronous
    crypto
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 ...ngjmp-setjmp-symbol-clashes-with-libpthre.patch | 130 +++++++++++++
 ...Allow-building-and-running-on-older-hosts.patch |  99 ++++++++++
 ...ectly-check-for-PTRACE_GETRESET-SETREGSET.patch |  29 +++
 ...-um-Fix-check-for-_xstate-for-older-hosts.patch |  46 +++++
 .../linux/uml/patches-4.9/101-mconsole-exec.patch  | 211 +++++++++++++++++++++
 .../uml/patches-4.9/102-pseudo-random-mac.patch    | 131 +++++++++++++
 6 files changed, 646 insertions(+)

diff --git a/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch b/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch
new file mode 100644
index 0000000..02149ee
--- /dev/null
+++ b/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch
@@ -0,0 +1,130 @@
+From f44f1e7da7c8e3f4575d5d61c4df978496903fcc Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Tue, 23 May 2017 17:32:31 -0700
+Subject: [PATCH] um: Avoid longjmp/setjmp symbol clashes with libpthread.a
+
+[ Upstream commit f44f1e7da7c8e3f4575d5d61c4df978496903fcc ]
+
+Building a statically linked UML kernel on a Centos 6.9 host resulted in
+the following linking failure (GCC 4.4, glibc-2.12):
+
+/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o):
+In function `siglongjmp':
+(.text+0x8490): multiple definition of `longjmp'
+arch/x86/um/built-in.o:/local/users/fainelli/openwrt/trunk/build_dir/target-x86_64_musl/linux-uml/linux-4.4.69/arch/x86/um/setjmp_64.S:44:
+first defined here
+/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o):
+In function `sem_open':
+(.text+0x77cd): warning: the use of `mktemp' is dangerous, better use
+`mkstemp'
+collect2: ld returned 1 exit status
+make[4]: *** [vmlinux] Error 1
+
+Adopt a solution similar to the one done for vmap where we define
+longjmp/setjmp to be kernel_longjmp/setjmp. In the process, make sure we
+do rename the functions in arch/x86/um/setjmp_*.S accordingly.
+
+Fixes: a7df4716d195 ("um: link with -lpthread")
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+ arch/um/Makefile        |  4 ++++
+ arch/x86/um/setjmp_32.S | 16 ++++++++--------
+ arch/x86/um/setjmp_64.S | 16 ++++++++--------
+ 3 files changed, 20 insertions(+), 16 deletions(-)
+
+--- a/arch/um/Makefile
++++ b/arch/um/Makefile
+@@ -59,10 +59,14 @@ KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_D
+ # Same things for in6addr_loopback and mktime - found in libc. For these two we
+ # only get link-time error, luckily.
+ #
++# -Dlongjmp=kernel_longjmp prevents anything from referencing the libpthread.a
++# embedded copy of longjmp, same thing for setjmp.
++#
+ # These apply to USER_CFLAGS to.
+ 
+ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
+ 	$(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap	\
++	-Dlongjmp=kernel_longjmp -Dsetjmp=kernel_setjmp \
+ 	-Din6addr_loopback=kernel_in6addr_loopback \
+ 	-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
+ 
+--- a/arch/x86/um/setjmp_32.S
++++ b/arch/x86/um/setjmp_32.S
+@@ -16,9 +16,9 @@
+ 
+ 	.text
+ 	.align 4
+-	.globl setjmp
+-	.type setjmp, @function
+-setjmp:
++	.globl kernel_setjmp
++	.type kernel_setjmp, @function
++kernel_setjmp:
+ #ifdef _REGPARM
+ 	movl %eax,%edx
+ #else
+@@ -35,13 +35,13 @@ setjmp:
+ 	movl %ecx,20(%edx)		# Return address
+ 	ret
+ 
+-	.size setjmp,.-setjmp
++	.size kernel_setjmp,.-kernel_setjmp
+ 
+ 	.text
+ 	.align 4
+-	.globl longjmp
+-	.type longjmp, @function
+-longjmp:
++	.globl kernel_longjmp
++	.type kernel_longjmp, @function
++kernel_longjmp:
+ #ifdef _REGPARM
+ 	xchgl %eax,%edx
+ #else
+@@ -55,4 +55,4 @@ longjmp:
+ 	movl 16(%edx),%edi
+ 	jmp *20(%edx)
+ 
+-	.size longjmp,.-longjmp
++	.size kernel_longjmp,.-kernel_longjmp
+--- a/arch/x86/um/setjmp_64.S
++++ b/arch/x86/um/setjmp_64.S
+@@ -18,9 +18,9 @@
+ 
+ 	.text
+ 	.align 4
+-	.globl setjmp
+-	.type setjmp, @function
+-setjmp:
++	.globl kernel_setjmp
++	.type kernel_setjmp, @function
++kernel_setjmp:
+ 	pop  %rsi			# Return address, and adjust the stack
+ 	xorl %eax,%eax			# Return value
+ 	movq %rbx,(%rdi)
+@@ -34,13 +34,13 @@ setjmp:
+ 	movq %rsi,56(%rdi)		# Return address
+ 	ret
+ 
+-	.size setjmp,.-setjmp
++	.size kernel_setjmp,.-kernel_setjmp
+ 
+ 	.text
+ 	.align 4
+-	.globl longjmp
+-	.type longjmp, @function
+-longjmp:
++	.globl kernel_longjmp
++	.type kernel_longjmp, @function
++kernel_longjmp:
+ 	movl %esi,%eax			# Return value (int)
+ 	movq (%rdi),%rbx
+ 	movq 8(%rdi),%rsp
+@@ -51,4 +51,4 @@ longjmp:
+ 	movq 48(%rdi),%r15
+ 	jmp *56(%rdi)
+ 
+-	.size longjmp,.-longjmp
++	.size kernel_longjmp,.-kernel_longjmp
diff --git a/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch b/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch
new file mode 100644
index 0000000..9de557b
--- /dev/null
+++ b/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch
@@ -0,0 +1,99 @@
+From 0a987645672ebde7844a9c0732a5a25f3d4bb6c6 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Thu, 25 May 2017 11:36:26 -0700
+Subject: [PATCH] um: Allow building and running on older hosts
+
+[ Upstream commit 0a987645672ebde7844a9c0732a5a25f3d4bb6c6 ]
+
+Commit a78ff1112263 ("um: add extended processor state save/restore
+support") and b6024b21fec8 ("um: extend fpstate to _xstate to support
+YMM registers") forced the use of the x86 FP _xstate and
+PTRACE_GETREGSET/SETREGSET. On older hosts, we would neither be able to
+build UML nor run it anymore with these two commits applied because we
+don't have definitions for struct _xstate nor these two ptrace requests.
+
+We can determine at build time which fp context structure to check
+against, just like we can keep using the old i387 fp save/restore if
+PTRACE_GETRESET/SETREGSET are not defined.
+
+Fixes: a78ff1112263 ("um: add extended processor state save/restore support")
+Fixes: b6024b21fec8 ("um: extend fpstate to _xstate to support YMM registers")
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+ arch/x86/um/os-Linux/registers.c | 12 ++++++++----
+ arch/x86/um/user-offsets.c       |  4 ++++
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+--- a/arch/x86/um/os-Linux/registers.c
++++ b/arch/x86/um/os-Linux/registers.c
+@@ -26,6 +26,7 @@ int save_i387_registers(int pid, unsigne
+ 
+ int save_fp_registers(int pid, unsigned long *fp_regs)
+ {
++#ifdef PTRACE_GETREGSET
+ 	struct iovec iov;
+ 
+ 	if (have_xstate_support) {
+@@ -34,9 +35,9 @@ int save_fp_registers(int pid, unsigned 
+ 		if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0)
+ 			return -errno;
+ 		return 0;
+-	} else {
++	} else
++#endif
+ 		return save_i387_registers(pid, fp_regs);
+-	}
+ }
+ 
+ int restore_i387_registers(int pid, unsigned long *fp_regs)
+@@ -48,6 +49,7 @@ int restore_i387_registers(int pid, unsi
+ 
+ int restore_fp_registers(int pid, unsigned long *fp_regs)
+ {
++#ifdef PTRACE_SETREGSET
+ 	struct iovec iov;
+ 
+ 	if (have_xstate_support) {
+@@ -56,9 +58,9 @@ int restore_fp_registers(int pid, unsign
+ 		if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0)
+ 			return -errno;
+ 		return 0;
+-	} else {
++	} else
++#endif
+ 		return restore_i387_registers(pid, fp_regs);
+-	}
+ }
+ 
+ #ifdef __i386__
+@@ -122,6 +124,7 @@ int put_fp_registers(int pid, unsigned l
+ 
+ void arch_init_registers(int pid)
+ {
++#ifdef PTRACE_GETREGSET
+ 	struct _xstate fp_regs;
+ 	struct iovec iov;
+ 
+@@ -129,6 +132,7 @@ void arch_init_registers(int pid)
+ 	iov.iov_len = sizeof(struct _xstate);
+ 	if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) == 0)
+ 		have_xstate_support = 1;
++#endif
+ }
+ #endif
+ 
+--- a/arch/x86/um/user-offsets.c
++++ b/arch/x86/um/user-offsets.c
+@@ -50,7 +50,11 @@ void foo(void)
+ 	DEFINE(HOST_GS, GS);
+ 	DEFINE(HOST_ORIG_AX, ORIG_EAX);
+ #else
++#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET)
+ 	DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long));
++#else
++	DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
++#endif
+ 	DEFINE_LONGS(HOST_BX, RBX);
+ 	DEFINE_LONGS(HOST_CX, RCX);
+ 	DEFINE_LONGS(HOST_DI, RDI);
diff --git a/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch b/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch
new file mode 100644
index 0000000..79beb82
--- /dev/null
+++ b/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch
@@ -0,0 +1,29 @@
+From 61e8d462457f202bf0c6393133425ad387825e22 Mon Sep 17 00:00:00 2001
+From: Richard Weinberger <richard at nod.at>
+Date: Thu, 6 Jul 2017 09:35:27 +0200
+Subject: [PATCH] um: Correctly check for PTRACE_GETRESET/SETREGSET
+
+[ Upstream commit 61e8d462457f202bf0c6393133425ad387825e22 ]
+
+When checking for PTRACE_GETRESET/SETREGSET, make sure that
+the correct header file is included. We need linux/ptrace.h
+which contains all ptrace UAPI related defines.
+Otherwise #if defined(PTRACE_GETRESET) is always false.
+
+Cc: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+ arch/x86/um/user-offsets.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/um/user-offsets.c
++++ b/arch/x86/um/user-offsets.c
+@@ -5,7 +5,7 @@
+ #include <sys/mman.h>
+ #include <sys/user.h>
+ #define __FRAME_OFFSETS
+-#include <asm/ptrace.h>
++#include <linux/ptrace.h>
+ #include <asm/types.h>
+ 
+ #ifdef __i386__
diff --git a/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch
new file mode 100644
index 0000000..b31ca41
--- /dev/null
+++ b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch
@@ -0,0 +1,46 @@
+From 2fb44600fe784449404c6639de26af8361999ec7 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Tue, 18 Jul 2017 16:43:47 -0700
+Subject: [PATCH] um: Fix check for _xstate for older hosts
+
+Commit 0a987645672e ("um: Allow building and running on older
+hosts") attempted to check for PTRACE_{GET,SET}REGSET under the premise
+that these ptrace(2) parameters were directly linked with the presence
+of the _xstate structure.
+
+After Richard's commit 61e8d462457f ("um: Correctly check for
+PTRACE_GETRESET/SETREGSET") which properly included linux/ptrace.h
+instead of asm/ptrace.h, we could get into the original build failure
+that I reported:
+
+arch/x86/um/user-offsets.c: In function 'foo':
+arch/x86/um/user-offsets.c:54: error: invalid application of 'sizeof' to
+incomplete type 'struct _xstate'
+
+On this particular host, we do have PTRACE_GETREGSET and
+PTRACE_SETREGSET defined in linux/ptrace.h, but not the structure
+_xstate that should be pulled from the following include chain: signal.h
+-> bits/sigcontext.h.
+
+Correctly fix this by checking for FP_XSTATE_MAGIC1 which is the correct
+way to see if struct _xstate is available or not on the host.
+
+Fixes: 61e8d462457f ("um: Correctly check for PTRACE_GETRESET/SETREGSET")
+Fixes: 0a987645672e ("um: Allow building and running on older hosts")
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Richard Weinberger <richard at nod.at>
+---
+ arch/x86/um/user-offsets.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/um/user-offsets.c
++++ b/arch/x86/um/user-offsets.c
+@@ -50,7 +50,7 @@ void foo(void)
+ 	DEFINE(HOST_GS, GS);
+ 	DEFINE(HOST_ORIG_AX, ORIG_EAX);
+ #else
+-#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET)
++#ifdef FP_XSTATE_MAGIC1
+ 	DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long));
+ #else
+ 	DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long));
diff --git a/target/linux/uml/patches-4.9/101-mconsole-exec.patch b/target/linux/uml/patches-4.9/101-mconsole-exec.patch
new file mode 100644
index 0000000..6682338
--- /dev/null
+++ b/target/linux/uml/patches-4.9/101-mconsole-exec.patch
@@ -0,0 +1,211 @@
+#
+# Minimalist mconsole exec patch 
+#
+# 3.10 version (with bit more synchronous behavior) by fingon at iki dot fi
+# Adaptation to kernel 3.3.8 made by David Fern?ndez (david at dit.upm.es) for 
+# Starting point: mconsole-exec-2.6.30.patch for kernel 2.6.30
+# Author of original patch: Paolo Giarrusso, aka Blaisorblade 
+#                           (http://www.user-mode-linux.org/~blaisorblade)
+#
+# Known misfeatures:
+#
+# - If output is too long, blocks (and breaks horribly) 
+# (this misfeature from 3.10 patches, when minimalizing the patch;
+#  workaround: redirect to a shared filesystem if long output is expected)
+#
+# - Nothing useful is done with stdin
+#
+--- a/arch/um/drivers/mconsole.h
++++ b/arch/um/drivers/mconsole.h
+@@ -85,6 +85,7 @@ extern void mconsole_cad(struct mc_reque
+ extern void mconsole_stop(struct mc_request *req);
+ extern void mconsole_go(struct mc_request *req);
+ extern void mconsole_log(struct mc_request *req);
++extern void mconsole_exec(struct mc_request *req);
+ extern void mconsole_proc(struct mc_request *req);
+ extern void mconsole_stack(struct mc_request *req);
+ 
+--- a/arch/um/drivers/mconsole_kern.c
++++ b/arch/um/drivers/mconsole_kern.c
+@@ -4,6 +4,7 @@
+  * Licensed under the GPL
+  */
+ 
++#include "linux/kmod.h"
+ #include <linux/console.h>
+ #include <linux/ctype.h>
+ #include <linux/string.h>
+@@ -24,6 +25,7 @@
+ #include <linux/fs.h>
+ #include <linux/mount.h>
+ #include <linux/file.h>
++#include <linux/completion.h>
+ #include <asm/uaccess.h>
+ #include <asm/switch_to.h>
+ 
+@@ -121,6 +123,59 @@ void mconsole_log(struct mc_request *req
+ 	mconsole_reply(req, "", 0, 0);
+ }
+ 
++void mconsole_exec(struct mc_request *req)
++{
++  struct subprocess_info *sub_info;
++  int res, len;
++  struct file *out;
++  char buf[MCONSOLE_MAX_DATA];
++
++  char *envp[] = {
++    "HOME=/", "TERM=linux",
++    "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin",
++    NULL
++  };
++  char *argv[] = {
++    "/bin/sh", "-c",
++    req->request.data + strlen("exec "),
++    NULL
++  };
++
++  sub_info = call_usermodehelper_setup("/bin/sh", argv, envp, GFP_ATOMIC, NULL, NULL, NULL);
++  if (sub_info == NULL) {
++    mconsole_reply(req, "call_usermodehelper_setup failed", 1, 0);
++    return;
++  }
++  res = call_usermodehelper_stdoutpipe(sub_info, &out);
++  if (res < 0) {
++    kfree(sub_info);
++    mconsole_reply(req, "call_usermodehelper_stdoutpipe failed", 1, 0);
++    return;
++  }
++
++  res = call_usermodehelper_exec(sub_info, UMH_WAIT_PROC);
++  if (res < 0) {
++    kfree(sub_info);
++    mconsole_reply(req, "call_usermodehelper_exec failed", 1, 0);
++    return;
++  }
++
++  for (;;) {
++    len = out->f_op->read(out, buf, sizeof(buf), &out->f_pos);
++    if (len < 0) {
++      mconsole_reply(req, "reading output failed", 1, 0);
++      break;
++    }
++    if (len == 0)
++      break;
++    mconsole_reply_len(req, buf, len, 0, 1);
++  }
++  fput(out);
++
++  mconsole_reply_len(req, NULL, 0, 0, 0);
++}
++
++
+ void mconsole_proc(struct mc_request *req)
+ {
+ 	struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt;
+@@ -187,6 +242,7 @@ void mconsole_proc(struct mc_request *re
+     stop - pause the UML; it will do nothing until it receives a 'go' \n\
+     go - continue the UML after a 'stop' \n\
+     log <string> - make UML enter <string> into the kernel log\n\
++    exec <string> - pass <string> to /bin/sh -c synchronously\n\
+     proc <file> - returns the contents of the UML's /proc/<file>\n\
+     stack <pid> - returns the stack of the specified pid\n\
+ "
+--- a/arch/um/drivers/mconsole_user.c
++++ b/arch/um/drivers/mconsole_user.c
+@@ -30,6 +30,7 @@ static struct mconsole_command commands[
+ 	{ "stop", mconsole_stop, MCONSOLE_PROC },
+ 	{ "go", mconsole_go, MCONSOLE_INTR },
+ 	{ "log", mconsole_log, MCONSOLE_INTR },
++	{ "exec", mconsole_exec, MCONSOLE_PROC },
+ 	{ "proc", mconsole_proc, MCONSOLE_PROC },
+ 	{ "stack", mconsole_stack, MCONSOLE_INTR },
+ };
+--- a/arch/um/os-Linux/file.c
++++ b/arch/um/os-Linux/file.c
+@@ -554,6 +554,8 @@ int os_create_unix_socket(const char *fi
+ 
+ 	addr.sun_family = AF_UNIX;
+ 
++	if (len > sizeof(addr.sun_path))
++		len = sizeof(addr.sun_path);
+ 	snprintf(addr.sun_path, len, "%s", file);
+ 
+ 	err = bind(sock, (struct sockaddr *) &addr, sizeof(addr));
+--- a/include/linux/kmod.h
++++ b/include/linux/kmod.h
+@@ -62,6 +62,7 @@ struct subprocess_info {
+ 	int wait;
+ 	int retval;
+ 	int (*init)(struct subprocess_info *info, struct cred *new);
++	struct file *stdout;
+ 	void (*cleanup)(struct subprocess_info *info);
+ 	void *data;
+ };
+@@ -102,4 +103,6 @@ extern int usermodehelper_read_trylock(v
+ extern long usermodehelper_read_lock_wait(long timeout);
+ extern void usermodehelper_read_unlock(void);
+ 
++int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, struct file **filp);
++
+ #endif /* __LINUX_KMOD_H__ */
+--- a/kernel/kmod.c
++++ b/kernel/kmod.c
+@@ -39,6 +39,7 @@
+ #include <linux/rwsem.h>
+ #include <linux/ptrace.h>
+ #include <linux/async.h>
++#include <linux/pipe_fs_i.h>
+ #include <asm/uaccess.h>
+ 
+ #include <trace/events/module.h>
+@@ -222,6 +223,28 @@ static int call_usermodehelper_exec_asyn
+ 	flush_signal_handlers(current, 1);
+ 	spin_unlock_irq(&current->sighand->siglock);
+ 
++	/* Install output when needed */
++	if (sub_info->stdout) {
++		struct files_struct *f = current->files;
++		struct fdtable *fdt;
++
++		sys_close(1);
++		sys_close(2);
++		get_file(sub_info->stdout);
++		fd_install(1, sub_info->stdout);
++		fd_install(2, sub_info->stdout);
++		spin_lock(&f->file_lock);
++		fdt = files_fdtable(f);
++		__set_bit(1, fdt->open_fds);
++		__clear_bit(1, fdt->close_on_exec);
++		__set_bit(2, fdt->open_fds);
++		__clear_bit(2, fdt->close_on_exec);
++		spin_unlock(&f->file_lock);
++
++		/* disallow core files */
++		current->signal->rlim[RLIMIT_CORE] = (struct rlimit){0, 0};
++	}
++
+ 	/*
+ 	 * Our parent (unbound workqueue) runs with elevated scheduling
+ 	 * priority. Avoid propagating that into the userspace child.
+@@ -540,6 +563,20 @@ struct subprocess_info *call_usermodehel
+ }
+ EXPORT_SYMBOL(call_usermodehelper_setup);
+ 
++int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info,
++                                 struct file **filp)
++{
++  struct file *f[2];
++
++  if (create_pipe_files(f, 0)<0)
++    return PTR_ERR(f);
++  sub_info->stdout = f[1];
++  *filp = f[0];
++  return 0;
++}
++EXPORT_SYMBOL(call_usermodehelper_stdoutpipe);
++
++
+ /**
+  * call_usermodehelper_exec - start a usermode application
+  * @sub_info: information about the subprocessa
diff --git a/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch b/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch
new file mode 100644
index 0000000..a31d75f
--- /dev/null
+++ b/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch
@@ -0,0 +1,131 @@
+===============================================================================
+
+This patch makes MAC addresses of network interfaces predictable. In
+particular, it adds a small routine that computes MAC addresses of based on
+a SHA1 hash of the virtual machine name and interface ID.
+
+TECHNICAL INFORMATION:
+
+Applies to vanilla kernel 3.9.4.
+
+===============================================================================
+--- a/arch/um/Kconfig.net
++++ b/arch/um/Kconfig.net
+@@ -21,6 +21,19 @@ config UML_NET
+         enable at least one of the following transport options to actually
+         make use of UML networking.
+ 
++config UML_NET_RANDOM_MAC
++	bool "Use random MAC addresses for network interfaces"
++	default n
++	depends on UML_NET
++	help
++        Virtual network devices inside a User-Mode Linux instance must be
++        assigned a MAC (Ethernet) address. If none is specified on the UML
++        command line, one must be automatically computed. If this option is
++        enabled, a randomly generated address is used. Otherwise, if this
++        option is disabled, the address is generated from a SHA1 hash of
++        the umid of the UML instance and the interface name. The latter choice
++        is useful to make MAC addresses predictable.
++
+ config UML_NET_ETHERTAP
+ 	bool "Ethertap transport"
+ 	depends on UML_NET
+--- a/arch/um/drivers/net_kern.c
++++ b/arch/um/drivers/net_kern.c
+@@ -25,6 +25,14 @@
+ #include <net_kern.h>
+ #include <net_user.h>
+ 
++#include <crypto/sha.h>
++#include <crypto/hash.h>
++#include <linux/string.h>
++#include <linux/crypto.h>
++#include <linux/err.h>
++#include <linux/scatterlist.h>
++#include "os.h"
++
+ #define DRIVER_NAME "uml-netdev"
+ 
+ static DEFINE_SPINLOCK(opened_lock);
+@@ -295,11 +303,53 @@ static void uml_net_user_timer_expire(un
+ #endif
+ }
+ 
++#ifndef CONFIG_UML_NET_RANDOM_MAC
++
++/* Compute a SHA1 hash of the UML instance's id and
++ *  * an interface name. */
++static int compute_hash(const char *umid, const char *ifname, char *hash)
++{
++	struct ahash_request *desc;
++	struct crypto_ahash *tfm;
++	struct scatterlist sg;
++	char vmif[1024];
++	int ret;
++
++	strcpy (vmif, umid);
++	strcat (vmif, ifname);
++
++	tfm = crypto_alloc_ahash("sha1", 0, CRYPTO_ALG_ASYNC);
++	if (IS_ERR(tfm))
++		return -ENOMEM;
++
++	desc = ahash_request_alloc(tfm, GFP_KERNEL);
++	if (!desc) {
++		ret = -ENOMEM;
++		goto out;
++	}
++
++	crypto_ahash_clear_flags(tfm, ~0);
++
++	sg_init_table(&sg, 1);
++	sg_set_buf(&sg, vmif, strlen(vmif));
++
++	ahash_request_set_crypt(desc, &sg, hash, strlen(vmif));
++
++	ret = crypto_ahash_digest(desc);
++out:
++	crypto_free_ahash(tfm);
++
++	return ret;
++}
++
++#endif
++
+ static void setup_etheraddr(struct net_device *dev, char *str)
+ {
+ 	unsigned char *addr = dev->dev_addr;
+ 	char *end;
+ 	int i;
++	u8 hash[SHA1_DIGEST_SIZE];
+ 
+ 	if (str == NULL)
+ 		goto random;
+@@ -340,9 +390,26 @@ static void setup_etheraddr(struct net_d
+ 	return;
+ 
+ random:
++#ifdef CONFIG_UML_NET_RANDOM_MAC
+ 	printk(KERN_INFO
+ 	       "Choosing a random ethernet address for device %s\n", dev->name);
+ 	eth_hw_addr_random(dev);
++#else
++	printk(KERN_INFO
++	       "Computing a digest to use as ethernet address for device %s\n", dev->name);
++	if (compute_hash(get_umid(), dev->name, hash) < 0) {
++		printk(KERN_WARNING
++		       "Could not compute digest to use as ethernet address for device %s. "
++		       "Using random address instead.\n", dev->name);
++		random_ether_addr(addr);
++	}
++	else {
++		for (i=0; i < 6; i++)
++			addr[i] = (hash[i] + hash[i+6]) % 0x100;
++	}
++	addr [0] &= 0xfe; /* clear multicast bit */
++	addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
++#endif
+ }
+ 
+ static DEFINE_SPINLOCK(devices_lock);


From lede-commits at lists.infradead.org  Tue Oct 24 17:02:36 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 20:02:36 -0400
Subject: [source]  include: Silence external kernel version checks
In-Reply-To: <20171025000236.24220.25411@git-01.infra.lede-project.org>
References: <20171025000236.24220.25411@git-01.infra.lede-project.org>
Message-ID: <mailman.56407.1508889779.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/474391573bbd9720a58b6fcd725896f85113e4ec

commit 474391573bbd9720a58b6fcd725896f85113e4ec
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Tue Oct 24 16:59:15 2017 -0700

    include: Silence external kernel version checks
    
    During the initial configuration phases, we have not set-up the kernel
    source directory, which would lead to such messages:
    
    cat:
    /local/users/fainelli/openwrt/trunk/build_dir/target-x86_64_musl/linux-uml/linux-4.9.58/include/config/kernel.release:
    No such file or directory
    
    Just silence it, since it does not create a functional problem.
    
    Fixes: 8e0e0e7d8bfb ("include: Determine MODULES_DIR correctly for external/git kernels")
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 include/kernel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index a84c755..75797cf 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -64,7 +64,7 @@ else
   ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
       LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING)
   else
-      LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release))
+      LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null))
   endif
 
   MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)


From lede-commits at lists.infradead.org  Tue Oct 24 18:39:40 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 21:39:40 -0400
Subject: [source]  bcm53xx: Fix Generic profile description
In-Reply-To: <20171025013938.8474.78126@git-01.infra.lede-project.org>
References: <20171025013938.8474.78126@git-01.infra.lede-project.org>
Message-ID: <mailman.56458.1508895608.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/5df1f4113bd89542a804308d5890823876878918

commit 5df1f4113bd89542a804308d5890823876878918
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Tue Oct 24 18:08:25 2017 -0700

    bcm53xx: Fix Generic profile description
    
    Fix the sentence describing the bcm53xx generic profile.
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 target/linux/bcm53xx/profiles/100-Generic.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/linux/bcm53xx/profiles/100-Generic.mk b/target/linux/bcm53xx/profiles/100-Generic.mk
index d7e9005..b572586 100644
--- a/target/linux/bcm53xx/profiles/100-Generic.mk
+++ b/target/linux/bcm53xx/profiles/100-Generic.mk
@@ -11,8 +11,9 @@ define Profile/Generic
 endef
 
 define Profile/Generic/Description
-	Package set compatible with hardware any Broadcom BCM47xx or BCM535x 
-	SoC with a ARM CPU like the BCM4707, BCM4708, BCM4709, BCM53010
+	Package set compatible with any hardware using Broadcom BCM47xx or
+	BCM535x SoCs with an ARM CPU like the BCM4707, BCM4708, BCM4709,
+	BCM53010
 endef
 
 $(eval $(call Profile,Generic))


From lede-commits at lists.infradead.org  Tue Oct 24 18:39:39 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 21:39:39 -0400
Subject: [source]  orion: Switch to 4.9 kernel
In-Reply-To: <20171025013938.8474.78126@git-01.infra.lede-project.org>
References: <20171025013938.8474.78126@git-01.infra.lede-project.org>
Message-ID: <mailman.56459.1508895610.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/9a6e2d7d09a5c0882c8e3b0a401e79fca30d98fb

commit 9a6e2d7d09a5c0882c8e3b0a401e79fca30d98fb
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Tue Oct 24 17:46:15 2017 -0700

    orion: Switch to 4.9 kernel
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 target/linux/orion/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/orion/Makefile b/target/linux/orion/Makefile
index 5a54100..07583e4 100644
--- a/target/linux/orion/Makefile
+++ b/target/linux/orion/Makefile
@@ -13,7 +13,7 @@ FEATURES:=broken rtc
 SUBTARGETS:=generic harddisk
 MAINTAINER:=Imre Kaloz <kaloz at openwrt.org>
 
-KERNEL_PATCHVER:=4.4
+KERNEL_PATCHVER:=4.9
 
 include $(INCLUDE_DIR)/target.mk
 


From lede-commits at lists.infradead.org  Tue Oct 24 18:39:38 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 24 Oct 2017 21:39:38 -0400
Subject: [source]  orion: Add support for 4.9 kernel
In-Reply-To: <20171025013938.8474.78126@git-01.infra.lede-project.org>
References: <20171025013938.8474.78126@git-01.infra.lede-project.org>
Message-ID: <mailman.56460.1508895616.26984.lede-commits@lists.infradead.org>

florian pushed a commit to source.git, branch master:
https://git.lede-project.org/124cf53c872dbaf2212db6cd3e7446f0fa35a63f

commit 124cf53c872dbaf2212db6cd3e7446f0fa35a63f
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Tue Oct 24 17:46:02 2017 -0700

    orion: Add support for 4.9 kernel
    
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 target/linux/orion/config-4.9                      | 246 +++++++++
 .../patches-4.9/000-arm_openwrt_machtypes.patch    |   8 +
 .../100-wrt350nv2_openwrt_partition_map.patch      |  32 ++
 .../patches-4.9/101-wnr854t_partition_map.patch    |  25 +
 .../orion/patches-4.9/200-dt2_board_support.patch  | 562 +++++++++++++++++++++
 .../orion/patches-4.9/210-wn802t_support.patch     |  73 +++
 6 files changed, 946 insertions(+)

diff --git a/target/linux/orion/config-4.9 b/target/linux/orion/config-4.9
new file mode 100644
index 0000000..56ae5ee
--- /dev/null
+++ b/target/linux/orion/config-4.9
@@ -0,0 +1,246 @@
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+# CONFIG_ARCH_HAS_SG_CHAIN is not set
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_ARCH_MULTI_V4 is not set
+# CONFIG_ARCH_MULTI_V4T is not set
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_ARCH_ORION5X=y
+# CONFIG_ARCH_ORION5X_DT is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_ARM=y
+# CONFIG_ARM_CPU_SUSPEND is not set
+CONFIG_ARM_L1_CACHE_SHIFT=5
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+# CONFIG_ARM_THUMB is not set
+CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200 earlyprintk"
+CONFIG_CMDLINE_FORCE=y
+CONFIG_COMMON_CLK=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_FEROCEON=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_FEROCEON=y
+CONFIG_CPU_FEROCEON_OLD_ID=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_CPU_PABRT_LEGACY=y
+CONFIG_CPU_TLB_FEROCEON=y
+CONFIG_CPU_USE_DOMAINS=y
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
+CONFIG_DEBUG_LL_UART_8250=y
+CONFIG_DEBUG_UART_8250=y
+# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
+CONFIG_DEBUG_UART_8250_SHIFT=2
+# CONFIG_DEBUG_UART_8250_WORD is not set
+CONFIG_DEBUG_UART_PHYS=0xf1012000
+CONFIG_DEBUG_UART_VIRT=0xfe012000
+# CONFIG_DEBUG_USER is not set
+CONFIG_DMADEVICES=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_ENGINE_RAID=y
+CONFIG_DMA_OF=y
+CONFIG_DNOTIFY=y
+CONFIG_DTC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_FIXED_PHY=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_FRAME_POINTER=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_DEVRES=y
+CONFIG_GPIO_MVEBU=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+# CONFIG_HAVE_ARCH_BITREVERSE is not set
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_PFN_VALID=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_BPF_JIT=y
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_UID16=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_PERIODIC=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MV64XXX=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_IOMMU_HELPER=y
+CONFIG_IRQCHIP=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LIBFDT=y
+# CONFIG_MACH_D2NET_DT is not set
+# CONFIG_MACH_DB88F5281 is not set
+# CONFIG_MACH_DNS323 is not set
+# CONFIG_MACH_DT2 is not set
+# CONFIG_MACH_KUROBOX_PRO is not set
+# CONFIG_MACH_LINKSTATION_LSCHL is not set
+# CONFIG_MACH_LINKSTATION_LS_HGL is not set
+# CONFIG_MACH_LINKSTATION_MINI is not set
+# CONFIG_MACH_LINKSTATION_PRO is not set
+# CONFIG_MACH_MSS2_DT is not set
+# CONFIG_MACH_MV2120 is not set
+# CONFIG_MACH_NET2BIG is not set
+# CONFIG_MACH_RD88F5181L_FXO is not set
+# CONFIG_MACH_RD88F5181L_GE is not set
+# CONFIG_MACH_RD88F5182 is not set
+# CONFIG_MACH_RD88F5182_DT is not set
+# CONFIG_MACH_RD88F6183AP_GE is not set
+CONFIG_MACH_TERASTATION_PRO2=y
+# CONFIG_MACH_TS209 is not set
+# CONFIG_MACH_TS409 is not set
+# CONFIG_MACH_TS78XX is not set
+CONFIG_MACH_WN802T=y
+CONFIG_MACH_WNR854T=y
+CONFIG_MACH_WRT350N_V2=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MMC=y
+CONFIG_MMC_MVSDIO=y
+# CONFIG_MMC_TIFM_SD is not set
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MULTI_IRQ_HANDLER=y
+CONFIG_MV643XX_ETH=y
+CONFIG_MVEBU_MBUS=y
+CONFIG_MVMDIO=y
+# CONFIG_MVNETA is not set
+CONFIG_MV_XOR=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_KUSER_HELPERS=y
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_NET_VENDOR_AURORA is not set
+CONFIG_NO_BOOTMEM=y
+CONFIG_OF=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_ADDRESS_PCI=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_GPIO=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_MTD=y
+CONFIG_OF_NET=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_OF_RESERVED_MEM=y
+CONFIG_OLD_SIGACTION=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_ORION_WATCHDOG=y
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PCI=y
+# CONFIG_PCI_DOMAINS_GENERIC is not set
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+CONFIG_PLAT_ORION=y
+CONFIG_PLAT_ORION_LEGACY=y
+CONFIG_RATIONAL=y
+# CONFIG_RCU_EXPERT is not set
+# CONFIG_RCU_STALL_COMMON is not set
+CONFIG_RTC_CLASS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCSI_DMA is not set
+CONFIG_SERIAL_8250_FSL=y
+CONFIG_SPLIT_PTLOCK_CPUS=999999
+CONFIG_SRAM=y
+CONFIG_SRCU=y
+CONFIG_SWIOTLB=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
+CONFIG_USB_SUPPORT=y
+CONFIG_USE_OF=y
+CONFIG_VECTORS_BASE=0xffff0000
+# CONFIG_VFP is not set
+CONFIG_WATCHDOG_CORE=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_BCJ=y
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch b/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch
new file mode 100644
index 0000000..764f992
--- /dev/null
+++ b/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch
@@ -0,0 +1,8 @@
+--- a/arch/arm/tools/mach-types
++++ b/arch/arm/tools/mach-types
+@@ -1006,3 +1006,5 @@ eco5_bx2		MACH_ECO5_BX2		ECO5_BX2		4572
+ eukrea_cpuimx28sd	MACH_EUKREA_CPUIMX28SD	EUKREA_CPUIMX28SD	4573
+ domotab			MACH_DOMOTAB		DOMOTAB			4574
+ pfla03			MACH_PFLA03		PFLA03			4575
++dt2			MACH_DT2		DT2			1514
++wn802t			MACH_WN802T		WN802T			3306
diff --git a/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch b/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch
new file mode 100644
index 0000000..89c2c94
--- /dev/null
+++ b/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch
@@ -0,0 +1,32 @@
+--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
++++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+@@ -134,11 +134,11 @@ static struct mtd_partition wrt350n_v2_n
+ 	{
+ 		.name		= "kernel",
+ 		.offset		= 0x00000000,
+-		.size		= 0x00760000,
++		.size		= 0x00140000,	// change to kernel mtd size here (1/3)
+ 	}, {
+ 		.name		= "rootfs",
+-		.offset		= 0x001a0000,
+-		.size		= 0x005c0000,
++		.offset		= 0x00140000,	// change to kernel mtd size here (2/3)
++		.size		= 0x00610000,	// adopt to kernel mtd size here (3/3) = 0x00750000 - <kernel mtd size>
+ 	}, {
+ 		.name		= "lang",
+ 		.offset		= 0x00760000,
+@@ -151,6 +151,14 @@ static struct mtd_partition wrt350n_v2_n
+ 		.name		= "u-boot",
+ 		.offset		= 0x007c0000,
+ 		.size		= 0x00040000,
++	}, {
++		.name		= "eRcOmM_do_not_touch",
++		.offset		= 0x00750000,
++		.size		= 0x00010000,	// erasesize
++	}, {
++		.name		= "image",	// for sysupgrade
++		.offset		= 0x00000000,
++		.size		= 0x00750000,
+ 	},
+ };
+ 
diff --git a/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch b/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch
new file mode 100644
index 0000000..881cfb7
--- /dev/null
+++ b/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch
@@ -0,0 +1,25 @@
+--- a/arch/arm/mach-orion5x/wnr854t-setup.c
++++ b/arch/arm/mach-orion5x/wnr854t-setup.c
+@@ -57,15 +57,19 @@ static struct mtd_partition wnr854t_nor_
+ 	{
+ 		.name		= "kernel",
+ 		.offset		= 0x00000000,
+-		.size		= 0x00100000,
++		.size		= 0x00140000,
+ 	}, {
+ 		.name		= "rootfs",
+-		.offset		= 0x00100000,
+-		.size		= 0x00660000,
++		.offset		= 0x00140000,
++		.size		= 0x00620000,
+ 	}, {
+ 		.name		= "uboot",
+ 		.offset		= 0x00760000,
+ 		.size		= 0x00040000,
++	}, {
++		.name		= "image",	// for sysupgrade
++		.offset		= 0x00000000,
++		.size		= 0x00760000,
+ 	},
+ };
+ 
diff --git a/target/linux/orion/patches-4.9/200-dt2_board_support.patch b/target/linux/orion/patches-4.9/200-dt2_board_support.patch
new file mode 100644
index 0000000..5528069
--- /dev/null
+++ b/target/linux/orion/patches-4.9/200-dt2_board_support.patch
@@ -0,0 +1,562 @@
+--- a/arch/arm/mach-orion5x/Kconfig
++++ b/arch/arm/mach-orion5x/Kconfig
+@@ -48,6 +48,13 @@ config MACH_RD88F5182_DT
+ 	  Say 'Y' here if you want your kernel to support the Marvell
+ 	  Orion-NAS (88F5182) RD2, Flattened Device Tree.
+ 
++config MACH_DT2
++	bool "Freecom DataTank Gateway"
++	select I2C_BOARDINFO
++	help
++	  Say 'Y' here if you want your kernel to support the
++	  Freecom DataTank Gateway
++
+ config MACH_KUROBOX_PRO
+ 	bool "KuroBox Pro"
+ 	select I2C_BOARDINFO if I2C
+--- a/arch/arm/mach-orion5x/Makefile
++++ b/arch/arm/mach-orion5x/Makefile
+@@ -15,6 +15,7 @@ obj-$(CONFIG_MACH_TS78XX)	+= ts78xx-setu
+ obj-$(CONFIG_MACH_MV2120)	+= mv2120-setup.o
+ obj-$(CONFIG_MACH_NET2BIG)	+= net2big-setup.o
+ obj-$(CONFIG_MACH_WNR854T)	+= wnr854t-setup.o
++obj-$(CONFIG_MACH_DT2)		+= dt2-setup.o
+ obj-$(CONFIG_MACH_RD88F5181L_GE)	+= rd88f5181l-ge-setup.o
+ obj-$(CONFIG_MACH_RD88F5181L_FXO)	+= rd88f5181l-fxo-setup.o
+ obj-$(CONFIG_MACH_RD88F6183AP_GE)	+= rd88f6183ap-ge-setup.o
+--- /dev/null
++++ b/arch/arm/mach-orion5x/dt2-common.h
+@@ -0,0 +1,82 @@
++#ifndef __INC_DT2_COMMON_H
++#define __INC_DT2_COMMON_H
++
++#define ATAG_MV_UBOOT			0x41000403
++
++struct tag_mv_uboot {
++	u32 uboot_version;
++	u32 tclk;
++	u32 sysclk;
++	u32 isUsbHost;
++	u32 overEthAddr;
++	u8  dt2_eeprom[256];
++};
++
++#define DT2_EEPROM_ADDR 		0x50
++#define DT2_EEPROM_OFFSET		0
++#define DT2_EEPROM_LENGTH		256
++
++#define DT2_SERIAL_NUMBER_DEFAULT	"run on default\0"
++#define DT2_REVISION_DEFAULT_INIT 	0xFF
++#define DT2_CONFIG_FLAGS_DEFAULT 	0x00
++
++#define _PACKED_	__attribute__((packed))
++
++struct DT2_EEPROM_SD_CONFIG {
++	unsigned int	ram_1;
++	unsigned int	ram_2;
++	unsigned int	ram_3;
++	unsigned int	ram_4;
++	unsigned char	ram_5;
++	unsigned char	ram_6;
++	unsigned short	ram_7;
++	unsigned int 	magic_id;
++	} _PACKED_;		// 24 Bytes in total
++
++struct DT2_EEPROM_FC_CONFIG {
++	unsigned char	rtc_sts_mask;
++	unsigned char	rtc_sts_init;
++	unsigned char	rtc_int_mask;
++	unsigned char	rtc_int_init;
++	unsigned char	rtc_atrim_init;
++	unsigned char	rtc_dtrim_init;
++	unsigned char	dummy1;
++	unsigned char	dummy2;
++	unsigned char	dt2_config_flags;	/* 0x80 to load rtc_values to RTC */
++	unsigned char	dt2_revision;		/* upper nibble is HW, lower nibble is FW */
++	unsigned char	dt2_serial_number[16];	/* Serial number of DT-2 */
++	} _PACKED_;		// 26 Bytes in total
++
++#define CFG_LOAD_RTC_VALUES 	0x80
++
++struct DT2_EEPROM_GW_CONFIG {
++	unsigned int	dummy1;
++	unsigned int	dummy2;
++	unsigned int	dummy3;
++	unsigned char	dummy4;
++	unsigned char	tos_video_val1;
++	unsigned char	tos_video_val2;
++	unsigned char	tos_voip_val;
++	unsigned char	qos_igmp_cfg;
++	unsigned char	num_of_ifs;
++	unsigned short	vlan_ports_if[3];
++	unsigned char	mac_addr[3][6];
++	} _PACKED_;		// 42 Bytes in total
++
++#define _SIZE_OF_ALL_STRUCTS_ (sizeof(struct DT2_EEPROM_SD_CONFIG) + sizeof(struct DT2_EEPROM_FC_CONFIG) +  sizeof(struct DT2_EEPROM_GW_CONFIG))
++
++// MV = EEPROM - SD - FC - GW - CRC
++struct DT2_EEPROM_MV_CONFIG {
++	unsigned int reg_addr[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)];
++	unsigned int reg_data[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)];
++ 	} _PACKED_;
++
++struct DT2_EEPROM_STRUCT {
++	struct DT2_EEPROM_MV_CONFIG mv;
++	struct DT2_EEPROM_SD_CONFIG sd;
++	struct DT2_EEPROM_FC_CONFIG fc;
++	struct DT2_EEPROM_GW_CONFIG gw;
++	unsigned int	crc;
++	} _PACKED_;
++
++#endif
+--- /dev/null
++++ b/arch/arm/mach-orion5x/dt2-setup.c
+@@ -0,0 +1,448 @@
++/*
++ * arch/arm/mach-orion5x/dt2-setup.c
++ *
++ * Freecom DataTank Gateway Setup
++ *
++ * Copyright (C) 2009 Zintis Petersons <Zintis.Petersons at abcsolutions.lv>
++ *
++ * This file is licensed under the terms of the GNU General Public
++ * License version 2.  This program is licensed "as is" without any
++ * warranty of any kind, whether express or implied.
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/platform_device.h>
++#include <linux/pci.h>
++#include <linux/irq.h>
++#include <linux/mtd/physmap.h>
++#include <linux/mv643xx_eth.h>
++#include <linux/ethtool.h>
++#include <linux/if_ether.h>
++#include <net/dsa.h>
++#include <linux/ata_platform.h>
++#include <linux/i2c.h>
++#include <linux/reboot.h>
++#include <linux/interrupt.h>
++#include <asm/mach-types.h>
++#include <asm/gpio.h>
++#include <asm/mach/arch.h>
++#include <asm/mach/pci.h>
++#include "orion5x.h"
++#include "common.h"
++#include "mpp.h"
++
++/*****************************************************************************
++ * DT2 local
++ ****************************************************************************/
++#include <asm/setup.h>
++#include "dt2-common.h"
++
++u32 mvUbootVer = 0;
++u32 mvTclk = 166666667;
++u32 mvSysclk = 200000000;
++u32 mvIsUsbHost = 1;
++u32 overEthAddr = 0;
++u32 gBoardId = -1;
++struct DT2_EEPROM_STRUCT dt2_eeprom;
++
++/*****************************************************************************
++ * DT2 Info
++ ****************************************************************************/
++/*
++ * PCI
++ */
++
++#define DT2_PCI_SLOT0_OFFS	7
++#define DT2_PCI_SLOT0_IRQ_A_PIN	3
++#define DT2_PCI_SLOT0_IRQ_B_PIN	2
++
++#define DT2_PIN_GPIO_SYNC	25
++#define DT2_PIN_GPIO_POWER	24
++#define DT2_PIN_GPIO_UNPLUG1	23
++#define DT2_PIN_GPIO_UNPLUG2	22
++#define DT2_PIN_GPIO_RESET	4
++
++#define DT2_NOR_BOOT_BASE	0xf4000000
++#define DT2_NOR_BOOT_SIZE	SZ_512K
++
++#define DT2_LEDS_BASE		0xfa000000
++#define DT2_LEDS_SIZE		SZ_1K
++
++/*****************************************************************************
++ * 512K NOR Flash on Device bus Boot CS
++ ****************************************************************************/
++
++static struct mtd_partition dt2_partitions[] = {
++	{
++		.name	= "u-boot",
++		.size	= 0x00080000,
++		.offset	= 0,
++	},
++};
++
++static struct physmap_flash_data dt2_nor_flash_data = {
++	.width		= 1,		/* 8 bit bus width */
++	.parts		= dt2_partitions,
++	.nr_parts	= ARRAY_SIZE(dt2_partitions)
++};
++
++static struct resource dt2_nor_flash_resource = {
++	.flags		= IORESOURCE_MEM,
++	.start		= DT2_NOR_BOOT_BASE,
++	.end		= DT2_NOR_BOOT_BASE + DT2_NOR_BOOT_SIZE - 1,
++};
++
++static struct platform_device dt2_nor_flash = {
++	.name		= "physmap-flash",
++	.id		= 0,
++	.dev		= {
++		.platform_data	= &dt2_nor_flash_data,
++	},
++	.resource	= &dt2_nor_flash_resource,
++	.num_resources	= 1,
++};
++
++/*****************************************************************************
++ * PCI
++ ****************************************************************************/
++
++void __init dt2_pci_preinit(void)
++{
++	int pin, irq;
++
++	/*
++	 * Configure PCI GPIO IRQ pins
++	 */
++	pin = DT2_PCI_SLOT0_IRQ_A_PIN;
++	if (gpio_request(pin, "PCI IntA") == 0) {
++		if (gpio_direction_input(pin) == 0) {
++			irq = gpio_to_irq(pin);
++			irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW);
++			printk (KERN_INFO "PCI IntA IRQ: %d\n", irq);
++		} else {
++			printk(KERN_ERR "dt2_pci_preinit failed to "
++					"irq_set_irq_type pin %d\n", pin);
++			gpio_free(pin);
++		}
++	} else {
++		printk(KERN_ERR "dt2_pci_preinit failed to request gpio %d\n", pin);
++	}
++
++	pin = DT2_PCI_SLOT0_IRQ_B_PIN;
++	if (gpio_request(pin, "PCI IntB") == 0) {
++		if (gpio_direction_input(pin) == 0) {
++			irq = gpio_to_irq(pin);
++			irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW);
++			printk (KERN_INFO "PCI IntB IRQ: %d\n", irq);
++		} else {
++			printk(KERN_ERR "dt2_pci_preinit failed to "
++					"irq_set_irq_type pin %d\n", pin);
++			gpio_free(pin);
++		}
++	} else {
++		printk(KERN_ERR "dt2_pci_preinit failed to gpio_request %d\n", pin);
++	}
++}
++
++static int __init dt2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
++{
++	int irq;
++
++	/*
++	 * Check for devices with hard-wired IRQs.
++	 */
++	irq = orion5x_pci_map_irq(dev, slot, pin);
++	if (irq != -1){
++		printk(KERN_INFO "orion5x_pci_map_irq: %d\n", irq);
++		return irq;
++	}
++
++	/*
++	 * PCI IRQs are connected via GPIOs
++	 */
++	switch (slot - DT2_PCI_SLOT0_OFFS) {
++	case 0:
++		if (pin == 1){
++			irq = gpio_to_irq(DT2_PCI_SLOT0_IRQ_A_PIN);
++			printk(KERN_INFO "dt2_pci_map_irq DT2_PCI_SLOT0_IRQ_A_PIN: %d\n", irq);
++		}
++		else {
++			irq = gpio_to_irq(DT2_PCI_SLOT0_IRQ_B_PIN);
++			printk(KERN_INFO "dt2_pci_map_irq DT2_PCI_SLOT0_IRQ_B_PIN: %d\n", irq);
++		}
++	default:
++		irq = -1;
++			printk(KERN_INFO "dt2_pci_map_irq IRQ: %d\n", irq);
++	}
++
++	return irq;
++}
++
++static struct hw_pci dt2_pci __initdata = {
++	.nr_controllers	= 2,
++	.preinit	= dt2_pci_preinit,
++	.setup		= orion5x_pci_sys_setup,
++	.scan		= orion5x_pci_sys_scan_bus,
++	.map_irq	= dt2_pci_map_irq,
++};
++
++static int __init dt2_pci_init(void)
++{
++	if (machine_is_dt2())
++		pci_common_init(&dt2_pci);
++
++	return 0;
++}
++
++subsys_initcall(dt2_pci_init);
++
++/*****************************************************************************
++ * Ethernet
++ ****************************************************************************/
++
++static struct mv643xx_eth_platform_data dt2_eth_data = {
++	.phy_addr	= MV643XX_ETH_PHY_NONE,
++	.speed		= SPEED_1000,
++	.duplex		= DUPLEX_FULL,
++};
++
++static struct dsa_chip_data dt2_switch_chip_data = {
++	.port_names[0] = "wan",
++	.port_names[1] = "lan1",
++	.port_names[2] = "lan2",
++	.port_names[3] = "cpu",
++	.port_names[4] = "lan3",
++	.port_names[5] = "lan4",
++};
++
++static struct dsa_platform_data dt2_switch_plat_data = {
++	.nr_chips	= 1,
++	.chip		= &dt2_switch_chip_data,
++};
++
++/*****************************************************************************
++ * RTC ISL1208 on I2C bus
++ ****************************************************************************/
++static struct i2c_board_info __initdata dt2_i2c_rtc = {
++	I2C_BOARD_INFO("isl1208", 0x6F),
++};
++
++/*****************************************************************************
++ * Sata
++ ****************************************************************************/
++static struct mv_sata_platform_data dt2_sata_data = {
++	.n_ports	= 2,
++};
++
++/*****************************************************************************
++ * General Setup
++ ****************************************************************************/
++static unsigned int dt2_mpp_modes[] __initdata = {
++	MPP0_GPIO,		// RTC interrupt
++	MPP1_GPIO,		// 88e6131 interrupt
++	MPP2_GPIO,		// PCI_intB
++	MPP3_GPIO,		// PCI_intA
++	MPP4_GPIO,		// reset button switch
++	MPP5_GPIO,
++	MPP6_GPIO,
++	MPP7_GPIO,
++	MPP8_GPIO,
++	MPP9_GIGE,		/* GE_RXERR */
++	MPP10_GPIO,		// usb
++	MPP11_GPIO,		// usb
++	MPP12_GIGE,		// GE_TXD[4]
++	MPP13_GIGE,		// GE_TXD[5]
++	MPP14_GIGE,		// GE_TXD[6]
++	MPP15_GIGE,		// GE_TXD[7]
++	MPP16_GIGE,		// GE_RXD[4]
++	MPP17_GIGE,		// GE_RXD[5]
++	MPP18_GIGE,		// GE_RXD[6]
++	MPP19_GIGE,		// GE_RXD[7]
++	0,
++};
++
++/*****************************************************************************
++ * LEDS
++ ****************************************************************************/
++static struct platform_device dt2_leds = {
++	.name		= "dt2-led",
++	.id		= -1,
++};
++
++/****************************************************************************
++ * GPIO key
++ ****************************************************************************/
++static irqreturn_t dt2_reset_handler(int irq, void *dev_id)
++{
++	/* This is the paper-clip reset which does an emergency reboot. */
++	printk(KERN_INFO "Restarting system.\n");
++	machine_restart(NULL);
++
++	/* This should never be reached. */
++	return IRQ_HANDLED;
++}
++
++static irqreturn_t dt2_power_handler(int irq, void *dev_id)
++{
++	printk(KERN_INFO "Shutting down system.\n");
++	machine_power_off();
++	return IRQ_HANDLED;
++}
++
++static void __init dt2_init(void)
++{
++	/*
++	 * Setup basic Orion functions. Need to be called early.
++	 */
++	orion5x_init();
++
++	orion5x_mpp_conf(dt2_mpp_modes);
++
++	/*
++	 * Configure peripherals.
++	 */
++
++	orion5x_uart0_init();
++	orion5x_ehci0_init();
++	orion5x_ehci1_init();
++	orion5x_i2c_init();
++	orion5x_sata_init(&dt2_sata_data);
++	orion5x_xor_init();
++
++	printk(KERN_INFO "U-Boot parameters:\n");
++	printk(KERN_INFO "Sys Clk = %d, Tclk = %d, BoardID = 0x%02x\n", mvSysclk, mvTclk, gBoardId);
++
++	printk(KERN_INFO "Serial: %s\n", dt2_eeprom.fc.dt2_serial_number);
++	printk(KERN_INFO "Revision: %016x\n", dt2_eeprom.fc.dt2_revision);
++	printk(KERN_INFO "DT2: Using MAC address %pM for port 0\n",
++	       dt2_eeprom.gw.mac_addr[0]);
++	printk(KERN_INFO "DT2: Using MAC address %pM for port 1\n",
++	       dt2_eeprom.gw.mac_addr[1]);
++
++	orion5x_eth_init(&dt2_eth_data);
++	memcpy(dt2_eth_data.mac_addr, dt2_eeprom.gw.mac_addr[0], 6);
++	orion5x_eth_switch_init(&dt2_switch_plat_data);
++
++	i2c_register_board_info(0, &dt2_i2c_rtc, 1);
++
++	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
++				    ORION_MBUS_DEVBUS_BOOT_ATTR,
++				    DT2_NOR_BOOT_BASE, DT2_NOR_BOOT_SIZE);
++
++	platform_device_register(&dt2_nor_flash);
++
++	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(0),
++				    ORION_MBUS_DEVBUS_ATTR(0),
++				    DT2_LEDS_BASE, DT2_LEDS_SIZE);
++	platform_device_register(&dt2_leds);
++
++	if (request_irq(gpio_to_irq(DT2_PIN_GPIO_RESET), &dt2_reset_handler,
++			IRQF_TRIGGER_LOW,
++			"DT2: Reset button", NULL) < 0) {
++
++		printk("DT2: Reset Button IRQ %d not available\n",
++			gpio_to_irq(DT2_PIN_GPIO_RESET));
++	}
++
++	if (request_irq(gpio_to_irq(DT2_PIN_GPIO_POWER), &dt2_power_handler,
++			IRQF_TRIGGER_LOW,
++			"DT2: Power button", NULL) < 0) {
++
++		printk(KERN_DEBUG "DT2: Power Button IRQ %d not available\n",
++			gpio_to_irq(DT2_PIN_GPIO_POWER));
++	}
++}
++
++static int __init parse_tag_dt2_uboot(const struct tag *t)
++{
++	struct tag_mv_uboot *mv_uboot;
++
++	// Get pointer to our block
++	mv_uboot = (struct tag_mv_uboot*)&t->u;
++	mvTclk = mv_uboot->tclk;
++	mvSysclk = mv_uboot->sysclk;
++	mvUbootVer = mv_uboot->uboot_version;
++	mvIsUsbHost = mv_uboot->isUsbHost;
++
++	// Some clock fixups
++	if(mvTclk == 166000000) mvTclk = 166666667;
++	else if(mvTclk == 133000000) mvTclk = 133333333;
++	else if(mvSysclk == 166000000) mvSysclk = 166666667;
++
++	gBoardId =  (mvUbootVer & 0xff);
++
++	//DT2 specific data
++	memcpy(&dt2_eeprom, mv_uboot->dt2_eeprom, sizeof(struct DT2_EEPROM_STRUCT));
++
++	return 0;
++}
++__tagtable(ATAG_MV_UBOOT, parse_tag_dt2_uboot);
++
++/*
++ * This is OpenWrt specific fixup. It includes code from original "tag_fixup_mem32" to
++ * fixup bogus memory tags and also fixes kernel cmdline by adding " init=/etc/preinit"
++ * at the end. It is important to flash OpenWrt image from original Freecom firmware.
++ *
++ * Vanilla kernel should use "tag_fixup_mem32" function.
++ */
++static void __init openwrt_fixup(struct tag *t, char **from)
++{
++	char *p = NULL;
++	static char openwrt_init_tag[] __initdata = " init=/etc/preinit";
++
++	for (; t->hdr.size; t = tag_next(t)){
++		/* Locate the Freecom cmdline */
++		if (t->hdr.tag == ATAG_CMDLINE) {
++			p = t->u.cmdline.cmdline;
++			printk("%s(%d): Found cmdline '%s' at 0x%0lx\n",
++			       __FUNCTION__, __LINE__, p, (unsigned long)p);
++		}
++		/*
++		 * Many orion-based systems have buggy bootloader implementations.
++		 * This is a common fixup for bogus memory tags.
++		 */
++		if (t->hdr.tag == ATAG_MEM &&
++		    (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK ||
++		     t->u.mem.start & ~PAGE_MASK)) {
++			printk(KERN_WARNING
++			       "Clearing invalid memory bank %dKB at 0x%08x\n",
++			       t->u.mem.size / 1024, t->u.mem.start);
++			t->hdr.tag = 0;
++		}
++	}
++
++	printk("%s(%d): End of table at 0x%0lx\n", __FUNCTION__, __LINE__, (unsigned long)t);
++
++	/* Overwrite the end of the table with a new cmdline tag. */
++	t->hdr.tag = ATAG_CMDLINE;
++	t->hdr.size =
++		(sizeof (struct tag_header) +
++		 strlen(p) + strlen(openwrt_init_tag) + 1 + 4) >> 2;
++
++	strlcpy(t->u.cmdline.cmdline, p, COMMAND_LINE_SIZE);
++	strlcpy(t->u.cmdline.cmdline + strlen(p), openwrt_init_tag,
++		COMMAND_LINE_SIZE - strlen(p));
++
++	printk("%s(%d): New cmdline '%s' at 0x%0lx\n",
++	       __FUNCTION__, __LINE__,
++	       t->u.cmdline.cmdline, (unsigned long)t->u.cmdline.cmdline);
++
++	t = tag_next(t);
++
++	printk("%s(%d): New end of table at 0x%0lx\n", __FUNCTION__, __LINE__, (unsigned long)t);
++
++	t->hdr.tag = ATAG_NONE;
++	t->hdr.size = 0;
++}
++
++/* Warning: Freecom uses their own custom bootloader with mach-type (=1500) */
++MACHINE_START(DT2, "Freecom DataTank Gateway")
++	/* Maintainer: Zintis Petersons <Zintis.Petersons at abcsolutions.lv> */
++	.atag_offset    = 0x100,
++	.init_machine	= dt2_init,
++	.map_io		= orion5x_map_io,
++	.init_irq	= orion5x_init_irq,
++	.init_time	= orion5x_timer_init,
++	.fixup		= openwrt_fixup, //tag_fixup_mem32,
++MACHINE_END
diff --git a/target/linux/orion/patches-4.9/210-wn802t_support.patch b/target/linux/orion/patches-4.9/210-wn802t_support.patch
new file mode 100644
index 0000000..a274bee
--- /dev/null
+++ b/target/linux/orion/patches-4.9/210-wn802t_support.patch
@@ -0,0 +1,73 @@
+--- a/arch/arm/mach-orion5x/Kconfig
++++ b/arch/arm/mach-orion5x/Kconfig
+@@ -159,10 +159,13 @@ config MACH_MSS2_DT
+ 	  Maxtor Shared Storage II platform.
+ 
+ config MACH_WNR854T
+-	bool "Netgear WNR854T"
++	bool "Netgear WNR854T / WN802T"
+ 	help
+ 	  Say 'Y' here if you want your kernel to support the
+-	  Netgear WNR854T platform.
++	  Netgear WNR854T or WN802T platform.
++
++config MACH_WN802T
++	def_bool MACH_WNR854T
+ 
+ config MACH_RD88F5181L_GE
+ 	bool "Marvell Orion-VoIP GE Reference Design"
+--- a/arch/arm/mach-orion5x/wnr854t-setup.c
++++ b/arch/arm/mach-orion5x/wnr854t-setup.c
+@@ -115,6 +115,15 @@ static struct dsa_platform_data __initda
+ 	.chip		= &wnr854t_switch_chip_data,
+ };
+ 
++static struct dsa_chip_data wn802t_switch_chip_data = {
++	.port_names[2] = "wan",
++	.port_names[3] = "cpu",
++};
++
++static struct dsa_platform_data wn802t_switch_plat_data = {
++	.nr_chips	= 1,
++	.chip		= &wn802t_switch_chip_data,
++};
+ static void __init wnr854t_init(void)
+ {
+ 	/*
+@@ -128,7 +137,10 @@ static void __init wnr854t_init(void)
+ 	 * Configure peripherals.
+ 	 */
+ 	orion5x_eth_init(&wnr854t_eth_data);
+-	orion5x_eth_switch_init(&wnr854t_switch_plat_data);
++	if (machine_is_wn802t())
++		orion5x_eth_switch_init(&wn802t_switch_plat_data);
++	else
++		orion5x_eth_switch_init(&wnr854t_switch_plat_data);
+ 	orion5x_uart0_init();
+ 
+ 	mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
+@@ -168,7 +180,7 @@ static struct hw_pci wnr854t_pci __initd
+ 
+ static int __init wnr854t_pci_init(void)
+ {
+-	if (machine_is_wnr854t())
++	if (machine_is_wnr854t() || machine_is_wn802t())
+ 		pci_common_init(&wnr854t_pci);
+ 
+ 	return 0;
+@@ -187,3 +199,15 @@ MACHINE_START(WNR854T, "Netgear WNR854T"
+ 	.fixup		= tag_fixup_mem32,
+ 	.restart	= orion5x_restart,
+ MACHINE_END
++
++MACHINE_START(WN802T, "Netgear WN802T")
++	/* Maintainer: Imre Kaloz <kaloz at openwrt.org> */
++	.atag_offset	= 0x100,
++	.init_machine	= wnr854t_init,
++	.map_io		= orion5x_map_io,
++	.init_early	= orion5x_init_early,
++	.init_irq	= orion5x_init_irq,
++	.init_time	= orion5x_timer_init,
++	.fixup		= tag_fixup_mem32,
++	.restart	= orion5x_restart,
++MACHINE_END


From lede-commits at lists.infradead.org  Wed Oct 25 00:22:43 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 03:22:43 -0400
Subject: [source]  lantiq: add missing default lan interface
In-Reply-To: <20171025072243.2563.85612@git-01.infra.lede-project.org>
References: <20171025072243.2563.85612@git-01.infra.lede-project.org>
Message-ID: <mailman.56502.1508916313.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/9dd2d99525a588a66cfb0fd00ac8f3d62130bfca

commit 9dd2d99525a588a66cfb0fd00ac8f3d62130bfca
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Oct 25 08:32:00 2017 +0200

    lantiq: add missing default lan interface
    
    With removing the boards from the the default case to fix the xDSL WAN
    MAC-Address, the setting for the default LAN interface wasn't added.
    
    Fixes: 92a12c434ca3 ("lantiq: fix avm fritz box mac addresses")
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/base-files/etc/board.d/02_network | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index bc5c410..f78ef2f 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -117,10 +117,12 @@ EASY80920NAND|EASY80920NOR)
 
 FRITZ3370)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2439)" 1)
+	ucidef_set_interface_lan 'eth0'
 	;;
 
 FRITZ7320)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
+	ucidef_set_interface_lan 'eth0'
 	;;
 
 FRITZ7360SL)


From lede-commits at lists.infradead.org  Wed Oct 25 00:22:44 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 03:22:44 -0400
Subject: [source]  lantiq: match default adsl annex and firmware
In-Reply-To: <20171025072243.2563.85612@git-01.infra.lede-project.org>
References: <20171025072243.2563.85612@git-01.infra.lede-project.org>
Message-ID: <mailman.56503.1508916313.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/664369f6b281b961718b247e3b6b2d55fc6a5f7a

commit 664369f6b281b961718b247e3b6b2d55fc6a5f7a
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Mon Oct 16 23:25:04 2017 +0200

    lantiq: match default adsl annex and firmware
    
    Set a default Annex matching the the annex of the selected adsl
    firmware.
    
    Set Annex B for xrx200 board which are known to have an ADSL hybrid for
    Annex B.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../linux/lantiq/base-files/etc/board.d/02_network | 33 ++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index f78ef2f..8c2a118 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -23,7 +23,7 @@ interface_wan=""
 board=$(board_name)
 
 case "$board" in
-ACMP252|GIGASX76X)
+ACMP252)
 	ucidef_add_switch "switch0" \
 		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t at eth0"
 	;;
@@ -42,17 +42,24 @@ ARV4510PW)
 		"0:lan:4" "2:lan:2" "1:lan:3" "3:lan:1" "5t at eth0"
 	;;
 
-ARV4519PW|ARV7510PW22|ARV7518PW|ARV752DPW22|ARV8539PW22)
+ARV4519PW|ARV7510PW22|ARV7518PW)
 	ucidef_add_switch "switch0" \
 		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
 	;;
 
 ARV4520PW)
+	annex="b"
 	ucidef_add_switch "switch0" \
 		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t at eth0"
 	;;
 
+ARV4525PW|ARV452CQW|ARV7525PW|ARV752DPW)
+	annex="b"
+	ucidef_set_interface_lan 'eth0'
+	;;
+
 ARV7506PW11)
+	annex="b"
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2)
 	ucidef_add_switch "switch0" \
 		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t at eth0"
@@ -70,6 +77,12 @@ ARV7519RW22)
 		"0:lan:5" "2:lan:3" "3:lan:4" "4:lan:1" "5:lan:2" "6t at eth0"
 	;;
 
+ARV752DPW22|ARV8539PW22)
+	annex="b"
+	ucidef_add_switch "switch0" \
+		"0t at eth0" "2:lan" "3:lan" "4:lan" "5:lan"
+	;;
+
 ASL56026)
 	lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
 	wan_mac=$(mtd_get_mac_ascii uboot_env wanmac)
@@ -97,6 +110,11 @@ BTHOMEHUBV5A)
 		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t at eth0"
 	;;
 
+DGN1000B)
+	annex="b"
+	ucidef_set_interface_lan 'eth0'
+	;;
+
 DGN3500*)
 	ucidef_add_switch "switch0" \
 		"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t at eth0"
@@ -116,22 +134,32 @@ EASY80920NAND|EASY80920NOR)
 	;;
 
 FRITZ3370)
+	annex="b"
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2439)" 1)
 	ucidef_set_interface_lan 'eth0'
 	;;
 
 FRITZ7320)
+	annex="b"
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
 	ucidef_set_interface_lan 'eth0'
 	;;
 
 FRITZ7360SL)
+	annex="b"
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
 	ucidef_add_switch "switch0" \
 		"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t at eth0"
 	;;
 
+GIGASX76X)
+	annex="b"
+	ucidef_add_switch "switch0" \
+		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t at eth0"
+	;;
+
 H201L)
+	annex="b"
 	ucidef_add_switch "switch0" \
 		"0:lan" "1:lan" "2:lan" "3:lan" "4t at eth0"
 	;;
@@ -168,6 +196,7 @@ VR200v)
 	;;
 
 VGV7510KW22*)
+	annex="b"
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2)
 	ucidef_add_switch "switch0" \
 		"2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "0:wan:5" "6t at eth0"


From lede-commits at lists.infradead.org  Wed Oct 25 00:22:45 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 03:22:45 -0400
Subject: [source]  ltq-adsl-app: convert init script to procd
In-Reply-To: <20171025072243.2563.85612@git-01.infra.lede-project.org>
References: <20171025072243.2563.85612@git-01.infra.lede-project.org>
Message-ID: <mailman.56504.1508916323.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/d456a888d07e97491ad2d57f470801bbbc4c06a6

commit d456a888d07e97491ad2d57f470801bbbc4c06a6
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Sun Oct 15 10:33:29 2017 +0200

    ltq-adsl-app: convert init script to procd
    
    Use the procd features for the init script.
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 package/network/config/ltq-adsl-app/files/dsl_control | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/package/network/config/ltq-adsl-app/files/dsl_control b/package/network/config/ltq-adsl-app/files/dsl_control
index 8218186..d93d478 100644
--- a/package/network/config/ltq-adsl-app/files/dsl_control
+++ b/package/network/config/ltq-adsl-app/files/dsl_control
@@ -2,14 +2,12 @@
 # Copyright (C) 2012 OpenWrt.org
 
 START=49
+USE_PROCD=1
 
 EXTRA_COMMANDS="status lucistat"
 EXTRA_HELP="	status  Get DSL status information
 	lucistat  Get status information if lua friendly format"
 
-SERVICE_DAEMONIZE=1
-SERVICE_WRITE_PID=1
-
 [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
 
 annex_b=10_00_10_00_00_04_00_00
@@ -28,7 +26,11 @@ annex_m2=00_00_00_00_40_00_00_00
 annex_m2p=00_00_00_00_00_00_04_00
 annex_j=10_00_10_40_00_04_01_00
 
-start() {
+service_triggers() {
+	procd_add_reload_trigger network
+}
+
+start_service() {
 	local annex
 	local firmware
 	local xtu
@@ -45,12 +47,15 @@ start() {
 		return 1
 	}
 
-	service_start /sbin/dsl_cpe_control -i${xtu} \
+	procd_open_instance
+	procd_set_param command /sbin/dsl_cpe_control \
+			-i${xtu} \
 			-n /sbin/dsl_notify.sh \
 			-f ${firmware}
+	procd_close_instance
 }
 
-stop() {
+stop_service() {
 	DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
 	DSL_INTERFACE_STATUS="DOWN" \
 		/sbin/dsl_notify.sh


From lede-commits at lists.infradead.org  Wed Oct 25 00:23:58 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 03:23:58 -0400
Subject: [source]  ramips: fix default usb support for nexx wt3020-8M
In-Reply-To: <20171025072353.3416.49401@git-01.infra.lede-project.org>
References: <20171025072353.3416.49401@git-01.infra.lede-project.org>
Message-ID: <mailman.56505.1508916392.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/f5935f78a194525e0b1a261e1cf1c6769e810504

commit f5935f78a194525e0b1a261e1cf1c6769e810504
Author: Alberto Bursi <alberto.bursi at outlook.it>
AuthorDate: Sat Oct 21 23:53:49 2017 +0200

    ramips: fix default usb support for nexx wt3020-8M
    
    the nexx wt3020-8M has a usb 2.0 port,
    add usb 2.0 support packages to its default package list.
    
    Signed-off-by: Alberto Bursi <alberto.bursi at outlook.it>
---
 target/linux/ramips/image/mt7620.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index c2c0ae2..ccf8d52 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -107,6 +107,7 @@ define Device/wt3020-8M
   IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
 	poray-header -B WT3020 -F 8M
   DEVICE_TITLE := Nexx WT3020 (8MB)
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
 endef
 TARGET_DEVICES += wt3020-8M
 


From lede-commits at lists.infradead.org  Wed Oct 25 00:23:59 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 03:23:59 -0400
Subject: [source]  ipq806x: fix Zyxel NBG6817 WiFi button
In-Reply-To: <20171025072353.3416.49401@git-01.infra.lede-project.org>
References: <20171025072353.3416.49401@git-01.infra.lede-project.org>
Message-ID: <mailman.56506.1508916392.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/2bee675d33f57ca7b995e848d3aca987013ee2ae

commit 2bee675d33f57ca7b995e848d3aca987013ee2ae
Author: Tolga Cakir <tolga at cevel.net>
AuthorDate: Tue Oct 24 22:03:33 2017 +0200

    ipq806x: fix Zyxel NBG6817 WiFi button
    
    Zyxel NBG6817 features a WiFi button, which becomes functional by setting
    correct GPIO. It is a switch-type button, so it emits KEY_RFKILL on each ON
    and OFF state. This is achieved by setting input-type to EV_SW.
    
    Signed-off-by: Tolga Cakir <tolga at cevel.net>
---
 .../linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
index 4db1a30..9abe44e 100644
--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
@@ -41,7 +41,7 @@
 		pinmux at 800000 {
 			button_pins: button_pins {
 				mux {
-					pins = "gpio6", "gpio54", "gpio65";
+					pins = "gpio53", "gpio54", "gpio65";
 					function = "gpio";
 					drive-strength = <2>;
 					bias-pull-up;
@@ -334,8 +334,9 @@
 
 		wifi {
 			label = "wifi";
-			gpios = <&qcom_pinmux 6 GPIO_ACTIVE_LOW>;
+			gpios = <&qcom_pinmux 53 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_RFKILL>;
+			linux,input-type = <EV_SW>;
 		};
 
 		reset {


From lede-commits at lists.infradead.org  Wed Oct 25 00:24:00 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 03:24:00 -0400
Subject: [source]  lantiq: add missing default lan interface
In-Reply-To: <20171025072353.3416.49401@git-01.infra.lede-project.org>
References: <20171025072353.3416.49401@git-01.infra.lede-project.org>
Message-ID: <mailman.56507.1508916393.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/ee6fa8d8396922a3cfda58f5ee56a6efe67ccf80

commit ee6fa8d8396922a3cfda58f5ee56a6efe67ccf80
Author: Mathias Kresin <dev at kresin.me>
AuthorDate: Wed Oct 25 08:32:00 2017 +0200

    lantiq: add missing default lan interface
    
    With removing the boards from the the default case to fix the xDSL WAN
    MAC-Address, the setting for the default LAN interface wasn't added.
    
    Fixes: 92a12c434ca3 ("lantiq: fix avm fritz box mac addresses")
    
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/lantiq/base-files/etc/board.d/02_network | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
index 058fbd5..de55be8 100755
--- a/target/linux/lantiq/base-files/etc/board.d/02_network
+++ b/target/linux/lantiq/base-files/etc/board.d/02_network
@@ -95,10 +95,12 @@ EASY80920NAND|EASY80920NOR)
 
 FRITZ3370)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2439)" 1)
+	ucidef_set_interface_lan 'eth0'
 	;;
 
 FRITZ7320)
 	wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
+	ucidef_set_interface_lan 'eth0'
 	;;
 
 FRITZ7360SL)


From lede-commits at lists.infradead.org  Wed Oct 25 00:58:26 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 03:58:26 -0400
Subject: [source] dnsmasq: restore ability to include/exclude raw device names
In-Reply-To: <20171025075826.12182.89897@git-01.infra.lede-project.org>
References: <20171025075826.12182.89897@git-01.infra.lede-project.org>
Message-ID: <mailman.56512.1508918337.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/367b4563b4cd466188bd4c8cf24ff0a125029c1c

commit 367b4563b4cd466188bd4c8cf24ff0a125029c1c
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Jul 10 10:53:29 2017 +0200

    dnsmasq: restore ability to include/exclude raw device names
    
    Commit 5cd88f4 "dnsmasq: remove use of uci state for getting network ifname"
    broke the ability to specify unmanaged network device names for inclusion
    and exclusion in the uci configuration.
    
    Restore support for raw device names by falling back to the input value
    when "network_get_device" yields no result.
    
    Fixes FS#876.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
    (cherry picked from commit a89c36b50875e61c790113d3adee10621575788a)
---
 package/network/services/dnsmasq/Makefile           | 2 +-
 package/network/services/dnsmasq/files/dnsmasq.init | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 94fd702..8eed542 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.78
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index a762cd3..1ecbb3c 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -116,12 +116,12 @@ append_ipset() {
 }
 
 append_interface() {
-	network_get_device ifname "$1" || return
+	network_get_device ifname "$1" || ifname="$1"
 	xappend "--interface=$ifname"
 }
 
 append_notinterface() {
-	network_get_device ifname "$1" || return
+	network_get_device ifname "$1" || ifname="$1"
 	xappend "--except-interface=$ifname"
 }
 


From lede-commits at lists.infradead.org  Wed Oct 25 09:49:33 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 12:49:33 -0400
Subject: [source]  ltq-xdsl-app: script style nit
In-Reply-To: <20171025164932.11918.31063@git-01.infra.lede-project.org>
References: <20171025164932.11918.31063@git-01.infra.lede-project.org>
Message-ID: <mailman.56578.1508950201.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/240d4b1b6ecbfc667f923e0ac980724670113342

commit 240d4b1b6ecbfc667f923e0ac980724670113342
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Wed Oct 25 10:39:23 2017 +0100

    ltq-xdsl-app: script style nit
    
    Fix missing space style nit.
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/config/ltq-adsl-app/files/10-adsl_rename | 2 +-
 package/network/config/ltq-vdsl-app/files/10-xdsl_rename | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/config/ltq-adsl-app/files/10-adsl_rename b/package/network/config/ltq-adsl-app/files/10-adsl_rename
index faa5911..f81a90a 100644
--- a/package/network/config/ltq-adsl-app/files/10-adsl_rename
+++ b/package/network/config/ltq-adsl-app/files/10-adsl_rename
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$ACTION" = add ]; then
-	[ "$DEVICENAME" = "nas0" ] ||[ "$DEVICENAME" = "ptm0" ] || exit
+	[ "$DEVICENAME" = "nas0" ] || [ "$DEVICENAME" = "ptm0" ] || exit
 
 	ip link set $DEVICENAME name dsl0
 fi
diff --git a/package/network/config/ltq-vdsl-app/files/10-xdsl_rename b/package/network/config/ltq-vdsl-app/files/10-xdsl_rename
index faa5911..f81a90a 100644
--- a/package/network/config/ltq-vdsl-app/files/10-xdsl_rename
+++ b/package/network/config/ltq-vdsl-app/files/10-xdsl_rename
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ "$ACTION" = add ]; then
-	[ "$DEVICENAME" = "nas0" ] ||[ "$DEVICENAME" = "ptm0" ] || exit
+	[ "$DEVICENAME" = "nas0" ] || [ "$DEVICENAME" = "ptm0" ] || exit
 
 	ip link set $DEVICENAME name dsl0
 fi


From lede-commits at lists.infradead.org  Wed Oct 25 09:49:34 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 12:49:34 -0400
Subject: [source]  ramips: remove erroneous "wdt rst" DTS entries
In-Reply-To: <20171025164932.11918.31063@git-01.infra.lede-project.org>
References: <20171025164932.11918.31063@git-01.infra.lede-project.org>
Message-ID: <mailman.56579.1508950210.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/bca01fddb357147648ea00bde543542bd4f00bec

commit bca01fddb357147648ea00bde543542bd4f00bec
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Wed Oct 25 09:21:35 2017 +0100

    ramips: remove erroneous "wdt rst" DTS entries
    
    Remove reference to pinmux group "wdt rst" on EW1200, ZBT-WG2626 and
    ZBT-WG3526 devices. "wdt rst" is a pinmux function and not a pinmux
    group.
    
    Fixes the following error message during boot:
    
      rt2880-pinmux pinctrl: invalid group "wdt rst" for function "gpio"
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 target/linux/ramips/dts/EW1200.dts      | 2 +-
 target/linux/ramips/dts/ZBT-WG2626.dts  | 2 +-
 target/linux/ramips/dts/ZBT-WG3526.dtsi | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/dts/EW1200.dts b/target/linux/ramips/dts/EW1200.dts
index e6b96fa..84c4f72 100644
--- a/target/linux/ramips/dts/EW1200.dts
+++ b/target/linux/ramips/dts/EW1200.dts
@@ -121,7 +121,7 @@
 &pinctrl {
 	state_default: pinctrl0 {
 		gpio {
-			ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
+			ralink,group = "wdt", "rgmii2", "jtag", "mdio";
 			ralink,function = "gpio";
 		};
 	};
diff --git a/target/linux/ramips/dts/ZBT-WG2626.dts b/target/linux/ramips/dts/ZBT-WG2626.dts
index a55fd09..79f2859 100644
--- a/target/linux/ramips/dts/ZBT-WG2626.dts
+++ b/target/linux/ramips/dts/ZBT-WG2626.dts
@@ -116,7 +116,7 @@
 &pinctrl {
 	state_default: pinctrl0 {
 		gpio {
-			ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
+			ralink,group = "wdt", "rgmii2", "jtag", "mdio";
 			ralink,function = "gpio";
 		};
 	};
diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/ZBT-WG3526.dtsi
index ccd5ab1..104a51f 100644
--- a/target/linux/ramips/dts/ZBT-WG3526.dtsi
+++ b/target/linux/ramips/dts/ZBT-WG3526.dtsi
@@ -111,7 +111,7 @@
 &pinctrl {
 	state_default: pinctrl0 {
 		gpio {
-			ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio";
+			ralink,group = "wdt", "rgmii2", "jtag", "mdio";
 			ralink,function = "gpio";
 		};
 	};


From lede-commits at lists.infradead.org  Wed Oct 25 12:45:51 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 25 Oct 2017 15:45:51 -0400
Subject: [source]  hostapd: fix up ubus support
In-Reply-To: <20171025194551.18055.51030@git-01.infra.lede-project.org>
References: <20171025194551.18055.51030@git-01.infra.lede-project.org>
Message-ID: <mailman.56591.1508960780.26984.lede-commits@lists.infradead.org>

blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/21e59ee3a2310ba1ec80b07614991318c014610e

commit 21e59ee3a2310ba1ec80b07614991318c014610e
Author: John Crispin <john at phrozen.org>
AuthorDate: Sat Oct 21 22:02:31 2017 +0200

    hostapd: fix up ubus support
    
    Signed-off-by: John Crispin <john at phrozen.org>
---
 .../hostapd/patches/600-ubus_support.patch         | 62 +++++++++++++++-------
 package/network/services/hostapd/src/src/ap/ubus.c |  6 +--
 2 files changed, 45 insertions(+), 23 deletions(-)

diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch
index 31e3e79..b63d99a 100644
--- a/package/network/services/hostapd/patches/600-ubus_support.patch
+++ b/package/network/services/hostapd/patches/600-ubus_support.patch
@@ -1,5 +1,7 @@
---- a/hostapd/Makefile
-+++ b/hostapd/Makefile
+Index: hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/hostapd/Makefile
++++ hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile
 @@ -165,6 +165,11 @@ OBJS += ../src/common/hw_features_common
  
  OBJS += ../src/eapol_auth/eapol_auth_sm.o
@@ -12,8 +14,10 @@
  
  ifdef CONFIG_CODE_COVERAGE
  CFLAGS += -O0 -fprofile-arcs -ftest-coverage
---- a/src/ap/hostapd.h
-+++ b/src/ap/hostapd.h
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.h
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h
 @@ -13,6 +13,7 @@
  #include "utils/list.h"
  #include "ap_config.h"
@@ -39,8 +43,10 @@
  	enum hostapd_iface_state {
  		HAPD_IFACE_UNINITIALIZED,
  		HAPD_IFACE_DISABLED,
---- a/src/ap/hostapd.c
-+++ b/src/ap/hostapd.c
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.c
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c
 @@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc
  	hapd->started = 0;
  
@@ -82,8 +88,10 @@
  	hostapd_interface_deinit(iface);
  	wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit",
  		   __func__, driver, drv_priv);
---- a/src/ap/ieee802_11.c
-+++ b/src/ap/ieee802_11.c
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/ieee802_11.c
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c
 @@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap
  
  
@@ -201,8 +209,10 @@
  		ret = 1;
  		break;
  	case WLAN_FC_STYPE_DISASSOC:
---- a/src/ap/beacon.c
-+++ b/src/ap/beacon.c
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.c
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c
 @@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc
  
  void handle_probe_req(struct hostapd_data *hapd,
@@ -241,8 +251,10 @@
  	/* TODO: verify that supp_rates contains at least one matching rate
  	 * with AP configuration */
  
---- a/src/ap/beacon.h
-+++ b/src/ap/beacon.h
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.h
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h
 @@ -14,7 +14,7 @@ struct ieee80211_mgmt;
  
  void handle_probe_req(struct hostapd_data *hapd,
@@ -252,8 +264,10 @@
  int ieee802_11_set_beacon(struct hostapd_data *hapd);
  int ieee802_11_set_beacons(struct hostapd_iface *iface);
  int ieee802_11_update_beacons(struct hostapd_iface *iface);
---- a/src/ap/drv_callbacks.c
-+++ b/src/ap/drv_callbacks.c
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/drv_callbacks.c
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c
 @@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d
  	u16 reason = WLAN_REASON_UNSPECIFIED;
  	u16 status = WLAN_STATUS_SUCCESS;
@@ -278,8 +292,10 @@
  #ifdef CONFIG_P2P
  	if (elems.p2p) {
  		wpabuf_free(sta->p2p_ie);
---- a/src/ap/sta_info.c
-+++ b/src/ap/sta_info.c
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/sta_info.c
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c
 @@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo
  			       HOSTAPD_LEVEL_INFO, "deauthenticated due to "
  			       "local deauth request");
@@ -296,8 +312,18 @@
  		break;
  	}
  }
---- a/src/ap/wpa_auth_glue.c
-+++ b/src/ap/wpa_auth_glue.c
+@@ -1212,6 +1214,7 @@ void ap_sta_set_authorized(struct hostap
+ 					  buf, ip_addr);
+ 	} else {
+ 		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf);
++		hostapd_ubus_notify(hapd, "disassoc", sta->addr);
+ 
+ 		if (hapd->msg_ctx_parent &&
+ 		    hapd->msg_ctx_parent != hapd->msg_ctx)
+Index: hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c
+===================================================================
+--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/wpa_auth_glue.c
++++ hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c
 @@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure
  	struct hostapd_data *hapd = ctx;
  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c
index bc77393..beb4388 100644
--- a/package/network/services/hostapd/src/src/ap/ubus.c
+++ b/package/network/services/hostapd/src/src/ap/ubus.c
@@ -743,18 +743,14 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
 
 void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *addr)
 {
-	char mac[18];
-
 	if (!hapd->ubus.obj.has_subscribers)
 		return;
 
 	if (!addr)
 		return;
 
-	snprintf(mac, sizeof(mac), MACSTR, MAC2STR(addr));
-
 	blob_buf_init(&b, 0);
-	blobmsg_add_macaddr(&b, "address", mac);
+	blobmsg_add_macaddr(&b, "address", addr);
 
 	ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1);
 }


From lede-commits at lists.infradead.org  Thu Oct 26 03:27:47 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 06:27:47 -0400
Subject: [source]  treewide: do not use IMG_PREFIX in Image/Prepare
In-Reply-To: <20171026102747.31665.39015@git-01.infra.lede-project.org>
References: <20171026102747.31665.39015@git-01.infra.lede-project.org>
Message-ID: <mailman.56644.1509013704.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/6f528dfbd91f8e687e36300ab9284d16b78475b4

commit 6f528dfbd91f8e687e36300ab9284d16b78475b4
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Oct 13 14:21:53 2017 +0200

    treewide: do not use IMG_PREFIX in Image/Prepare
    
    IMG_PREFIX can be modified in ImageBuilder by passing EXTRA_IMAGE_NAME
    on command line, but Image/Prepare is not run in ImageBuilder. This
    causes missing files when IMG_PREFIX is used for target file names in
    Image/Prepare, then as source file names in Image/BuildKernel or
    Image/Build.
    
    Fix this by using a fixed output file name in Image/Prepare, and copy to
    the expected file name in Image/BuildKernel instead, which is run by
    ImageBuilder.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/gemini/image/Makefile  | 18 +++++++++---------
 target/linux/ipq806x/image/Makefile |  4 ++--
 target/linux/malta/image/Makefile   |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile
index 1c51b62..2cea857 100644
--- a/target/linux/gemini/image/Makefile
+++ b/target/linux/gemini/image/Makefile
@@ -10,19 +10,19 @@ include $(INCLUDE_DIR)/image.mk
 ifeq ($(SUBTARGET),wiligear)
 define Image/Prepare
 # WBD111: mach id 1690 (0x69a)
-	echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd111-zImage
-	cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd111-zImage
+	echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/wbd111-zImage
+	cat $(KDIR)/zImage >> $(KDIR)/wbd111-zImage
 # WBD222: mach id 2753 (0xAC1)
-	echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd222-zImage
-	cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd222-zImage
+	echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/wbd222-zImage
+	cat $(KDIR)/zImage >> $(KDIR)/wbd222-zImage
 endef
 endif
 
 ifeq ($(SUBTARGET),raidsonic)
 define Image/Prepare
 # NAS4220: mach id 2038 (0x7F6)
-	echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-nas4220-zImage
-	cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-nas4220-zImage
+	echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/nas4220-zImage
+	cat $(KDIR)/zImage >> $(KDIR)/nas4220-zImage
 endef
 endif
 
@@ -30,9 +30,9 @@ ifeq ($(SUBTARGET),wiligear)
 define Image/BuildKernel
 # workaround the bootloader's bug with extra nops
 	echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage
-	cat $(KDIR)/$(IMG_PREFIX)-wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage
+	cat $(KDIR)/wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage
 	echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage
-	cat $(KDIR)/$(IMG_PREFIX)-wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage
+	cat $(KDIR)/wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage
 endef
 endif
 
@@ -74,7 +74,7 @@ define Image/Build
 	dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/rd.gz bs=6144k count=1
 #	dd if=/dev/zero of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1
 	dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 seek=1
-	cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/
+	cp $(KDIR)/nas4220-zImage $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage
 	cp $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage
 	cp ./ImageInfo-ib4220 $(BIN_DIR)/ImageInfo
 	(cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-ib4220.tar.gz ImageInfo zImage rd.gz hddapp.tgz)
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 3a76c7f..f6f7f42 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -6,11 +6,11 @@ include $(INCLUDE_DIR)/image.mk
 UBIFS_OPTS = -m 2048 -e 124KiB -c 4096 -U -F
 
 define Image/Prepare
-	$(CP) $(LINUX_DIR)/vmlinux $(KDIR)/$(IMG_PREFIX)-vmlinux.elf
+	$(CP) $(LINUX_DIR)/vmlinux $(KDIR)/vmlinux-unstripped.elf
 endef
 
 define Image/BuildKernel
-	$(CP) $(KDIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR)
+	$(CP) $(KDIR)/vmlinux-unstripped.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
 endef
 
 define Image/Build/squashfs
diff --git a/target/linux/malta/image/Makefile b/target/linux/malta/image/Makefile
index 31eb7ca..d49d4a7 100644
--- a/target/linux/malta/image/Makefile
+++ b/target/linux/malta/image/Makefile
@@ -22,7 +22,6 @@ define MkuImage
 endef
 
 define Image/Prepare
-	cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
 	$(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
 	$(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma)
 	$(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz)
@@ -30,6 +29,7 @@ define Image/Prepare
 endef
 
 define Image/BuildKernel
+	cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
 	cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma
 	cp $(KDIR)/uImage.gz $(BIN_DIR)/$(IMG_PREFIX)-uImage-gzip
 endef


From lede-commits at lists.infradead.org  Thu Oct 26 05:44:16 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 08:44:16 -0400
Subject: [source] ar71xx: Archer C58/C59/C60 fix qca9886 wireless interface
In-Reply-To: <20171026124416.31921.44715@git-01.infra.lede-project.org>
References: <20171026124416.31921.44715@git-01.infra.lede-project.org>
Message-ID: <mailman.56656.1509021889.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/34958c826915cf864833ed8ba6e5b49d44c6cb41

commit 34958c826915cf864833ed8ba6e5b49d44c6cb41
Author: Henryk Heisig <hyniu at o2.pl>
AuthorDate: Thu Jun 29 15:20:31 2017 +0200

    ar71xx: Archer C58/C59/C60 fix qca9886 wireless interface
    
    This commit fix 5GHz wireless interface used in Archer C58/C59/C60v1
    and set correctly MAC address on this interface.
    
    Signed-off-by: Henryk Heisig <hyniu at o2.pl>
---
 .../ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata      | 6 +++---
 .../linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 +++-
 target/linux/ar71xx/image/tp-link.mk                                | 6 +++---
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 6679659..d96f40d 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -56,8 +56,6 @@ case "$FIRMWARE" in
 		;;
 	archer-c7-v4|\
 	archer-c25-v1|\
-	archer-c59-v1|\
-	archer-c60-v1|\
 	tl-wdr6500-v2)
 		ath10kcal_extract "art" 20480 2116
 		ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
@@ -141,7 +139,9 @@ case "$FIRMWARE" in
 	;;
 "ath10k/pre-cal-pci-0000:00:00.0.bin")
 	case $board in
-	archer-c58-v1)
+	archer-c58-v1|\
+	archer-c59-v1|\
+	archer-c60-v1)
 		ath10kcal_extract "art" 20480 12064
 		;;
 	esac
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 77c835f..0530d59 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -12,7 +12,9 @@ PHYNBR=${DEVPATH##*/phy}
 board=$(board_name)
 
 case "$board" in
-	archer-c58-v1)
+	archer-c58-v1|\
+	archer-c59-v1|\
+	archer-c60-v1)
 		echo $(macaddr_add $(mtd_get_mac_binary mac 8)  $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
 		;;
 	*)
diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
index 868bbda..b7689c2 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -118,7 +118,7 @@ endef
 define Device/archer-c58-v1
   $(Device/archer-cxx)
   DEVICE_TITLE := TP-LINK Archer C58 v1
-  DEVICE_PACKAGES := kmod-ath10k
+  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888
   BOARDNAME := ARCHER-C58-V1
   TPLINK_BOARD_ID := ARCHER-C58-V1
   DEVICE_PROFILE := ARCHERC58V1
@@ -130,7 +130,7 @@ endef
 define Device/archer-c59-v1
   $(Device/archer-cxx)
   DEVICE_TITLE := TP-LINK Archer C59 v1
-  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x
+  DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca9888
   BOARDNAME := ARCHER-C59-V1
   TPLINK_BOARD_ID := ARCHER-C59-V1
   DEVICE_PROFILE := ARCHERC59V1
@@ -142,7 +142,7 @@ endef
 define Device/archer-c60-v1
   $(Device/archer-cxx)
   DEVICE_TITLE := TP-LINK Archer C60 v1
-  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
+  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888
   BOARDNAME := ARCHER-C60-V1
   TPLINK_BOARD_ID := ARCHER-C60-V1
   DEVICE_PROFILE := ARCHERC60V1


From lede-commits at lists.infradead.org  Thu Oct 26 06:41:53 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 09:41:53 -0400
Subject: [source]  mac80211: backport fixes for fix for CVE-2017-13080
In-Reply-To: <20171026134148.12436.98859@git-01.infra.lede-project.org>
References: <20171026134148.12436.98859@git-01.infra.lede-project.org>
Message-ID: <mailman.56664.1509025339.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/1dcd8e7cf1c7a84dc658ff55f84b34887860311f

commit 1dcd8e7cf1c7a84dc658ff55f84b34887860311f
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Oct 26 15:31:15 2017 +0200

    mac80211: backport fixes for fix for CVE-2017-13080
    
    Backport two fixes for the fix of CVE-2017-13080, preventing side channel
    attacks and making it work for TKIP.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 ...11-use-constant-time-comparison-with-keys.patch | 33 ++++++++++
 ...on-t-compare-TKIP-TX-MIC-key-in-reinstall.patch | 73 ++++++++++++++++++++++
 2 files changed, 106 insertions(+)

diff --git a/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch
new file mode 100644
index 0000000..03e8201
--- /dev/null
+++ b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch
@@ -0,0 +1,33 @@
+From 2bdd713b92a9cade239d3c7d15205a09f556624d Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Tue, 17 Oct 2017 20:32:07 +0200
+Subject: [PATCH] mac80211: use constant time comparison with keys
+
+Otherwise we risk leaking information via timing side channel.
+
+Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything")
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+ net/mac80211/key.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/mac80211/key.c
++++ b/net/mac80211/key.c
+@@ -19,6 +19,7 @@
+ #include <linux/slab.h>
+ #include <linux/export.h>
+ #include <net/mac80211.h>
++#include <crypto/algapi.h>
+ #include <asm/unaligned.h>
+ #include "ieee80211_i.h"
+ #include "driver-ops.h"
+@@ -635,7 +636,7 @@ int ieee80211_key_link(struct ieee80211_
+ 	 * new version of the key to avoid nonce reuse or replay issues.
+ 	 */
+ 	if (old_key && key->conf.keylen == old_key->conf.keylen &&
+-	    !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) {
++	    !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) {
+ 		ieee80211_key_free_unused(key);
+ 		ret = 0;
+ 		goto out;
diff --git a/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch b/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch
new file mode 100644
index 0000000..1eaf51d
--- /dev/null
+++ b/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch
@@ -0,0 +1,73 @@
+From cfbb0d90a7abb289edc91833d0905931f8805f12 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg at intel.com>
+Date: Tue, 24 Oct 2017 21:12:13 +0200
+Subject: [PATCH] mac80211: don't compare TKIP TX MIC key in reinstall prevention
+
+For the reinstall prevention, the code I had added compares the
+whole key. It turns out though that iwlwifi firmware doesn't
+provide the TKIP TX MIC key as it's not needed in client mode,
+and thus the comparison will always return false.
+
+For client mode, thus always zero out the TX MIC key part before
+doing the comparison in order to avoid accepting the reinstall
+of the key with identical encryption and RX MIC key, but not the
+same TX MIC key (since the supplicant provides the real one.)
+
+Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything")
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+ net/mac80211/key.c | 36 ++++++++++++++++++++++++++++++++++--
+ 1 file changed, 34 insertions(+), 2 deletions(-)
+
+--- a/net/mac80211/key.c
++++ b/net/mac80211/key.c
+@@ -610,6 +610,39 @@ void ieee80211_key_free_unused(struct ie
+ 	ieee80211_key_free_common(key);
+ }
+ 
++static bool ieee80211_key_identical(struct ieee80211_sub_if_data *sdata,
++				    struct ieee80211_key *old,
++				    struct ieee80211_key *new)
++{
++	u8 tkip_old[WLAN_KEY_LEN_TKIP], tkip_new[WLAN_KEY_LEN_TKIP];
++	u8 *tk_old, *tk_new;
++
++	if (!old || new->conf.keylen != old->conf.keylen)
++		return false;
++
++	tk_old = old->conf.key;
++	tk_new = new->conf.key;
++
++	/*
++	 * In station mode, don't compare the TX MIC key, as it's never used
++	 * and offloaded rekeying may not care to send it to the host. This
++	 * is the case in iwlwifi, for example.
++	 */
++	if (sdata->vif.type == NL80211_IFTYPE_STATION &&
++	    new->conf.cipher == WLAN_CIPHER_SUITE_TKIP &&
++	    new->conf.keylen == WLAN_KEY_LEN_TKIP &&
++	    !(new->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
++		memcpy(tkip_old, tk_old, WLAN_KEY_LEN_TKIP);
++		memcpy(tkip_new, tk_new, WLAN_KEY_LEN_TKIP);
++		memset(tkip_old + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8);
++		memset(tkip_new + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8);
++		tk_old = tkip_old;
++		tk_new = tkip_new;
++	}
++
++	return !crypto_memneq(tk_old, tk_new, new->conf.keylen);
++}
++
+ int ieee80211_key_link(struct ieee80211_key *key,
+ 		       struct ieee80211_sub_if_data *sdata,
+ 		       struct sta_info *sta)
+@@ -635,8 +668,7 @@ int ieee80211_key_link(struct ieee80211_
+ 	 * Silently accept key re-installation without really installing the
+ 	 * new version of the key to avoid nonce reuse or replay issues.
+ 	 */
+-	if (old_key && key->conf.keylen == old_key->conf.keylen &&
+-	    !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) {
++	if (ieee80211_key_identical(sdata, old_key, key)) {
+ 		ieee80211_key_free_unused(key);
+ 		ret = 0;
+ 		goto out;


From lede-commits at lists.infradead.org  Thu Oct 26 16:31:53 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 19:31:53 -0400
Subject: [source] ar71xx: fix board.bin used by QCA9886 in Archer C58/C59/C60
In-Reply-To: <20171026233153.9208.35343@git-01.infra.lede-project.org>
References: <20171026233153.9208.35343@git-01.infra.lede-project.org>
Message-ID: <mailman.56716.1509060864.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/e917e51bf91fc7cb5085bda5e67d62520801f9cc

commit e917e51bf91fc7cb5085bda5e67d62520801f9cc
Author: Henryk Heisig <hyniu at o2.pl>
AuthorDate: Thu Jun 29 15:38:22 2017 +0200

    ar71xx: fix board.bin used by QCA9886 in Archer C58/C59/C60
    
    Signed-off-by: Henryk Heisig <hyniu at o2.pl>
---
 target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index d96f40d..6a0a59f 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -143,6 +143,8 @@ case "$FIRMWARE" in
 	archer-c59-v1|\
 	archer-c60-v1)
 		ath10kcal_extract "art" 20480 12064
+		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
+			/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
 		;;
 	esac
 	;;


From lede-commits at lists.infradead.org  Thu Oct 26 16:31:54 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 19:31:54 -0400
Subject: [source]  ath10k-firmware: qca9888 firmware: remove board.bin
In-Reply-To: <20171026233153.9208.35343@git-01.infra.lede-project.org>
References: <20171026233153.9208.35343@git-01.infra.lede-project.org>
Message-ID: <mailman.56717.1509060864.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/f774d68fff236d22430e8919ef6c801ac1c387ab

commit f774d68fff236d22430e8919ef6c801ac1c387ab
Author: Henryk Heisig <hyniu at o2.pl>
AuthorDate: Mon Jul 3 23:59:54 2017 +0200

    ath10k-firmware: qca9888 firmware: remove board.bin
    
    Signed-off-by: Henryk Heisig <hyniu at o2.pl>
---
 package/firmware/ath10k-firmware/Makefile | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile
index b8e1265..9a34ac3 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -243,9 +243,6 @@ define Package/ath10k-firmware-qca9888/install
 		$(PKG_BUILD_DIR)/QCA9888/hw2.0/board-2.bin \
 		$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
 	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/QCA9888/hw2.0/board-2.bin \
-		$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
-	$(INSTALL_DATA) \
 		$(PKG_BUILD_DIR)/QCA9888/hw2.0/firmware-5.bin_10.4-3.2-00072 \
 		$(1)/lib/firmware/ath10k/QCA9888/hw2.0/firmware-5.bin
 endef


From lede-commits at lists.infradead.org  Thu Oct 26 16:31:55 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 19:31:55 -0400
Subject: [source]  kernel: enable CONFIG_ADVISE_SYSCALLS
In-Reply-To: <20171026233153.9208.35343@git-01.infra.lede-project.org>
References: <20171026233153.9208.35343@git-01.infra.lede-project.org>
Message-ID: <mailman.56718.1509060867.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/56342ee2bcbf9bf8918a01045471c7bb7faa1596

commit 56342ee2bcbf9bf8918a01045471c7bb7faa1596
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Oct 14 17:07:19 2017 -0700

    kernel: enable CONFIG_ADVISE_SYSCALLS
    
    Without this, posix_[fm]advise does not work. This causes issues with
    btrfs-progs, which uses fadvise to drop caches.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 target/linux/generic/config-4.9 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9
index 4d2c911..9512e49 100644
--- a/target/linux/generic/config-4.9
+++ b/target/linux/generic/config-4.9
@@ -90,7 +90,7 @@ CONFIG_32BIT=y
 # CONFIG_ADM6996_PHY is not set
 # CONFIG_ADM8211 is not set
 # CONFIG_ADT7316 is not set
-# CONFIG_ADVISE_SYSCALLS is not set
+CONFIG_ADVISE_SYSCALLS=y
 # CONFIG_ADXRS450 is not set
 CONFIG_AEABI=y
 # CONFIG_AFE4403 is not set


From lede-commits at lists.infradead.org  Thu Oct 26 17:31:40 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 20:31:40 -0400
Subject: [source]  iptables: Fix target TRACE issue
In-Reply-To: <20171027003140.18518.1111@git-01.infra.lede-project.org>
References: <20171027003140.18518.1111@git-01.infra.lede-project.org>
Message-ID: <mailman.56719.1509064332.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/378e1a4858b9c51e6fcf396adc602fd835280759

commit 378e1a4858b9c51e6fcf396adc602fd835280759
Author: Martin Wetterwald <martin.wetterwald at corp.ovh.com>
AuthorDate: Thu Jan 12 15:06:00 2017 +0100

    iptables: Fix target TRACE issue
    
    The package kmod-ipt-debug builds the module xt_TRACE, which allows
    users to use '-j TRACE' as target in the chain PREROUTING of the table
    raw in iptables.
    
    The kernel compilation flag NETFILTER_XT_TARGET_TRACE is also enabled so
    that this feature which is implemented deep inside the linux IP stack
    (for example in sk_buff) is compiled.
    
    But a strace of iptables -t raw -I PREROUTING -p icmp -j TRACE reveals
    that an attempt is made to read /usr/lib/iptables/libxt_TRACE.so, which
    fails as this dynamic library is not present on the system.
    
    I created the package iptables-mod-trace which takes care of that, and
    target TRACE now works!
    
    https://dev.openwrt.org/ticket/16694
    https://dev.openwrt.org/ticket/19661
    
    Signed-off-by: Martin Wetterwald <martin.wetterwald at corp.ovh.com>
    [Jo-Philipp Wich: also remove trace extension from builtin extension list
                      and depend on kmod-ipt-raw since its required for rules]
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
    Tested-by: Enrico Mioso <mrkiko.rs at gmail.com>
---
 include/netfilter.mk                    |  1 -
 package/network/utils/iptables/Makefile | 15 +++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/netfilter.mk b/include/netfilter.mk
index 2d53758..1f5050b 100644
--- a/include/netfilter.mk
+++ b/include/netfilter.mk
@@ -366,7 +366,6 @@ IPT_BUILTIN += $(IPT_NAT_EXTRA-y)
 IPT_BUILTIN += $(NF_NATHELPER-y)
 IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y)
 IPT_BUILTIN += $(IPT_ULOG-y)
-IPT_BUILTIN += $(IPT_DEBUG-y)
 IPT_BUILTIN += $(IPT_TPROXY-y)
 IPT_BUILTIN += $(NFNETLINK-y)
 IPT_BUILTIN += $(NFNETLINK_LOG-y)
diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile
index 89f4354..133d98c 100644
--- a/package/network/utils/iptables/Makefile
+++ b/package/network/utils/iptables/Makefile
@@ -216,6 +216,20 @@ define Package/iptables-mod-nflog/description
 
 endef
 
+define Package/iptables-mod-trace
+$(call Package/iptables/Module, +kmod-ipt-debug +kmod-ipt-raw)
+  TITLE:=Netfilter TRACE target
+endef
+
+define Package/iptables-mod-trace/description
+ iptables extension for TRACE target
+
+ Includes:
+  - libxt_TRACE
+
+endef
+
+
 define Package/iptables-mod-nfqueue
 $(call Package/iptables/Module, +kmod-nfnetlink-queue +kmod-ipt-nfqueue)
   TITLE:=Netfilter NFQUEUE target
@@ -584,6 +598,7 @@ $(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m)))
 $(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m)))
 $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m)))
 $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m)))
+$(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m)))
 $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m)))
 $(eval $(call BuildPackage,ip6tables))
 $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m)))


From lede-commits at lists.infradead.org  Thu Oct 26 17:32:39 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 20:32:39 -0400
Subject: [source]  mdadm: Fix config generation
In-Reply-To: <20171027003239.18666.67519@git-01.infra.lede-project.org>
References: <20171027003239.18666.67519@git-01.infra.lede-project.org>
Message-ID: <mailman.56720.1509064398.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/8eadec40bdc205568e34e19b07b2a3035c9223fb

commit 8eadec40bdc205568e34e19b07b2a3035c9223fb
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Tue Oct 17 09:28:39 2017 -0700

    mdadm: Fix config generation
    
    The init script generated something like "DEVICE=/dev/sda" when it should
    have been generating "DEVICE /dev/sda". mdadm errors on this. Patch by jow.
    
    Also changed the default sendmail path to /usr/sbin/sendmail. No package
    in LEDE provides /sbin/sendmail. msmtp provides /usr/sbin/sendmail so use
    that.
    
    Also add a patch to fix file paths for mdadm runtime files. mdadm currently
    errors on them since /run is missing. Once /run is added to stock LEDE, this
    patch can be removed.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    [rewrap commit message]
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/utils/mdadm/Makefile         |  9 ++++-----
 package/utils/mdadm/files/mdadm.init | 11 +++++------
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile
index 1ed62d8..8264242 100644
--- a/package/utils/mdadm/Makefile
+++ b/package/utils/mdadm/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mdadm
 PKG_VERSION:=4.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -32,17 +32,16 @@ endef
 
 define Package/mdadm/description
  A tool for managing Linux Software RAID arrays.
- RAID 0, 1 and 10 support included. 
- If you need RAID 4,5 or 6 functionality please 
+ RAID 0, 1 and 10 support included.
+ If you need RAID 4,5 or 6 functionality please
  install kmod-md-raid456 .
 endef
 
 define Package/mdadm/conffiles
-/etc/mdadm.conf
 /etc/config/mdadm
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS
+TARGET_CFLAGS += -ffunction-sections -fdata-sections -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS -DCONFFILE="/var/etc/mdadm.conf" -DMAP_DIR="/var/run/mdadm" -DMDMON_DIR="/var/run/mdadm" -DFAILED_SLOTS_DIR="/var/run/mdadm/failed-slots"
 TARGET_LDFLAGS += -Wl,--gc-sections
 
 define Build/Compile
diff --git a/package/utils/mdadm/files/mdadm.init b/package/utils/mdadm/files/mdadm.init
index e6624a7..64a50b3 100644
--- a/package/utils/mdadm/files/mdadm.init
+++ b/package/utils/mdadm/files/mdadm.init
@@ -34,14 +34,13 @@ mdadm_common() {
 	local cfg="$1"
 	local email devices
 
-	if [ -x /sbin/sendmail ]; then
-		append_option email "$cfg" email "MAILADDR"
-
+	if [ -x /usr/sbin/sendmail ]; then
+		config_get email "$cfg" email
+		[ -n "$email" ] && printf "MAILADDR %s\n" "$email" >> $CONF
 	fi
 
-	append_option devices "$cfg" devices DEVICE " "
-
-	printf "%s\n%s\n" "$email" "$devices" >> $CONF
+	config_list_foreach "$cfg" devices append_list_item devices " "
+	[ -n "$devices" ] && printf "DEVICE %s\n" "$devices" >> $CONF
 }
 
 mdadm_array() {


From lede-commits at lists.infradead.org  Thu Oct 26 18:26:44 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 26 Oct 2017 21:26:44 -0400
Subject: [source]  mdadm: fix parameter quoting
In-Reply-To: <20171027012644.28440.75790@git-01.infra.lede-project.org>
References: <20171027012644.28440.75790@git-01.infra.lede-project.org>
Message-ID: <mailman.56725.1509067636.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/d4e7af52788fe6a5495064606e674ed6897a69cb

commit d4e7af52788fe6a5495064606e674ed6897a69cb
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Fri Oct 27 03:25:29 2017 +0200

    mdadm: fix parameter quoting
    
    Ensure that path defines are passed quoted to the compiler in order
    to avoid cpp syntax errors.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/utils/mdadm/Makefile | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile
index 8264242..2b44db2 100644
--- a/package/utils/mdadm/Makefile
+++ b/package/utils/mdadm/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mdadm
 PKG_VERSION:=4.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -41,16 +41,20 @@ define Package/mdadm/conffiles
 /etc/config/mdadm
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS -DCONFFILE="/var/etc/mdadm.conf" -DMAP_DIR="/var/run/mdadm" -DMDMON_DIR="/var/run/mdadm" -DFAILED_SLOTS_DIR="/var/run/mdadm/failed-slots"
+TARGET_CFLAGS += \
+	-ffunction-sections -fdata-sections \
+	-DHAVE_STDINT_H -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS \
+	-DCONFFILE='\"/var/etc/mdadm.conf\"' \
+	-DMAP_DIR='\"/var/run/mdadm\"' \
+	-DMDMON_DIR='\"/var/run/mdadm\"' \
+	-DFAILED_SLOTS_DIR='\"/var/run/mdadm/failed-slots\"'
+
 TARGET_LDFLAGS += -Wl,--gc-sections
 
+MAKE_VARS += CHECK_RUN_DIR=0
+
 define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		CC="$(TARGET_CC)" \
-		CFLAGS="$(TARGET_CFLAGS) -DHAVE_STDINT_H" \
-		LDFLAGS="$(TARGET_LDFLAGS)" \
-		CHECK_RUN_DIR=0 \
-		mdadm
+	$(call Build/Compile/Default,mdadm)
 endef
 
 define Package/mdadm/install


From lede-commits at lists.infradead.org  Fri Oct 27 02:20:56 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 05:20:56 -0400
Subject: [source]  tools/findutils: include sysmacros.h explicitly
In-Reply-To: <20171027092056.19633.97247@git-01.infra.lede-project.org>
References: <20171027092056.19633.97247@git-01.infra.lede-project.org>
Message-ID: <mailman.56766.1509096086.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/4a5de1f4309fe2de6a9af8c4d1b0e7b65372cee9

commit 4a5de1f4309fe2de6a9af8c4d1b0e7b65372cee9
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:43:43 2017 +0100

    tools/findutils: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1016
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
---
 tools/findutils/patches/100-include_sysmacros.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/findutils/patches/100-include_sysmacros.patch b/tools/findutils/patches/100-include_sysmacros.patch
new file mode 100644
index 0000000..82b1ee9
--- /dev/null
+++ b/tools/findutils/patches/100-include_sysmacros.patch
@@ -0,0 +1,13 @@
+--- a/gl/lib/mountlist.c
++++ b/gl/lib/mountlist.c
+@@ -17,6 +17,10 @@
+ 
+ #include <config.h>
+ 
++#ifdef MAJOR_IN_SYSMACROS
++# include <sys/sysmacros.h>
++#endif
++
+ #include "mountlist.h"
+ 
+ #include <limits.h>


From lede-commits at lists.infradead.org  Fri Oct 27 02:20:58 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 05:20:58 -0400
Subject: [source]  tools/squashfs: include sysmacros.h explicitly
In-Reply-To: <20171027092056.19633.97247@git-01.infra.lede-project.org>
References: <20171027092056.19633.97247@git-01.infra.lede-project.org>
Message-ID: <mailman.56769.1509096090.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/09bfca653c0ce9db3588c4046c53b28ae67eddbe

commit 09bfca653c0ce9db3588c4046c53b28ae67eddbe
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:47:55 2017 +0100

    tools/squashfs: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1018
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
---
 tools/squashfs/patches/130-include_sysmacros.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/squashfs/patches/130-include_sysmacros.patch b/tools/squashfs/patches/130-include_sysmacros.patch
new file mode 100644
index 0000000..f0149d6
--- /dev/null
+++ b/tools/squashfs/patches/130-include_sysmacros.patch
@@ -0,0 +1,20 @@
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -30,6 +30,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -25,6 +25,7 @@
+ #define FALSE 0
+ #include <stdio.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>


From lede-commits at lists.infradead.org  Fri Oct 27 02:20:57 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 05:20:57 -0400
Subject: [source]  tools/mtd-utils: include sysmacros.h explicitly
In-Reply-To: <20171027092056.19633.97247@git-01.infra.lede-project.org>
References: <20171027092056.19633.97247@git-01.infra.lede-project.org>
Message-ID: <mailman.56770.1509096095.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/855d210f656961cb989c2741748942414dbdefb7

commit 855d210f656961cb989c2741748942414dbdefb7
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:47:33 2017 +0100

    tools/mtd-utils: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1015
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
    [refresh patches]
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../mtd-utils/patches/120-include_sysmacros.patch  | 25 ++++++++++++++++++++++
 .../patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch |  6 ++----
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/tools/mtd-utils/patches/120-include_sysmacros.patch b/tools/mtd-utils/patches/120-include_sysmacros.patch
new file mode 100644
index 0000000..81ba1cf
--- /dev/null
+++ b/tools/mtd-utils/patches/120-include_sysmacros.patch
@@ -0,0 +1,25 @@
+From 9a06f45ec71116d76ee4b268ebe1b33d45b06fc0 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier at gentoo.org>
+Date: Sat, 16 Apr 2016 22:10:43 -0400
+Subject: [PATCH mtd-utils] include sys/sysmacros.h for major/minor/makedev
+
+These functions have always been defined in sys/sysmacros.h under
+Linux C libraries.  For some, including sys/types.h implicitly
+includes that as well, but glibc wants to deprecate that, and some
+others already have.  Include the header explicitly for the funcs.
+
+Signed-off-by: Mike Frysinger <vapier at gentoo.org>
+---
+ include/common.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/include/common.h
++++ b/include/common.h
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <inttypes.h>
++#include <sys/sysmacros.h>
+ #include "version.h"
+ 
+ #ifndef PROGRAM_NAME
diff --git a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch
index 46014e7..70e6a7e 100644
--- a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch
+++ b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch
@@ -1,7 +1,5 @@
-Index: mtd-utils-1.5.2/mkfs.jffs2.c
-===================================================================
---- mtd-utils-1.5.2.orig/mkfs.jffs2.c
-+++ mtd-utils-1.5.2/mkfs.jffs2.c
+--- a/mkfs.jffs2.c
++++ b/mkfs.jffs2.c
 @@ -108,7 +108,7 @@ static char *rootdir = default_rootdir;
  static int verbose = 0;
  static int squash_uids = 0;


From lede-commits at lists.infradead.org  Fri Oct 27 02:20:59 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 05:20:59 -0400
Subject: [source]  tools/squashfs4: include sysmacros.h explicitly
In-Reply-To: <20171027092056.19633.97247@git-01.infra.lede-project.org>
References: <20171027092056.19633.97247@git-01.infra.lede-project.org>
Message-ID: <mailman.56771.1509096101.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/4425fa84dad57b6b0046b97e224d50b33f1f536b

commit 4425fa84dad57b6b0046b97e224d50b33f1f536b
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:48:19 2017 +0100

    tools/squashfs4: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1017
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
    [refresh patches]
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 tools/squashfs4/patches/130-include_sysmacros.patch  | 20 ++++++++++++++++++++
 ...170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch |  8 ++++----
 tools/squashfs4/patches/180-openbsd_compat.patch     |  2 +-
 .../squashfs4/patches/190-no_nonstatic_inline.patch  |  6 +++---
 .../patches/200-add-fixed-timestamp-option.patch     | 16 ++++++++--------
 5 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/tools/squashfs4/patches/130-include_sysmacros.patch b/tools/squashfs4/patches/130-include_sysmacros.patch
new file mode 100644
index 0000000..e884513
--- /dev/null
+++ b/tools/squashfs4/patches/130-include_sysmacros.patch
@@ -0,0 +1,20 @@
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -33,6 +33,7 @@
+ #include <stddef.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -30,6 +30,7 @@
+ #include "xattr.h"
+ 
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ 
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_deflate, *to_writer, *from_writer;
diff --git a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
index ad69b19..bc7d6c7 100644
--- a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
+++ b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
@@ -16,7 +16,7 @@
  #define SQUASHFS_METADATA_LOG		13
 --- a/squashfs-tools/unsquashfs.c
 +++ b/squashfs-tools/unsquashfs.c
-@@ -1463,10 +1463,12 @@ int read_super(char *source)
+@@ -1464,10 +1464,12 @@ int read_super(char *source)
  	 */
  	read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block),
  		&sBlk_4);
@@ -31,7 +31,7 @@
  			sBlk_4.s_minor == 0) {
  		s_ops.squashfs_opendir = squashfs_opendir_4;
  		s_ops.read_fragment = read_fragment_4;
-@@ -1479,7 +1481,11 @@ int read_super(char *source)
+@@ -1480,7 +1482,11 @@ int read_super(char *source)
  		/*
  		 * Check the compression type
  		 */
@@ -44,7 +44,7 @@
  		return TRUE;
  	}
  
-@@ -1494,8 +1500,10 @@ int read_super(char *source)
+@@ -1495,8 +1501,10 @@ int read_super(char *source)
  	 * Check it is a SQUASHFS superblock
  	 */
  	swap = 0;
@@ -57,7 +57,7 @@
  			squashfs_super_block_3 sblk;
  			ERROR("Reading a different endian SQUASHFS filesystem "
  				"on %s\n", source);
-@@ -1573,7 +1581,11 @@ int read_super(char *source)
+@@ -1574,7 +1582,11 @@ int read_super(char *source)
  	/*
  	 * 1.x, 2.x and 3.x filesystems use gzip compression.
  	 */
diff --git a/tools/squashfs4/patches/180-openbsd_compat.patch b/tools/squashfs4/patches/180-openbsd_compat.patch
index b9c1b59..4f7afd8 100644
--- a/tools/squashfs4/patches/180-openbsd_compat.patch
+++ b/tools/squashfs4/patches/180-openbsd_compat.patch
@@ -8,8 +8,8 @@
 +#include <sys/param.h>
 +#endif
  #include <sys/types.h>
+ #include <sys/sysmacros.h>
  #include <sys/stat.h>
- #include <fcntl.h>
 --- a/squashfs-tools/unsquashfs.h
 +++ b/squashfs-tools/unsquashfs.h
 @@ -25,6 +25,9 @@
diff --git a/tools/squashfs4/patches/190-no_nonstatic_inline.patch b/tools/squashfs4/patches/190-no_nonstatic_inline.patch
index 27ebc6a..8cab120 100644
--- a/tools/squashfs4/patches/190-no_nonstatic_inline.patch
+++ b/tools/squashfs4/patches/190-no_nonstatic_inline.patch
@@ -1,6 +1,6 @@
 --- a/squashfs-tools/mksquashfs.c
 +++ b/squashfs-tools/mksquashfs.c
-@@ -735,13 +735,13 @@ void cache_block_put(struct file_buffer
+@@ -736,13 +736,13 @@ void cache_block_put(struct file_buffer
  			+ (((char *)A) - data_cache)))
  
  
@@ -16,7 +16,7 @@
  {
  	pthread_mutex_lock(&progress_mutex);
  	pthread_cond_signal(&progress_wait);
-@@ -749,7 +749,7 @@ inline void update_progress_bar()
+@@ -750,7 +750,7 @@ inline void update_progress_bar()
  }
  
  
@@ -25,7 +25,7 @@
  {
  	TRACE("Waiting for thread %d\n", i);
  	while(thread[i] != 0)
-@@ -3358,7 +3358,7 @@ struct inode_info *lookup_inode(struct s
+@@ -3359,7 +3359,7 @@ struct inode_info *lookup_inode(struct s
  }
  
  
diff --git a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
index 5cec51f..7411b97 100644
--- a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
+++ b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
@@ -1,6 +1,6 @@
 --- a/squashfs-tools/mksquashfs.c
 +++ b/squashfs-tools/mksquashfs.c
-@@ -175,6 +175,9 @@ unsigned int cache_bytes = 0, cache_size
+@@ -176,6 +176,9 @@ unsigned int cache_bytes = 0, cache_size
  /* inode lookup table */
  squashfs_inode *inode_lookup_table = NULL;
  
@@ -10,7 +10,7 @@
  /* in memory directory data */
  #define I_COUNT_SIZE		128
  #define DIR_ENTRIES		32
-@@ -2452,6 +2455,8 @@ again:
+@@ -2453,6 +2456,8 @@ again:
  restat:
  	fstat(file, &buf2);
  	close(file);
@@ -19,7 +19,7 @@
  	if(read_size != buf2.st_size) {
  		memcpy(buf, &buf2, sizeof(struct stat));
  		file_buffer->error = 2;
-@@ -3612,7 +3617,7 @@ void dir_scan(squashfs_inode *inode, cha
+@@ -3613,7 +3618,7 @@ void dir_scan(squashfs_inode *inode, cha
  		buf.st_mode = S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR;
  		buf.st_uid = getuid();
  		buf.st_gid = getgid();
@@ -28,7 +28,7 @@
  		buf.st_dev = 0;
  		buf.st_ino = 0;
  		dir_ent->inode = lookup_inode(&buf);
-@@ -3623,6 +3628,8 @@ void dir_scan(squashfs_inode *inode, cha
+@@ -3624,6 +3629,8 @@ void dir_scan(squashfs_inode *inode, cha
  				pathname, strerror(errno));
  			return;
  		}
@@ -37,7 +37,7 @@
  		dir_ent->inode = lookup_inode(&buf);
  	}
  
-@@ -3677,6 +3684,8 @@ struct dir_info *dir_scan1(char *pathnam
+@@ -3678,6 +3685,8 @@ struct dir_info *dir_scan1(char *pathnam
  				filename, strerror(errno));
  			continue;
  		}
@@ -46,7 +46,7 @@
  
  		if((buf.st_mode & S_IFMT) != S_IFREG &&
  			(buf.st_mode & S_IFMT) != S_IFDIR &&
-@@ -3795,7 +3804,7 @@ struct dir_info *dir_scan2(struct dir_in
+@@ -3796,7 +3805,7 @@ struct dir_info *dir_scan2(struct dir_in
  		buf.st_gid = pseudo_ent->dev->gid;
  		buf.st_rdev = makedev(pseudo_ent->dev->major,
  			pseudo_ent->dev->minor);
@@ -55,7 +55,7 @@
  		buf.st_ino = pseudo_ino ++;
  
  		if(pseudo_ent->dev->type == 'f') {
-@@ -4674,6 +4683,15 @@ int main(int argc, char *argv[])
+@@ -4675,6 +4684,15 @@ int main(int argc, char *argv[])
  			progress = FALSE;
  		else if(strcmp(argv[i], "-no-exports") == 0)
  			exportable = FALSE;
@@ -71,7 +71,7 @@
  		else if(strcmp(argv[i], "-processors") == 0) {
  			if((++i == argc) || (processors =
  					strtol(argv[i], &b, 10), *b != '\0')) {
-@@ -5314,7 +5332,7 @@ printOptions:
+@@ -5315,7 +5333,7 @@ printOptions:
  	sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, no_fragments,
  		always_use_fragments, duplicate_checking, exportable,
  		no_xattrs, comp_opts);


From lede-commits at lists.infradead.org  Fri Oct 27 02:21:00 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 05:21:00 -0400
Subject: [source]  ramips: fix Youku-YK1 support
In-Reply-To: <20171027092056.19633.97247@git-01.infra.lede-project.org>
References: <20171027092056.19633.97247@git-01.infra.lede-project.org>
Message-ID: <mailman.56772.1509096115.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch master:
https://git.lede-project.org/9786b53efb8225f5b6f21921e684b40b9febe61e

commit 9786b53efb8225f5b6f21921e684b40b9febe61e
Author: Edmunt Pienkowsky <roed at onet.eu>
AuthorDate: Sat Oct 21 11:07:43 2017 +0200

    ramips: fix Youku-YK1 support
    
    Remove the ephy-pins from the ethernet device tree node. The ephy-pins
    are useed to controll the ePHY LEDs and this board doesn't have these.
    Instead one of the ePHY pins is used in GPIO mode to control the WAN
    LED.
    
    Use the switch LED trigger to control the WAN LED. Move the power LED
    handling to diag.sh to show the boot status via this LED.
    
    Add the missing kernel packages for USB and microSD card reader to the
    default package selection.
    
    Fix the maximum image size value. The board has a 32MByte flash chip.
    
    Fixes: FS#1055
    
    Signed-off-by: Edmunt Pienkowsky <roed at onet.eu>
    [make the commit message more verbose, remove GPIO pinmux for pins not
    used as GPIOs]
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 target/linux/ramips/base-files/etc/board.d/01_leds | 2 +-
 target/linux/ramips/base-files/etc/diag.sh         | 3 ++-
 target/linux/ramips/dts/YOUKU-YK1.dts              | 3 +--
 target/linux/ramips/image/mt7620.mk                | 3 ++-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 75ab0da..037331d 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -461,9 +461,9 @@ zte-q7)
 	set_wifi_led "$board:blue:status"
 	;;
 youku-yk1)
-	ucidef_set_led_default "power" "power" "$board:blue:power" "1"
 	set_wifi_led "$board:blue:air"
 	set_usb_led "$board:blue:usb"
+	ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x10"
 	;;
 esac
 
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index 4411bab..3b3c455 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -134,7 +134,8 @@ get_status_led() {
 	wl-330n3g|\
 	wli-tx4-ag300n|\
 	y1|\
-	y1s)
+	y1s|\
+	youku-yk1)
 		status_led="$board:blue:power"
 		;;
 	db-wrt01|\
diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts b/target/linux/ramips/dts/YOUKU-YK1.dts
index d4e3c90..8a0e081 100644
--- a/target/linux/ramips/dts/YOUKU-YK1.dts
+++ b/target/linux/ramips/dts/YOUKU-YK1.dts
@@ -96,7 +96,7 @@
 &pinctrl {
 	state_default: pinctrl0 {
 		default {
-			ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd";
+			ralink,group = "i2c", "rgmii1", "ephy", "wled";
 			ralink,function = "gpio";
 		};
 	};
@@ -104,7 +104,6 @@
 
 &ethernet {
 	pinctrl-names = "default";
-	pinctrl-0 = <&ephy_pins>;
 	mtd-mac-address = <&factory 0x4>;
 	mediatek,portmap = "llllw";
 };
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 8eac6f5..2f3f59e 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -505,8 +505,9 @@ TARGET_DEVICES += y1s
 
 define Device/youku-yk1
   DTS := YOUKU-YK1
-  IMAGE_SIZE := $(ralink_default_fw_size_16M)
+  IMAGE_SIZE := $(ralink_default_fw_size_32M)
   DEVICE_TITLE := YOUKU YK1
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += youku-yk1
 


From lede-commits at lists.infradead.org  Fri Oct 27 02:44:20 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 05:44:20 -0400
Subject: [source]  Revert "wpa_supplicant: log to syslog instead of stdout"
In-Reply-To: <20171027094420.25140.51272@git-01.infra.lede-project.org>
References: <20171027094420.25140.51272@git-01.infra.lede-project.org>
Message-ID: <mailman.56781.1509097492.26984.lede-commits@lists.infradead.org>

jow pushed a commit to source.git, branch master:
https://git.lede-project.org/75021e9411cd4c49e179ab76a51a388ef8276190

commit 75021e9411cd4c49e179ab76a51a388ef8276190
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Fri Oct 27 11:37:11 2017 +0200

    Revert "wpa_supplicant: log to syslog instead of stdout"
    
    This reverts commit e7373e489d8a215402d6b0c408a26188342c7c17.
    
    Support of "-s" depends on the CONFIG_DEBUG_SYSLOG compile time flag which
    is not enabled for all build variants.
    
    Revert the change for now until we can properly examine the size impact of
    CONFIG_DEBUG_SYSLOG.
    
    Fixes FS#1117.
    
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 package/network/services/hostapd/Makefile         | 2 +-
 package/network/services/hostapd/files/hostapd.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 5a353e6..f1d057d 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 16925d5..144e49b 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -773,7 +773,7 @@ wpa_supplicant_run() {
 
 	_wpa_supplicant_common "$ifname"
 
-	/usr/sbin/wpa_supplicant -B -s \
+	/usr/sbin/wpa_supplicant -B \
 		${network_bridge:+-b $network_bridge} \
 		-P "/var/run/wpa_supplicant-${ifname}.pid" \
 		-D ${_w_driver:-wext} \


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:21 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:21 -0400
Subject: [source]  ath10k-ct: switch to AutoProbe
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56817.1509102543.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/5172f799a3e595167d3bfa24d4327230d39fdf7f

commit 5172f799a3e595167d3bfa24d4327230d39fdf7f
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Jul 24 13:11:33 2017 +0200

    ath10k-ct: switch to AutoProbe
    
    Now that we have working module dependency generation, we can switch to
    AutoProbe and let modprobe handle loading required modules.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/ath10k-ct/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index 6e134e1..9b152dd 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -33,7 +33,7 @@ define KernelPackage/ath10k-ct
   FILES:=\
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
 	$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
-  AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
+  AUTOLOAD:=$(call AutoProbe,ath10k_pci)
 endef
 
 NOSTDINC_FLAGS = \


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:20 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:20 -0400
Subject: [source]  ath10k-ct: define module directories
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56818.1509102543.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/dd9df74dfa1fb9c1d94453dfc3590169e85726d3

commit dd9df74dfa1fb9c1d94453dfc3590169e85726d3
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Jul 21 15:20:12 2017 +0200

    ath10k-ct: define module directories
    
    Define the module subdir so our buildsystem properly picks up the
    Module.symvers.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/ath10k-ct/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index a894773..6e134e1 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -14,6 +14,7 @@ PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814
 
 PKG_MAINTAINER:=Ben Greear <greearb at candelatech.com>
 PKG_BUILD_PARALLEL:=1
+PKG_EXTMOD_SUBDIRS:=ath10k
 
 # Build the 4.13 ath10k-ct driver version.  Other options are "-4.9", or
 # leave un-defined for 4.7 kernel.  Probably this should match as closely as


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:24 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:24 -0400
Subject: [source]  broadcom-wl: switch to AutoProbe
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56819.1509102543.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/7eda0d227276fd2928aeb212dd566e4dc4e2ac4d

commit 7eda0d227276fd2928aeb212dd566e4dc4e2ac4d
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sun Aug 27 20:01:51 2017 +0200

    broadcom-wl: switch to AutoProbe
    
    Now that we have working module dependency generation, we can switch to
    AutoProbe and let modprobe handle loading required modules.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/broadcom-wl/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile
index cca0023..fe1c522 100644
--- a/package/kernel/broadcom-wl/Makefile
+++ b/package/kernel/broadcom-wl/Makefile
@@ -43,7 +43,7 @@ define KernelPackage/brcm-wl/Default
   DEPENDS:=@TARGET_brcm47xx||TARGET_brcm63xx +wireless-tools
   TITLE:=Kernel driver for BCM43xx chipsets
   FILES:=$(PKG_BUILD_DIR)/driver$(1)/wl.ko $(PKG_BUILD_DIR)/glue/wl_glue.ko
-  AUTOLOAD:=$(call AutoLoad,30,wl_glue wl)
+  AUTOLOAD:=$(call AutoProbe,wl)
 endef
 
 define KernelPackage/brcm-wl/Default/description


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:26 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:26 -0400
Subject: [source]  mt76: switch to AutoProbe
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56820.1509102543.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/5df30a169c5f6366e21a0bbbe87b3e13ccbca63b

commit 5df30a169c5f6366e21a0bbbe87b3e13ccbca63b
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Jul 24 11:16:21 2017 +0200

    mt76: switch to AutoProbe
    
    Now that we have working module dependency generation, we can switch to
    AutoProbe and let modprobe handle loading required modules.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/mt76/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 3428ea1..6214f37 100644
--- a/package/kernel/mt76/Makefile
+++ b/package/kernel/mt76/Makefile
@@ -39,7 +39,6 @@ define KernelPackage/mt76-core
   TITLE:=MediaTek MT76xx wireless driver
   FILES:=\
 	$(PKG_BUILD_DIR)/mt76.ko
-  AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76)
 endef
 
 define KernelPackage/mt76x2
@@ -48,7 +47,7 @@ define KernelPackage/mt76x2
   DEPENDS+=+kmod-mt76-core
   FILES:=\
 	$(PKG_BUILD_DIR)/mt76x2e.ko
-  AUTOLOAD:=$(call AutoLoad,51,mt76x2e)
+  AUTOLOAD:=$(call AutoProbe,mt76x2e)
 endef
 
 define KernelPackage/mt7603
@@ -57,7 +56,7 @@ define KernelPackage/mt7603
   DEPENDS+=+kmod-mt76-core
   FILES:=\
 	$(PKG_BUILD_DIR)/mt7603e.ko
-  AUTOLOAD:=$(call AutoLoad,51,mt7603e)
+  AUTOLOAD:=$(call AutoProbe,mt7603e)
 endef
 
 NOSTDINC_FLAGS = \


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:23 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:23 -0400
Subject: [source]  broadcom-wl: reorder kmod build and pass EXTRA_VERSIONS
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56821.1509102543.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/5cee71904f4792840a1153d8ebbd04c6f93c3c98

commit 5cee71904f4792840a1153d8ebbd04c6f93c3c98
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Jul 21 16:23:06 2017 +0200

    broadcom-wl: reorder kmod build and pass EXTRA_VERSIONS
    
    Reoder the build to build the glue module first and pass the glue module's
    Module.symvers to the wl driver builds.
    
    This allows modpost to properly store a wl_glue dependency in the driver.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/broadcom-wl/Makefile | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile
index c174141..cca0023 100644
--- a/package/kernel/broadcom-wl/Makefile
+++ b/package/kernel/broadcom-wl/Makefile
@@ -112,23 +112,25 @@ define Build/Prepare
 endef
 
 define Build/Compile
+	# Compile glue driver
+	$(MAKE_KMOD) -C "$(LINUX_DIR)" \
+		SUBDIRS="$(PKG_BUILD_DIR)/glue" \
+		modules
+
 	# Compile the kernel part
 	$(MAKE_KMOD) \
 		SUBDIRS="$(PKG_BUILD_DIR)/driver" \
 		MODFLAGS="-DMODULE -mlong-calls" \
+		KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \
 		modules
 
 	$(MAKE_KMOD) \
 		SUBDIRS="$(PKG_BUILD_DIR)/driver-mini" \
 		MODFLAGS="-DMODULE -mlong-calls" \
 		BUILD_TYPE="wl_apsta_mini" \
+		KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \
 		modules
 
-	# Compile glue driver
-	$(MAKE_KMOD) -C "$(LINUX_DIR)" \
-		SUBDIRS="$(PKG_BUILD_DIR)/glue" \
-		modules                                        
-
 	# Compile libshared
 	$(MAKE) -C $(PKG_BUILD_DIR)/shared \
 		$(TARGET_CONFIGURE_OPTS) \


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:25 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:25 -0400
Subject: [source]  mac80211: ath10k: switch to AutoProbe
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56822.1509102567.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/3689f7c8efe1d43a384ab2f03819fa1774a64da5

commit 3689f7c8efe1d43a384ab2f03819fa1774a64da5
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Jul 24 13:14:20 2017 +0200

    mac80211: ath10k: switch to AutoProbe
    
    Now that we have working module dependency generation, we can switch to
    AutoProbe and let modprobe handle loading required modules.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/mac80211/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 7e9b5ad..fa90b36 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -320,7 +320,7 @@ define KernelPackage/ath10k
   FILES:= \
 	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
 	$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
-  AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci)
+  AUTOLOAD:=$(call AutoProbe,ath10k_pci)
 endef
 
 define KernelPackage/ath10k/description


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:18 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:18 -0400
Subject: [source]  acx-mac80211: switch to AutoProbe
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56823.1509102567.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/860aba9e48198e237208cd264c76479e19469d71

commit 860aba9e48198e237208cd264c76479e19469d71
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Jul 24 13:12:28 2017 +0200

    acx-mac80211: switch to AutoProbe
    
    Now that we have working module dependency generation, we can switch to
    AutoProbe and let modprobe handle loading required modules.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/acx-mac80211/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile
index 5629b05..05b1304 100644
--- a/package/kernel/acx-mac80211/Makefile
+++ b/package/kernel/acx-mac80211/Makefile
@@ -29,7 +29,7 @@ define KernelPackage/acx-mac80211
   TITLE:=ACX1xx mac80211 driver
   DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel @LINUX_3_18||LINUX_4_4 +kmod-mac80211
   FILES:=$(PKG_BUILD_DIR)/acx-mac80211.ko
-  AUTOLOAD:=$(call AutoLoad,50,mac80211 acx-mac80211)
+  AUTOLOAD:=$(call AutoProbe,acx-mac80211)
   MAINTAINER:=Florian Fainelli <florian at openwrt.org>
   MENU:=1
 endef


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:22 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:22 -0400
Subject: [source]  broadcom-wl: define module directories
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56824.1509102589.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/557e98ebcc26310dfdff4269db6ec2a412011ac0

commit 557e98ebcc26310dfdff4269db6ec2a412011ac0
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Jul 21 15:46:35 2017 +0200

    broadcom-wl: define module directories
    
    Define the module subdirs so our build system properly picks up the
    Module.symvers.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/broadcom-wl/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile
index 2f3a0c5..c174141 100644
--- a/package/kernel/broadcom-wl/Makefile
+++ b/package/kernel/broadcom-wl/Makefile
@@ -22,6 +22,8 @@ ifeq ($(ARCH),mips)
 PKG_HASH:=ca6a86ca3e3e9c85b6dbb665b35bcbf338c37829c1b2f1994487d55664886045
 endif
 
+PKG_EXTMOD_SUBDIRS:=driver driver-mini glue
+
 PKG_USE_MIPS16:=0
 PKG_FLAGS:=nonshared
 


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:17 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:17 -0400
Subject: [source]  kernel: collect module symvers for external modules
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56831.1509103460.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/2e496876c60cc45a06ac610e02c00ec767028b64

commit 2e496876c60cc45a06ac610e02c00ec767028b64
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Jul 20 22:34:54 2017 +0200

    kernel: collect module symvers for external modules
    
    Collect module symvers for all external modules to make them available
    for modpost. This fixes dependencies for most external modules.
    
    Example:
    
    Before:
    
    root at LEDE:/# modinfo mt76
    module:         /lib/modules/4.4.74/mt76.ko
    license:        Dual BSD/GPL
    depends:
    
    After:
    
    root at LEDE:/# modinfo mt76
    module:         /lib/modules/4.4.74/mt76.ko
    license:        Dual BSD/GPL
    depends:        mac80211,cfg80211
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 include/kernel.mk | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/include/kernel.mk b/include/kernel.mk
index 75797cf..f2099ad 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -123,6 +123,32 @@ ifdef CONFIG_USE_SPARSE
   KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
 endif
 
+PKG_EXTMOD_SUBDIRS ?= .
+
+define populate_module_symvers
+	cat /dev/null > $(PKG_INFO_DIR)/$(PKG_NAME).symvers; \
+	for subdir in $(PKG_EXTMOD_SUBDIRS); do \
+		cat $(PKG_INFO_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \
+	done
+endef
+
+define collect_module_symvers
+	for subdir in $(PKG_EXTMOD_SUBDIRS); do \
+		grep -F $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
+	done; \
+	sort -u $(PKG_BUILD_DIR)/Module.symvers.tmp > $(PKG_BUILD_DIR)/Module.symvers; \
+	mv $(PKG_BUILD_DIR)/Module.symvers $(PKG_INFO_DIR)/$(PKG_NAME).symvers
+endef
+
+define KernelPackage/hooks
+  ifneq ($(PKG_NAME),kernel)
+    Hooks/Compile/Pre += populate_module_symvers
+    Hooks/Compile/Post += collect_module_symvers
+  endif
+  define KernelPackage/hooks
+  endef
+endef
+
 define KernelPackage/Defaults
   FILES:=
   AUTOLOAD:=
@@ -230,6 +256,7 @@ $(call KernelPackage/$(1)/config)
   endif
 
   $(call KernelPackage/depends)
+  $(call KernelPackage/hooks)
 
   ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),)
     ifneq ($(strip $(FILES)),)


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:19 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:19 -0400
Subject: [source]  acx-mac80211: drop PKG_BUILD_DEPENDS
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56832.1509103460.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/70e7efb12f0458ea5eaa1aa3423a16734f78b8c5

commit 70e7efb12f0458ea5eaa1aa3423a16734f78b8c5
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Mon Jul 24 13:12:54 2017 +0200

    acx-mac80211: drop PKG_BUILD_DEPENDS
    
    We already have a DEPENDS on mac80211, which should be enough to ensure
    headers are available before build.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/acx-mac80211/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile
index 05b1304..a3d5de2 100644
--- a/package/kernel/acx-mac80211/Makefile
+++ b/package/kernel/acx-mac80211/Makefile
@@ -16,7 +16,6 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2014-02-16
 PKG_SOURCE_VERSION:=b6fc31491020cb01d2cd1acc170cfa03ced7e726
 PKG_MIRROR_HASH:=58590245715f0e5fb4b57aab6d91071dfb6a97d3273f5aee0b97b1edee030ed0
-PKG_BUILD_DEPENDS:=mac80211
 
 PKG_CONFIG_DEPENDS:= \
 	CONFIG_PACKAGE_MAC80211_DEBUGFS \


From lede-commits at lists.infradead.org  Fri Oct 27 04:08:27 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 27 Oct 2017 07:08:27 -0400
Subject: [source]  mwlwifi: switch to AutoProbe
In-Reply-To: <20171027110817.14402.29314@git-01.infra.lede-project.org>
References: <20171027110817.14402.29314@git-01.infra.lede-project.org>
Message-ID: <mailman.56833.1509103598.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/471d5dc6e3c16a2bef9bde2b788b563a00357292

commit 471d5dc6e3c16a2bef9bde2b788b563a00357292
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sun Aug 27 20:03:58 2017 +0200

    mwlwifi: switch to AutoProbe
    
    Now that we have working module dependency generation, we can switch to
    AutoProbe and let modprobe handle loading required modules.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/mwlwifi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile
index cdb0f4f..e28d554 100644
--- a/package/kernel/mwlwifi/Makefile
+++ b/package/kernel/mwlwifi/Makefile
@@ -30,7 +30,7 @@ define KernelPackage/mwlwifi
   TITLE:=Marvell 88W8864 wireless driver
   DEPENDS:=+kmod-mac80211 + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT + at DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu
   FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko
-  AUTOLOAD:=$(call AutoLoad,50,mac80211 mwlwifi)
+  AUTOLOAD:=$(call AutoProbe,mwlwifi)
 endef
 
 NOSTDINC_FLAGS = \


From lede-commits at lists.infradead.org  Sat Oct 28 02:25:19 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 28 Oct 2017 05:25:19 -0400
Subject: [source] build: ensure PKG_INFO_DIR exists before trying to use it
In-Reply-To: <20171028092513.16475.87212@git-01.infra.lede-project.org>
References: <20171028092513.16475.87212@git-01.infra.lede-project.org>
Message-ID: <mailman.56933.1509182745.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/e5e5c3f5fd38f1f0dd8d4672fc64bdd0a1a01add

commit e5e5c3f5fd38f1f0dd8d4672fc64bdd0a1a01add
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Oct 28 11:19:25 2017 +0200

    build: ensure PKG_INFO_DIR exists before trying to use it
    
    PKG_INFO_DIR is only created at the finish step of the first package
    build, but kernel modules now use it at the start. Doing a parallel build
    could cause a kernel module to be the first package, breaking the build.
    
    Fix this by ensuring the directory exists.
    
    Fixes: 2e496876c60c ("kernel: collect module symvers for external modules")
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 include/kernel.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/kernel.mk b/include/kernel.mk
index f2099ad..f2d2a12 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -133,6 +133,7 @@ define populate_module_symvers
 endef
 
 define collect_module_symvers
+	@mkdir -p $(PKG_INFO_DIR)
 	for subdir in $(PKG_EXTMOD_SUBDIRS); do \
 		grep -F $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
 	done; \


From lede-commits at lists.infradead.org  Sat Oct 28 02:58:54 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 28 Oct 2017 05:58:54 -0400
Subject: [source]  build: actually fix the creation of PKG_INFO_DIR
In-Reply-To: <20171028095854.23723.44913@git-01.infra.lede-project.org>
References: <20171028095854.23723.44913@git-01.infra.lede-project.org>
Message-ID: <mailman.56937.1509184757.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/22b5e285ab36ee0a0dae97d4f60dc77fc3943bee

commit 22b5e285ab36ee0a0dae97d4f60dc77fc3943bee
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Oct 28 11:57:39 2017 +0200

    build: actually fix the creation of PKG_INFO_DIR
    
    The creation was accidentally moved to the wrong hook, fix it by moving
    it to the pre hook.
    
    Fixes: e5e5c3f5fd38 ("build: ensure PKG_INFO_DIR exists before trying to use it")
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 include/kernel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index f2d2a12..d620fdc 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -126,6 +126,7 @@ endif
 PKG_EXTMOD_SUBDIRS ?= .
 
 define populate_module_symvers
+	@mkdir -p $(PKG_INFO_DIR)
 	cat /dev/null > $(PKG_INFO_DIR)/$(PKG_NAME).symvers; \
 	for subdir in $(PKG_EXTMOD_SUBDIRS); do \
 		cat $(PKG_INFO_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \
@@ -133,7 +134,6 @@ define populate_module_symvers
 endef
 
 define collect_module_symvers
-	@mkdir -p $(PKG_INFO_DIR)
 	for subdir in $(PKG_EXTMOD_SUBDIRS); do \
 		grep -F $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \
 	done; \


From lede-commits at lists.infradead.org  Sat Oct 28 04:59:28 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 28 Oct 2017 07:59:28 -0400
Subject: [source]  arc770: mark as source-only
In-Reply-To: <20171028115928.18217.88711@git-01.infra.lede-project.org>
References: <20171028115928.18217.88711@git-01.infra.lede-project.org>
Message-ID: <mailman.56944.1509191994.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/8b9cdebc9c533f3933874b6746829eb4bdbb7647

commit 8b9cdebc9c533f3933874b6746829eb4bdbb7647
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sat Oct 28 13:42:28 2017 +0200

    arc770: mark as source-only
    
    Mark target arc770 as source-only as it has package compile issues
    (e.g. iproute2) due to the usage of uClibc.
    As a prerequisite to be included in future releases the arc770 target
    needs to switch either to glibc or musl.
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 target/linux/arc770/generic/target.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/arc770/generic/target.mk b/target/linux/arc770/generic/target.mk
index 15f598e..2ca59b5 100644
--- a/target/linux/arc770/generic/target.mk
+++ b/target/linux/arc770/generic/target.mk
@@ -1,5 +1,5 @@
 BOARDNAME:=Generic
-FEATURES += ramdisk usb ext4
+FEATURES += ramdisk usb ext4 source-only
 
 define Target/Description
 	Build firmware images for generic ARC 770D based boards.


From lede-commits at lists.infradead.org  Sun Oct 29 08:33:04 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 11:33:04 -0400
Subject: [source]  layerscape: Remove netfilter and LZ4 config symbols
In-Reply-To: <20171029153304.3561.28864@git-01.infra.lede-project.org>
References: <20171029153304.3561.28864@git-01.infra.lede-project.org>
Message-ID: <mailman.57000.1509291347.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/6a457749a46eaed82fef66d65bd6125eebf93aa0

commit 6a457749a46eaed82fef66d65bd6125eebf93aa0
Author: Mathew McBride <matt at traverse.com.au>
AuthorDate: Fri Oct 13 15:23:07 2017 +1100

    layerscape: Remove netfilter and LZ4 config symbols
    
    These conflict with the kmod packages (such as nf-netlink)
    
    Signed-off-by: Mathew McBride <matt at traverse.com.au>
    [Add same changes for arm8_32b subtarget and refresh config]
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/layerscape/armv8_32b/config-4.9 | 85 ----------------------------
 target/linux/layerscape/armv8_64b/config-4.9 | 79 --------------------------
 2 files changed, 164 deletions(-)

diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9
index f0687f3..bb45901 100644
--- a/target/linux/layerscape/armv8_32b/config-4.9
+++ b/target/linux/layerscape/armv8_32b/config-4.9
@@ -2,7 +2,6 @@ CONFIG_ABX500_CORE=y
 CONFIG_AD525X_DPOT=y
 CONFIG_AD525X_DPOT_I2C=y
 # CONFIG_AD525X_DPOT_SPI is not set
-CONFIG_ADVISE_SYSCALLS=y
 CONFIG_AHCI_IMX=y
 CONFIG_AHCI_QORIQ=y
 CONFIG_AK8975=y
@@ -304,7 +303,6 @@ CONFIG_DEBUG_RODATA=y
 # CONFIG_DEBUG_USER is not set
 CONFIG_DECOMPRESS_BZIP2=y
 CONFIG_DECOMPRESS_GZIP=y
-CONFIG_DECOMPRESS_LZ4=y
 CONFIG_DECOMPRESS_LZMA=y
 CONFIG_DECOMPRESS_LZO=y
 CONFIG_DECOMPRESS_XZ=y
@@ -524,7 +522,6 @@ CONFIG_GPIO_TPS6586X=y
 CONFIG_GPIO_TPS65910=y
 CONFIG_GPIO_TWL4030=y
 CONFIG_GPIO_XILINX=y
-CONFIG_GRACE_PERIOD=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
@@ -669,11 +666,6 @@ CONFIG_IOMMU_HELPER=y
 # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
 CONFIG_IOMMU_SUPPORT=y
 CONFIG_IOSCHED_CFQ=y
-CONFIG_IP6_NF_FILTER=y
-CONFIG_IP6_NF_IPTABLES=y
-CONFIG_IP6_NF_NAT=y
-CONFIG_IP6_NF_TARGET_MASQUERADE=y
-# CONFIG_IP6_NF_TARGET_NPT is not set
 CONFIG_IPC_NS=y
 CONFIG_IPV6=y
 CONFIG_IPV6_MULTIPLE_TABLES=y
@@ -683,39 +675,10 @@ CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_SUBTREES is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 # CONFIG_IP_MROUTE is not set
-CONFIG_IP_NF_FILTER=y
-CONFIG_IP_NF_IPTABLES=y
-CONFIG_IP_NF_MANGLE=y
-CONFIG_IP_NF_NAT=y
-CONFIG_IP_NF_TARGET_MASQUERADE=y
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_RARP=y
-CONFIG_IP_VS=y
-# CONFIG_IP_VS_DEBUG is not set
-# CONFIG_IP_VS_DH is not set
-# CONFIG_IP_VS_FO is not set
-# CONFIG_IP_VS_IPV6 is not set
-# CONFIG_IP_VS_LBLC is not set
-# CONFIG_IP_VS_LBLCR is not set
-# CONFIG_IP_VS_LC is not set
-# CONFIG_IP_VS_NFCT is not set
-# CONFIG_IP_VS_NQ is not set
-# CONFIG_IP_VS_OVF is not set
-# CONFIG_IP_VS_PROTO_AH is not set
-# CONFIG_IP_VS_PROTO_AH_ESP is not set
-# CONFIG_IP_VS_PROTO_ESP is not set
-# CONFIG_IP_VS_PROTO_SCTP is not set
-# CONFIG_IP_VS_PROTO_TCP is not set
-# CONFIG_IP_VS_PROTO_UDP is not set
-# CONFIG_IP_VS_RR is not set
-# CONFIG_IP_VS_SED is not set
-# CONFIG_IP_VS_SH is not set
-CONFIG_IP_VS_SH_TAB_BITS=8
-CONFIG_IP_VS_TAB_BITS=12
-# CONFIG_IP_VS_WLC is not set
-# CONFIG_IP_VS_WRR is not set
 CONFIG_IRQCHIP=y
 CONFIG_IRQ_CROSSBAR=y
 CONFIG_IRQ_DOMAIN=y
@@ -759,14 +722,12 @@ CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
 CONFIG_LIBFDT=y
 CONFIG_LOCALVERSION_AUTO=y
-CONFIG_LOCKD=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
 CONFIG_LOGO=y
 CONFIG_LOGO_LINUX_CLUT224=y
 CONFIG_LOGO_LINUX_MONO=y
 CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_LZ4_DECOMPRESS=y
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 CONFIG_MACB=y
@@ -896,49 +857,11 @@ CONFIG_NAMESPACES=y
 CONFIG_NATIONAL_PHY=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEON=y
-CONFIG_NETFILTER=y
-CONFIG_NETFILTER_ADVANCED=y
-CONFIG_NETFILTER_INGRESS=y
-CONFIG_NETFILTER_XTABLES=y
-CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
-CONFIG_NETFILTER_XT_MATCH_COMMENT=y
-CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
-CONFIG_NETFILTER_XT_MATCH_IPVS=y
-CONFIG_NETFILTER_XT_NAT=y
-CONFIG_NETFILTER_XT_TARGET_CHECKSUM=y
-CONFIG_NETLINK_DIAG=y
 # CONFIG_NET_CLS_CGROUP is not set
 CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NET_INGRESS=y
 CONFIG_NET_IP_TUNNEL=y
-CONFIG_NET_KEY=y
 CONFIG_NET_NS=y
-CONFIG_NET_PACKET_ENGINE=y
 CONFIG_NET_PTP_CLASSIFY=y
-CONFIG_NET_SWITCHDEV=y
-# CONFIG_NET_VENDOR_AURORA is not set
-CONFIG_NFS_ACL_SUPPORT=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_USE_KERNEL_DNS=y
-# CONFIG_NFS_USE_LEGACY_DNS is not set
-CONFIG_NFS_V2=y
-CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_NF_CONNTRACK=y
-CONFIG_NF_CONNTRACK_IPV4=y
-CONFIG_NF_CONNTRACK_IPV6=y
-CONFIG_NF_CONNTRACK_MARK=y
-# CONFIG_NF_CONNTRACK_RTCACHE is not set
-CONFIG_NF_DEFRAG_IPV4=y
-CONFIG_NF_DEFRAG_IPV6=y
-# CONFIG_NF_LOG_IPV6 is not set
-CONFIG_NF_NAT=y
-CONFIG_NF_NAT_IPV4=y
-CONFIG_NF_NAT_IPV6=y
-CONFIG_NF_NAT_MASQUERADE_IPV4=y
-CONFIG_NF_NAT_MASQUERADE_IPV6=y
-CONFIG_NF_NAT_NEEDED=y
-# CONFIG_NF_NAT_REDIRECT is not set
 CONFIG_NLS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
@@ -964,7 +887,6 @@ CONFIG_OF_NET=y
 CONFIG_OF_PCI=y
 CONFIG_OF_PCI_IRQ=y
 CONFIG_OF_RESERVED_MEM=y
-CONFIG_OID_REGISTRY=y
 CONFIG_OLD_SIGACTION=y
 CONFIG_OLD_SIGSUSPEND3=y
 # CONFIG_OMAP2PLUS_MBOX is not set
@@ -994,7 +916,6 @@ CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PACKET_DIAG=y
 CONFIG_PAGE_COUNTER=y
 CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_PALMAS_GPADC is not set
 # CONFIG_PANIC_ON_OOPS is not set
 CONFIG_PANIC_ON_OOPS_VALUE=0
 CONFIG_PANIC_TIMEOUT=0
@@ -1094,7 +1015,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_GZIP=y
-CONFIG_RD_LZ4=y
 CONFIG_RD_LZMA=y
 CONFIG_RD_LZO=y
 CONFIG_RD_XZ=y
@@ -1147,7 +1067,6 @@ CONFIG_REGULATOR_TWL4030=y
 CONFIG_REGULATOR_VEXPRESS=y
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
-CONFIG_ROOT_NFS=y
 CONFIG_RPS=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AS3722=y
@@ -1254,7 +1173,6 @@ CONFIG_SPARSE_IRQ=y
 CONFIG_SPI=y
 CONFIG_SPI_BITBANG=y
 CONFIG_SPI_CADENCE=y
-# CONFIG_SPI_CADENCE_QUADSPI is not set
 CONFIG_SPI_FSL_QUADSPI=y
 # CONFIG_SPI_IMX is not set
 CONFIG_SPI_MASTER=y
@@ -1278,8 +1196,6 @@ CONFIG_STMPE_I2C=y
 # CONFIG_STMPE_SPI is not set
 CONFIG_STMP_DEVICE=y
 # CONFIG_STRIP_ASM_SYMS is not set
-CONFIG_SUNRPC=y
-CONFIG_SUNRPC_GSS=y
 CONFIG_SUSPEND=y
 CONFIG_SUSPEND_FREEZER=y
 CONFIG_SWIOTLB=y
@@ -1347,7 +1263,6 @@ CONFIG_USB_DWC3_DUAL_ROLE=y
 CONFIG_USB_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PCI=y
-# CONFIG_USB_EHCI_FSL is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
 # CONFIG_USB_EHCI_MXC is not set
diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9
index 91a89a2..ea4dba6 100644
--- a/target/linux/layerscape/armv8_64b/config-4.9
+++ b/target/linux/layerscape/armv8_64b/config-4.9
@@ -23,7 +23,6 @@ CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y
 CONFIG_ACPI_SPCR_TABLE=y
 CONFIG_ACPI_TABLE_UPGRADE=y
 CONFIG_ACPI_THERMAL=y
-CONFIG_ADVISE_SYSCALLS=y
 CONFIG_AHCI_CEVA=y
 CONFIG_AHCI_QORIQ=y
 CONFIG_AHCI_XGENE=y
@@ -145,11 +144,6 @@ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_BOUNCE=y
 CONFIG_BPF_JIT=y
 # CONFIG_BPF_SYSCALL is not set
-CONFIG_BRIDGE_EBT_DNAT=y
-CONFIG_BRIDGE_EBT_SNAT=y
-CONFIG_BRIDGE_EBT_T_NAT=y
-CONFIG_BRIDGE_NETFILTER=y
-CONFIG_BRIDGE_NF_EBTABLES=y
 CONFIG_BRIDGE_VLAN_FILTERING=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
@@ -318,7 +312,6 @@ CONFIG_DEBUG_RODATA=y
 CONFIG_DEBUG_SET_MODULE_RONX=y
 CONFIG_DECOMPRESS_BZIP2=y
 CONFIG_DECOMPRESS_GZIP=y
-CONFIG_DECOMPRESS_LZ4=y
 CONFIG_DECOMPRESS_LZMA=y
 CONFIG_DECOMPRESS_LZO=y
 CONFIG_DECOMPRESS_XZ=y
@@ -691,11 +684,6 @@ CONFIG_IPV6=y
 CONFIG_IPV6_SIT=y
 # CONFIG_IP_ADVANCED_ROUTER is not set
 # CONFIG_IP_MROUTE is not set
-CONFIG_IP_NF_FILTER=y
-CONFIG_IP_NF_IPTABLES=y
-CONFIG_IP_NF_MANGLE=y
-CONFIG_IP_NF_NAT=y
-CONFIG_IP_NF_TARGET_MASQUERADE=y
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_DHCP=y
@@ -748,7 +736,6 @@ CONFIG_LOGO_LINUX_CLUT224=y
 # CONFIG_LOGO_LINUX_VGA16 is not set
 CONFIG_LS_SCFG_MSI=y
 CONFIG_LS_SOC_DRIVERS=y
-CONFIG_LZ4_DECOMPRESS=y
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 CONFIG_MACB=y
@@ -845,76 +832,12 @@ CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_MULTIPLE_NODES=y
 CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
 CONFIG_NEED_SG_DMA_LENGTH=y
-CONFIG_NETFILTER=y
-CONFIG_NETFILTER_ADVANCED=y
-CONFIG_NETFILTER_INGRESS=y
-CONFIG_NETFILTER_NETLINK=y
-CONFIG_NETFILTER_XTABLES=y
-CONFIG_NETFILTER_XT_CONNMARK=y
-CONFIG_NETFILTER_XT_MATCH_COMMENT=y
-CONFIG_NETFILTER_XT_NAT=y
-CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
 # CONFIG_NETLABEL is not set
-CONFIG_NETLINK_DIAG=y
-# CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_NET_9P=y
-# CONFIG_NET_9P_DEBUG is not set
-CONFIG_NET_9P_VIRTIO=y
 # CONFIG_NET_CLS_CGROUP is not set
 CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NET_INGRESS=y
 CONFIG_NET_IP_TUNNEL=y
-CONFIG_NET_KEY=y
 CONFIG_NET_NS=y
-CONFIG_NET_PACKET_ENGINE=y
 CONFIG_NET_PTP_CLASSIFY=y
-# CONFIG_NET_VENDOR_AURORA is not set
-# CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_NFT_CHAIN_NAT_IPV4 is not set
-# CONFIG_NFT_CHAIN_ROUTE_IPV4 is not set
-CONFIG_NFT_COMPAT=y
-# CONFIG_NFT_COUNTER is not set
-CONFIG_NFT_CT=y
-# CONFIG_NFT_EXTHDR is not set
-# CONFIG_NFT_HASH is not set
-# CONFIG_NFT_LIMIT is not set
-# CONFIG_NFT_LOG is not set
-CONFIG_NFT_MASQ=y
-# CONFIG_NFT_MASQ_IPV4 is not set
-# CONFIG_NFT_META is not set
-CONFIG_NFT_NAT=y
-# CONFIG_NFT_NUMGEN is not set
-# CONFIG_NFT_QUOTA is not set
-# CONFIG_NFT_REDIR is not set
-# CONFIG_NFT_REJECT is not set
-# CONFIG_NFT_REJECT_IPV4 is not set
-# CONFIG_NFT_SET_HASH is not set
-# CONFIG_NFT_SET_RBTREE is not set
-CONFIG_NF_CONNTRACK=y
-CONFIG_NF_CONNTRACK_EVENTS=y
-CONFIG_NF_CONNTRACK_IPV4=y
-CONFIG_NF_CONNTRACK_IPV6=y
-CONFIG_NF_CONNTRACK_MARK=y
-# CONFIG_NF_CONNTRACK_RTCACHE is not set
-CONFIG_NF_DEFRAG_IPV4=y
-CONFIG_NF_DEFRAG_IPV6=y
-# CONFIG_NF_LOG_BRIDGE is not set
-CONFIG_NF_LOG_COMMON=y
-CONFIG_NF_LOG_IPV6=y
-CONFIG_NF_NAT=y
-CONFIG_NF_NAT_IPV4=y
-CONFIG_NF_NAT_IPV6=y
-CONFIG_NF_NAT_MASQUERADE_IPV4=y
-CONFIG_NF_NAT_MASQUERADE_IPV6=y
-CONFIG_NF_NAT_NEEDED=y
-# CONFIG_NF_NAT_REDIRECT is not set
-CONFIG_NF_REJECT_IPV6=y
-CONFIG_NF_TABLES=y
-# CONFIG_NF_TABLES_ARP is not set
-CONFIG_NF_TABLES_BRIDGE=y
-# CONFIG_NF_TABLES_INET is not set
-CONFIG_NF_TABLES_IPV4=y
-# CONFIG_NF_TABLES_IPV6 is not set
 CONFIG_NLS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
@@ -1046,7 +969,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_GZIP=y
-CONFIG_RD_LZ4=y
 CONFIG_RD_LZMA=y
 CONFIG_RD_LZO=y
 CONFIG_RD_XZ=y
@@ -1240,7 +1162,6 @@ CONFIG_USB_DWC3_DUAL_ROLE=y
 # CONFIG_USB_DWC3_HOST is not set
 CONFIG_USB_DWC3_OF_SIMPLE=y
 CONFIG_USB_DWC3_PCI=y
-# CONFIG_USB_EHCI_FSL is not set
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_PCI=y


From lede-commits at lists.infradead.org  Sun Oct 29 09:02:07 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 12:02:07 -0400
Subject: [source]  ltq-atm: Add missing dependency to kmod-ltq-adsl-ase-mei
In-Reply-To: <20171029160207.9090.62373@git-01.infra.lede-project.org>
References: <20171029160207.9090.62373@git-01.infra.lede-project.org>
Message-ID: <mailman.57001.1509292955.26984.lede-commits@lists.infradead.org>

hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/1e5e0058414a47bbba7a47feca0e5321586e0a3b

commit 1e5e0058414a47bbba7a47feca0e5321586e0a3b
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Oct 29 16:58:44 2017 +0100

    ltq-atm: Add missing dependency to kmod-ltq-adsl-ase-mei
    
    Commit 2e496876c60 fixed the generation of the depends line for external
    kernel modules which makes it possible for the build system to
    automatically detect this missing dependency. This fixes the build bot
    build of the lantiq/aes target.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/lantiq/ltq-atm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/lantiq/ltq-atm/Makefile b/package/kernel/lantiq/ltq-atm/Makefile
index a4f9c03..fa66931 100644
--- a/package/kernel/lantiq/ltq-atm/Makefile
+++ b/package/kernel/lantiq/ltq-atm/Makefile
@@ -28,7 +28,7 @@ endef
 
 KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy))
 KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway)
-KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase)
+KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase +kmod-ltq-adsl-ase-mei)
 KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200)
 
 define Build/Configure


From lede-commits at lists.infradead.org  Sun Oct 29 11:07:17 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 14:07:17 -0400
Subject: [source]  tools/findutils: include sysmacros.h explicitly
In-Reply-To: <20171029180717.6646.60179@git-01.infra.lede-project.org>
References: <20171029180717.6646.60179@git-01.infra.lede-project.org>
Message-ID: <mailman.57010.1509300468.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/d2fd6412a63655dd748ba4651e59898c6a8e7d03

commit d2fd6412a63655dd748ba4651e59898c6a8e7d03
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:43:43 2017 +0100

    tools/findutils: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1016
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
---
 tools/findutils/patches/100-include_sysmacros.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/findutils/patches/100-include_sysmacros.patch b/tools/findutils/patches/100-include_sysmacros.patch
new file mode 100644
index 0000000..82b1ee9
--- /dev/null
+++ b/tools/findutils/patches/100-include_sysmacros.patch
@@ -0,0 +1,13 @@
+--- a/gl/lib/mountlist.c
++++ b/gl/lib/mountlist.c
+@@ -17,6 +17,10 @@
+ 
+ #include <config.h>
+ 
++#ifdef MAJOR_IN_SYSMACROS
++# include <sys/sysmacros.h>
++#endif
++
+ #include "mountlist.h"
+ 
+ #include <limits.h>


From lede-commits at lists.infradead.org  Sun Oct 29 11:07:18 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 14:07:18 -0400
Subject: [source]  tools/mtd-utils: include sysmacros.h explicitly
In-Reply-To: <20171029180717.6646.60179@git-01.infra.lede-project.org>
References: <20171029180717.6646.60179@git-01.infra.lede-project.org>
Message-ID: <mailman.57011.1509300474.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/96dbf59e5ae9b2384d860008f92cb583412c1688

commit 96dbf59e5ae9b2384d860008f92cb583412c1688
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:47:33 2017 +0100

    tools/mtd-utils: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1015
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
    [refresh patches]
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 .../mtd-utils/patches/120-include_sysmacros.patch  | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/tools/mtd-utils/patches/120-include_sysmacros.patch b/tools/mtd-utils/patches/120-include_sysmacros.patch
new file mode 100644
index 0000000..81ba1cf
--- /dev/null
+++ b/tools/mtd-utils/patches/120-include_sysmacros.patch
@@ -0,0 +1,25 @@
+From 9a06f45ec71116d76ee4b268ebe1b33d45b06fc0 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier at gentoo.org>
+Date: Sat, 16 Apr 2016 22:10:43 -0400
+Subject: [PATCH mtd-utils] include sys/sysmacros.h for major/minor/makedev
+
+These functions have always been defined in sys/sysmacros.h under
+Linux C libraries.  For some, including sys/types.h implicitly
+includes that as well, but glibc wants to deprecate that, and some
+others already have.  Include the header explicitly for the funcs.
+
+Signed-off-by: Mike Frysinger <vapier at gentoo.org>
+---
+ include/common.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/include/common.h
++++ b/include/common.h
+@@ -27,6 +27,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <inttypes.h>
++#include <sys/sysmacros.h>
+ #include "version.h"
+ 
+ #ifndef PROGRAM_NAME


From lede-commits at lists.infradead.org  Sun Oct 29 11:07:19 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 14:07:19 -0400
Subject: [source]  tools/squashfs: include sysmacros.h explicitly
In-Reply-To: <20171029180717.6646.60179@git-01.infra.lede-project.org>
References: <20171029180717.6646.60179@git-01.infra.lede-project.org>
Message-ID: <mailman.57012.1509300489.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/8406e50df540b13a43c080a304ec675bc4fc2caf

commit 8406e50df540b13a43c080a304ec675bc4fc2caf
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:47:55 2017 +0100

    tools/squashfs: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1018
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
---
 tools/squashfs/patches/130-include_sysmacros.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/squashfs/patches/130-include_sysmacros.patch b/tools/squashfs/patches/130-include_sysmacros.patch
new file mode 100644
index 0000000..f0149d6
--- /dev/null
+++ b/tools/squashfs/patches/130-include_sysmacros.patch
@@ -0,0 +1,20 @@
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -30,6 +30,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -25,6 +25,7 @@
+ #define FALSE 0
+ #include <stdio.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>


From lede-commits at lists.infradead.org  Sun Oct 29 11:07:20 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 14:07:20 -0400
Subject: [source]  tools/squashfs4: include sysmacros.h explicitly
In-Reply-To: <20171029180717.6646.60179@git-01.infra.lede-project.org>
References: <20171029180717.6646.60179@git-01.infra.lede-project.org>
Message-ID: <mailman.57015.1509300496.26984.lede-commits@lists.infradead.org>

mkresin pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/8a48a53dcb503137a8eac64cf3fc522024484818

commit 8a48a53dcb503137a8eac64cf3fc522024484818
Author: Alex Maclean <monkeh at monkeh.net>
AuthorDate: Mon Oct 23 13:48:19 2017 +0100

    tools/squashfs4: include sysmacros.h explicitly
    
    glibc is moving to remove the include of sys/sysmacros.h from
    sys/types.h, and some distros have done this early. Other libcs may
    already lack this include. Include sysmacros.h explicitly.
    
    Fixes: FS#1017
    
    Signed-off-by: Alex Maclean <monkeh at monkeh.net>
    [refresh patches]
    Signed-off-by: Mathias Kresin <dev at kresin.me>
---
 tools/squashfs4/patches/130-include_sysmacros.patch  | 20 ++++++++++++++++++++
 ...170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch |  8 ++++----
 tools/squashfs4/patches/180-openbsd_compat.patch     |  2 +-
 .../squashfs4/patches/190-no_nonstatic_inline.patch  |  6 +++---
 .../patches/200-add-fixed-timestamp-option.patch     | 16 ++++++++--------
 5 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/tools/squashfs4/patches/130-include_sysmacros.patch b/tools/squashfs4/patches/130-include_sysmacros.patch
new file mode 100644
index 0000000..e884513
--- /dev/null
+++ b/tools/squashfs4/patches/130-include_sysmacros.patch
@@ -0,0 +1,20 @@
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -33,6 +33,7 @@
+ #include <stddef.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -30,6 +30,7 @@
+ #include "xattr.h"
+ 
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ 
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_deflate, *to_writer, *from_writer;
diff --git a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
index ad69b19..bc7d6c7 100644
--- a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
+++ b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
@@ -16,7 +16,7 @@
  #define SQUASHFS_METADATA_LOG		13
 --- a/squashfs-tools/unsquashfs.c
 +++ b/squashfs-tools/unsquashfs.c
-@@ -1463,10 +1463,12 @@ int read_super(char *source)
+@@ -1464,10 +1464,12 @@ int read_super(char *source)
  	 */
  	read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block),
  		&sBlk_4);
@@ -31,7 +31,7 @@
  			sBlk_4.s_minor == 0) {
  		s_ops.squashfs_opendir = squashfs_opendir_4;
  		s_ops.read_fragment = read_fragment_4;
-@@ -1479,7 +1481,11 @@ int read_super(char *source)
+@@ -1480,7 +1482,11 @@ int read_super(char *source)
  		/*
  		 * Check the compression type
  		 */
@@ -44,7 +44,7 @@
  		return TRUE;
  	}
  
-@@ -1494,8 +1500,10 @@ int read_super(char *source)
+@@ -1495,8 +1501,10 @@ int read_super(char *source)
  	 * Check it is a SQUASHFS superblock
  	 */
  	swap = 0;
@@ -57,7 +57,7 @@
  			squashfs_super_block_3 sblk;
  			ERROR("Reading a different endian SQUASHFS filesystem "
  				"on %s\n", source);
-@@ -1573,7 +1581,11 @@ int read_super(char *source)
+@@ -1574,7 +1582,11 @@ int read_super(char *source)
  	/*
  	 * 1.x, 2.x and 3.x filesystems use gzip compression.
  	 */
diff --git a/tools/squashfs4/patches/180-openbsd_compat.patch b/tools/squashfs4/patches/180-openbsd_compat.patch
index b9c1b59..4f7afd8 100644
--- a/tools/squashfs4/patches/180-openbsd_compat.patch
+++ b/tools/squashfs4/patches/180-openbsd_compat.patch
@@ -8,8 +8,8 @@
 +#include <sys/param.h>
 +#endif
  #include <sys/types.h>
+ #include <sys/sysmacros.h>
  #include <sys/stat.h>
- #include <fcntl.h>
 --- a/squashfs-tools/unsquashfs.h
 +++ b/squashfs-tools/unsquashfs.h
 @@ -25,6 +25,9 @@
diff --git a/tools/squashfs4/patches/190-no_nonstatic_inline.patch b/tools/squashfs4/patches/190-no_nonstatic_inline.patch
index 27ebc6a..8cab120 100644
--- a/tools/squashfs4/patches/190-no_nonstatic_inline.patch
+++ b/tools/squashfs4/patches/190-no_nonstatic_inline.patch
@@ -1,6 +1,6 @@
 --- a/squashfs-tools/mksquashfs.c
 +++ b/squashfs-tools/mksquashfs.c
-@@ -735,13 +735,13 @@ void cache_block_put(struct file_buffer
+@@ -736,13 +736,13 @@ void cache_block_put(struct file_buffer
  			+ (((char *)A) - data_cache)))
  
  
@@ -16,7 +16,7 @@
  {
  	pthread_mutex_lock(&progress_mutex);
  	pthread_cond_signal(&progress_wait);
-@@ -749,7 +749,7 @@ inline void update_progress_bar()
+@@ -750,7 +750,7 @@ inline void update_progress_bar()
  }
  
  
@@ -25,7 +25,7 @@
  {
  	TRACE("Waiting for thread %d\n", i);
  	while(thread[i] != 0)
-@@ -3358,7 +3358,7 @@ struct inode_info *lookup_inode(struct s
+@@ -3359,7 +3359,7 @@ struct inode_info *lookup_inode(struct s
  }
  
  
diff --git a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
index 5cec51f..7411b97 100644
--- a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
+++ b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch
@@ -1,6 +1,6 @@
 --- a/squashfs-tools/mksquashfs.c
 +++ b/squashfs-tools/mksquashfs.c
-@@ -175,6 +175,9 @@ unsigned int cache_bytes = 0, cache_size
+@@ -176,6 +176,9 @@ unsigned int cache_bytes = 0, cache_size
  /* inode lookup table */
  squashfs_inode *inode_lookup_table = NULL;
  
@@ -10,7 +10,7 @@
  /* in memory directory data */
  #define I_COUNT_SIZE		128
  #define DIR_ENTRIES		32
-@@ -2452,6 +2455,8 @@ again:
+@@ -2453,6 +2456,8 @@ again:
  restat:
  	fstat(file, &buf2);
  	close(file);
@@ -19,7 +19,7 @@
  	if(read_size != buf2.st_size) {
  		memcpy(buf, &buf2, sizeof(struct stat));
  		file_buffer->error = 2;
-@@ -3612,7 +3617,7 @@ void dir_scan(squashfs_inode *inode, cha
+@@ -3613,7 +3618,7 @@ void dir_scan(squashfs_inode *inode, cha
  		buf.st_mode = S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR;
  		buf.st_uid = getuid();
  		buf.st_gid = getgid();
@@ -28,7 +28,7 @@
  		buf.st_dev = 0;
  		buf.st_ino = 0;
  		dir_ent->inode = lookup_inode(&buf);
-@@ -3623,6 +3628,8 @@ void dir_scan(squashfs_inode *inode, cha
+@@ -3624,6 +3629,8 @@ void dir_scan(squashfs_inode *inode, cha
  				pathname, strerror(errno));
  			return;
  		}
@@ -37,7 +37,7 @@
  		dir_ent->inode = lookup_inode(&buf);
  	}
  
-@@ -3677,6 +3684,8 @@ struct dir_info *dir_scan1(char *pathnam
+@@ -3678,6 +3685,8 @@ struct dir_info *dir_scan1(char *pathnam
  				filename, strerror(errno));
  			continue;
  		}
@@ -46,7 +46,7 @@
  
  		if((buf.st_mode & S_IFMT) != S_IFREG &&
  			(buf.st_mode & S_IFMT) != S_IFDIR &&
-@@ -3795,7 +3804,7 @@ struct dir_info *dir_scan2(struct dir_in
+@@ -3796,7 +3805,7 @@ struct dir_info *dir_scan2(struct dir_in
  		buf.st_gid = pseudo_ent->dev->gid;
  		buf.st_rdev = makedev(pseudo_ent->dev->major,
  			pseudo_ent->dev->minor);
@@ -55,7 +55,7 @@
  		buf.st_ino = pseudo_ino ++;
  
  		if(pseudo_ent->dev->type == 'f') {
-@@ -4674,6 +4683,15 @@ int main(int argc, char *argv[])
+@@ -4675,6 +4684,15 @@ int main(int argc, char *argv[])
  			progress = FALSE;
  		else if(strcmp(argv[i], "-no-exports") == 0)
  			exportable = FALSE;
@@ -71,7 +71,7 @@
  		else if(strcmp(argv[i], "-processors") == 0) {
  			if((++i == argc) || (processors =
  					strtol(argv[i], &b, 10), *b != '\0')) {
-@@ -5314,7 +5332,7 @@ printOptions:
+@@ -5315,7 +5333,7 @@ printOptions:
  	sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, no_fragments,
  		always_use_fragments, duplicate_checking, exportable,
  		no_xattrs, comp_opts);


From lede-commits at lists.infradead.org  Sun Oct 29 15:08:15 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:08:15 -0400
Subject: [source]  nghttp2: bump to 1.27.0
In-Reply-To: <20171029220815.32169.30461@git-01.infra.lede-project.org>
References: <20171029220815.32169.30461@git-01.infra.lede-project.org>
Message-ID: <mailman.57025.1509315053.26984.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/f6c01306cbef3cbbaef9aadce2c631d8bf5757fe

commit f6c01306cbef3cbbaef9aadce2c631d8bf5757fe
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sun Oct 29 22:59:31 2017 +0100

    nghttp2: bump to 1.27.0
    
    Changes in v1.27.0 :
    
    build: Fixed accidental compiler flags concatenation for MSVC (Patch from LazyHamster) (GH-1029)
    build: Reduce libxml2 version requirement to 2.6.26 (Patch from Mike Lothian) (GH-1020)
    asio: Support for Windows / MinGW (Patch from Daniel Evers) (GH-1027)
    h2load: Print out h2 header fields with --verbose option (GH-1015)
    nghttpx: Send non-final response to HTTP/1.1 or HTTP/2 client only (GH-1016)
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/libs/nghttp2/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile
index 0a21d12..4bc06d3 100644
--- a/package/libs/nghttp2/Makefile
+++ b/package/libs/nghttp2/Makefile
@@ -1,15 +1,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nghttp2
-PKG_VERSION:=1.26.0
+PKG_VERSION:=1.27.0
 PKG_RELEASE:=1
 PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=0389af5724010627e19425237e9e5e0bf343bc6f
+PKG_SOURCE_VERSION:=e8907a073f451df11952664518b9abcc3c57e65e
 PKG_SOURCE_DIR:=$(PKG_NAME)
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MIRROR_HASH:=e7d6d6239cb5a6957b9aafe22a15ea01fafefdf472eff84ec959bb31c5023f79
+PKG_MIRROR_HASH:=94ece79959ca2ca2936f4e67868704c44cc377bded2e9aa25d7517ab1c7d7cbc
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
 CMAKE_INSTALL:=1


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:08 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:08 -0400
Subject: [source]  ar7-atm: fix function signatures with expected ones
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57026.1509316893.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/c77ba7df09564226b791ae693dc3cf3ad9d2385f

commit c77ba7df09564226b791ae693dc3cf3ad9d2385f
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Oct 19 15:47:41 2017 +0200

    ar7-atm: fix function signatures with expected ones
    
    Newer kernels treat differing signatures an error, not just a warning,
    so fix the signatures to match.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 .../260-fix_function_signatures.patch              | 63 ++++++++++++++++++++++
 .../260-fix_function_signatures.patch              | 63 ++++++++++++++++++++++
 2 files changed, 126 insertions(+)

diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch
new file mode 100644
index 0000000..fe13fc5
--- /dev/null
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch
@@ -0,0 +1,63 @@
+--- a/cpswhal_cpsar.h
++++ b/cpswhal_cpsar.h
+@@ -430,10 +430,10 @@ typedef struct
+   int   (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo);
+   int   (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value);
+   int   (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value);
+-  void  (*Free)(void *MemPtr);
++  void  (*Free)(const void *MemPtr);
+   void  (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr);
+-  void  (*FreeDev)(void *MemPtr);
+-  void  (*FreeDmaXfer)(void *MemPtr);
++  void  (*FreeDev)(const void *MemPtr);
++  void  (*FreeDmaXfer)(const void *MemPtr);
+   void  (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit);
+   void  (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit);
+   void* (*Malloc)(bit32u size);
+--- a/cpswhal_cpaal5.h
++++ b/cpswhal_cpaal5.h
+@@ -430,10 +430,10 @@ typedef struct
+   int   (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo);
+   int   (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value);
+   int   (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value);
+-  void  (*Free)(void *MemPtr);
++  void  (*Free)(const void *MemPtr);
+   void  (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr);
+-  void  (*FreeDev)(void *MemPtr);
+-  void  (*FreeDmaXfer)(void *MemPtr);
++  void  (*FreeDev)(const void *MemPtr);
++  void  (*FreeDmaXfer)(const void *MemPtr);
+   void  (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit);
+   void  (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit);
+   void* (*Malloc)(bit32u size);
+--- a/tn7atm.c
++++ b/tn7atm.c
+@@ -2481,7 +2481,7 @@ static int tn7atm_proc_qos_read(struct s
+     return 0;
+ 
+ }
+-static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data)
++static int tn7atm_proc_qos_write(struct file *fp, const char *buf, size_t count, loff_t *data)
+ {
+     char local_buf[32];
+ 
+--- a/tn7dsl.c
++++ b/tn7dsl.c
+@@ -1712,7 +1712,7 @@ static int tn7dsl_proc_stats_open(struct
+ 	return single_open(file, tn7dsl_proc_stats, PDE_DATA(inode));
+ }
+ 
+-int tn7dsl_proc_write_stats (struct file *fp, const char *buf, unsigned long count, void *data);
++int tn7dsl_proc_write_stats (struct file *fp, const char *buf, size_t count, loff_t *data);
+ 
+ struct file_operations tn7dsl_proc_stats_fops = {
+ 	.owner 		= THIS_MODULE,
+@@ -4256,7 +4256,7 @@ int tn7dsl_generic_write( int offsetnum,
+ }
+ 
+ int tn7dsl_proc_write_stats (struct file *fp, const char *buf,
+-                             unsigned long count, void *data)
++                             size_t count, loff_t *data)
+ {
+     char local_buf[31];
+     int  ret_val = 0;
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch
new file mode 100644
index 0000000..61a1ff7
--- /dev/null
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch
@@ -0,0 +1,63 @@
+--- a/cpswhal_cpsar.h
++++ b/cpswhal_cpsar.h
+@@ -437,10 +437,10 @@ typedef struct
+   int   (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo);
+   int   (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value);
+   int   (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value);
+-  void  (*Free)(void *MemPtr);
++  void  (*Free)(const void *MemPtr);
+   void  (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr);
+-  void  (*FreeDev)(void *MemPtr);
+-  void  (*FreeDmaXfer)(void *MemPtr);
++  void  (*FreeDev)(const void *MemPtr);
++  void  (*FreeDmaXfer)(const void *MemPtr);
+   void  (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit);
+   void  (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit);
+   void* (*Malloc)(bit32u size);
+--- a/cpswhal_cpaal5.h
++++ b/cpswhal_cpaal5.h
+@@ -436,10 +436,10 @@ typedef struct
+   int   (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo);
+   int   (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value);
+   int   (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value);
+-  void  (*Free)(void *MemPtr);
++  void  (*Free)(const void *MemPtr);
+   void  (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr);
+-  void  (*FreeDev)(void *MemPtr);
+-  void  (*FreeDmaXfer)(void *MemPtr);
++  void  (*FreeDev)(const void *MemPtr);
++  void  (*FreeDmaXfer)(const void *MemPtr);
+   void  (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit);
+   void  (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit);
+   void* (*Malloc)(bit32u size);
+--- a/tn7atm.c
++++ b/tn7atm.c
+@@ -2690,7 +2690,7 @@ static int tn7atm_proc_turbodsl_read(str
+     return 0;
+ }
+ 
+-static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data)
++static int tn7atm_proc_qos_write(struct file *fp, const char *buf, size_t count, loff_t *data)
+ {
+     char local_buf[32];
+ 
+--- a/tn7dsl.c
++++ b/tn7dsl.c
+@@ -1770,7 +1770,7 @@ static int tn7dsl_proc_stats_open(struct
+ 	return single_open(file, tn7dsl_proc_stats, PDE_DATA(inode));
+ }
+ 
+-int tn7dsl_proc_write_stats(struct file *fp, const char * buf, unsigned long count, void * data);
++int tn7dsl_proc_write_stats(struct file *fp, const char * buf, size_t count, loff_t * data);
+ 
+ struct file_operations tn7dsl_proc_stats_fops = {
+ 	.owner 		= THIS_MODULE,
+@@ -4436,7 +4436,7 @@ int tn7dsl_generic_write( int offsetnum,
+ }
+ 
+ int tn7dsl_proc_write_stats (struct file *fp, const char *buf,
+-                             unsigned long count, void *data)
++                             size_t count, loff_t *data)
+ {
+     char local_buf[31];
+     int  ret_val = 0;


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:07 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:07 -0400
Subject: [source]  ar7-atm: fixup proc fixes
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57027.1509316893.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/fce2664f1965857077932fb6e0b50582044aa89d

commit fce2664f1965857077932fb6e0b50582044aa89d
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Oct 13 13:17:51 2017 +0200

    ar7-atm: fixup proc fixes
    
    They were incomplete, so fix them to properly update the function signatures
    to what is expected.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 .../190-2.6.32_proc_fixes.patch                    | 35 ++++++++++++++++++++--
 .../220-3.10-update_proc_code.patch                | 10 ++++---
 .../patches-D7.04.03.00/240-3.18_fixes.patch       | 12 ++++----
 .../190-2.6.32_proc_fixes.patch                    | 35 ++++++++++++++++++++--
 .../220-3.10-update_proc_code.patch                | 10 ++++---
 .../patches-D7.05.01.00/240-3.18_fixes.patch       | 12 ++++----
 6 files changed, 90 insertions(+), 24 deletions(-)

diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch
index 87a1fde..1223604 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch
@@ -9,12 +9,43 @@
  #define MAX_STR_SIZE     256
  #define DSL_MOD_SIZE     256
  
+@@ -333,8 +333,8 @@ static void tn7dsl_chng_modulation(void*
+ static unsigned int tn7dsl_set_modulation(void* data, int flag);
+ static void tn7dsl_ctrl_fineGain(int value);
+ static void tn7dsl_set_fineGainValue(int value);
+-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp,
+-                          void *buffer, size_t * lenp);
++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer,
++                          size_t * lenp, loff_t *ppos);
+ static void tn7dsl_register_dslss_led(void);
+ void tn7dsl_dslmod_sysctl_register(void);
+ void tn7dsl_dslmod_sysctl_unregister(void);
+@@ -3398,8 +3398,8 @@ unsigned int tn7dsl_get_memory(unsigned
+ 
+ 
+ 
+-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp,
+-      void *buffer, size_t *lenp)
++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer,
++      size_t *lenp, loff_t *ppos)
+ {
+   char *ptr;
+   int ret, len = 0;
+@@ -3411,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl,
+   char mod_req[16] = { '\t' };
+   char fst_byt;
+ 
+-  if (!*lenp || (filp->f_pos && !write))
++  if (!*lenp || (*ppos && !write))
+   {
+     *lenp = 0;
+     return 0;
 @@ -3421,9 +3421,9 @@ static int dslmod_sysctl(ctl_table *ctl,
     */
    if(write)
      {
 -    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
-+    ret = proc_dostring(ctl, write, buffer, lenp, 0);
++    ret = proc_dostring(ctl, write, buffer, lenp, ppos);
  
 -    switch (ctl->ctl_name)
 +    switch ((long)ctl->extra2)
@@ -26,7 +57,7 @@
      {
      len += sprintf(info+len, mod_req);
 -    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
-+    ret = proc_dostring(ctl, write, buffer, lenp, 0);
++    ret = proc_dostring(ctl, write, buffer, lenp, ppos);
      }
    return ret;
  }
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch
index 6026d30..7a2bbe8 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch
@@ -2886,7 +2886,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
        k=0;
        for(j=0;j<4;j++)
        {
-@@ -1468,26 +1488,16 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1468,26 +1488,18 @@ int tn7sar_proc_sar_stat(char* buf, char
          {
            if((char *)*pSarStat == NULL)
              break;
@@ -2897,7 +2897,8 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 -            k += dBytes;
 -          }
 +
-+          k += seq_printf(m, "%s: ",(char *) *pSarStat);
++          seq_printf(m, "%s: ",(char *) *pSarStat);
++          k += strlen((char *) *pSarStat) + strlen(": ");
            pSarStat++;
 -          if(len<=limit)
 -          {
@@ -2905,7 +2906,8 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 -            len += dBytes;
 -            k += dBytes;
 -          }
-+          k += seq_printf(m, "%s;  \n",(char *) *pSarStat);
++          seq_printf(m, "%s;  \n",(char *) *pSarStat);
++          k += strlen((char *) *pSarStat) + strlen(";  \n");
            pSarStat++;
  
            if(k > 60)
@@ -2917,7 +2919,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
            }
          }
  
-@@ -1496,9 +1506,22 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1496,9 +1508,22 @@ int tn7sar_proc_sar_stat(char* buf, char
      }
    }
  
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch
index 4588782..2e69300 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch
@@ -4,18 +4,18 @@
  static unsigned int tn7dsl_set_modulation(void* data, int flag);
  static void tn7dsl_ctrl_fineGain(int value);
  static void tn7dsl_set_fineGainValue(int value);
--static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp,
-+static int dslmod_sysctl (struct ctl_table * ctl, int write, struct file *filp,
-                           void *buffer, size_t * lenp);
+-static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer,
++static int dslmod_sysctl (struct ctl_table * ctl, int write, void *buffer,
+                           size_t * lenp, loff_t *ppos);
  static void tn7dsl_register_dslss_led(void);
  void tn7dsl_dslmod_sysctl_register(void);
 @@ -3308,7 +3308,7 @@ unsigned int tn7dsl_get_memory(unsigned
  
  
  
--static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp,
-+static int dslmod_sysctl(struct ctl_table *ctl, int write, struct file * filp,
-       void *buffer, size_t *lenp)
+-static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer,
++static int dslmod_sysctl(struct ctl_table *ctl, int write, void *buffer,
+       size_t *lenp, loff_t *ppos)
  {
    char *ptr;
 @@ -3423,7 +3423,7 @@ static int dslmod_sysctl(ctl_table *ctl,
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch
index 23045bb..10d32d2 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch
@@ -9,12 +9,43 @@
  #define MAX_STR_SIZE     256
  #define DSL_MOD_SIZE     256
  
+@@ -350,8 +350,8 @@ static void tn7dsl_chng_modulation(void*
+ static unsigned int tn7dsl_set_modulation(void* data, int flag);
+ static void tn7dsl_ctrl_fineGain(int value);
+ static void tn7dsl_set_fineGainValue(int value);
+-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp,
+-                          void *buffer, size_t * lenp);
++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer,
++                          size_t * lenp, loff_t *ppos);
+ static void tn7dsl_register_dslss_led(void);
+ void tn7dsl_dslmod_sysctl_register(void);
+ void tn7dsl_dslmod_sysctl_unregister(void);
+@@ -3582,8 +3582,8 @@ unsigned int tn7dsl_get_memory(unsigned
+ 
+ 
+ 
+-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp,
+-      void *buffer, size_t *lenp)
++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer,
++      size_t *lenp, loff_t *ppos)
+ {
+   char *ptr;
+   int ret, len = 0;
+@@ -3595,7 +3595,7 @@ static int dslmod_sysctl(ctl_table *ctl,
+   char mod_req[16] = { '\t' };
+   char fst_byt;
+ 
+-  if (!*lenp || (filp->f_pos && !write))
++  if (!*lenp || (*ppos && !write))
+   {
+     *lenp = 0;
+     return 0;
 @@ -3605,9 +3605,9 @@ static int dslmod_sysctl(ctl_table *ctl,
     */
    if(write)
      {
 -    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
-+    ret = proc_dostring(ctl, write, buffer, lenp, 0);
++    ret = proc_dostring(ctl, write, buffer, lenp, ppos);
  
 -    switch (ctl->ctl_name)
 +    switch ((long)ctl->extra2)
@@ -26,7 +57,7 @@
      {
      len += sprintf(info+len, mod_req);
 -    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
-+    ret = proc_dostring(ctl, write, buffer, lenp, 0);
++    ret = proc_dostring(ctl, write, buffer, lenp, ppos);
      }
    return ret;
  }
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch
index 1d3d758..ef1ddd8 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch
@@ -3023,7 +3023,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
        k=0;
        for(j=0;j<4;j++)
        {
-@@ -1620,26 +1640,16 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1620,26 +1640,18 @@ int tn7sar_proc_sar_stat(char* buf, char
          {
            if((char *)*pSarStat == NULL)
              break;
@@ -3034,7 +3034,8 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 -            k += dBytes;
 -          }
 +
-+          k += seq_printf(m, "%s: ",(char *) *pSarStat);
++          seq_printf(m, "%s: ",(char *) *pSarStat);
++          k += strlen((char *) *pSarStat) + strlen(": ");
            pSarStat++;
 -          if(len<=limit)
 -          {
@@ -3042,7 +3043,8 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 -            len += dBytes;
 -            k += dBytes;
 -          }
-+          k += seq_printf(m, "%s;  \n",(char *) *pSarStat);
++          seq_printf(m, "%s;  \n",(char *) *pSarStat);
++          k += strlen((char *) *pSarStat) + strlen(";  \n");
            pSarStat++;
  
            if(k > 60)
@@ -3054,7 +3056,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
            }
          }
  
-@@ -1648,9 +1658,22 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1648,9 +1660,22 @@ int tn7sar_proc_sar_stat(char* buf, char
      }
    }
  
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch
index 43da567..c95c876 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch
@@ -4,18 +4,18 @@
  static unsigned int tn7dsl_set_modulation(void* data, int flag);
  static void tn7dsl_ctrl_fineGain(int value);
  static void tn7dsl_set_fineGainValue(int value);
--static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp,
-+static int dslmod_sysctl (struct ctl_table * ctl, int write, struct file *filp,
-                           void *buffer, size_t * lenp);
+-static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer,
++static int dslmod_sysctl (struct ctl_table * ctl, int write, void *buffer,
+                           size_t * lenp, loff_t *ppos);
  static void tn7dsl_register_dslss_led(void);
  void tn7dsl_dslmod_sysctl_register(void);
 @@ -3488,7 +3488,7 @@ unsigned int tn7dsl_get_memory(unsigned
  
  
  
--static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp,
-+static int dslmod_sysctl(struct ctl_table *ctl, int write, struct file * filp,
-       void *buffer, size_t *lenp)
+-static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer,
++static int dslmod_sysctl(struct ctl_table *ctl, int write, void *buffer,
+       size_t *lenp, loff_t *ppos)
  {
    char *ptr;
 @@ -3603,7 +3603,7 @@ static int dslmod_sysctl(ctl_table *ctl,


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:10 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:10 -0400
Subject: [source]  ar7: unbreak serial console
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57028.1509316898.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/be11b3b1c71945fbac359104a21d55f245800c7b

commit be11b3b1c71945fbac359104a21d55f245800c7b
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sun Oct 29 23:12:20 2017 +0100

    ar7: unbreak serial console
    
    Serial output was broken since 3.16 for shared uarts between
    kernel and login. Fix this by adding a fix sent upstream.
    
    While at it, drop a useless patch that adds duplicate code.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 ...-ensure-the-port-type-s-FCR-value-is-used.patch | 48 ++++++++++++++++++++++
 .../linux/ar7/patches-3.18/500-serial_kludge.patch | 28 -------------
 .../linux/ar7/patches-3.18/950-cpmac_titan.patch   | 10 ++---
 3 files changed, 53 insertions(+), 33 deletions(-)

diff --git a/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch b/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch
new file mode 100644
index 0000000..f6a8754
--- /dev/null
+++ b/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch
@@ -0,0 +1,48 @@
+From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski at gmail.com>
+Date: Sun, 29 Oct 2017 15:50:42 +0100
+Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
+
+Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt
+trigger I/F of FIFO buffers"), the port's default FCR value isn't used
+in serial8250_do_set_termios anymore, but copied over once in
+serial8250_config_port and then modified as needed.
+
+Unfortunately, serial8250_config_port will never be called if the port
+is shared between kernel and userspace, and the port's flag doesn't have
+UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well.
+
+This causes garbled output from userspace:
+
+[    5.220000] random: procd urandom read with 49 bits of entropy available
+ers
+   [kee
+
+Fix this by forcing it to be configured on boot, resulting in the
+expected output:
+
+[    5.250000] random: procd urandom read with 50 bits of entropy available
+Press the [f] key and hit [enter] to enter failsafe mode
+Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
+
+Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers")
+Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+---
+I'm not sure if this is just AR7's issue, or if this points to a general
+issue for UARTs used as kernel console and login console with the "fixed"
+commit.
+
+ arch/mips/ar7/platform.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/mips/ar7/platform.c
++++ b/arch/mips/ar7/platform.c
+@@ -581,7 +581,7 @@ static int __init ar7_register_uarts(voi
+ 	uart_port.type		= PORT_AR7;
+ 	uart_port.uartclk	= clk_get_rate(bus_clk) / 2;
+ 	uart_port.iotype	= UPIO_MEM32;
+-	uart_port.flags		= UPF_FIXED_TYPE;
++	uart_port.flags		= UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF;
+ 	uart_port.regshift	= 2;
+ 
+ 	uart_port.line		= 0;
diff --git a/target/linux/ar7/patches-3.18/500-serial_kludge.patch b/target/linux/ar7/patches-3.18/500-serial_kludge.patch
deleted file mode 100644
index fc72530..0000000
--- a/target/linux/ar7/patches-3.18/500-serial_kludge.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/tty/serial/8250/8250_core.c
-+++ b/drivers/tty/serial/8250/8250_core.c
-@@ -329,6 +329,13 @@ static const struct serial8250_config ua
- 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
- 		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
- 	},
-+	[PORT_AR7] = {
-+		.name		= "TI-AR7",
-+		.fifo_size	= 16,
-+		.tx_loadsz	= 16,
-+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
-+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
-+	},
- };
- 
- /* Uart divisor latch read */
-@@ -3168,7 +3175,11 @@ static void serial8250_console_putchar(s
- {
- 	struct uart_8250_port *up = up_to_u8250p(port);
- 
-+#ifdef CONFIG_AR7
-+	wait_for_xmitr(up, BOTH_EMPTY);
-+#else
- 	wait_for_xmitr(up, UART_LSR_THRE);
-+#endif
- 	serial_port_out(port, UART_TX, ch);
- }
- 
diff --git a/target/linux/ar7/patches-3.18/950-cpmac_titan.patch b/target/linux/ar7/patches-3.18/950-cpmac_titan.patch
index f1d432c..3cabae0 100644
--- a/target/linux/ar7/patches-3.18/950-cpmac_titan.patch
+++ b/target/linux/ar7/patches-3.18/950-cpmac_titan.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/ethernet/ti/cpmac.c
 +++ b/drivers/net/ethernet/ti/cpmac.c
-@@ -1146,6 +1146,8 @@ static int cpmac_probe(struct platform_d
+@@ -1147,6 +1147,8 @@ static int cpmac_probe(struct platform_d
  		goto out;
  	}
  
@@ -9,7 +9,7 @@
  	dev->irq = platform_get_irq_byname(pdev, "irq");
  
  	dev->netdev_ops = &cpmac_netdev_ops;
-@@ -1227,7 +1229,7 @@ int cpmac_init(void)
+@@ -1228,7 +1230,7 @@ int cpmac_init(void)
  	cpmac_mii->reset = cpmac_mdio_reset;
  	cpmac_mii->irq = mii_irqs;
  
@@ -18,8 +18,8 @@
  
  	if (!cpmac_mii->priv) {
  		pr_err("Can't ioremap mdio registers\n");
-@@ -1238,10 +1240,16 @@ int cpmac_init(void)
- #warning FIXME: unhardcode gpio&reset bits
+@@ -1239,10 +1241,16 @@ int cpmac_init(void)
+ 	/* FIXME: unhardcode gpio&reset bits */
  	ar7_gpio_disable(26);
  	ar7_gpio_disable(27);
 -	ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
@@ -37,7 +37,7 @@
  	cpmac_mii->reset(cpmac_mii);
  
  	for (i = 0; i < 300; i++) {
-@@ -1258,7 +1266,11 @@ int cpmac_init(void)
+@@ -1259,7 +1267,11 @@ int cpmac_init(void)
  		mask = 0;
  	}
  


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:09 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:09 -0400
Subject: [source]  ar7: remove gpio character device
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57031.1509316899.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/23145d427613ee9b982cec25d187b41cc938f27a

commit 23145d427613ee9b982cec25d187b41cc938f27a
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Oct 12 10:51:53 2017 +0200

    ar7: remove gpio character device
    
    There are no obvious users, and any out of tree users should convert to
    one of the generic APIs.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/ar7/config-3.18                       |   1 -
 target/linux/ar7/config-4.1                        |   1 -
 target/linux/ar7/files/drivers/char/ar7_gpio.c     | 158 ---------------------
 .../linux/ar7/patches-3.18/120-gpio_chrdev.patch   |  28 ----
 target/linux/ar7/patches-4.1/120-gpio_chrdev.patch |  28 ----
 5 files changed, 216 deletions(-)

diff --git a/target/linux/ar7/config-3.18 b/target/linux/ar7/config-3.18
index 21c86db..a91d45e 100644
--- a/target/linux/ar7/config-3.18
+++ b/target/linux/ar7/config-3.18
@@ -1,6 +1,5 @@
 CONFIG_ADM6996_PHY=y
 CONFIG_AR7=y
-CONFIG_AR7_GPIO=y
 CONFIG_AR7_TI=y
 # CONFIG_AR7_TYPE_AC49X is not set
 CONFIG_AR7_TYPE_TI=y
diff --git a/target/linux/ar7/config-4.1 b/target/linux/ar7/config-4.1
index 7463d5b..91ab14f 100644
--- a/target/linux/ar7/config-4.1
+++ b/target/linux/ar7/config-4.1
@@ -1,6 +1,5 @@
 CONFIG_ADM6996_PHY=y
 CONFIG_AR7=y
-CONFIG_AR7_GPIO=y
 CONFIG_AR7_TI=y
 # CONFIG_AR7_TYPE_AC49X is not set
 CONFIG_AR7_TYPE_TI=y
diff --git a/target/linux/ar7/files/drivers/char/ar7_gpio.c b/target/linux/ar7/files/drivers/char/ar7_gpio.c
deleted file mode 100644
index 71310fa..0000000
--- a/target/linux/ar7/files/drivers/char/ar7_gpio.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2007 Nicolas Thill <nico at openwrt.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include <linux/device.h>
-#include <linux/fs.h>
-#include <linux/module.h>
-#include <linux/errno.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/uaccess.h>
-#include <linux/io.h>
-#include <linux/types.h>
-#include <linux/cdev.h>
-#include <gpio.h>
-
-#define DRVNAME "ar7_gpio"
-#define LONGNAME "TI AR7 GPIOs Driver"
-
-MODULE_AUTHOR("Nicolas Thill <nico at openwrt.org>");
-MODULE_DESCRIPTION(LONGNAME);
-MODULE_LICENSE("GPL");
-
-static int ar7_gpio_major;
-
-static ssize_t ar7_gpio_write(struct file *file, const char __user *buf,
-	size_t len, loff_t *ppos)
-{
-	int pin = iminor(file->f_path.dentry->d_inode);
-	size_t i;
-
-	for (i = 0; i < len; ++i) {
-		char c;
-		if (get_user(c, buf + i))
-			return -EFAULT;
-		switch (c) {
-		case '0':
-			gpio_set_value(pin, 0);
-			break;
-		case '1':
-			gpio_set_value(pin, 1);
-			break;
-		case 'd':
-		case 'D':
-			ar7_gpio_disable(pin);
-			break;
-		case 'e':
-		case 'E':
-			ar7_gpio_enable(pin);
-			break;
-		case 'i':
-		case 'I':
-		case '<':
-			gpio_direction_input(pin);
-			break;
-		case 'o':
-		case 'O':
-		case '>':
-			gpio_direction_output(pin, 0);
-			break;
-		default:
-			return -EINVAL;
-		}
-	}
-
-	return len;
-}
-
-static ssize_t ar7_gpio_read(struct file *file, char __user *buf,
-	size_t len, loff_t *ppos)
-{
-	int pin = iminor(file->f_path.dentry->d_inode);
-	int value;
-
-	value = gpio_get_value(pin);
-	if (put_user(value ? '1' : '0', buf))
-		return -EFAULT;
-
-	return 1;
-}
-
-static int ar7_gpio_open(struct inode *inode, struct file *file)
-{
-	int m = iminor(inode);
-
-	if (m >= (ar7_is_titan() ? TITAN_GPIO_MAX : AR7_GPIO_MAX))
-		return -EINVAL;
-
-	return nonseekable_open(inode, file);
-}
-
-static int ar7_gpio_release(struct inode *inode, struct file *file)
-{
-	return 0;
-}
-
-static const struct file_operations ar7_gpio_fops = {
-	.owner   = THIS_MODULE,
-	.write   = ar7_gpio_write,
-	.read    = ar7_gpio_read,
-	.open    = ar7_gpio_open,
-	.release = ar7_gpio_release,
-	.llseek  = no_llseek,
-};
-
-static struct platform_device *ar7_gpio_device;
-
-static int __init ar7_gpio_char_init(void)
-{
-	int rc;
-
-	ar7_gpio_device = platform_device_alloc(DRVNAME, -1);
-	if (!ar7_gpio_device)
-		return -ENOMEM;
-
-	rc = platform_device_add(ar7_gpio_device);
-	if (rc < 0)
-		goto out_put;
-
-	rc = register_chrdev(ar7_gpio_major, DRVNAME, &ar7_gpio_fops);
-	if (rc < 0)
-		goto out_put;
-
-	ar7_gpio_major = rc;
-
-	rc = 0;
-
-	goto out;
-
-out_put:
-	platform_device_put(ar7_gpio_device);
-out:
-	return rc;
-}
-
-static void __exit ar7_gpio_char_exit(void)
-{
-	unregister_chrdev(ar7_gpio_major, DRVNAME);
-	platform_device_unregister(ar7_gpio_device);
-}
-
-module_init(ar7_gpio_char_init);
-module_exit(ar7_gpio_char_exit);
diff --git a/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch b/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch
deleted file mode 100644
index beb0052..0000000
--- a/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/char/Kconfig
-+++ b/drivers/char/Kconfig
-@@ -452,6 +452,15 @@ config MWAVE
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called mwave.
- 
-+config AR7_GPIO
-+	tristate "TI AR7 GPIO Support"
-+	depends on AR7
-+	help
-+	  Give userspace access to the GPIO pins on the Texas Instruments AR7
-+	  processors.
-+
-+	  If compiled as a module, it will be called ar7_gpio.
-+
- config SCx200_GPIO
- 	tristate "NatSemi SCx200 GPIO Support"
- 	depends on SCx200
---- a/drivers/char/Makefile
-+++ b/drivers/char/Makefile
-@@ -42,6 +42,7 @@ obj-$(CONFIG_HW_RANDOM)		+= hw_random/
- obj-$(CONFIG_PPDEV)		+= ppdev.o
- obj-$(CONFIG_NWBUTTON)		+= nwbutton.o
- obj-$(CONFIG_NWFLASH)		+= nwflash.o
-+obj-$(CONFIG_AR7_GPIO)		+= ar7_gpio.o
- obj-$(CONFIG_SCx200_GPIO)	+= scx200_gpio.o
- obj-$(CONFIG_PC8736x_GPIO)	+= pc8736x_gpio.o
- obj-$(CONFIG_NSC_GPIO)		+= nsc_gpio.o
diff --git a/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch b/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch
deleted file mode 100644
index 1468ca3..0000000
--- a/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/char/Kconfig
-+++ b/drivers/char/Kconfig
-@@ -461,6 +461,15 @@ config MWAVE
- 	  To compile this driver as a module, choose M here: the
- 	  module will be called mwave.
- 
-+config AR7_GPIO
-+	tristate "TI AR7 GPIO Support"
-+	depends on AR7
-+	help
-+	  Give userspace access to the GPIO pins on the Texas Instruments AR7
-+	  processors.
-+
-+	  If compiled as a module, it will be called ar7_gpio.
-+
- config SCx200_GPIO
- 	tristate "NatSemi SCx200 GPIO Support"
- 	depends on SCx200
---- a/drivers/char/Makefile
-+++ b/drivers/char/Makefile
-@@ -42,6 +42,7 @@ obj-$(CONFIG_HW_RANDOM)		+= hw_random/
- obj-$(CONFIG_PPDEV)		+= ppdev.o
- obj-$(CONFIG_NWBUTTON)		+= nwbutton.o
- obj-$(CONFIG_NWFLASH)		+= nwflash.o
-+obj-$(CONFIG_AR7_GPIO)		+= ar7_gpio.o
- obj-$(CONFIG_SCx200_GPIO)	+= scx200_gpio.o
- obj-$(CONFIG_PC8736x_GPIO)	+= pc8736x_gpio.o
- obj-$(CONFIG_NSC_GPIO)		+= nsc_gpio.o


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:06 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:06 -0400
Subject: [source]  ar7-atm: drop LINUX_VERSION tests
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57032.1509316899.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/889b21f95414dcff942cb5f72d764d876b68ace2

commit 889b21f95414dcff942cb5f72d764d876b68ace2
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Oct 13 11:32:31 2017 +0200

    ar7-atm: drop LINUX_VERSION tests
    
    Minimum supported kernel is 3.18, so we don't need to test for anything
    older. In addition, the API hasn't changed since then, so we don't need
    to check for any kernel version at all.  This helps to keeps the amount
    of changes more managable.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 .../patches-D7.04.03.00/170-bus_id_removal.patch   |  19 +--
 .../180-git_headers_include.patch                  |  35 ++---
 .../190-2.6.32_proc_fixes.patch                    |  40 ++---
 .../patches-D7.04.03.00/200-2.6.37_args.patch      |  12 +-
 .../220-3.10-update_proc_code.patch                | 118 ++++++---------
 .../patches-D7.04.03.00/240-3.18_fixes.patch       |  18 +--
 .../patches-D7.04.03.00/250-4.1_fixes.patch        |   4 +-
 .../patches-D7.05.01.00/170-bus_id_removal.patch   |  19 +--
 .../180-git_headers_include.patch                  |  35 ++---
 .../190-2.6.32_proc_fixes.patch                    |  40 ++---
 .../patches-D7.05.01.00/200-2.6.37_args.patch      |  12 +-
 .../220-3.10-update_proc_code.patch                | 164 +++++++++------------
 .../patches-D7.05.01.00/240-3.18_fixes.patch       |  18 +--
 .../patches-D7.05.01.00/250-4.1_fixes.patch        |   4 +-
 14 files changed, 199 insertions(+), 339 deletions(-)

diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch
index 9f1f0fd..a970574 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch
@@ -1,30 +1,19 @@
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -109,6 +109,7 @@
- #include <linux/vmalloc.h>
- #include <linux/file.h>
- #include <linux/firmware.h>
-+#include <linux/version.h>
- 
- #include <asm/io.h>
- #include <asm/ar7/ar7.h>
-@@ -446,7 +447,9 @@ static void avsar_release(struct device
+@@ -446,7 +446,6 @@ static void avsar_release(struct device
  }
  
  static struct device avsar = {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- 	.bus_id    = "vlynq",
-+#endif
+-	.bus_id    = "vlynq",
  	.release   = avsar_release,
  };
  
-@@ -455,6 +458,9 @@ int shim_osLoadFWImage(unsigned char *pt
+@@ -455,6 +454,8 @@ int shim_osLoadFWImage(unsigned char *pt
  	const struct firmware *fw_entry;
  	size_t size;
  
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
 +	dev_set_name(&avsar, "avsar");
-+#endif
++
  	printk("requesting firmware image \"ar0700xx.bin\"\n");
  	if(device_register(&avsar) < 0) {
  		printk(KERN_ERR
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch
index 6bd8f48..6d72b00 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch
@@ -1,54 +1,39 @@
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -71,10 +71,16 @@
- #include <linux/proc_fs.h>
- #include <linux/string.h>
+@@ -73,8 +73,8 @@
  #include <linux/ctype.h>
-+#include <linux/version.h>
  
  #include <asm/io.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
- #include <asm/ar7/ar7.h>
- #include <asm/ar7/prom.h>
-+#else
+-#include <asm/ar7/ar7.h>
+-#include <asm/ar7/prom.h>
 +#include <asm/mach-ar7/ar7.h>
 +#include <asm/mach-ar7/prom.h>
-+#endif
  
  #include "dsl_hal_api.h"
  #include "tn7atm.h"
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -112,8 +112,13 @@
- #include <linux/version.h>
+@@ -111,8 +111,8 @@
+ #include <linux/firmware.h>
  
  #include <asm/io.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
- #include <asm/ar7/ar7.h>
- #include <asm/ar7/prom.h>
-+#else
+-#include <asm/ar7/ar7.h>
+-#include <asm/ar7/prom.h>
 +#include <asm/mach-ar7/ar7.h>
 +#include <asm/mach-ar7/prom.h>
-+#endif
  
  /* Modules specific header files */
  #include "tn7atm.h"
 --- a/tn7sar.c
 +++ b/tn7sar.c
-@@ -52,10 +52,16 @@
- #include <linux/proc_fs.h>
- #include <linux/string.h>
+@@ -54,8 +54,8 @@
  #include <linux/ctype.h>
-+#include <linux/version.h>
  
  #include <asm/io.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
- #include <asm/ar7/ar7.h>
- #include <asm/ar7/prom.h>
-+#else
+-#include <asm/ar7/ar7.h>
+-#include <asm/ar7/prom.h>
 +#include <asm/mach-ar7/ar7.h>
 +#include <asm/mach-ar7/prom.h>
-+#endif
  
  #define _CPHAL_AAL5
  #define _CPHAL_SAR
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch
index 11487bf..87a1fde 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch
@@ -1,53 +1,39 @@
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -203,7 +203,11 @@ led_reg_t ledreg[2];
+@@ -197,7 +197,7 @@ led_reg_t ledreg[2];
  static struct led_funcs ledreg[2];
  #endif
  
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
- #define DEV_DSLMOD       CTL_UNNUMBERED
-+#else
+-#define DEV_DSLMOD       CTL_UNNUMBERED
 +#define DEV_DSLMOD	0
-+#endif
  #define MAX_STR_SIZE     256
  #define DSL_MOD_SIZE     256
  
-@@ -3431,9 +3435,16 @@ static int dslmod_sysctl(ctl_table *ctl,
+@@ -3421,9 +3421,9 @@ static int dslmod_sysctl(ctl_table *ctl,
     */
    if(write)
      {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-     ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
--
-+#else
+-    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
 +    ret = proc_dostring(ctl, write, buffer, lenp, 0);
-+#endif
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-     switch (ctl->ctl_name)
-+#else
+ 
+-    switch (ctl->ctl_name)
 +    switch ((long)ctl->extra2)
-+#endif
        {
        case DEV_DSLMOD:
        ptr = strpbrk(info, " \t");
-@@ -3517,14 +3528,29 @@ static int dslmod_sysctl(ctl_table *ctl,
+@@ -3507,14 +3507,21 @@ static int dslmod_sysctl(ctl_table *ctl,
    else
      {
      len += sprintf(info+len, mod_req);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-     ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
-+#else
+-    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
 +    ret = proc_dostring(ctl, write, buffer, lenp, 0);
-+#endif
      }
    return ret;
  }
  
  
  ctl_table dslmod_table[] = {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
-+#else
+-  {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
 +	{
 +		.procname 		= "dslmod",
 +		.data			= info,
@@ -56,24 +42,20 @@
 +		.proc_handler	= &dslmod_sysctl,
 +		.extra2			= (void *)DEV_DSLMOD,
 +	}
-+#endif
    ,
    {0}
    };
-@@ -3532,7 +3558,16 @@ ctl_table dslmod_table[] = {
+@@ -3522,7 +3529,12 @@ ctl_table dslmod_table[] = {
  /* Make sure that /proc/sys/dev is there */
  ctl_table dslmod_root_table[] = {
  #ifdef CONFIG_PROC_FS
-+	#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
-+	#else
+-  {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
 +	{
 +		.procname		= "dev",
 +		.maxlen			= 0,
 +		.mode			= 0555,
 +		.child			= dslmod_table,
 +	}
-+	#endif
    ,
  #endif /* CONFIG_PROC_FS */
    {0}
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch
index e8668b6..2007b49 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch
@@ -1,28 +1,24 @@
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -1876,7 +1876,11 @@ static int __init tn7atm_register (Tn7At
+@@ -1870,7 +1870,7 @@ static int __init tn7atm_register (Tn7At
  
    dgprintf (4, "device %s being registered\n", priv->name);
  
-+  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
-   mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL);
-+  #else
+-  mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL);
 +  mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL);
-+  #endif
  
    if (mydev == NULL)
    {
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -466,14 +466,17 @@ int shim_osLoadFWImage(unsigned char *pt
+@@ -453,13 +453,16 @@ int shim_osLoadFWImage(unsigned char *pt
  {
  	const struct firmware *fw_entry;
  	size_t size;
 + 	int ret;
  
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
  	dev_set_name(&avsar, "avsar");
- #endif
+ 
  	printk("requesting firmware image \"ar0700xx.bin\"\n");
 -	if(device_register(&avsar) < 0) {
 +	dev_set_name(&avsar, "avsar");
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch
index be81ee1..6026d30 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch
@@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif __SGAPI_H
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -277,25 +277,15 @@ static int tn7atm_change_qos (struct atm
+@@ -271,25 +271,15 @@ static int tn7atm_change_qos (struct atm
  static int tn7atm_detect (void);
  static int tn7atm_init (struct atm_dev *dev);
  static int tn7atm_irq_request (struct atm_dev *dev);
@@ -147,15 +147,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
  //CT - Added function to return chipset Id
         void tn7atm_get_chipsetId (char *pVerId);
-@@ -415,63 +405,67 @@ const char drv_proc_root_folder[] = "ava
- static struct proc_dir_entry *root_proc_dir_entry = NULL;
- #define DRV_PROC_MODE 0644
- static int proc_root_already_exists = TRUE;
-+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-+#define PDE_DATA(inode) PDE(inode)->data
-+#endif
-+
+@@ -412,60 +402,59 @@ static int proc_root_already_exists = TR
  static struct
  {
      const unsigned char name[32];
@@ -250,7 +242,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  };
  
  /* *INDENT-ON* */
-@@ -1709,75 +1703,81 @@ int tn7atm_receive (void *os_dev, int ch
+@@ -1703,75 +1692,81 @@ int tn7atm_receive (void *os_dev, int ch
    return 0;
  }
  
@@ -301,15 +293,15 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
 -  return len;
 +  return 0;
-+}
-+
-+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file)
-+{
-+	return single_open(file, tn7atm_proc_channels, PDE_DATA(inode));
  }
  
 -static int tn7atm_proc_private (char *buf, char **start, off_t offset,
 -                                int count, int *eof, void *data)
++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file)
++{
++	return single_open(file, tn7atm_proc_channels, PDE_DATA(inode));
++}
++
 +static struct file_operations tn7atm_proc_channels_fops = {
 +	.owner 		= THIS_MODULE,
 +	.open		= tn7atm_proc_channels_open,
@@ -353,11 +345,11 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 +
 +  seq_printf (m, "tx_irq: %02d", priv->sar_irq);
 +  seq_printf (m, "rx_irq: %02d", priv->dsl_irq);
- 
--  return len;
++
 +  return 0;
 +}
-+
+ 
+-  return len;
 +static int tn7atm_proc_private_open(struct inode *inode, struct file *file)
 +{
 +	return single_open(file, tn7atm_proc_private, PDE_DATA(inode));
@@ -374,7 +366,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr,
                                   int interrupt_num)
  {
-@@ -1900,10 +1900,8 @@ static int __init tn7atm_register (Tn7At
+@@ -1890,10 +1885,8 @@ static int __init tn7atm_register (Tn7At
    return ATM_REG_OK;
  }
  
@@ -386,7 +378,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    char dslVer[8];
    char dspVer[10];
    char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id
-@@ -1914,56 +1912,64 @@ static int tn7atm_proc_version (char *bu
+@@ -1904,56 +1897,64 @@ static int tn7atm_proc_version (char *bu
  
    priv = mydev->dev_data;
  
@@ -472,7 +464,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int ctr;
    const char *residual;
  
-@@ -2012,24 +2018,7 @@ static int __init tn7atm_detect (void)
+@@ -2002,24 +2003,7 @@ static int __init tn7atm_detect (void)
     */
    for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++)
    {
@@ -498,7 +490,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    }
  
    tn7dsl_dslmod_sysctl_register ();
-@@ -2501,63 +2490,10 @@ static int tn7atm_set_can_support_adsl2
+@@ -2491,63 +2475,10 @@ static int tn7atm_set_can_support_adsl2
    return TRUE;
  }
  
@@ -564,7 +556,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
  }
  static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data)
-@@ -2591,5 +2527,19 @@ static int tn7atm_proc_qos_write(struct
+@@ -2581,5 +2512,19 @@ static int tn7atm_proc_qos_write(struct
      return count;
  }
  
@@ -586,17 +578,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  module_exit (tn7atm_exit);
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -221,6 +221,9 @@ static struct led_funcs ledreg[2];
- 
- #define tn7dsl_kfree_skb(x)      dev_kfree_skb(x)
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-+#define PDE_DATA(inode) PDE(inode)->data
-+#endif
- 
- //---------------------------------------------
- // Begin Clear EOC definitions
-@@ -349,7 +352,7 @@ static void tn7dsl_register_dslss_led(vo
+@@ -339,7 +339,7 @@ static void tn7dsl_register_dslss_led(vo
  void tn7dsl_dslmod_sysctl_register(void);
  void tn7dsl_dslmod_sysctl_unregister(void);
  static int tn7dsl_clear_eoc_receive(void);
@@ -605,7 +587,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /* end of internal functions */
  
  //  UR8_MERGE_START CQ11054   Jack Zhang
-@@ -649,11 +652,9 @@ void shim_osCriticalExit(void)
+@@ -635,11 +635,9 @@ void shim_osCriticalExit(void)
    spin_unlock_irqrestore(&shimLock, flags);
  }
  
@@ -618,7 +600,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int i, j;
    int bin = (int) data;
    unsigned short *rxSnrPerBin;
-@@ -674,95 +675,128 @@ static int tn7dsl_proc_snr_print (char *
+@@ -660,95 +658,128 @@ static int tn7dsl_proc_snr_print (char *
        break;
  
    default:
@@ -791,7 +773,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #ifndef NO_ACT
  int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count,
                   int *eof, void *data)
-@@ -825,59 +859,48 @@ static char *pUnknown= "Unknown";
+@@ -811,59 +842,48 @@ static char *pUnknown= "Unknown";
  #ifdef ADV_DIAG_STATS //CQ10275, CQ10449
  //UR8_MERGE_START CQ10449 Jack Zhang
  
@@ -874,7 +856,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  {
    int len = 0;
    int i = 0;
-@@ -886,66 +909,53 @@ static int proc_adv_stats_header(char* b
+@@ -872,66 +892,53 @@ static int proc_adv_stats_header(char* b
     */
  
    dslhal_api_gatherStatistics(pIhw);
@@ -963,7 +945,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  }
  
  static int getDiagDisplayMode()
-@@ -968,29 +978,24 @@ static int getDiagDisplayMode()
+@@ -954,29 +961,24 @@ static int getDiagDisplayMode()
      ret = 2;
    return ret;
  }
@@ -998,7 +980,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
                      (unsigned int)pIhw->AppData.marginTblDstrm[i],
                      (int)pIhw->AppData.rxSnrPerBin0[i]);
-@@ -1001,26 +1006,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch
+@@ -987,26 +989,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch
      if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
      {
        dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
@@ -1041,7 +1023,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int i;
    int mode = 0;  //mode = 0 => ADSL1 or ADSL2 & 2+
    unsigned char SNRpsds[512];
-@@ -1030,12 +1043,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
+@@ -1016,12 +1026,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
    if( mode==1) //ADSL1
    {
    dslhal_api_gatherStatistics(pIhw);
@@ -1056,7 +1038,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
                      (unsigned int)pIhw->AppData.marginTblDstrm[i],
                      (int)pIhw->AppData.rxSnrPerBin0[i]);
-@@ -1046,26 +1057,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
+@@ -1032,26 +1040,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
      if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
      {
        dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
@@ -1100,7 +1082,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int i;
    int mode = 0;  //mode = 0 => ADSL1 or ADSL2 & 2+
    unsigned char SNRpsds[512];
-@@ -1075,12 +1095,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
+@@ -1061,12 +1078,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
    if( mode==1) //ADSL1
    {
    dslhal_api_gatherStatistics(pIhw);
@@ -1115,7 +1097,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
                      (unsigned int)pIhw->AppData.marginTblDstrm[i],
                      (int)pIhw->AppData.rxSnrPerBin0[i]);
-@@ -1091,283 +1109,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
+@@ -1077,283 +1092,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
      if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
      {
        dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
@@ -1256,7 +1238,9 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  {
 +	return single_open(file, tn7dsl_proc_dbg_cmsgs, PDE_DATA(inode));
 +}
-+
+ 
+-  int len = 0;
+-  int limit = count - 80;
 +struct file_operations tn7dsl_proc_dbg_cmsgs_fops = {
 +	.owner 		= THIS_MODULE,
 +	.open		= tn7dsl_proc_dbg_cmsgs_open,
@@ -1264,9 +1248,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 +	.llseek		= seq_lseek,
 +	.release	= single_release,
 +};
- 
--  int len = 0;
--  int limit = count - 80;
++
 +
 +int tn7dsl_proc_dbg_rmsgs1(struct seq_file *m, void *data)
 +{
@@ -1544,7 +1526,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int F4count, F5count;
    unsigned int maxRate=0;
    unsigned int us_maxRate=0;
-@@ -1375,80 +1397,58 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1361,80 +1380,58 @@ int tn7dsl_proc_stats(char* buf, char **
    //UR8_MERGE_START CQ10700 Manjula K
    struct atm_dev *dev;
    Tn7AtmPrivate *priv;
@@ -1648,7 +1630,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      ((unsigned int) pIhw->AppData.usAtm_count[0] +
                       (unsigned int) pIhw->AppData.usAtm_count[1]) * 48,
                      ((unsigned int) pIhw->AppData.dsGood_count[0] +
-@@ -1456,9 +1456,7 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1442,9 +1439,7 @@ int tn7dsl_proc_stats(char* buf, char **
    /*
     * Superframe Count
     */
@@ -1659,7 +1641,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                 "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n",
                     (unsigned int)pIhw->AppData.usSuperFrmCnt,
                     (unsigned int)pIhw->AppData.dsSuperFrmCnt );
-@@ -1466,57 +1464,45 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1452,57 +1447,45 @@ int tn7dsl_proc_stats(char* buf, char **
    /*
     * US and DS power
     */
@@ -1732,7 +1714,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                     (unsigned int)pIhw->AppData.currentHybridNum, trellis);
  
    //@Added Maximum attainable bit rate information. 05-14-2004
-@@ -1528,12 +1514,12 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1514,12 +1497,12 @@ int tn7dsl_proc_stats(char* buf, char **
    }
    else
    {
@@ -1747,7 +1729,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                                   (unsigned char *) &rMsgsRA[0], 12);
  
       maxRate = (unsigned int)pIhw->AppData.DSConRate;
-@@ -1549,283 +1535,213 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1535,283 +1518,213 @@ int tn7dsl_proc_stats(char* buf, char **
       }
    }
  
@@ -2129,7 +2111,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    char *state;
    int tag;
  
-@@ -1859,16 +1775,26 @@ int tn7dsl_proc_modem(char* buf, char **
+@@ -1845,16 +1758,26 @@ int tn7dsl_proc_modem(char* buf, char **
  
    if(pIhw->lConnected == 1)
      state = "SHOWTIME";
@@ -2163,7 +2145,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /**********************************************************************
  **                                                                    *
  **  tn7dsl_hdlc_update_crc() -- Calculate CRC                         *
-@@ -2133,11 +2059,8 @@ static int tn7dsl_hdlc_rx_process(unsign
+@@ -2119,11 +2042,8 @@ static int tn7dsl_hdlc_rx_process(unsign
    return(ret);
  }
  
@@ -2176,7 +2158,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int offset[2] = {34, 0};  // point to buffer parameter data structure
    clearEocParm_t   peoc;
  
-@@ -2146,62 +2069,49 @@ int tn7dsl_proc_eoc (char *buf, char **s
+@@ -2132,62 +2052,49 @@ int tn7dsl_proc_eoc (char *buf, char **s
                                 (unsigned char *) &peoc,
                                 sizeof (clearEocParm_t));
  
@@ -2279,7 +2261,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  int tn7dsl_clear_eoc_setup(void)
  {
    int   i;
-@@ -4440,14 +4350,10 @@ int tn7dsl_proc_write_stats (struct file
+@@ -4407,14 +4314,10 @@ int tn7dsl_proc_write_stats (struct file
  }
  
  
@@ -2295,7 +2277,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
    typedef struct
    {
-@@ -4528,197 +4434,185 @@ int tn7dsl_proc_train_mode_export (char
+@@ -4495,197 +4398,185 @@ int tn7dsl_proc_train_mode_export (char
    }
  
  
@@ -2574,7 +2556,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    }
  
    start = (indx -1) * 128;
-@@ -4727,39 +4621,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char
+@@ -4694,39 +4585,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char
    {
      if (!(i%8))
      {
@@ -2679,7 +2661,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif
  #endif //TR69_HLIN_IN
  //  UR8_MERGE_END   CQ10979*
-@@ -4767,64 +4711,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha
+@@ -4734,64 +4675,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha
  // *    UR8_MERGE_START CQ11057   Jack Zhang
  #ifdef TR69_PMD_IN
  #ifndef NO_ADV_STATS
@@ -2760,7 +2742,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
    }
  
-@@ -4832,19 +4760,28 @@ int tn7dsl_proc_PMDus(char* buf, char **
+@@ -4799,19 +4724,28 @@ int tn7dsl_proc_PMDus(char* buf, char **
    for (i=0; i<pIhw->AppData.max_us_tones; i++)
    {
      if (!(i%16))
@@ -2800,15 +2782,11 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  // *    UR8_MERGE_END   CQ11057 *
 --- a/tn7sar.c
 +++ b/tn7sar.c
-@@ -1401,44 +1401,70 @@ int tn7sar_oam_generation(void *privCont
+@@ -1395,44 +1395,66 @@ int tn7sar_oam_generation(void *privCont
    return 0;
  }
  
 -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-+#define PDE_DATA(inode) PDE(inode)->data
-+#endif
-+
 +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data)
  {
 -  int len = 0;
@@ -2883,7 +2861,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    struct atm_dev *dev;
    Tn7AtmPrivate *priv;
    int i, j, k;
-@@ -1447,21 +1473,19 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1441,21 +1463,19 @@ int tn7sar_proc_sar_stat(char* buf, char
    unsigned int *pStateBase, *pSarStat;
    HAL_FUNCTIONS *pHalFunc;
    HAL_DEVICE    *pHalDev;
@@ -2908,7 +2886,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
        k=0;
        for(j=0;j<4;j++)
        {
-@@ -1474,26 +1498,16 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1468,26 +1488,16 @@ int tn7sar_proc_sar_stat(char* buf, char
          {
            if((char *)*pSarStat == NULL)
              break;
@@ -2939,7 +2917,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
            }
          }
  
-@@ -1502,9 +1516,22 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1496,9 +1506,22 @@ int tn7sar_proc_sar_stat(char* buf, char
      }
    }
  
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch
index e8bdab6..4588782 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch
@@ -1,6 +1,6 @@
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -346,7 +346,7 @@ static void tn7dsl_chng_modulation(void*
+@@ -333,7 +333,7 @@ static void tn7dsl_chng_modulation(void*
  static unsigned int tn7dsl_set_modulation(void* data, int flag);
  static void tn7dsl_ctrl_fineGain(int value);
  static void tn7dsl_set_fineGainValue(int value);
@@ -9,7 +9,7 @@
                            void *buffer, size_t * lenp);
  static void tn7dsl_register_dslss_led(void);
  void tn7dsl_dslmod_sysctl_register(void);
-@@ -3325,7 +3325,7 @@ unsigned int tn7dsl_get_memory(unsigned
+@@ -3308,7 +3308,7 @@ unsigned int tn7dsl_get_memory(unsigned
  
  
  
@@ -18,21 +18,21 @@
        void *buffer, size_t *lenp)
  {
    char *ptr;
-@@ -3451,7 +3451,7 @@ static int dslmod_sysctl(ctl_table *ctl,
+@@ -3423,7 +3423,7 @@ static int dslmod_sysctl(ctl_table *ctl,
  }
  
  
 -ctl_table dslmod_table[] = {
 +struct ctl_table dslmod_table[] = {
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
- #else
-@@ -3469,7 +3469,7 @@ ctl_table dslmod_table[] = {
+ 	{
+ 		.procname 		= "dslmod",
+ 		.data			= info,
+@@ -3437,7 +3437,7 @@ ctl_table dslmod_table[] = {
    };
  
  /* Make sure that /proc/sys/dev is there */
 -ctl_table dslmod_root_table[] = {
 +struct ctl_table dslmod_root_table[] = {
  #ifdef CONFIG_PROC_FS
- 	#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
+ 	{
+ 		.procname		= "dev",
diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch
index 97a26cb..f26b7e2 100644
--- a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch
@@ -1,6 +1,6 @@
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -788,7 +788,7 @@ static int __init tn7atm_irq_request (st
+@@ -777,7 +777,7 @@ static int __init tn7atm_irq_request (st
     * Register SAR interrupt
     */
    priv->sar_irq = LNXINTNUM (ATM_SAR_INT);      /* Interrupt line # */
@@ -9,7 +9,7 @@
      printk ("Could not register tn7atm_sar_irq\n");
  
    /*
-@@ -806,7 +806,7 @@ static int __init tn7atm_irq_request (st
+@@ -795,7 +795,7 @@ static int __init tn7atm_irq_request (st
     * Reigster Receive interrupt A
     */
    priv->dsl_irq = LNXINTNUM (ATM_DSL_INT);      /* Interrupt line # */
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch
index 6692f40..53767e4 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch
@@ -1,30 +1,19 @@
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -117,6 +117,7 @@
- #include <linux/vmalloc.h>
- #include <linux/file.h>
- #include <linux/firmware.h>
-+#include <linux/version.h>
- 
- #include <asm/io.h>
- #include <asm/ar7/ar7.h>
-@@ -492,7 +493,9 @@ static void avsar_release(struct device
+@@ -492,7 +492,6 @@ static void avsar_release(struct device
  }
  
  static struct device avsar = {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
- 	.bus_id    = "vlynq",
-+#endif
+-	.bus_id    = "vlynq",
  	.release   = avsar_release,
  };
  
-@@ -501,6 +504,9 @@ int shim_osLoadFWImage(unsigned char *pt
+@@ -501,6 +500,8 @@ int shim_osLoadFWImage(unsigned char *pt
  	const struct firmware *fw_entry;
  	size_t size;
  
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
 +	dev_set_name(&avsar, "avsar");
-+#endif
++
  	printk("requesting firmware image \"ar0700xx.bin\"\n");
  	if(device_register(&avsar) < 0) {
  		printk(KERN_ERR
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch
index feb6ea8..69b433b 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch
@@ -1,54 +1,39 @@
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -76,10 +76,16 @@
- #include <linux/proc_fs.h>
- #include <linux/string.h>
+@@ -78,8 +78,8 @@
  #include <linux/ctype.h>
-+#include <linux/version.h>
  
  #include <asm/io.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
- #include <asm/ar7/ar7.h>
- #include <asm/ar7/prom.h>
-+#else
+-#include <asm/ar7/ar7.h>
+-#include <asm/ar7/prom.h>
 +#include <asm/mach-ar7/ar7.h>
 +#include <asm/mach-ar7/prom.h>
-+#endif
  
  #include "dsl_hal_api.h"
  #ifdef AR7_EFM
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -120,8 +120,13 @@
- #include <linux/version.h>
+@@ -119,8 +119,8 @@
+ #include <linux/firmware.h>
  
  #include <asm/io.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
- #include <asm/ar7/ar7.h>
- #include <asm/ar7/prom.h>
-+#else
+-#include <asm/ar7/ar7.h>
+-#include <asm/ar7/prom.h>
 +#include <asm/mach-ar7/ar7.h>
 +#include <asm/mach-ar7/prom.h>
-+#endif
  
  /* Modules specific header files */
  #ifdef AR7_EFM
 --- a/tn7sar.c
 +++ b/tn7sar.c
-@@ -53,10 +53,16 @@
- #include <linux/proc_fs.h>
- #include <linux/string.h>
+@@ -55,8 +55,8 @@
  #include <linux/ctype.h>
-+#include <linux/version.h>
  
  #include <asm/io.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
- #include <asm/ar7/ar7.h>
- #include <asm/ar7/prom.h>
-+#else
+-#include <asm/ar7/ar7.h>
+-#include <asm/ar7/prom.h>
 +#include <asm/mach-ar7/ar7.h>
 +#include <asm/mach-ar7/prom.h>
-+#endif
  
  #define _CPHAL_AAL5
  #define _CPHAL_SAR
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch
index 52ebbc1..23045bb 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch
@@ -1,53 +1,39 @@
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -215,7 +215,11 @@ led_reg_t ledreg[2];
+@@ -209,7 +209,7 @@ led_reg_t ledreg[2];
  static struct led_funcs ledreg[2];
  #endif
  
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
- #define DEV_DSLMOD       CTL_UNNUMBERED
-+#else
+-#define DEV_DSLMOD       CTL_UNNUMBERED
 +#define DEV_DSLMOD	0
-+#endif
  #define MAX_STR_SIZE     256
  #define DSL_MOD_SIZE     256
  
-@@ -3615,9 +3619,16 @@ static int dslmod_sysctl(ctl_table *ctl,
+@@ -3605,9 +3605,9 @@ static int dslmod_sysctl(ctl_table *ctl,
     */
    if(write)
      {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-     ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
--
-+#else
+-    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
 +    ret = proc_dostring(ctl, write, buffer, lenp, 0);
-+#endif
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-     switch (ctl->ctl_name)
-+#else
+ 
+-    switch (ctl->ctl_name)
 +    switch ((long)ctl->extra2)
-+#endif
        {
        case DEV_DSLMOD:
        ptr = strpbrk(info, " \t");
-@@ -3701,14 +3712,29 @@ static int dslmod_sysctl(ctl_table *ctl,
+@@ -3691,14 +3691,21 @@ static int dslmod_sysctl(ctl_table *ctl,
    else
      {
      len += sprintf(info+len, mod_req);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-     ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
-+#else
+-    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
 +    ret = proc_dostring(ctl, write, buffer, lenp, 0);
-+#endif
      }
    return ret;
  }
  
  
  ctl_table dslmod_table[] = {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
-+#else
+-  {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
 +	{
 +		.procname 		= "dslmod",
 +		.data			= info,
@@ -56,24 +42,20 @@
 +		.proc_handler	= &dslmod_sysctl,
 +		.extra2			= (void *)DEV_DSLMOD,
 +	}
-+#endif
    ,
    {0}
    };
-@@ -3716,7 +3742,16 @@ ctl_table dslmod_table[] = {
+@@ -3706,7 +3713,12 @@ ctl_table dslmod_table[] = {
  /* Make sure that /proc/sys/dev is there */
  ctl_table dslmod_root_table[] = {
  #ifdef CONFIG_PROC_FS
-+	#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
-+	#else
+-  {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
 +	{
 +		.procname		= "dev",
 +		.maxlen			= 0,
 +		.mode			= 0555,
 +		.child			= dslmod_table,
 +	}
-+	#endif
    ,
  #endif /* CONFIG_PROC_FS */
    {0}
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch
index f6dba4b..75de5a3 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch
@@ -1,28 +1,24 @@
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -2009,7 +2009,11 @@ static int __init tn7atm_register (Tn7At
+@@ -2003,7 +2003,7 @@ static int __init tn7atm_register (Tn7At
  
    dgprintf (4, "device %s being registered\n", priv->name);
  
-+  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
-   mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL);
-+  #else
+-  mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL);
 +  mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL);
-+  #endif
  
    if (mydev == NULL)
    {
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -512,14 +512,17 @@ int shim_osLoadFWImage(unsigned char *pt
+@@ -499,13 +499,16 @@ int shim_osLoadFWImage(unsigned char *pt
  {
  	const struct firmware *fw_entry;
  	size_t size;
 + 	int ret;
  
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
  	dev_set_name(&avsar, "avsar");
- #endif
+ 
  	printk("requesting firmware image \"ar0700xx.bin\"\n");
 -	if(device_register(&avsar) < 0) {
 +	dev_set_name(&avsar, "avsar");
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch
index 747869b..1d3d758 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch
@@ -125,7 +125,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif __SGAPI_H
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -265,11 +265,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB
+@@ -259,11 +259,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB
  
  #ifdef AR7_EFM
  extern void tn7dsl_disable_alarm(void);
@@ -140,7 +140,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  extern unsigned int g_efm_proc_ctl;
  extern struct net_device *mydev_efm;
  extern Tn7AtmPrivate *mypriv;
-@@ -305,31 +303,17 @@ extern int tn7efm_register (Tn7AtmPrivat
+@@ -299,31 +297,17 @@ extern int tn7efm_register (Tn7AtmPrivat
  static int tn7atm_irq_request (struct atm_dev *dev);
  #endif
  
@@ -177,15 +177,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
  //CT - Added function to return chipset Id
         void tn7atm_get_chipsetId (char *pVerId);
-@@ -456,78 +440,83 @@ const char drv_proc_root_folder[] = "ava
- static struct proc_dir_entry *root_proc_dir_entry = NULL;
- #define DRV_PROC_MODE 0644
- static int proc_root_already_exists = TRUE;
-+
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-+#define PDE_DATA(inode) PDE(inode)->data
-+#endif
-+
+@@ -453,75 +437,75 @@ static int proc_root_already_exists = TR
  static struct
  {
      const unsigned char name[32];
@@ -301,7 +293,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  };
  
  /* *INDENT-ON* */
-@@ -1811,76 +1800,81 @@ int tn7atm_receive (void *os_dev, int ch
+@@ -1805,76 +1789,81 @@ int tn7atm_receive (void *os_dev, int ch
    return 0;
  }
  
@@ -353,15 +345,15 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
 -  return len;
 +  return 0;
-+}
-+
-+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file)
-+{
-+	return single_open(file, tn7atm_proc_channels, PDE_DATA(inode));
  }
  
 -static int tn7atm_proc_private (char *buf, char **start, off_t offset,
 -                                int count, int *eof, void *data)
++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file)
++{
++	return single_open(file, tn7atm_proc_channels, PDE_DATA(inode));
++}
++
 +static struct file_operations tn7atm_proc_channels_fops = {
 +	.owner 		= THIS_MODULE,
 +	.open		= tn7atm_proc_channels_open,
@@ -426,7 +418,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr,
                                   int interrupt_num)
  {
-@@ -2033,10 +2027,8 @@ static int __init tn7atm_register (Tn7At
+@@ -2023,10 +2012,8 @@ static int __init tn7atm_register (Tn7At
    return ATM_REG_OK;
  }
  
@@ -438,7 +430,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    char dslVer[8];
    char dspVer[10];
    char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id
-@@ -2051,58 +2043,52 @@ static int tn7atm_proc_version (char *bu
+@@ -2041,58 +2028,52 @@ static int tn7atm_proc_version (char *bu
    priv = mydev->dev_data;
  
  #ifdef AR7_EFM
@@ -517,7 +509,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
              pdspV1, pdspV2, (priv->curr_TC_mode== TC_MODE_ATM) ? '*' : ' ');
  
    tn7sar_get_EFM_firmware_version (&pdspV1, &pdspV2);
-@@ -2114,26 +2100,37 @@ static int tn7atm_proc_version (char *bu
+@@ -2104,26 +2085,37 @@ static int tn7atm_proc_version (char *bu
  #endif
      str = "EFM";  
  
@@ -531,16 +523,16 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    tn7atm_get_chipsetId(chipsetID);
 -  len += sprintf (buf + len, "Chipset ID: [%s]\n",chipsetID);
 +  seq_printf (m, "Chipset ID: [%s]\n",chipsetID);
-+
-+  return 0;
-+}
  
 -  return len;
++  return 0;
+ }
+ 
 +static int tn7atm_proc_version_open(struct inode *inode, struct file *file)
 +{
 +	return single_open(file, tn7atm_proc_version, PDE_DATA(inode));
- }
- 
++}
++
 +static struct file_operations tn7atm_proc_version_fops = {
 +	.owner 		= THIS_MODULE,
 +	.open		= tn7atm_proc_version_open,
@@ -560,7 +552,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int ctr;
    const char *residual;
  
-@@ -2214,24 +2211,7 @@ static int __init tn7atm_detect (void)
+@@ -2204,24 +2196,7 @@ static int __init tn7atm_detect (void)
     */
    for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++)
    {
@@ -586,7 +578,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    }
  
    tn7dsl_dslmod_sysctl_register ();
-@@ -2711,73 +2691,18 @@ static int tn7atm_set_can_support_adsl2
+@@ -2701,73 +2676,18 @@ static int tn7atm_set_can_support_adsl2
    return TRUE;
  }
  
@@ -599,10 +591,10 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 +static int tn7atm_proc_qos_read(struct seq_file *m, void *data)
  {
 -  if (!de || !de->low_ino)
+-    return 0;
+-  if (de->namelen != len)
 +    seq_printf (m, "\nEnableQoS = %d\n", EnableQoS);
      return 0;
--  if (de->namelen != len)
--    return 0;
 -  return !strncmp (name, de->name, len);
 -}
 -
@@ -665,7 +657,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  }
  
  static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data)
-@@ -2812,7 +2737,7 @@ static int tn7atm_proc_qos_write(struct
+@@ -2802,7 +2722,7 @@ static int tn7atm_proc_qos_write(struct
  }
  
  // [KT]
@@ -674,7 +666,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  {
      char local_buf[10];
   
-@@ -2843,5 +2768,33 @@ int tn7atm_proc_turbodsl_write(struct fi
+@@ -2833,5 +2753,33 @@ int tn7atm_proc_turbodsl_write(struct fi
      return count;
  }
  
@@ -710,17 +702,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  module_exit (tn7atm_exit);
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -233,6 +233,9 @@ static struct led_funcs ledreg[2];
- 
- #define tn7dsl_kfree_skb(x)      dev_kfree_skb(x)
- 
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-+#define PDE_DATA(inode) PDE(inode)->data
-+#endif
- 
- //---------------------------------------------
- // Begin Clear EOC definitions
-@@ -366,7 +369,7 @@ static void tn7dsl_register_dslss_led(vo
+@@ -356,7 +356,7 @@ static void tn7dsl_register_dslss_led(vo
  void tn7dsl_dslmod_sysctl_register(void);
  void tn7dsl_dslmod_sysctl_unregister(void);
  static int tn7dsl_clear_eoc_receive(void);
@@ -729,7 +711,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /* end of internal functions */
  
  //  UR8_MERGE_START CQ11054   Jack Zhang
-@@ -698,11 +701,9 @@ void shim_osCriticalExit(void)
+@@ -684,11 +684,9 @@ void shim_osCriticalExit(void)
    spin_unlock_irqrestore(&shimLock, flags);
  }
  
@@ -742,7 +724,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int i, j;
    int bin = (int) data;
    unsigned short *rxSnrPerBin;
-@@ -723,95 +724,128 @@ static int tn7dsl_proc_snr_print (char *
+@@ -709,95 +707,128 @@ static int tn7dsl_proc_snr_print (char *
        break;
  
    default:
@@ -915,7 +897,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #ifndef NO_ACT
  int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count,
                   int *eof, void *data)
-@@ -874,59 +908,48 @@ static char *pUnknown= "Unknown";
+@@ -860,59 +891,48 @@ static char *pUnknown= "Unknown";
  #ifdef ADV_DIAG_STATS //CQ10275, CQ10449
  //UR8_MERGE_START CQ10449 Jack Zhang
  
@@ -975,15 +957,15 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    printk("proc_adv_stats - return: ctr=%d, len=%d\n", ctr, len);
 -  return len;
 +  return 0;
- }
- 
--static int proc_adv_stats_header(char* buf, int limit)
++}
++
 +
 +static int tn7dsl_proc_adv_stats_open(struct inode *inode, struct file *file)
 +{
 +	return single_open(file, tn7dsl_proc_adv_stats, PDE_DATA(inode));
-+}
-+
+ }
+ 
+-static int proc_adv_stats_header(char* buf, int limit)
 +struct file_operations tn7dsl_proc_adv_stats_fops = {
 +	.owner 		= THIS_MODULE,
 +	.open		= tn7dsl_proc_adv_stats_open,
@@ -996,7 +978,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  {
    int len = 0;
    int i = 0;
-@@ -935,66 +958,53 @@ static int proc_adv_stats_header(char* b
+@@ -921,66 +941,53 @@ static int proc_adv_stats_header(char* b
     */
  
    dslhal_api_gatherStatistics(pIhw);
@@ -1084,7 +1066,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  }
  
  static int getDiagDisplayMode()
-@@ -1017,29 +1027,24 @@ static int getDiagDisplayMode()
+@@ -1003,29 +1010,24 @@ static int getDiagDisplayMode()
      ret = 2;
    return ret;
  }
@@ -1118,7 +1100,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
                      (unsigned int)pIhw->AppData.marginTblDstrm[i],
                      (int)pIhw->AppData.rxSnrPerBin0[i]);
-@@ -1050,26 +1055,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch
+@@ -1036,26 +1038,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch
      if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
      {
        dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
@@ -1161,7 +1143,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int i;
    int mode = 0;  //mode = 0 => ADSL1 or ADSL2 & 2+
    unsigned char SNRpsds[512];
-@@ -1079,12 +1092,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
+@@ -1065,12 +1075,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
    if( mode==1) //ADSL1
    {
    dslhal_api_gatherStatistics(pIhw);
@@ -1176,7 +1158,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
                      (unsigned int)pIhw->AppData.marginTblDstrm[i],
                      (int)pIhw->AppData.rxSnrPerBin0[i]);
-@@ -1095,26 +1106,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
+@@ -1081,26 +1089,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
      if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
      {
        dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
@@ -1220,7 +1202,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int i;
    int mode = 0;  //mode = 0 => ADSL1 or ADSL2 & 2+
    unsigned char SNRpsds[512];
-@@ -1124,12 +1144,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
+@@ -1110,12 +1127,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
    if( mode==1) //ADSL1
    {
    dslhal_api_gatherStatistics(pIhw);
@@ -1235,7 +1217,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
                      (unsigned int)pIhw->AppData.marginTblDstrm[i],
                      (int)pIhw->AppData.rxSnrPerBin0[i]);
-@@ -1140,283 +1158,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
+@@ -1126,283 +1141,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
      if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
      {
        dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
@@ -1455,9 +1437,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  {
 +	return single_open(file, tn7dsl_proc_dbg_rmsgs1, PDE_DATA(inode));
 +}
- 
--  int len = 0;
--  int limit = count - 80;
++
 +struct file_operations tn7dsl_proc_dbg_rmsgs1_fops = {
 +	.owner 		= THIS_MODULE,
 +	.open		= tn7dsl_proc_dbg_rmsgs1_open,
@@ -1465,7 +1445,9 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 +	.llseek		= seq_lseek,
 +	.release	= single_release,
 +};
-+
+ 
+-  int len = 0;
+-  int limit = count - 80;
 +
 +int tn7dsl_proc_dbg_rmsgs2(struct seq_file *m, void *data)
 +{
@@ -1636,12 +1618,12 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
 -  return len;
 +  return 0;
- }
++}
 +
 +static int tn7dsl_proc_dbg_rmsgs4_open(struct inode *inode, struct file *file)
 +{
 +	return single_open(file, tn7dsl_proc_dbg_rmsgs4, PDE_DATA(inode));
-+}
+ }
 +
 +struct file_operations tn7dsl_proc_dbg_rmsgs4_fops = {
 +	.owner 		= THIS_MODULE,
@@ -1664,7 +1646,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int F4count, F5count;
    unsigned int maxRate=0;
    unsigned int us_maxRate=0;
-@@ -1424,80 +1446,58 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1410,80 +1429,58 @@ int tn7dsl_proc_stats(char* buf, char **
    //UR8_MERGE_START CQ10700 Manjula K
    struct atm_dev *dev;
    Tn7AtmPrivate *priv;
@@ -1768,7 +1750,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                      ((unsigned int) pIhw->AppData.usAtm_count[0] +
                       (unsigned int) pIhw->AppData.usAtm_count[1]) * 48,
                      ((unsigned int) pIhw->AppData.dsGood_count[0] +
-@@ -1505,9 +1505,7 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1491,9 +1488,7 @@ int tn7dsl_proc_stats(char* buf, char **
    /*
     * Superframe Count
     */
@@ -1779,7 +1761,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                 "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n",
                     (unsigned int)pIhw->AppData.usSuperFrmCnt,
                     (unsigned int)pIhw->AppData.dsSuperFrmCnt );
-@@ -1515,59 +1513,45 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1501,59 +1496,45 @@ int tn7dsl_proc_stats(char* buf, char **
    /*
     * US and DS power
     */
@@ -1851,7 +1833,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                     (unsigned int)pIhw->AppData.currentHybridNum, trellis);
  
    //@Added Maximum attainable bit rate information. 05-14-2004
-@@ -1581,12 +1565,12 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1567,12 +1548,12 @@ int tn7dsl_proc_stats(char* buf, char **
    }
    else
    {
@@ -1866,7 +1848,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
                                   (unsigned char *) &rMsgsRA[0], 12);
  
       maxRate = (unsigned int)pIhw->AppData.DSConRate;
-@@ -1602,294 +1586,223 @@ int tn7dsl_proc_stats(char* buf, char **
+@@ -1588,294 +1569,223 @@ int tn7dsl_proc_stats(char* buf, char **
       }
    }
  
@@ -2259,7 +2241,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    char *state;
    int tag;
  
-@@ -1923,22 +1836,31 @@ extern int tn7efm_get_currTCmode(void);
+@@ -1909,22 +1819,31 @@ extern int tn7efm_get_currTCmode(void);
  
    if(pIhw->lConnected == 1)
      state = "SHOWTIME";
@@ -2301,7 +2283,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /**********************************************************************
  **                                                                    *
  **  tn7dsl_hdlc_update_crc() -- Calculate CRC                         *
-@@ -2203,11 +2125,8 @@ static int tn7dsl_hdlc_rx_process(unsign
+@@ -2189,11 +2108,8 @@ static int tn7dsl_hdlc_rx_process(unsign
    return(ret);
  }
  
@@ -2314,7 +2296,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    int offset[2] = {34, 0};  // point to buffer parameter data structure
    clearEocParm_t   peoc;
  
-@@ -2216,62 +2135,49 @@ int tn7dsl_proc_eoc (char *buf, char **s
+@@ -2202,62 +2118,49 @@ int tn7dsl_proc_eoc (char *buf, char **s
                                 (unsigned char *) &peoc,
                                 sizeof (clearEocParm_t));
  
@@ -2417,7 +2399,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  int tn7dsl_clear_eoc_setup(void)
  {
    int   i;
-@@ -4624,14 +4530,10 @@ int tn7dsl_proc_write_stats (struct file
+@@ -4591,14 +4494,10 @@ int tn7dsl_proc_write_stats (struct file
  }
  
  
@@ -2433,13 +2415,12 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
    typedef struct
    {
-@@ -4712,197 +4614,185 @@ int tn7dsl_proc_train_mode_export (char
+@@ -4679,197 +4578,185 @@ int tn7dsl_proc_train_mode_export (char
    }
  
  
 -    if(len <= count)
-+  for (i = 0; (i < num_entries) ; i++)
-     {
+-    {
 -        for (i = ctr; ((i < num_entries)&& (len <= count)) ; i++)
 -        {
 -      /*
@@ -2453,21 +2434,22 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 -            else
 -                break;
 -        }
-+              seq_printf(m, "%s\t\t\t%#x\n",
-+                         dsl_modes[i].mode_name, dsl_modes[i].mode_value);
-     }
- 
+-    }
+-
 -  /*
 -   * Data was completely written
 -   */
 -    if (i >= num_entries)
--    {
++  for (i = 0; (i < num_entries) ; i++)
+     {
 -    /*
 -     * We are done with this
 -     */
 -        *eof = 1;
 -        ctr = 0;
--    }
++              seq_printf(m, "%s\t\t\t%#x\n",
++                         dsl_modes[i].mode_name, dsl_modes[i].mode_value);
+     }
 -    else
 -    {
 -    /*
@@ -2475,7 +2457,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
 -     * terminate the buffer.
 -        */
 -        *(cp + len) = '\0';
--
+ 
 -    /*
 -     * Save the value of the counter for the next read for the rest of the
 -     * data.
@@ -2712,7 +2694,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    }
  
    start = (indx -1) * 128;
-@@ -4911,39 +4801,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char
+@@ -4878,39 +4765,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char
    {
      if (!(i%8))
      {
@@ -2817,7 +2799,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  #endif
  #endif //TR69_HLIN_IN
  //  UR8_MERGE_END   CQ10979*
-@@ -4951,64 +4891,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha
+@@ -4918,64 +4855,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha
  // *    UR8_MERGE_START CQ11057   Jack Zhang
  #ifdef TR69_PMD_IN
  #ifndef NO_ADV_STATS
@@ -2897,7 +2879,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
    }
  
-@@ -5016,19 +4940,28 @@ int tn7dsl_proc_PMDus(char* buf, char **
+@@ -4983,19 +4904,28 @@ int tn7dsl_proc_PMDus(char* buf, char **
    for (i=0; i<pIhw->AppData.max_us_tones; i++)
    {
      if (!(i%16))
@@ -2937,15 +2919,11 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  // *    UR8_MERGE_END   CQ11057 *
 --- a/tn7sar.c
 +++ b/tn7sar.c
-@@ -1553,44 +1553,70 @@ int tn7sar_oam_generation(void *privCont
+@@ -1547,44 +1547,66 @@ int tn7sar_oam_generation(void *privCont
    return 0;
  }
  
 -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
-+#define PDE_DATA(inode) PDE(inode)->data
-+#endif
-+
 +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data)
  {
 -  int len = 0;
@@ -3020,7 +2998,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
    struct atm_dev *dev;
    Tn7AtmPrivate *priv;
    int i, j, k;
-@@ -1599,21 +1625,19 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1593,21 +1615,19 @@ int tn7sar_proc_sar_stat(char* buf, char
    unsigned int *pStateBase, *pSarStat;
    HAL_FUNCTIONS *pHalFunc;
    HAL_DEVICE    *pHalDev;
@@ -3045,7 +3023,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
        k=0;
        for(j=0;j<4;j++)
        {
-@@ -1626,26 +1650,16 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1620,26 +1640,16 @@ int tn7sar_proc_sar_stat(char* buf, char
          {
            if((char *)*pSarStat == NULL)
              break;
@@ -3076,7 +3054,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
            }
          }
  
-@@ -1654,9 +1668,22 @@ int tn7sar_proc_sar_stat(char* buf, char
+@@ -1648,9 +1658,22 @@ int tn7sar_proc_sar_stat(char* buf, char
      }
    }
  
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch
index a29bae8..43da567 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch
@@ -1,6 +1,6 @@
 --- a/tn7dsl.c
 +++ b/tn7dsl.c
-@@ -363,7 +363,7 @@ static void tn7dsl_chng_modulation(void*
+@@ -350,7 +350,7 @@ static void tn7dsl_chng_modulation(void*
  static unsigned int tn7dsl_set_modulation(void* data, int flag);
  static void tn7dsl_ctrl_fineGain(int value);
  static void tn7dsl_set_fineGainValue(int value);
@@ -9,7 +9,7 @@
                            void *buffer, size_t * lenp);
  static void tn7dsl_register_dslss_led(void);
  void tn7dsl_dslmod_sysctl_register(void);
-@@ -3505,7 +3505,7 @@ unsigned int tn7dsl_get_memory(unsigned
+@@ -3488,7 +3488,7 @@ unsigned int tn7dsl_get_memory(unsigned
  
  
  
@@ -18,21 +18,21 @@
        void *buffer, size_t *lenp)
  {
    char *ptr;
-@@ -3631,7 +3631,7 @@ static int dslmod_sysctl(ctl_table *ctl,
+@@ -3603,7 +3603,7 @@ static int dslmod_sysctl(ctl_table *ctl,
  }
  
  
 -ctl_table dslmod_table[] = {
 +struct ctl_table dslmod_table[] = {
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
- #else
-@@ -3649,7 +3649,7 @@ ctl_table dslmod_table[] = {
+ 	{
+ 		.procname 		= "dslmod",
+ 		.data			= info,
+@@ -3617,7 +3617,7 @@ ctl_table dslmod_table[] = {
    };
  
  /* Make sure that /proc/sys/dev is there */
 -ctl_table dslmod_root_table[] = {
 +struct ctl_table dslmod_root_table[] = {
  #ifdef CONFIG_PROC_FS
- 	#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
-   {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table}
+ 	{
+ 		.procname		= "dev",
diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch
index bc913a7..426d593 100644
--- a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch
+++ b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch
@@ -1,6 +1,6 @@
 --- a/tn7atm.c
 +++ b/tn7atm.c
-@@ -856,7 +856,7 @@ static int __init tn7atm_irq_request (st
+@@ -845,7 +845,7 @@ static int __init tn7atm_irq_request (st
  
    priv->sar_irq = LNXINTNUM (ATM_SAR_INT);      /* Interrupt line # */
  
@@ -9,7 +9,7 @@
      printk ("Could not register tn7atm_sar_irq\n");
  
    /*
-@@ -880,7 +880,7 @@ static int __init tn7atm_irq_request (st
+@@ -869,7 +869,7 @@ static int __init tn7atm_irq_request (st
     * Reigster Receive interrupt A
     */
    priv->dsl_irq = LNXINTNUM (ATM_DSL_INT);      /* Interrupt line # */


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:11 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:11 -0400
Subject: [source]  ar7: drop unused 4.1 support
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57035.1509316909.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/1d30869cd2f589b27227428863ebd201099106ce

commit 1d30869cd2f589b27227428863ebd201099106ce
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sun Oct 29 23:28:39 2017 +0100

    ar7: drop unused 4.1 support
    
    Kernel 4.1 isn't support anymore anyway.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/ar7/config-4.1                        | 146 ----------
 .../ar7/patches-4.1/001-mips-ar7-fix-serial.patch  |  23 --
 .../ar7/patches-4.1/100-fix-highmem-offset.patch   |  11 -
 ...IPS-AR7-allow-NULL-clock-for-clk_get_rate.patch |  45 ----
 target/linux/ar7/patches-4.1/110-flash.patch       |  22 --
 .../patches-4.1/160-vlynq_try_remote_first.patch   | 300 ---------------------
 .../200-free-mem-below-kernel-offset.patch         |  15 --
 .../ar7/patches-4.1/300-add-ac49x-platform.patch   |  85 ------
 .../ar7/patches-4.1/310-ac49x-prom-support.patch   |  20 --
 .../ar7/patches-4.1/320-ac49x-mtd-partitions.patch |  35 ---
 .../linux/ar7/patches-4.1/500-serial_kludge.patch  |  28 --
 target/linux/ar7/patches-4.1/920-ar7part.patch     | 118 --------
 .../linux/ar7/patches-4.1/925-actiontec_leds.patch |  95 -------
 target/linux/ar7/patches-4.1/950-cpmac_titan.patch |  52 ----
 14 files changed, 995 deletions(-)

diff --git a/target/linux/ar7/config-4.1 b/target/linux/ar7/config-4.1
deleted file mode 100644
index 91ab14f..0000000
--- a/target/linux/ar7/config-4.1
+++ /dev/null
@@ -1,146 +0,0 @@
-CONFIG_ADM6996_PHY=y
-CONFIG_AR7=y
-CONFIG_AR7_TI=y
-# CONFIG_AR7_TYPE_AC49X is not set
-CONFIG_AR7_TYPE_TI=y
-CONFIG_AR7_WDT=y
-CONFIG_ARCH_BINFMT_ELF_STATE=y
-CONFIG_ARCH_DISCARD_MEMBLOCK=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_BOOT_ELF32=y
-CONFIG_CEVT_R4K=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
-CONFIG_CMDLINE_BOOL=y
-# CONFIG_CMDLINE_OVERRIDE is not set
-CONFIG_CPMAC=y
-CONFIG_CPU_GENERIC_DUMP_TLB=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-CONFIG_CPU_MIPSR1=y
-CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
-CONFIG_CPU_R4K_CACHE_TLB=y
-CONFIG_CPU_R4K_FPU=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_CSRC_R4K=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_ETHERNET_PACKET_MANGLE=y
-CONFIG_FIXED_PHY=y
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
-CONFIG_HARDWARE_WATCHPOINTS=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-# CONFIG_HAVE_ARCH_BITREVERSE is not set
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_BZIP2=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HW_RANDOM=y
-CONFIG_HZ_PERIODIC=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IP17XX_PHY=y
-CONFIG_IRQ_CPU=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_WORK=y
-CONFIG_KALLSYMS=y
-CONFIG_LEDS_GPIO=y
-CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-# CONFIG_LZ4_COMPRESS is not set
-# CONFIG_LZ4_DECOMPRESS is not set
-CONFIG_MDIO_BOARDINFO=y
-CONFIG_MIPS=y
-# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MACHINE is not set
-CONFIG_MODULES_USE_ELF_REL=y
-# CONFIG_MTD_AC49X_PARTS is not set
-CONFIG_MTD_CFI_STAA=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MVSWITCH_PHY=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_PER_CPU_KM=y
-CONFIG_NO_EXCEPT_FILL=y
-# CONFIG_NO_IOPORT_MAP is not set
-CONFIG_PAGEFLAGS_EXTENDED=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PGTABLE_LEVELS=2
-CONFIG_PHYLIB=y
-# CONFIG_RCU_EXPEDITE_BOOT is not set
-# CONFIG_RCU_STALL_COMMON is not set
-CONFIG_SCHED_HRTICK=y
-# CONFIG_SCSI_DMA is not set
-CONFIG_SRCU=y
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SWCONFIG=y
-CONFIG_SYSCTL_EXCEPTION_TRACE=y
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_SYS_SUPPORTS_MIPS16=y
-CONFIG_SYS_SUPPORTS_ZBOOT=y
-CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y
-CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_VLYNQ=y
-# CONFIG_VLYNQ_DEBUG is not set
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch b/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch
deleted file mode 100644
index 1aded92..0000000
--- a/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 443ab715a40881d6c9ba11b027ba154bac904cb0 Mon Sep 17 00:00:00 2001
-From: Oswald Buddenhagen <oswald.buddenhagen at gmx.de>
-Date: Sat, 10 May 2014 23:19:08 +0200
-Subject: [PATCH] MIPS/AR7: ensure that serial ports are properly set up
-
-without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is
-never copied, resulting in a dead port.
-
-Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen at gmx.de>
----
- arch/mips/ar7/platform.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/arch/mips/ar7/platform.c
-+++ b/arch/mips/ar7/platform.c
-@@ -577,6 +577,7 @@ static int __init ar7_register_uarts(voi
- 	uart_port.type		= PORT_AR7;
- 	uart_port.uartclk	= clk_get_rate(bus_clk) / 2;
- 	uart_port.iotype	= UPIO_MEM32;
-+	uart_port.flags		= UPF_FIXED_TYPE;
- 	uart_port.regshift	= 2;
- 
- 	uart_port.line		= 0;
diff --git a/target/linux/ar7/patches-4.1/100-fix-highmem-offset.patch b/target/linux/ar7/patches-4.1/100-fix-highmem-offset.patch
deleted file mode 100644
index f1a7549..0000000
--- a/target/linux/ar7/patches-4.1/100-fix-highmem-offset.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/arch/mips/include/asm/mach-ar7/spaces.h
-+++ b/arch/mips/include/asm/mach-ar7/spaces.h
-@@ -20,6 +20,8 @@
- #define UNCAC_BASE	_AC(0xb4000000, UL)	/* 0xa0000000 + PHYS_OFFSET */
- #define IO_BASE		UNCAC_BASE
- 
-+#define HIGHMEM_START	_AC(0x20000000, UL)
-+
- #include <asm/mach-generic/spaces.h>
- 
- #endif /* __ASM_AR7_SPACES_H */
diff --git a/target/linux/ar7/patches-4.1/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/ar7/patches-4.1/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch
deleted file mode 100644
index 74ac0d1..0000000
--- a/target/linux/ar7/patches-4.1/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From patchwork Tue Jul 18 10:17:26 2017
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [5/9] MIPS: AR7: allow NULL clock for clk_get_rate
-X-Patchwork-Submitter: Jonas Gorski <jonas.gorski at gmail.com>
-X-Patchwork-Id: 16775
-Message-Id: <20170718101730.2541-6-jonas.gorski at gmail.com>
-To: unlisted-recipients:; (no To-header on input)
-Cc: Ralf Baechle <ralf at linux-mips.org>,
- Paul Gortmaker <paul.gortmaker at windriver.com>,
- James Hogan <james.hogan at imgtec.com>,
- linux-mips at linux-mips.org, linux-kernel at vger.kernel.org
-Date: Tue, 18 Jul 2017 12:17:26 +0200
-From: Jonas Gorski <jonas.gorski at gmail.com>
-List-Id: linux-mips <linux-mips.eddie.linux-mips.org>
-
-Make the behaviour of clk_get_rate consistent with common clk's
-clk_get_rate by accepting NULL clocks as parameter. Some device
-drivers rely on this, and will cause an OOPS otherwise.
-
-Fixes: 780019ddf02f ("MIPS: AR7: Implement clock API")
-Cc: Ralf Baechle <ralf at linux-mips.org>
-Cc: Paul Gortmaker <paul.gortmaker at windriver.com>
-Cc: James Hogan <james.hogan at imgtec.com>
-Cc: linux-mips at linux-mips.org
-Cc: linux-kernel at vger.kernel.org
-Reported-by: Mathias Kresin <dev at kresin.me>
-Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
----
- arch/mips/ar7/clock.c | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/arch/mips/ar7/clock.c
-+++ b/arch/mips/ar7/clock.c
-@@ -430,6 +430,9 @@ EXPORT_SYMBOL(clk_disable);
- 
- unsigned long clk_get_rate(struct clk *clk)
- {
-+	if (!clk)
-+		return 0;
-+
- 	return clk->rate;
- }
- EXPORT_SYMBOL(clk_get_rate);
diff --git a/target/linux/ar7/patches-4.1/110-flash.patch b/target/linux/ar7/patches-4.1/110-flash.patch
deleted file mode 100644
index e4aeffd..0000000
--- a/target/linux/ar7/patches-4.1/110-flash.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/drivers/mtd/Makefile
-+++ b/drivers/mtd/Makefile
-@@ -12,7 +12,7 @@ obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
- obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
- obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
- obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
--obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
-+obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o titanpart.o
- obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
- obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o
- obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
---- a/arch/mips/ar7/platform.c
-+++ b/arch/mips/ar7/platform.c
-@@ -199,7 +199,7 @@ static struct resource physmap_flash_res
- 	.name	= "mem",
- 	.flags	= IORESOURCE_MEM,
- 	.start	= 0x10000000,
--	.end	= 0x107fffff,
-+	.end	= 0x11ffffff,
- };
- 
- static const char *ar7_probe_types[] = { "ar7part", NULL };
diff --git a/target/linux/ar7/patches-4.1/160-vlynq_try_remote_first.patch b/target/linux/ar7/patches-4.1/160-vlynq_try_remote_first.patch
deleted file mode 100644
index 1d1310d..0000000
--- a/target/linux/ar7/patches-4.1/160-vlynq_try_remote_first.patch
+++ /dev/null
@@ -1,300 +0,0 @@
---- a/drivers/vlynq/vlynq.c
-+++ b/drivers/vlynq/vlynq.c
-@@ -119,20 +119,40 @@ static int vlynq_linked(struct vlynq_dev
- 	return 0;
- }
- 
-+static volatile int vlynq_delay_value_new = 0;
-+
-+static void vlynq_delay_wait(u32 count)
-+{
-+	/* Code adopted from original vlynq driver */
-+	int i = 0;
-+	volatile int *ptr = &vlynq_delay_value_new;
-+	*ptr = 0;
-+
-+	/* We are assuming that the each cycle takes about
-+	 * 23 assembly instructions. */
-+	for(i = 0; i < (count + 23)/23; i++)
-+		*ptr = *ptr + 1;
-+}
-+
- static void vlynq_reset(struct vlynq_device *dev)
- {
-+	u32 rtm = readl(&dev->local->revision);
-+
-+	rtm = rtm < 0x00010205 || readl(&dev->local->status) & 0x800 == 0 ?
-+			0 : 0x600000;
-+
- 	writel(readl(&dev->local->control) | VLYNQ_CTRL_RESET,
- 			&dev->local->control);
- 
- 	/* Wait for the devices to finish resetting */
--	msleep(5);
-+	vlynq_delay_wait(0xffffff);
- 
- 	/* Remove reset bit */
--	writel(readl(&dev->local->control) & ~VLYNQ_CTRL_RESET,
-+	writel(readl(&dev->local->control) & ~VLYNQ_CTRL_RESET | rtm,
- 			&dev->local->control);
- 
- 	/* Give some time for the devices to settle */
--	msleep(5);
-+	vlynq_delay_wait(0xffffff);
- }
- 
- static void vlynq_irq_unmask(struct irq_data *d)
-@@ -379,6 +399,61 @@ void vlynq_unregister_driver(struct vlyn
- }
- EXPORT_SYMBOL(vlynq_unregister_driver);
- 
-+enum vlynq_clk_src {
-+	vlynq_clk_external,
-+	vlynq_clk_local,
-+	vlynq_clk_remote,
-+	vlynq_clk_invalid,
-+};
-+
-+static int __vlynq_set_clocks(struct vlynq_device *dev,
-+				enum vlynq_clk_src clk_dir,
-+				int lclk_div, int rclk_div)
-+{
-+	u32 reg;
-+
-+	if (clk_dir == vlynq_clk_invalid) {
-+		printk(KERN_ERR "%s: attempt to set invalid clocking\n",
-+				dev_name(&dev->dev));
-+		return -EINVAL;
-+	}
-+
-+	reg = readl(&dev->local->control);
-+	if (readl(&dev->local->revision) < 0x00010205) {
-+		if (clk_dir & vlynq_clk_local)
-+			reg |= VLYNQ_CTRL_CLOCK_INT;
-+		else
-+			reg &= ~VLYNQ_CTRL_CLOCK_INT;
-+	}
-+	reg &= ~VLYNQ_CTRL_CLOCK_MASK;
-+	reg |= VLYNQ_CTRL_CLOCK_DIV(lclk_div);
-+	writel(reg, &dev->local->control);
-+
-+	if (!vlynq_linked(dev))
-+		return -ENODEV;
-+
-+	printk(KERN_INFO "%s: local VLYNQ protocol rev. is 0x%08x\n",
-+			dev_name(&dev->dev), readl(&dev->local->revision));
-+	printk(KERN_INFO "%s: remote VLYNQ protocol rev. is 0x%08x\n",
-+			dev_name(&dev->dev), readl(&dev->remote->revision));
-+
-+	reg = readl(&dev->remote->control);
-+	if (readl(&dev->remote->revision) < 0x00010205) {
-+		if (clk_dir & vlynq_clk_remote)
-+			reg |= VLYNQ_CTRL_CLOCK_INT;
-+		else
-+			reg &= ~VLYNQ_CTRL_CLOCK_INT;
-+	}
-+	reg &= ~VLYNQ_CTRL_CLOCK_MASK;
-+	reg |= VLYNQ_CTRL_CLOCK_DIV(rclk_div);
-+	writel(reg, &dev->remote->control);
-+
-+	if (!vlynq_linked(dev))
-+		return -ENODEV;
-+
-+	return 0;
-+}
-+
- /*
-  * A VLYNQ remote device can clock the VLYNQ bus master
-  * using a dedicated clock line. In that case, both the
-@@ -392,29 +467,16 @@ static int __vlynq_try_remote(struct vly
- 	int i;
- 
- 	vlynq_reset(dev);
--	for (i = dev->dev_id ? vlynq_rdiv2 : vlynq_rdiv8; dev->dev_id ?
--			i <= vlynq_rdiv8 : i >= vlynq_rdiv2;
--		dev->dev_id ? i++ : i--) {
-+	for (i = 0; i <= 7; i++) {
- 
- 		if (!vlynq_linked(dev))
- 			break;
- 
--		writel((readl(&dev->remote->control) &
--				~VLYNQ_CTRL_CLOCK_MASK) |
--				VLYNQ_CTRL_CLOCK_INT |
--				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1),
--				&dev->remote->control);
--		writel((readl(&dev->local->control)
--				& ~(VLYNQ_CTRL_CLOCK_INT |
--				VLYNQ_CTRL_CLOCK_MASK)) |
--				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1),
--				&dev->local->control);
--
--		if (vlynq_linked(dev)) {
--			printk(KERN_DEBUG
--				"%s: using remote clock divisor %d\n",
--				dev_name(&dev->dev), i - vlynq_rdiv1 + 1);
--			dev->divisor = i;
-+		if (!__vlynq_set_clocks(dev, vlynq_clk_remote, i, i)) {
-+			printk(KERN_INFO
-+					"%s: using remote clock divisor %d\n",
-+					dev_name(&dev->dev), i + 1);
-+			dev->divisor = i + vlynq_rdiv1;
- 			return 0;
- 		} else {
- 			vlynq_reset(dev);
-@@ -433,25 +495,17 @@ static int __vlynq_try_remote(struct vly
-  */
- static int __vlynq_try_local(struct vlynq_device *dev)
- {
--	int i;
-+	int i, dir = !dev->dev_id;
- 
- 	vlynq_reset(dev);
- 
--	for (i = dev->dev_id ? vlynq_ldiv2 : vlynq_ldiv8; dev->dev_id ?
--			i <= vlynq_ldiv8 : i >= vlynq_ldiv2;
--		dev->dev_id ? i++ : i--) {
--
--		writel((readl(&dev->local->control) &
--				~VLYNQ_CTRL_CLOCK_MASK) |
--				VLYNQ_CTRL_CLOCK_INT |
--				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1),
--				&dev->local->control);
--
--		if (vlynq_linked(dev)) {
--			printk(KERN_DEBUG
--				"%s: using local clock divisor %d\n",
--				dev_name(&dev->dev), i - vlynq_ldiv1 + 1);
--			dev->divisor = i;
-+	for (i = dir ? 7 : 0; dir ? i >= 0 : i <= 7; dir ? i-- : i++) {
-+
-+		if (!__vlynq_set_clocks(dev, vlynq_clk_local, i, 0)) {
-+			printk(KERN_INFO
-+					"%s: using local clock divisor %d\n",
-+					dev_name(&dev->dev), i + 1);
-+			dev->divisor = i + vlynq_ldiv1;
- 			return 0;
- 		} else {
- 			vlynq_reset(dev);
-@@ -473,18 +527,10 @@ static int __vlynq_try_external(struct v
- 	if (!vlynq_linked(dev))
- 		return -ENODEV;
- 
--	writel((readl(&dev->remote->control) &
--			~VLYNQ_CTRL_CLOCK_INT),
--			&dev->remote->control);
--
--	writel((readl(&dev->local->control) &
--			~VLYNQ_CTRL_CLOCK_INT),
--			&dev->local->control);
--
--	if (vlynq_linked(dev)) {
--		printk(KERN_DEBUG "%s: using external clock\n",
--			dev_name(&dev->dev));
--			dev->divisor = vlynq_div_external;
-+	if (!__vlynq_set_clocks(dev, vlynq_clk_external, 0, 0)) {
-+		printk(KERN_INFO "%s: using external clock\n",
-+				dev_name(&dev->dev));
-+				dev->divisor = vlynq_div_external;
- 		return 0;
- 	}
- 
-@@ -501,24 +547,16 @@ static int __vlynq_enable_device(struct
- 		return result;
- 
- 	switch (dev->divisor) {
--	case vlynq_div_external:
- 	case vlynq_div_auto:
- 		/* When the device is brought from reset it should have clock
- 		 * generation negotiated by hardware.
- 		 * Check which device is generating clocks and perform setup
- 		 * accordingly */
--		if (vlynq_linked(dev) && readl(&dev->remote->control) &
--		   VLYNQ_CTRL_CLOCK_INT) {
--			if (!__vlynq_try_remote(dev) ||
--				!__vlynq_try_local(dev)  ||
--				!__vlynq_try_external(dev))
--				return 0;
--		} else {
--			if (!__vlynq_try_external(dev) ||
--				!__vlynq_try_local(dev)    ||
--				!__vlynq_try_remote(dev))
--				return 0;
--		}
-+		if (!__vlynq_try_remote(dev) || !__vlynq_try_local(dev))
-+			return 0;
-+	case vlynq_div_external:
-+		if (!__vlynq_try_external(dev))
-+			return 0;
- 		break;
- 	case vlynq_ldiv1:
- 	case vlynq_ldiv2:
-@@ -528,15 +566,12 @@ static int __vlynq_enable_device(struct
- 	case vlynq_ldiv6:
- 	case vlynq_ldiv7:
- 	case vlynq_ldiv8:
--		writel(VLYNQ_CTRL_CLOCK_INT |
--			VLYNQ_CTRL_CLOCK_DIV(dev->divisor -
--			vlynq_ldiv1), &dev->local->control);
--		writel(0, &dev->remote->control);
--		if (vlynq_linked(dev)) {
--			printk(KERN_DEBUG
--				"%s: using local clock divisor %d\n",
--				dev_name(&dev->dev),
--				dev->divisor - vlynq_ldiv1 + 1);
-+		if (!__vlynq_set_clocks(dev, vlynq_clk_local, dev->divisor -
-+				vlynq_ldiv1, 0)) {
-+			printk(KERN_INFO
-+					"%s: using local clock divisor %d\n",
-+					dev_name(&dev->dev),
-+					dev->divisor - vlynq_ldiv1 + 1);
- 			return 0;
- 		}
- 		break;
-@@ -548,20 +583,17 @@ static int __vlynq_enable_device(struct
- 	case vlynq_rdiv6:
- 	case vlynq_rdiv7:
- 	case vlynq_rdiv8:
--		writel(0, &dev->local->control);
--		writel(VLYNQ_CTRL_CLOCK_INT |
--			VLYNQ_CTRL_CLOCK_DIV(dev->divisor -
--			vlynq_rdiv1), &dev->remote->control);
--		if (vlynq_linked(dev)) {
--			printk(KERN_DEBUG
--				"%s: using remote clock divisor %d\n",
--				dev_name(&dev->dev),
--				dev->divisor - vlynq_rdiv1 + 1);
-+		if (!__vlynq_set_clocks(dev, vlynq_clk_remote, 0,
-+				dev->divisor - vlynq_rdiv1)) {
-+			printk(KERN_INFO
-+					"%s: using remote clock divisor %d\n",
-+					dev_name(&dev->dev),
-+					dev->divisor - vlynq_rdiv1 + 1);
- 			return 0;
- 		}
- 		break;
- 	}
--
-+	vlynq_reset(dev);
- 	ops->off(dev);
- 	return -ENODEV;
- }
-@@ -732,14 +764,14 @@ static int vlynq_probe(struct platform_d
- 	platform_set_drvdata(pdev, dev);
- 
- 	printk(KERN_INFO "%s: regs 0x%p, irq %d, mem 0x%p\n",
--	       dev_name(&dev->dev), (void *)dev->regs_start, dev->irq,
--	       (void *)dev->mem_start);
-+			dev_name(&dev->dev), (void *)dev->regs_start,
-+			dev->irq, (void *)dev->mem_start);
- 
- 	dev->dev_id = 0;
- 	dev->divisor = vlynq_div_auto;
--	result = __vlynq_enable_device(dev);
--	if (result == 0) {
-+	if (!__vlynq_enable_device(dev)) {
- 		dev->dev_id = readl(&dev->remote->chip);
-+		vlynq_reset(dev);
- 		((struct plat_vlynq_ops *)(dev->dev.platform_data))->off(dev);
- 	}
- 	if (dev->dev_id)
diff --git a/target/linux/ar7/patches-4.1/200-free-mem-below-kernel-offset.patch b/target/linux/ar7/patches-4.1/200-free-mem-below-kernel-offset.patch
deleted file mode 100644
index 4011942..0000000
--- a/target/linux/ar7/patches-4.1/200-free-mem-below-kernel-offset.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- a/arch/mips/ar7/memory.c
-+++ b/arch/mips/ar7/memory.c
-@@ -66,5 +66,11 @@ void __init prom_meminit(void)
- 
- void __init prom_free_prom_memory(void)
- {
--	/* Nothing to free */
-+	/* adapted from arch/mips/txx9/generic/setup.c */
-+	unsigned long saddr = PHYS_OFFSET + PAGE_SIZE;
-+	unsigned long eaddr = __pa_symbol(&_text);
-+
-+	/* free memory between prom-record and kernel _text base */
-+	if (saddr < eaddr)
-+		free_init_pages("prom memory", saddr, eaddr);
- }
diff --git a/target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch b/target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch
deleted file mode 100644
index 2e5528e..0000000
--- a/target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch
+++ /dev/null
@@ -1,85 +0,0 @@
---- a/arch/mips/ar7/Platform
-+++ b/arch/mips/ar7/Platform
-@@ -3,4 +3,9 @@
- #
- platform-$(CONFIG_AR7)		+= ar7/
- cflags-$(CONFIG_AR7)		+= -I$(srctree)/arch/mips/include/asm/mach-ar7
--load-$(CONFIG_AR7)		+= 0xffffffff94100000
-+load-$(CONFIG_AR7_TI)		+= 0xffffffff94100000
-+
-+#
-+# AudioCodes AC49x
-+#
-+load-$(CONFIG_AR7_AC49X)	+= 0xffffffff945ca000
---- a/arch/mips/ar7/setup.c
-+++ b/arch/mips/ar7/setup.c
-@@ -69,6 +69,10 @@ const char *get_system_type(void)
- 			return "TI AR7 (TNETV1056)";
- 		case TITAN_CHIP_1060:
- 			return "TI AR7 (TNETV1060)";
-+		case TITAN_CHIP_AC495:
-+			return "AudioCodes AC495";
-+		case TITAN_CHIP_AC496:
-+			return "AudioCodes AC496";
- 		}
- 	default:
- 		return "TI AR7 (unknown)";
---- a/arch/mips/include/asm/mach-ar7/ar7.h
-+++ b/arch/mips/include/asm/mach-ar7/ar7.h
-@@ -92,6 +92,8 @@
- #define TITAN_CHIP_1055 0x0e
- #define TITAN_CHIP_1056 0x0d
- #define TITAN_CHIP_1060 0x07
-+#define TITAN_CHIP_AC495	0x00
-+#define TITAN_CHIP_AC496	0x02
- 
- /* Interrupts */
- #define AR7_IRQ_UART0	15
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -99,7 +99,7 @@ config AR7
- 	select HAVE_CLK
- 	help
- 	  Support for the Texas Instruments AR7 System-on-a-Chip
--	  family: TNETD7100, 7200 and 7300.
-+	  family: TI TNETD7100, 7200, 7300 and AudioCodes AC49x.
- 
- config ATH25
- 	bool "Atheros AR231x/AR531x SoC support"
-@@ -925,6 +925,7 @@ config MIPS_PARAVIRT
- endchoice
- 
- source "arch/mips/alchemy/Kconfig"
-+source "arch/mips/ar7/Kconfig"
- source "arch/mips/ath25/Kconfig"
- source "arch/mips/ath79/Kconfig"
- source "arch/mips/bcm47xx/Kconfig"
---- /dev/null
-+++ b/arch/mips/ar7/Kconfig
-@@ -0,0 +1,26 @@
-+if AR7
-+
-+config AR7_TI
-+	bool
-+
-+config AR7_AC49X
-+	bool
-+
-+choice
-+	prompt "AR7 SoC family selection"
-+	default AR7_TYPE_TI
-+	depends on AR7
-+	help
-+	  Select AR7 MIPS SoC implementation.
-+
-+	config AR7_TYPE_TI
-+		bool "Texas Instruments AR7"
-+		select AR7_TI
-+
-+	config AR7_TYPE_AC49X
-+		bool "AudioCodes AC49X"
-+		select AR7_AC49X
-+
-+endchoice
-+
-+endif
diff --git a/target/linux/ar7/patches-4.1/310-ac49x-prom-support.patch b/target/linux/ar7/patches-4.1/310-ac49x-prom-support.patch
deleted file mode 100644
index dddf221..0000000
--- a/target/linux/ar7/patches-4.1/310-ac49x-prom-support.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/arch/mips/ar7/prom.c
-+++ b/arch/mips/ar7/prom.c
-@@ -70,6 +70,7 @@ struct psbl_rec {
- };
- 
- static const char psp_env_version[] __initconst = "TIENV0.8";
-+static const char psp_env_version_ac49x[] __initconst = "MaxENV0.2";
- 
- struct psp_env_chunk {
- 	u8	num;
-@@ -186,7 +187,8 @@ static void __init ar7_init_env(struct e
- 	struct psbl_rec *psbl = (struct psbl_rec *)(KSEG1ADDR(0x14000300));
- 	void *psp_env = (void *)KSEG1ADDR(psbl->env_base);
- 
--	if (strcmp(psp_env, psp_env_version) == 0) {
-+	if (strcmp(psp_env, psp_env_version) == 0 ||
-+	    strcmp(psp_env, psp_env_version_ac49x) == 0) {
- 		parse_psp_env(psp_env);
- 	} else {
- 		for (i = 0; i < MAX_ENTRY; i++, env++)
diff --git a/target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch b/target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch
deleted file mode 100644
index 2330493..0000000
--- a/target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- a/drivers/mtd/Kconfig
-+++ b/drivers/mtd/Kconfig
-@@ -159,6 +159,11 @@ config MTD_OF_PARTS
- 	  the partition map from the children of the flash node,
- 	  as described in Documentation/devicetree/bindings/mtd/partition.txt.
- 
-+config MTD_AC49X_PARTS
-+	tristate "AudioCodes AC49X partitioning support"
-+	---help---
-+	  AudioCodes AC49X partitioning support
-+
- config MTD_AR7_PARTS
- 	tristate "TI AR7 partitioning support"
- 	---help---
---- a/drivers/mtd/Makefile
-+++ b/drivers/mtd/Makefile
-@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_SPLIT)		+= mtdsplit/
- obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
- obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
- obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
-+obj-$(CONFIG_MTD_AC49X_PARTS)	+= ac49xpart.o
- obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
- obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o titanpart.o
- obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
---- a/arch/mips/ar7/platform.c
-+++ b/arch/mips/ar7/platform.c
-@@ -202,7 +202,7 @@ static struct resource physmap_flash_res
- 	.end	= 0x11ffffff,
- };
- 
--static const char *ar7_probe_types[] = { "ar7part", NULL };
-+static const char *ar7_probe_types[] = { "ac49xpart", "ar7part", NULL };
- 
- static struct physmap_flash_data physmap_flash_data = {
- 	.width	= 2,
diff --git a/target/linux/ar7/patches-4.1/500-serial_kludge.patch b/target/linux/ar7/patches-4.1/500-serial_kludge.patch
deleted file mode 100644
index c7bb297..0000000
--- a/target/linux/ar7/patches-4.1/500-serial_kludge.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- a/drivers/tty/serial/8250/8250_core.c
-+++ b/drivers/tty/serial/8250/8250_core.c
-@@ -347,6 +347,13 @@ configured less than Maximum supported f
- 		.rxtrig_bytes	= {1, 4, 8, 14},
- 		.flags		= UART_CAP_FIFO,
- 	},
-+	[PORT_AR7] = {
-+		.name		= "TI-AR7",
-+		.fifo_size	= 16,
-+		.tx_loadsz	= 16,
-+		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00,
-+		.flags		= UART_CAP_FIFO | UART_CAP_AFE,
-+	},
- };
- 
- /* Uart divisor latch read */
-@@ -3342,7 +3349,11 @@ static void serial8250_console_putchar(s
- {
- 	struct uart_8250_port *up = up_to_u8250p(port);
- 
-+#ifdef CONFIG_AR7
-+	wait_for_xmitr(up, BOTH_EMPTY);
-+#else
- 	wait_for_xmitr(up, UART_LSR_THRE);
-+#endif
- 	serial_port_out(port, UART_TX, ch);
- }
- 
diff --git a/target/linux/ar7/patches-4.1/920-ar7part.patch b/target/linux/ar7/patches-4.1/920-ar7part.patch
deleted file mode 100644
index 9948858..0000000
--- a/target/linux/ar7/patches-4.1/920-ar7part.patch
+++ /dev/null
@@ -1,118 +0,0 @@
---- a/drivers/mtd/ar7part.c
-+++ b/drivers/mtd/ar7part.c
-@@ -30,11 +30,14 @@
- 
- #include <uapi/linux/magic.h>
- 
-+#include <asm/mach-ar7/prom.h>
-+
- #define AR7_PARTS	4
- #define ROOT_OFFSET	0xe0000
- 
- #define LOADER_MAGIC1	le32_to_cpu(0xfeedfa42)
- #define LOADER_MAGIC2	le32_to_cpu(0xfeed1281)
-+#define LOADER_MAGIC3	le32_to_cpu(0x434d4d4c)
- 
- struct ar7_bin_rec {
- 	unsigned int checksum;
-@@ -42,12 +45,16 @@ struct ar7_bin_rec {
- 	unsigned int address;
- };
- 
-+int create_titan_partitions(struct mtd_info *master,
-+        struct mtd_partition **pparts,
-+        struct mtd_part_parser_data *data);
-+
- static int create_mtd_partitions(struct mtd_info *master,
- 				 struct mtd_partition **pparts,
- 				 struct mtd_part_parser_data *data)
- {
- 	struct ar7_bin_rec header;
--	unsigned int offset;
-+	unsigned int offset, mtd_start, mtd_end;
- 	size_t len;
- 	unsigned int pre_size = master->erasesize, post_size = 0;
- 	unsigned int root_offset = ROOT_OFFSET;
-@@ -55,6 +62,16 @@ static int create_mtd_partitions(struct
- 	int retries = 10;
- 	struct mtd_partition *ar7_parts;
- 
-+	const char *prom_str = prom_getenv("ProductID");
-+	char mtd_name[] = "mtd1";
-+	if(prom_str &&
-+		(strcmp(prom_str, "CYWL")==0 ||
-+		strcmp(prom_str, "CYWM")==0 ||
-+		strcmp(prom_str, "CYLM")==0 ||
-+		strcmp(prom_str, "CYLL")==0)){
-+		return create_titan_partitions(master, pparts, data);
-+	}
-+
- 	ar7_parts = kzalloc(sizeof(*ar7_parts) * AR7_PARTS, GFP_KERNEL);
- 	if (!ar7_parts)
- 		return -ENOMEM;
-@@ -83,34 +100,39 @@ static int create_mtd_partitions(struct
- 
- 	pre_size = offset;
- 
--	if (!ar7_parts[1].offset) {
--		ar7_parts[1].offset = master->size - master->erasesize;
--		post_size = master->erasesize;
--	}
--
- 	switch (header.checksum) {
--	case LOADER_MAGIC1:
--		while (header.length) {
--			offset += sizeof(header) + header.length;
--			mtd_read(master, offset, sizeof(header), &len,
--				 (uint8_t *)&header);
--		}
--		root_offset = offset + sizeof(header) + 4;
--		break;
- 	case LOADER_MAGIC2:
-+		for (retries = 0; retries <= 9; retries++) {
-+			mtd_name[3] = '0' + retries;
-+			prom_str = prom_getenv(mtd_name);
-+			if (prom_str == NULL)
-+				continue;
-+			sscanf(prom_str, "%i,%i", &mtd_start, &mtd_end);
-+			if (pre_size == (mtd_start & 0x1ffffff)) {
-+				ar7_parts[1].offset = mtd_end &= 0x1ffffff;
-+				ar7_parts[1].size = post_size = master->size - mtd_end;
-+				break;
-+			}
-+		}
-+	case LOADER_MAGIC1:
-+		root_offset = (header.checksum == LOADER_MAGIC1) ? 4 : 0;
- 		while (header.length) {
- 			offset += sizeof(header) + header.length;
- 			mtd_read(master, offset, sizeof(header), &len,
- 				 (uint8_t *)&header);
- 		}
--		root_offset = offset + sizeof(header) + 4 + 0xff;
--		root_offset &= ~(uint32_t)0xff;
-+		root_offset += offset + sizeof(header);
- 		break;
- 	default:
- 		printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum);
- 		break;
- 	}
- 
-+	if (!ar7_parts[1].offset) {
-+		post_size = master->erasesize;
-+		ar7_parts[1].offset = master->size - post_size;
-+	}
-+
- 	mtd_read(master, root_offset, sizeof(header), &len, (u8 *)&header);
- 	if (header.checksum != SQUASHFS_MAGIC) {
- 		root_offset += master->erasesize - 1;
---- a/drivers/mtd/titanpart.c
-+++ b/drivers/mtd/titanpart.c
-@@ -149,7 +149,7 @@ static void titan_add_partition(char * e
- }
- int create_titan_partitions(struct mtd_info *master,
- 	struct mtd_partition **pparts,
--	unsigned long origin)
-+	struct mtd_part_parser_data *data)
- {
- 	struct nsp_img_hdr_head		hdr;
- 	struct nsp_img_hdr_section_info	sect_info;
diff --git a/target/linux/ar7/patches-4.1/925-actiontec_leds.patch b/target/linux/ar7/patches-4.1/925-actiontec_leds.patch
deleted file mode 100644
index 1346a21..0000000
--- a/target/linux/ar7/patches-4.1/925-actiontec_leds.patch
+++ /dev/null
@@ -1,95 +0,0 @@
---- a/arch/mips/ar7/platform.c
-+++ b/arch/mips/ar7/platform.c
-@@ -461,31 +461,22 @@ static struct gpio_led fb_fon_leds[] = {
- 	},
- };
- 
--static struct gpio_led gt701_leds[] = {
-+static struct gpio_led actiontec_leds[] = {
- 	{
- 		.name			= "inet:green",
- 		.gpio			= 13,
--		.active_low		= 1,
--	},
--	{
--		.name			= "usb",
--		.gpio			= 12,
--		.active_low		= 1,
- 	},
- 	{
- 		.name			= "inet:red",
- 		.gpio			= 9,
--		.active_low		= 1,
- 	},
- 	{
--		.name			= "power:red",
-+		.name			= "power:green",
- 		.gpio			= 7,
--		.active_low		= 1,
- 	},
- 	{
--		.name			= "power:green",
-+		.name			= "power:red",
- 		.gpio			= 8,
--		.active_low		= 1,
- 		.default_trigger	= "default-on",
- 	},
- 	{
-@@ -493,6 +484,44 @@ static struct gpio_led gt701_leds[] = {
- 		.gpio			= 10,
- 		.active_low		= 1,
- 	},
-+	{
-+		.name			= "wifi",
-+		.gpio			= 6,
-+		.active_low		= 1,
-+	},
-+	{
-+		.name			= "wifi:red",
-+		.gpio			= 3,
-+	},
-+	{
-+		.name			= "standby",
-+		.gpio			= 4,
-+	},
-+	{
-+		.name			= "wps",
-+		.gpio			= 16,
-+		.active_low		= 1,
-+	},
-+	{
-+		.name			= "usb",
-+		.gpio			= 12,
-+		.active_low		= 1,
-+	},
-+	{
-+		.name			= "voip",
-+		.gpio			= 15,
-+		.active_low		= 1,
-+        },
-+        {
-+                .name			= "line1",
-+                .gpio			= 23,
-+                .active_low		= 1,
-+	},
-+	{
-+		.name			= "line2",
-+		.gpio			= 25,
-+		.active_low		= 1,
-+	},
- };
- 
- static struct gpio_led_platform_data ar7_led_data;
-@@ -536,9 +565,9 @@ static void __init detect_leds(void)
- 	} else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) {
- 		ar7_led_data.num_leds = ARRAY_SIZE(titan_leds);
- 		ar7_led_data.leds = titan_leds;
--	} else if (strstr(prid, "GT701")) {
--		ar7_led_data.num_leds = ARRAY_SIZE(gt701_leds);
--		ar7_led_data.leds = gt701_leds;
-+	} else if (strstr(prid, "GT7") || strstr(prid, "PK5000")) {
-+		ar7_led_data.num_leds = ARRAY_SIZE(actiontec_leds);
-+		ar7_led_data.leds = actiontec_leds;
- 	}
- }
- 
diff --git a/target/linux/ar7/patches-4.1/950-cpmac_titan.patch b/target/linux/ar7/patches-4.1/950-cpmac_titan.patch
deleted file mode 100644
index f1d432c..0000000
--- a/target/linux/ar7/patches-4.1/950-cpmac_titan.patch
+++ /dev/null
@@ -1,52 +0,0 @@
---- a/drivers/net/ethernet/ti/cpmac.c
-+++ b/drivers/net/ethernet/ti/cpmac.c
-@@ -1146,6 +1146,8 @@ static int cpmac_probe(struct platform_d
- 		goto out;
- 	}
- 
-+	ar7_device_reset(pdata->reset_bit);
-+
- 	dev->irq = platform_get_irq_byname(pdev, "irq");
- 
- 	dev->netdev_ops = &cpmac_netdev_ops;
-@@ -1227,7 +1229,7 @@ int cpmac_init(void)
- 	cpmac_mii->reset = cpmac_mdio_reset;
- 	cpmac_mii->irq = mii_irqs;
- 
--	cpmac_mii->priv = ioremap(AR7_REGS_MDIO, 256);
-+	cpmac_mii->priv = ioremap(ar7_is_titan() ? TITAN_REGS_MDIO : AR7_REGS_MDIO, 256);
- 
- 	if (!cpmac_mii->priv) {
- 		pr_err("Can't ioremap mdio registers\n");
-@@ -1238,10 +1240,16 @@ int cpmac_init(void)
- #warning FIXME: unhardcode gpio&reset bits
- 	ar7_gpio_disable(26);
- 	ar7_gpio_disable(27);
--	ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
--	ar7_device_reset(AR7_RESET_BIT_CPMAC_HI);
-+
-+	if (!ar7_is_titan()) {
-+		ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
-+		ar7_device_reset(AR7_RESET_BIT_CPMAC_HI);
-+	}
- 	ar7_device_reset(AR7_RESET_BIT_EPHY);
- 
-+	if (ar7_is_titan())
-+		ar7_device_reset(TITAN_RESET_BIT_EPHY1);
-+
- 	cpmac_mii->reset(cpmac_mii);
- 
- 	for (i = 0; i < 300; i++) {
-@@ -1258,7 +1266,11 @@ int cpmac_init(void)
- 		mask = 0;
- 	}
- 
--	cpmac_mii->phy_mask = ~(mask | 0x80000000);
-+	if (ar7_is_titan())
-+		cpmac_mii->phy_mask = ~(mask | 0x80000000 | 0x40000000);
-+	else
-+		cpmac_mii->phy_mask = ~(mask | 0x80000000);
-+
- 	snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "cpmac-1");
- 
- 	res = mdiobus_register(cpmac_mii);


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:12 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:12 -0400
Subject: [source]  ar7: add kernel 4.9 support
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57038.1509316919.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/cf9e0a59aabd84a409a44fd39f6b03a064a82786

commit cf9e0a59aabd84a409a44fd39f6b03a064a82786
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Thu Oct 12 10:50:08 2017 +0200

    ar7: add kernel 4.9 support
    
    Compile and run tested on WAG354Gv1.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/ar7/config-4.9                        | 151 +++++++++++
 .../ar7/patches-4.9/001-mips-ar7-fix-serial.patch  |  23 ++
 ...-ensure-the-port-type-s-FCR-value-is-used.patch |  48 ++++
 .../003-MIPS-AR7-defer-registration-of-GPIO.patch  |  45 ++++
 .../ar7/patches-4.9/100-fix-highmem-offset.patch   |  11 +
 ...IPS-AR7-allow-NULL-clock-for-clk_get_rate.patch |  45 ++++
 target/linux/ar7/patches-4.9/110-flash.patch       |  22 ++
 .../patches-4.9/160-vlynq_try_remote_first.patch   | 300 +++++++++++++++++++++
 .../200-free-mem-below-kernel-offset.patch         |  15 ++
 .../ar7/patches-4.9/300-add-ac49x-platform.patch   |  85 ++++++
 .../ar7/patches-4.9/310-ac49x-prom-support.patch   |  20 ++
 .../ar7/patches-4.9/320-ac49x-mtd-partitions.patch |  35 +++
 target/linux/ar7/patches-4.9/920-ar7part.patch     | 120 +++++++++
 .../linux/ar7/patches-4.9/925-actiontec_leds.patch |  95 +++++++
 target/linux/ar7/patches-4.9/950-cpmac_titan.patch |  52 ++++
 15 files changed, 1067 insertions(+)

diff --git a/target/linux/ar7/config-4.9 b/target/linux/ar7/config-4.9
new file mode 100644
index 0000000..95a5375
--- /dev/null
+++ b/target/linux/ar7/config-4.9
@@ -0,0 +1,151 @@
+CONFIG_ADM6996_PHY=y
+CONFIG_AR7=y
+CONFIG_AR7_TI=y
+# CONFIG_AR7_TYPE_AC49X is not set
+CONFIG_AR7_TYPE_TI=y
+CONFIG_AR7_WDT=y
+CONFIG_ARCH_BINFMT_ELF_STATE=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
+# CONFIG_ARCH_HAS_SG_CHAIN is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_BOOT_ELF32=y
+CONFIG_CEVT_R4K=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+CONFIG_CPMAC=y
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPS32_R1=y
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FIXED_PHY=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_IO=y
+CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GPIOLIB=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+# CONFIG_HAVE_ARCH_BITREVERSE is not set
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_HAVE_CBPF_JIT=y
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HW_RANDOM=y
+CONFIG_HZ_PERIODIC=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_IP17XX_PHY=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_MIPS_CPU=y
+CONFIG_IRQ_WORK=y
+CONFIG_KALLSYMS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_MDIO_BOARDINFO=y
+CONFIG_MIPS=y
+CONFIG_MIPS_ASID_BITS=8
+CONFIG_MIPS_ASID_SHIFT=0
+CONFIG_MIPS_CLOCK_VSYSCALL=y
+# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
+CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+# CONFIG_MIPS_MACHINE is not set
+CONFIG_MODULES_USE_ELF_REL=y
+# CONFIG_MTD_AC49X_PARTS is not set
+CONFIG_MTD_CFI_STAA=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MVSWITCH_PHY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NO_EXCEPT_FILL=y
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+# CONFIG_NO_IOPORT_MAP is not set
+# CONFIG_OF is not set
+CONFIG_PCI_DRIVERS_LEGACY=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+# CONFIG_RCU_STALL_COMMON is not set
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SERIAL_8250_FSL is not set
+CONFIG_SRCU=y
+CONFIG_SWAP_IO_SPACE=y
+CONFIG_SWCONFIG=y
+CONFIG_SWPHY=y
+CONFIG_SYSCTL_EXCEPTION_TRACE=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_MIPS16=y
+CONFIG_SYS_SUPPORTS_ZBOOT=y
+CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_VLYNQ=y
+# CONFIG_VLYNQ_DEBUG is not set
diff --git a/target/linux/ar7/patches-4.9/001-mips-ar7-fix-serial.patch b/target/linux/ar7/patches-4.9/001-mips-ar7-fix-serial.patch
new file mode 100644
index 0000000..7567b84
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/001-mips-ar7-fix-serial.patch
@@ -0,0 +1,23 @@
+From 443ab715a40881d6c9ba11b027ba154bac904cb0 Mon Sep 17 00:00:00 2001
+From: Oswald Buddenhagen <oswald.buddenhagen at gmx.de>
+Date: Sat, 10 May 2014 23:19:08 +0200
+Subject: [PATCH] MIPS/AR7: ensure that serial ports are properly set up
+
+without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is
+never copied, resulting in a dead port.
+
+Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen at gmx.de>
+---
+ arch/mips/ar7/platform.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/mips/ar7/platform.c
++++ b/arch/mips/ar7/platform.c
+@@ -576,6 +576,7 @@ static int __init ar7_register_uarts(voi
+ 	uart_port.type		= PORT_AR7;
+ 	uart_port.uartclk	= clk_get_rate(bus_clk) / 2;
+ 	uart_port.iotype	= UPIO_MEM32;
++	uart_port.flags		= UPF_FIXED_TYPE;
+ 	uart_port.regshift	= 2;
+ 
+ 	uart_port.line		= 0;
diff --git a/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch b/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch
new file mode 100644
index 0000000..cc1a541
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch
@@ -0,0 +1,48 @@
+From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski at gmail.com>
+Date: Sun, 29 Oct 2017 15:50:42 +0100
+Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used
+
+Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt
+trigger I/F of FIFO buffers"), the port's default FCR value isn't used
+in serial8250_do_set_termios anymore, but copied over once in
+serial8250_config_port and then modified as needed.
+
+Unfortunately, serial8250_config_port will never be called if the port
+is shared between kernel and userspace, and the port's flag doesn't have
+UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well.
+
+This causes garbled output from userspace:
+
+[    5.220000] random: procd urandom read with 49 bits of entropy available
+ers
+   [kee
+
+Fix this by forcing it to be configured on boot, resulting in the
+expected output:
+
+[    5.250000] random: procd urandom read with 50 bits of entropy available
+Press the [f] key and hit [enter] to enter failsafe mode
+Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
+
+Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers")
+Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+---
+I'm not sure if this is just AR7's issue, or if this points to a general
+issue for UARTs used as kernel console and login console with the "fixed"
+commit.
+
+ arch/mips/ar7/platform.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/mips/ar7/platform.c
++++ b/arch/mips/ar7/platform.c
+@@ -576,7 +576,7 @@ static int __init ar7_register_uarts(voi
+ 	uart_port.type		= PORT_AR7;
+ 	uart_port.uartclk	= clk_get_rate(bus_clk) / 2;
+ 	uart_port.iotype	= UPIO_MEM32;
+-	uart_port.flags		= UPF_FIXED_TYPE;
++	uart_port.flags		= UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF;
+ 	uart_port.regshift	= 2;
+ 
+ 	uart_port.line		= 0;
diff --git a/target/linux/ar7/patches-4.9/003-MIPS-AR7-defer-registration-of-GPIO.patch b/target/linux/ar7/patches-4.9/003-MIPS-AR7-defer-registration-of-GPIO.patch
new file mode 100644
index 0000000..f256665
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/003-MIPS-AR7-defer-registration-of-GPIO.patch
@@ -0,0 +1,45 @@
+From 3a8d54573f9d187779d36d6b45e8e0288b82c31a Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jonas.gorski at gmail.com>
+Date: Thu, 26 Oct 2017 23:25:44 +0200
+Subject: [PATCH 1/3] MIPS: AR7: defer registration of GPIO
+
+When called from prom init code, ar7_gpio_init() will fail as it will
+call gpiochip_add() which relies on a working kmalloc() to alloc
+the gpio_desc array and kmalloc is not useable yet at prom init time.
+
+Move ar7_gpio_init() to ar7_register_devices() (a device_initcall)
+where kmalloc works.
+
+Fixes: 14e85c0e69d5 ("gpio: remove gpio_descs global array")
+Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+---
+Text shamelessy stolen from commit 2ec459f2a77b8.
+
+ arch/mips/ar7/platform.c | 4 ++++
+ arch/mips/ar7/prom.c     | 2 --
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/arch/mips/ar7/platform.c
++++ b/arch/mips/ar7/platform.c
+@@ -655,6 +655,10 @@ static int __init ar7_register_devices(v
+ 	u32 val;
+ 	int res;
+ 
++	res = ar7_gpio_init();
++	if (res)
++		pr_warn("unable to register gpios: %d\n", res);
++
+ 	res = ar7_register_uarts();
+ 	if (res)
+ 		pr_err("unable to setup uart(s): %d\n", res);
+--- a/arch/mips/ar7/prom.c
++++ b/arch/mips/ar7/prom.c
+@@ -246,8 +246,6 @@ void __init prom_init(void)
+ 	ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
+ 	ar7_init_env((struct env_var *)fw_arg2);
+ 	console_config();
+-
+-	ar7_gpio_init();
+ }
+ 
+ #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
diff --git a/target/linux/ar7/patches-4.9/100-fix-highmem-offset.patch b/target/linux/ar7/patches-4.9/100-fix-highmem-offset.patch
new file mode 100644
index 0000000..f1a7549
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/100-fix-highmem-offset.patch
@@ -0,0 +1,11 @@
+--- a/arch/mips/include/asm/mach-ar7/spaces.h
++++ b/arch/mips/include/asm/mach-ar7/spaces.h
+@@ -20,6 +20,8 @@
+ #define UNCAC_BASE	_AC(0xb4000000, UL)	/* 0xa0000000 + PHYS_OFFSET */
+ #define IO_BASE		UNCAC_BASE
+ 
++#define HIGHMEM_START	_AC(0x20000000, UL)
++
+ #include <asm/mach-generic/spaces.h>
+ 
+ #endif /* __ASM_AR7_SPACES_H */
diff --git a/target/linux/ar7/patches-4.9/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/ar7/patches-4.9/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch
new file mode 100644
index 0000000..74ac0d1
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch
@@ -0,0 +1,45 @@
+From patchwork Tue Jul 18 10:17:26 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [5/9] MIPS: AR7: allow NULL clock for clk_get_rate
+X-Patchwork-Submitter: Jonas Gorski <jonas.gorski at gmail.com>
+X-Patchwork-Id: 16775
+Message-Id: <20170718101730.2541-6-jonas.gorski at gmail.com>
+To: unlisted-recipients:; (no To-header on input)
+Cc: Ralf Baechle <ralf at linux-mips.org>,
+ Paul Gortmaker <paul.gortmaker at windriver.com>,
+ James Hogan <james.hogan at imgtec.com>,
+ linux-mips at linux-mips.org, linux-kernel at vger.kernel.org
+Date: Tue, 18 Jul 2017 12:17:26 +0200
+From: Jonas Gorski <jonas.gorski at gmail.com>
+List-Id: linux-mips <linux-mips.eddie.linux-mips.org>
+
+Make the behaviour of clk_get_rate consistent with common clk's
+clk_get_rate by accepting NULL clocks as parameter. Some device
+drivers rely on this, and will cause an OOPS otherwise.
+
+Fixes: 780019ddf02f ("MIPS: AR7: Implement clock API")
+Cc: Ralf Baechle <ralf at linux-mips.org>
+Cc: Paul Gortmaker <paul.gortmaker at windriver.com>
+Cc: James Hogan <james.hogan at imgtec.com>
+Cc: linux-mips at linux-mips.org
+Cc: linux-kernel at vger.kernel.org
+Reported-by: Mathias Kresin <dev at kresin.me>
+Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
+---
+ arch/mips/ar7/clock.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/mips/ar7/clock.c
++++ b/arch/mips/ar7/clock.c
+@@ -430,6 +430,9 @@ EXPORT_SYMBOL(clk_disable);
+ 
+ unsigned long clk_get_rate(struct clk *clk)
+ {
++	if (!clk)
++		return 0;
++
+ 	return clk->rate;
+ }
+ EXPORT_SYMBOL(clk_get_rate);
diff --git a/target/linux/ar7/patches-4.9/110-flash.patch b/target/linux/ar7/patches-4.9/110-flash.patch
new file mode 100644
index 0000000..f5713bd
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/110-flash.patch
@@ -0,0 +1,22 @@
+--- a/drivers/mtd/Makefile
++++ b/drivers/mtd/Makefile
+@@ -12,7 +12,7 @@ obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
+ obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
+ obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
+ obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
+-obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o
++obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o titanpart.o
+ obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
+ obj-$(CONFIG_MTD_BCM47XX_PARTS)	+= bcm47xxpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
+--- a/arch/mips/ar7/platform.c
++++ b/arch/mips/ar7/platform.c
+@@ -198,7 +198,7 @@ static struct resource physmap_flash_res
+ 	.name	= "mem",
+ 	.flags	= IORESOURCE_MEM,
+ 	.start	= 0x10000000,
+-	.end	= 0x107fffff,
++	.end	= 0x11ffffff,
+ };
+ 
+ static const char *ar7_probe_types[] = { "ar7part", NULL };
diff --git a/target/linux/ar7/patches-4.9/160-vlynq_try_remote_first.patch b/target/linux/ar7/patches-4.9/160-vlynq_try_remote_first.patch
new file mode 100644
index 0000000..1d1310d
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/160-vlynq_try_remote_first.patch
@@ -0,0 +1,300 @@
+--- a/drivers/vlynq/vlynq.c
++++ b/drivers/vlynq/vlynq.c
+@@ -119,20 +119,40 @@ static int vlynq_linked(struct vlynq_dev
+ 	return 0;
+ }
+ 
++static volatile int vlynq_delay_value_new = 0;
++
++static void vlynq_delay_wait(u32 count)
++{
++	/* Code adopted from original vlynq driver */
++	int i = 0;
++	volatile int *ptr = &vlynq_delay_value_new;
++	*ptr = 0;
++
++	/* We are assuming that the each cycle takes about
++	 * 23 assembly instructions. */
++	for(i = 0; i < (count + 23)/23; i++)
++		*ptr = *ptr + 1;
++}
++
+ static void vlynq_reset(struct vlynq_device *dev)
+ {
++	u32 rtm = readl(&dev->local->revision);
++
++	rtm = rtm < 0x00010205 || readl(&dev->local->status) & 0x800 == 0 ?
++			0 : 0x600000;
++
+ 	writel(readl(&dev->local->control) | VLYNQ_CTRL_RESET,
+ 			&dev->local->control);
+ 
+ 	/* Wait for the devices to finish resetting */
+-	msleep(5);
++	vlynq_delay_wait(0xffffff);
+ 
+ 	/* Remove reset bit */
+-	writel(readl(&dev->local->control) & ~VLYNQ_CTRL_RESET,
++	writel(readl(&dev->local->control) & ~VLYNQ_CTRL_RESET | rtm,
+ 			&dev->local->control);
+ 
+ 	/* Give some time for the devices to settle */
+-	msleep(5);
++	vlynq_delay_wait(0xffffff);
+ }
+ 
+ static void vlynq_irq_unmask(struct irq_data *d)
+@@ -379,6 +399,61 @@ void vlynq_unregister_driver(struct vlyn
+ }
+ EXPORT_SYMBOL(vlynq_unregister_driver);
+ 
++enum vlynq_clk_src {
++	vlynq_clk_external,
++	vlynq_clk_local,
++	vlynq_clk_remote,
++	vlynq_clk_invalid,
++};
++
++static int __vlynq_set_clocks(struct vlynq_device *dev,
++				enum vlynq_clk_src clk_dir,
++				int lclk_div, int rclk_div)
++{
++	u32 reg;
++
++	if (clk_dir == vlynq_clk_invalid) {
++		printk(KERN_ERR "%s: attempt to set invalid clocking\n",
++				dev_name(&dev->dev));
++		return -EINVAL;
++	}
++
++	reg = readl(&dev->local->control);
++	if (readl(&dev->local->revision) < 0x00010205) {
++		if (clk_dir & vlynq_clk_local)
++			reg |= VLYNQ_CTRL_CLOCK_INT;
++		else
++			reg &= ~VLYNQ_CTRL_CLOCK_INT;
++	}
++	reg &= ~VLYNQ_CTRL_CLOCK_MASK;
++	reg |= VLYNQ_CTRL_CLOCK_DIV(lclk_div);
++	writel(reg, &dev->local->control);
++
++	if (!vlynq_linked(dev))
++		return -ENODEV;
++
++	printk(KERN_INFO "%s: local VLYNQ protocol rev. is 0x%08x\n",
++			dev_name(&dev->dev), readl(&dev->local->revision));
++	printk(KERN_INFO "%s: remote VLYNQ protocol rev. is 0x%08x\n",
++			dev_name(&dev->dev), readl(&dev->remote->revision));
++
++	reg = readl(&dev->remote->control);
++	if (readl(&dev->remote->revision) < 0x00010205) {
++		if (clk_dir & vlynq_clk_remote)
++			reg |= VLYNQ_CTRL_CLOCK_INT;
++		else
++			reg &= ~VLYNQ_CTRL_CLOCK_INT;
++	}
++	reg &= ~VLYNQ_CTRL_CLOCK_MASK;
++	reg |= VLYNQ_CTRL_CLOCK_DIV(rclk_div);
++	writel(reg, &dev->remote->control);
++
++	if (!vlynq_linked(dev))
++		return -ENODEV;
++
++	return 0;
++}
++
+ /*
+  * A VLYNQ remote device can clock the VLYNQ bus master
+  * using a dedicated clock line. In that case, both the
+@@ -392,29 +467,16 @@ static int __vlynq_try_remote(struct vly
+ 	int i;
+ 
+ 	vlynq_reset(dev);
+-	for (i = dev->dev_id ? vlynq_rdiv2 : vlynq_rdiv8; dev->dev_id ?
+-			i <= vlynq_rdiv8 : i >= vlynq_rdiv2;
+-		dev->dev_id ? i++ : i--) {
++	for (i = 0; i <= 7; i++) {
+ 
+ 		if (!vlynq_linked(dev))
+ 			break;
+ 
+-		writel((readl(&dev->remote->control) &
+-				~VLYNQ_CTRL_CLOCK_MASK) |
+-				VLYNQ_CTRL_CLOCK_INT |
+-				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1),
+-				&dev->remote->control);
+-		writel((readl(&dev->local->control)
+-				& ~(VLYNQ_CTRL_CLOCK_INT |
+-				VLYNQ_CTRL_CLOCK_MASK)) |
+-				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_rdiv1),
+-				&dev->local->control);
+-
+-		if (vlynq_linked(dev)) {
+-			printk(KERN_DEBUG
+-				"%s: using remote clock divisor %d\n",
+-				dev_name(&dev->dev), i - vlynq_rdiv1 + 1);
+-			dev->divisor = i;
++		if (!__vlynq_set_clocks(dev, vlynq_clk_remote, i, i)) {
++			printk(KERN_INFO
++					"%s: using remote clock divisor %d\n",
++					dev_name(&dev->dev), i + 1);
++			dev->divisor = i + vlynq_rdiv1;
+ 			return 0;
+ 		} else {
+ 			vlynq_reset(dev);
+@@ -433,25 +495,17 @@ static int __vlynq_try_remote(struct vly
+  */
+ static int __vlynq_try_local(struct vlynq_device *dev)
+ {
+-	int i;
++	int i, dir = !dev->dev_id;
+ 
+ 	vlynq_reset(dev);
+ 
+-	for (i = dev->dev_id ? vlynq_ldiv2 : vlynq_ldiv8; dev->dev_id ?
+-			i <= vlynq_ldiv8 : i >= vlynq_ldiv2;
+-		dev->dev_id ? i++ : i--) {
+-
+-		writel((readl(&dev->local->control) &
+-				~VLYNQ_CTRL_CLOCK_MASK) |
+-				VLYNQ_CTRL_CLOCK_INT |
+-				VLYNQ_CTRL_CLOCK_DIV(i - vlynq_ldiv1),
+-				&dev->local->control);
+-
+-		if (vlynq_linked(dev)) {
+-			printk(KERN_DEBUG
+-				"%s: using local clock divisor %d\n",
+-				dev_name(&dev->dev), i - vlynq_ldiv1 + 1);
+-			dev->divisor = i;
++	for (i = dir ? 7 : 0; dir ? i >= 0 : i <= 7; dir ? i-- : i++) {
++
++		if (!__vlynq_set_clocks(dev, vlynq_clk_local, i, 0)) {
++			printk(KERN_INFO
++					"%s: using local clock divisor %d\n",
++					dev_name(&dev->dev), i + 1);
++			dev->divisor = i + vlynq_ldiv1;
+ 			return 0;
+ 		} else {
+ 			vlynq_reset(dev);
+@@ -473,18 +527,10 @@ static int __vlynq_try_external(struct v
+ 	if (!vlynq_linked(dev))
+ 		return -ENODEV;
+ 
+-	writel((readl(&dev->remote->control) &
+-			~VLYNQ_CTRL_CLOCK_INT),
+-			&dev->remote->control);
+-
+-	writel((readl(&dev->local->control) &
+-			~VLYNQ_CTRL_CLOCK_INT),
+-			&dev->local->control);
+-
+-	if (vlynq_linked(dev)) {
+-		printk(KERN_DEBUG "%s: using external clock\n",
+-			dev_name(&dev->dev));
+-			dev->divisor = vlynq_div_external;
++	if (!__vlynq_set_clocks(dev, vlynq_clk_external, 0, 0)) {
++		printk(KERN_INFO "%s: using external clock\n",
++				dev_name(&dev->dev));
++				dev->divisor = vlynq_div_external;
+ 		return 0;
+ 	}
+ 
+@@ -501,24 +547,16 @@ static int __vlynq_enable_device(struct
+ 		return result;
+ 
+ 	switch (dev->divisor) {
+-	case vlynq_div_external:
+ 	case vlynq_div_auto:
+ 		/* When the device is brought from reset it should have clock
+ 		 * generation negotiated by hardware.
+ 		 * Check which device is generating clocks and perform setup
+ 		 * accordingly */
+-		if (vlynq_linked(dev) && readl(&dev->remote->control) &
+-		   VLYNQ_CTRL_CLOCK_INT) {
+-			if (!__vlynq_try_remote(dev) ||
+-				!__vlynq_try_local(dev)  ||
+-				!__vlynq_try_external(dev))
+-				return 0;
+-		} else {
+-			if (!__vlynq_try_external(dev) ||
+-				!__vlynq_try_local(dev)    ||
+-				!__vlynq_try_remote(dev))
+-				return 0;
+-		}
++		if (!__vlynq_try_remote(dev) || !__vlynq_try_local(dev))
++			return 0;
++	case vlynq_div_external:
++		if (!__vlynq_try_external(dev))
++			return 0;
+ 		break;
+ 	case vlynq_ldiv1:
+ 	case vlynq_ldiv2:
+@@ -528,15 +566,12 @@ static int __vlynq_enable_device(struct
+ 	case vlynq_ldiv6:
+ 	case vlynq_ldiv7:
+ 	case vlynq_ldiv8:
+-		writel(VLYNQ_CTRL_CLOCK_INT |
+-			VLYNQ_CTRL_CLOCK_DIV(dev->divisor -
+-			vlynq_ldiv1), &dev->local->control);
+-		writel(0, &dev->remote->control);
+-		if (vlynq_linked(dev)) {
+-			printk(KERN_DEBUG
+-				"%s: using local clock divisor %d\n",
+-				dev_name(&dev->dev),
+-				dev->divisor - vlynq_ldiv1 + 1);
++		if (!__vlynq_set_clocks(dev, vlynq_clk_local, dev->divisor -
++				vlynq_ldiv1, 0)) {
++			printk(KERN_INFO
++					"%s: using local clock divisor %d\n",
++					dev_name(&dev->dev),
++					dev->divisor - vlynq_ldiv1 + 1);
+ 			return 0;
+ 		}
+ 		break;
+@@ -548,20 +583,17 @@ static int __vlynq_enable_device(struct
+ 	case vlynq_rdiv6:
+ 	case vlynq_rdiv7:
+ 	case vlynq_rdiv8:
+-		writel(0, &dev->local->control);
+-		writel(VLYNQ_CTRL_CLOCK_INT |
+-			VLYNQ_CTRL_CLOCK_DIV(dev->divisor -
+-			vlynq_rdiv1), &dev->remote->control);
+-		if (vlynq_linked(dev)) {
+-			printk(KERN_DEBUG
+-				"%s: using remote clock divisor %d\n",
+-				dev_name(&dev->dev),
+-				dev->divisor - vlynq_rdiv1 + 1);
++		if (!__vlynq_set_clocks(dev, vlynq_clk_remote, 0,
++				dev->divisor - vlynq_rdiv1)) {
++			printk(KERN_INFO
++					"%s: using remote clock divisor %d\n",
++					dev_name(&dev->dev),
++					dev->divisor - vlynq_rdiv1 + 1);
+ 			return 0;
+ 		}
+ 		break;
+ 	}
+-
++	vlynq_reset(dev);
+ 	ops->off(dev);
+ 	return -ENODEV;
+ }
+@@ -732,14 +764,14 @@ static int vlynq_probe(struct platform_d
+ 	platform_set_drvdata(pdev, dev);
+ 
+ 	printk(KERN_INFO "%s: regs 0x%p, irq %d, mem 0x%p\n",
+-	       dev_name(&dev->dev), (void *)dev->regs_start, dev->irq,
+-	       (void *)dev->mem_start);
++			dev_name(&dev->dev), (void *)dev->regs_start,
++			dev->irq, (void *)dev->mem_start);
+ 
+ 	dev->dev_id = 0;
+ 	dev->divisor = vlynq_div_auto;
+-	result = __vlynq_enable_device(dev);
+-	if (result == 0) {
++	if (!__vlynq_enable_device(dev)) {
+ 		dev->dev_id = readl(&dev->remote->chip);
++		vlynq_reset(dev);
+ 		((struct plat_vlynq_ops *)(dev->dev.platform_data))->off(dev);
+ 	}
+ 	if (dev->dev_id)
diff --git a/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch b/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch
new file mode 100644
index 0000000..4011942
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch
@@ -0,0 +1,15 @@
+--- a/arch/mips/ar7/memory.c
++++ b/arch/mips/ar7/memory.c
+@@ -66,5 +66,11 @@ void __init prom_meminit(void)
+ 
+ void __init prom_free_prom_memory(void)
+ {
+-	/* Nothing to free */
++	/* adapted from arch/mips/txx9/generic/setup.c */
++	unsigned long saddr = PHYS_OFFSET + PAGE_SIZE;
++	unsigned long eaddr = __pa_symbol(&_text);
++
++	/* free memory between prom-record and kernel _text base */
++	if (saddr < eaddr)
++		free_init_pages("prom memory", saddr, eaddr);
+ }
diff --git a/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch
new file mode 100644
index 0000000..c17ae69
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch
@@ -0,0 +1,85 @@
+--- a/arch/mips/ar7/Platform
++++ b/arch/mips/ar7/Platform
+@@ -3,4 +3,9 @@
+ #
+ platform-$(CONFIG_AR7)		+= ar7/
+ cflags-$(CONFIG_AR7)		+= -I$(srctree)/arch/mips/include/asm/mach-ar7
+-load-$(CONFIG_AR7)		+= 0xffffffff94100000
++load-$(CONFIG_AR7_TI)		+= 0xffffffff94100000
++
++#
++# AudioCodes AC49x
++#
++load-$(CONFIG_AR7_AC49X)	+= 0xffffffff945ca000
+--- a/arch/mips/ar7/setup.c
++++ b/arch/mips/ar7/setup.c
+@@ -68,6 +68,10 @@ const char *get_system_type(void)
+ 			return "TI AR7 (TNETV1056)";
+ 		case TITAN_CHIP_1060:
+ 			return "TI AR7 (TNETV1060)";
++		case TITAN_CHIP_AC495:
++			return "AudioCodes AC495";
++		case TITAN_CHIP_AC496:
++			return "AudioCodes AC496";
+ 		}
+ 	default:
+ 		return "TI AR7 (unknown)";
+--- a/arch/mips/include/asm/mach-ar7/ar7.h
++++ b/arch/mips/include/asm/mach-ar7/ar7.h
+@@ -92,6 +92,8 @@
+ #define TITAN_CHIP_1055 0x0e
+ #define TITAN_CHIP_1056 0x0d
+ #define TITAN_CHIP_1060 0x07
++#define TITAN_CHIP_AC495	0x00
++#define TITAN_CHIP_AC496	0x02
+ 
+ /* Interrupts */
+ #define AR7_IRQ_UART0	15
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -160,7 +160,7 @@ config AR7
+ 	select HAVE_CLK
+ 	help
+ 	  Support for the Texas Instruments AR7 System-on-a-Chip
+-	  family: TNETD7100, 7200 and 7300.
++	  family: TI TNETD7100, 7200, 7300 and AudioCodes AC49x.
+ 
+ config ATH25
+ 	bool "Atheros AR231x/AR531x SoC support"
+@@ -1002,6 +1002,7 @@ config MIPS_PARAVIRT
+ endchoice
+ 
+ source "arch/mips/alchemy/Kconfig"
++source "arch/mips/ar7/Kconfig"
+ source "arch/mips/ath25/Kconfig"
+ source "arch/mips/ath79/Kconfig"
+ source "arch/mips/bcm47xx/Kconfig"
+--- /dev/null
++++ b/arch/mips/ar7/Kconfig
+@@ -0,0 +1,26 @@
++if AR7
++
++config AR7_TI
++	bool
++
++config AR7_AC49X
++	bool
++
++choice
++	prompt "AR7 SoC family selection"
++	default AR7_TYPE_TI
++	depends on AR7
++	help
++	  Select AR7 MIPS SoC implementation.
++
++	config AR7_TYPE_TI
++		bool "Texas Instruments AR7"
++		select AR7_TI
++
++	config AR7_TYPE_AC49X
++		bool "AudioCodes AC49X"
++		select AR7_AC49X
++
++endchoice
++
++endif
diff --git a/target/linux/ar7/patches-4.9/310-ac49x-prom-support.patch b/target/linux/ar7/patches-4.9/310-ac49x-prom-support.patch
new file mode 100644
index 0000000..dddf221
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/310-ac49x-prom-support.patch
@@ -0,0 +1,20 @@
+--- a/arch/mips/ar7/prom.c
++++ b/arch/mips/ar7/prom.c
+@@ -70,6 +70,7 @@ struct psbl_rec {
+ };
+ 
+ static const char psp_env_version[] __initconst = "TIENV0.8";
++static const char psp_env_version_ac49x[] __initconst = "MaxENV0.2";
+ 
+ struct psp_env_chunk {
+ 	u8	num;
+@@ -186,7 +187,8 @@ static void __init ar7_init_env(struct e
+ 	struct psbl_rec *psbl = (struct psbl_rec *)(KSEG1ADDR(0x14000300));
+ 	void *psp_env = (void *)KSEG1ADDR(psbl->env_base);
+ 
+-	if (strcmp(psp_env, psp_env_version) == 0) {
++	if (strcmp(psp_env, psp_env_version) == 0 ||
++	    strcmp(psp_env, psp_env_version_ac49x) == 0) {
+ 		parse_psp_env(psp_env);
+ 	} else {
+ 		for (i = 0; i < MAX_ENTRY; i++, env++)
diff --git a/target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch b/target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch
new file mode 100644
index 0000000..fafa8c7
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch
@@ -0,0 +1,35 @@
+--- a/drivers/mtd/Kconfig
++++ b/drivers/mtd/Kconfig
+@@ -154,6 +154,11 @@ config MTD_OF_PARTS
+ 	  the partition map from the children of the flash node,
+ 	  as described in Documentation/devicetree/bindings/mtd/partition.txt.
+ 
++config MTD_AC49X_PARTS
++	tristate "AudioCodes AC49X partitioning support"
++	---help---
++	  AudioCodes AC49X partitioning support
++
+ config MTD_AR7_PARTS
+ 	tristate "TI AR7 partitioning support"
+ 	---help---
+--- a/drivers/mtd/Makefile
++++ b/drivers/mtd/Makefile
+@@ -11,6 +11,7 @@ obj-$(CONFIG_MTD_SPLIT)		+= mtdsplit/
+ obj-$(CONFIG_MTD_OF_PARTS)	+= ofpart.o
+ obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
+ obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
++obj-$(CONFIG_MTD_AC49X_PARTS)	+= ac49xpart.o
+ obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
+ obj-$(CONFIG_MTD_AR7_PARTS)	+= ar7part.o titanpart.o
+ obj-$(CONFIG_MTD_BCM63XX_PARTS)	+= bcm63xxpart.o
+--- a/arch/mips/ar7/platform.c
++++ b/arch/mips/ar7/platform.c
+@@ -201,7 +201,7 @@ static struct resource physmap_flash_res
+ 	.end	= 0x11ffffff,
+ };
+ 
+-static const char *ar7_probe_types[] = { "ar7part", NULL };
++static const char *ar7_probe_types[] = { "ac49xpart", "ar7part", NULL };
+ 
+ static struct physmap_flash_data physmap_flash_data = {
+ 	.width	= 2,
diff --git a/target/linux/ar7/patches-4.9/920-ar7part.patch b/target/linux/ar7/patches-4.9/920-ar7part.patch
new file mode 100644
index 0000000..e520af2
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/920-ar7part.patch
@@ -0,0 +1,120 @@
+--- a/drivers/mtd/ar7part.c
++++ b/drivers/mtd/ar7part.c
+@@ -30,11 +30,14 @@
+ 
+ #include <uapi/linux/magic.h>
+ 
++#include <asm/mach-ar7/prom.h>
++
+ #define AR7_PARTS	4
+ #define ROOT_OFFSET	0xe0000
+ 
+ #define LOADER_MAGIC1	le32_to_cpu(0xfeedfa42)
+ #define LOADER_MAGIC2	le32_to_cpu(0xfeed1281)
++#define LOADER_MAGIC3	le32_to_cpu(0x434d4d4c)
+ 
+ struct ar7_bin_rec {
+ 	unsigned int checksum;
+@@ -42,12 +45,16 @@ struct ar7_bin_rec {
+ 	unsigned int address;
+ };
+ 
++int create_titan_partitions(struct mtd_info *master,
++        const struct mtd_partition **pparts,
++        struct mtd_part_parser_data *data);
++
+ static int create_mtd_partitions(struct mtd_info *master,
+ 				 const struct mtd_partition **pparts,
+ 				 struct mtd_part_parser_data *data)
+ {
+ 	struct ar7_bin_rec header;
+-	unsigned int offset;
++	unsigned int offset, mtd_start, mtd_end;
+ 	size_t len;
+ 	unsigned int pre_size = master->erasesize, post_size = 0;
+ 	unsigned int root_offset = ROOT_OFFSET;
+@@ -55,6 +62,16 @@ static int create_mtd_partitions(struct
+ 	int retries = 10;
+ 	struct mtd_partition *ar7_parts;
+ 
++	const char *prom_str = prom_getenv("ProductID");
++	char mtd_name[] = "mtd1";
++	if(prom_str &&
++		(strcmp(prom_str, "CYWL")==0 ||
++		strcmp(prom_str, "CYWM")==0 ||
++		strcmp(prom_str, "CYLM")==0 ||
++		strcmp(prom_str, "CYLL")==0)){
++		return create_titan_partitions(master, pparts, data);
++	}
++
+ 	ar7_parts = kzalloc(sizeof(*ar7_parts) * AR7_PARTS, GFP_KERNEL);
+ 	if (!ar7_parts)
+ 		return -ENOMEM;
+@@ -83,34 +100,39 @@ static int create_mtd_partitions(struct
+ 
+ 	pre_size = offset;
+ 
+-	if (!ar7_parts[1].offset) {
+-		ar7_parts[1].offset = master->size - master->erasesize;
+-		post_size = master->erasesize;
+-	}
+-
+ 	switch (header.checksum) {
+-	case LOADER_MAGIC1:
+-		while (header.length) {
+-			offset += sizeof(header) + header.length;
+-			mtd_read(master, offset, sizeof(header), &len,
+-				 (uint8_t *)&header);
+-		}
+-		root_offset = offset + sizeof(header) + 4;
+-		break;
+ 	case LOADER_MAGIC2:
++		for (retries = 0; retries <= 9; retries++) {
++			mtd_name[3] = '0' + retries;
++			prom_str = prom_getenv(mtd_name);
++			if (prom_str == NULL)
++				continue;
++			sscanf(prom_str, "%i,%i", &mtd_start, &mtd_end);
++			if (pre_size == (mtd_start & 0x1ffffff)) {
++				ar7_parts[1].offset = mtd_end &= 0x1ffffff;
++				ar7_parts[1].size = post_size = master->size - mtd_end;
++				break;
++			}
++		}
++	case LOADER_MAGIC1:
++		root_offset = (header.checksum == LOADER_MAGIC1) ? 4 : 0;
+ 		while (header.length) {
+ 			offset += sizeof(header) + header.length;
+ 			mtd_read(master, offset, sizeof(header), &len,
+ 				 (uint8_t *)&header);
+ 		}
+-		root_offset = offset + sizeof(header) + 4 + 0xff;
+-		root_offset &= ~(uint32_t)0xff;
++		root_offset += offset + sizeof(header);
+ 		break;
+ 	default:
+ 		printk(KERN_WARNING "Unknown magic: %08x\n", header.checksum);
+ 		break;
+ 	}
+ 
++	if (!ar7_parts[1].offset) {
++		post_size = master->erasesize;
++		ar7_parts[1].offset = master->size - post_size;
++	}
++
+ 	mtd_read(master, root_offset, sizeof(header), &len, (u8 *)&header);
+ 	if (header.checksum != SQUASHFS_MAGIC) {
+ 		root_offset += master->erasesize - 1;
+--- a/drivers/mtd/titanpart.c
++++ b/drivers/mtd/titanpart.c
+@@ -148,8 +148,8 @@ static void titan_add_partition(char * e
+ 
+ }
+ int create_titan_partitions(struct mtd_info *master,
+-	struct mtd_partition **pparts,
+-	unsigned long origin)
++	const struct mtd_partition **pparts,
++	struct mtd_part_parser_data *data)
+ {
+ 	struct nsp_img_hdr_head		hdr;
+ 	struct nsp_img_hdr_section_info	sect_info;
diff --git a/target/linux/ar7/patches-4.9/925-actiontec_leds.patch b/target/linux/ar7/patches-4.9/925-actiontec_leds.patch
new file mode 100644
index 0000000..804dbf5
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/925-actiontec_leds.patch
@@ -0,0 +1,95 @@
+--- a/arch/mips/ar7/platform.c
++++ b/arch/mips/ar7/platform.c
+@@ -460,31 +460,22 @@ static struct gpio_led fb_fon_leds[] = {
+ 	},
+ };
+ 
+-static struct gpio_led gt701_leds[] = {
++static struct gpio_led actiontec_leds[] = {
+ 	{
+ 		.name			= "inet:green",
+ 		.gpio			= 13,
+-		.active_low		= 1,
+-	},
+-	{
+-		.name			= "usb",
+-		.gpio			= 12,
+-		.active_low		= 1,
+ 	},
+ 	{
+ 		.name			= "inet:red",
+ 		.gpio			= 9,
+-		.active_low		= 1,
+ 	},
+ 	{
+-		.name			= "power:red",
++		.name			= "power:green",
+ 		.gpio			= 7,
+-		.active_low		= 1,
+ 	},
+ 	{
+-		.name			= "power:green",
++		.name			= "power:red",
+ 		.gpio			= 8,
+-		.active_low		= 1,
+ 		.default_trigger	= "default-on",
+ 	},
+ 	{
+@@ -492,6 +483,44 @@ static struct gpio_led gt701_leds[] = {
+ 		.gpio			= 10,
+ 		.active_low		= 1,
+ 	},
++	{
++		.name			= "wifi",
++		.gpio			= 6,
++		.active_low		= 1,
++	},
++	{
++		.name			= "wifi:red",
++		.gpio			= 3,
++	},
++	{
++		.name			= "standby",
++		.gpio			= 4,
++	},
++	{
++		.name			= "wps",
++		.gpio			= 16,
++		.active_low		= 1,
++	},
++	{
++		.name			= "usb",
++		.gpio			= 12,
++		.active_low		= 1,
++	},
++	{
++		.name			= "voip",
++		.gpio			= 15,
++		.active_low		= 1,
++        },
++        {
++                .name			= "line1",
++                .gpio			= 23,
++                .active_low		= 1,
++	},
++	{
++		.name			= "line2",
++		.gpio			= 25,
++		.active_low		= 1,
++	},
+ };
+ 
+ static struct gpio_led_platform_data ar7_led_data;
+@@ -535,9 +564,9 @@ static void __init detect_leds(void)
+ 	} else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) {
+ 		ar7_led_data.num_leds = ARRAY_SIZE(titan_leds);
+ 		ar7_led_data.leds = titan_leds;
+-	} else if (strstr(prid, "GT701")) {
+-		ar7_led_data.num_leds = ARRAY_SIZE(gt701_leds);
+-		ar7_led_data.leds = gt701_leds;
++	} else if (strstr(prid, "GT7") || strstr(prid, "PK5000")) {
++		ar7_led_data.num_leds = ARRAY_SIZE(actiontec_leds);
++		ar7_led_data.leds = actiontec_leds;
+ 	}
+ }
+ 
diff --git a/target/linux/ar7/patches-4.9/950-cpmac_titan.patch b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch
new file mode 100644
index 0000000..158b689
--- /dev/null
+++ b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch
@@ -0,0 +1,52 @@
+--- a/drivers/net/ethernet/ti/cpmac.c
++++ b/drivers/net/ethernet/ti/cpmac.c
+@@ -1124,6 +1124,8 @@ static int cpmac_probe(struct platform_d
+ 		goto fail;
+ 	}
+ 
++	ar7_device_reset(pdata->reset_bit);
++
+ 	dev->irq = platform_get_irq_byname(pdev, "irq");
+ 
+ 	dev->netdev_ops = &cpmac_netdev_ops;
+@@ -1203,7 +1205,7 @@ int cpmac_init(void)
+ 	cpmac_mii->write = cpmac_mdio_write;
+ 	cpmac_mii->reset = cpmac_mdio_reset;
+ 
+-	cpmac_mii->priv = ioremap(AR7_REGS_MDIO, 256);
++	cpmac_mii->priv = ioremap(ar7_is_titan() ? TITAN_REGS_MDIO : AR7_REGS_MDIO, 256);
+ 
+ 	if (!cpmac_mii->priv) {
+ 		pr_err("Can't ioremap mdio registers\n");
+@@ -1214,10 +1216,16 @@ int cpmac_init(void)
+ 	/* FIXME: unhardcode gpio&reset bits */
+ 	ar7_gpio_disable(26);
+ 	ar7_gpio_disable(27);
+-	ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
+-	ar7_device_reset(AR7_RESET_BIT_CPMAC_HI);
++
++	if (!ar7_is_titan()) {
++		ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
++		ar7_device_reset(AR7_RESET_BIT_CPMAC_HI);
++	}
+ 	ar7_device_reset(AR7_RESET_BIT_EPHY);
+ 
++	if (ar7_is_titan())
++		ar7_device_reset(TITAN_RESET_BIT_EPHY1);
++
+ 	cpmac_mii->reset(cpmac_mii);
+ 
+ 	for (i = 0; i < 300; i++) {
+@@ -1234,7 +1242,11 @@ int cpmac_init(void)
+ 		mask = 0;
+ 	}
+ 
+-	cpmac_mii->phy_mask = ~(mask | 0x80000000);
++	if (ar7_is_titan())
++		cpmac_mii->phy_mask = ~(mask | 0x80000000 | 0x40000000);
++	else
++		cpmac_mii->phy_mask = ~(mask | 0x80000000);
++
+ 	snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "cpmac-1");
+ 
+ 	res = mdiobus_register(cpmac_mii);


From lede-commits at lists.infradead.org  Sun Oct 29 15:41:13 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 29 Oct 2017 18:41:13 -0400
Subject: [source]  acx-mac80211: allow compilation on 4.9
In-Reply-To: <20171029224106.5421.71988@git-01.infra.lede-project.org>
References: <20171029224106.5421.71988@git-01.infra.lede-project.org>
Message-ID: <mailman.57041.1509316921.26984.lede-commits@lists.infradead.org>

jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/5302abe74507cfbc46a30c119ef8dd5543f96e0f

commit 5302abe74507cfbc46a30c119ef8dd5543f96e0f
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sun Oct 29 23:27:33 2017 +0100

    acx-mac80211: allow compilation on 4.9
    
    acx-mac80211 compiles fine with 4.9, so no reason to not allow it.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 package/kernel/acx-mac80211/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile
index adca5b7..5927f17 100644
--- a/package/kernel/acx-mac80211/Makefile
+++ b/package/kernel/acx-mac80211/Makefile
@@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
 define KernelPackage/acx-mac80211
   SUBMENU:=Wireless Drivers
   TITLE:=ACX1xx mac80211 driver
-  DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel @LINUX_3_18||LINUX_4_4 +kmod-mac80211
+  DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel +kmod-mac80211
   FILES:=$(PKG_BUILD_DIR)/acx-mac80211.ko
   AUTOLOAD:=$(call AutoProbe,acx-mac80211)
   MAINTAINER:=Florian Fainelli <florian at openwrt.org>


From lede-commits at lists.infradead.org  Mon Oct 30 19:43:29 2017
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 30 Oct 2017 22:43:29 -0400
Subject: [source]  openssl: Enable assembler optimizations for aarch64
In-Reply-To: <20171031024329.21666.50292@git-01.infra.lede-project.org>
References: <20171031024329.21666.50292@git-01.infra.lede-project.org>
Message-ID: <mailman.57219.1509417963.26984.lede-commits@lists.infradead.org>

yousong pushed a commit to source.git, branch master:
https://git.lede-project.org/098afa1e1b29918c8d9d4a675464be896aadc7a1

commit 098afa1e1b29918c8d9d4a675464be896aadc7a1
Author: Baptiste Jonglez <git at bitsofnetworks.org>
AuthorDate: Fri Oct 27 20:45:53 2017 +0200

    openssl: Enable assembler optimizations for aarch64
    
    OpenSSL is built with the generic linux settings for most targets,
    including aarch64.  These generic settings are designed for 32-bit CPU and
    provide no assembler optmization: this is widely suboptimal for aarch64.
    
    This patch simply switches to the aarch64 settings that are already
    available in OpenSSL.
    
    Here is the output of "openssl speed" before the optimization, with
    "(...)" representing build flags that didn't change:
    
        OpenSSL 1.0.2l  25 May 2017
        options:bn(64,32) rc4(ptr,char) des(idx,cisc,2,int) aes(partial) blowfish(ptr)
        compiler: aarch64-openwrt-linux-musl-gcc  (...)
    
    And after this patch, OpenSSL uses 64 bit mode and assembler optimizations:
    
        OpenSSL 1.0.2l  25 May 2017
        options:bn(64,64) rc4(ptr,char) des(idx,cisc,2,int) aes(partial) blowfish(ptr)
        compiler: aarch64-openwrt-linux-musl-gcc  (...)  -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
    
    Here are some benchmarks on a pine64+ running latest LEDE master r5142-20d363aed3:
    
        before# openssl speed sha aes blowfish
        The 'numbers' are in 1000s of bytes per second processed.
        type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
        sha1              3918.89k     9982.43k    19148.03k    24933.03k    27325.78k
        sha256            4604.51k    10240.64k    17472.51k    21355.18k    22801.07k
        sha512            3662.19k    14539.41k    21443.16k    29544.11k    33177.60k
        blowfish cbc     16266.63k    16940.86k    17176.92k    17237.33k    17252.35k
        aes-128 cbc      19712.95k    21447.40k    22091.09k    22258.35k    22304.09k
        aes-192 cbc      17680.12k    19064.47k    19572.14k    19703.13k    19737.26k
        aes-256 cbc      15986.67k    17132.48k    17537.28k    17657.17k    17689.26k
    
        after# openssl speed sha aes blowfish
        type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
        sha1              6770.87k    26172.80k    86878.38k   205649.58k   345978.20k
        sha256           20913.93k    74663.85k   184658.18k   290891.09k   351032.66k
        sha512            7633.10k    30110.14k    50083.24k    71883.43k    82485.25k
        blowfish cbc     16224.93k    16933.55k    17173.76k    17234.94k    17252.35k
        aes-128 cbc      19425.74k    21193.31k    22065.74k    22304.77k    22380.54k
        aes-192 cbc      17452.29k    18883.84k    19536.90k    19741.70k    19800.06k
        aes-256 cbc      15815.89k    17003.01k    17530.03k    17695.40k    17746.60k
    
    For some reason AES and blowfish do not benefit, but SHA performance
    improves between 1.7x and 15x.  SHA256 clearly benefits the most from the
    optimization (4.5x on small blocks, 15x on large blocks!).
    
    When using EVP (with "openssl speed -evp <algo>"):
    
        # Before, EVP mode
        type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
        sha1              3824.46k    10049.66k    19170.56k    24947.03k    27325.78k
        sha256            3368.33k     8511.15k    16061.44k    20772.52k    22721.88k
        sha512            2845.23k    11381.57k    19467.69k    28512.26k    33008.30k
        bf-cbc           15146.74k    16623.83k    17092.01k    17211.39k    17249.62k
        aes-128-cbc      17873.03k    20870.61k    21933.65k    22216.36k    22301.35k
        aes-192-cbc      16184.18k    18607.15k    19447.13k    19670.02k    19737.26k
        aes-256-cbc      14774.06k    16757.25k    17457.58k    17639.42k    17686.53k
    
        # After, EVP mode
        type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
        sha1              7056.97k    27142.10k    89515.86k   209155.41k   347419.99k
        sha256            7745.70k    29750.06k    95341.48k   211001.69k   332376.75k
        sha512            4550.47k    18086.06k    39997.10k    65880.75k    81431.21k
        bf-cbc           15129.20k    16619.03k    17090.56k    17212.76k    17246.89k
        aes-128-cbc      99619.74k   269032.34k   450214.23k   567353.00k   613933.06k
        aes-192-cbc      93180.74k   231017.79k   361766.66k   433671.51k   461731.16k
        aes-256-cbc      89343.23k   209858.58k   310160.04k   362234.88k   380878.85k
    
    Blowfish does not seem to have assembler optimization at all, and SHA
    still benefits (between 1.6x and 14.5x) but is generally slower than in
    non-EVP mode.
    
    However, AES performance is improved between 5.5x and 27.5x, which is
    really impressive!  For aes-128-cbc on large blocks, a core i7-6600U
    @2.60GHz is only twice as fast...
    
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
---
 package/libs/openssl/Makefile                            | 4 +++-
 package/libs/openssl/patches/110-optimize-for-size.patch | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 7707c19..d7037cb 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=openssl
 PKG_BASE:=1.0.2
 PKG_BUGFIX:=l
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_USE_MIPS16:=0
 
 PKG_BUILD_PARALLEL:=0
@@ -161,6 +161,8 @@ else
   OPENSSL_OPTIONS+=no-sse2
   ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y)
     OPENSSL_TARGET:=linux-mips-openwrt
+  else ifeq ($(CONFIG_aarch64),y)
+    OPENSSL_TARGET:=linux-aarch64-openwrt
   else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y)
     OPENSSL_TARGET:=linux-armv4-openwrt
   else
diff --git a/package/libs/openssl/patches/110-optimize-for-size.patch b/package/libs/openssl/patches/110-optimize-for-size.patch
index 0f174a3..d6d4a21 100644
--- a/package/libs/openssl/patches/110-optimize-for-size.patch
+++ b/package/libs/openssl/patches/110-optimize-for-size.patch
@@ -1,11 +1,12 @@
 --- a/Configure
 +++ b/Configure
-@@ -470,6 +470,12 @@ my %table=(
+@@ -470,6 +470,13 @@ my %table=(
  "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
  "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
  
 +# OpenWrt targets
 +"linux-armv4-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-aarch64-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 +"linux-x86_64-openwrt",	"gcc:-m64 -DL_ENDIAN -DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
 +"linux-mips-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 +"linux-generic-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",


