openwrt/staging/blogic.git
5 years agorpcd: fix init script reload action
Jo-Philipp Wich [Thu, 6 Jun 2019 09:27:11 +0000 (11:27 +0200)]
rpcd: fix init script reload action

Drop the legacy start() and stop() procedures and define a proper
reload signal action instead.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agokernel: backport act_ctinfo
Kevin Darbyshire-Bryant [Wed, 5 Jun 2019 17:28:46 +0000 (18:28 +0100)]
kernel: backport act_ctinfo

ctinfo is a new tc filter action module.  It is designed to restore
information contained in firewall conntrack marks to other packet fields
and is typically used on packet ingress paths.  At present it has two
independent sub-functions or operating modes, DSCP restoration mode &
skb mark restoration mode.

The DSCP restore mode:

This mode copies DSCP values that have been placed in the firewall
conntrack mark back into the IPv4/v6 diffserv fields of relevant
packets.

The DSCP restoration is intended for use and has been found useful for
restoring ingress classifications based on egress classifications across
links that bleach or otherwise change DSCP, typically home ISP Internet
links.  Restoring DSCP on ingress on the WAN link allows qdiscs such as
but by no means limited to CAKE to shape inbound packets according to
policies that are easier to set & mark on egress.

Ingress classification is traditionally a challenging task since
iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT
lookups, hence are unable to see internal IPv4 addresses as used on the
typical home masquerading gateway.  Thus marking the connection in some
manner on egress for later restoration of classification on ingress is
easier to implement.

Parameters related to DSCP restore mode:

dscpmask - a 32 bit mask of 6 contiguous bits and indicate bits of the
conntrack mark field contain the DSCP value to be restored.

statemask - a 32 bit mask of (usually) 1 bit length, outside the area
specified by dscpmask.  This represents a conditional operation flag
whereby the DSCP is only restored if the flag is set.  This is useful to
implement a 'one shot' iptables based classification where the
'complicated' iptables rules are only run once to classify the
connection on initial (egress) packet and subsequent packets are all
marked/restored with the same DSCP.  A mask of zero disables the
conditional behaviour ie. the conntrack mark DSCP bits are always
restored to the ip diffserv field (assuming the conntrack entry is found
& the skb is an ipv4/ipv6 type)

e.g. dscpmask 0xfc000000 statemask 0x01000000

|----0xFC----conntrack mark----000000---|
| Bits 31-26 | bit 25 | bit24 |~~~ Bit 0|
| DSCP       | unused | flag  |unused   |
|-----------------------0x01---000000---|
      |                   |
      |                   |
      ---|             Conditional flag
         v             only restore if set
|-ip diffserv-|
| 6 bits      |
|-------------|

The skb mark restore mode (cpmark):

This mode copies the firewall conntrack mark to the skb's mark field.
It is completely the functional equivalent of the existing act_connmark
action with the additional feature of being able to apply a mask to the
restored value.

Parameters related to skb mark restore mode:

mask - a 32 bit mask applied to the firewall conntrack mark to mask out
bits unwanted for restoration.  This can be useful where the conntrack
mark is being used for different purposes by different applications.  If
not specified and by default the whole mark field is copied (i.e.
default mask of 0xffffffff)

e.g. mask 0x00ffffff to mask out the top 8 bits being used by the
aforementioned DSCP restore mode.

|----0x00----conntrack mark----ffffff---|
| Bits 31-24 |                          |
| DSCP & flag|      some value here     |
|---------------------------------------|
|
|
v
|------------skb mark-------------------|
|            |                          |
|  zeroed    |                          |
|---------------------------------------|

Overall parameters:

zone - conntrack zone

control - action related control (reclassify | pipe | drop | continue |
ok | goto chain <CHAIN_INDEX>)

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Make suitable adjustments for backporting to 4.14 & 4.19

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years agorpcd: update to the latest git head
Petr Štetiar [Wed, 5 Jun 2019 11:14:29 +0000 (13:14 +0200)]
rpcd: update to the latest git head

 89bfaa424606 Fix possible linker errors by using CMake find_library macro
 569284a119f9 session: handle NULL return values of crypt()

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agokernel: bump 4.19 to 4.19.48
Koen Vandeputte [Tue, 4 Jun 2019 14:31:31 +0000 (16:31 +0200)]
kernel: bump 4.19 to 4.19.48

Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: generic: make kernel-debug.tar.bz2 usable again
Petr Štetiar [Mon, 3 Jun 2019 11:09:31 +0000 (13:09 +0200)]
kernel: generic: make kernel-debug.tar.bz2 usable again

This patch removes 202-reduce_module_size.patch which is causing missing
debug symbols in kernel modules, leading to unusable
kernel-debug.tar.bz2 on all platforms, making debugging of release
kernel crashes difficult.

Cc: Felix Fietkau <nbd@nbd.name>
Acked-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoramips: add support for TOTOLINK LR1200
Chuanhong Guo [Thu, 16 May 2019 07:09:07 +0000 (15:09 +0800)]
ramips: add support for TOTOLINK LR1200

Specifications:
- SoC: MT7628DAN (MT7628AN with 64MB built-in RAM)
- Flash: 8M SPI NOR
- Ethernet: 5x 10/100Mbps
- WiFi: 2.4G: MT7628 built-in
        5G: MT7612E
- 1x miniPCIe slot for LTE modem (only USB pins connected)
- 1x SIM slot

Flash instruction:
U-boot has a builtin web recovery page:
1. Hold the reset button while powering it up
2. Connect to the ethernet and set an IP in 192.168.1.0/24 range
3. Open your browser and upload firmware through http://192.168.1.1

Note about the LTE modem:
If your router comes with an EC25 module and it doesn't show up
as a QMI device, you should do the following to switch it to QMI
mode:
1. Install kmod-usb-serial-option and a terminal software
   (e.g. minicom or screen). All 4 serial ports of the modem
   should be available now.
2. Open /dev/ttyUSB3 with the terminal software and type this
   AT command: AT+QCFG="usbnet",0
3. Power-cycle the router. You should now get a QMI device
   recognized.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agoath79: add support for 8devices Carambola2 development board
Rytis Zigmantavičius [Thu, 11 Apr 2019 16:31:23 +0000 (19:31 +0300)]
ath79: add support for 8devices Carambola2 development board

Specifications:
- Atheros AR9331 (400 MHz)
- 64 MB of RAM (DDR2)
- 16 MB of Flash (SPI)
- 1T1R 2.4 Wlan (AR9331)
- 2x 10/100 Mbps Ethernet
- 3x LEDs, 1x gpio button
- 1x USB 2.0, 5V
- UART over usb, 115200n8

Upgrading from ar71xx target:
- Put image into board:
    scp openwrt-ath79-generic-8dev_carambola2-squashfs-sysupgrade.bin \
        root@192.168.1.1/tmp/
- Run sysupgrade
    sysupgrade /tmp/sysupgrade.bin

Upgrading from u-boot:
- Set up tftp server with sysupgrade.bin image
- Go to u-boot (reboot and press ESC when prompted)
- Set TFTP server IP
    setenv serverip 192.168.1.254
- Set device ip from same subnet
    setenv ipaddr 192.168.1.1
- Copy new firmware to board
    tftpboot 0x81000000 sysupgrade.bin
- erase flash
    erase 0x9f050000 +${filesize}
- flash firmware
    cp.b 0x81000000 0x9f050000 ${filesize}
- Reset board
    reset

Signed-off-by: Rytis Zigmantavičius <rytis.z@8devices.com>
[wrapped long line in commit description, whitespace and art address
 fix in DTS, keep default lan/wan setup, removed -n in sysupgrade]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoath79: Add support for ZBT-WD323
