openwrt/openwrt.git
3 years agomac80211: util: don't warn on missing sband iftype data
David Bauer [Sat, 25 Jul 2020 09:26:11 +0000 (11:26 +0200)]
mac80211: util: don't warn on missing sband iftype data

The kernel currently floods the ringbuffer with warnings when adding a
mesh interface for a device not support HE 6GHz modes.

Return without warning in this case, as mesh_add_he_6ghz_cap_ie calls
ieee80211_ie_build_he_6ghz_cap regardless of the supported interface
modes.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoath79: mikrotik: use base mac on lan for RBwAPG-5HacT2HnD
Bjoern Dobe [Fri, 24 Jul 2020 06:48:39 +0000 (08:48 +0200)]
ath79: mikrotik: use base mac on lan for RBwAPG-5HacT2HnD

The Mikrotik RBwAPG-5HacT2HnD has only a single ethernet interface
(lan), and the vendor uses the base (label) MAC address for it.

Signed-off-by: Bjoern Dobe <bjoern@dobecom.de>
[commit title/message improvement]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agotreewide: rename POWER_ON_STRIP register
Sungbo Eo [Thu, 2 Jul 2020 13:33:18 +0000 (22:33 +0900)]
treewide: rename POWER_ON_STRIP register

AR8327 datasheet[1] calls the register at address 0x0010
"Power-on Strapping Register". As it has nothing to do with "strip",
let's rename it to "POWER_ON_STRAP" to make it easier to grasp.

[1] https://lafibre.info/images/doc/201106_spec_AR8327.pdf

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
3 years agoramips: remove non-existant poe_passthrough for RouterBOARD 750Gr3
John Thomson [Sat, 13 Jun 2020 11:25:12 +0000 (21:25 +1000)]
ramips: remove non-existant poe_passthrough for RouterBOARD 750Gr3

This 750gr3 GPIO17 switch was added based on vendor source,
but only the 760iGS (which shares the rbsysfs board identifier)
device has the physical wiring. The 750Gr3 actually does not
support PoE out.

Apart from that, note that the gpio base (480) would have required
this GPIO to be referenced as 497 if it was kept.

Fixes: 6ba58b7b020c ("ramips: cleanup the RB750Gr3 support")
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: add support for Winstars WS-WN583A6
Davide Fioravanti [Thu, 16 Jul 2020 21:29:27 +0000 (23:29 +0200)]
ramips: add support for Winstars WS-WN583A6

The Winstars WS-WN583A6 is a wireless repeater with 2 gigabit ethernet
ports. Even if mine is branded as "Gemeita AC2100", the sticker on the
back says WS-WN583A6. So I will refer to it as Winstars WS-WN583A6.
Probably the real product name is the Wavlink WL-WN583A6 because of
the many references to Wavlink in the OEM firmware and bootlog.

Hardware
--------
SoC:   Mediatek MT7621AT (880 MHz, 2 cores 4 threads)
RAM:   128MB
FLASH: 8MB NOR (GigaDevice GD25Q64B)
ETH:   2x 10/100/1000 Mbps Ethernet (MT7530)
WIFI:
  - 2.4GHz: 1x MT7603E (2x2:2)
  - 5GHz:   1x MT7615E (4x4:4)
  - 6 internal antennas
BTN:
  - 1x Reset button
  - 1x WPS button
  - 1x ON/OFF switch (working but unmodifiable)
  - 1x Auto/Schedule switch (working but unmodifiable. Read Note #3)
LEDS:
  - 1x White led
  - 1x Red led
  - 1x Amber led
  - 1x Blue led
  - 2x Blue leds (lan and wan port status: working but unmodifiable)
UART:
  - 57600-8-N-1

Everything works correctly.

Currently there is no firmware update available. Because of this, in
order to restore the OEM firmware, you must firstly dump the OEM
firmware from your router before you flash the OpenWrt image.

Backup the OEM Firmware
-----------------------
The following steps are to be intended for users having little to none
experience in linux. Obviously there are many ways to backup the OEM
firmware, but probably this is the easiest way for this router.
Procedure tested on M83A6.V5030.191210 firmware version.

1) Go to http://192.168.10.1/webcmd.shtml

2) Type the following line in the "Command" input box:
mkdir /etc_ro/lighttpd/www/dev; for i in /dev/mtd*ro; do dd if=${i} of=/etc_ro/lighttpd/www${i}; done

3) Click "Apply"

4) After few seconds, in the textarea should appear this output:
16384+0 records in
16384+0 records out
8388608 bytes (8.0MB) copied, 4.038820 seconds, 2.0MB/s
384+0 records in
384+0 records out
196608 bytes (192.0KB) copied, 0.095180 seconds, 2.0MB/s
128+0 records in
128+0 records out
65536 bytes (64.0KB) copied, 0.032020 seconds, 2.0MB/s
128+0 records in
128+0 records out
65536 bytes (64.0KB) copied, 0.031760 seconds, 2.0MB/s
15744+0 records in
15744+0 records out
8060928 bytes (7.7MB) copied, 3.885280 seconds, 2.0MB/s
dd: can't open '/dev/mtd5ro': No such device
dd: can't open '/dev/mtd6ro': No such device
dd: can't open '/dev/mtd7ro': No such device

   Excluding the "X.XXXXXX seconds" part, you should get the same
   exact output. If your output doesn't match mine, stop reading
   and ask for help in the forum.

5) Open the following links to download the partitions of the OEM FW:
http://192.168.10.1/dev/mtd0ro
http://192.168.10.1/dev/mtd1ro
http://192.168.10.1/dev/mtd2ro
http://192.168.10.1/dev/mtd3ro
http://192.168.10.1/dev/mtd4ro

   If one (or more) of these files weight 0 byte, stop reading and ask
   for help in the forum.

6) Store these downloaded files in a safe place.

7) Reboot your router to remove any temporary file from your router.

Installation
------------
Flash the initramfs image in the OEM firmware interface.
When openwrt boots, flash the sysupgrade image otherwise you won't be
able to keep configuration between reboots.

Restore OEM Firmware
--------------------
Flash the "mtd4ro" file you previously backed-up directly from LUCI.
Warning: Remember to not keep settings!
Warning2: Remember to force the flash.

Notes
-----
1) The "System Command" page allows to run every command as root.
   For example you can use "dd" and "nc" to backup the OEM firmware.
   PC (SERVER):
nc -l 5555 > ./mtdXro
   ROUTER (CLIENT):
dd if=/dev/mtdXro | nc PC_IP_ADDRESS 5555

2) The OEM web interface accepts only images containing the string
   "WN583A6" in the filename.
   Currently the OEM interface accepts only the initramfs image
   probably because it checks if the ih_size in the image header is
   equal to the whole image size (instead of the kernel size)
   Read more here:
   https://forum.openwrt.org/t/support-for-strong-1200/22768/19

3) The white led (namely "Smart Night Light") can be controller by the
   user only if the side switch is set to "Schedule" otherwise it will
   be activated by the light condition (there is a photodiode on the
   top side of the router)

4) Router mac addresses:

   LAN XX:XX:XX:XX:XX:8F
   WAN XX:XX:XX:XX:XX:90
   WIFI 2G XX:XX:XX:XX:XX:91
   WIFI 5G XX:XX:XX:XX:XX:92

   LABEL XX:XX:XX:XX:XX:91

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
[remove chosen node, fix whitespace]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agooxnas: use vendor_model scheme for ox810se
Adrian Schmutzler [Sat, 18 Jul 2020 12:22:54 +0000 (14:22 +0200)]
oxnas: use vendor_model scheme for ox810se

Most newer targets have been converted to consistently use
vendor_model scheme for device definitions/image names, ox820 is
using it as well, so let's just convert ox810se for consistency.

