openwrt/openwrt.git
2 months agowireguard: bump to 0.0.20190406
Jason A. Donenfeld [Sat, 6 Apr 2019 11:24:09 +0000 (13:24 +0200)]
wireguard: bump to 0.0.20190406

* allowedips: initialize list head when removing intermediate nodes

Fix for an important regression in removing allowed IPs from the last
snapshot. We have new test cases to catch these in the future as well.

* tools: warn if an AllowedIP has a nonzero host part

If you try to run `wg set wg0 peer ... allowed-ips 192.168.1.82/24`, wg(8)
will now print a warning. Even though we mask this automatically down to
192.168.1.0/24, usually when people specify it like this, it's a mistake.

* wg-quick: add 'strip' subcommand

The new strip subcommand prints the config file to stdout after stripping
it of all wg-quick-specific options. This enables tricks such as:
`wg addconf $DEV <(wg-quick strip $DEV)`.

* tools: avoid unneccessary next_peer assignments in sort_peers()

Small C optimization the compiler was probably already doing.

* peerlookup: rename from hashtables
* allowedips: do not use __always_inline
* device: use skb accessor functions where possible

Suggested tweaks from Dave Miller.

* blake2s: simplify
* blake2s: remove outlen parameter from final

The blake2s implementation has been simplified, since we don't use any of the
fancy tree hashing parameters or the like. We also no longer separate the
output length at initialization time from the output length at finalization
time.

* global: the _bh variety of rcu helpers have been unified
* compat: nf_nat_core.h was removed upstream
* compat: backport skb_mark_not_on_list

The usual assortment of compat fixes for Linux 5.1.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2 months agotarget/octeon: Add Linux 4.19 support
Daniel Engberg [Thu, 7 Feb 2019 23:41:47 +0000 (23:41 +0000)]
target/octeon: Add Linux 4.19 support

This commit adds support for Linux 4.19 kernel, various cleanups
listed below.

Drop 170-cisco-hack.patch as these devices never seems to have been
supported.

Unset kernel symbols:

* CONFIG_CAVIUM_CN63XXP1=y
  No supported hardware uses CN63XXP1 and it causes "slight decrease in
  performance"
  Source: https://cateee.net/lkddb/web-lkddb/CAVIUM_CN63XXP1.html

* CONFIG_USB_OCTEON_EHCI=y
  CONFIG_USB_OCTEON_OHCI=y
  Deprecated
  Source: https://cateee.net/lkddb/web-lkddb/USB_OCTEON_EHCI.html
  https://cateee.net/lkddb/web-lkddb/USB_OCTEON_OHCI.html

Removed kernel symbols:

* # CONFIG_ARCH_HIBERNATION_POSSIBLE=y
* CONFIG_ARCH_SUSPEND_POSSIBLE=y
  These are not in if you do a vanilla config of a MIPS Octeon kernel
  and I can't find any references about support on this platform.

* # CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
* CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
  No need to have this in by default, not defined in most other targets

* CONFIG_CRASH_CORE=y
  Can't find any documentation why this should be enabled by default

* CONFIG_DEBUG_INFO=y
  Set by https://github.com/openwrt/openwrt/blob/master/config/Config-kernel.in#L134

* CONFIG_DEBUG_SPINLOCK=y
  No need to have this in by default

* CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
  Already set by default
  Source: https://cateee.net/lkddb/web-lkddb/DEFAULT_HUNG_TASK_TIMEOUT.html

* CONFIG_DETECT_HUNG_TASK=y
  No need to have this in by default, not defined in most other targets

* CONFIG_HAVE_DEBUG_KMEMLEAK=y
  No need to have this in by default, not defined in most other targets

* CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
  No need to have this in by default

* CONFIG_HAVE_IDE=y
  None of the supported devices have IDE

* CONFIG_HZ=250
* # CONFIG_HZ_100 is not set
* CONFIG_HZ_250=y
  This is broken with generic config

* CONFIG_KALLSYMS=y
  No need to have this in by default, not defined in most other targets

* CONFIG_KEXEC=y
* CONFIG_KEXEC_CORE=y
  No need to have this in by default, not defined in most other targets

* CONFIG_HAVE_KVM=y
  No need to have this in by default

* CONFIG_SCHED_DEBUG=y
  No need to have this in by default, not defined in most other targets

* CONFIG_SYSFS_DEPRECATED=y
  Deprecated symbol
  Source: https://cateee.net/lkddb/web-lkddb/SYSFS_DEPRECATED.html

* CONFIG_SYSFS_DEPRECATED_V2=y
  Discouraged usage in general
  Source: https://cateee.net/lkddb/web-lkddb/SYSFS_DEPRECATED_V2.html

* CONFIG_UNINLINE_SPIN_UNLOCK=y
  No need to have this in by default, not defined in most other targets
  Source: https://github.com/openSUSE/kernel/blob/master/lib/Kconfig.debug#L1137

* CONFIG_ZLIB_INFLATE=y
  No need to have this in by default, not defined in most other targets

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2 months agomvebu: sysupgrade: sdcard: keep user added partitons
Tomasz Maciej Nowak [Thu, 28 Mar 2019 17:07:09 +0000 (18:07 +0100)]
mvebu: sysupgrade: sdcard: keep user added partitons

Currently sysupgrade overwrites whole disk and destroys partitions added
by user. Sync the sysupgrade code with the one present in x86 target to
remedy this behaviour.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agomvebu: base-files: autodetect upgrade device
Tomasz Maciej Nowak [Thu, 28 Mar 2019 17:07:08 +0000 (18:07 +0100)]
mvebu: base-files: autodetect upgrade device

Since some boards could be also booted from other mediums than SD card,
lets make the upgrade block device autodetected.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agomvebu: shrink amount of packages and reorganize them
Tomasz Maciej Nowak [Thu, 28 Mar 2019 17:07:07 +0000 (18:07 +0100)]
mvebu: shrink amount of packages and reorganize them

Since most of devices using SD card image to boot, use ext4 as boot
files system we can drop fat fs related packages. Also move packages
which are added repeatedly across subtargets to their default packages,
with droping the ones that are enabled in target kernel configugation.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agomvebu: use ext4 for clearfog image bootfs
Tomasz Maciej Nowak [Thu, 28 Mar 2019 17:07:06 +0000 (18:07 +0100)]
mvebu: use ext4 for clearfog image bootfs

This will allow to drop additional packages and shrink image size.

Cc: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agomvebu: make bootfs size for sdcard image configurable
Tomasz Maciej Nowak [Thu, 28 Mar 2019 17:07:05 +0000 (18:07 +0100)]
mvebu: make bootfs size for sdcard image configurable

Let's take this oportunity to implement boot-part and rootfs-part feature
flags.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agozynq: replace storage related configs by packages
Luis Araneda [Mon, 1 Apr 2019 03:33:08 +0000 (00:33 -0300)]
zynq: replace storage related configs by packages

Select build-in packages by default and remove the
associated kernel configs

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2 months agozynq: replace CAN kconfig options by device packages
Luis Araneda [Mon, 1 Apr 2019 03:33:07 +0000 (00:33 -0300)]
zynq: replace CAN kconfig options by device packages

The options are managed on a generic way by the can
kmod packages