Kristian Evensen [Fri, 31 May 2019 13:43:14 +0000 (15:43 +0200)]
ath79: Add support for ZBT-WD323

ZBT-WD323 is a dual-LTE router based on AR9344. The detailed
specifications are:

* AR9344 560MHz/450MHz/225MHz (CPU/DDR/AHN).
* 128 MB RAM
* 16MB of flash(SPI-NOR, 22MHz)
* 1x 2.4GHz wifi (Atheros AR9340)
* 3x 10/100Mbos Ethernet (AR8229)
* 1x USB2.0 port
* 2x miniPCIe-slots (USB2.0 only)
* 2x SIM slots (standard size)
* 4x LEDs (1 gpio controlled)
* 1x reset button
* 1x 10 pin terminal block (RS232, RS485, 4x GPIO)
* 2x CP210x UART bridge controllers (used for RS232 and RS485)
* 1x 2 pin 5mm industrial interface (input voltage 12V~36V)
* 1x DC jack
* 1x RTC (PCF8563)

Tested:
- Ethernet switch
- Wifi
- USB port
- MiniPCIe-slots (+ SIM slots)
- Sysupgrade
- Reset button
- RS232

Intallation and recovery:

The board ships with OpenWRT, but sysupgrade does not work as a
different firmware format than what is expected is generated.  The
easiest way to install (and recover) the router, is to use the
web-interface provided by the bootloader (Breed).

While the interface is in Chinese, it is easy to use. First, in order to
access the interface, you need to hold down the reset button for around
five seconds. Then, go to 192.168.1.1 in your browser. Click on the
second item in the list on the left to access the recovery page. The
second item on the next page is where you select the firmware.  Select
the menu item containing "Atheros SDK" and "16MB" in the dropdown close
to the buttom, and click on the button at the bottom to start
installation/recovery.

Notes:
* RS232 is available on /dev/ttyUSB0 and RS485 on /dev/ttyUSB1

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
[removed unused poll-interval from gpio-keys, i2c-gpio 4.19 compat]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoath79: fix default config for devices with eth0/eth1 swapped
Chuanhong Guo [Thu, 16 May 2019 04:50:10 +0000 (12:50 +0800)]
ath79: fix default config for devices with eth0/eth1 swapped

also fix the following problems in this commit:
glinet,gl-ar150: This router uses an uncommon order of setting up gmacs
                 in ar71xx. gmac0 is preferred to be wan port because of
                 the additional link status info available. So this
                 router will have eth0/eth1 swapped comparing to ar71xx.
tplink,tl-wr710n-v1: same as gl-ar150
embeddedwireless,dorin: eth0 is used as switch port, which was incorrect.
                        It's correct now, so keep this one untouched.
tplink,tl-wr842n-v1: we don't swap PHYs on ar7241 so the original port order
                     is incorrect.
reorder archer-a7-v5 entry.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agoath79: dts: drop "simple-mfd" for gmacs in SoC dtsi
Chuanhong Guo [Fri, 10 May 2019 15:28:47 +0000 (23:28 +0800)]
ath79: dts: drop "simple-mfd" for gmacs in SoC dtsi

With a proper probe deferring for ag71xx we don't need to explicitly
probe mdio1 before gmac0.
Drop all "simple-mfd" in SoC dtsi so that gmac orders can be the same
as ar71xx.
This makes eth0/eth1 order the same as those in ar71xx, which means
we don't need a migration script for this anymore and we can merge
incorrectly split gmac/mdio driver back together.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agoath79: ag71xx: defer probe if of_phy_connect failed
Chuanhong Guo [Fri, 10 May 2019 14:17:28 +0000 (22:17 +0800)]
ath79: ag71xx: defer probe if of_phy_connect failed

gmac0 may need a phy on builtin switch, which can be unavailable
if gmac0 is probed before builtin switch.
Return -EPROBE_DEFER in this case so that gmac0 can be probed
later.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agoath79: rework LED configurations for tplink,archer-d50-v1
Chuanhong Guo [Mon, 20 May 2019 13:26:03 +0000 (21:26 +0800)]
ath79: rework LED configurations for tplink,archer-d50-v1

The original one has the following problem:
1. Port mask of lan led includes wan port.
2. By using netdev trigger with vlan port, the link led
   is always on.

This commits fixes the above problems by correcting port
mask for lan led and use swconfig trigger for wan leds.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agoramips: mt7620: fix 5GHz WiFi LED on DWR-118-A1
Pawel Dembicki [Wed, 29 May 2019 08:40:36 +0000 (10:40 +0200)]
ramips: mt7620: fix 5GHz WiFi LED on DWR-118-A1

Support for D-Link DWR-118 A1 was added before LEDs feature
in mt76x0e driver.

This fixes the 5GHz WiFi LED which was previously inverted.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
5 years agoar71xx: ag71xx: update ethtool support
Petr Štetiar [Fri, 24 May 2019 23:34:42 +0000 (01:34 +0200)]
ar71xx: ag71xx: update ethtool support

Remove references to broken and mostly deprecated phy_ethtool_ioctl, use
new {s,g}et_link_ksettings and add nway_reset which was previously
handled in phy_ethtool_ioctl.

Cc: John Crispin <john@phrozen.org>
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1982
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoath79: ag71xx: update ethtool support
Petr Štetiar [Fri, 24 May 2019 22:24:35 +0000 (00:24 +0200)]
ath79: ag71xx: update ethtool support

ethtool doesn't work currently as phy_ethtool_ioctl expects user space
pointer, but it's being passed kernel one. Fixing it doesn't make sense
as {s,g}et_settings were deprecated anyway.  So let's rather remove
phy_ethtool_ioctl and use new {s,g}et_link_ksettings instead. While at
it, update nway_reset as well.

Cc: John Crispin <john@phrozen.org>
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1982
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoar71xx: ag71xx: remove unused SIOCETHTOOL ioctl handling
Petr Štetiar [Fri, 24 May 2019 23:14:53 +0000 (01:14 +0200)]
ar71xx: ag71xx: remove unused SIOCETHTOOL ioctl handling

This ioctl is currently routed through generic interface code:

  dev_ioctl
    dev_ethtool
      __ethtool_get_link_ksettings
        phy_ethtool_ioctl

Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoath79: ag71xx: remove unused SIOCETHTOOL ioctl handling
Petr Štetiar [Fri, 24 May 2019 21:49:40 +0000 (23:49 +0200)]
ath79: ag71xx: remove unused SIOCETHTOOL ioctl handling

This ioctl is currently routed through generic interface code:

 dev_ioctl
   dev_ethtool
     __ethtool_get_link_ksettings
       phy_ethtool_ioctl

Cc: John Crispin <john@phrozen.org>
Cc: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoramips: ethernet: remove unused SIOCETHTOOL ioctl handling
Petr Štetiar [Sat, 25 May 2019 10:06:14 +0000 (12:06 +0200)]
ramips: ethernet: remove unused SIOCETHTOOL ioctl handling

This ioctl is currently routed through generic interface code.

  dev_ioctl
    dev_ethtool
      __ethtool_get_link_ksettings
        phy_ethtool_ioctl

Cc: Felix Fietkau <nbd@nbd.name>
Cc: John Crispin <john@phrozen.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agokernel: generic: remove broken and obsolete phy_ethtool_ioctl
Petr Štetiar [Fri, 24 May 2019 22:20:31 +0000 (00:20 +0200)]
kernel: generic: remove broken and obsolete phy_ethtool_ioctl

