[LEDE-DEV] [PATCH] busybox: update to version 1.25.0

2016-09-18 Thread Hauke Mehrtens
cd config
../convert_menuconfig.pl .../build_dir/target-*/busybox-1.25.0
cd ..
./convert_defaults.pl < .../build_dir/target-*/busybox-1.25.0/.config > 
Config-defaults.in

Signed-off-by: Hauke Mehrtens 
---
 package/utils/busybox/Config-defaults.in   | 169 +
 package/utils/busybox/Makefile |   4 +-
 package/utils/busybox/config/Config.in |  22 +++
 package/utils/busybox/config/archival/Config.in|  29 ++--
 package/utils/busybox/config/coreutils/Config.in   |  39 +++--
 package/utils/busybox/config/debianutils/Config.in |   5 -
 package/utils/busybox/config/e2fsprogs/Config.in   |  34 ++---
 package/utils/busybox/config/init/Config.in|  49 +++---
 package/utils/busybox/config/libbb/Config.in   |  48 --
 package/utils/busybox/config/loginutils/Config.in  | 112 +++---
 package/utils/busybox/config/miscutils/Config.in   |  22 ++-
 package/utils/busybox/config/modutils/Config.in|   3 -
 package/utils/busybox/config/networking/Config.in  |  15 +-
 package/utils/busybox/config/printutils/Config.in  |   2 -
 package/utils/busybox/config/runit/Config.in   |  65 
 package/utils/busybox/config/sysklogd/Config.in| 121 +++
 package/utils/busybox/config/util-linux/Config.in  |  45 --
 .../busybox/config/util-linux/volume_id/Config.in  |   8 +
 .../busybox/patches/001-resource_h_include.patch   |   2 +-
 ...fix-uninitialized-memory-when-displaying-.patch |  23 ---
 ...libiproute-fix-displaying-route-table-for.patch |   2 +-
 ...lem-on-mips64-n64-big-endian-musl-systems.patch |  75 -
 .../patches/120-remove_uclibc_rpc_check.patch  |   2 +-
 .../busybox/patches/200-udhcpc_reduce_msgs.patch   |   8 +-
 .../patches/201-udhcpc_changed_ifindex.patch   |   2 +-
 .../patches/203-udhcpc_renew_no_deconfig.patch |   2 +-
 .../busybox/patches/204-udhcpc_src_ip_rebind.patch |  51 ---
 .../busybox/patches/210-add_netmsg_util.patch  |   4 +-
 .../utils/busybox/patches/220-add_lock_util.patch  |  16 +-
 .../busybox/patches/230-ntpd_delayed_resolve.patch |  48 --
 .../utils/busybox/patches/240-telnetd_intr.patch   |   2 +-
 .../utils/busybox/patches/250-date-k-flag.patch|  12 +-
 32 files changed, 482 insertions(+), 559 deletions(-)
 delete mode 100644 
package/utils/busybox/patches/010-networking-fix-uninitialized-memory-when-displaying-.patch
 delete mode 100644 
package/utils/busybox/patches/030-ip-fix-problem-on-mips64-n64-big-endian-musl-systems.patch
 delete mode 100644 package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch
 delete mode 100644 package/utils/busybox/patches/230-ntpd_delayed_resolve.patch

diff --git a/package/utils/busybox/Config-defaults.in 
b/package/utils/busybox/Config-defaults.in
index 105a3fc..11cce03 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -34,6 +34,9 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE
 config BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE
bool
default y
+config BUSYBOX_DEFAULT_BUSYBOX
+   bool
+   default n
 config BUSYBOX_DEFAULT_FEATURE_INSTALLER
bool
default n
@@ -166,6 +169,9 @@ config BUSYBOX_DEFAULT_DEBUG
 config BUSYBOX_DEFAULT_DEBUG_PESSIMIZE
bool
default n
+config BUSYBOX_DEFAULT_DEBUG_SANITIZE
+   bool
+   default n
 config BUSYBOX_DEFAULT_UNIT_TEST
bool
default n
@@ -205,7 +211,7 @@ config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER
 config BUSYBOX_DEFAULT_PREFIX
string
default "./_install"
-config BUSYBOX_DEFAULT_FEATURE_SYSTEMD
+config BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL
bool
default n
 config BUSYBOX_DEFAULT_FEATURE_RTMINMAX
@@ -313,6 +319,9 @@ config BUSYBOX_DEFAULT_UNCOMPRESS
 config BUSYBOX_DEFAULT_GUNZIP
bool
default y
+config BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS
+   bool
+   default n
 config BUSYBOX_DEFAULT_BUNZIP2
bool
default y
@@ -460,6 +469,15 @@ config BUSYBOX_DEFAULT_GROUPS
 config BUSYBOX_DEFAULT_SHUF
bool
default n
+config BUSYBOX_DEFAULT_STAT
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT
+   bool
+   default n
+config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM
+   bool
+   default n
 config BUSYBOX_DEFAULT_SYNC
bool
default y
@@ -733,12 +751,6 @@ config BUSYBOX_DEFAULT_SPLIT
 config BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY
bool
default n
-config BUSYBOX_DEFAULT_STAT
-   bool
-   default n
-config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT
-   bool
-   default n
 config BUSYBOX_DEFAULT_STTY
bool
default n
@@ -1117,6 +1129,9 @@ config BUSYBOX_DEFAULT_TELINIT_PATH
 config BUSYBOX_DEFAULT_INIT
bool
default n
+config BUSYBOX_DEFAULT_LINUXRC
+   bool
+   default n
 config BUSYBOX_DEFAULT_FEATURE_USE_INITTAB
bool
default n
@@ -1138,22 +1153,16 @@ 

Re: [LEDE-DEV] [PATCH v2 2/2] ar71xx: Do not use a hardcoded ath10k firmware mac address

2016-09-18 Thread Martin Blumenstingl
On Sun, Sep 18, 2016 at 11:29 PM, Martin Blumenstingl
 wrote:
> ar71xx has an init-script for special devices where the ath10k OTP
> calibration data is stored on the PCIe card's EEPROM (and thus can only
> be read by ath10k). Unfortunately the OTP data uses the default mac
> address (= all devices come with the same mac address, which leads to
> problems when you have multiple of these devices in the same network).
>
> To work around this the mac address is patched in the firmware during
> the first boot of the device. To prevent flash wear this was only done
> if the ath10k firmware matched a hardcoded md5sum.
> However, if the md5sum does not match this can mean that either the mac
> address was already patched (which is fine) - unfortunately it can also
> mean that the firmware version was updated without updating the
> hardcoded md5sum.
>
> Change the "was the mac address already patched" check to actually
> compare the mac address inside the ath10k firmware.
>
> Signed-off-by: Martin Blumenstingl 
> ---
>  .../linux/ar71xx/base-files/lib/preinit/82_patch_ath10k | 17 
> ++---
>  1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k 
> b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
> index af12bd5..b6af921 100644
> --- a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
> +++ b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
> @@ -12,16 +12,19 @@ do_patch_ath10k_firmware() {
> return
> }
>
> -   local firmware_md5_orig="fcb2fbd42d73a63fbf603505c718cbde"
> -   local firmware_md5_current="$(md5sum $firmware_file)"
> -   local firmware_md5_current="${firmware_md5_current%% *}"
> +   local mac_offset=276
> +   local mac_length=6
> +   local default_mac="00:03:07:12:34:56"
> +   local current_mac="$(hexdump -v -n $mac_length -s $mac_offset -e '5/1 
> "%02x:" 1/1 "%02x"' $firmware_file  2>/dev/null)"
>
> -   # verify md5sum before patching
> -   [ "$firmware_md5_orig" != "$firmware_md5_current" ] || {
> +   # check if mac address was already patched
> +   [ "$default_mac" = "$current_mac" ] || {
> return
> }
>
> -   # some boards have bogus mac in otp, patch the default mac in the 
> firmware
> +   # some boards have bogus mac in otp (= directly in the PCIe card's 
> EEPROM).
> +   # we have to patch the default mac in the firmware because we cannot 
> change
> +   # the otp.
> case $(ar71xx_board_name) in
> dgl-5500-a1 | tew-823dru)
I should mention that I do not have access to any of these devices,
thus I cannot test this properly.
So it would be great if someone with access to any of these devices
could give it a try.

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2 2/2] ar71xx: Do not use a hardcoded ath10k firmware mac address

2016-09-18 Thread Martin Blumenstingl
ar71xx has an init-script for special devices where the ath10k OTP
calibration data is stored on the PCIe card's EEPROM (and thus can only
be read by ath10k). Unfortunately the OTP data uses the default mac
address (= all devices come with the same mac address, which leads to
problems when you have multiple of these devices in the same network).

To work around this the mac address is patched in the firmware during
the first boot of the device. To prevent flash wear this was only done
if the ath10k firmware matched a hardcoded md5sum.
However, if the md5sum does not match this can mean that either the mac
address was already patched (which is fine) - unfortunately it can also
mean that the firmware version was updated without updating the
hardcoded md5sum.

Change the "was the mac address already patched" check to actually
compare the mac address inside the ath10k firmware.

Signed-off-by: Martin Blumenstingl 
---
 .../linux/ar71xx/base-files/lib/preinit/82_patch_ath10k | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k 
b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
index af12bd5..b6af921 100644
--- a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
+++ b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k
@@ -12,16 +12,19 @@ do_patch_ath10k_firmware() {
return
}
 
-   local firmware_md5_orig="fcb2fbd42d73a63fbf603505c718cbde"
-   local firmware_md5_current="$(md5sum $firmware_file)"
-   local firmware_md5_current="${firmware_md5_current%% *}"
+   local mac_offset=276
+   local mac_length=6
+   local default_mac="00:03:07:12:34:56"
+   local current_mac="$(hexdump -v -n $mac_length -s $mac_offset -e '5/1 
"%02x:" 1/1 "%02x"' $firmware_file  2>/dev/null)"
 
-   # verify md5sum before patching
-   [ "$firmware_md5_orig" != "$firmware_md5_current" ] || {
+   # check if mac address was already patched
+   [ "$default_mac" = "$current_mac" ] || {
return
}
 
-   # some boards have bogus mac in otp, patch the default mac in the 
firmware
+   # some boards have bogus mac in otp (= directly in the PCIe card's 
EEPROM).
+   # we have to patch the default mac in the firmware because we cannot 
change
+   # the otp.
case $(ar71xx_board_name) in
dgl-5500-a1 | tew-823dru)
local mac
@@ -29,7 +32,7 @@ do_patch_ath10k_firmware() {
 
cp $firmware_file /tmp/ath10k-firmware.bin
macaddr_2bin $mac | dd of=/tmp/ath10k-firmware.bin \
-   conv=notrunc bs=1 seek=276 count=6
+   conv=notrunc bs=1 seek=$mac_offset 
count=$mac_length
 
;;
esac
-- 
2.9.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2 1/2] ath10k-firmware: update the qca988x firmware to 10.2.4.70.54