While at it, use generic setup for DEVICE_DTS and add SUPPORTED_DEVICES.
The latter have been introduced for ox820 already in
cf7896117b3e ("oxnas: enable image metadata by setting SUPPORTED_DEVICES")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoprocd: jail: fix build on glibc and uclibc
Daniel Golle [Sat, 25 Jul 2020 15:54:40 +0000 (16:54 +0100)]
procd: jail: fix build on glibc and uclibc

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoprocd: update to git HEAD
Daniel Golle [Sat, 25 Jul 2020 15:07:59 +0000 (16:07 +0100)]
procd: update to git HEAD

 48777de rcS: cast format string to int64_t
 a4df90f jail: fix wrong format for 32-bit
 c482c5d jail: add support for referencing existing namespaces

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agocake-oot: update to latest HEAD
Kevin Darbyshire-Bryant [Sat, 4 Jul 2020 16:18:10 +0000 (17:18 +0100)]
cake-oot: update to latest HEAD

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 years agobuild: Remove dependency of user space stack cookies from kernel
Hauke Mehrtens [Fri, 17 Jul 2020 21:27:41 +0000 (23:27 +0200)]
build: Remove dependency of user space stack cookies from kernel

Currently the user space stack cookies work well also when the kernel
stack cookies are not activated. This is handled completely in user
space and does not need kernel support.

This dependency was probably needed some years ago when the libc did not
support stack cookies.

Reviewed-by: Ian Cooper <iancooper@hotmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agotoolchain: binutils: Use version 2.34 by default
Hauke Mehrtens [Fri, 17 Jul 2020 20:53:11 +0000 (22:53 +0200)]
toolchain: binutils: Use version 2.34 by default

Switch to binutils version 2.34 for all CPUs by default. The ARC CPUs
do not need any special binutils version any more.

This increases the image size by 0.2% on MIPS (lantiq)

Tested on lantiq, ipq40xx

Acked-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agolantiq: Fix warning in SPI driver
Hauke Mehrtens [Fri, 17 Jul 2020 20:48:15 +0000 (22:48 +0200)]
lantiq: Fix warning in SPI driver

This fixes a warning in the SPI driver at bootup. This warning is seen
in kernel 5.4 on lantiq deives.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agomac80211: Update to version 5.8-rc2-1
Hauke Mehrtens [Sat, 20 Jun 2020 21:11:17 +0000 (23:11 +0200)]
mac80211: Update to version 5.8-rc2-1

The following patches:
* 972-ath10k_fix-crash-due-to-wrong-handling-of-peer_bw_rxnss_override-parameter.patch
* 973-ath10k_fix-band_center_freq-handling-for-VHT160-in-recent-firmwares.patch
are replaced by this commit in the upstream kernel:
3db24065c2c8 ("ath10k: enable VHT160 and VHT80+80 modes")

The following patches were applied upstream:
* 001-rt2800-enable-MFP-support-unconditionally.patch
* 090-wireless-Use-linux-stddef.h-instead-of-stddef.h.patch

The rtw88 driver is now split into multiple kernel modules, just put it
all into one OpenWrt kernel package.

rtl8812au-ct was patched to compile against the mac80211 from kernel
5.8, but not runtime tested.

Add a patch which fixes ath10k on IPQ40XX, this patch was send upstream
and fixes a crash when loading ath10k on this SoC.

Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq40xx/ map-ac2200]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agomac80211: Update to version 5.7.5-1
Hauke Mehrtens [Sun, 28 Jun 2020 12:57:06 +0000 (14:57 +0200)]
mac80211: Update to version 5.7.5-1

The b43 and b43legacy driver now support DRIVER_11W_SUPPORT.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agotools/mkimage: create .itb file with read-access for group,other not just owner.
Ted Hess [Thu, 23 Jul 2020 18:07:16 +0000 (14:07 -0400)]
tools/mkimage: create .itb file with read-access for group,other not just owner.

This patch will fix the source of 403 errors on these files
from downloads.openwrt.org.

Signed-off-by: Ted Hess <thess@kitschensync.net>
3 years agouboot-mediatek: remove swig requirement
Rosen Penev [Thu, 23 Jul 2020 00:55:07 +0000 (17:55 -0700)]
uboot-mediatek: remove swig requirement

Ever since this package was introduced, the SDK for mt7629 failed to
build as it started failing on this package.

Fixed by porting Hauke's similar patch for uboot-sunxi to uboot-mediatek.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agoopenvpn: Allow override of interface name
Michal Hrusecky [Mon, 20 Jul 2020 13:23:07 +0000 (15:23 +0200)]
openvpn: Allow override of interface name

If using a configuration file for OpenVPN, allow overriding name of the
interface. The reason is that then people could use configuration file
provided by VPN provider directly and override the name of the interface
to include it in correct firewall zone without need to alter the
configuration file.

Signed-off-by: Michal Hrusecky <michal@hrusecky.net>
(cherry picked from commit c93667358515ec078ef4ac96393623ac084e5c9e)

3 years agoopenpvn: Split out config parsing code for reuse
Michal Hrusecky [Thu, 23 Jul 2020 10:10:45 +0000 (12:10 +0200)]
openpvn: Split out config parsing code for reuse

Split out code that parses openvpn configuration file into separate file
that can be later included in various scripts and reused.

Signed-off-by: Michal Hrusecky <michal@hrusecky.net>
(cherry picked from commit 86d8467c8ab792c79809a08c223dd9d40da6da2e)

3 years agoipq40xx: support reset button for WPJ419
Phi Nguyen [Thu, 23 Jul 2020 03:03:52 +0000 (11:03 +0800)]
ipq40xx: support reset button for WPJ419

Compex WPJ419 has a reset button on a GPIO pin.

Signed-off-by: Phi Nguyen <phind.uet@gmail.com>
3 years agotools/flock: add PKG_{VERSION,RELEASE}
Paul Spooren [Wed, 22 Jul 2020 23:49:37 +0000 (13:49 -1000)]
tools/flock: add PKG_{VERSION,RELEASE}

The stored source code of flock contains the version string of version
2.18, reflect that in the Makefile.

Motivation is the tracking of changes in the buildsystem, which requires
versioning of packages.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agotools/sstrip: add PKG_{VERSION,RELEASE}
Paul Spooren [Wed, 22 Jul 2020 23:46:21 +0000 (13:46 -1000)]
tools/sstrip: add PKG_{VERSION,RELEASE}

Comparing the in tree stored source file of sstrip suggests it's version
2.0[0], reflect that in the Makefile.

Motivation is the tracking of changes in the buildsystem, which requires
versioning of packages.

[0]: https://github.com/BR903/ELFkickers/commit/df4426a0f0ada861064d75c08cbebaac7c16b3ae#diff-d3ba694d91432a068d5d3b36abf8cd0f

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agotools/firmware-utils: add PKG_RELEASE
Paul Spooren [Wed, 22 Jul 2020 23:10:06 +0000 (13:10 -1000)]
tools/firmware-utils: add PKG_RELEASE

There is no versioning information in the firmware-utils code nor the
Makefile. Consider it as first release by adding PKG_RELEASE.

Motivation is the tracking of changes in the buildsystem, which requires
versioning of packages.

Also update copyright.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agotools/patch-image: add PKG_RELEASE
Paul Spooren [Wed, 22 Jul 2020 23:08:27 +0000 (13:08 -1000)]
tools/patch-image: add PKG_RELEASE

There is no versioning information in the patch-image code nor the
Makefile. Consider it as first release by adding PKG_RELEASE.

Motivation is the tracking of changes in the buildsystem, which requires
versioning of packages.

Also update copyright.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agotools: drop PKG_VERSION for purely local packages
Adrian Schmutzler [Wed, 22 Jul 2020 23:04:35 +0000 (01:04 +0200)]
tools: drop PKG_VERSION for purely local packages