Remove 701-phy_extension.patch from 4.14 and 4.19 kernel, as it's
currenlty broken and fixing doesn't make sense as most of it is
deprecated anyway.

Cc: John Crispin <john@phrozen.org>
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1982
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agolibunwind: bump to version 1.3.1
Yousong Zhou [Tue, 4 Jun 2019 06:33:52 +0000 (06:33 +0000)]
libunwind: bump to version 1.3.1

Libunwind provides a sigreturn stub for x86 in version 1.2 [1].  However
the arch still depends on setcontext() which is unavailable in musl-libc
and which is supposed to be "deprecated everywhere" [2]

 [1] x86 sigreturn unimplemented for some libcs,
     https://github.com/libunwind/libunwind/issues/13
 [2] setcontext deprecated on x86,
     https://github.com/libunwind/libunwind/issues/69

Refs: https://github.com/openwrt/packages/issues/8548#issuecomment-497791552
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years agokernel: bump 4.19 to 4.19.47
Koen Vandeputte [Mon, 3 Jun 2019 12:03:29 +0000 (14:03 +0200)]
kernel: bump 4.19 to 4.19.47

Refreshed all patches.

Compile-tested on: imx6
Runtime-tested on: imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.14 to 4.14.123
Koen Vandeputte [Mon, 3 Jun 2019 11:40:15 +0000 (13:40 +0200)]
kernel: bump 4.14 to 4.14.123

Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.9 to 4.9.180
Koen Vandeputte [Mon, 3 Jun 2019 10:48:57 +0000 (12:48 +0200)]
kernel: bump 4.9 to 4.9.180

Refreshed all patches.

Compile-tested: ar7
Runtime-tested: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.19 to 4.19.46
Koen Vandeputte [Tue, 28 May 2019 10:28:11 +0000 (12:28 +0200)]
kernel: bump 4.19 to 4.19.46

Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.14 to 4.14.122
Koen Vandeputte [Tue, 28 May 2019 10:14:03 +0000 (12:14 +0200)]
kernel: bump 4.14 to 4.14.122

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>
5 years agokernel: bump 4.9 to 4.9.179
Koen Vandeputte [Tue, 28 May 2019 09:23:18 +0000 (11:23 +0200)]
kernel: bump 4.9 to 4.9.179

Refreshed all patches.

Compile-tested: ar7
Runtime-tested: none

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agoapm821xx: backport accepted linux-crypto patches to 4.19
Christian Lamparter [Fri, 31 May 2019 18:13:55 +0000 (20:13 +0200)]
apm821xx: backport accepted linux-crypto patches to 4.19

This patch brings the crypto4xx driver up to the latest
upstream changes.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoapm821xx: backport accepted linux-crypto patches to 4.14
Christian Lamparter [Fri, 31 May 2019 17:30:00 +0000 (19:30 +0200)]
apm821xx: backport accepted linux-crypto patches to 4.14

This patch brings the crypto4xx driver up to the latest
upstream changes.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoapm821xx: MX60: convert to interrupt-driven gpio-key driver
Christian Lamparter [Fri, 31 May 2019 14:29:32 +0000 (16:29 +0200)]
apm821xx: MX60: convert to interrupt-driven gpio-key driver

This patch converts the device to use the gpio-key
over gpio-key-polled driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoapm821xx: MR24: convert to interrupt-driven gpio-key driver
Christian Lamparter [Fri, 31 May 2019 14:28:51 +0000 (16:28 +0200)]
apm821xx: MR24: convert to interrupt-driven gpio-key driver

This patch converts the device to use the gpio-key
over gpio-key-polled driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoapm821xx: WNDAP6X0: convert to interrupt-driven gpio-key driver
Christian Lamparter [Fri, 31 May 2019 14:30:18 +0000 (16:30 +0200)]
apm821xx: WNDAP6X0: convert to interrupt-driven gpio-key driver

This patch converts the device to use the gpio-key
over gpio-key-polled driver.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoath79: fix QCA955x GMAC register size
David Bauer [Thu, 11 Apr 2019 15:59:42 +0000 (17:59 +0200)]
ath79: fix QCA955x GMAC register size

The register size of the QCA955x currently matches the size stated in
the datasheet. However, there are more hidden GMAC registers which are
needed for the SGMII workaround to work.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agowireguard: bump to 0.0.20190601
Jason A. Donenfeld [Sat, 1 Jun 2019 11:39:59 +0000 (13:39 +0200)]
wireguard: bump to 0.0.20190601

There was an issue with the backport compat layer in yesterday's snapshot,
causing issues on certain (mostly Atom) Intel chips on kernels older than
4.2, due to the use of xgetbv without checking cpu flags for xsave support.
This manifested itself simply at module load time. Indeed it's somewhat tricky
to support 33 different kernel versions (3.10+), plus weird distro
frankenkernels.

If OpenWRT doesn't support < 4.2, you probably don't need to apply this.
But it also can't hurt, and probably best to stay updated.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
5 years agowireguard: bump to 0.0.20190531
Jason A. Donenfeld [Fri, 31 May 2019 16:50:33 +0000 (18:50 +0200)]
wireguard: bump to 0.0.20190531

* tools: add wincompat layer to wg(8)

Consistent with a lot of the Windows work we've been doing this last cycle,
wg(8) now supports the WireGuard for Windows app by talking through a named
pipe. You can compile this as `PLATFORM=windows make -C src/tools` with mingw.
Because programming things for Windows is pretty ugly, we've done this via a
separate standalone wincompat layer, so that we don't pollute our pretty *nix
utility.

* compat: udp_tunnel: force cast sk_data_ready

This is a hack to work around broken Android kernel wrapper scripts.

* wg-quick: freebsd: workaround SIOCGIFSTATUS race in FreeBSD kernel

FreeBSD had a number of kernel race conditions, some of which we can vaguely
work around. These are in the process of being fixed upstream, but probably
people won't update for a while.

* wg-quick: make darwin and freebsd path search strict like linux

Correctness.

* socket: set ignore_df=1 on xmit

This was intended from early on but didn't work on IPv6 without the ignore_df
flag. It allows sending fragments over IPv6.

* qemu: use newer iproute2 and kernel
* qemu: build iproute2 with libmnl support
* qemu: do not check for alignment with ubsan

The QEMU build system has been improved to compile newer versions. Linking
against libmnl gives us better error messages. As well, enabling the alignment
check on x86 UBSAN isn't realistic.

* wg-quick: look up existing routes properly
* wg-quick: specify protocol to ip(8), because of inconsistencies

The route inclusion check was wrong prior, and Linux 5.1 made it break
entirely. This makes a better invocation of `ip route show match`.

* netlink: use new strict length types in policy for 5.2
* kbuild: account for recent upstream changes
* zinc: arm64: use cpu_get_elf_hwcap accessor for 5.2

The usual churn of changes required for the upcoming 5.2.

* timers: add jitter on ack failure reinitiation

Correctness tweak in the timer system.

* blake2s,chacha: latency tweak
* blake2s: shorten ssse3 loop

In every odd-numbered round, instead of operating over the state
    x00 x01 x02 x03
    x05 x06 x07 x04
    x10 x11 x08 x09
    x15 x12 x13 x14
we operate over the rotated state
    x03 x00 x01 x02
    x04 x05 x06 x07
    x09 x10 x11 x08
    x14 x15 x12 x13
The advantage here is that this requires no changes to the 'x04 x05 x06 x07'
row, which is in the critical path. This results in a noticeable latency
improvement of roughly R cycles, for R diagonal rounds in the primitive. As
well, the blake2s AVX implementation is now SSSE3 and considerably shorter.