2016-09-18 Thread Martin Blumenstingl
Use firmware version 10.2.4.70.54 from kvalo's git repository. The old
version (even though it's version number is greater) is an old version
from September 2015.
Using only the firmware versions from kvalo's git repo is recommended,
because those are tested by QCA's internal QCA.

The QCA988X directory received a small reorganization as a "hw2.0"
subdirectory was added - this patch also takes care of that as
board.bin was moved to that subdirectory.

Signed-off-by: Martin Blumenstingl 
---
 package/firmware/ath10k-firmware/Makefile | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile 
b/package/firmware/ath10k-firmware/Makefile
index 624da6a..d393240 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ath10k-firmware
-PKG_SOURCE_VERSION:=b00eb8d30fbebb6a5047ccacefa8c37e072fca9c
-PKG_VERSION:=2014-11-13-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=307cb46b06661ebd3186723b5002de769c7add83
+PKG_VERSION:=2016-09-13-$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
@@ -66,18 +66,10 @@ $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA988x devices
 endef
 
-QCA988X_FIRMWARE_FILE:=firmware-5.bin_10.2.4.97-1
 QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-16.1.bin-lede
 QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-7.bin-lede.004
 QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-7.bin-lede.004
 
-define Download/ath10k-firmware-qca988x
-  
URL:=https://www.codeaurora.org/cgit/quic/qsdk/oss/firmware/ath10k-firmware/plain/10.2.4/
-  FILE:=$(QCA988X_FIRMWARE_FILE)
-  MD5SUM:=fcb2fbd42d73a63fbf603505c718cbde
-endef
-$(eval $(call Download,ath10k-firmware-qca988x))
-
 define Download/ath10k-firmware-qca988x-ct
   URL:=https://www.candelatech.com/downloads/
   FILE:=$(QCA988X_FIRMWARE_FILE_CT)
@@ -188,17 +180,17 @@ endef
 define Package/ath10k-firmware-qca988x/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
-   $(PKG_BUILD_DIR)/QCA988X/board.bin \
+   $(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
$(INSTALL_DATA) \
-   $(DL_DIR)/$(QCA988X_FIRMWARE_FILE) \
+   
$(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4.70/firmware-5.bin_10.2.4.70.54 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
 endef
 
 define Package/ath10k-firmware-qca988x-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
-   $(PKG_BUILD_DIR)/QCA988X/board.bin \
+   $(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA988X_FIRMWARE_FILE_CT) \
-- 
2.9.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2 0/2] update QCA988X ath10k-firmware to the latest version

2016-09-18 Thread Martin Blumenstingl
According to Kalle Valo (on the OpenWrt mailing list, see [0]) only
firmware binaries from his repository are tested by QCA's internal QA
team.

Additionally he pointed out that the version used in LEDE so far is
from September 2015, despite having a newer version number than the
current "stable" version (10.2.4.70.54).

This updates the firmware for the QCA988X chips to the latest version
available in his repository (meaning the latest stable version).

As a side-note: this should (theoretically) add 802.11s (mesh)
support to the firmware. However, at least for some OpenWrt users this
does not work out-of-the-box.

I have tested this for a few minutes, but maybe we can let this live in
Felix' tree for a few days to get test results from other people as
well.

Changes since v1:
- squashed patch 2 as it only updated the ath10k PKG_VERSION
- fixed building of the qca988x-ct firmware as board.bin is taken from
  kvalo's repo, which means the location also has to be updated
- added a new patch to remove the hardcoded ath10k firmware mac address
  in a script which is required on some ar71xx boards


[0] https://lists.openwrt.org/pipermail/openwrt-devel/2016-September/042162.html

Martin Blumenstingl (2):
  ath10k-firmware: update the qca988x firmware to 10.2.4.70.54
  ar71xx: Do not use a hardcoded ath10k firmware mac address

 package/firmware/ath10k-firmware/Makefile  | 18 +-
 .../ar71xx/base-files/lib/preinit/82_patch_ath10k  | 17 ++---
 2 files changed, 15 insertions(+), 20 deletions(-)

-- 
2.9.3


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] ath10k-firmware: move to firmware section in buildroot

2016-09-18 Thread Stijn Segers
This patch moves the ath10k firmware packages to the firmware submenu
in the buildroot, where it belongs.

Signed-off-by: Stijn Segers 
---
 package/firmware/ath10k-firmware/Makefile | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/package/firmware/ath10k-firmware/Makefile 
b/package/firmware/ath10k-firmware/Makefile
index 624da6a..86f48d3 100644
--- a/package/firmware/ath10k-firmware/Makefile
+++ b/package/firmware/ath10k-firmware/Makefile
@@ -21,11 +21,9 @@ PKG_MAINTAINER:=Felix Fietkau 
 
 include $(INCLUDE_DIR)/package.mk
 
-WMENU:=Wireless Drivers
-
 define Package/ath10k-firmware-default
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
+  SECTION:=firmware
+  CATEGORY:=Firmware
   SUBMENU:=$(WMENU)
   URL:=$(PKG_SOURCE_URL)
   DEPENDS:=
@@ -64,6 +62,8 @@ define Package/ath10k-firmware-qca988x
 $(Package/ath10k-firmware-default)
   DEFAULT:=PACKAGE_kmod-ath10k
   TITLE:=ath10k firmware for QCA988x devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 QCA988X_FIRMWARE_FILE:=firmware-5.bin_10.2.4.97-1
@@ -102,11 +102,15 @@ $(eval $(call Download,ath10k-firmware-qca9984-ct))
 define Package/ath10k-firmware-qca99x0
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA99x0 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca988x-ct
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k CT 10.1 firmware for QCA988x devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca988x-ct/description
@@ -143,21 +147,29 @@ endef
 define Package/ath10k-firmware-qca99x0-ct
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k CT 10.4.3 firmware for QCA99x0 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca9984-ct
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k CT 10.4.3 firmware for QCA9984 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca9984
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA9984 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 define Package/ath10k-firmware-qca6174
 $(Package/ath10k-firmware-default)
   TITLE:=ath10k firmware for QCA6174 devices
+  SECTION:=firmware
+  CATEGORY:=Firmware
 endef
 
 QCA99X0_BOARD_REV:=ddcec9efd245da9365c474f513a855a55f3ac7fe
-- 
2.1.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] hostapd: 420-indicate-features.patch

2016-09-18 Thread e9hack
Hi,

420-indicate-features.patch doesn't work for hostapd full. The Makefile in
hostapd-full/hostapd--xx-xx/hostapd doesn't define IEEE8021X_EAPOL or 
IEEE80211N
depend on configuration. Luci usese 'hostapd -veap' to check if an external 
radius server
is supported. It will be evaluate only, if IEEE8021X_EAPOL is defined. The 
usage of
IEEE8021X_EAPOL for 'hostapd -veap' seems to be wrong, because IEEE8021X_EAPOL 
must be
set, if the internal radius server is used. It isn't necessary for the external 
radius server.

Regards,
Hartmut

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH ubox] getrandom: Define SYS_getrandom if no definition exists