Additionally, select can packages only for devices that
currently has CAN enabled, which is only the ZC702

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2 months agokernel: can: add Xilinx CAN IP kernel module package
Luis Araneda [Mon, 1 Apr 2019 03:33:06 +0000 (00:33 -0300)]
kernel: can: add Xilinx CAN IP kernel module package

This driver is required to use the CAN IP on devices
from the zynq target

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2 months agozynq: kernel: remove video/camera kconfig options
Luis Araneda [Mon, 1 Apr 2019 03:33:05 +0000 (00:33 -0300)]
zynq: kernel: remove video/camera kconfig options

The options are managed on a generic way by video packages

Additionally, only one of the currently supported boards
has a camera interface, but it requires programming
the FPGA fabric first

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2 months agozynq: kernel: remove sound kconfig options
Luis Araneda [Mon, 1 Apr 2019 03:33:04 +0000 (00:33 -0300)]
zynq: kernel: remove sound kconfig options

The options are managed on a generic way by the sound
kmod packages

Additionally, none of the currently supported boards have
sound support out of the box, as they require programming
the FPGA fabric first

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2 months agokernel: sound: add missing symbol to sound-soc-core
Luis Araneda [Mon, 1 Apr 2019 03:33:03 +0000 (00:33 -0300)]
kernel: sound: add missing symbol to sound-soc-core

This fixes compilation on zynq target when migrating
to sound kmod packages

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2 months agozynq: kernel: refresh config
Luis Araneda [Mon, 1 Apr 2019 03:33:02 +0000 (00:33 -0300)]
zynq: kernel: refresh config

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
2 months agomac80211: update to version 4.19.32-1
Hauke Mehrtens [Thu, 28 Mar 2019 15:00:43 +0000 (16:00 +0100)]
mac80211: update to version 4.19.32-1

The removed patches are now integrated in the upstream kernel.
Refresh all patches on top of the new backports release.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2 months agombedtls: update to version 2.16.1
Josef Schlehofer [Fri, 29 Mar 2019 23:51:58 +0000 (00:51 +0100)]
mbedtls: update to version 2.16.1

Refreshed patches

Signed-off-by: Josef Schlehofer <josef.schlehofer@nic.cz>
Tested-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2 months agotegra: add kernel 4.19 support
Tomasz Maciej Nowak [Mon, 1 Apr 2019 17:25:44 +0000 (19:25 +0200)]
tegra: add kernel 4.19 support

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agotegra: add support for CompuLab TrimSlice
Tomasz Maciej Nowak [Mon, 1 Apr 2019 17:25:43 +0000 (19:25 +0200)]
tegra: add support for CompuLab TrimSlice

It is a small form factor computer with rich amount of expansion ports.
Some hardware specs and supported features in this commit:

CPU: NVIDIA Tegra 2 @ 1GHz
RAM: 1GB DDR2-667
Storage: SDHC card slot
         µSDHC card slot
         USB to SATA bridge (depends on model)
         1MB SPI NOR flash for bootloader (single partition)
LAN: RTL8111DL GbE
WIFI: RT3070 b/g/n with external antenna (depends on model)
RTC: EM3027 (mapped as rtc0; with battery backup)
     Tegra 2 built-in (mapped as rtc1)
Sound: Analog/Digital (TLV320AIC23b; S/PDIF not tested)
Connectors: 4x USB 2.0
            RS232 (mini serial)
            HDMI
            DVI-D (depends on model, not supported atm)
            Extension connector (24 pin ZIF, 0.5mm pitch):
            2X UART
            SPI
            JTAG (1.8V)
Other: power button with green led (not functional for early revisions
       without programmed PMIC)
       2x GPIO configurable green led

TrimSlice uses U-Boot placed in NOR flash. Boots Linux from any media
connected to USB, SATA or SD card inserted in slot. Can also boot from
TFTP. To run OpenWrt one needs to update U-Boot to fairly recent version
(the versions, pre-dts/dts provided by CompuLab won't suffice):

 1. Boot TrimSlice into Your current linux distro,
 2. Download trimslice-spi.img from u-boot-trimslice subdir,
 3. Install mtd-utils,
 4. Run following commands:
     flash_erase /dev/mtd0 0 256
     nandwrite /dev/mtd0 trimslice-spi.img
 5. Poweroff, insert SD card with OpenWrt, boot and enjoy.

If by some obstacle You can't follow those instructions, it is possible
to flash U-Boot using serial console.

 1. Insert FAT or EXT2/EXT3 formatted SD card with trimslice-spi.img,
 2. Interrupt boot process to enter U-Boot command line,
 3. Run following commands:
     ${fs}load mmc 0 0x04080000 trimslice-spi.img
     sf probe 0
     sf erase 0 0x100000
     sf write 0x04080000 0x0 ${filesize}
     reset
 4. Poweroff, insert SD card with OpenWrt, boot and enjoy.

If something went wrong with one of above steps, there is simple
recovery option:

 1. Open the µSD slot security door to access the recovery-boot button,
 2. Insert SD card with OpenWrt to the front slot while unpowered,
 3. Power on the TrimSlice while pressing the recovery-boot button,
 4. With this it should boot straigth to OpenWrt, from there download
    trimslice-spi.img and execute following commands:
     mtd erase /dev/mtd0
     mtd write trimslice-spi.img /dev/mtd0
 5. Reboot, now it should boot straigth to OpenWrt, without pressing the
    recovery-boot button, with proper U-Boot flashed.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agokernel: package rtc-em3027 module
Tomasz Maciej Nowak [Mon, 1 Apr 2019 17:25:42 +0000 (19:25 +0200)]
kernel: package rtc-em3027 module

Support for Microelectronic EM3027 real time clock chip.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agouboot-tegra: add U-Boot for tegra boards
Tomasz Maciej Nowak [Mon, 1 Apr 2019 17:25:41 +0000 (19:25 +0200)]
uboot-tegra: add U-Boot for tegra boards

Add U-Boot for NVIDIA Tegra based boards, with the first being CompuLab
TrimSlice. This is part of initial support for this board.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agotools: add cbootimage-configs for tegra
Tomasz Maciej Nowak [Mon, 1 Apr 2019 17:25:40 +0000 (19:25 +0200)]
tools: add cbootimage-configs for tegra

This provides board configuraion tables for various Tegra boards needed
by cbootimage tool to create flashable bootloader images.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agotools: add cbootimage for tegra
Tomasz Maciej Nowak [Mon, 1 Apr 2019 17:25:39 +0000 (19:25 +0200)]
tools: add cbootimage for tegra

Tegra BCT and bootable flash image generator/compiler

>From documentation:
This project provides a tool which compiles BCT (Boot Configuration
Table) images to place into the boot flash of a Tegra-based device.

The tool will either:

a) Compile a textual representation of a BCT into a binary image.

b) Generate an entire boot image from a previously compiled BCT and a
   bootloader binary.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agotegra: add new target
Tomasz Maciej Nowak [Mon, 1 Apr 2019 17:25:38 +0000 (19:25 +0200)]
tegra: add new target

New target introduces initial support for NVIDIA Tegra SoC based devices.
It focuses on Tegra 2 CPUs, for successors supporting NEON instruction
set the target should be split in two subtargets.
This initial commit doesn't create any device image, it's groundwork
for further additions.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2 months agocurl: Update to 7.64.1
Daniel Engberg [Fri, 5 Apr 2019 17:43:59 +0000 (17:43 +0000)]
curl: Update to 7.64.1