* tools: allow setting WG_ENDPOINT_RESOLUTION_RETRIES

System integrators can now specify things like
WG_ENDPOINT_RESOLUTION_RETRIES=infinity when building wg(8)-based init
scripts and services, or 0, or any other integer.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
5 years agoramips: create R6220 dtsi and improve WNDR3700v5 support
Jan Hoffmann [Sun, 26 May 2019 13:01:09 +0000 (15:01 +0200)]
ramips: create R6220 dtsi and improve WNDR3700v5 support

The R6220 and WNDR3700v5 are identical apart from using NAND/NOR flash and
having a different casing. This adds a new cleaned up R6220.dtsi with the
common bits for both devices. Both devices now have feature parity.

Performed cleanup:
 * generic DTS node names
 * regulator for usb power
 * added missing pinctrl groups
 * use switch port instead of VLAN as trigger for WAN LED

Fixes for WNDR3700v5:
 * all LEDS work
 * correct ethernet MAC addresses

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
5 years agoramips: add support for Xiaomi Mi Router 4A (100M Edition)
Markus Scheck [Mon, 27 May 2019 17:25:22 +0000 (19:25 +0200)]
ramips: add support for Xiaomi Mi Router 4A (100M Edition)

- SoC:      MediaTek MT7628AN
- Flash:    16MB (Winbond W25Q128JV)
- RAM:      64MB
- Serial:   As marked on PCB, 3V3 logic, baudrate is 115200
- Ethernet: 3x 10/100 Mbps (switched, 2x LAN + WAN)
- WIFI0:    MT7628AN 2.4GHz 802.11b/g/n
- WIFI1:    MT7612EN 5GHz 802.11ac
- Antennas: 4x external (2 per radio), non-detachable
- LEDs:     Programmable power-LED (two-colored, yellow/blue)
            Non-programmable internet-LED (shows WAN-activity)
- Buttons:  Reset

INSTALLATION:

1. Connect to the serial port of the router and power it up.
   If you get a prompt asking for boot-mode, go to step 3.
2. Unplug the router after
       > Erasing SPI Flash...
       > raspi_erase: offs:20000 len:10000
   occurs on the serial port. Plug the router back in.
3. At the prompt select option 2 (Load system code then
   write to Flash via TFTP.)
4. Enter 192.168.1.1 as the device IP and 192.168.1.2 as the
   Server-IP.
5. Connect your computer to LAN1 and assign it as 192.168.1.2/24.
6. Rename the sysupgrade image to test.bin and serve it via TFTP.
7. Enter test.bin on the serial console and press enter.

Signed-off-by: Markus Scheck <markus@mscheck.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[added mt76 compatible]

5 years agobuild: add support to && in DEPENDS
Eneas U de Queiroz [Wed, 24 Apr 2019 22:29:43 +0000 (22:29 +0000)]
build: add support to && in DEPENDS

Adds support to && operand in DEPENDS.  Also, fixes generation of ||
dependencies by scripts/package-metadata.pl.

The precedence order from higher to lower is && then ||.  Use of
parentheses to change the order is not supported. As before, they are
silently ignored.  Use them for readability only.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [DMARC removal]
5 years agoopenssl: update to version 1.1.1c
Eneas U de Queiroz [Tue, 28 May 2019 20:07:57 +0000 (20:07 +0000)]
openssl: update to version 1.1.1c

Highlights of this version:
 - Prevent over long nonces in ChaCha20-Poly1305 (CVE-2019-1543)
 - Fix OPENSSL_config bug (patch removed)
 - Change the default RSA, DSA and DH size to 2048 bit instead of 1024.
 - Enable SHA3 pre-hashing for ECDSA and DSA

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [DMARC removal]
5 years agoath79: add leds migrations for archer-c7-v2 and v4
David Santamaría Rogado [Thu, 23 May 2019 21:38:07 +0000 (23:38 +0200)]
ath79: add leds migrations for archer-c7-v2 and v4

In ar71xx v2 has blue color defined because the same mach-*.c is also used
for TL-WDR4900 model with blue leds. ath79 v2 dts defines them as green.

For v4 the situation is the same as v5 so the conversion is identical only
v4 instead v5.

So now upgrading from ar71xx to ath79 should be also smoother for v2 and v4.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
5 years agoramips: add CUDY WR1000 support
Davide Fioravanti [Mon, 20 May 2019 03:20:37 +0000 (05:20 +0200)]
ramips: add CUDY WR1000 support

Cudy WR1200 is an AC1200 AP with 3-port FE and 2 non-detachable antennas

Specifications:

MT7628 (580 MHz)
64 MB of RAM (DDR2)
8 MB of FLASH
2T2R 2.4 GHz (MT7628)
2T2R 5 GHz (MT7612E)
3x 10/100 Mbps Ethernet (2 LAN + 1 WAN)
2x external, non-detachable antennas (5dbi)
UART header on PCB (57600 8n1)
7x LED, 2x button

Known issues:
The Power LED is always ON, probably because it is connected
directly to power.

Flash instructions
------------------
Load the ...-factory.bin image via the stock web interface.

Openwrt upgrade instructions
----------------------------
Use the ...-sysupgrade.bin image for future upgrades.

Revert to stock FW
------------------
Warning! This tutorial will work only with the following OEM FW:
  WR1000_EU_92.122.2.4987.201806261618.bin
  WR1000_US_92.122.2.4987.201806261609.bin
If in the future these firmwares will not be available anymore,
you have to find the new XOR key.

1) Download the original FW from the Cudy website.

   (For example WR1000_EU_92.122.2.4987.201806261618.bin)

2) Remove the header.

   dd if="WR1000_EU_92.122.2.4987.201806261618.bin" of="WR1000_EU_92.122.2.4987.201806261618.bin.mod" skip=8 bs=64

3) XOR the new file with the region key.

   FOR EU: 7B76741E67594351555042461D625F4545514B1B03050208000603020803000D
   FOR US: 7B76741E675943555D5442461D625F454555431F03050208000603060007010C

   You can use OpenWrt's tools/firmware-utils/src/xorimage.c tool for this:

   xorimage -i WR1000..bin.mod -o stock-firmware.bin -x -p 7B767..

   Or, you can use this tool (CHANGE THE XOR KEY ACCORDINGLY!):
   https://gchq.github.io/CyberChef/#recipe=XOR(%7B'option':'Hex','string':''%7D,'',false)

4) Check the resulting decrypted image.

   Check if bytes from 0x20 to 0x3f are:
   4C 69 6E 75 78 20 4B 65 72 6E 65 6C 20 49 6D 61 67 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00

   Alternatively, you can use u-boot's tool dumpimage tool to check
   if the decryption was successful. It should look like:

   # dumpimage -l stock-firmware.bin
   Image Name:   Linux Kernel Image
   Created:      Tue Jun 26 10:24:54 2018
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4406635 Bytes = 4303.35 KiB = 4.20 MiB
   Load Address: 80000000
   Entry Point:  8000c150

5) Flash it via forced firmware upgrade and don't "Keep Settings"

   CLI: sysupgrade -F -n stock-firmware.bin

   LuCI: make sure to click on the "Keep settings" checkbox
         to disable it. You'll need to do this !TWICE! because
         on the first try, LuCI will refuse the image and reset
 the "Keep settings" to enable. However a new
         "Force upgrade" checkbox will appear as well.
         Make sure to do this very carefully!

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[added wifi compatible, spiffed-up the returned to stock instructions]