2016-09-18 Thread Florian Fainelli
Le 18/09/2016 à 12:06, Etienne Champetier a écrit :
> (Answering from my phone with gmail so this email is in HTML and will
> get bounced by the ML)
> 
> Le 18 sept. 2016 14:03, "John Crispin"  > a écrit :
>>
>>
>>
>> On 18/09/2016 02:13, Florian Fainelli wrote:
>> > Le 17/09/2016 à 16:49, Etienne Champetier a écrit :
>> >> Hi Florian,
>> >>
>> >> What is your use case?
>> >
>> > Pre-built toolchain which ships with kernel headers 3.8 at the moment.
>> >
>> >> If you run it on kernel less than 3.17 this will then fail at run
> time ...
>> >
>> > I run a kernel newer than 3.17, but that's a good point.
>> >
>> >> I would prefer to not compile it instead of having an unusable binary
>> >
>> > Ok, so something more like that:
> 
> I still doesn't understand why getrandom isn't built with target kernel
> headers
> All LEDE targets are using linux 4.4 and OpenWRT targets are 3.18+, so
> this feels like the wrong fix for me

I am using an external toolchain which ships with kernel headers 3.8,
and anybody building an external toolchain in OpenWrt may run into a
similar problem.

Irrespective of the kernel version, since the system call is not present
in all kernel versions, testing for its presence does not hurt.

Besides that, people may end up backporting a newer user-space to run
with an older kernel that is pre 3.17, making things robust and testing
for what you use in your application is a good practice that has years
of precedence (autotols would not exist otherwise).
-- 
Florian

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] xburst (Ingenic XBurst): update to kernel 4.4, please test

2016-09-18 Thread Hauke Mehrtens
Hi,

I updated the xburst target to kernel 4.4 in this branch:
https://git.lede-project.org/?p=lede/hauke/staging.git;a=shortlog;h=refs/heads/kernel-4.4

If you have any device supported by this target please test it and
report back if the xburst target is still working with kernel 4.4 like
with the old kernel or if you see new problems. Please report back if it
worked and if it does not work. I only compile tested this because I do
not have this hardware.

Having the target at kennel 4.4 is a requirement to get it into the next
release.

Hauke

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] ppc44x (AMCC/IBM PPC44x): update to kernel 4.4, please test

2016-09-18 Thread Hauke Mehrtens
Hi,

I updated the ppc44x target to kernel 4.4 in this branch:
https://git.lede-project.org/?p=lede/hauke/staging.git;a=shortlog;h=refs/heads/kernel-4.4

If you have any device supported by this target please test it and
report back if the ppc44x target is still working with kernel 4.4 like
with the old kernel or if you see new problems. Please report back if it
worked and if it does not work. I only compile tested this because I do
not have this hardware.

Having the target at kennel 4.4 is a requirement to get it into the next
release.

Hauke

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] rb532 (Mikrotik RouterBoard 532): update to kernel 4.4, please test

2016-09-18 Thread Hauke Mehrtens
Hi,

I updated the rb532 target to kernel 4.4 in this branch:
https://git.lede-project.org/?p=lede/hauke/staging.git;a=shortlog;h=refs/heads/kernel-4.4

If you have any device supported by this target please test it and
report back if the rb532 target is still working with kernel 4.4 like
with the old kernel or if you see new problems. Please report back if it
worked and if it does not work. I only compile tested this because I do
not have this hardware.

Having the target at kennel 4.4 is a requirement to get it into the next
release.

Hauke

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] ar7 (TI AR7): update to kernel 4.4, please test

2016-09-18 Thread Hauke Mehrtens
Hi,

I updated the ar7 target to kernel 4.4 in this branch:
https://git.lede-project.org/?p=lede/hauke/staging.git;a=shortlog;h=refs/heads/kernel-4.4

If you have any device supported by this target please test it and
report back if the ar7 target is still working with kernel 4.4 like
with the old kernel or if you see new problems. Please report back if it
worked and if it does not work. I only compile tested this because I do
not have this hardware.

Having the target at kennel 4.4 is a requirement to get it into the next
release.

Hauke

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] mcs814x (Moschip MCS814x): update to kernel 4.4, please test

2016-09-18 Thread Hauke Mehrtens
Hi,

I updated the mcs814x target to kernel 4.4 in this branch:
https://git.lede-project.org/?p=lede/hauke/staging.git;a=shortlog;h=refs/heads/kernel-4.4

If you have any device supported by this target please test it and
report back if the mcs814x target is still working with kernel 4.4 like
with the old kernel or if you see new problems. Please report back if it
worked and if it does not work. I only compile tested this because I do
not have this hardware.

Having the target at kennel 4.4 is a requirement to get it into the next
release.

Hauke

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2 3/3] ar71xx: add support for Cisco Meraki Z1 Cloud Managed Teleworker Gateway

2016-09-18 Thread Chris Blake
This patch adds support for Cisco's Z1.
Detailed instructions for the flashing the device can
be found in the OpenWrt wiki:


Signed-off-by: Chris Blake 
---
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 +
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  20 +++
 .../etc/uci-defaults/03_network-switchX-migration  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   4 +
 .../ar71xx/base-files/lib/upgrade/merakinand.sh|  61 ++--
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   6 +-
 target/linux/ar71xx/config-4.4 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  12 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-z1.c   | 164 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/nand.mk  |  23 +++
 .../818-MIPS-ath79-add-nu801-led-driver.patch  |   2 +-
 16 files changed, 293 insertions(+), 19 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index cf05859..7551455 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -813,6 +813,10 @@ wzr-hp-g300nh)
ucidef_set_led_usbdev "usb" "USB" "buffalo:blue:usb" "1-1"
;;

+z1)
+   ucidef_set_led_netdev "wlan1" "WLAN1" "z1:blue:tricolor0" "wlan1"
+   ;;
+
 zbt-we1526)
ucidef_set_led_netdev "wan" "WAN" "zbt-we1526:green:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "zbt-we1526:green:lan1" "switch0" 
"0x10"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index b637113..2a50c9d 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -538,6 +538,12 @@ wndr3700)
ucidef_add_switch_port_attr "switch0" 5 led 2
;;