Update curl to 7.64.1
Remove deprecated patch

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
2 months agoodhcpd: update to latest git HEAD
Hans Dedecker [Fri, 5 Apr 2019 09:57:54 +0000 (11:57 +0200)]
odhcpd: update to latest git HEAD

65a9519 ndp: create ICMPv6 socket per interface
c6dae8e router: create ICMPv6 socket per interface
e7b1d4b treewide: initialize properly file descriptors

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 months agobase-files/hotplug: fix dedicated group for tty devices
Michael Heimpold [Tue, 2 Apr 2019 19:48:11 +0000 (21:48 +0200)]
base-files/hotplug: fix dedicated group for tty devices

Commit 124ab1dc0a and 5523ee3459 introduced the assignment of the
group "tty" to /dev/tty* devices in order to support unprivileged
user access to serial devices.

However, due to an improperly rebased commit this feature broke.

This patch restores the lost hunk in hotplug.json file to
re-introduce this feature and also renames the existing "tty" group
to "dialout" as this is the more typical name for such a group
on desktop systems.

Fixes: 5209cfa534 ("procd: fix hotplug.json syntax")
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Acked-by: Jo-Philipp Wich <jo@mein.io>
2 months agokernel: b53: add support for kernels 5.0+
Rafał Miłecki [Thu, 4 Apr 2019 09:31:28 +0000 (11:31 +0200)]
kernel: b53: add support for kernels 5.0+