5 years agoramips: unify JCG helper command definition
Davide Fioravanti [Mon, 20 May 2019 03:15:24 +0000 (05:15 +0200)]
ramips: unify JCG helper command definition

This patch makes the JCG helper command definition available
for every rampis target

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years agofirmware-utils: jcgimage: add support for 4MiB+ images
Davide Fioravanti [Mon, 20 May 2019 02:43:17 +0000 (04:43 +0200)]
firmware-utils: jcgimage: add support for 4MiB+ images

The first version of this script allowed just 4Mb factory images.
With this patch is possible to set the maximum size of the payload.

For an 8Mb flash, the corresponding maxsize is:
8 * 1024 * 1024 - 5 * 64 * 1024 = 8388608 - 327680 = 8060928

If the -m argument is not set, the default maximum size will be
used for backward compatibility.

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years agofirmware-utils: jcgimage: fix style and compiler warnings
Davide Fioravanti [Mon, 20 May 2019 02:29:51 +0000 (04:29 +0200)]
firmware-utils: jcgimage: fix style and compiler warnings

Fixed some compilation warnings.

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years agoapm821xx: wndr4700: interrupt-driven gpio-keys
Christian Lamparter [Sun, 26 May 2019 14:36:10 +0000 (16:36 +0200)]
apm821xx: wndr4700: interrupt-driven gpio-keys

This patch fixes the active_low setting and
converts all of the physical keys on the wndr4700
to utilize the interrupt-driven gpio-keys driver
over the polled version.

The sdcard-insertion hack has been removed since the
block-subsystem will now be polling the device instead.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agogpio-button-hotplug: support interrupt properties
Christian Lamparter [Sun, 19 May 2019 14:06:34 +0000 (16:06 +0200)]
gpio-button-hotplug: support interrupt properties

Upstream Linux's input gpio-keys driver supports
specifying a external interrupt for a gpio via the
'interrupts' properties as well as having support
for software debounce.

This patch ports these features to OpenWrt's event
version. Only the "pure" interrupt-driven support is
left behind, since this goes a bit against the "gpio"
in the "gpio-keys" and I don't have a real device to
test this with.

This patch also silences the generated warnings showing
up since 4.14 due to the 'constification' of the
struct gpio_keys_button *buttons variable in the
upstream struct gpio_keys_platform_data declaration.

gpio-button-hotplug.c: In function 'gpio_keys_get_devtree_pdata':
gpio-button-hotplug.c:392:10: warning: assignment discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
   button = &pdata->buttons[i++];
          ^
gpio-button-hotplug.c: In function 'gpio_keys_button_probe':
gpio-button-hotplug.c:537:12: warning: assignment discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
   bdata->b = &pdata->buttons[i];
            ^
gpio-button-hotplug.c: In function 'gpio_keys_probe':
gpio-button-hotplug.c:563:37: warning: initialization discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
   struct gpio_keys_button *button = &pdata->buttons[i];
                                   ^
Acked-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoppp: add config options to tune discovery timeout and attempts
Hans Dedecker [Wed, 29 May 2019 16:51:20 +0000 (18:51 +0200)]
ppp: add config options to tune discovery timeout and attempts

Upstream PPP project has added in commit 8e77984 options to tune discovery
timeout and attempts in the rp-pppoe plugin.

Expose these options in the uci datamodel for pppoe:
padi_attempts: Number of discovery attempts
padi_timeout: Initial timeout for discovery packets in seconds

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agoppp: update to version 2.4.7.git-2019-05-25
Hans Dedecker [Tue, 28 May 2019 10:23:11 +0000 (12:23 +0200)]
ppp: update to version 2.4.7.git-2019-05-25

8e77984 rp-pppoe plugin: Add options to tune discovery timeout and number of attempts

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agogre: introduce 'nohostroute' option
Fabian Bläse [Wed, 29 May 2019 19:08:01 +0000 (21:08 +0200)]
gre: introduce 'nohostroute' option

It is not always necessary to add a host route for the gre peer address.

This introduces a new config option 'nohostroute' (similar to the
option introduced for wireguard in d8e2e19) to allow to disable
the creation of those routes explicitely.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
5 years agouclient: bump to version 2019-05-30
Yousong Zhou [Thu, 30 May 2019 10:37:19 +0000 (10:37 +0000)]
uclient: bump to version 2019-05-30

This version bump contains the following commit to fix FS#2222

3b3e368 uclient-http: set data_eof when content-length is 0

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years agolibunwind: requires glibc if arch in powerpc
Yousong Zhou [Thu, 30 May 2019 08:30:42 +0000 (08:30 +0000)]
libunwind: requires glibc if arch in powerpc

libunwind for powerpc depends on getcontext() from libc which musl-libc
does not provide because this API and its friends are supposed to be
"obsolescent" [1,2]

 [1] Subject: Re: setcontext/getcontext/makecontext missing?
     https://www.openwall.com/lists/musl/2016/02/04/5
 [2] http://pubs.opengroup.org/onlinepubs/009695399/functions/makecontext.html

Refs: https://github.com/openwrt/packages/issues/8548#issuecomment-497200058
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years agoat91:renaming subtraget legacy to sam9x
Sandeep Sheriker M [Tue, 28 May 2019 17:21:10 +0000 (10:21 -0700)]
at91:renaming subtraget legacy to sam9x

renaming subtraget legacy to sam9x for adding new sam9 soc's

Signed-off-by: Sandeep Sheriker M <sandeep.sheriker@microchip.com>
5 years agogemini: Activate Realtek and vitesse DSA driver again
Hauke Mehrtens [Tue, 28 May 2019 21:52:48 +0000 (23:52 +0200)]
gemini: Activate Realtek and vitesse DSA driver again

This activates the wrongly removed DSA drivers again.

Fixes 9ab4d74b5f86 ("kernel: Move some DSA config options to generic config")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reported-by: Linus Walleij <linus.walleij@linaro.org>
5 years agoat91: Update kernel to version 4.14
Hauke Mehrtens [Tue, 28 May 2019 17:21:16 +0000 (10:21 -0700)]
at91: Update kernel to version 4.14

This adds support for kernel 4.14 to the target and directly make it the
default kernel version to use.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Sandeep Sheriker <sandeepsheriker.mallikarjun@microchip.com>
5 years agoat91: Merge SAMA5 subtargets
Hauke Mehrtens [Tue, 28 May 2019 17:21:14 +0000 (10:21 -0700)]
at91: Merge SAMA5 subtargets

Instead of maintaining 3 very similar subtargets merge them into one.
This does not use the Arm NEON extension any more, because the SAMA5D3
does not support NEON.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Sandeep Sheriker <sandeepsheriker.mallikarjun@microchip.com>
5 years agoat91: Clean up kernel configuration
Hauke Mehrtens [Tue, 28 May 2019 17:21:12 +0000 (10:21 -0700)]
at91: Clean up kernel configuration

This removes some settings which are normally set by the generic
configuration and should not be changed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Sandeep Sheriker <sandeepsheriker.mallikarjun@microchip.com>
5 years agoat91: Refresh kernel configuration
Hauke Mehrtens [Tue, 28 May 2019 17:21:09 +0000 (10:21 -0700)]
at91: Refresh kernel configuration

The configuration of the sama5d4 subtarget was used as the default
configuration and then the subtarget configurations were adapted.

The resulting kernel configuration without any extra modules selected is
still the same.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Sandeep Sheriker <sandeepsheriker.mallikarjun@microchip.com>
5 years agolantiq: BTHOMEHUBV5A: don't power off with restart button
Alan Swanson [Wed, 29 May 2019 10:40:21 +0000 (11:40 +0100)]
lantiq: BTHOMEHUBV5A: don't power off with restart button