+z1)
+   ucidef_set_interfaces_lan_wan "eth0" "eth1"
+   ucidef_add_switch "switch0" \
+   "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4" "5:wan"
+   ;;
+
 *)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 69ef609..6ce49b0 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -426,6 +426,9 @@ get_status_led() {
wrt160nl)
status_led="wrt160nl:blue:wps"
;;
+   z1)
+   status_led="z1:green:tricolor0"
+   ;;
zbt-we1526)
status_led="zbt-we1526:green:status"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 3b0229d..3141625 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -73,6 +73,16 @@ case "$FIRMWARE" in
ath9k_eeprom_extract "caldata" 4096 2048
ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 0)
;;
+   z1)
+   . /lib/upgrade/nand.sh
+
+   if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
+   ath9k_ubi_eeprom_extract "caldata" 4096 2048
+   else
+   ath9k_eeprom_extract "origcaldata" 4096 2048
+   fi
+   ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi 
board-config 102) +2)
+   ;;
*)
ath9k_eeprom_die "board $board is not supported yet"
;;
@@ -100,6 +110,16 @@ case "$FIRMWARE" in
ath9k_eeprom_extract "caldata" 20480 2048
ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 12)
;;
+   z1)
+   . /lib/upgrade/nand.sh
+
+   if [ -n "$(nand_find_volume ubi0 caldata)" ]; then
+   ath9k_ubi_eeprom_extract "caldata" 86016 4096
+   else
+   ath9k_eeprom_extract "origcaldata" 86016 4096
+   fi
+   ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi 
board-config 102) +3)
+   ;;
*)
ath9k_eeprom_die "board $board is not supported yet"
;;
diff --git 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration 
b/target/linux/ar71xx/base-files/etc/uci-defau

[LEDE-DEV] [PATCH v2 0/3] Add support for Cisco Meraki Z1

2016-09-18 Thread Chris Blake
This patch group adds support for the Cisco Meraki Z1 Teleworker Gateway unit.
More info can be found at https://wiki.openwrt.org/toh/meraki/z1

V2 changes, as requested:
* Move owl-loader to package/kernel/linux/modules/other

V1 discussions are at 
http://lists.infradead.org/pipermail/lede-dev/2016-September/002611.html

Cc: Christian Lamparter 
Signed-off-by: Chris Blake 

Chris Blake (1):
  ar71xx: add support for Cisco Meraki Z1 Cloud Managed Teleworker
Gateway

Christian Lamparter (2):
  firmware-utils mkmerakifw-old: firmware generator for Z1
  kernel: owl-loader for delayed Atheros ath9k fixup

 package/kernel/linux/modules/other.mk  |  21 ++
 target/linux/ar71xx/base-files/etc/board.d/01_leds |   4 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 +
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom |  20 ++
 .../etc/uci-defaults/03_network-switchX-migration  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../base-files/lib/preinit/05_set_iface_mac_ar71xx |   4 +
 .../ar71xx/base-files/lib/upgrade/merakinand.sh|  61 +++-
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   6 +-
 target/linux/ar71xx/config-4.4 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  12 +
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-z1.c   | 164 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/nand.mk  |  23 ++
 .../818-MIPS-ath79-add-nu801-led-driver.patch  |   2 +-
 .../linux/generic/files/drivers/misc/owl-loader.c  | 246 ++
 .../generic/patches-4.4/835-misc-owl_loader.patch  |  31 ++
 tools/firmware-utils/Makefile  |   1 +
 tools/firmware-utils/src/mkmerakifw-old.c  | 369 +
 21 files changed, 961 insertions(+), 19 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c
 create mode 100644 target/linux/generic/files/drivers/misc/owl-loader.c
 create mode 100644 target/linux/generic/patches-4.4/835-misc-owl_loader.patch
 create mode 100644 tools/firmware-utils/src/mkmerakifw-old.c

--
2.7.4

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2 1/3] firmware-utils mkmerakifw-old: firmware generator for Z1

2016-09-18 Thread Chris Blake
From: Christian Lamparter 

This patch adds firmware generation tool for Cisco's Z1

Signed-off-by: Christian Lamparter 
---
 tools/firmware-utils/Makefile |   1 +
 tools/firmware-utils/src/mkmerakifw-old.c | 369 ++
 2 files changed, 370 insertions(+)
 create mode 100644 tools/firmware-utils/src/mkmerakifw-old.c

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index f4a5222..803ada4 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -74,6 +74,7 @@ define Host/Compile
$(call cc,dgn3500sum)
$(call cc,edimax_fw_header, -Wall)
$(call cc,mkmerakifw sha1, -Wall)
+   $(call cc,mkmerakifw-old, -Wall)
$(call cc,jcgimage, -lz -Wall)
 endef