This applies to tools directory what has been done for package/ in
commit 9c170cb92f4f ("package: drop PKG_VERSION for purely local
packages"):

In the package guidelines, PKG_VERSION is supposed to be used as
"The upstream version number that we're downloading", while
PKG_RELEASE is referred to as "The version of this package Makefile".
Thus, the variables in a strict interpretation provide a clear
distinction between "their" (upstream) version in PKG_VERSION and
"our" (local OpenWrt trunk) version in PKG_RELEASE.

For local (OpenWrt-only) packages, this implies that those will only
need PKG_RELEASE defined, while PKG_VERSION does not apply following
a strict interpretation. While the majority of "our" packages actually
follow that scheme, there are also some that mix both variables or
have one of them defined but keep them at "1".

This is misleading and confusing, which can be observed by the fact
that there typically either one of the variables is never bumped or
the choice of the variable to increase depends on the person doing the
change.

Consequently, this patch aims at clarifying the situation by
consistently using only PKG_RELEASE for "our" packages. For tools/,
only three packages were affected. This fixes two of them, and
leaves the remaining wrt350nv2-builder untouched, as the code there
seems to have some versioning of its own that is treated as upstream
version in PKG_VERSION.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoRevert "ramips: fix flash layout for TP-Link TL-WR841N v14"
Adrian Schmutzler [Wed, 22 Jul 2020 16:49:09 +0000 (18:49 +0200)]
Revert "ramips: fix flash layout for TP-Link TL-WR841N v14"

This reverts commit 1623defbdbb852a4018329d07673b4b8f66225a8.

As already stated in the reverted patch, the OEM firmware will
properly recreate the config partition if it is overwritten by
OpenWrt.

The main reason for adding the partition was the image size
restriction imposed by the 0x3d0000 limitation of the TFTP
flashing process. Addressing this by shrinking the firmware
partition is not a good solution to that problem, though:

1. For a working image, the size of the content has to be smaller
   than the available space, so empty erase blocks will remain.

2. Conceptually, the restriction is on the image, so it makes sense
   to implement it in the same way, and not via the partitioning.
   Users could e.g. do initial flash with TFTP restriction with
   an older image, and then sysupgrade into a newer one, so TFTP
   restriction does not apply.

3. The (content) size of the recovery image is enforced to 0x3d0000
   by the tplink-v2-image command in combination with
   TPLINK_FLASHLAYOUT (flash layout in mktplinkfw2.c) anyway.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoarc770: use generic 02_sysinfo
Adrian Schmutzler [Wed, 22 Jul 2020 16:24:01 +0000 (18:24 +0200)]
arc770: use generic 02_sysinfo

Currently arc770 sets a board name from compatible for no apparent
reason. Just use the compatible directly instead.

This theoretically removes a board name "generic" when no compatible
was present, however, there is no case where this "generic" board
name was actually used.

This also fixes an issue where snps,axs101 would not have been
properly detected anyway, as its case was not set up syntactically
correct.

Fixes: 576621f1e353 ("linux: add support of Synopsys ARC770-based boards")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoarchs38: use generic 02_sysinfo
Adrian Schmutzler [Sat, 18 Jul 2020 14:02:06 +0000 (16:02 +0200)]
archs38: use generic 02_sysinfo

Currently archs38 sets a board name from compatible for no apparent
reason. Just use the compatible directly instead.

This theoretically removes a board name "generic" when no compatible
was present, however, there is no case where this "generic" board
name was actually used.

This also fixes an issue where snps,axs103 would not have been
properly detected anyway, as its case was not set up syntactically
correct.

Fixes: 73015c4cb378 ("linux: add support of Synopsys ARCHS38-based boards")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: switch MT7620 subtarget to 5.4
David Bauer [Tue, 21 Jul 2020 18:40:39 +0000 (20:40 +0200)]
ramips: switch MT7620 subtarget to 5.4

MT7620 seems to work fine with kernel 5.4. Set the default kernel
version to 5.4 to bring this to a broader audience.

Tested on Archer C2 v1 / Archer C20i

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoramips: increase SPI frequency for MT7620 Archer
David Bauer [Tue, 21 Jul 2020 18:11:28 +0000 (20:11 +0200)]
ramips: increase SPI frequency for MT7620 Archer

Increase the SPI frequency for the MT7620 based TP-Link Archer
series to 30MHz.

TP-Link uses different SPI flash chips for the same board
revision, so be conservative to not break boards with a
different chip. 30MHz should be well supported by all chips.

Tested on Archer C2 v1 (GD25Q64B) and Archer C20i (W25Q64FV).

Archer C20i (before)
====================
root@OpenWrt:~# time dd if=/dev/mtd1 of=/tmp/test.bin bs=64k
122+0 records in
122+0 records out
real 0m 15.30s
user 0m 0.00s
sys 0m 15.29s

Archer C20i (after)
===================
root@OpenWrt:~# time dd if=/dev/mtd1 of=/tmp/test.bin bs=64k
122+0 records in
122+0 records out
real 0m 5.99s
user 0m 0.00s
sys 0m 5.98s

Signed-off-by: David Bauer <mail@david-bauer.net>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoath79: re-enable image generation for GL-AR750S
David Bauer [Tue, 21 Jul 2020 22:00:36 +0000 (00:00 +0200)]
ath79: re-enable image generation for GL-AR750S

The bootloader only writes the first 2MB of the image to the NOR flash
when installing the NAND factory image. The bootloader is capable of
booting larger kernels as it boots from the memory mapped SPI flash.

Disable the NAND factory image. The NAND can be bootstrapped by writing
the NAND initramfs image using the NOR upgrade method in the bootloader
web-recovery and sysupgrading from there. The NOR variant is not
affected.

Also refactor the partition definitions in the DTS to make them less
annoying to read.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agokmod-sched-cake-oot: fix PKG_MIRROR_HASH
Kevin Darbyshire-Bryant [Wed, 22 Jul 2020 14:56:08 +0000 (15:56 +0100)]
kmod-sched-cake-oot: fix PKG_MIRROR_HASH

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 years agoumdns: fix compiling using gcc 10
Kevin Darbyshire-Bryant [Mon, 20 Jul 2020 11:16:19 +0000 (12:16 +0100)]
umdns: fix compiling using gcc 10

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 years agoglibc: fix memcpy and memmove for negative length [BZ #25620]
Hans Dedecker [Tue, 21 Jul 2020 20:41:04 +0000 (22:41 +0200)]
glibc: fix memcpy and memmove for negative length [BZ #25620]

6f3459f985 Add NEWS entry for CVE-2020-6096 (bug 25620)
64246fccaf arm: CVE-2020-6096: Fix multiarch memcpy for negative length [BZ #25620]
9bbd2b6172 arm: CVE-2020-6096: fix memcpy and memmove for negative length [BZ #25620]

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agoath79: correctly define WiFi switch for TL-WR841ND v8
Adrian Schmutzler [Wed, 8 Jul 2020 18:48:57 +0000 (20:48 +0200)]
ath79: correctly define WiFi switch for TL-WR841ND v8

The TL-WR841ND v8 feature a WiFi switch instead of a button.
This adds the corresponding input-type to prevent booting into
failsafe regularly.

This has been defined correctly in ar71xx, but was overlooked
when migrating to ath79. In contrast, the TL-WR842ND v2, which
has the key set up as switch in ar71xx, actually has a button.
The TL-MR3420 v2 has a button as well and is set up correctly
for both targets. (Information based on TP-Link user guide)

Note:

While looking into this, I found that support PR for TL-MR3420 v2
switched reset button to ACTIVE_HIGH. However, the other two
device still use ACTIVE_LOW. This seems strange, but I cannot
verify it lacking the affected devices.

Fixes: FS#2733
Fixes: 9601d94138de ("add support for TP-Link TL-WR841N/ND v8")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: improve LED support for D-Link DIR-615 D series
Adrian Schmutzler [Wed, 8 Jul 2020 11:36:54 +0000 (13:36 +0200)]
ramips: improve LED support for D-Link DIR-615 D series

This patch adds a trigger for the WAN LED and enhances support for
the WiFi LED by enabling activity indication.

This is based on bug report feedback (see reference below).

While at it, update the LED node names in DTS file.

Fixes: FS#732
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoomap: derive DEVICE_DTS from device name
Adrian Schmutzler [Sat, 18 Jul 2020 12:14:01 +0000 (14:14 +0200)]
omap: derive DEVICE_DTS from device name

In most cases the DEVICE_DTS name can be derived easily from the
node name, so let's do this to enforce harmonized names where
possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoapm821xx: derive DEVICE_DTS from device name
Adrian Schmutzler [Sat, 18 Jul 2020 11:14:28 +0000 (13:14 +0200)]
apm821xx: derive DEVICE_DTS from device name

The DEVICE_DTS variable always matches the device definition name,
just with "_" replaced by "-". Thus, create a DEVICE_DTS definition
in Device/Default and drop all the individual statements.

If necessary in the future, local DEVICE_DTS will still overwrite
that default.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agobcm47xx: fix switch setup for Linksys WRT610N v2
Adrian Schmutzler [Wed, 8 Jul 2020 12:54:11 +0000 (14:54 +0200)]
bcm47xx: fix switch setup for Linksys WRT610N v2

WRT610N V2 is not detected by the initial network configuration script.
The switch remains unconfigured and wlan/lan vlans are not created.

This adds the correct setup for the device.

Fixes: FS#1869
Suggested-by: Alessandro Radicati
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agolayerscape: fix indent
Adrian Schmutzler [Mon, 20 Jul 2020 13:34:18 +0000 (15:34 +0200)]
layerscape: fix indent

Fix indent to be consistent with the rest of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: fix network setup for Ubiquiti ER-X/ER-X-SFP
Nelson Cai [Mon, 20 Jul 2020 05:02:27 +0000 (13:02 +0800)]
ramips: fix network setup for Ubiquiti ER-X/ER-X-SFP

The function name ucidef_set_interface_lan_wan does not exist,
use the proper name by adding an "s" and thereby fix network
setup on these devices.

Fixes: 22468cc40c8b (ramips: erx and erx-sfp: fix missing WAN interface)
Signed-off-by: Nelson Cai <niphor@gmail.com>
[commit message/title facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agohostapd: enter DFS state if no available channel is found
David Bauer [Mon, 20 Jul 2020 13:08:19 +0000 (15:08 +0200)]
hostapd: enter DFS state if no available channel is found

Previously hostapd would not stop transmitting when a DFS event was
detected and no available channel to switch to was available.

Disable and re-enable the interface to enter DFS state. This way, TX
does not happen until the kernel notifies hostapd about the NOP
expiring.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agomac80211: create channel list for fixed channel operation
David Bauer [Mon, 20 Jul 2020 13:07:47 +0000 (15:07 +0200)]
mac80211: create channel list for fixed channel operation

Currently a device which has a DFS channel selected using the UCI
channel setting might switch to a non-DFS channel in case no chanlist is
provided (UCI setting "channels") when the radio detects a DFS event.

Automatically add a chanlist consisting of the configured channel when
the device does not operate in auto-channel mode and no chanlist set to
circumvent this issue.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agovxlan: add capability for multiple fdb entries
Johannes Kimmel [Mon, 20 Jul 2020 06:05:10 +0000 (08:05 +0200)]
vxlan: add capability for multiple fdb entries

Similar to wireguard, vxlan can configure multiple peers or add specific
entries to the fdb for a single mac address.

While you can still use peeraddr/peer6addr option within the proto
vxlan/vxlan6 section to not break existing configurations, this patch
allows to add multiple sections that conigure fdb entries via the bridge
command. As such, the bridge command is now a dependency of the vxlan
package. (To be honest without the bridge command available, vxlan isn't
very much fun to use or debug at all)

Field names are taken direclty from the bridge command.

Example with all supported parameters, since this hasn't been documented so
far:

  config interface 'vx0'
      option proto     'vxlan6'      # use vxlan over ipv6

      # main options
      option ip6addr   '2001:db8::1' # listen address
      option tunlink   'wan6'        # optional if listen address given
      option peer6addr '2001:db8::2' # now optional
      option port      '8472'        # this is the standard port under linux
      option vid       '42'          # VXLAN Network Identifier to use
      option mtu       '1430'        # vxlan6 has 70 bytes overhead

      # extra options
      option rxcsum  '0'  # allow receiving packets without checksum
      option txcsum  '0'  # send packets without checksum
      option ttl     '16' # specifies the TTL value for outgoing packets
      option tos     '0'  # specifies the TOS value for outgoing packets
      option macaddr '11:22:33:44:55:66' # optional, manually specify mac
                                         # default is a random address

Single peer with head-end replication. Corresponds to the following call
to bridge:

  $ bridge fdb append 00:00:00:00:00:00 dev vx0 dst 2001:db8::3

  config vxlan_peer
      option vxlan 'vx0'
      option dst '2001:db8::3' # always required

For multiple peers, this section can be repeated for each dst address.

It's possible to specify a multicast address as destination. Useful when
multicast routing is available or within one lan segment:

  config vxlan_peer
      option vxlan 'vx0'
      option dst 'ff02::1337' # multicast group to join.
                              # all bum traffic will be send there
      option via 'eth1'       # for multicast, an outgoing interface needs
                              # to be specified

All available peer options for completeness:

  config vxlan_peer
      option vxlan   'vx0'               # the interface to configure
      option lladdr  'aa:bb:cc:dd:ee:ff' # specific mac,
      option dst     '2001:db8::4'       # connected to this peer
      option via     'eth0.1'            # use this interface only
      option port    '4789'              # use different port for this peer
      option vni     '23'                # override vni for this peer
      option src_vni '123'               # see man 3 bridge

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
3 years agovxlan: remove mandatory peeraddr
Johannes Kimmel [Mon, 20 Jul 2020 06:05:09 +0000 (08:05 +0200)]
vxlan: remove mandatory peeraddr

vxlan can be configured without a peer address. This is used to prepare
an interface and add peers later.

Fixes: FS#2743
Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Acked-by: Matthias Schiffer <mschiffer@universe-factory.net>
3 years agotplink-safeloader: expand support list for TP-Link CPE210 v3
Adrian Schmutzler [Wed, 8 Jul 2020 09:08:17 +0000 (11:08 +0200)]
tplink-safeloader: expand support list for TP-Link CPE210 v3

This adds new strings to the support list for the TP-Link CPE210 v3
that are supposed to work with the existing setup.

Without it, the factory image won't be accepted by the vendor UI on
these newer revisions.

Tested on a CPE210 v3.20 (EU).

Ref: https://forum.openwrt.org/t/build-for-cpe210-v3-20/68000

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agodnsmasq: bump to 2.82
Kevin Darbyshire-Bryant [Mon, 29 Jun 2020 15:26:42 +0000 (16:26 +0100)]
dnsmasq: bump to 2.82

This fixes a nasty problem introduced in 2.81 which causes random
crashes on systems where there's significant DNS activity over TCP. It
also fixes DNSSEC validation problems with zero-TTL DNSKEY and DS
records.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 years agoprocd: bump to git HEAD once again
Daniel Golle [Mon, 20 Jul 2020 03:36:58 +0000 (04:36 +0100)]
procd: bump to git HEAD once again

Further complete OCI container support in ujail:
 f5f305e jail: move /tmp/resolv.conf.d to /dev/resolv.conf.d
 6f078ae jail: add support for defining devices
 686cf7a jail: actually apply filesystem-specific mount options
 f91009a jail: refactor default mounts into new structure
 66ae2d9 jail: re-implement /proc/sys/net read-write in netns hack

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agolantiq/xrx200: make WLAN button responsive on Fritzbox 7360 & 7362
Dustin Gathmann [Sun, 19 Jul 2020 22:07:44 +0000 (00:07 +0200)]
lantiq/xrx200: make WLAN button responsive on Fritzbox 7360 & 7362

Pressing the 'WLAN' button should enable/disable wireless activity.
Currently, the button is mapped to the KEY_WLAN, which will not
have this effect.
This patch changes the mapping of the WLAN button, so a button
press will emit an action for the 'rfkill' key instead of 'wlan'.
Apparently, this is what stock OpenWRT expects.

This fix is analogous to the preceding patch for Fritzbox 3370.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
3 years agolantiq/xrx200: fix WLAN button actions for Fritzbox 3370
Dustin Gathmann [Wed, 20 May 2020 23:22:53 +0000 (01:22 +0200)]
lantiq/xrx200: fix WLAN button actions for Fritzbox 3370

The WLAN button actions are reversed, i.e. pressing the button emits a
'released' action, and vice versa.
This can easily be checked by adding
logger -t button_action "$BUTTON $ACTION"
as the second line of /etc/rc.button/rfkill, and using logread to read
the events (assuming the preceding patch has been applied).
Defining the GPIO as ACTIVE_LOW corrects this behavior.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
3 years agolantiq/xrx200: make WLAN button responsive on Fritzbox 3370
Dustin Gathmann [Wed, 20 May 2020 22:13:43 +0000 (00:13 +0200)]
lantiq/xrx200: make WLAN button responsive on Fritzbox 3370

Pressing the 'WLAN' button should enable/disable wireless activity.
However, on the Fritzbox 3370 this doesn't have an effect.
This patch changes the mapping of the physical WLAN button, so a button
press will emit an action for the 'rfkill' key instead of 'wlan'.
Apparently, this is what stock OpenWRT expects, and also what is
implemented for most other devices.

Signed-off-by: Dustin Gathmann <dzsoftware@posteo.org>
3 years agoprocd: update to git HEAD
Daniel Golle [Sun, 19 Jul 2020 18:34:46 +0000 (19:34 +0100)]
procd: update to git HEAD

 9eddf0f jail: fix hooks
 1b1286b jail: parse and apply OCI sysctl values
 c049047 jail: implement OCI user additionalGIDs
 0e1920c jail: read and apply umask from OCI if defined
 1c46cc3 jail: parse and apply POSIX rlimits
 76adac5 jail: /proc/$pid/oom_score_adj to OCI defined oomScoreAdj

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoramips: fix flash layout for TP-Link TL-WR841N v14
Alexander Müller [Fri, 17 Jul 2020 16:46:19 +0000 (18:46 +0200)]
ramips: fix flash layout for TP-Link TL-WR841N v14

The config partition was missing from the flash layout of the device.

Although the stock firmware resets a corrupted config partition to the
default values, the TFTP flash with an image bigger than 0x3d0000 will
truncate the image as the bootloader only copies 0x3d0000 bytes to flash
during TFTP flashing.

Fixed by adding the config partition and shrinking the firmware
partition.

Fixes: 3fd97c522bb7 ("ramips: add support for TP-Link TL-WR841n v14")
Signed-off-by: Alexander Müller <donothingloop@gmail.com>
3 years agoramips: remove incorrect mtd-eeprom for TP-Link TL-WR841N v14
Adrian Schmutzler [Fri, 17 Jul 2020 09:23:16 +0000 (11:23 +0200)]
ramips: remove incorrect mtd-eeprom for TP-Link TL-WR841N v14

The factory partition on this device is only 64k in size, so having
mediatek,mtd-eeprom = <&factory 0x10000> would place the EEPROM data
after the end of the flash. As can be verified against the TP-Link
GPL sources, which contain the EEPROM data as binary blob, the actual
address for the EEPROM data is 0x0.

Since 0x0 is default for MT7628, the incorrect line is just removed.

This error is the reason for the abysmal Wifi performance that people
are complaining about for the WR841Nv14.

Fixes: 3fd97c522bb7 ("ramips: add support for TP-Link TL-WR841n v14")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: don't create switch config for VIXMINI
David Bauer [Sat, 18 Jul 2020 20:12:19 +0000 (22:12 +0200)]
ramips: don't create switch config for VIXMINI

Don't create UCI switch config for the GL.iNet microuter-N300 and
VIXMINI. These devices only have a single LAN port.
Creating the switch config makes usage of VLANs more complicated,
as they would have to be configured on the MAC as well as the "switch".

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoprocd: bump to git HEAD
Daniel Golle [Fri, 17 Jul 2020 10:59:16 +0000 (11:59 +0100)]
procd: bump to git HEAD

 8d5208f jail: fix false return in case of nofail mount
 b41f76b procd: fix compile if procd-ujail is not selected
 86a5105 jail: fs: fix build on uClibc-ng
 bfce7d1 jail: fix some more mount options
 268126a jail: add support for maskedPaths and readonlyPaths

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agolantiq: move 01_led_migration script to subtargets
Adrian Schmutzler [Fri, 17 Jul 2020 10:09:57 +0000 (12:09 +0200)]
lantiq: move 01_led_migration script to subtargets

Split the /etc/uci-defaults/01_led_migration scripts into subtargets
as already done for most of the other base-files.

While this introduces a minor amount of code duplication, it still
is considered an improvement, as device-specific settings are kept
together in the subtargets' base-files and the script at hand can be
removed entirely for two of the subtargets not needing it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoltq-*dsl-app: dsl_control: remove unneeded check for lantiq_dsl.sh
Martin Schiller [Fri, 17 Jul 2020 03:58:19 +0000 (05:58 +0200)]
ltq-*dsl-app: dsl_control: remove unneeded check for lantiq_dsl.sh

This file is always present because it is part of the ltq-dsl-base
package on which these packages depend.

This check would not have been necessary in the past, because the script
was part of the TARGET_LANTIQ on which these packages also depend.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
3 years agolantiq: move dsl related base-files into own package
Martin Schiller [Wed, 21 Aug 2019 07:06:54 +0000 (09:06 +0200)]
lantiq: move dsl related base-files into own package

It does not make sense to install this components on lantiq systems
where the dsl subsystem is not needed/used.

This also makes it possible to use the files also on other targets.
(hopefully ipq401x / FritzBox 7530 in the near future)

Signed-off-by: Martin Schiller <ms.3headeddevs@gmail.com>
3 years agoramips: move redundant console setup to mt7621 SoC DTSI
Adrian Schmutzler [Tue, 14 Jul 2020 10:01:51 +0000 (12:01 +0200)]
ramips: move redundant console setup to mt7621 SoC DTSI

For mt7621, console is set up via DTS bootargs individually in
device DTS/DTSI files. However, 44 of 74 statements use the
following setting:

chosen {
bootargs = "console=ttyS0,57600";
};

Therefore, don't repeat ourselves and move that definition to the SoC
DTSI file to serve as a default value.

This patch is cosmetic.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agokernel: bump 5.4 to 5.4.52
John Audia [Thu, 16 Jul 2020 11:03:17 +0000 (07:03 -0400)]
kernel: bump 5.4 to 5.4.52

update_kernel.sh refreshed all patches, no human interaction was needed

Build system: x86_64
Run-tested: Netgear R7800 (ipq806x)

Signed-off-by: John Audia <graysky@archlinux.us>
3 years agoramips: add arl_table support for MT7530
Salvatore Mesoraca [Wed, 17 Jun 2020 13:07:58 +0000 (14:07 +0100)]
ramips: add arl_table support for MT7530

Use switch.h API to expose MT7530's ARL table to
user space.

Signed-off-by: Salvatore Mesoraca <salvatore@samknows.com>
3 years agolzo: fix pkgconfig paths
Rosen Penev [Tue, 14 Jul 2020 05:12:52 +0000 (22:12 -0700)]
lzo: fix pkgconfig paths

The last commit to this package that added the pkgconfig file did not
fix the paths to point to the prefix.

This allows packages to find lzo properly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agomvebu: add Kobol Helios 4 device
Alberto Bursi [Sun, 12 Jul 2020 13:35:54 +0000 (15:35 +0200)]
mvebu: add Kobol Helios 4 device

The Helios 4 is a NAS from Kobol
that is powered by an Armada 38x
MicroSOM from Solidrun, similarly
to Clearfog.

This device has:
-Armada 38x CPU
 (dual core ARMv7 1.6 Ghz)
-2 GB of ECC RAM
-Gigabit ethernet (Marvell)
-2x USB 3.0 ports
-4x Sata 3.0 ports
-i2c header (J9 |>GND|SDA|SCL|VCC)
-2x 3-pin fan headers with PWM
-micro-usb port is a TTL/UART to
 USB converter connected to TTL
-MicroSD card slot
-System, 4xSata and 1xUSB LEDs

NOT WORKING: fan control

Fan Control requires a kernel patch
that is available in the Armbian
project (the "default firmware"
of this device) and named
mvebu-gpio-remove-hardcoded
-timer-assignment
This patch isn't acceptable
by OpenWrt, it should be upstreamed.
I also have that patch in my own
local OpenWrt builds,
in case you want a more
clean and less confusing patch
for upstreaming.

To install, write the disk image
on a micro SD card with dd or
win32 disk imager, insert the
card in the slot.
Check that the dip switch battery
for boot selection is as follows
Switch 1 and 2 down/off, switches
3, 4, 5 up/on.

Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
3 years agouboot-mvebu: add uboot for helios 4
Alberto Bursi [Wed, 3 Jun 2020 06:19:51 +0000 (08:19 +0200)]
uboot-mvebu: add uboot for helios 4

add u-boot for Helios 4 NAS

Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com>
3 years agonat46: update to latest git HEAD
Hans Dedecker [Thu, 16 Jul 2020 20:14:30 +0000 (22:14 +0200)]
nat46: update to latest git HEAD

ac712ad nat46-netdev: Add support for removing a rule

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agoramips: add support for D-Link DIR-867/DIR-882 A1
Mateus B. Cassiano [Wed, 15 Jul 2020 21:45:39 +0000 (17:45 -0400)]
ramips: add support for D-Link DIR-867/DIR-882 A1

This patch adds support for D-Link DIR-867 A1 and D-Link DIR-882 A1. Given
the similarity of these devices, this patch also introduces a common DTS
shared between DIR-867 A1, DIR-878 A1 and DIR-882 A1.

Specifications:
* Board: AP-MTKH7-0002
* SoC: MediaTek MT7621AT
* RAM: 128 MB (DDR3)
* Flash: 16 MB (SPI NOR)
* WiFi: MediaTek MT7615N (x2)
* Switch: 1 WAN, 4 LAN (Gigabit)
* Ports: 1 USB 2.0, 1 USB 3.0
* Buttons: Reset, WiFi Toggle, WPS
* LEDs: Power (green/orange), Internet (green/orange), WiFi 2.4G (green),
        WiFi 5G (green), USB 2.0 (green), USB 3.0 (green)

Notes:
* WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips
* DIR-867 wireless chips are limited to 3x3 streams at hardware level
* USB ports and related LEDs available only on DIR-882

Serial port:
* Parameters: 57600, 8N1
* Location: J1 header (close to the Reset, WiFi and WPS buttons)
* Pinout: 1 - VCC
          2 - RXD
          3 - TXD
          4 - GND

Installation:
* D-Link Recovery GUI: power down the router, press and hold the reset
  button, then re-plug it. Keep the reset button pressed until the power
  LED starts flashing orange, manually assign a static IP address under
  the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1

* Some modern browsers may have problems flashing via the Recovery GUI,
  if that occurs consider uploading the firmware through cURL:

    curl -v -i -F "firmware=@file.bin" 192.168.0.1

Signed-off-by: Mateus B. Cassiano <mbc07@live.com>
[move DEVICE_VARIANT to individual definitions]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: add support for Linksys EA7300 v1
Santiago Rodriguez-Papa [Thu, 16 Jul 2020 00:24:43 +0000 (20:24 -0400)]
ramips: add support for Linksys EA7300 v1

Specifications:

* SoC:      MediaTek MT7621A              (880 MHz 2c/4t)
* RAM:      Nanya NT5CC128M16IP-DIT       (256M DDR3-1600)
* Flash:    Macronix MX30LF1G18AC-TI      (128M NAND)
* Eth:      MediaTek MT7621A              (10/100/1000 Mbps x5)
* Radio:    MT7615N                       (2.4 GHz & 5 GHz)
            4 antennae: 1 internal and 3 non-deatachable
* USB:      3.0 (x1)
* LEDs:
    White   (x1 logo)
    Green   (x6 eth + wps)
    Orange  (x5, hardware-bound)
* Buttons:
    Reset   (x1)
    WPS     (x1)

Everything works! Been running it for a couple weeks now and haven't had
any problems. Please let me know if you run into any.

Installation:

Flash factory image through GUI.

This might fail due to the A/B nature of this device. When flashing, OEM
firmware writes over the non-booted partition. If booted from 'A',
flashing over 'B' won't work. To get around this, you should flash the
OEM image over itself. This will then boot the router from 'B' and
allow you to flash OpenWRT without problems.

Reverting to factory firmware:

Hard-reset the router three times to force it to boot from 'B.' This is
where the stock firmware resides. To remove any traces of OpenWRT from
your router simply flash the OEM image at this point.

Signed-off-by: Santiago Rodriguez-Papa <contact@rodsan.dev>
[use v1 only, minor DTS adjustments, use LINKSYS_HWNAME and add it to
DEVICE_VARS, wrap DEVICE_PACKAGES, adjust commit message/title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: provide common definition for ELECOM WRC GS devices
Adrian Schmutzler [Wed, 15 Jul 2020 18:08:22 +0000 (20:08 +0200)]
ramips: provide common definition for ELECOM WRC GS devices

Add a common definition for ELECOM WRC "GS" devices to mt7621.mk
to not repeat the same assignments five times.

To keep the naming consistent, slightly rename the DTSI and the
factory image recipe as well.

Note that elecom_wrc-1167ghbk2-s uses a slightly different build
recipe for the factory image, so we keep it separate.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com> [WRC-1750GSV]
3 years agoramips: add support for ELECOM WRC-1750GS/GSV
INAGAKI Hiroshi [Wed, 15 Jul 2020 04:13:01 +0000 (13:13 +0900)]
ramips: add support for ELECOM WRC-1750GS/GSV

ELECOM WRC-1750GS is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on
MT7621A.

WRC-1750GSV has the same hardware with WRC-1750GS.

Specification:

- SoC : MediaTek MT7621A
- RAM : DDR3 128 MiB
- Flash : SPI-NOR 16 MiB
- WLAN : 2.4/5 GHz 3T3R (2x MediaTek MT7615)
- Ethernet : 10/100/1000 Mbps x5
  - Switch : MediaTek MT7530 (SoC)
- LED/keys : 4x/6x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
  - J4: 3.3V, GND, TX, RX from ethernet port side
  - 57600n8
- Power : 12VDC, 1.5A

Flash instruction using factory image:

1. Boot WRC-1750GS (or WRC-1750GSV) normally
2. Access to "http://192.168.2.1/" and open firmware update page
   ("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
   for WRC-1750GS : wrc-1750gs-squashfs-factory.bin
   for WRC-1750GSV: wrc-1750gsv-squashfs-factory.bin
4. Wait ~120 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
3 years agomediatek: backport latest pci/e driver from upstream
John Crispin [Thu, 16 Jul 2020 07:18:28 +0000 (09:18 +0200)]
mediatek: backport latest pci/e driver from upstream

Signed-off-by: John Crispin <john@phrozen.org>
3 years agomediatek: generate UBI images for the rev board
John Crispin [Thu, 16 Jul 2020 07:16:34 +0000 (09:16 +0200)]
mediatek: generate UBI images for the rev board

Signed-off-by: John Crispin <john@phrozen.org>
3 years agomediatek: minor fix to eip97 driver
John Crispin [Thu, 16 Jul 2020 07:14:49 +0000 (09:14 +0200)]
mediatek: minor fix to eip97 driver

This patch makes the driver work on the newer v2.3 core.

Signed-off-by: John Crispin <john@phrozen.org>
3 years agoath79: harmonize model names for Ubiquiti devices
Adrian Schmutzler [Wed, 15 Jul 2020 16:41:57 +0000 (18:41 +0200)]
ath79: harmonize model names for Ubiquiti devices

This harmonizes the model names for the ath79 Ubiquiti devices by
applying a few minor cosmetic adjustments:

- Removes hyphens where they are not found in the product names
  (Ubiquiti uses hyphens only for the abbreviated version names
  like UAP-AC-PRO which we don't use anyway.)

- Add (XM) suffix for DTS model strings to help with distinguishing
  them from their XW counterparts.

- Remove DEVICE_VARIANT for LAP-120 which actually was an alternate
  device name.

- Generally make DTS model names and those from generic-ubnt.mk
  more consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agobase-files: replace backticks in lib/upgrade/nand.sh
Adrian Schmutzler [Sun, 10 May 2020 14:20:55 +0000 (16:20 +0200)]
base-files: replace backticks in lib/upgrade/nand.sh

This replaces deprecated backticks by more versatile $(...) syntax.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agopackage: drop PKG_VERSION for purely local packages
Adrian Schmutzler [Mon, 24 Feb 2020 15:57:38 +0000 (16:57 +0100)]
package: drop PKG_VERSION for purely local packages

In the package guidelines, PKG_VERSION is supposed to be used as
"The upstream version number that we're downloading", while
PKG_RELEASE is referred to as "The version of this package Makefile".
Thus, the variables in a strict interpretation provide a clear
distinction between "their" (upstream) version in PKG_VERSION and
"our" (local OpenWrt trunk) version in PKG_RELEASE.

For local (OpenWrt-only) packages, this implies that those will only
need PKG_RELEASE defined, while PKG_VERSION does not apply following
a strict interpretation. While the majority of "our" packages actually
follow that scheme, there are also some that mix both variables or
have one of them defined but keep them at "1".

This is misleading and confusing, which can be observed by the fact
that there typically either one of the variables is never bumped or
the choice of the variable to increase depends on the person doing the
change.

Consequently, this patch aims at clarifying the situation by
consistently using only PKG_RELEASE for "our" packages. To achieve
that, PKG_VERSION is removed there, bumping PKG_RELEASE where
necessary to ensure the resulting package version string is bigger
than before.

During adjustment, one has to make sure that the new resulting composite
package version will not be considered "older" than the previous one.

A useful tool for evaluating that is 'opkg compare-versions'. In
principle, there are the following cases:

1. Sole PKG_VERSION replaced by sole PKG_RELEASE:
   In this case, the resulting version string does not change, it's
   just the value of the variable put in the file. Consequently, we
   do not bump the number in these cases so nobody is tempted to
   install the same package again.

2. PKG_VERSION and PKG_RELEASE replaced by sole PKG_RELEASE:
   In this case, the resulting version string has been "version-release",
   e.g. 1-3 or 1.0-3. For this case, the new PKG_RELEASE will just
   need to be higher than the previous PKG_VERSION.
   For the cases where PKG_VERSION has always sticked to "1", and
   PKG_RELEASE has been incremented, we take the most recent value of
   PKG_RELEASE.

Apart from that, a few packages appear to have developed their own
complex versioning scheme, e.g. using x.y.z number for PKG_VERSION
_and_ a PKG_RELEASE (qos-scripts) or using dates for PKG_VERSION
(adb-enablemodem, wwan). I didn't touch these few in this patch.

Cc: Hans Dedecker <dedeckeh@gmail.com>
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Andre Valentin <avalentin@marcant.net>
Cc: Matthias Schiffer <mschiffer@universe-factory.net>
Cc: Jo-Philipp Wich <jo@mein.io>
Cc: Steven Barth <steven@midlink.org>
Cc: Daniel Golle <dgolle@allnet.de>
Cc: John Crispin <john@phrozen.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agovxlan: bump and change to PKG_RELEASE
Adrian Schmutzler [Wed, 15 Jul 2020 14:49:36 +0000 (16:49 +0200)]
vxlan: bump and change to PKG_RELEASE

Bumping package version has been overlooked in a previous commit.

While at it, use PKG_RELEASE instead of PKG_VERSION, as the latter
is meant for upstream version number only.
(The effective version string for the package would be "3" in both
cases, so there is no harm done for version comparison.)

Fixes: 0453c3866feb ("vxlan: fix udp checksum control")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoath79: add support for Ubiquiti PowerBridge M
Vieno Hakkerinen [Fri, 10 Jul 2020 21:23:01 +0000 (23:23 +0200)]
ath79: add support for Ubiquiti PowerBridge M

This adds support for the Ubiquiti PowerBridge M, which has the same
board/LEDs as the Bullet M XM, but different case and antennas.

Specifications:
- AR7241 SoC @ 400 MHz
- 64 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- Internal antenna: 25 dBi
- POWER/LAN green LEDs
- 4x RSSI LEDs (red, orange, green, green)
- UART (115200 8N1) on PCB

Flashing via WebUI:
Upload the factory image via the stock firmware web UI.

Attention: airOS firmware versions >= 5.6 have a new bootloader with
an incompatible partition table!

Please downgrade to <= 5.5 _before_ flashing OpenWrt!
Refer to the device's Wiki page for further information.

Flashing via TFTP:
Same procedure as other Bullet M (XM) boards.

- Use a pointy tool (e.g., pen cap, paper clip) and keep the reset
button on the device or on the PoE supply pressed
- Power on the device via PoE (keep reset button pressed)
- Keep pressing until LEDs flash alternatively LED1+LED3 =>
LED2+LED4 => LED1+LED3, etc.
- Release reset button
- The device starts a TFTP server at 192.168.1.20
- Set a static IP on the computer (e.g., 192.168.1.21/24)
- Upload via tftp the factory image:
$ tftp 192.168.1.20
  tftp> bin
  tftp> trace
  tftp> put openwrt-ath79-generic-xxxxx-ubnt_powerbridge-m-squashfs-factory.bin

Signed-off-by: Vieno Hakkerinen <vieno@hakkerinen.eu>
3 years agoravpower-mcu: bump PKG_RELEASE
David Bauer [Wed, 15 Jul 2020 07:56:05 +0000 (09:56 +0200)]
ravpower-mcu: bump PKG_RELEASE

Fixes commit b94d1a2d2786 ("ravpower-mcu: remove target dependency")

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agovxlan: fix udp checksum control
Johannes Kimmel [Mon, 8 Jun 2020 14:14:43 +0000 (16:14 +0200)]
vxlan: fix udp checksum control

So far, passing "rxcsum" and "txcsum" had no effect.

Fixes: 95ab18e0124e ("vxlan: add options to enable and disable UDP
checksums")

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
[add Fixes:]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoravpower-mcu: remove target dependency
David Bauer [Tue, 14 Jul 2020 22:01:36 +0000 (00:01 +0200)]
ravpower-mcu: remove target dependency

Remove the target dependency as the tool is also usable with other
battery-powered routers.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoiproute2: tc: fix missing em_ipset module
Tony Ambardar [Tue, 30 Jun 2020 05:07:19 +0000 (22:07 -0700)]
iproute2: tc: fix missing em_ipset module

Feature detection doesn't recognize ipset v7 use on kernel v5.x systems
and thus disables the tc ematch function em_ipset.

- backport patch:
  * 002-configure-support-ipset-v7.patch:
    650591a7a70c configure: support ipset version 7 with kernel version 5

Fixes: 4e0c54bc5bc8 ("kernel: add support for kernel 5.4")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agoiproute2: tc: fix dynamic symbol table size optimization
Tony Ambardar [Tue, 30 Jun 2020 05:04:54 +0000 (22:04 -0700)]
iproute2: tc: fix dynamic symbol table size optimization

Recent iproute2 5.x versions modified the symbols resolved for plugins,
causing "tc .. action xt .." to fail. Update the list of symbols to fix.

Fixes: b61495409bb3 ("iproute2: tc: reduce size of dynamic symbol table")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agoipq40xx: fix ethernet vlan double tagging
John Crispin [Tue, 14 Jul 2020 08:07:32 +0000 (10:07 +0200)]
ipq40xx: fix ethernet vlan double tagging

As the the SoC uses implicit vlan tagging for dual MAC support, the
offload feature breaks when using double tagging.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: John Crispin <john@phrozen.org>
3 years agoipq40xx: merge all ar40xx patches into one single patch
John Crispin [Tue, 14 Jul 2020 07:50:31 +0000 (09:50 +0200)]
ipq40xx: merge all ar40xx patches into one single patch

Signed-off-by: John Crispin <john@phrozen.org>
3 years agoipq806x: really fix aliases node for Qualcomm IPQ8064/DB149
Adrian Schmutzler [Tue, 14 Jul 2020 14:59:44 +0000 (16:59 +0200)]
ipq806x: really fix aliases node for Qualcomm IPQ8064/DB149

Having looked at this again, it appears that only gsbi2_serial
is actually enabled for this device, so the entry in the broken
aliases node was correct.

Therefore, this needs to set its own serial0 instead of inheriting
"serial0 = &gsbi4_serial;" from DTSI. Do this with the correctly
named aliases node now.

Fixes: c83f7b6d217f ("ipq806x: fix aliases node name for Qualcomm
IPQ8064/DB149")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoipq806x: use consistent DT labels for gsbiX_serial
Adrian Schmutzler [Tue, 14 Jul 2020 10:23:53 +0000 (12:23 +0200)]
ipq806x: use consistent DT labels for gsbiX_serial

Kernel uses the label gsbiX_serial, so let's adjust our labels to
this naming scheme.

This is cosmetic, and actually only already existing gsbi4_serial
has been used at all.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoipq806x: fix aliases node name for Qualcomm IPQ8064/DB149
Adrian Schmutzler [Fri, 3 Jul 2020 13:50:42 +0000 (15:50 +0200)]
ipq806x: fix aliases node name for Qualcomm IPQ8064/DB149

This device uses a node incorrectly named "alias" instead of
"aliases" since it was introduced.

Remove it without replacement, as the definitions in it don't
seem to be required anyway:

The serial0 definition has never been effective anyway and this
would be the only device deviating from the common setting
"serial0 = &gsbi4_serial;" for ipq8064. (So, maybe the wrong
node prevented us from finding out about the wrong serial
definition?)

The mdio-gpio0 alias was supposed to be removed in d2a2eb7e48f6
anyway, the redundant definition in the alias node was just
overlooked back then.

Fixes: 0fd202f3e563 ("ipq806x: add db149 dts files")
Fixes: d2a2eb7e48f6 ("ipq806x: replace caf nss-gmac driver by upstream stmmac")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoprocd: allow optional watchdog instance parameter
Daniel Bailey [Mon, 13 Jul 2020 22:21:50 +0000 (15:21 -0700)]
procd: allow optional watchdog instance parameter

Optional instance watchdog timeout and watchdog mode can be set by
adding: procd_set_param $mode $timeout

$mode is an integer [0-1] representing instance watchdog mode of
operation:
0 = disabled
1 = passive mode, client must periodically poke watchdog via ubus

$timeout is an integer representing how often, in seconds, the watchdog must be poked.

Signed-off-by: Daniel Bailey <danielb@meshplusplus.com>
3 years agoprocd: update to git HEAD
Daniel Golle [Mon, 13 Jul 2020 23:23:11 +0000 (00:23 +0100)]
procd: update to git HEAD

 639df57 uxc: fix build with uClibc-ng
 b2230e4 procd: add service instance watchdog

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoath79: use rgmii-id instead of rgmii in ubnt,lap-120
Roger Pueyo Centelles [Tue, 10 Mar 2020 18:31:20 +0000 (19:31 +0100)]
ath79: use rgmii-id instead of rgmii in ubnt,lap-120

Since commit 6f2e1b7485 (ath79: disable delays on AT803X config init)
the incoming incoming traffic on the ubnt,lap-120 devices Ethernet
port was not making it through. Using rgmii-id instead of rgmii (same
configuration as ubnt,litebeam-ac-gen2) fixes it.

Fixes FS#2893.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
3 years agobuild,json: fix compatibility with Python 3.5
Paul Spooren [Sun, 12 Jul 2020 04:44:55 +0000 (18:44 -1000)]
build,json: fix compatibility with Python 3.5

The f-string feature was introduced in Python 3.6. As Buildbots may run
on Debian 9, which comes per default with Python 3.5, this would cause
an issue. Instead of f-strings use the *legacy* `.format()` function.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agoramips: add support for D-Link DIR-878 A1
Mathieu Martin-Borret [Fri, 10 Jul 2020 03:49:20 +0000 (13:49 +1000)]
ramips: add support for D-Link DIR-878 A1

Specifications:

    SoC: MT7621AT
    RAM: 128MB
    Flash: 16MB NOR SPI flash
    WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz)
    LAN: 5x1000M
    Firmware layout is Uboot with extra 96 bytes in header
    Base PCB is AP-MTKH7-0002
    LEDs Power Green,Power Orange,Internet Green,Internet Orange
    LEDs "2.4G" Green & "5G" Green connected directly to wifi module
    Buttons Reset,WPS,WIFI

Flashing instructions:

Upload image via emergency recovery mode
Push and hold reset button (on the back of the device) until power led
starts flashing (about 10 secs or so) while powering the device on.
Give it ~30 seconds, to boot the recovery mode GUI
Connect your client computer to LAN1 of the device
Set your client IP address manually to 192.168.0.2 / 255.255.255.0.
Call the recovery page for the device at http://192.168.0.1
Use the provided emergency web GUI to upload and flash a new firmware to
the device. Some browsers/OS combinations are known not to work, so if
you don't see the percentage complete displayed and moving within a few
seconds, restart the procedure from scratch and try anoher one,
or try the command line way.

Alternative method using command line on Linux:
curl -v -i -F "firmware=@openwrt-xxxx-squashfs-factory.bin" 192.168.0.1

Signed-off-by: Mathieu Martin-Borret <mathieu.mb@protonmail.com>
[use of generic uimage-padhdr in image generation code]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
3 years agokernel: mtdsplit_uimage: add SGE parser
Mathieu Martin-Borret [Fri, 10 Jul 2020 03:40:58 +0000 (13:40 +1000)]
kernel: mtdsplit_uimage: add SGE parser

Adding SGE parser for SGE (T&W) Shenzhen Gongjin Electronics
to add 96 bytes padding the the firmware image

Signed-off-by: Mathieu Martin-Borret <mathieu.mb@protonmail.com>
3 years agoglibc: fix avx2 strncmp offset compare condition check [BZ #25933]
Hans Dedecker [Mon, 13 Jul 2020 20:36:47 +0000 (22:36 +0200)]
glibc: fix avx2 strncmp offset compare condition check [BZ #25933]

4e8a33a959 NEWS: Mention BZ 25933 fix
fd15ba932d Fix avx2 strncmp offset compare condition check [BZ #25933

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agorockchip: don't disable timer LED trigger
David Bauer [Mon, 13 Jul 2020 15:44:22 +0000 (17:44 +0200)]
rockchip: don't disable timer LED trigger

The timer LED trigger is enabled in all targets (except for lantiq
xway-legacy). It's necessary for the OpenWrt preinit LED pattern to
work.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agorockchip: use downstream GPIO button implementation
David Bauer [Mon, 13 Jul 2020 15:44:07 +0000 (17:44 +0200)]
rockchip: use downstream GPIO button implementation

Use the OpenWrt netlink GPIO button implementation to forward button
presses to procd. This is necessary to make failsafe-mode access
using a button possible.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoprocd: update to git HEAD
Daniel Golle [Mon, 13 Jul 2020 11:19:08 +0000 (12:19 +0100)]
procd: update to git HEAD

 aed7fb3 procd: fix compilation with uClibc-ng
 9d0f831 jail: fix segfault with len(uidmap/gidmap) > 1
 42a6217 jail: consider PATH for argv in OCI container
 83f4b72 jail: actually chdir into OCI defined CWD
 fc9f614 jail: parse and run OCI hooks
 02eec92 jail: memory allocation fixes
 71e75f4 jail: refactor mount support to cover OCI spec
 b586e7d jail: don't make mount source read-only
 dacab12 uxc: fix 'stop' command

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agobcm47xx: disable image for Linksys WRT160n v3
Adrian Schmutzler [Wed, 8 Jul 2020 12:32:31 +0000 (14:32 +0200)]
bcm47xx: disable image for Linksys WRT160n v3

The device can only hold 3.6 MB, but newer images (since 18.06)
are bigger, so flashing a new version fails.

This disables default build for this device based on the bug report
referenced below.

Fixes: FS#1963
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: consolidate Netgear devices for mt7628
Adrian Schmutzler [Fri, 10 Jul 2020 10:00:08 +0000 (12:00 +0200)]
ramips: consolidate Netgear devices for mt7628

This creates a common DTSI and shared image definition for the
relatively similar Netgear devices for mt7628 platform.

As a side effect, this raises SPI flash frequency for the R6120,
as it's expected to work there as well if it works for R6080 and
R6020.

Based on the data from the other devices, it also seems probable
the 5g MAC address for R6120 could be extracted from the caldata,
and the mtd-mac-address there could be dropped.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agowireguard: bump to 1.0.20200712
Jason A. Donenfeld [Mon, 13 Jul 2020 03:37:11 +0000 (21:37 -0600)]
wireguard: bump to 1.0.20200712

This release brings parity with the commits Linus released a few hours
ago into 5.8-rc5.

* receive: account for napi_gro_receive never returning GRO_DROP

The napi_gro_receive function no longer returns GRO_DROP ever, making
handling GRO_DROP dead code. This commit removes that dead code.
Further, it's not even clear that device drivers have any business in
taking action after passing off received packets; that's arguably out of
their hands.

* device: implement header_ops->parse_protocol for AF_PACKET

WireGuard uses skb->protocol to determine packet type, and bails out if
it's not set or set to something it's not expecting. For AF_PACKET
injection, we need to support its call chain of:

    packet_sendmsg -> packet_snd -> packet_parse_headers ->
      dev_parse_header_protocol -> parse_protocol

Without a valid parse_protocol, this returns zero, and wireguard then
rejects the skb. So, this wires up the ip_tunnel handler for layer 3
packets for that case.

* queueing: make use of ip_tunnel_parse_protocol

Now that wg_examine_packet_protocol has been added for general
consumption as ip_tunnel_parse_protocol, it's possible to remove
wg_examine_packet_protocol and simply use the new
ip_tunnel_parse_protocol function directly.

* compat: backport ip_tunnel_parse_protocol and ip_tunnel_header_ops

These are required for moving wg_examine_packet_protocol out of
wireguard and into upstream.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>