The restart button is currently assigned to KEY_POWER power script but
an easily accessible button immediately powering off the device is
undesirable. Switch to using new KEY_POWER2 reboot script with 5 second
seen delay.

Fixes: FS#1965
Signed-off-by: Alan Swanson <reiver@improbability.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [long line wrap]
5 years agogpio-button-hotplug: add KEY_POWER2 handling
Alan Swanson [Wed, 29 May 2019 10:39:30 +0000 (11:39 +0100)]
gpio-button-hotplug: add KEY_POWER2 handling

For devices such as BTHOMEHUBV5A with both reset and restart buttons,
its easily accessible restart button has been assigned to KEY_POWER
power script to poweroff preventing accidental (or malicious) factory
resets by KEY_RESTART reset script. However an easily accessible button
immediately powering off the device is also undesirable.

As KEY_RESTART is already used for reset script (and there's no
KEY_REBOOT in Linux input events), use KEY_POWER2 for rebooting via new
reboot script with 5 second seen delay.

Fixes: FS#1965
Signed-off-by: Alan Swanson <reiver@improbability.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [long line wrap]
5 years agobutton-hotplug: add KEY_POWER2 handling
Alan Swanson [Wed, 29 May 2019 10:36:12 +0000 (11:36 +0100)]
button-hotplug: add KEY_POWER2 handling

For devices such as BTHOMEHUBV5A with both reset and restart buttons,
its easily accessible restart button has been assigned to KEY_POWER
power script to poweroff preventing accidental (or malicious) factory
resets by KEY_RESTART reset script. However an easily accessible button
immediately powering off the device is also undesirable.

As KEY_RESTART is already used for reset script (and there's no
KEY_REBOOT in Linux input events), use KEY_POWER2 for rebooting via new
reboot script with 5 second seen delay.

Fixes: FS#1965
Signed-off-by: Alan Swanson <reiver@improbability.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [long line wrap]
5 years agobase-files: add reboot only button handler
Alan Swanson [Wed, 29 May 2019 10:28:33 +0000 (11:28 +0100)]
base-files: add reboot only button handler

For devices such as BTHOMEHUBV5A with both reset and restart buttons,
its easily accessible restart button has been assigned to KEY_POWER
power script to poweroff preventing accidental (or malicious) factory
resets by KEY_RESTART reset script. However an easily accessible button
immediately powering off the device is also undesirable.

Fixes: FS#1965
Signed-off-by: Alan Swanson <reiver@improbability.net>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [long line wrap]
5 years agoprocd: update to latest git HEAD
Petr Štetiar [Thu, 30 May 2019 06:00:44 +0000 (08:00 +0200)]
procd: update to latest git HEAD

 ade00ca585a4 container: fix .dockerenv stat check
 385b904b2f0a hotplug: improve error message during group ownership change

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoprocd: update to latest git HEAD
Paul Spooren [Wed, 29 May 2019 12:24:00 +0000 (14:24 +0200)]
procd: update to latest git HEAD

7f0f6b2 procd: add docker support

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years agobusybox: fix: ip addr flush hangs when run by non-root user
Mikael Magnusson [Mon, 27 May 2019 20:48:10 +0000 (22:48 +0200)]
busybox: fix: ip addr flush hangs when run by non-root user

Add upstream patch from:
https://git.busybox.net/busybox/commit/?id=028c5aa18b5273c029f0278232d922ee1a164de6