diff --git a/tools/firmware-utils/src/mkmerakifw-old.c 
b/tools/firmware-utils/src/mkmerakifw-old.c
new file mode 100644
index 000..01b9b31
--- /dev/null
+++ b/tools/firmware-utils/src/mkmerakifw-old.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright (C) 2015 Thomas Hebb 
+ * Copyright (C) 2016 Christian Lamparter 
+ *
+ * The format of the header this tool generates was first documented by
+ * Chris Blake  in a shell script of the
+ * same purpose. I have created this reimplementation at his request. The
+ * original script can be found at:
+ * 
+ *
+ * Support for the old header format, which is used by the Cisco Z1 AP
+ * has been reverse engineered from the nandloader's nand_load_bk function.
+ * The original code is part of Cisco's GPL code and can be found at:
+ * 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define PADDING_BYTE   0xff
+
+#define HDR_LENGTH 0x0020
+#define HDR_OFF_MAGIC1 0
+#define HDR_OFF_LOAD_ADDR  4
+#define HDR_OFF_IMAGELEN   8
+#define HDR_OFF_ENTRY  12
+#define HDR_OFF_CHECKSUM   16
+#define HDR_OFF_FILLER020
+#define HDR_OFF_FILLER124
+#define HDR_OFF_FILLER228
+
+struct board_info {
+   char *id;
+   char *description;
+   uint32_t magic;
+   uint32_t imagelen;
+   uint32_t load_addr;
+   uint32_t entry;
+};
+
+/*
+ * Globals
+ */
+static char *progname;
+static bool strip_padding;
+
+static char *board_id;
+static const struct board_info *board;
+
+static const struct board_info boards[] = {
+   {
+   .id = "z1",
+   .description= "Meraki Z1 Access Point",
+   .magic  = 0x4d495053,
+   .imagelen   = 0x007e,
+   .load_addr  = 0x8006,
+   .entry  = 0x8006
+   }, {
+   /* terminating entry */
+   }
+};
+
+/*
+ * 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 "\n", \
+   progname, ## __VA_ARGS__, strerror(save)); \
+} while (0)
+
+static const struct board_info *find_board(const char *id)
+{
+   const struct board_info *ret;
+   const 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 void usage(int status)
+{
+   FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+   const struct board_info *board;
+
+   fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+   fprintf(stream,
+"\n"
+"Options:\n"
+"  -B   create image for the board specified with \n"
+"  -iread kernel image from the file \n"
+"  -owrite output to the file \n"
+"  -s  strip padding from the end of the image\n"
+"  -h  show this screen\n"
+   );
+
+   fprintf(stream, "\nBoards:\n");
+   for (board = boards; board->id != NULL; board++)
+   fprintf(stream, "  %-16s%s\n", board->id, board->description);
+
+   exit(status);
+}
+
+static void writel(unsigned char *buf, size_t offset, uint32_t value)
+{
+   value = htobe32(value);
+   memcpy(buf + offset, &value, sizeof(uint32_t));
+}
+
+static const uint32_t crc32_table[] = {
+   0x, 0x77073096, 0xee0e612c, 0x990951ba,
+   0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
+   0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+   0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
+   

[LEDE-DEV] [PATCH v2 2/3] kernel: owl-loader for delayed Atheros ath9k fixup

2016-09-18 Thread Chris Blake
From: Christian Lamparter 

Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway)
need to be able to initialize the PCIe wifi device. Normally, this is done
during the early stages of booting linux, because the necessary init code
is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup.
However,this isn't possible for devices which have the init code for the
Atheros chip stored on NAND in an UBI volume. Hence, this module can be
used to initialze the chip when the user-space is ready to extract the
init code.

Martin Blumenstingl made a few fixes and added support for lantiq:
kernel: owl-loader: add support for OWL emulation PCI devices
kernel: owl-loader: don't re-scan the bus when ath9k_pci_fixup failed
kernel: owl-loader: use dev_* instead of pr_* logging functions
kernel: owl-loader: auto-generate the eeprom filename as fallback
kernel: owl-loader: add a debug message when swapping the eeprom data
kernel: owl-loader: add missing newlines in log messages
kernel: owl-loader: add support for the lantiq platform

These patches have been integrated. Thanks!

Signed-off-by: Martin Blumenstingl 
Signed-off-by: Christian Lamparter 
---
 package/kernel/linux/modules/other.mk  |  21 ++
 .../linux/generic/files/drivers/misc/owl-loader.c  | 246 +
 .../generic/patches-4.4/835-misc-owl_loader.patch  |  31 +++
 3 files changed, 298 insertions(+)
 create mode 100644 target/linux/generic/files/drivers/misc/owl-loader.c
 create mode 100644 target/linux/generic/patches-4.4/835-misc-owl_loader.patch

diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index 3f7a3ee..a5e0f50 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -1039,3 +1039,24 @@ define KernelPackage/bmp085-spi/description
 endef

 $(eval $(call KernelPackage,bmp085-spi))
+
+
+define KernelPackage/owl-loader
+  SUBMENU:=$(WIRELESS_MENU)
+  TITLE:=Owl loader for initializing Atheros PCI(e) Wifi chips
+  DEPENDS:=@PCI_SUPPORT +kmod-ath9k
+  KCONFIG:=CONFIG_OWL_LOADER
+  FILES:=$(LINUX_DIR)/drivers/misc/owl-loader.ko
+  AUTOLOAD:=$(call AutoProbe,owl-loader)
+endef
+
+define KernelPackage/owl-loader/description
+  Kernel module that helps to initialize certain Qualcomm
+  Atheros' PCI(e) Wifi chips, which have the init data
+  (which contains the PCI device ID for example) stored
+  together with the calibration data in the file system.
+
+  This is necessary for devices like the Cisco Meraki Z1.
+endef
+
+$(eval $(call KernelPackage,owl-loader))
diff --git a/target/linux/generic/files/drivers/misc/owl-loader.c 
b/target/linux/generic/files/drivers/misc/owl-loader.c
new file mode 100644
index 000..30340da
--- /dev/null
+++ b/target/linux/generic/files/drivers/misc/owl-loader.c
@@ -0,0 +1,246 @@
+/*
+ * Initialize Owl Emulation Devices
+ *
+ * Copyright (C) 2016 Christian Lamparter 
+ * Copyright (C) 2016 Martin Blumenstingl 
+ *
+ * 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.
+ *
+ * Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway)
+ * need to be able to initialize the PCIe wifi device. Normally, this is done
+ * during the early stages of booting linux, because the necessary init code
+ * is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup.
+ * However,this isn't possible for devices which have the init code for the
+ * Atheros chip stored on NAND. Hence, this module can be used to initialze
+ * the chip when the user-space is ready to extract the init code.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct owl_ctx {
+   struct completion eeprom_load;
+};
+
+#define EEPROM_FILENAME_LEN 100
+
+#define AR5416_EEPROM_MAGIC 0xa55a
+
+static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
+  size_t cal_len)
+{
+   void __iomem *mem;
+   const void *cal_end = (void *)cal_data + cal_len;
+   const struct {
+   __be16 reg;
+   __be16 low_val;
+   __be16 high_val;
+   } __packed *data;
+   u16 cmd;
+   u32 bar0;
+   bool swap_needed = false;
+
+   if (*cal_data != AR5416_EEPROM_MAGIC) {
+   if (*cal_data != swab16(AR5416_EEPROM_MAGIC)) {
+   dev_err(&pdev->dev, "invalid calibration data\n");
+   return -EINVAL;
+   }
+
+   dev_dbg(&pdev->dev, "calibration data needs swapping\n");
+   swap_needed = true;
+   }
+
+   dev_info(&pdev->dev, "fixup device configuration\n");
+
+   mem = pcim_iomap(pdev, 0, 0);
+   if (!mem) {
+   dev_err(&pdev->dev, "ioremap error\n");
+   return -EINVAL;
+   }
+
+   pci_read_config_dword(pdev, PCI_B

Re: [LEDE-DEV] [PATCH 2/3] kernel: owl-loader for delayed Atheros ath9k fixup

2016-09-18 Thread Christian Lamparter
On Sunday, September 18, 2016 2:19:33 PM CEST John Crispin wrote:
> On 18/09/2016 14:17, Martin Blumenstingl wrote:
> > On Sun, Sep 18, 2016 at 2:01 PM, John Crispin  wrote:
> >> On 08/09/2016 23:58, Christian Lamparter wrote:
> >>> So yes, if it needs to go in a different location, that would be fine.
> >>> Based on your suggestion, I think the owl-loader.c code can be moved to:
> >>> target/linux/generic/files/drivers/net/wireless/ath9k/owl-loader.c
> >>>
> >>> and the module definition from the Makefile can be copied into:
> >>> package/kernel/linux/modules/wireless.mk
> >>>
> >>> Or do you have something else in mind?
> >>
> >> target/linux/ar71xx/files/arch/mips/ath79/ would be fine i guess
> > Mathias and I have already tested this module on the lantiq platform
> > as well, so could we please keep it in a generic location (so we only
> > have to maintain it once)?
> > 
> 
> 
> sure thing. drivers/misc/ maybe ?
> 
Ok thanks.

I've updated the patch. If it passes QC, Chris will post a new series.

Regards,

Christian

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] merging the layerscape target

2016-09-18 Thread John Crispin
Hi all,

i have just spent some time reviewing the layerscape PR [1] and started
a full build of it. its starting to look good and i cannot see any
blockers. if anyone has any hold on this please let me know in the next
couple of days. if i dont get any vetos i will merge it.

John

[1] https://github.com/lede-project/source/pull/323

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH 2/3] kernel: owl-loader for delayed Atheros ath9k fixup

2016-09-18 Thread John Crispin


On 18/09/2016 14:17, Martin Blumenstingl wrote:
> On Sun, Sep 18, 2016 at 2:01 PM, John Crispin  wrote:
>>
>>
>> On 08/09/2016 23:58, Christian Lamparter wrote:
>>> So yes, if it needs to go in a different location, that would be fine.
>>> Based on your suggestion, I think the owl-loader.c code can be moved to:
>>> target/linux/generic/files/drivers/net/wireless/ath9k/owl-loader.c
>>>
>>> and the module definition from the Makefile can be copied into:
>>> package/kernel/linux/modules/wireless.mk
>>>
>>> Or do you have something else in mind?
>>
>>
>> Hi,
>>
>> target/linux/ar71xx/files/arch/mips/ath79/ would be fine i guess
> Mathias and I have already tested this module on the lantiq platform
> as well, so could we please keep it in a generic location (so we only
> have to maintain it once)?
> 


sure thing. drivers/misc/ maybe ?

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH 2/3] kernel: owl-loader for delayed Atheros ath9k fixup

2016-09-18 Thread Martin Blumenstingl
On Sun, Sep 18, 2016 at 2:01 PM, John Crispin  wrote:
>
>
> On 08/09/2016 23:58, Christian Lamparter wrote:
>> So yes, if it needs to go in a different location, that would be fine.
>> Based on your suggestion, I think the owl-loader.c code can be moved to:
>> target/linux/generic/files/drivers/net/wireless/ath9k/owl-loader.c
>>
>> and the module definition from the Makefile can be copied into:
>> package/kernel/linux/modules/wireless.mk
>>
>> Or do you have something else in mind?
>
>
> Hi,
>
> target/linux/ar71xx/files/arch/mips/ath79/ would be fine i guess
Mathias and I have already tested this module on the lantiq platform
as well, so could we please keep it in a generic location (so we only
have to maintain it once)?

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH firewall3] utils.h: Avoid name clashes for setbit/delbit/hasbit

2016-09-18 Thread John Crispin
Hi Florian,

merged into the fw3 repo. i did not update the package in lede yet.
first want to talk to jow if current head of that repo is production ready.

John

On 02/09/2016 04:10, Florian Fainelli wrote:
> Rename to fw3_{set,del,has}bit to avoid name clashes with sys/param.h:
> 
> /opt/toolchains/stbgcc-4.8-1.5/arm-linux-gnueabihf/sys-root/usr/include/sys/param.h:80:0:
>  note: this is the location of the previous definition
>  #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
> 
> Signed-off-by: Florian Fainelli 
> ---
>  defaults.c |  2 +-
>  forwards.c |  4 ++--
>  iptables.c |  8 
>  options.c  |  8 
>  rules.c|  8 
>  utils.h| 12 ++--
>  zones.c| 26 +-
>  7 files changed, 34 insertions(+), 34 deletions(-)
> 
> diff --git a/defaults.c b/defaults.c
> index 2dbbb633e2e4..8afbf9acf832 100644
> --- a/defaults.c
> +++ b/defaults.c
> @@ -154,7 +154,7 @@ fw3_print_default_chains(struct fw3_ipt_handle *handle, 
> struct fw3_state *state,
>   continue;
>  
>   if (c->flag &&
> - !hasbit(defs->flags[handle->family == FW3_FAMILY_V6], 
> c->flag))
> + !fw3_hasbit(defs->flags[handle->family == FW3_FAMILY_V6], 
> c->flag))
>   continue;
>  
>   fw3_ipt_create_chain(handle, c->format);
> diff --git a/forwards.c b/forwards.c
> index 591173279996..6f950520fd37 100644
> --- a/forwards.c
> +++ b/forwards.c
> @@ -86,8 +86,8 @@ fw3_load_forwards(struct fw3_state *state, struct 
> uci_package *p)
>   /* NB: forward family... */
>   if (forward->_dest)
>   {
> - setbit(forward->_dest->flags[0], FW3_FLAG_ACCEPT);
> - setbit(forward->_dest->flags[1], FW3_FLAG_ACCEPT);
> + fw3_setbit(forward->_dest->flags[0], FW3_FLAG_ACCEPT);
> + fw3_setbit(forward->_dest->flags[1], FW3_FLAG_ACCEPT);
>  
>   if (forward->_src &&
>   (forward->_src->conntrack || 
> forward->_dest->conntrack))
> diff --git a/iptables.c b/iptables.c
> index 96fba12f0e90..e54ea53f2c39 100644
> --- a/iptables.c
> +++ b/iptables.c
> @@ -1030,7 +1030,7 @@ fw3_ipt_rule_time(struct fw3_ipt_rule *r, struct 
> fw3_time *time)
>   {
>   for (i = 1, p = buf; i < 32; i++)
>   {
> - if (hasbit(time->monthdays, i))
> + if (fw3_hasbit(time->monthdays, i))
>   {
>   if (p > buf)
>   *p++ = ',';
> @@ -1039,14 +1039,14 @@ fw3_ipt_rule_time(struct fw3_ipt_rule *r, struct 
> fw3_time *time)
>   }
>   }
>  
> - fw3_ipt_rule_addarg(r, hasbit(time->monthdays, 0), 
> "--monthdays", buf);
> + fw3_ipt_rule_addarg(r, fw3_hasbit(time->monthdays, 0), 
> "--monthdays", buf);
>   }
>  
>   if (time->weekdays & 0xFE)
>   {
>   for (i = 1, p = buf; i < 8; i++)
>   {
> - if (hasbit(time->weekdays, i))
> + if (fw3_hasbit(time->weekdays, i))
>   {
>   if (p > buf)
>   *p++ = ',';
> @@ -1055,7 +1055,7 @@ fw3_ipt_rule_time(struct fw3_ipt_rule *r, struct 
> fw3_time *time)
>   }
>   }
>  
> - fw3_ipt_rule_addarg(r, hasbit(time->weekdays, 0), "--weekdays", 
> buf);
> + fw3_ipt_rule_addarg(r, fw3_hasbit(time->weekdays, 0), 
> "--weekdays", buf);
>   }
>  }
>  
> diff --git a/options.c b/options.c
> index 407931b4c490..d88d3ba09b50 100644
> --- a/options.c
> +++ b/options.c
> @@ -718,7 +718,7 @@ fw3_parse_weekdays(void *ptr, const char *val, bool 
> is_list)
>  
>   if (*val == '!')
>   {
> - setbit(*(uint8_t *)ptr, 0);
> + fw3_setbit(*(uint8_t *)ptr, 0);
>   while (isspace(*++val));
>   }
>  
> @@ -738,7 +738,7 @@ fw3_parse_weekdays(void *ptr, const char *val, bool 
> is_list)
>   }
>   }
>  
> - setbit(*(uint8_t *)ptr, w);
> + fw3_setbit(*(uint8_t *)ptr, w);
>   }
>  
>   free(s);
> @@ -753,7 +753,7 @@ fw3_parse_monthdays(void *ptr, const char *val, bool 
> is_list)
>  
>   if (*val == '!')
>   {
> - setbit(*(uint32_t *)ptr, 0);
> + fw3_setbit(*(uint32_t *)ptr, 0);
>   while (isspace(*++val));
>   }
>  
> @@ -770,7 +770,7 @@ fw3_parse_monthdays(void *ptr, const char *val, bool 
> is_list)
>   return false;
>   }
>  
> - setbit(*(uint32_t *)ptr, d);
> + fw3_setbit(*(uint32_t *)ptr, d);
>   }
>  
>   free(s);
> diff --git a/rules.c b/rules.c
> index 2c682b1b0b7e..8f232d3e0644 100644
> --- a/rules.c
> +++ b/rules.c
> @@ -247,13