It adjusts b53 code to upstream changes from the commit 3c1bcc8614db
("net: ethernet: Convert phydev advertize and supported from u32 to link
mode").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 months agokernel: backport upstream ubifs default compression selection fix
Rafał Miłecki [Thu, 4 Apr 2019 09:18:27 +0000 (11:18 +0200)]
kernel: backport upstream ubifs default compression selection fix

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 months agokernel: fix rtcache compilation with 4.18+ with IPv6 support
Rafał Miłecki [Thu, 4 Apr 2019 07:31:41 +0000 (09:31 +0200)]
kernel: fix rtcache compilation with 4.18+ with IPv6 support

Please note that modified code isn't currently being compiled with
kernels 4.19+ due to the dropped CONFIG_NF_CONNTRACK_IPV6 in upstream
Linux. That requires a separated fix.

This fixes:
net/netfilter/nf_conntrack_rtcache.c: In function 'nf_rtcache_get_cookie':
net/netfilter/nf_conntrack_rtcache.c:82:11: error: 'const struct rt6_info' has no member named 'rt6i_node'; did you mean 'rt6i_idev'?
   if (rt->rt6i_node)
           ^~~~~~~~~
           rt6i_idev

IPv6 structs were reworked in upstream kernel by:
commit a64efe142f5e ("net/ipv6: introduce fib6_info struct and helpers")
commit 77634cc67dc1 ("net/ipv6: Remove unused code and variables for rt6_info")
commit 93c2fb253d17 ("net/ipv6: Rename fib6_info struct elements")

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 months agomac80211: set noscan=1 if sta/adhoc/mesh interfaces are present
Felix Fietkau [Sat, 30 Mar 2019 09:09:32 +0000 (10:09 +0100)]
mac80211: set noscan=1 if sta/adhoc/mesh interfaces are present

Fixes channel selection issues and suppresses an unnecessary extra scan

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agomac80211: improve performance by deferring tx queue selection
Felix Fietkau [Sat, 23 Mar 2019 08:59:35 +0000 (09:59 +0100)]
mac80211: improve performance by deferring tx queue selection

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agoramips: implement vlan rx offload on MT7621
Felix Fietkau [Sat, 23 Mar 2019 13:29:00 +0000 (14:29 +0100)]
ramips: implement vlan rx offload on MT7621

Avoids the overhead of software VLAN untagging in the network stack

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agoopenvpn: openssl: explicitly depend on deprecated APIs
Magnus Kroken [Tue, 2 Apr 2019 20:18:44 +0000 (22:18 +0200)]
openvpn: openssl: explicitly depend on deprecated APIs

OpenVPN as of 2.4.7 uses some OpenSSL APIs that are deprecated in
OpenSSL >= 1.1.0.

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [white space fix]
2 months agoath79: Add support for TP-Link CPE210 v2
Adrian Schmutzler [Mon, 25 Mar 2019 17:46:26 +0000 (18:46 +0100)]
ath79: Add support for TP-Link CPE210 v2

This PR adds support for a popular low-cost 2.4GHz N based AP

Specifications:
 - SoC: Qualcomm Atheros QCA9533 (650MHz)
 - RAM: 64MB
 - Storage: 8 MB SPI NOR
 - Wireless: 2.4GHz N based built into SoC 2x2
 - Ethernet: 1x 100/10 Mbps, integrated into SoC, 24V POE IN

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on
for around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254

This is based on the support patch for the identical CPE210 v3
by Mario Schroen <m.schroen@web.de>.

Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[renamed dtsi filename]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoath79: Add support for TP-Link CPE210 v3
Mario Schroen [Sun, 31 Mar 2019 19:07:03 +0000 (21:07 +0200)]
ath79: Add support for TP-Link CPE210 v3

Specifications:

    * SoC: Qualcomm Atheros QCA9533 (650MHz)
    * RAM: 64MB
    * Storage: 8 MB SPI NOR
    * Wireless: 2.4GHz N based built into SoC 2x2
    * Ethernet: 1x 100/10 Mbps, integrated into SoC, 24V POE IN

Installation:
    Flash factory image through stock firmware WEB UI or TFTP
    To get to TFTP recovery just hold reset button while powering
    on for around 4-5 seconds and release.
    Rename factory image to recovery.bin
    Stock TFTP server IP:192.168.0.100
    Stock device TFTP adress:192.168.0.254

Thanks to robimarko for the work inside the ar71xx tree.
Thanks to adrianschmutzler for deep discussion and fixes.

Signed-off-by: Mario Schroen <m.schroen@web.de>
[Split into DTS/DTSI, read-only config partition in DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[renamed dtsi filename, light subject touches]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoar71xx: Add support for TP-Link CPE210 v3
Robert Marko [Sat, 11 Aug 2018 15:32:48 +0000 (17:32 +0200)]
ar71xx: Add support for TP-Link CPE210 v3

Looks identical to the v2.

This PR adds support for a popular low-cost 2.4GHz N based AP

Specifications:
 - SoC: Qualcomm Atheros QCA9533 (650MHz)
 - RAM: 64MB
 - Storage: 8 MB SPI NOR
 - Wireless: 2.4GHz N based built into SoC 2x2
 - Ethernet: 1x 100/10 Mbps, integrated into SoC, 24V POE IN

Installation:
Flash factory image through stock firmware WEB UI
or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 4-5 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP adress:192.168.0.254

Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Robert Marko <robimarko@gmail.com>
[Rebased, adjusted for separate tplink-safeloader entry, dynamic partitioning]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 months agoar71xx: Use dynamic partitions for TP-Link CPE210 v2
Adrian Schmutzler [Tue, 26 Mar 2019 10:41:57 +0000 (11:41 +0100)]
ar71xx: Use dynamic partitions for TP-Link CPE210 v2

This is also helpful to add support in ath79.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 months agonetifd: update to latest git HEAD
Hans Dedecker [Mon, 1 Apr 2019 21:08:58 +0000 (23:08 +0200)]
netifd: update to latest git HEAD

361b3e4 proto-shell: return error in case setup fails
a97297d interface: set interface in TEARDOWN state when checking link state

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 months agobuild: image: Fix off-by-one in DTC kernel version checks
Petr Štetiar [Mon, 1 Apr 2019 11:53:31 +0000 (13:53 +0200)]
build: image: Fix off-by-one in DTC kernel version checks

It was reported to me on IRC today, that my change causes issues with
kernel versions between 4.14 and 4.19.

It's because I've wrongly used `git describe` in order to get kernel
version where we should disable noisy DTC checks, but I should've used
`git tag --contains` instead.

Fixes: cbbef976e2b ("build: dtc: Disable noisy warnings by default")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoar71xx: ens202ext: Fix whitespace issues
Petr Štetiar [Mon, 1 Apr 2019 10:03:50 +0000 (12:03 +0200)]
ar71xx: ens202ext: Fix whitespace issues

I've missed leading whitespace issues in the original patch, so fixing
it in this commit. Thanks to pepe2k for letting me know.

Fixes: d260813d ("ar71xx: ens202ext: Fix VLAN switch")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoopenvpn: update to 2.4.7
Magnus Kroken [Wed, 27 Mar 2019 19:07:58 +0000 (20:07 +0100)]
openvpn: update to 2.4.7

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
2 months agomwlwifi: Fix pcie timeout issue
Kabuli Chana [Sun, 3 Mar 2019 20:53:23 +0000 (13:53 -0700)]
mwlwifi: Fix pcie timeout issue

Increase MAX_WAIT_FW_COMPLETE_ITERATIONS to 10000 as before commit
e5e0700 to prevent timeout as reported here: #308 (Original OP issue is
probably not related though as his post preceeds commit e5e0700).

compile/test target mvebu/mamba, rango

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
[commit subject and message tweaks]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoramips: add missing SPDX identifier for EX6150
David Bauer [Fri, 29 Mar 2019 15:16:18 +0000 (16:16 +0100)]
ramips: add missing SPDX identifier for EX6150

This adds the SPDX license identifier for the NETGEAR EX6150. It was
missed when submitting the original patch.

Signed-off-by: David Bauer <mail@david-bauer.net>
2 months agoar71xx: ens202ext: Fix VLAN switch
Michael Pratt [Fri, 22 Feb 2019 05:28:50 +0000 (00:28 -0500)]
ar71xx: ens202ext: Fix VLAN switch

The target ENS202EXT was just recently added right before the stable
release of Openwrt 18.

It flashes fine, but the physical switch is almost impossible to use
until you have a VLAN set up. Tested on two devices.

The actual problem is that eth0 represents nothing for whatever reason.
In other words, both WAN and LAN are running from eth1. There may be an
underlying problem in the build, but for now, I assume that this is
correct and that a VLAN switch is an appropriate fix.

Also, it's virtually impossible to get the switch running right through
LuCI. It is one thing to get a switch to appear, but attempting to
configure it breaks the whole thing. The VLAN has to be set up
perfectly, otherwise, interfaces will not start up, and one is forced to
reset settings, OR, the new LuCI feature kicks in and reverses any
steps. It is extremely difficult to determine which virtual ports
correspond to which physical ethernet ports without being able to set up
the switch in LuCI.

Temporary Workaround: followed directions here
[openwrt/luci#867](https://github.com/openwrt/luci/issues/867)

Reviewed-by: Marty Plummer <hanetzer@startmail.com>
Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[commit author fix, subject fix, message text wrap]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoath10k-firmware: update Candela Tech firmware images
Christian Lamparter [Sat, 30 Mar 2019 09:33:47 +0000 (10:33 +0100)]
ath10k-firmware: update Candela Tech firmware images

Release notes since last time:

Release notes for wave-1 / 10.1:
2019-03-28: Fix sometimes using bad TID for management frames
    in htt-mgt mode. (Backported from wave2, looks
    like bug would be the same though.)

Release notes for wave-2 / 10.4:
2019-03-28: Fix off-channel scanning while associated in
    proxy-station mode.

2019-03-29: Fix sometimes sending mgt frames on wrong tid when
    using htt-mgt. This bug has been around since I first
    enabled htt-mgt mode.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 months agoodhcpd: update to latest git HEAD
Hans Dedecker [Fri, 29 Mar 2019 14:45:28 +0000 (15:45 +0100)]
odhcpd: update to latest git HEAD

7798d50 netlink: rework IPv4 address refresh logic
0b20876 netlink: rework IPv6 address refresh logic

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 months agokernel: bump 4.14 to 4.14.109
Koen Vandeputte [Thu, 28 Mar 2019 11:59:20 +0000 (12:59 +0100)]
kernel: bump 4.14 to 4.14.109

Refreshed all patches.

Compile-tested on: ar71xx, cns3xxx, imx6, x86_64
Runtime-tested on: ar71xx, cns3xxx, imx6, x86_64

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 months agokernel: bump 4.9 to 4.9.166
Koen Vandeputte [Thu, 28 Mar 2019 11:57:03 +0000 (12:57 +0100)]
kernel: bump 4.9 to 4.9.166

Refreshed all patches.

Compile-tested on: ar7
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 months agoramips: Increase GB-PC1 SPI frequency to 80MHz
Rosen Penev [Thu, 14 Feb 2019 21:15:29 +0000 (13:15 -0800)]
ramips: Increase GB-PC1 SPI frequency to 80MHz

The specific flash chip used (W25Q256FVEM) accepts 50MHz for read
requests and higher for others. 104MHz for fast reads. ramips seems to
be limited to 80MHz based on testing with higher values (no speedup).

Based on upstream commit: 97738374a310b9116f9c33832737e517226d3722

 time dd if=/dev/mtdblock3 of=/dev/null bs=64k from 42.96s to 7.01s

 [test done with backported upstream v4.19 driver[1], for numbers on
  stock 4.14 driver please take a look at `ramips: Increase GB-PC2 SPI
  frequency to 80MHz` commit message]

1. https://github.com/openwrt/openwrt/pull/1578

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[expanded note about spi driver version]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoramips: Increase GB-PC2 SPI frequency to 80MHz
Rosen Penev [Fri, 29 Mar 2019 06:01:30 +0000 (23:01 -0700)]
ramips: Increase GB-PC2 SPI frequency to 80MHz

The flash chip on the board (Spansion S25FL256SAIF00) is rated to
support at least 50MHz for normal read requests according to the
datasheet. 133MHz for fast reads. However, ramips seems to be limited to
80MHz.

>From testing this, higher values do not improve speeds.

time dd if=/dev/mtdblock3 of=/dev/null bs=64k from

42.82s to 14.09s.

boot speed is also faster:
[   66.884087] procd: - init - vs
[   48.976049] procd: - init -

Since spi speed was requested:
[    3.538884] spi-mt7621 1e000b00.spi: sys_freq: 225000000

CPU is 900MHz:
[    0.000000] CPU Clock: 900MHz

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[fixed commit message by adding missing 0 in the spi-mt7621 clock output]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoramips: add Netgear EX6150
David Bauer [Thu, 21 Mar 2019 14:55:09 +0000 (15:55 +0100)]
ramips: add Netgear EX6150

SoC:   MediaTek MT7621
RAM:   64M (Winbond W9751G6KB-25)
FLASH: 16MB (Macronix MX25L12835F)
WiFi:  MediaTek MT7662E bgn 2SS
WiFi:  MediaTek MT7662E nac 2SS
BTN:   ON/OFF - Reset - WPS - AP/Extender toggle
LED:    - Arrow Right (blue)
        - Arrow Left (blue)
        - WiFi 1 (red/green)
        - WiFi 2 (red/green)
        - Power (green/amber)
        - WPS (Green)
UART:  UART is present as Pads on the backside of the PCB. They are
       located on the other side of the Ethernet port.
       3.3V - GND - TX - RX / 57600-8N1
       3.3V is the nearest one to the antenna connectors

Installation
------------
Update the factory image via the Netgear web-interfaces (by default:
192.168.1.250/24).

You can also use the factory image with the nmrpflash tool.
For more information see https://github.com/jclehner/nmrpflash

Signed-off-by: David Bauer <mail@david-bauer.net>
[merge conflict in 02_network, flash@0 node rename, wlan DTS triggers]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoramips: add support for ZyXEL Keenetic Start
Vladimir Kot [Sat, 12 Jan 2019 09:43:28 +0000 (18:43 +0900)]
ramips: add support for ZyXEL Keenetic Start

Device specification:
- SoC: RT5350F
- CPU Frequency: 360 MHz
- Flash Chip: Winbond 25Q32 (4096 KiB)
- RAM: 32768 KiB
- 5x 10/100 Mbps Ethernet (4x LAN, 1x WAN)
- 1x external, non-detachable antenna
- UART (J1) header on PCB (57800 8n1)
- Wireless: SoC-intergated: 2.4GHz 802.11bgn
- USB: None
- 3x LED, 2x button

Flash instruction:
1. Configure PC with static IP 192.168.1.2/24 and start TFTP server.
2. Rename "openwrt-ramips-rt305x-kn_st-squashfs-sysupgrade.bin"
   to "kstart_recovery.bin" and place it in TFTP server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
   the router and keep button pressed until power LED start blinking.
4. Router will download file from TFTP server, write it to flash and reboot.

Signed-off-by: Vladimir Kot <vova28rus@gmail.com>
[fixed git commit author and whitespace issues in DTS]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoramips: add support for WIZnet WizFi630S board
Tobias Welz [Fri, 11 Jan 2019 23:37:43 +0000 (00:37 +0100)]
ramips: add support for WIZnet WizFi630S board

The WIZnet WizFi630S board is in the miniPCIe form factor.

SoC: Mediatek MT7688AN
RAM: 128MB
Flash: 32Mb
WiFi: 2.4GHz
Ethernet: 3x 100Mbit
USB: 1 (USB 2.0)
serial ports: 2 (1x full, 1xlite)

Flash and recovery instructions: Use the factory installed u-boot boot
loader. It is available on UART2 (115200,8,n,1).  Then get the
sysupgrade image from a tftp server.

Signed-off-by: Tobias Welz <tw@wiznet.eu>
[whitespace and device name in makefile fixes]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoiwinfo: Fix 802.11ad channel to frequency
Daniel Golle [Thu, 28 Mar 2019 14:09:38 +0000 (15:09 +0100)]
iwinfo: Fix 802.11ad channel to frequency

 c2cfe9d iwinfo: Fix 802.11ad channel to frequency

Fixes 9725aa271a ("iwinfo: update to latest git HEAD")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agofstools: update to the latest master branch
Petr Štetiar [Thu, 28 Mar 2019 11:57:08 +0000 (12:57 +0100)]
fstools: update to the latest master branch

ff1ded6 libfstools: Fix overflow of F2FS_MINSIZE constant
bc2c876 libfstools: Print error in case of loop blkdev failure

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agopackage/uboot-omap: backport patches to fix build
Alexander Couzens [Sat, 16 Mar 2019 22:19:04 +0000 (23:19 +0100)]
package/uboot-omap: backport patches to fix build

* 106: fix build when libfdt-devel is installed on host
* 107: fix stdbool.h includes

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2 months agowireguard: introduce 'nohostroute' option
Daniel Golle [Wed, 27 Mar 2019 21:59:03 +0000 (22:59 +0100)]
wireguard: introduce 'nohostroute' option

Instead of creating host-routes depending on fwmark as (accidentally)
pushed by commit
1e8bb50b93 ("wireguard: do not add host-dependencies if fwmark is set")
use a new config option 'nohostroute' to explicitely prevent creation
of the route to the endpoint.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agoIB: fix generating .profile.mk for profiles without metadata
Daniel Golle [Wed, 27 Mar 2019 21:52:05 +0000 (22:52 +0100)]
IB: fix generating .profile.mk for profiles without metadata

Fixes d6fa04a437 ("IB: include SUPPORTED_DEVICES in 'make info' output")

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agowireguard: do not add host-dependencies if fwmark is set
Daniel Golle [Tue, 19 Mar 2019 15:47:17 +0000 (16:47 +0100)]
wireguard: do not add host-dependencies if fwmark is set

The 'fwmark' option is used to define routing traffic to
wireguard endpoints to go through specific routing tables.
In that case it doesn't make sense to setup routes for
host-dependencies in the 'main' table, so skip setting host
dependencies if 'fwmark' is set.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 months agoodhcpd: update to latest git HEAD (FS#2204)
Hans Dedecker [Wed, 27 Mar 2019 20:03:02 +0000 (21:03 +0100)]
odhcpd: update to latest git HEAD (FS#2204)

420945c netlink: fix IPv6 address updates (FS#2204)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2 months agokernel: fix missing dependency in 4.14.108
Koen Vandeputte [Wed, 27 Mar 2019 15:46:39 +0000 (16:46 +0100)]
kernel: fix missing dependency in 4.14.108

The 4.14.108 bump introduced a missing dependency when building
specific netfilters.

Thsi was not seen as the error does not occur on all targets.

Thanks to Jo-Philipp Wich for providing the fix

Fixes: af6c86dbe56e ("kernel: bump 4.14 to 4.14.108")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 months agomt76: update to the latest version
Felix Fietkau [Wed, 27 Mar 2019 12:03:01 +0000 (13:03 +0100)]
mt76: update to the latest version

f2a18f5 mt76x02: introduce mt76x02_beacon.c
91ade88 mt76x02: add hrtimer for pre TBTT for USB
6370485 mt76x02: introduce beacon_ops
37af803 mt76x02u: implement beacon_ops
41d6190 mt76x02: generalize some mmio beaconing functions
dcccc04 mt76x02u: add sta_ps
5ac5289 mt76x02: disable HW encryption for group frames
e284cc2 mt76x02u: implement pre TBTT work for USB
77e56b8 mt76x02: make beacon slots bigger for USB
d4c740f mt76x02u: add mt76_release_buffered_frames
65e6344 mt76: unify set_tim
f720e49 mt76x02: enable AP mode for USB
cf1838d mt76usb: change mt76u_submit_buf
16b2ccf mt76: remove rx_page_lock
e1bfbeb mt76usb: change mt76u_fill_rx_sg arguments
e9c0171 mt76usb: use usb_dev private data
a4eb5db mt76usb: remove mt76u_buf redundant fileds
3f9b68d mt76usb: move mt76u_buf->done to queue entry
4a366bd mt76usb: remove mt76u_buf and use urb directly
0904bc4 mt76usb: remove MT_RXQ_MAIN queue from mt76u_urb_alloc
42f2899 mt76usb: resue mt76u_urb_alloc for tx
4d4d73a mt76usb: remove unneded sg_init_table
57309c7 mt76usb: allocate urb and sg as linear data
2e89721 mt76usb: remove queue variable from rx_tasklet
30a256a mt76x02: remove extra_tx_headroom (obsoleted by mac8211 skb aligning)
ae166b0 Revert "mt76: mt7603: store software PN/IV in wcid"
bf6e72d Revert "mt76: mt76x02: store software PN/IV in wcid"
a11b673 mt76: fix tx power issues

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agokernel: bump 4.14 to 4.14.108
Koen Vandeputte [Mon, 25 Mar 2019 10:40:22 +0000 (11:40 +0100)]
kernel: bump 4.14 to 4.14.108

Refreshed all patches.

Altered patches:
- 950-0033-i2c-bcm2835-Add-debug-support.patch

Compile-tested on: ar71xx, cns3xxx, imx6, x86_64
Runtime-tested on: ar71xx, cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 months agokernel: bump 4.9 to 4.9.165
Koen Vandeputte [Mon, 25 Mar 2019 10:37:17 +0000 (11:37 +0100)]
kernel: bump 4.9 to 4.9.165

Refreshed all patches.

Compile-tested on: ar7
Runtime-tested on: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 months agoscripts/gen_image_generic.sh: fail on errors
Stijn Tintel [Tue, 26 Mar 2019 17:35:55 +0000 (19:35 +0200)]
scripts/gen_image_generic.sh: fail on errors

The script always exits with value 0, even if some of the commands fail.
This can potentially create broken, unbootable images, e.g. when
make_ext4fs fails due to TARGET_KERNEL_PARTSIZE being too small for the
kernel. Avoid this by failing the script when any command fails.

Acked-by: Jo-Philipp Wich <jo@mein.io>
Acked-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 months agoar71xx: add support for MikroTik RouterBOARD 922UAGS-5HPacD
Koen Vandeputte [Fri, 22 Mar 2019 12:02:40 +0000 (13:02 +0100)]
ar71xx: add support for MikroTik RouterBOARD 922UAGS-5HPacD

This patch adds support for the MikroTik RouterBOARD 922UAGS-5HPacD
with a built-in 802.11ac High-Power radio (31dBm).

See https://mikrotik.com/product/RB922UAGS-5HPacD for more info.

Specifications:
- SoC: Qualcomm Atheros QCA9557 (720 MHz)
- RAM: 128 MB
- Storage: 128 MB NAND
- Wireless: external QCA9882 802.11a/ac 2x2:2
- Ethernet: 1x 1000/100/10 Mbps, integrated, via AR8031 PHY, passive PoE-in 24V
- SFP: 1x host
- USB: 1x 2.0 type A
- PCIe: 1x Mini slot (also contains USB 2.0 for 3G/LTE modems)
- SIM slot: 1x mini-SIM

Working:
- Board/system detection
- NAND storage detection
- PCIe
- USB: Type A & mini PCIe
- Wireless
- Ethernet
- LED's (excl. SFP and RSSI levels)
- Reset button
- Sysupgrade

Not working:
- SFP cage

Installation:

- Boot vmlinux-initramfs image via BOOTP/TFTP and then flash sysupgrade
image using "sysupgrade -n"

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
2 months agomvebu: Add dependency to kmod-i2c-mux-pca954x for armada-macchiatobin
Hauke Mehrtens [Thu, 21 Mar 2019 16:57:00 +0000 (17:57 +0100)]
mvebu: Add dependency to kmod-i2c-mux-pca954x for armada-macchiatobin

This driver is needed for the I2C mux on the board.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
2 months agomvebu: Refresh kernel configuration
Hauke Mehrtens [Tue, 26 Mar 2019 00:23:24 +0000 (01:23 +0100)]
mvebu: Refresh kernel configuration

This refreshes the current kernel configuration to remove unneeded
options, add some automatically added ones and reorders them. The normal
build did this automatically, so the builds already used this
configuration.

CONFIG_HW_RANDOM_OMAP is explicitly activated for the cortexa72
subtarget because it has an inside-secure,safexcel-eip76 IP core.

This was done with this command on the cortexa9 subtarget:
make kernel_oldconfig
and this one on the other subtargets:
make kernel_oldconfig CONFIG_TARGET=subtarget

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 months agomvebu: Fix typo in MACCHIATOBin detection
Hauke Mehrtens [Thu, 21 Mar 2019 16:56:59 +0000 (17:56 +0100)]
mvebu: Fix typo in MACCHIATOBin detection

The name in the device tree file is written with two C.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
2 months agolinux: Add kmod-sched-act-vlan
Hauke Mehrtens [Thu, 21 Mar 2019 18:16:18 +0000 (19:16 +0100)]
linux: Add kmod-sched-act-vlan

This allows to configure rules to push or pop vlan headers.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
2 months agolinux: Add kmod-sched-flower
Hauke Mehrtens [Thu, 21 Mar 2019 18:16:17 +0000 (19:16 +0100)]
linux: Add kmod-sched-flower

This allows to classify packets based on a configurable combination
of packet keys and masks.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
2 months agolinux: Add kmod-sched-mqprio
Hauke Mehrtens [Thu, 21 Mar 2019 18:16:16 +0000 (19:16 +0100)]
linux: Add kmod-sched-mqprio

This adds Multi-queue priority scheduler (MQPRIO).

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
2 months agolinux: Add kmod-crxypto-xcbc
Hauke Mehrtens [Thu, 21 Mar 2019 18:16:15 +0000 (19:16 +0100)]
linux: Add kmod-crxypto-xcbc

This can be used for IPsec.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
2 months agodropbear: split ECC support to basic and full
Konstantin Demin [Mon, 25 Mar 2019 19:00:28 +0000 (22:00 +0300)]
dropbear: split ECC support to basic and full

- limit ECC support to ec*-sha2-nistp256:
  * DROPBEAR_ECC now provides only basic support for ECC
- provide full ECC support as an option:
  * DROPBEAR_ECC_FULL brings back support for ec{dh,dsa}-sha2-nistp{384,521}
- update feature costs in binary size

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: rewrite init script startup logic to handle both host key files
Konstantin Demin [Mon, 25 Mar 2019 18:59:47 +0000 (21:59 +0300)]
dropbear: rewrite init script startup logic to handle both host key files

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: change type of config option "Port" to scalar type "port"
Konstantin Demin [Mon, 25 Mar 2019 18:42:09 +0000 (21:42 +0300)]
dropbear: change type of config option "Port" to scalar type "port"

it was never used anywhere, even LuCI works with "Port" as scalar type.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: introduce config option "keyfile" (replacement for "rsakeyfile")
Konstantin Demin [Mon, 25 Mar 2019 18:42:01 +0000 (21:42 +0300)]
dropbear: introduce config option "keyfile" (replacement for "rsakeyfile")

* option "keyfile" is more generic than "rsakeyfile".
* option "rsakeyfile" is considered to be deprecated and should be removed
  in future releases.
* warn user (in syslog) if option "rsakeyfile" is used
* better check options ("rsakeyfile" and "keyfile"): don't append
  "-r keyfile" to command line if file is absent (doesn't exist or empty),
  warn user (in syslog) about such files

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: add initial support for ECC host key
Konstantin Demin [Mon, 25 Mar 2019 18:41:45 +0000 (21:41 +0300)]
dropbear: add initial support for ECC host key

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: fix regression where TTY modes weren't reset for client
Konstantin Demin [Mon, 25 Mar 2019 18:41:37 +0000 (21:41 +0300)]
dropbear: fix regression where TTY modes weren't reset for client

cherry-pick upstream commit 7bc6280613f5ab4ee86c14c779739070e5784dfe

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: honour CFLAGS while building bundled libtomcrypt/libtommath
Konstantin Demin [Mon, 25 Mar 2019 18:41:27 +0000 (21:41 +0300)]
dropbear: honour CFLAGS while building bundled libtomcrypt/libtommath

Felix Fietkau pointed out that bundled libtomcrypt/libtommath do funny stuff with CFLAGS.
fix this with checking environment variable OPENWRT_BUILD in both libs.
change in dropbear binary size is drastical: 221621 -> 164277.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: fix hardening flags during configure
Konstantin Demin [Mon, 25 Mar 2019 18:40:59 +0000 (21:40 +0300)]
dropbear: fix hardening flags during configure

compiler complains about messed up CFLAGS in build log:
  <command-line>: warning: "_FORTIFY_SOURCE" redefined
  <command-line>: note: this is the location of the previous definition

and then linker fails:
  mips-openwrt-linux-musl-gcc [...] -o dropbearmulti [...]
  collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
  compilation terminated.
  /staging_dir/toolchain-mips_24kc_gcc-8.2.0_musl/mips-openwrt-linux-musl/bin/ld: /tmp/cc27zORz.ltrans0.ltrans.o: relocation R_MIPS_HI16 against `cipher_descriptor' can not be used when making a shared object; recompile with -fPIC
  /staging_dir/toolchain-mips_24kc_gcc-8.2.0_musl/mips-openwrt-linux-musl/bin/ld: /tmp/cc27zORz.ltrans1.ltrans.o: relocation R_MIPS_HI16 against `ses' can not be used when making a shared object; recompile with -fPIC
  /staging_dir/toolchain-mips_24kc_gcc-8.2.0_musl/mips-openwrt-linux-musl/bin/ld: /tmp/cc27zORz.ltrans2.ltrans.o: relocation R_MIPS_HI16 against `cipher_descriptor' can not be used when making a shared object; recompile with -fPIC
  /staging_dir/toolchain-mips_24kc_gcc-8.2.0_musl/mips-openwrt-linux-musl/bin/ld: BFD (GNU Binutils) 2.31.1 assertion fail elfxx-mips.c:6550
  [...]
  /staging_dir/toolchain-mips_24kc_gcc-8.2.0_musl/mips-openwrt-linux-musl/bin/ld: BFD (GNU Binutils) 2.31.1 assertion fail elfxx-mips.c:6550
  make[3]: *** [Makefile:198: dropbearmulti] Error 1
  make[3]: *** Deleting file 'dropbearmulti'
  make[3]: Leaving directory '/build_dir/target-mips_24kc_musl/dropbear-2018.76'
  make[2]: *** [Makefile:158: /build_dir/target-mips_24kc_musl/dropbear-2018.76/.built] Error 2
  make[2]: Leaving directory '/package/network/services/dropbear'

This FTBFS issue was caused by hardening flags set up by dropbear's configure script.

By default, Dropbear offers hardening via CFLAGS and LDFLAGS,
but this may break or confuse OpenWrt settings.

Remove most Dropbear's hardening settings in favour of precise build,
but preserve Spectre v2 mitigations:
* -mfunction-return=thunk
* -mindirect-branch=thunk

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agodropbear: bump to 2019.77
Konstantin Demin [Mon, 25 Mar 2019 18:40:38 +0000 (21:40 +0300)]
dropbear: bump to 2019.77

- drop patches applied upstream:
  * 010-runtime-maxauthtries.patch
  * 020-Wait-to-fail-invalid-usernames.patch
  * 150-dbconvert_standalone.patch
  * 610-skip-default-keys-in-custom-runs.patch
- refresh patches
- move OpenWrt configuration from patch to Build/Configure recipe,
  thus drop patch 120-openwrt_options.patch

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 months agoath10k-ct: Update to 2019-03-25
Christian Lamparter [Mon, 25 Mar 2019 17:27:59 +0000 (18:27 +0100)]
ath10k-ct: Update to 2019-03-25

2e917efb607f ath10k: Add slow-pci bus work-around, sw-crypt blockack support.
cc73ceb0dbc7 ath10k: Fix out-of-tree compile for 4.16 driver.
4b3cf7c20972 ath10k: Improve tx-status reporting.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 months agoath10k-firmware: update Candela Tech firmware images
Christian Lamparter [Mon, 25 Mar 2019 17:14:05 +0000 (18:14 +0100)]
ath10k-firmware: update Candela Tech firmware images

Release notes since last time:

Release notes for wave-1:

- 2019-03-12: Add btcoex feature flag for 2.4Ghz only adapters,
      backported from upstream 10.2 firmware.

- 2019-03-12: Support offloading decrypt of PMF blockack frames
      to the host. This lets us do blockack with PMF and
      rx-sw-crypt. Normal hwcrypt scenarios would not need this.

Release notes for wave-2:

- 2019-03-12: Fix crash when tearing down VI TID when pending frames
      exist. Could reproduce this while doing rmmod when VI
      traffic was flowing and PMF was enabled but broken.
      Bad luck could rarely cause it to happen in more normal
      config too.

- 2019-03-12: Support offloading decrypt of PMF blockack frames to
      the host.  This lets us do blockack with PMF and
      rx-sw-crypt. Normal hwcrypt scenarios would not need this.

- 2019-03-12: Re-work problematic patch that attempted to fix transmit
      on non-QOS tids. It appears buggy in several ways,
      hopefully improved now.  This was introduced last fall.
      See github bug 78.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 months agogemini: Classify Raidsonic NAS IB-4220-B as a NAS
Christian Lamparter [Sun, 24 Mar 2019 21:00:15 +0000 (22:00 +0100)]
gemini: Classify Raidsonic NAS IB-4220-B as a NAS

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 months agogemini: D-Link DNS-313 is a NAS
Christian Lamparter [Sun, 24 Mar 2019 20:59:06 +0000 (21:59 +0100)]
gemini: D-Link DNS-313 is a NAS

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 months agoapm821xx: MBL: set DEVICE_TYPE to NAS
Christian Lamparter [Sun, 24 Mar 2019 20:53:29 +0000 (21:53 +0100)]
apm821xx: MBL: set DEVICE_TYPE to NAS

The MyBook Live is a NAS.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 months agotoolchain: ARM: Fix option conflict with multiarch
Boris Krasnovskiy [Thu, 21 Mar 2019 03:00:51 +0000 (23:00 -0400)]
toolchain: ARM: Fix option conflict with multiarch

This problem exposed when compiling glibc, but applicable across the
board. gcc compiles runtime libraries for all supported architectures,
unless otherwise specified, and later selects applicable library based
-m[arch,cpu,*] options, thus these options should not be passed to gcc
as they break the compilation process.

Signed-off-by: Boris Krasnovskiy <borkra@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[modified so it only touches ARM - I'm too chicken, changed authors email]

2 months agotoolchain: ARM: Fix toolchain compilation for gcc 8.x
Boris Krasnovskiy [Sun, 10 Mar 2019 01:45:43 +0000 (20:45 -0500)]
toolchain: ARM: Fix toolchain compilation for gcc 8.x

Set the toolchain's ARM CPU and FPU architectures by utilizing' gcc's
--with-cpu / --with-fpu configure options that: "Specify which cpu
variant the compiler should generate code for by default. cpu will
be used as the default value of the -mcpu= switch."

This will resolve the following kernel compilation failures under
gcc 8.x on ARM because the kernel wants to set (possibly conflicting)
optimization flags.

.../ccyVnmrs.s:204: Error: selected processor does not support `dmb ish' in ARM mode
.../ccyVnmrs.s:215: Error: architectural extension `mp' is not allowed for the current base architecture
.../ccyVnmrs.s:216: Error: selected processor does not support `pldw [r4]' in ARM mode

Because this is a big change, the .config and toolchain need to be
refreshed (as in removed and regenerated).

Reported-by: Ansuel Smith <ansuelsmth@gmail.com>
Reported-by: Daniel Engberg <daniel.engberg.lists@pyret.net> [#1203]
Signed-off-by: Boris Krasnovskiy <borkra@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [extended commit message,
removed now-deprecated CPU_CFLAGS, changed author to gmail address]

2 months agoipq40xx: essedma: Add fix for memory allocation issues
Christian Lamparter [Tue, 19 Mar 2019 15:44:21 +0000 (16:44 +0100)]
ipq40xx: essedma: Add fix for memory allocation issues

This patch adds a ChromiumOS 3.18 patch [0] that fixes memory
allocation issues under memory pressure by keeping track
of missed allocs and rectify the omission at a later date.
It also adds ethtool counters for memory allocation
failures accounting so this can be verified.

[0] <https://chromium.googlesource.com/chromiumos/third_party/kernel/+/d4e1e4ce6801f9eddce056c58f5a288864955265>

Reported-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 months agotools/ccache: update to 3.6
Deng Qingfang [Fri, 15 Mar 2019 18:05:04 +0000 (02:05 +0800)]
tools/ccache: update to 3.6

Update ccache to 3.6

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
2 months agoramips: allow packets with ttl=0
Felix Fietkau [Sun, 24 Mar 2019 11:05:56 +0000 (12:05 +0100)]
ramips: allow packets with ttl=0

Some broken ISPs (e.g. Comcast) send DHCPv6 packets with hop limit=0.
This trips up the TTL=0 check in the PPE if enabled.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 months agoath79: add support for COMFAST CF-E5/E7
Ding Tengfei [Thu, 21 Mar 2019 11:50:01 +0000 (19:50 +0800)]
ath79: add support for COMFAST CF-E5/E7

COMFAST CF-E5/E7 is a outdoor 4G LTE AP with PoE support, based on
Qualcomm/Atheros QCA9531.

Short specification:

    2x 10/100 Mbps Ethernet, with 24v PoE support
    64 MB of RAM (DDR2)
    16 MB of FLASH (SPI)
    2T2R 2.4 GHz, 802.11b/g/n
    built-in 1x 3 dBi antennas
    output power (max): 80 mW (19 dBm)
    Qucetel EC20 LTE MODULE(1x external detachable antenna)

Flash instruction:

Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.

Signed-off-by: Ding Tengfei <dtf@comfast.cn>
[commit subject fix]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 months agoath79: add TP-Link TL-WR710N v1
Marcin Jurkowski [Sun, 16 Dec 2018 01:22:45 +0000 (02:22 +0100)]
ath79: add TP-Link TL-WR710N v1

This commit adds support for TP-Link TL-WR710N v1 router.

CPU: Atheros AR9331 400MHz
RAM: 32MB
FLASH: 8MiB
PORTS: 1 Port 100/10 LAN (connected to a switch), 1 Port 100/10 WAN
WiFi: Atheros AR9331 1x2:1 bgn
USB: ChipIdea HDRC USB2.0
LED: SYS
BTN: Reset

Sysupgrade from `ar71xx` works without glitches.
Network interfaces assigned for LAN and WAN ports are `eth1` and `eth0`
respectively, what's consistent with `ar71xx` target. Wireless radio
path is automatically upgraded from `platform/ar933x_wmac` to
`platform/ahb/18100000.wmac`.

Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
2 months agoath79: add support for TP-Link TL-WR941N v7 (CN)
Chuanhong Guo [Sun, 20 Jan 2019 15:30:27 +0000 (23:30 +0800)]
ath79: add support for TP-Link TL-WR941N v7 (CN)

This adds support for the Chinese version of TL-WR941N v7.
It uses QCA9558+AR8236 while the international version
uses TP9343 instead.

Specification:
- SoC: Qualcomm Atheros QCA9558
- Flash: 4 MB
- RAM: 64 MB
- Ethernet: Atheros AR8236 with 5 FE ports

Flash instruction:
  Upload the generated factory firmware on web interface.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 months agoath79: ag71xx: remove switch driver in ag71xx
Chuanhong Guo [Fri, 11 Jan 2019 06:00:03 +0000 (14:00 +0800)]
ath79: ag71xx: remove switch driver in ag71xx

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 months agoath79: use ar8216 for builtin switch
Chuanhong Guo [Fri, 11 Jan 2019 05:58:28 +0000 (13:58 +0800)]
ath79: use ar8216 for builtin switch

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 months agogeneric: ar8216: introduce qca,mib-poll-interval property
Chuanhong Guo [Wed, 23 Jan 2019 05:46:15 +0000 (13:46 +0800)]
generic: ar8216: introduce qca,mib-poll-interval property

This allows users to specify a shorter mib poll interval so that the
swconfig leds could behave normal with current get_port_stats()
implementation.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 months agogeneric: ar8216: do a software reset for switch during hw_init
Chuanhong Guo [Sun, 20 Jan 2019 14:25:25 +0000 (22:25 +0800)]
generic: ar8216: do a software reset for switch during hw_init

This applies to ar8216 and ar8236. QCA's newer U-boot will enable
the switch mdio master for FE switches which makes phy inaccessible
from CPU mdio. (e.g. on TP-Link TL-WR941N v7 Chinese version which
uses QCA9558+AR8236.) For these devices PHY probing is broken and
mdio device probing is a must. We also need to disable switch mdio
master in driver for later PHY initialization.

Do a soft reset during hw_init so that mdio master can be disabled
and expose PHYs to CPU mdio for later PHY accessing.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 months agogeneric: ar8216: mib_work_func: read all port mibs everytime
Chuanhong Guo [Fri, 11 Jan 2019 05:18:30 +0000 (13:18 +0800)]
generic: ar8216: mib_work_func: read all port mibs everytime

ar8xxx_mib_capture will update mib counters for all ports. Current
code only update one port at a time and the data for other ports
are lost.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>