The patch fixes a problem with an infinite loop causing 100% CPU usage
when running the following command /lib/preinit/10_indicate_preinit
without the CAP_NET_ADMIN capability (such as in Docker):
  ip -4 address flush dev $pi_ifname

Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [refresh patch]
5 years agokernel: bump 4.19 to 4.19.45
Koen Vandeputte [Fri, 24 May 2019 12:46:23 +0000 (14:46 +0200)]
kernel: bump 4.19 to 4.19.45

Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.14 to 4.14.121
Koen Vandeputte [Fri, 24 May 2019 11:45:43 +0000 (13:45 +0200)]
kernel: bump 4.14 to 4.14.121

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>
5 years agokernel: bump 4.9 to 4.9.178
Koen Vandeputte [Fri, 24 May 2019 07:56:59 +0000 (09:56 +0200)]
kernel: bump 4.9 to 4.9.178

Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agonetifd: fix missing ip rules after network reload (FS#2296)
Hans Dedecker [Tue, 28 May 2019 08:17:34 +0000 (10:17 +0200)]
netifd: fix missing ip rules after network reload (FS#2296)

beb810d iprule: fix missing ip rules after a reload (FS#2296)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agoath79: ecb1750: additional dts fixes
Petr Štetiar [Sun, 26 May 2019 12:51:49 +0000 (14:51 +0200)]
ath79: ecb1750: additional dts fixes

This patch fixes following missing bits:

 - add missing 'compatible' property on firmware partition
 - set vendor partition 'userconfig' read-only

Fixes: 30dcbc741d84 ("ath79: add support for EnGenius ECB1750")
Signed-off-by: Sven Friedmann <sf.openwrt@okay.ms>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoath79: add support for WD My Net N750
Ryan Mounce [Sat, 25 May 2019 12:36:05 +0000 (22:06 +0930)]
ath79: add support for WD My Net N750

SoC: AR9344
RAM: 128MB
Flash: 16MiB Winbond 25Q128BVFG SPI NOR
5GHz WiFi: AR9380 PCIe 3x3:3 802.11n
2.4GHz WiFi: AR9344 (SoC) AHB 2x2:2 802.11n

5x Gigabit ethernet via AR8327N switch (green + amber LEDs)
2x USB 2.0 via GL850G hub
4x front LEDs from SoC GPIO
1x front WPS button from SoC GPIO
1x bottom reset button from SoC GPIO

Known issues:
AR8327N LEDs only have default functionality, not presented in sysfs.
This is a regression from ar71xx.

UART header JP1, 115200 no parity 1 stop
TX
GND
VCC
(N/P)
RX

See https://openwrt.org/toh/wd/n750 for flashing detail.
Procedures unchanged from ar71xx.

Tested sysupgrade + factory flash from WD Emergency Recovery

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
5 years agocurl: bump to 7.65.0
Hans Dedecker [Sun, 26 May 2019 19:41:46 +0000 (21:41 +0200)]
curl: bump to 7.65.0

For changes in 7.65.0; see https://curl.haxx.se/changes.html#7_65_0

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agomap: don't set default firewall zone to wan
Hans Dedecker [Mon, 29 Apr 2019 14:35:33 +0000 (16:35 +0200)]
map: don't set default firewall zone to wan

Don't set the default firewall zone to wan if not specified to keep the
behavior aligned with other tunnel protocols like gre and 6rd.
If the interface zone is not specified try to get it from the firewall config
when constructing the procd firewall rule.
While at it only add procd inbound/outbound firewall rules if a zone is specified.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago464xlat: don't set default firewall zone to wan
Hans Dedecker [Mon, 29 Apr 2019 14:03:11 +0000 (16:03 +0200)]
464xlat: don't set default firewall zone to wan

Don't set the default firewall zone to wan if not specified to keep the
behavior aligned with other tunnel protocols like gre and 6rd.
If the interface zone is not specified try to get it from the firewall config
when constructing the procd firewall rule.
While at it only add a procd inbound firewall rule if a zone is specified.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agoethtool: bump to 5.1
Petr Štetiar [Fri, 24 May 2019 13:36:44 +0000 (15:36 +0200)]
ethtool: bump to 5.1

 * Feature: Add support for 200Gbps (50Gbps per lane) link mode
 * Feature: simplify handling of PHY tunable downshift
 * Feature: add support for PHY tunable Fast Link Down
 * Feature: add PHY Fast Link Down tunable to man page
 * Feature: Add a 'start N' option when specifying the Rx flow hash indirection table.
 * Feature: Add bash-completion script
 * Feature: add 10000baseR_FEC link mode name
 * Fix: qsfp: fix special value comparison
 * Feature: move option parsing related code into function
 * Feature: move cmdline_coalesce out of do_scoalesce
 * Feature: introduce new ioctl for per-queue settings
 * Feature: support per-queue sub command --show-coalesce
 * Feature: support per-queue sub command --coalesce
 * Fix: fix up dump_coalesce output to match actual option names
 * Feature: fec: add pretty dump

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoRevert "base-files: add console to inittab"
Alexander Couzens [Sat, 25 May 2019 06:08:42 +0000 (08:08 +0200)]
Revert "base-files: add console to inittab"

This reverts commit cde52cb4866fe8cf4a19bb2bb32ff7802e542e19.
When using OpenWrt in qemu, the shell is unsuable

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
5 years agouci: fix heap use after free (FS#2288)
Hans Dedecker [Thu, 23 May 2019 20:00:23 +0000 (22:00 +0200)]
uci: fix heap use after free (FS#2288)

f199b96 uci: fix options list of section after type change

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agoglibc: update to latest 2.27 commit (BZ #24531)
Hans Dedecker [Thu, 23 May 2019 11:20:07 +0000 (13:20 +0200)]
glibc: update to latest 2.27 commit (BZ #24531)

54ba8bcd423 Fix tcache count maximum (BZ #24531)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agogemini: Support sysupgrade on DIR-685
Linus Walleij [Mon, 20 May 2019 20:25:21 +0000 (22:25 +0200)]
gemini: Support sysupgrade on DIR-685

This makes sysupgrade work on the D-Link DIR-685 after
initial factory install.

We create the platform.sh script to support sysupgrade
on more targets as we move on with sysupgrade support.

Cc: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[cleanup in platform.sh, removed superfluous SUPPORTED_DEVICES]

5 years agolua: lnum: fix strtoul based number parsing
Liangbin Lian [Tue, 14 May 2019 15:20:45 +0000 (23:20 +0800)]
lua: lnum: fix strtoul based number parsing

Lua's LNUM patch currently doesn't parse properly certain numbers as
it's visible from the following simple tests.

On x86_64 host (stock Lua 5.1.5, expected output):

 $ /usr/bin/lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  2147483648
  8796093022208
  4294967296

On x86_64 host:

 $ staging_dir/hostpkg/bin/lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  -2147483648
  0
  0

On x86_64 target:

 $ lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  -2147483648
  0
  0

On ath79 target:

 $ lua -e 'print(0x80000000); print(0x80000000000); print(0x100000000)'

  -2147483648
  8796093022208
  4294967296

It's caused by two issues fixed in this patch, first issue is caused by
unhadled strtoul overflow and second one is caused by the cast of
unsigned to signed Lua integer when parsing from hex literal.

Run tested on:

 * Zidoo Z9S with RTD1296 CPU (aarch64_cortex-a53)
 * qemu/x86_64
 * qemu/armvirt_64
 * ath79

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
[commit subject/message touches, fixed From to match SOB, fixed another
 unhandled case in luaO_str2i, host Lua, package bump]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoRevert "bc: update to 1.07.1"
Hans Dedecker [Wed, 22 May 2019 19:25:35 +0000 (21:25 +0200)]
Revert "bc: update to 1.07.1"

This reverts commit 0111b86f1db501d57bfee8a313fe5bebdf8b2ed9 as it
breaks on Linux distributions without ed support

./fix-libmath_h: line 1: ed: command not found

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agobc: update to 1.07.1
Deng Qingfang [Fri, 17 May 2019 18:33:51 +0000 (02:33 +0800)]
bc: update to 1.07.1

Update bc to 1.07.1
Use GNU mirror

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years agobase-files: add console to inittab
Paul Spooren [Tue, 7 May 2019 11:09:53 +0000 (13:09 +0200)]
base-files: add console to inittab

When running OpenWrt inside an LXC container no shell is opend as LXC
defaults to a virtual /dev/console.

This patch allows to enter a shell after starting the container via
`lxc-start`, without it is only posible to access a shell on tty1 via
`lxc-console`.

Signed-off-by: Paul Spooren <mail@aparcar.org>
5 years agoar71xx: wr940 v4/v6: correct lan interface mac address
Alexander Couzens [Tue, 21 May 2019 11:17:56 +0000 (13:17 +0200)]
ar71xx: wr940 v4/v6: correct lan interface mac address

The vendor firmware only uses two mac addresses, the mac address on the
label and the label + 1. While checking multiple devices, all labels have
even mac addresses. Concluding only 2 address are assigned to a device.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
5 years agoiwinfo: update to latest git HEAD
Koen Vandeputte [Tue, 21 May 2019 08:04:18 +0000 (10:04 +0200)]
iwinfo: update to latest git HEAD

073a838891e5 iwinfo: Complete device IDs for Ubiquiti airOS XM/XW devices
04f5a7d3a431 iwinfo: Add Mikrotik R11e-5HnD
c2cfe9d96c9a iwinfo: Fix 802.11ad channel to frequency

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.19 to 4.19.44
Koen Vandeputte [Mon, 20 May 2019 08:51:18 +0000 (10:51 +0200)]
kernel: bump 4.19 to 4.19.44

Refreshed all patches.

Remove upstreamed:
- 103-MIPS-perf-ath79-Fix-perfcount-IRQ-assignment.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.14 to 4.14.120
Koen Vandeputte [Mon, 20 May 2019 08:31:41 +0000 (10:31 +0200)]
kernel: bump 4.14 to 4.14.120

Refreshed all patches.

Remove upstreamed:
- 103-MIPS-perf-ath79-Fix-perfcount-IRQ-assignment.patch
- 060-fix-oxnas-rps-dt-match.patch

Altered patches:
- 0067-generic-Mangle-bootloader-s-kernel-arguments.patch
- 006-mvebu-Mangle-bootloader-s-kernel-arguments.patch
- 996-generic-Mangle-bootloader-s-kernel-arguments.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.9 to 4.9.177
Koen Vandeputte [Fri, 17 May 2019 09:46:47 +0000 (11:46 +0200)]
kernel: bump 4.9 to 4.9.177

Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agoath79: glinet_gl-ar750s: Add USB power & microSD
Alexander Wördekemper [Thu, 16 May 2019 14:24:43 +0000 (16:24 +0200)]
ath79: glinet_gl-ar750s: Add USB power & microSD

The GL.iNet AR750S USB and microSD port is currently not working out of
the box.  GPIO 7 is used to control the power of the USB port. Add GPIO
7 as a fixed-regulator for the port.  Also add &usb1 to DTS to get the
microSD port to work.

Signed-off-by: Alexander Wördekemper <alexwoerde@web.de>
5 years agoimx6: apalis: fix config survival after sysupgrade -n
Petr Štetiar [Mon, 13 May 2019 14:42:41 +0000 (16:42 +0200)]
imx6: apalis: fix config survival after sysupgrade -n

This patch fixes `sysupgrade -n` when flashed with rootfs of the same
size as currently running, so the rootfs_data wouldn't get destroyed and
thus survive reboot. So let's fix it by always cleaning up the content
of the rootfs_data during sysupgrade.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agouboot-imx6: bump to 2019.04 and refresh patches
Petr Štetiar [Tue, 14 May 2019 07:47:26 +0000 (09:47 +0200)]
uboot-imx6: bump to 2019.04 and refresh patches

Build tested: apalis, mx6sabresd, nitrogen6dl, nitrogen6dl2g, nitrogen6q,
      nitrogen6q2g, nitrogen6s, nitrogen6s1g, wandboard

Run tested: apalis

Cc: Felix Fietkau <nbd@nbd.name>
Cc: Vladimir Vid <vladimir.vid@sartura.hr>
Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoath79: add leds migrations for archer-c7-v5
Petr Štetiar [Fri, 17 May 2019 11:52:20 +0000 (13:52 +0200)]
ath79: add leds migrations for archer-c7-v5

ar71xx uses `archer-c7-v5` for led prefix, but ath79 sticks to more
generic `tplink` as the DTS is reused by more boards, so we need to
perform migrations of the LED names during upgrade.

Cc: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoar71xx: set mib-poll-interval on devices with ar8xxx switch
Petr Štetiar [Fri, 17 May 2019 08:56:33 +0000 (10:56 +0200)]
ar71xx: set mib-poll-interval on devices with ar8xxx switch

Commit "generic: ar8216: add mib_poll_interval switch attribute" sets
mib-poll-interval as disabled by default (was set to 2s), so it makes
switch LEDs trigger disfunctional on devices which don't have
mib-poll-interval set.

So this patch sets mib-poll-interval to 500ms on devices which are using
ar8xxx switch LEDs trigger, as the same value was set for built in
switches in 443fc9ac35 ("ath79: use ar8216 for builtin switch").

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agoapm821xx: set mib-poll-interval on emac0 attached ar83xx switch
Petr Štetiar [Sun, 14 Apr 2019 15:23:38 +0000 (17:23 +0200)]
apm821xx: set mib-poll-interval on emac0 attached ar83xx switch

Commit "generic: ar8216: add mib_poll_interval switch attribute" sets
mib-poll-interval as disabled by default (was set to 2s), so it makes
switch LEDs trigger disfunctional on devices which don't have
mib-poll-interval set.

So this patch sets mib-poll-interval to 500ms on devices which have
ar83xx switch connected to emac0, as the same value was set for built in
switches in 443fc9ac35 ("ath79: use ar8216 for builtin switch").

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agoath79: set mib-poll-interval on mdio0 attached ar83xx switch
Petr Štetiar [Sun, 14 Apr 2019 15:26:04 +0000 (17:26 +0200)]
ath79: set mib-poll-interval on mdio0 attached ar83xx switch

Commit "generic: ar8216: add mib_poll_interval switch attribute" sets
mib-poll-interval as disabled by default (was set to 2s), so it makes
switch LEDs trigger disfunctional on devices which don't have
mib-poll-interval set.

So this patch sets mib-poll-interval to 500ms on devices which have
ar83xx switch connected to mdio0 bus, as the same value was set for
built in switches in 443fc9ac35 ("ath79: use ar8216 for builtin
switch").

Some measurements performed on TP-Link Archer C7-v5:

 mib-type=0, mib-poll-interval=500ms (10s pidstat)

  Average:  %usr %system  %guest   %wait    %CPU   CPU  Command
  Average:  0.00    1.93    0.00    0.00    1.93     -  kworker/0:2

  iperf3 (30s): 334 Mbits/sec

 mib-type=0, mib-poll-interval=2s (10s pidstat)

  Average:  %usr %system  %guest   %wait    %CPU   CPU  Command
  Average:  0.00    1.14    0.00    0.00    1.14     -  kworker/0:2

  iperf3 (30s): 334 Mbits/sec

So it seems like we get 4x faster LED refresh rate for additional 0.8%
CPU load.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agobase-files: add support for the new ar8xxx MIB counters settings
Petr Štetiar [Fri, 17 May 2019 08:53:18 +0000 (10:53 +0200)]
base-files: add support for the new ar8xxx MIB counters settings

Commit "generic: ar8216: add mib_poll_interval switch attribute" has
added mib_poll_interval global config option and commit "generic:
ar8216: group MIB counters and use two basic ones only by default" has
added mib_type config option.

So this patch adds ucidef_set_ar8xxx_switch_mib helper function which
would allow configuration of the above mentioned new switch config
options.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agonetifd: add support for the new ar8xxx MIB counters settings
Petr Štetiar [Sat, 13 Apr 2019 08:31:44 +0000 (10:31 +0200)]
netifd: add support for the new ar8xxx MIB counters settings

Commit "generic: ar8216: add mib_poll_interval switch attribute" has added
mib_poll_interval global config option and commit "generic: ar8216: group
MIB counters and use two basic ones only by default" has added mib_type
config option.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years agogeneric: ar8216: group MIB counters and use two basic ones only by default
Chuanhong Guo [Thu, 11 Apr 2019 13:45:45 +0000 (21:45 +0800)]
generic: ar8216: group MIB counters and use two basic ones only by default

There are too many MIB counters that almost nobody needs since commit
d6366ce3665f ("generic: ar8216: mib_work_func: read all port mibs
everytime").

In the worker function to poll MIB data, it deals with all ports instead
of only one port every time, which introduces too many mdio operations
that it becomes a heavy CPU load even on not-emulated MDIO bus.

This commit groups MIB counters and enable only TxBytes and RxGoodBytes
by default (both of which are necessary to get swconfig led working.)
and adds an swconfig attribute to allow enabling all counters if users
need them.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agogeneric: ar8216: add mib_poll_interval switch attribute
Chuanhong Guo [Tue, 9 Apr 2019 13:32:32 +0000 (21:32 +0800)]
generic: ar8216: add mib_poll_interval switch attribute

This allows specifying interval of polling MIB counters from userspace
and allow completely turning off MIB counter support by setting
mib_poll_interval to 0.

Since MIB counter polling is a heavy CPU load for GPIO emulated MDIO
bus, disable this behavior by default. Those who wants to use swconfig
LEDs can enable them with qca,mib-poll-interval dts property or with
swconfig command.

Fixes: FS#2230 ("kworker spikes 100% cpu every 2 second.")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agouboot-fritz4040: Add host flags for host compiler
Hauke Mehrtens [Fri, 17 May 2019 19:32:50 +0000 (21:32 +0200)]
uboot-fritz4040: Add host flags for host compiler

This adds the host staging directory to the include path to make it use
the zlib.h files from the staging include directory and also link
against the zlib version from the staging directory.

This fixes a compile problem when the zlib header were not installed on
the build host.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[picked from openwrt-18.06]

5 years agoapm821xx: WNDR4700: remove obsolete sd-card change detection
Christian Lamparter [Sun, 19 May 2019 10:11:13 +0000 (12:11 +0200)]
apm821xx: WNDR4700: remove obsolete sd-card change detection

The SD-Card polling is now implemented by default in the
fs-tools block-mount utility package. It might not be as
fast as the current detection method since the polling
time is 2 Seconds, but it's much less of an hack.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agoppp: update to version 2.4.7.git-2019-05-18
Hans Dedecker [Sat, 18 May 2019 19:34:23 +0000 (21:34 +0200)]
ppp: update to version 2.4.7.git-2019-05-18

c9d9dbf pppoe: Custom host-uniq tag
44012ae plugins/rp-pppoe: Fix compile errors

Refresh patches
Drop 520-uniq patch as upstream accepted
Drop 150-debug_compile_fix patch as fixed upstream

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>