Re: [LEDE-DEV] [PATCH ubox] getrandom: Define SYS_getrandom if no definition exists

2016-09-18 Thread John Crispin


On 18/09/2016 02:13, Florian Fainelli wrote:
> Le 17/09/2016 à 16:49, Etienne Champetier a écrit :
>> Hi Florian,
>>
>> What is your use case?
> 
> Pre-built toolchain which ships with kernel headers 3.8 at the moment.
> 
>> If you run it on kernel less than 3.17 this will then fail at run time ...
> 
> I run a kernel newer than 3.17, but that's a good point.
> 
>> I would prefer to not compile it instead of having an unusable binary
> 
> Ok, so something more like that:
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 6cf0c934aac6..1d04c1d77662 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -16,10 +16,15 @@ IF(DEBUG)
>ADD_DEFINITIONS(-DDEBUG -g3)
>  ENDIF()
> 
> -ADD_EXECUTABLE(getrandom getrandom.c)
> -INSTALL(TARGETS getrandom
> +INCLUDE (CheckSymbolExists)
> +CHECK_SYMBOL_EXISTS(SYS_getrandom sycall.h getrandom)
> +
> +IF(getrandom)
> +  ADD_EXECUTABLE(getrandom getrandom.c)
> +  INSTALL(TARGETS getrandom
> RUNTIME DESTINATION bin
> -)
> +  )
> +ENDIF()
> 
>  ADD_EXECUTABLE(kmodloader kmodloader.c)
>  TARGET_LINK_LIBRARIES(kmodloader ubox)
> 
> diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile
> index 9f0c4dc10250..48371e168fd3 100644
> --- a/package/system/ubox/Makefile
> +++ b/package/system/ubox/Makefile
> @@ -32,7 +32,7 @@ define Package/ubox/install
> $(INSTALL_DIR) $(1)/sbin $(1)/usr/sbin $(1)/lib $(1)/usr/bin
> $(1)/etc/init.d
> 
> $(INSTALL_BIN)
> $(PKG_INSTALL_DIR)/usr/sbin/{kmodloader,validate_data} $(1)/sbin/
> -   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/
> +   -$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/
> $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib
> 
> $(LN) ../../sbin/kmodloader $(1)/usr/sbin/rmmod
> 
> 

looks better. i think that the code invoking getrandom would also need
to be changed to fallback to urandom if the helper does not exist.

John

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH 2/3] kernel: owl-loader for delayed Atheros ath9k fixup

2016-09-18 Thread John Crispin


On 08/09/2016 23:58, Christian Lamparter wrote:
> So yes, if it needs to go in a different location, that would be fine.
> Based on your suggestion, I think the owl-loader.c code can be moved to:
> target/linux/generic/files/drivers/net/wireless/ath9k/owl-loader.c
> 
> and the module definition from the Makefile can be copied into:
> package/kernel/linux/modules/wireless.mk
> 
> Or do you have something else in mind?


Hi,

target/linux/ar71xx/files/arch/mips/ath79/ would be fine i guess and
then a definition inside package/kernel/linux/modules/*.mk to make the
build system create an ipk for it. i'll mark the patch as changes
requested inside patchwork. please send a V2 of the series

John

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev