Compare commits

...

874 Commits

Author SHA1 Message Date
Mikhail Novosyolov 3cd69d3546 Remove yggdrasil for now
1. It seems to allow any connections in default mode, I don't want it
https://t.me/rosalinux/63611
2. This package is very heavy (3.5 MB), there is enough space, but still...
4 years ago
Mikhail Novosyolov 22f2d947d9 add sudo, drop openssh (dropbear is enough) 4 years ago
Mikhail Novosyolov a59a5551a7 preinstall my SSH keys 4 years ago
Mikhail Novosyolov 8f608e1601 Add config of the 1st successfull build for Mercusys AC12
Image is 5.1 MB
4 years ago
Hauke Mehrtens f3f38f40da OpenWrt v19.07.3: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Thibaut VARÈNE 85e04e9f46 generic: platform/mikrotik: fix LZOR support
31e99fe3da which introduced this code was unfortunately untested.
This commit fixes a number of issues and works around the fact that in
this particular scheme, the LZO payload may be padded at the end which
will trigger a harmless lzo decompression error.
This commit also disambiguates the debug printks.

Tested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
Fixes: 31e99fe3da ("generic: platform/mikrotik: support LZOR encoding")
(cherry picked from commit 2ea481193c)
4 years ago
Robert Marko 4cd9ae41c5 libjson-c: backport security fixes
This backports upstream fixes for the out of bounds write vulnerability in json-c.
It was reported and patches in this upstream PR: https://github.com/json-c/json-c/pull/592

Addresses CVE-2020-12762

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
[bump PKG_RELEASE, rebase patches on top of json-c 0.12]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit bc0288b768)
4 years ago
Adrian Schmutzler 6ffd4d8a4d ar71xx: remove hard-coded folder name from Mikrotik RB upgrade
So far, specifying "BOARD_NAME := routerboard" is required by the
upgrade code of Mikrotik NAND devices, as "sysupgrade-routerboard"
is hardcoded in platform_do_upgrade_mikrotik_rb().

This patch replaces the latter with a grep for the name like it
is already done in nand_upgrade_tar() in /lib/upgrade/nand.sh.

This should enable upgrades from ar71xx to ath79 without setting
BOARD_NAME for the latter.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(backported from commit 281785d74f)
4 years ago
Daniel Golle d2ee15ef76 fstools: blockd: fix segfault triggered by non-autofs mounts
Program received signal SIGSEGV, Segmentation fault.
main_autofs (argv=<optimized out>, argc=<optimized out>)
    at fstools-2020-05-06-eec16e2f/block.c:1193
1193:    if (!m->autofs && (mp = find_mount_point(pr->dev))) {

Fixes: 3b9e4d6d4c ("fstools: update to the latest version")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit b181294b02)
4 years ago
Thibaut VARÈNE 4cd44e5dc7 ar71xx: mikrotik: mach-rbspi.c remove wlan id
Following on the previous commit, this patch removes useless id argument
from rbspi_wlan_init().

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 3fecb06fb1 ar71xx: mikrotik: bypass id check in __rb_get_wlan_data()
The id parameter in __rb_get_wlan_data() was incorrectly used on the
assumption that id "0" would always be tied to ath9k with RLE encoding
and positive id (in fact, only id "1" was valid) would always be tied to
("external") ath10k with LZO encoding.

Newer hardware revisions of supported devices prove this assumption to
be invalid, with ath9k caldata being now wrapped in MAGIC_ERD and LZO
compressed, so disable this check to allow newer hardware to correctly
decode caldata for ath9k. Since ath10k caldata is no longer pulled from
this implementation, this commit also disables the publication in sysfs
to avoid wasting memory.

Note: this patch assumes that ath9k caldata is never stored with the new
"LZOR" encoding scheme found on some ath10k devices.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE b36aa168d8 ar71xx: mikrotik: ath10k: use new sysfs driver
Fetch ath10k calibration data from backported mikrotik sysfs driver
which supports the newer "LZOR" encoding.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE fa2369e59b generic: platform/mikrotik: support LZOR encoding
Some newer MikroTik RouterBOARD devices use a new encoding scheme
for their WLAN calibration data. This patch provides support for
decoding this new scheme.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 612b64e6c4 ar71xx: enable mikrotik platform driver
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE 511859de9b generic: mikrotik platform build bits
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Thibaut VARÈNE ddae86cc69 generic: routerboot sysfs platform driver
This driver exposes the data encoded in the "hard_config" flash segment
of MikroTik RouterBOARDs devices. It presents the data in a sysfs folder
named "hard_config". The WLAN calibration data is available on demand via
the 'wlan_data' sysfs file in that folder.

This driver permanently allocates a chunk of RAM as large as the
"hard_config" MTD partition (typically 4KB), although it is technically
possible to operate entirely from the MTD device without using a local
buffer (except when requesting WLAN calibration data), at the cost of a
performance penalty.

This driver does not reuse any of the existing code previously found in
routerboot.c.

This driver has been successfully tested on BE (ath79) and LE (ipq40xx
and ramips) hardware.

Tested-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Tested-by: Baptiste Jonglez <git@bitsofnetworks.org>
Tested-by: Tobias Schramm <t.schramm@manjaro.org>
Tested-by: Christopher Hill <ch6574@gmail.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
4 years ago
Koen Vandeputte 2efcfb1d1a kernel: bump 4.14 to 4.14.180
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Lech Perczak ecea10f2b9 ath79: dts: add missing 'serial0' alias for TP-Link TL-MR3040v2
Out of all devices currently supported based on AR9331 chipset,
this one had the 'serial0' alias missing. Add it to fix setting of
/dev/console and login shell on the onboard UART.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 94f3449977)
4 years ago
Hauke Mehrtens a8c92e9eda opkg: Fix PKG_MIRROR_HASH
Fixes: c61fbdd087 ("odhcpd: fix PKG_SOURCE_DATE")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
DENG Qingfang 844b892a74 ath10k-firmware: fix mirror hash
Fix PKG_MIRROR_HASH hash mismatch.

Fixes: 641a93f0f2 ("ath10k-firmware: update wave 1 firmware to 10.2.4-1.0-00047")
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
[added missing commit description]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 2d758129ca)
4 years ago
Jo-Philipp Wich 7e9d84ee4a opkg: update to latest Git HEAD
f2166a8 libopkg: implement lightweight package listing logic
cf4554d libopkg: support passing callbacks to feed parsing functions
2a0210f opkg-cl: don't read feeds on opkg update
b6f1967 libopkg: use xsystem() to spawn opkg-key
60b9af2 file_util.c: refactor and fix checksum_hex2bin()
206ebae file_util.c: fix possible bad memory access in file_read_line_alloc()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 79da9d78b9)
4 years ago
Jason A. Donenfeld 81f3f6540e wireguard: bump to 1.0.20200506
* compat: timeconst.h is a generated artifact

Before we were trying to check for timeconst.h by looking in the kernel
source directory. This isn't quite correct on configurations in which
the object directory is separate from the kernel source directory, for
example when using O="elsewhere" as a make option when building the
kernel. The correct fix is to use $(CURDIR), which should point to
where we want.

* compat: use bash instead of bc for HZ-->USEC calculation

This should make packaging somewhat easier, as bash is generally already
available (at least for dkms), whereas bc isn't provided by distros by
default in their build meta packages.

* socket: remove errant restriction on looping to self

It's already possible to create two different interfaces and loop
packets between them. This has always been possible with tunnels in the
kernel, and isn't specific to wireguard. Therefore, the networking stack
already needs to deal with that. At the very least, the packet winds up
exceeding the MTU and is discarded at that point. So, since this is
already something that happens, there's no need to forbid the not very
exceptional case of routing a packet back to the same interface; this
loop is no different than others, and we shouldn't special case it, but
rather rely on generic handling of loops in general. This also makes it
easier to do interesting things with wireguard such as onion routing.
At the same time, we add a selftest for this, ensuring that both onion
routing works and infinite routing loops do not crash the kernel. We
also add a test case for wireguard interfaces nesting packets and
sending traffic between each other, as well as the loop in this case
too. We make sure to send some throughput-heavy traffic for this use
case, to stress out any possible recursion issues with the locks around
workqueues.

* send: cond_resched() when processing tx ringbuffers

Users with pathological hardware reported CPU stalls on CONFIG_
PREEMPT_VOLUNTARY=y, because the ringbuffers would stay full, meaning
these workers would never terminate. That turned out not to be okay on
systems without forced preemption. This commit adds a cond_resched() to
the bottom of each loop iteration, so that these workers don't hog the
core. We don't do this on encryption/decryption because the compat
module here uses simd_relax, which already includes a call to schedule
in preempt_enable.

* selftests: initalize ipv6 members to NULL to squelch clang warning

This fixes a worthless warning from clang.

* send/receive: use explicit unlikely branch instead of implicit coalescing

Some code readibility cleanups.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit 4f6343ffe7)
4 years ago
Jason A. Donenfeld b956f6bd13 wireguard: bump to 20191226
As announced on the mailing list, WireGuard will be in Linux 5.6. As a
result, the wg(8) tool, used by OpenWRT in the same manner as ip(8), is
moving to its own wireguard-tools repo. Meanwhile, the out-of-tree
kernel module for kernels 3.10 - 5.5 moved to its own wireguard-linux-
compat repo. Yesterday, releases were cut out of these repos, so this
commit bumps packages to match. Since wg(8) and the compat kernel module
are versioned and released separately, we create a wireguard-tools
Makefile to contain the source for the new tools repo. Later, when
OpenWRT moves permanently to Linux 5.6, we'll drop the original module
package, leaving only the tools. So this commit shuffles the build
definition around a bit but is basically the same idea as before.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit ea980fb9c6)
4 years ago
Hans Dedecker c61fbdd087 odhcpd: fix PKG_SOURCE_DATE
Fixes: 5e8b50da15 (odhcpd : fix lan host reachibility due to identical RIO and PIO prefixes (FS#3056))

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years ago
Hans Dedecker 5e8b50da15 odhcpd: fix lan host reachibility due to identical RIO and PIO prefixes (FS#3056)
49e4949 router: fix Lan host reachibility due to identical RIO and PIO prefixes (FS#3056)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years ago
Jo-Philipp Wich ac5d5d8d09 ustream-ssl: update to 19.07 Git HEAD
40b563b ustream-openssl: clear error stack before SSL_read/SSL_write
30cebb4 ustream-ssl: mbedtls: fix ssl client verification
77de09f ustream-ssl: mbedtls: fix net_sockets.h include warning

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Jo-Philipp Wich a6caa8fad1 uhttpd: update to 19.07 Git HEAD
975dce2 client: allow keep-alive for POST requests
d062f85 file: poke ustream after starting deferred program

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Rafał Miłecki 3b9e4d6d4c fstools: update to the latest version
eec16e2 blockd: add optional "device" parameter to "info" ubus method
9ab936d block(d): always call hotplug.d "mount" scripts from blockd
4963db4 blockd: use uloop_process for calling /sbin/hotplug-call mount
cddd902 Truncate FAT filesystem label until 1st occurance of a blank (0x20)

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit c3a43753b9)
4 years ago
Chuanhong Guo d9244a1b5b generic: ar8216: fix unknown packet flooding for ar8229/ar8236
ar8229 and ar8236 don't allow unknown unicast/multicast frames and
broadcast frames to be flooded to cpu port. This isn't desired behavior
for swconfig as we treat it as a standalone switch.
Current code doesn't enable unicast frame flooding for ar8229 and uses
wrong setup for ar8236. This commit fixes both of them by enabling port
0 flooding for all unknown frames.

Fixes: FS#2848
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 47f17b0662)
4 years ago
Jo-Philipp Wich 429e4490c4 libpcap: fix library packaging issues
Workaround a bug in patches/100-debian_shared_lib.patch - it attemptss to
extract the library major version from debian/changelog which does not exist
in the vanilla upstream tarball.

Create a fake changelog file for now to satisfy the version extraction
routine until we get around to properly augment the patch.

Fixes: FS#2970
Fixes: 96ee7c8bfd ("libpcap: Update shared-lib patch from Debian to fix linking problems")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Petr Štetiar e678cb1595 kernel: bump 4.14 to 4.14.179
Runtime-tested on: qemu-x86-64
Compile-tested on: x86/64

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Rafał Miłecki 8fa4ed9ef7 fstools: update to the latest version
8b9e601 block: always use st_dev (device ID) of / when looking for root
37c9148 block: simplify check_extroot() a bit
d70774d block: add some basic extroot documentation
32db27d Revert "block: support hierarchical mount/umount"
0b93429 Revert "block: mount_action: handle mount/umount deps"

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 9295ce7006)
4 years ago
Felix Fietkau 5c6dfb5bc0 fstools: update to the latest version
84965b92f635 blockd: print symlink error code and string message
62c578c22f9d blockd: report "target" path as "mount" for autofs available mounts
d1f1f2b38fa1 block: remove mount target file if it's a link
830441d790d6 blockd: remove symlink linkpath file if it's a dir or link
c80f7002114f libfstools/mtd: attempt to read from OOB data if empty space is found

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit b7d6e80fee)
4 years ago
Hauke Mehrtens 607809dcdc mac80211: Update to version 4.19.120
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Paul Spooren 96d280cc37 scripts/download: add sources CDN as first mirror
OpenWrt now has a CDN for sources at sources.cdn.openwrt.org which
mirrors sources.openwrt.org.

Downloading sources outside Europe or US (mainland) could
result in low throughput, extremely slowing down the first compilation of
the build system.

This patch adds sources.cdn.openwrt.org as the first mirror to offer
worldwide fast download speeds by default. If the CDN goes down for
whatever reason, the script jumps to the next available mirror and
downloads requested files as before (in regional varying speed).

Signed-off-by: Paul Spooren <mail@aparcar.org>
Acked-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit c737a9ee6a)
4 years ago
Hauke Mehrtens 55ccb04046 upgs: Remove extra _DEFAULT_SOURCE definition
This extra _DEFAULT_SOURCE definition results in a double definition
which is a compile error.

This fixes the following compile error with glibc:
----------------------------------------------------------------------
ugps-2019-06-25-cd7eabcd/nmea.c:19: error: "_DEFAULT_SOURCE" redefined [-Werror]
 #define _DEFAULT_SOURCE

<command-line>: note: this is the location of the previous definition
cc1: all warnings being treated as errors

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 70a962ca6f)
4 years ago
Hauke Mehrtens ee480c50c1 dante: Fix compile with glibc
When compiled with glibc the config_scan.c wants to use the
cpupolicy2numeric() function which is only available when
HAVE_SCHED_SETSCHEDULER is set. It looks like the wrong define was used here.

This fixes a build problem with glibc in combination with the force
ac_cv_func_sched_setscheduler=no in the OpenWrt CONFIGURE_VARS.

This fixes the following compile error with glibc:
----------------------------------------------------------------------
/bin/ld: config_scan.o: in function `socks_yylex':
dante-1.4.1/sockd/config_scan.l:461: undefined reference to `cpupolicy2numeric'
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile:522: sockd] Error 1

Fixes: aaf46a8fe2 ("dante: disable sched_getscheduler() - not implemented in musl")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ce1798e915)
4 years ago
Yangbo Lu 5f0e25d966 perf: build with NO_LIBCAP=1
Build with NO_LIBCAP=1. This is to resolve build issue.

Package perf is missing dependencies for the following libraries:
libcap.so.2

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
(cherry picked from commit 80f128d2aa)
4 years ago
Linus Lüssing 005adba939 mac80211: ath10k: increase rx buffer size to 2048
Before, only frames with a maximum size of 1528 bytes could be
transmitted between two 802.11s nodes.

For batman-adv for instance, which adds its own header to each frame,
we typically need an MTU of at least 1532 bytes to be able to transmit
without fragmentation.

This patch now increases the maxmimum frame size from 1528 to 1656
bytes.

Tested with two ath10k devices in 802.11s mode, as well as with
batman-adv on top of 802.11s with forwarding disabled.

Fix originally found and developed by Ben Greear.

Link: https://github.com/greearb/ath10k-ct/issues/89
Link: 9e5ab25027
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: Linus Lüssing <ll@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(cherry picked from commit 066ec97167)
4 years ago
Matt Merhar 0974d59b5f kernel: backport fix for non-regular inodes on f2fs
Upstream commit dda9f4b9ca ("f2fs: fix to skip verifying block address
for non-regular inode").

On 4.14, attempting to perform operations on a non-regular inode
residing on an f2fs filesystem, such rm-ing a device node, would fail
and lead to a warning / call trace in dmesg. This fix was already
applied to other kernels upstream - including 4.19, from which the patch
was taken.

More info at https://bugzilla.kernel.org/show_bug.cgi?id=202495.

Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
(cherry picked from commit ee500186a5)
4 years ago
Adrian Schmutzler f40947a8c0 ath79: indicate boot/failsafe/upgrade for NanoBeam/Nanostation AC
Like for Ubiquiti PowerBeam 5AC Gen2, the highest RSSI LED can
be exploited to indicate boot/failsafe/upgrade for the NanoBeam AC
and Nanostation AC as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 80a094aaf3)
4 years ago
Adrian Schmutzler 65cf72d5d2 ath79: add SUPPORTED_DEVICES based on ar71xx for some devices
This adds some still-missing board names for old TP-Link devices
to ath79 SUPPORTED_DEVICES.

Fixes: FS#3017

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 522f6b7eee)
4 years ago
Petr Štetiar f9ef0c5705 kernel: bump 4.14 to 4.14.178
Refreshed all patches and removed upstreamed:

 oxnas/001-irqchip-versatile-fpga-Handle-chained-IRQs-properly.patch
 oxnas/002-irqchip-versatile-fpga-Apply-clear-mask-earlier.patch

Fixes: CVE-2020-12114 and CVE-2020-11669

Runtime-tested on: qemu-x86-64
Compile-tested on: ath79/generic, x86/64, imx6

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Antonio Quartulli 2df0ea042d wpad-wolfssl: fix crypto_bignum_sub()
Backport patch from hostapd.git master that fixes copy/paste error in
crypto_bignum_sub() in crypto_wolfssl.c.

This missing fix was discovered while testing SAE over a mesh interface.

With this fix applied and wolfssl >3.14.4 mesh+SAE works fine with
wpad-mesh-wolfssl.

Cc: Sean Parkinson <sean@wolfssl.com>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 4b3b8ec81c)
4 years ago
Felix Fietkau ec6cb33452 mac80211: backport fix for an no-ack tx status issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Jérôme Benoit <jerome.benoit@piment-noir.org> [WRT1900AC v1]
[added missing package version bump]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit e0ab33ea49)
4 years ago
Felix Fietkau f141cdd200 hostapd: unconditionally enable ap/mesh for wpa-cli
Without this change, wpa-cli features depend on which wpad build variant was
used to build the wpa-cli package

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Tested-by: Jérôme Benoit <jerome.benoit@piment-noir.org> [WRT1900AC v1]
[added missing package version bump]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 03e9e4ba9e)
4 years ago
Petr Štetiar 54b6683390 wireless-regdb: backport three upstream fixes
Another release is overdue for quite some time, so I'm backporting three
fixes from upstream which I plan to backport into 19.07 as well.

Ref: FS#2880
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 76a0ddf130)
4 years ago
Petr Štetiar 55591e63bc curl: backport fix for CVE-2019-15601
On Windows, refuse paths that start with \\ ... as that might cause an
unexpected SMB connection to a given host name.

Ref: PR#2730
Ref: https://curl.haxx.se/docs/CVE-2019-15601.html
Suggested-by: Jerome Benoit <jerome.benoit@sap.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Pawel Dembicki 35ea808b97 uboot-kirkwood: fix ethernet and usb
Before 2019.01 version was introduced patch, which changes cache
routines: 93b283d4 ("ARM: CPU: arm926ejs: Consolidate cache
routines to common file"). Unfortunately that patch make ethernet
and usb in kirkwood broken.

This patch backport commit 599f7aa5 ("ARM: kirkwood: disable dcache
for Kirkwood boards"), which are fix for that problem.

Fixes: dc08514e6d ("uboot-kirkwood: update to 2019.01")

Run tested: pogoplugv4

Tested-by: Cezary Jackiewicz <cezary@eko.one.pl> [nsa310]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years ago
Chuanhong Guo 5feb0df9bb ramips: remove memory node for ZBT MT7621 devices
It's known that ZBT sells 256M variants of these routers. As a result,
our images won't be able to boot on these routers.
This commit removes memory node for them. With previously backported
memory detection patch, kernel is able to detect memory size itself.

Fixes: FS#3053
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years ago
Sungbo Eo b80a98ae7f ramips: remove unnecessary DEVICE_PACKAGES for Belkin F7C027
kmod-usb-dwc2 and kmod-usb-ledtrig-usbport are not target default packages, and
Belkin F7C027 does not have a USB port anyway. Just drop it.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 1dedad2a00)
4 years ago
Sungbo Eo bfe652c5bd oxnas: move service file to correct place
This service file has been misplaced from the very beginning.

Fixes: dcc34574ef ("oxnas: bring in new oxnas target")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 01961f163d)
4 years ago
Kevin Darbyshire-Bryant 5b4e4a38d8 relayd: bump to version 2020-04-25
f4d759b dhcp.c: further improve validation

Further improve input validation for CVE-2020-11752

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 9e7d11f3e2)
4 years ago
Kevin Darbyshire-Bryant 4e5a29827f umdns: update to version 2020-04-25
cdac046 dns.c: fix input validation fix

Due to a slight foobar typo, failing to de-reference a pointer, previous
fix not quite as complete as it should have been.

Improve CVE-2020-11750 fix

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 9f7c8ed078)
4 years ago
Henrique de Moraes Holschuh c2efc973d5 dnsmasq: fix dnssec+ntp chicken-and-egg workaround (FS#2574)
Fix the test for an enabled sysntp initscript in dnsmasq.init, and get
rid of "test -o" while at it.

Issue reproduced on openwrt-19.07 with the help of pool.ntp.br and an
RTC-less ath79 router.  dnssec-no-timecheck would be clearly missing
from /var/etc/dnsmasq.conf.* while the router was still a few days in
the past due to non-working DNSSEC + DNS-based NTP server config.

The fix was tested with the router in the "DNSSEC broken state": it
properly started dnsmasq in dnssec-no-timecheck mode, and eventually ntp
was able to resolve the server name to an IP address, and set the system
time.  DNSSEC was then enabled by SIGINT through the ntp hotplug hook,
as expected.

A missing system.ntp.enabled UCI node is required for the bug to show
up.  The reasons for why it would be missing in the first place were not
investigated.

Signed-off-by: Henrique de Moraes Holschuh <henrique@nic.br>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
(cherry picked from commit 556b8581a1)
4 years ago
Petr Štetiar 6c020577ae libpcap: fix build breakage with very high number of simultaneous jobs
Building libpcap with high number (64) of simultaneous jobs fails:

 In file included from ./fmtutils.c:42:0:
 ./ftmacros.h:106:0: warning: "_BSD_SOURCE" redefined
   #define _BSD_SOURCE

 <command-line>:0:0: note: this is the location of the previous definition
 ./gencode.c:67:10: fatal error: grammar.h: No such file or directory
  #include "grammar.h"
           ^~~~~~~~~~~
 compilation terminated.
 Makefile:99: recipe for target 'gencode_pic.o' failed

So fix this by less intrusive way by disabling the parallel builds for
this package.

Ref: FS#3010
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Petr Štetiar efe837de84 openssl: bump to 1.1.1g
Fixes NULL dereference in SSL_check_chain() for TLS 1.3, marked with
high severity, assigned CVE-2020-1967.

Ref: https://www.openssl.org/news/secadv/20200421.txt
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 3773ae127a)
4 years ago
Kevin Darbyshire-Bryant 1df49d98e7 relayd: bump to version 2020-04-20
796da66 dhcp.c: improve input validation & length checks

Addresses CVE-2020-11752

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit be172e663f)
4 years ago
Kevin Darbyshire-Bryant b71c7c261b umdns: update to version 2020-04-20
e74a3f9 dns.c: improve input validation

Addresses CVE-2020-11750

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 533da61ac6)
4 years ago
Kevin Darbyshire-Bryant b6d8119c53 umdns: update to the version 2020-04-05
ab7a39a umdns: fix unused error
45c4953 dns: explicitly endian-convert all fields in header and question

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 22ae8bd50e)
(cherry picked from commit 17c4593e63f5847868f2c38185275199d37d379a)
4 years ago
Kevin Darbyshire-Bryant ef3df27507 umdns: suppress address-of-packed-member warning
gcc 8 & 9 appear to be more picky with regards access alignment to
packed structures, leading to this warning in dns.c:

dns.c:261:2: error: converting a packed ‘struct dns_question’ pointer
(alignment 1) to a ‘uint16_t’ {aka ‘short unsigned int’} pointer
(alignment 2) may result in an unaligned pointer value
[-Werror=address-of-packed-member]

261 |  uint16_t *swap = (uint16_t *) q;

Work around what I think is a false positive by turning the warning off.
Not ideal, but not quite as not ideal as build failure.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 02640f0147)
(cherry picked from commit a10b6ec1c8cd6d14a3b76a2ec3d81442b85f7321)
4 years ago
Hans Dedecker 55312cc202 binutils: add ALTERNATIVES for strings (FS#3001)
Don't move strings anymore to /bin/strings to avoid clash with
busybox /usr/bin/strings but move it to /usr/bin/binutils-strings.
Use ALTERNATIVES support to install it as /usr/bin/strings

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 5f126c541a)
4 years ago
Magnus Kroken 3b6f079d8d mbedtls: update to 2.16.6
Security fixes for:
* CVE-2020-10932
* a potentially remotely exploitable buffer overread in a DTLS client
* bug in DTLS handling of new associations with the same parameters

Full release announement:
https://tls.mbed.org/tech-updates/releases/mbedtls-2.16.6-and-2.7.15-released

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
(cherry picked from commit 02fcbe2f3d)
4 years ago
Tomasz Maciej Nowak 67ed408af2 mvebu: cortexa9: correct cpu subtype
Armada 370  processors have only 16 double-precision registers. The
change introduced by 8dcc108760 ("toolchain: ARM: Fix toolchain
compilation for gcc 8.x") switched accidentally the toolchain for mvebu
cortexa9 subtarget to cpu type with 32 double-precision registers. This
stems from gcc defaults which assume "vfpv3-d32" if only "vfpv3" as mfpu
is specified. That change resulted in unusable image, in which kernel
will kill userspace as soon as it causing "Illegal instruction".

Ref: https://forum.openwrt.org/t/gcc-was-broken-on-mvebu-armada-370-device-after-commit-on-2019-03-25/43272
Fixes: 8dcc108760 ("toolchain: ARM: Fix toolchain compilation for
gcc 8.x")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 2d61f8821c)
4 years ago
Tomasz Maciej Nowak dee8fcfe9f tegra: correct cpu subtype
Tegra 2 processors have only 16 double-precision registers. The change
introduced by 8dcc108760 ("toolchain: ARM: Fix toolchain compilation
for gcc 8.x") switched accidentally the toolchain for tegra target to cpu
type with 32 double-precision registers. This stems from gcc defaults
which assume "vfpv3-d32" if only "vfpv3" as mfpu is specified. That
change resulted in unusable image, in which kernel will kill userspace as
soon as it causing "Illegal instruction".

Ref: https://forum.openwrt.org/t/gcc-was-broken-on-mvebu-armada-370-device-after-commit-on-2019-03-25/43272
Fixes: 8dcc108760 ("toolchain: ARM: Fix toolchain compilation for
gcc 8.x")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 43d1d88510)
4 years ago
Joel Johnson d8e0b015e8 mvebu: backport ClearFog SPI enablement
Backport Device Tree change first added in kernel 4.19 to enable the SPI
device on ClearFog devices by default. This is tested and working in
snapshot builds with kernel 5.4+, include the change in future 19.07
patch releases.

Signed-off-by: Joel Johnson <mrjoel@lixil.net>
4 years ago
Koen Vandeputte 0232f57e1a kernel: bump 4.14 to 4.14.176
Refreshed all patches.

Remove upstreamed:
- 0001-net-thunderx-workaround-BGX-TX-Underflow-issue.patch
- 600-ipv6-addrconf-call-ipv6_mc_up-for-non-Ethernet-inter.patch
- 003-ARM-dts-oxnas-Fix-clear-mask-property.patch

Fixes:
- CVE-2020-8647
- CVE-2020-8648 (potentially)
- CVE-2020-8649

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Adrian Schmutzler 286c407c3d ath79: add SUPPORTED_DEVICES for TP-Link TL-WA901ND v2
This adds the board name from ar71xx to support upgrade without
-F for the TP-Link TL-WA901ND v2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 508462a399)
4 years ago
Josef Schlehofer 02c6deab8c mbedtls: update to version 2.16.5
Changelog:
https://tls.mbed.org/tech-updates/releases/mbedtls-2.16.5-and-2.7.14-released

Security advisory:
https://tls.mbed.org/tech-updates/security-advisories/mbedtls-security-advisory-2020-02

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 36af1967f5)
4 years ago
Adrian Schmutzler 01b624e28e Revert "ramips: disable ZyXel Keenetic by default"
This reverts commit c38074de92.

Since ZyXEL Keenetic has actually 8 MiB flash as fixed in the
previous patch, we can re-enable it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Alexey Dobrovolsky 14c8ea0245 ramips: use full 8MB flash on ZyXEL Keenetic
ZyXEL Keenetic has 8MB flash, but OpenWrt uses only 4MB.
This commit fixes the problem.

WikiDevi page [1] says that ZyXEL Keenetic has FLA1: 8 MiB, there is
an article with specs [2] (in Russian).

[1] https://wikidevi.wi-cat.ru/ZyXEL_Keenetic
[2] https://3dnews.ru/608774/page-2.html

Fixes: FS#2487
Fixes: a7cbf59e0e ("ramips: add new device ZyXEL Keenetic as kn")

Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
(cherry picked from commit fea232ae8f)
4 years ago
Dan Haab 5b9b833f8c bcm53xx: add support for Luxul FullMAC WiFi devices
This prepares support for models XAP-1610 and XWR-3150. Flashing
requires using Luxul firmware version:
1) 8.1.0 or newer for XAP-1610
2) 6.4.0 or newer for XWR-3150
and uploading firmware using "Firmware Update" web UI page.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
(cherry picked from commit c459a6bf48)
4 years ago
Rafał Miłecki ab3549a870 bcm53xx: refactor board.d code in 02_network
1. Use functions for cleaner code
2. Always execute WAN interface generic code

Before this change WAN interface code wasn't executed on all devices due
to an early "exit 0".

Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b51ea43f90)
4 years ago
Rafał Miłecki 35413b047c bcm53xx: sysupgrade: optimize building UBI image
Use "truncate" to adjust size of existing file instead of "dd" which
required creating a copy. This saves space on tmpfs. It may be as low
as 2.1 MiB when using OpenWrt default user space and way more (20+ MiB)
when flashing vendor firmware.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8abefc8896)
4 years ago
Rafał Miłecki 55c29c398c busybox: enable truncate on bcm53xx target
It's needed for optimized sysupgrade. On host machine this change
increased busybox size by 4096 B.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 547f1ec25a)
4 years ago
Rafał Miłecki a89731ad7a bcm53xx: fix ASUS firmwares to use vendor format
Image building process was missing "asus-trx" step which resulted in raw
TRX files (without ASUS footer with device id).

Fixes: 0b9de8daa7 ("bcm53xx: add profiles for all other (SoftMAC) devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 0493d57e04)
4 years ago
Eneas U de Queiroz 36373c5ddb openssl: bump to 1.1.1f
There were two changes between 1.1.1e and 1.1.1f:
- a change in BN prime generation to avoid possible fingerprinting of
  newly generated RSA modules
- the patch reversing EOF detection we had already applied.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit af5ccfbac7)
4 years ago
Adrian Schmutzler 470f7c046c ath79: add support for TP-Link TL-WDR4310 v1
This device seems to be identical to the TL-WDR4300, just with
different release date/region and TPLINK_HWID.

Support is added based on the ar71xx implementation.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 676ca94c3c)
4 years ago
Hauke Mehrtens 96ee7c8bfd libpcap: Update shared-lib patch from Debian to fix linking problems
This updates the shared-lib patch to the recent version from debian
found here:
https://salsa.debian.org/rfrancoise/libpcap/-/blob/debian/1.9.1-2/debian/patches/shared-lib.diff

This patch makes it include missing/strlcpy.o to the shared library
which is needed for OpenWrt glibc builds, otherwise there is an
undefined symbol and tcpdump and other builds are failing.

Fixes: 44f11353de ("libpcap: update to 1.9.1")
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
4 years ago
Michael T Farnworth 96092a8eea mkrasimage: fix segmentation fault
Code was attempting to determine the size of the file
before it was actually known and allocating insufficient
memory space.  Images above a certain size caused a
segmentation fault.  Moving the calloc() ensured ensured
that large images didn't result in a buffer overflow on
memcpy().

Signed-off-by: Michael T Farnworth <michael@turf.org>
[fixed name in From to match one in SoB]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b468353a37)
4 years ago
Petr Štetiar bf5ea2a8dc rpcd: fix respawn settings
Commit 432ec292cc ("rpcd: add respawn param") has introduced infinite
restarting of the service which could be reached over network. This is
not recommended security practice as it might give potential adversary
infinite number of tries in case there might be some issue in the rpcd
or its surrounding stack.

So lets remove the currently bogus `respawn_retry` variable (it wasn't
possible to override it anyway), reverting to the previous default max.
of 5 service restarts which could be now overriden via system's UCI
settings if desired.

Cc: Jo-Philip Wich <jow@mein.io>
Cc: Florian Eckert <fe@dev.tdt.de>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Fixes: 432ec292cc ("rpcd: add respawn param")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 52e6fb1369)
4 years ago
Jan Kardell 83381ce95d readline: needs host depend on ncurses to build
We must ensure that host ncurses is build before host readline.

Signed-off-by: Jan Kardell <jan.kardell@telliq.com>
(cherry picked from commit ecef29b294)
4 years ago
Robert Marko 45b586c4a6 tools: squashfskit4: fix build with GCC10
In order to build squashfskit with GCC10, this backport from upstream is needed.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
[increase PKG_RELEASE]
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
(cherry picked from commit be4ed1db18)
4 years ago
Alexander Couzens 79b60d878d squashfskit4/Makefile: introduce PKG_RELEASE=1
When adding patches, the PKG_RELEASE should be increased.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
(cherry picked from commit 1f4020a293)
4 years ago
Kevin Darbyshire-Bryant a08394b3c6 build: prereq: tidy gcc version checks
There is a restriction in the number of parameters(10)  that may be passed to
the SetupHostCommand macro so continually adding explicit gcc'n' version
checks ends up breaking the compiler check for the later versions and
oddballs like Darwin as was done in 835d1c68a0 which added gcc10.

Drop all the explicitly specified gcc version checks.  If a suitable gcc
compiler is not found, it may be specified at the dependency checking
stage after which that version will be symlinked into the build staging
host directory.

eg. 'CC=gccfoo CXX=g++foo make prereq'

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Acked-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 1fb3c003d6)
4 years ago
Robert Marko 66cbfeeaae build: add GCC 10 version detection
Lets add GCC 10 detection to the build system as distributions like Fedora 32 have started shipping with it.
Some tools like mtd-utils need work to compile under GCC10, but that will be next step.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
(cherry picked from commit 835d1c68a0)
4 years ago
Eneas U de Queiroz eea3a9625c openssl: revert EOF detection change in 1.1.1
This adds patches to avoid possible application breakage caused by a
change in behavior introduced in 1.1.1e.  It affects at least nginx,
which logs error messages such as:
nginx[16652]: [crit] 16675#0: *358 SSL_read() failed (SSL: error:
4095126:SSL routines:ssl3_read_n:unexpected eof while reading) while
keepalive, client: xxxx, server: [::]:443

Openssl commits db943f4 (Detect EOF while reading in libssl), and
22623e0 (Teach more BIOs how to handle BIO_CTRL_EOF) changed the
behavior when encountering an EOF in SSL_read().  Previous behavior was
to return SSL_ERROR_SYSCALL, but errno would still be 0.  The commits
being reverted changed it to SSL_ERRO_SSL, and add an error to the
stack, which is correct.  Unfortunately this affects a number of
applications that counted on the old behavior, including nginx.

The reversion was discussed in openssl/openssl#11378, and implemented as
PR openssl/openssl#11400.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 2e8a4db9b6)
4 years ago
Hauke Mehrtens c6c3f6bb0a mac80211: Update to version 4.19.112
The removed patches are all integrated in the upstream version now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years ago
Petr Štetiar 794fd4c6cf procd: turn error into debug message for missing ujail binary
Since commit 557f11b3a20f ("instance: provide error feedback if ujail
binary is missing") worrying log spam of the form "unable to find
/sbin/jail ..." may be encountered.

This corresponds with the changes done in the upstream commit
bcb86554f1b4 ("instance: add 'requirejail' attribute").

Ref: https://forum.openwrt.org/t/openwrt-19-07-2-service-release/57066
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Baptiste Jonglez f5b3cd1539 ar71xx: Fix gigabit switch support for Mikrotik RB951G-2HnD
Without this patch, when using rev 3 of the Atheros AR9344 SoC, the
gigabit switch (AR8327) does not work or works very erratically.

This is a re-spin of http://patchwork.ozlabs.org/patch/419857/ with a
different PLL value, according to the feedback from several users
(including myself) as shown here:

  https://openwrt.org/toh/mikrotik/rb2011uias#tracking_reported_experience_with_suggested_patch_for_the_5_gige_ports

Performance is acceptable: testing L3 forwarding without NAT yields a
performance of 370 Mbit/s (iperf3 TCP) and 41 Kpps (iperf3 UDP with 64
bytes payload). Both tests show that 100% of CPU time is spent on softirq.

A similar fix for a different device (RB2011) was added in e457d22261
("Make GBit switch work on RB2011").

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
(cherry picked from commit 247043c968)
4 years ago
Adrian Schmutzler bdbda30384 ath79: add support for TP-Link TL-WA860RE v1
This ports support for the TL-WA860RE v1 range extender from ar71xx
to ath79.

Specifications:
  Board: AP123 / AR9341 rev. 3
  Flash/RAM: 4/32 MiB
  CPU: 535 MHz
  WiFi: 2.4 GHz b/g/n
  Ethernet: 1 port (100M)
  Two external antennas

Flashing instructions:
  Upload the factory image via the vendor firmware upgrade option.

Recovery:
  Note that this device does not provide TFTP via ethernet like many
  other TP-Link devices do. You will have to open the case if you
  require recovery beyond failsafe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Sebastian Knapp <sebastian4842@outlook.com>
(cherry picked from commit 385f4868bc)
4 years ago
Adrian Schmutzler 2e6bfab8c5 ath79: add support for TP-Link TL-WA850RE v1
This ports support for the TL-WA850RE v1 range extender from ar71xx
to ath79.

Specifications:
  Board: AP123 / AR9341 rev. 3
  Flash/RAM: 4/32 MiB
  CPU: 535 MHz
  WiFi: 2.4 GHz b/g/n
  Ethernet: 1 port (100M)

Flashing instructions:
Upload the factory image via the vendor firmware upgrade option.

Recovery:
Note that this device does not provide TFTP via ethernet like many
other TP-Link devices do. You will have to open the case if you
require recovery beyond failsafe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6eaea3a8ba)
4 years ago
Rafał Miłecki dba6f418fa mac80211: fix brcmfmac monitor interface crash
This fixes bug in brcmfmac *exposed* by ipv6/addrconf fix.

Fixes: 6e4453aecc ("kernel: backport out-of-memory fix for non-Ethernet devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 038318f766)
4 years ago
Jan Alexander 27e77922a1 ar71xx: use status led for GL.iNet GL-AR750S
Use power led for device status.

The status led behavior has already been fixed in af28d8a539
("ath79: add support for GL.iNet GL-AR750S") when porting the
device to ath79. This fixes it for ar71xx as well.

Signed-off-by: Jan Alexander <jan@nalx.net>
[minor commit title/message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit d394c354ee)
4 years ago
David Bauer 81264ebb51 brcm2708: fix build failure
Build of the brcm2708 subtarget currently fails with the following error
message:

 arch/arm/lib/memset_rpi.S: Assembler messages:
 arch/arm/lib/memset_rpi.S:65: Error: garbage following instruction
  -- `orr DAT0,DAT0,lsl#8'
 arch/arm/lib/memset_rpi.S:67: Error: garbage following instruction
  -- `orr DAT0,DAT0,lsl#16'
 scripts/Makefile.build:427: recipe for target 'arch/arm/lib/memset_rpi.o'
 failed

Using the assembly notation from master fixes this error.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years ago
Jordan Sokolic 39405644d5 dnsmasq: add 'scriptarp' option
Add option 'scriptarp' to uci dnsmasq config to enable --script-arp functions.
The default setting is false, meaning any scripts in `/etc/hotplug.d/neigh` intended
to be triggered by `/usr/lib/dnsmasq/dhcp-script.sh` will fail to execute.

Also enable --script-arp if has_handlers returns true.

Signed-off-by: Jordan Sokolic <oofnik@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
4 years ago
Eneas U de Queiroz d5b1f4430f openssl: update to 1.1.1e
This version includes bug and security fixes, including medium-severity
CVE-2019-1551, affecting RSA1024, RSA1536, DSA1024 & DH512 on x86_64.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit dcef8d6093)
4 years ago
Eneas U de Queiroz 798ff37aaa openssl: add configuration example for afalg-sync
This adds commented configuration help for the alternate, afalg-sync
engine to /etc/ssl/openssl.cnf.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit d9d689589b)
4 years ago
Daniel Golle 168acbb36d oxnas: yet another irqchip related patch
This time DTS fix, again from Sungbo Eo <mans0n@gorani.run>
  ARM: dts: oxnas: Fix clear-mask property

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 9e5a25846f)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years ago
Daniel Golle cf4520d15e oxnas: backport another fix for irqchip
Sungbo Eo <mans0n@gorani.run> submitted another patch fixing an error
on reboot:
  irqchip/versatile-fpga: Apply clear-mask earlier

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 19af00850f)
4 years ago
Adrian Schmutzler 456e1c60d6 ath79: add support for TP-Link WDR3500 v1
Hardware:
SoC:      AR9344
CPU:      560 MHz
Flash:    8 MiB
RAM:      128 MiB
WiFi:     Atheros AR9340 2.4GHz 802.11bgn
          Atheros AR9300 5GHz 802.11an
Ethernet: AR934X built-in switch, WAN on separate physical interface
USB:      1x 2.0

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to
   wdr3500v1_tp_recovery.bin
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[removed stray newline]
Signed-off-by: David Bauer <mail@david-bauer.net>
(backported from commit fbbb4eb8b4)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Adrian Schmutzler e7fae8fc97 ath79: add support for TP-Link Archer C60 v3
TP-Link Archer C60 v3 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561 + QCA9886.

It seems to be identical to the v2 revision, except that
it lacks a WPS LED and has different GPIO for amber WAN LED.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 6x LED, 2x button
- UART header on PCB

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed IP address 192.168.0.66
2. Download *-factory.bin image and rename it to tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root
   directory
4. Turn off the router
5. Press and hold reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time the firmware should
   be transferred from the tftp server
8. Wait ~30 second to complete recovery

While TFTP works for OpenWrt images, my device didn't accept the
only available official firmware "Archer C60(EU)_V3.0_190115.bin".

In contrast to earlier revisions (v2), the v3 contains the (same)
MAC address twice, once in 0x1fa08 and again in 0x1fb08.
While the partition-table on the device refers to the latter, the
firmware image contains a different partition-table for that region:

name           device            firmware
factory-boot   0x00000-0x1fb00   0x00000-0x1fa00
default-mac    0x1fb00-0x1fd00   0x1fa00-0x1fc00
pin            0x1fd00-0x1fe00   0x1fc00-0x1fd00
product-info   0x1fe00-0x1ff00   0x1fd00-0x1ff00
device-id      0x1ff00-0x20000   0x1ff00-0x20000

While the MAC address is present twice, other data like the PIN isn't,
so with the partitioning from the firmware image the PIN on the device
would actually be outside of its partition.
Consequently, the patch uses the MAC location from the device (which
is the same as for the v2).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 646d95c374)
4 years ago
Daniel Golle 2bd9d2e08b oxnas: backport patch fixing hang after reboot
Sungbo Eo <mans0n@gorani.run> posted a patch fixing the long-standing
reboot problem on the OXNAS OX820 platform:
  irqchip/versatile-fpga: Handle chained IRQs properly

It got queued for 5.7. Import it to oxnas target patches for now.

Fixes: b4917fa907 ("oxnas: fix oxnas-rps-timer dt-match")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 67b04e767a)
4 years ago
Sungbo Eo 74a8e36975 layerscape: add kmod-i2c-mux to DEVICE_PACKAGES for traverse-ls1043
kmod-i2c-mux-pca954x will not get into images unless kmod-i2c-mux is added to
DEVICE_PACKAGES as well.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit dffbe668ab)
4 years ago
Jun Su 7ae345ecb7 ath79: add support for TP-Link TL-WR740N v5
This adds support for the TP-Link TL-WR740N v5, a clone of the
v4 only with a different TPLINK_HWID. It was already supported
in ar71xx as well.

Specifications:

SOC: Atheros AR9331
CPU: 400MHz
Flash: 4 MiB
RAM: 32 MiB
WLAN: Atheros AR9330 bgn
Ethernet: 5 ports (100M)

Flashing instructions:

- Flash factory image from OEM WebUI:
  openwrt-ath79-tiny-tplink_tl-wr740n-v5-squashfs-factory.bin
- Sysupgrade from ar71xx image:
  openwrt-ath79-tiny-tplink_tl-wr740n-v5-squashfs-sysupgrade.bin

Signed-off-by: Jun Su <howard0su@gmail.com>
[commit title/message facelift, backport for 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit b9f4f1f97a)
4 years ago
Adrian Schmutzler 76c1c1daea ar71xx: fix port order on TP-Link Archer C60 v1/v2
The labels on the LAN ports of the TP-Link Archer C60 v1/v2 are
actually inverted compared to the ports of the internal switch.

Add this information to 02_network.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 14a07fa1f0)
4 years ago
Adrian Schmutzler f1a3a6b79c ath79: fix port order on TP-Link Archer C60 v1/v2
The labels on the LAN ports of the TP-Link Archer C60 v1/v2 are
actually inverted compared to the ports of the internal switch.

Add this information to 02_network.

This is the same for to-be-supported v3 of this device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit b054729899)
4 years ago
Adrian Schmutzler e4107e30a7 ar71xx: remove wrong MAC address adjustment for Archer C60 v2
The adjustment of the MAC address for Archer C60 v2 in 10_fix_wifi_mac
is broken since a "mac" partition is not set up for this device on
ar71xx. Instead, the MAC address is already patched correctly in
11-ath10k-caldata.

Remove the useless adjustment.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit cbdc919024)
4 years ago
Adrian Schmutzler 83f1015a6c ar71xx: fix swapped LAN/WAN MAC address for Archer C60 v1/v2
The MAC addresses for lan/wan are swapped compared to the vendor
firmware. This adjusts to vendor configuration, which is:

lan   *:7b   label
wan   *:7c   label+1
2.4g  *:7b   label
5g    *:7a   label-1

Only one address is stored in <&mac 0x8>, corresponding to the label.

This has been checked on revisions v1, v2 and v3.

Since ar71xx calculates the ath10k MAC address based on the ethernet
addresses, the number there is adjusted, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 14eb54938b)
4 years ago
Adrian Schmutzler 9f024d3587 ath79: fix swapped LAN/WAN MAC address for Archer C60 v1/v2
The MAC addresses for lan/wan are swapped compared to the vendor
firmware. This adjusts to vendor configuration, which is:

lan   *:7b   label
wan   *:7c   label+1
2.4g  *:7b   label
5g    *:7a   label-1

Only one address is stored in <&mac 0x8>, corresponding to the label.

This has been checked on revisions v1, v2 and v3.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 88aead0a66)
4 years ago
Adrian Schmutzler b32129d30b rssileds: add dependencies based on LDFLAGS
This adds the direct dependencies introduced by TARGET_LDFLAGS
to the package's DEPENDS variable.

This was found by accidentally building rssileds on octeon, which
resulted in:

"Package rssileds is missing dependencies for the following libraries:
libnl-tiny.so"

Though the dependencies are provided when building for the
relevant targets ar71xx, ath79 and ramips, it seems more tidy to
specify them explicitly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a5b2c6f5ed)
4 years ago
Felix Fietkau 9da31d0fb4 mt76: update to the latest version
8682e0d0b49c mt76: speed up usb bulk copy
884c25e7caca mt76: usb: use max packet length for m76u_copy
1ad98b95cf4a mt76: mt76u: rely only on data buffer for usb control messagges
3d491603caff mt76: fix array overflow on receiving too many fragments for a packet
9792a62e7f30 mt76: set dma-done flag for flushed descriptors
53233cdf9486 mt76: fix handling full tx queues in mt76_dma_tx_queue_skb_raw
a4ae9219e6c7 mt76: dma: do not write cpu_idx on rx queue reset until after refill
1198fa57d185 mt76: mt7603: increase dma mcu rx ring size
91cd5be6ee37 mt76: avoid extra RCU synchronization on station removal
7d7fb26bb78a mt76: mt76x2: avoid starting the MAC too early
aac609809de1 mt76: fix LED link time failure
18627db2e633 mt76: mt76x0u: add support to TP-Link T2UHP
5ecfdb1a6e0a mt76: mt76x02: fix handling MCU timeouts during hw restart
f7e9be89db59 mt76: mt7603: add upper limit for dynamic sensitivity minimum receive power
23b834485070 mt76: mt7603: enable dynamic sensitivity adjustment by default
08054d5ab135 mt76: mt76x02: reset MCU timeout counter earlier in watchdog reset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years ago
Catrinel Catrinescu 68351990dc ar71xx/ath79: ew-dorin, fix the trigger level for WPS button
Because the WPS button had the wrong trigger level,
the failsafe mode was triggered quite often,
after this commit:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=27f3f493de

Signed-off-by: Catrinel Catrinescu <cc@80211.de>
(cherry picked from commit 3e03b7ac4a)
4 years ago
Rafał Miłecki 6e4453aecc kernel: backport out-of-memory fix for non-Ethernet devices
Doing up & down on non-Ethernet devices (e.g. monitor mode interface)
was consuming memory.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ec8e8e2ef0)
4 years ago
Koen Vandeputte 06f5a8d3e9 kernel: bump 4.14 to 4.14.172
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Florian Eckert e7f1313bbb rpcd: add respawn param
The rpcd service is an important service, but if the service stops
working for any reason, no one will ever respawn that service. With this
commit, the procd service will monitor if the rpcd service
is running. If the rpcd service has crashed, then
procd respawns the rpcd service.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 432ec292cc)
4 years ago
Jo-Philipp Wich f6f0cd54a2 rpcd: update to latest Git HEAD
aaa0836 file: extend exec acl checks to commands with arguments

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 762aac50c0)
4 years ago
David Bauer 1713707673 ar71xx: add missing LED migration for Archer C7
When changing the LED names for the Archer C7 to represent the correct
color, a migration for existing UCI entries was not created.

Add a migration to keep existing LED configurations working.

Fixes commit c79c001b59 ("ar71xx: Archer C7 v1 LED names and RFKILL
fixes")

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 4349d4c682)
4 years ago
David Bauer ef391799e3 ar71xx: correct AVM FRITZ Repeater 450E WPS button flag
The AVM FRITZ!WLAN Repeater 450E's WPS button is not active low.

Correct the active low flag to avoid unintenional activation of
failsafe mode on boot.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 1d4f2ca610)
4 years ago
Jo-Philipp Wich c56ed72d2b OpenWrt v19.07.2: revert to branch defaults
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Jo-Philipp Wich 33732f4a9c OpenWrt v19.07.2: adjust config defaults
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Jo-Philipp Wich 65030d81f3 libubox: update to latest Git HEAD
7da6643 tests: blobmsg: add test case
75e300a blobmsg: fix wrong payload len passed from blobmsg_check_array

Fixes: FS#2833
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 955634b473)
4 years ago
Roger Pueyo Centelles b33cfb7eb2 ath79: add missing reset-gpios for NanoStation Loco M (XW)
When porting support from ar71xx to ath79, the reset-gpios option was
missed. Due to a hardware bug, this would eventually leave the devices
with RX-deaf Ethernet PHY.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit 6613a7f5cc)
4 years ago
Roger Pueyo Centelles 4edadfb997 ath79: add support for Ubiquiti NanoStation Loco M (XW)
This commit adds support for the NanoStation Loco M2/M5 XW devices
on the ath79 target (support was long ago available on ar71xx).

Specifications:

 - AR9342 SoC @ 535 MHz
 - 64 MB RAM
 - 8 MB SPI flash
 - 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
 - AR8032 switch
 - 2T2R 5 GHz radio, 22 dBm
 - 13 dBi built-in antenna
 - POWER/LAN green LEDs
 - 4x RSSI LEDs (red, orange, green, green)
 - UART (115200 8N1) on PCB

Flashing via TFTP:

 - 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_nanostation-loco-m-xw-squashfs-factory.bin

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(backported from commit 633c4304ad)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Petr Štetiar cf118077cd ppp: backport security fixes
8d45443bb5c9 pppd: Ignore received EAP messages when not doing EAP
8d7970b8f3db pppd: Fix bounds check in EAP code
858976b1fc31 radius: Prevent buffer overflow in rc_mksid()

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 215598fd03)
Fixes: CVE-2020-8597
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Jo-Philipp Wich 0e9e5b1553 Revert "ppp: backport security fixes"
This reverts commit 6b7eeb74db since it
didn't contain a reference to the CVE it addresses. The next commit
will re-add the commit including a CVE reference in its commit message.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
4 years ago
Jo-Philipp Wich 9e2a1af62f uhttpd: update to latest Git HEAD
2ee323c file: poke ustream after starting deferred program

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 04069fde19)
4 years ago
Koen Vandeputte af79c3bccc kernel: bump 4.14 to 4.14.171
Refreshed all patches.

Fixes:
- CVE-2013-1798

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
4 years ago
Ansuel Smith bc0ca20ca9 ipq806x: fix bug in L2 cache scaling
It has been notice a buf in L2 cache scaling where the scaling is not
done proprely if the frequency is set to the initial state before
the new frequency.

From: https://patchwork.kernel.org/patch/10565443/

* The clocks are set to aux clock rate first to make sure the
* secondary mux is not sourcing off of QSB. The rate is then set to
* two different rates to force a HFPLL reinit under all
* circumstances.

In the initial stage of boot to force a new frequency to apply, is
needed to first set the frequency back to the lowest one (aux_rate)
and then to the target one. This force and make sure the controller
actually switch the frequency to the right one. Apply the same
mechanism to L2 frequency scaling. Before scaling to the target
frequency, first set the frequency to the aux_rate to force the
transition, then scale it to the target frequency. Doing the wrong way
can produce unexpected results and could lock the scaling mechanism
until a full reboot is done (Causing a full reset by the krait-cc driver)

From: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=77612720a2362230af726baa4149c40ec7a7fb05

When the Hfplls are reprogrammed during the rate change,
the primary muxes which are sourced from the same hfpll
for higher frequencies, needs to be switched to the 'safe
secondary mux' as the parent for that small window. This
is done by registering a clk notifier for the muxes and
switching to the safe parent in the PRE_RATE_CHANGE notifier
and back to the original parent in the POST_RATE_CHANGE notifier.

This should apply also to L2 scaling... as we can't relly use
the notifier, we manually do this on L2 scaling.

Tested-By: Marc Benoit <marcb62185@gmail.com> [19.07: R7800]
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [nbg6817/ipq8065]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 5ab9c0b388)
4 years ago
Pavel Kubelun 191822b59f ipq806x: add missing core1 voltage tolerance
Voltage tolerance is accounted per core, not per cpu, so add
missing DT entry.

Tested-By: Marc Benoit <marcb62185@gmail.com> [19.07: R7800]
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 77e7d6c20d)
4 years ago
Johann Neuhauser d0c8875faf ath79: ar934x: use reset for usb-phy-analog
This was already available on ar71xx, but is missing on ath79.
This solves the slow usb speed on TP-Link WDR3600/WDR4300 and similar,
as reported in Flyspray [0], OpenWRT Forum [1] and GitHub PR [2].

[0] https://bugs.openwrt.org/index.php?do=details&task_id=2567
[1] https://forum.openwrt.org/t/usb-wdr4300-low-speed-on-external-storage/46794
[2] https://github.com/openwrt/openwrt/pull/964

Tested-By: Lech Perczak <lech.perczak@gmail.com> [TL-WDR4300]
Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
(cherry picked from commit bda6b6144d)
4 years ago
Johann Neuhauser c9b6bb43ce ath79: phy-ar7200-usb: adapt old behavior of arch/mips/ath79/dev-usb.c
[ Upstream commit 6cca6fffa0 ]

Do not put usb-phy into reset if clearing the usb-phy reset or
setting the suspend_override has failed.

Reorder (de)asserts like in arch/mips/ath79/dev-usb.c.

Add an optional reset_control "usb-phy-analog", which is needed for
ar934x SoCs like in the old mach-driver arch/mips/ath79/dev-usb.c.

Tested-By: Lech Perczak <lech.perczak@gmail.com> [TL-WDR4300]
Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
[added reference to upstream commit, Tested-by]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years ago
Adrian Schmutzler b2660e67f0 Revert "ath79: add support for Ubiquiti NanoStation Loco M (XW)"
This reverts commit 21bf718b8c.

Until the mdio-reset is solved, this is not ready for stable release.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Roger Pueyo Centelles 21bf718b8c ath79: add support for Ubiquiti NanoStation Loco M (XW)
This commit adds support for the NanoStation Loco M2/M5 XW devices
on the ath79 target (support was long ago available on ar71xx).

Specifications:

 - AR9342 SoC @ 535 MHz
 - 64 MB RAM
 - 8 MB SPI flash
 - 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
 - AR8032 switch
 - 2T2R 5 GHz radio, 22 dBm
 - 13 dBi built-in antenna
 - POWER/LAN green LEDs
 - 4x RSSI LEDs (red, orange, green, green)
 - UART (115200 8N1) on PCB

Flashing via TFTP:

 - 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_nanostation-loco-m-xw-squashfs-factory.bin

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(backported from commit 633c4304ad)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years ago
Sungbo Eo 2d3a93335a ramips: append tail to WF2881 initramfs image
Stock firmware has a vendor-defined tail at the end of uImage for image
validation. This patch enables OpenWrt installation from stock firmware
without having to access the UART console.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit be3e98ce26)
4 years ago
Adrian Schmutzler 8fa6107aee ath79: add support for Ubiquiti Picostation M (XM)
This adds support for the Ubiquiti Picostation M (XM), which has the
same board/LEDs as the Bullet M XM, but different case and antennas.

Specifications:
- AR7241 SoC @ 400 MHz
- 32 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- External antenna: 5 dBi (USA), 2 dBi (EU)
- 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 NanoStation M 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_picostation-m-squashfs-factory.bin

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6fdaf16dd0)
4 years ago
Sven Roederer 6a950afde1 ath79: add support for Ubiquiti Nanostation Loco M (XM)
This adds support for the Ubiquiti Nanostation Loco M (XM), which
has the same board/LEDs as the Bullet M XM, but different case and
antennas.

Specifications:
- AR7241 SoC @ 400 MHz
- 32 MB RAM
- 8 MB SPI flash
- 1x 10/100 Mbps Ethernet, 24 Vdc PoE-in
- NS Loco M2: built-in antenna: 8 dBi; AR9287
- NS Loco M5: built-in antenna: 13 dBi; 2T2R 5 GHz radio
- 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.
  Note that only certain firmware versions accept unsigned
  images. Refer to the device's Wiki page for further information.

Flashing via TFTP:
  Same procedure as other NanoStation M 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_nanostation-loco-m-squashfs-factory.bin

Tested on NanoStation Loco M2.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit b56bcfe3be)
4 years ago
Adrian Schmutzler 7cbd39421e ath79: add gpio4 pinmux on TL-WR841N/ND v8, WR842N v2, MR3420 v2
This adds a pinmux to the shared DTSI for TP-Link TL-WR841N/ND v8,
TL-WR842N v2 and TL-MR3420 v2. It is supposed to be the equivalent
of:

/* config gpio4 as normal gpio function */
ath79_gpio_output_select(TL_MR3420V2_GPIO_USB_POWER,AR934X_GPIO_OUT_GPIO);

This allows to enable USB power on these devices.

While at it, move the jtag_disable_pins to &gpio node and remove the
redundant status=okay there.

Tested on TP-Link TL-WR842N v2.

Fixes: FS#2753

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Armin Fuerst <armin@fuerst.priv.at>
[backport: change individual DTS files, no mr3420-v2 present]
(backported from commit 18c95c9d6e)
4 years ago
Adrian Schmutzler 085f38351f ath79: enable forceless sysupgrade from ar71xx on fritz300e
This adds the ar71xx board name to the SUPPORTED_DEVICES on ath79,
so forceless sysupgrade on this device becomes possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 49ff00db34)
4 years ago
Petr Štetiar 6b7eeb74db ppp: backport security fixes
8d45443bb5c9 pppd: Ignore received EAP messages when not doing EAP
8d7970b8f3db pppd: Fix bounds check in EAP code
858976b1fc31 radius: Prevent buffer overflow in rc_mksid()

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 215598fd03)
4 years ago
Chuanhong Guo 95d5cbdec3 ath79: add wmac migration for all ar93xx/qca95xx SoCs
Add migration for all ar71xx device path as well as previously
incorrect ath79 path.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit d08b5bb344)
Tested-by: Lech Perczak <lech.perczak@gmail.com> [TP-Link TL-WDR4300 v1]
5 years ago
Chuanhong Guo 2d21357b65 ath79: ar93xx/qca95xx: move gmac/wmac/pcie node out of apb bus
according to functional block diagram in datasheet, these devices
don't belong to apb bus.
Move these nodes out to match datasheet description.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit f65501e1c2)
Tested-by: Lech Perczak <lech.perczak@gmail.com> [TP-Link TL-WDR4300 v1]
5 years ago
Jo-Philipp Wich b6c01fec92 hostapd: remove erroneous $(space) redefinition
The $(space) definition in the hostapd Makefile ceased to work with
GNU Make 4.3 and later, leading to syntax errors in the generated
Kconfig files.

Drop the superfluous redefinition and reuse the working $(space)
declaration from rules.mk to fix this issue.

Fixes: GH#2713
Ref: https://github.com/openwrt/openwrt/pull/2713#issuecomment-583722469
Reported-by: Karel Kočí <cynerd@email.cz>
Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Tested-by: Shaleen Jain <shaleen@jain.sh>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 766e778226)
5 years ago
Adrian Schmutzler 5000fc53a1 ath79: fix DTS node names for Ubiquiti XW partitions
Some node names were inconsistent with the reg property. Fix it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 1a0d6e1eba)
[fixed XM->XW in commit title for backport]
5 years ago
Michal Cieslakiewicz a0ca72d9ab uboot-envtools: ath79: add Netgear WNDR3700v2
Add Netgear WNDR3700v2 to the list of supported boards.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
[rebase, adjusted commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a09408fa57)
5 years ago
Michal Cieslakiewicz 53cd2299ee ath79: WNDR3700 v1/v2: make u-boot env partition writable
Remove read-only flag from U-boot environment partition for Netgear
WNDR3700 v1 and v2 so u-boot-envtools can modify data there.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
(cherry picked from commit 6227c8d1bf)
5 years ago
Dan Haab cff3795450 bcm53xx: build images for Luxul ABR-4500 and XBR-4500 routers
Luxul ABR-4500 and XBR-4500 devices are wired routers with 5 Ethernet
ports and 1 USB 3.0 port. Flashing requires using Luxul firmware 6.4.0
or newer and uploading firmware using "Firmware Update" web UI page.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
(cherry picked from commit 1d47f81581)
[rmilecki: use DEVICE_TITLE for 19.07]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
Dan Haab cf2b042855 firmware-utils: add lxlfw tool for generating Luxul firmwares
It's a simple tool prepending image with a Luxul header.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
(cherry picked from commit 9aa6569aa6)
5 years ago
Rafał Miłecki 887eb669f9 mac80211: brcm: backport remaining 5.6 kernel patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit aca274091a)
5 years ago
Koen Vandeputte d91b52b1a2 kernel: add missing symbol
Reported by Buildbot:

x86 instruction decoder selftest (X86_DECODER_SELFTEST) [N/y/?] (NEW) aborted!

Fixes: eca8a2ee0d ("kernel: bump 4.14 to 4.14.169")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 2a844349fa kernel: add support for GD25D05 SPI NOR
This chip is used on newer RB912UAG-5HPnD r2 boards:

Before:

[    0.642553] m25p80 spi0.0: unrecognized JEDEC id bytes: c8, 40, 10
[    0.649381] NAND flash driver for the RouterBOARD 91x series

After:

[    0.641714] m25p80 spi0.0: found gd25d05, expected m25p80
[    0.649916] m25p80 spi0.0: gd25d05 (64 Kbytes)
[    0.655122] Creating 4 MTD partitions on "spi0.0":
[    0.660164] 0x000000000000-0x00000000c000 : "routerboot"
[    0.667782] 0x00000000c000-0x00000000d000 : "hard_config"
[    0.675073] 0x00000000d000-0x00000000e000 : "bios"
[    0.682613] 0x00000000e000-0x00000000f000 : "soft_config"
[    0.690304] NAND flash driver for the RouterBOARD 91x series

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte eca8a2ee0d kernel: bump 4.14 to 4.14.169
Refreshed all patches.

Fixes:
- CVE-2019-14896
- CVE-2019-14897

Remove upstreamed:
- 023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch
- 001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Mason Clarke 3d1c84d424 ramips: reenable image creation for the D-Link DIR-645
This commit reenables the image creation for the D-Link DIR-645.

Images built for the D-Link DIR-645 work just fine, there is no reason
to disable the image creation for it.

I tested the OpenWrt 18.06.5 and 19.07.0-rc1 images, as well as an
image I built from the current 19.07 branch (git HEAD 62d5ece) with
the default 19.07 release config, and I cannot confirm the report that
commit 2607c02ed5
("ramips: disable D-Link DIR-645 by default") references.
Configuration changes were applied successfully and remained set after
a reboot as well. The log also showed no anomalies.

This reverts commit 2607c02ed5.

Signed-off-by: Mason Clarke <mclarke2355@gmail.com>
5 years ago
Jan Alexander aed6632d31 ramips: use tpt DTS trigger for TP-Link TL-MR3020 v3 and TL-WA801ND v5
This converts the TP-Link TL-MR3020v3 board to use the WLAN throughput
LED trigger in order to react to all VAPs.

It also moves the WLAN trigger config of the TP-Link TL-WA801NDv5 to the
DTS and merges the now identical LAN LED configs.

Verified these changes on a TL-MR3020v3 and TL-WA801NDv5.

Signed-off-by: Jan Alexander <jan@nalx.net>
[changed commit title and extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[added comment about test result on TL-WA801ND v5]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 20eb45da4f)
5 years ago
Adrian Schmutzler a229907150 ramips: remove duplicate DEVICE_PACKAGES for TP-Link Archer C20i
DEVICE_PACKAGES is specified twice for the same device. Remove the
first (=older) assignment.

Fixes: 40692f0fb5 ("ramips: mt7620: select only the matching mt76 driver")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 4ecd6510bf)
5 years ago
Jo-Philipp Wich 4668ae3bed OpenWrt v19.07.1: revert to branch defaults
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 901bbe2ab9 OpenWrt v19.07.1: adjust config defaults
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich c155900f66 opkg: update to latest Git HEAD
80d161e opkg: Fix -Wformat-overflow warning
c09fe20 libopkg: fix skipping of leading whitespace when parsing checksums

Fixes: CVE-2020-7982
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c69c20c667)
5 years ago
Felix Fietkau 8ab2b42fac kernel: fix dst reference leak in flow offload
Fixes a significant amount of leaked memory with lots of connections

Ref: PR#2721
Tested-by: Jerome Benoit <jerome.benoit@sap.com> [WRT1900AC v1]
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[removed 4.19 patch during cherry-pick]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c6c4701def)
5 years ago
Adrian Schmutzler 47935940d6 ath79: fix SUPPORTED_DEVICES not matching ar71xx board names
Based on a script for comparison, this fixes (hopefully) all errors
in SUPPORTED_DEVICES for ar71xx->ath79 upgrade.

Devices where old string is removed as the device does not exist
in ar71xx:
- dlink_dir-859-a1
- tplink_archer-a7-v5
- tplink_cpe510-v3 [only in master]

Devices where string is changed because it did not match the board
name in ar71xx:
- tplink_tl-mr3220-v1
- tplink_tl-mr3420-v1
- tplink_tl-wr2543-v1
- tplink_tl-wr741nd-v4
- tplink_tl-wr841-v7
- ubnt_unifiac-mesh
- ubnt_unifiac-mesh-pro
- ubnt_unifiac-pro

For this device, the correct string could not be found, but we could
not determine the correct one. Thus, the string is removed for now:
- tplink_tl-wr740n-v4

The script for checking this is quite simple (note that newer
entries, i.e. ath79->ath79 upgrade, are displayed as missing):

  newpath=target/linux/ath79/image/
  oldpath=target/linux/ar71xx/base-files/lib/ar71xx.sh

  for s in $(grep -roh "SUPPORTED_DEVICES.*" $newpath | sed 's/SUPPORTED_DEVICES *.= *//'); do
    found="Missing"
    grep -q -r "\"$s\"" $oldpath && found="Found"
    echo "$s: $found."
  done

The errors might be filtered by appending 'grep "Missing"' to the script.

Fixes: FS#2751

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 07ce940b77)
5 years ago
Adrian Schmutzler da5b5ae9b9 ath79: remove SUPPORTED_DEVICES for TP-Link Archer D50 v1
This device has not been supported in ar71xx, so there is no need
for an explicit SUPPORTED_DEVICES entry.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 894bdee756)
5 years ago
Hauke Mehrtens f84981f6f8 mac80211: Update to version 4.19.98
The removed patches are all integrated in the upstream version now.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Martin Schiller 3212290a3b lantiq: ltq-ptm: vr9: fix skb handling in ptm_hard_start_xmit()
Call skb_orphan(skb) to call the owner's destructor function and make
the skb unowned.

This is necessary to prevent sk_wmem_alloc of a socket from overflowing,
which leads to ENOBUFS errors on application level.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
(cherry picked from commit 996f02e5ba)
5 years ago
Magnus Kroken 6ee0138a6c mbedtls: update to 2.16.4
Fixes side channel vulnerabilities in mbed TLS' implementation of ECDSA.

Release announcement:
https://tls.mbed.org/tech-updates/releases/mbedtls-2.16.4-and-2.7.13-released

Security advisory:
https://tls.mbed.org/tech-updates/security-advisories/mbedtls-security-advisory-2019-12

Fixes:
 * CVE-2019-18222: Side channel attack on ECDSA

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
(cherry picked from commit 6e96fd9047)
5 years ago
Koen Vandeputte 1c5ac590c4 kernel: bump 4.14 to 4.14.167
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Petr Štetiar 8038846b62 procd: update to version 2020-01-24
Get only fix backports from openwr-19.07 procd branch:

 31e4b2dfdbd7 state: fix reboot causing shutdown inside LXC container
 557f11b3a20f instance: provide error feedback if ujail binary is missing
 0a11aa405d3f instance: Fix instance_config_move_strdup() function
 44dd9419812b instance: fix typo in error message
 153820c76471 instance: fix pidfile and seccomp attributes double free

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 4e91c4e156 ramips: mt7621: ubnt-erx: allow sysupgrade from master
Currently it's not possible to downgrade from master:

 Device ubiquiti,edgerouterx not supported by this image
 Supported devices: ubnt-erx

So fix it by adding a DTS based device name from master into
SUPPORTED_DEVICES list.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Felix Fietkau 4a58a871c4 hostapd: fix faulty WMM IE parameters with ETSI regulatory domains
hostapd sets minimum values for CWmin/CWmax/AIFS and maximum for TXOP.
The code for applying those values had a few bugs leading to bogus values,
which caused significant latency and packet loss.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Anderson Vulczak abaf329dad tools: tplink-safeloader: update soft_ver for TP-Link Archer C6 v2 (EU)
This patch updates "soft_ver" for TP-Link Archer C6 v2 (EU).

It makes possible to upload OpenWrt on lastest vendor's firmware
as the web-based updater checks for major.minor version during upload.

Due to that on next major/minor version update TP-Link will stop
us from using the web-based firmware update tool, so it will
require a new patch on soft_ver to match major and minor version.
Up to today's latest stock firmware the patch (major.minor.patch)
version does not matters, that allows downgrade from 1.1.4 to 1.1.1
but do not allow downgrade from 1.1.X to 1.0.X.

Signed-off-by: Anderson Vulczak <andi@andi.com.br>
(cherry picked from commit 7a8bfbf0ff)
(cherry picked from commit eeb93e5c2b23518e372737ecf8fdde4b9f139a49)
5 years ago
Kimmo Vuorinen 177c9ed4b0 uboot-envtools: ath79: add support for glinet,gl-ar150
Add ubootenv uci config for GL.inet GL-AR150

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a8723c48ad)
5 years ago
Kimmo Vuorinen a1502b0443 uboot-envtools: ar71xx: add support for gl-ar150/-domino/-mifi
Add ubootenv uci config for gl-ar150, gl-domino and gl-mifi

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit message/title facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit dc6dfaac80)
5 years ago
Kimmo Vuorinen b6675c2b2e ar71xx: change u-boot-env to read-write for gl-ar150/-domino/mifi
Change u-boot-env partitions to be mounted as read-write for gl-ar150,
gl-domino and gl-mifi so uboot-envtools support is possible.

Signed-off-by: Kimmo Vuorinen <kimmo.vuorinen@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 2c1cfacdde)
5 years ago
Petr Štetiar eed8f30b98 urngd: update to version 2020-01-21
c7f7b6b65b82 Tag version 1.0.2
236b7a0aef21 Fix blocked entropy generation

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 3d8edd9bb4)
5 years ago
Petr Štetiar 1636e99e80 urngd: update to latest Git head
* 40f939d57c67 Tag version 1.0.1
 * 9e758e6e6aec jitterentropy-rngd: update to version v1.1.0 + clang compile fix
 * 193586a25adc Fix wrong types in format strings used in debug build
 * d474977bb611 Add initial GitLab CI support

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit ed67b137c7)
5 years ago
Lech Perczak 1b4b4e3fae ar71xx: ubnt-rocket-m-ti: fix RSSI LED definitions
When mapping for RSSI LEDs was defined for interface wlan0 on
Ubiquiti Rocket M Titanium, it missed connection to actual interface.
Therefore create the mapping to interface, so RSSI LEDs work without
additional configuration, after starting rssileds service.

While at that, split RSSI into ~equal intervals for 6 LEDs,
and remove coefficients needed for PWM LEDs, as this board does not
support PWM LEDs.

Finally, for complete support, enable 'rssileds' package in per-device
rootfs, so the indicator works out of box.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 83708f233d)
5 years ago
Walter Sonius c1245ebc96 brcm47xx: fix switch port order for Netgear WN2500RP V1
The Netgear WN2500RP V1 switch0 already works for LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
4 / 3 / 2 / 1
WAN port is absent on this device and therefore removed
from switch config.

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[move block to maintain alphabetic sorting]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 098cbc68ee)
5 years ago
Stephan Knauss f638ef4325 kirkwood: fix HDD LED labels for Zyxel NSA325 in 01_leds
Change the LED labels for hdd1/hdd2 in 01_leds to match their
counterpart in DTS.

Signed-off-by: Stephan Knauss <openwrt@stephans-server.de>
[improve commit title and message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit fbf297be38)
5 years ago
Walter Sonius d3c2547cf1 brcm47xx: fix switch port order for Netgear WNR3500 V2
The Netgear WNR3500 V2 switch0 already works for WAN/LAN
however the port order for the LAN ports is inverted. Correct
physical port order watched from the back of the device is:
Internet / 4 / 3 / 2 / 1 this resembles the Linksys E3000 V1.

Verfied with imagebuilder edit FILES=/etc/board.d/01_network

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
(cherry picked from commit cf2f1fc687)
5 years ago
Sungbo Eo f6ab1f1566 ramips: rt305x: remove unnecessary mediatek,portmap
"#mediatek,portmap" is not a valid property name.

If mediatek,portmap equals 0x0, then the esw driver ditches it and uses
the default value, 0x3f.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit f87281b295)
5 years ago
Sungbo Eo 1d56a7b75d ramips: mt76x8: fix bogus mediatek,portmap
mt76x8 uses esw_rt3050 driver, which does not accept mediatek,portmap with
string values. Convert the strings to integers to make it work.

According to its switch setup, WRTnode 2P/2R have a WAN port at port 0,
so the correct value should be 0x3e.

tplink_8m.dtsi uses "llllw", but it does not match switch setups of any
device using the DTSI. Remove it from the DTSI and add correct value to DTS
for each device.

These devices have a WAN port at port 0. Set the value to 0x3e.
- tplink,archer-c20-v4
- tplink,archer-c50-v3
- tplink,tl-mr3420-v5
- tplink,tl-wr840n-v4
- tplink,tl-wr841n-v13
- tplink,tl-wr842n-v5

These devices have only one ethernet port. They don't need portmap setting.
- tplink,tl-wa801nd-v5
- tplink,tl-wr802n-v4
- tplink,tl-wr902ac-v3

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(backported from commit 7a387bf9a0)
[removed TL-WR841N v14 which is not present in 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Maxim Anisimov 49b240cde8 ramips: fix portmap for TP-Link Archer C50 v4
According to 02_network portmap is wan=0 lan1=1 lan2=2 lan3=3 lan4=4

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
(cherry picked from commit ebf535a6cf)
5 years ago
Sungbo Eo d3eabe44d0 ramips: mt7620/mt7621: remove invalid mediatek,portmap
mt7620 and mt7621 use mt7530 driver, which only accepts "llllw", "wllll",
and "lwlll" values.

According to its switch setup, Mi Router 3G v2 has a WAN port at port 4,
so the correct value should be "llllw".

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(backported from commit d3c0a94405)
[removed devices not in 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Christoph Krapp 67595ce380 ramips: add factory image for Netgear R6350
This adds factory image generation for all three
devices. These images can be flashed via WebUI
for easy installation.

Thanks to David Bauer for the inspiration.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[altered commit to only include the R6350]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3c8df280a9)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Christoph Krapp 9c6913ccad ramips: add mt7615e support to Netgear R6350
Signed-off-by: Christoph Krapp <achterin@googlemail.com>
(cherry picked from commit 9861fa7aba)
5 years ago
Petr Štetiar f8902d1ae6 libubox: update to version 2020-01-20
43a103ff17ee blobmsg: blobmsg_parse and blobmsg_parse_array oob read fixes
 5c0faaf4f5e2 tests: prefer dynamically allocated buffers
 1ffa41535369 blobmsg_json: prefer snprintf usage
 132ecb563da7 blobmsg: blobmsg_vprintf: prefer vsnprintf
 a2aab30fc918 jshn: prefer snprintf usage
 b0886a37f39a cmake: add a possibility to set library version
 a36ee96618a9 blobmsg: blobmsg_add_json_element() 64-bit values
 f0da3a4283b7 blobmsg_json: fix int16 serialization
 20a070f08139 tests: blobmsg/json: add more test cases
 379cd33d1992 tests: include json script shunit2 based testing

Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 5c73bb12c8)
5 years ago
Petr Štetiar 5ca066a5c2 fstools: backport fix from version 2020-01-18
Contains only the FS#2735 fix:

 189b41b6b487 libblkid-tiny: fix f2fs labels by increasing label buffer

Commit adding new feature wasn't backported (needs patched kernel anyway):

 f5c7c1813f52 fstools: Add support to read-only MTD partitions (eg. recovery images)

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 63000bfaf7)
5 years ago
Koen Vandeputte ae953449f2 kernel: bump 4.14 to 4.14.166
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 945db9fb01 kernel: bump 4.14 to 4.14.165
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 9298c443df kernel: bump 4.14 to 4.14.164
Refreshed all patches.

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
DENG Qingfang d46b00cf0f ramips: fix HiWiFi HC5962 status LED
Match LED behavior to stock firmware:

Red: booting
White: running

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit 9a3c9a9656)
5 years ago
DENG Qingfang 03c35bda03 ramips: fix HiWiFi HC5962 switch configuration
HC5962 has only 3 LAN ports, switch port 0 is unused

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(backported from commit 68f49df315)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Ozgur Can Leonard a885f7d3d0 ramips: add kmod-mt7615e to Xiaomi Mi Router 3 Pro images
Now that the mt76/mt7615e driver is in Openwrt, might as well use it.

Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com>
(cherry picked from commit d7c082ba4f)
5 years ago
Thomas Nixon 67c8e586c8 ar71xx/mikrotik: use ath10k-ct-smallbuffers for 64 MiB devices
This image is only needed on one device (wAP AC); since this target is
going to be removed anyway it doesn't make sense to add an extra "low
RAM" image.

Fixes OOM issues on RouterBoard wAP AC.

Signed-off-by: Thomas Nixon <tom@tomn.co.uk>
(cherry picked from commit 788c8485eb)
5 years ago
Jan Alexander e18c87ef45 ramips: fix wps leds/btn for TP-Link TL-WA801ND v5
- fix color and active mode for existing wps led
- add green wps led
- add wps button

Signed-off-by: Jan Alexander <jan@nalx.net>
[wrap line]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 26105974e7)
5 years ago
Daniel Golle 455ba76bf9 hostapd: cleanup IBSS-RSN
set noscan also for IBSS and remove redundant/obsolete variable.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 702c70264b)
5 years ago
Eneas U de Queiroz dd4d49dcc1 cryptodev-linux: remove DEFAULT redefinition
The 'DEFAULT:=m if ALL' line prevents the phase1 buildbots from building
the package, and users from downloading it, since they use 'ALL_KMODS=y'
but 'ALL' is not set.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 9b25f833eb)
5 years ago
Felix Fietkau 44b37774f9 mac80211: fix a page refcounting issue leading to leaks/crashes in rx A-MSDU decap
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 9501469e11)
5 years ago
Felix Fietkau a3b6ffe01b mac80211: fix sta TID stats leak on a few nl80211 calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit d5b3024139)
5 years ago
Petr Štetiar 25e1afb9e1 ucert: update to version 2019-12-19
14a279411cff fix certificate blob parsing vulnerability by using blob_parse_untrusted
19a7225ac018 fix leaking memory in cert_dump_blob
9dba44ddd4f5 fix possibly garbage value returned in cert_process_revoker
4462ff9dedfa add cram based unit tests
5fe64b5606aa cmake: split usign bits into static library
5d7626a2b6d8 cmake: reindent the file
e284ed941972 cmake: enable hardening compiler flags and fix the reported issues
7e5390666347 add initial GitLab CI support
fa0bf4ef45b1 cmake: add proper include and library dependencies

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 2544cb1ba3)
5 years ago
Petr Štetiar fe197b8b09 ramips: mt7621: disable images for gehua_ghl-r-001
This device OOPs during the boot due to broken flash. It can be probably
fixed with `broken-flash-reset` once ramips is on 4.19 kernel.

So disable images for this device until its fixed.

Ref: FS#2695, PR#2483
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 28080d54d2)
5 years ago
Maxim Anisimov 08d9828b76 ramips: fix leds for TP-Link Archer C20 v4
- add "gpio" group for wan_orange led
- use tpt triggers for wifi led indication
- add wifi 5 GHz led support

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
[slight commit message adjustment, backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 3a538db60a)
5 years ago
Adrian Schmutzler fd28ef59db ath79: add SUPPORTED_DEVICES for TP-Link TL-WR841N/ND v9 to v12
In ar71xx, v10 and v12 did not have separate board_name.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 7ed643d205)
5 years ago
Adrian Schmutzler 7a0d9b2eea ath79: add support for TP-Link TL-WR841N/ND v12
This router has the same hardware as TP-LINK TL-WR841N/ND v11 (same
FCC ID, same TFTP image name...).

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to wr841nv11_tp_recovery.bin
   (it's really v11, not v12)
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 8b76c6695b)
5 years ago
Adrian Schmutzler bd3eb071fd ath79: add support for TP-Link TL-WR841N/ND v10
The TL-WR841N/ND v10 is mostly identical to the v9. Apart from some minor
changes, it contains a newer revision of the QCA9533 SoC and the CPU clock
is significantly higher.

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to wr841nv10_tp_recovery.bin
3. Start a tftp server with the image file in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 4254193c1d)
5 years ago
Andrew Cameron 19ff3f5105 ath79: add support for the TP-LINK CPE220 V3
This adds support for a popular low-cost 2.4GHz N based AP

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

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

This also applies some minor changes to the common DTSI:
- use &wmac for label-mac-device, as this one is actually set up in
  common DTSI
- move &eth0 to parent DTSI
- fix several leading spaces, added/removed newlines

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[DTS style fixes/improvements, updated commit message/title,
backport to 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Matthias Schiffer 44c827215d
ethtool: fix PKG_CONFIG_DEPENDS
Add missing CONFIG_ prefix.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 41c19dd542)
5 years ago
Hauke Mehrtens eb15634541 OpenWrt v19.07.0: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens aca39acedf OpenWrt v19.07.0: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens a3ffeb413b ramips: Fix sysupgrade for Xiaomi mir3g
This mostly reverts the original commit e9929ebeea ("ramips: Fix
sysupgrade for Xiaomi mir3g") and replaces it with setting the
BOARD_NAME to the old value.

This way the folder in the tar will be named sysupgrade-mir3g and not
sysupgrade-xiaomi_mir3g and the sysupgrade in OpenWrt 18.06 can find it.

Without this change sysupgrade from 18.06 to 19.07 is only possible with
the -F option.

I tested the following sysupgrades successfully without -F
18.06 -> 19.07
19.07 -> master
master -> 19.07

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens f58705b77e dnsmasq: Fix potential dnsmasq crash with TCP
This is a backport from the dnsmasq master which should fix a bug which
could cause a crash in dnsmasq.

I saw the following crashes in my log:
[522413.117215] do_page_fault(): sending SIGSEGV to dnsmasq for invalid read access from 2a001450
[522413.124464] epc = 004197f1 in dnsmasq[400000+23000]
[522413.129459] ra  = 004197ef in dnsmasq[400000+23000]
This is happening in blockdata_write() when block->next is
dereferenced, but I am not sure if this is related to this problem or if
this is a different problem. I am unable to reproduce this problem.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 414d054138)
5 years ago
Petr Štetiar 54711e528d x86: fix missing led variable warning during boot
Fixes following warning during the boot:

 WARNING: Variable 'led' does not exist or is not an array/object

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 5816caad26)
5 years ago
Maxim Storchak abb0665bec ca-certificates: provide ca-certs by both ca-certificates and ca-bundle
- both packages provide ca-certs
- make ca-bundle the default provider

This should allow easy transition between these two forms of CA certificates storage

Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
(cherry picked from commit dd299805ad)
5 years ago
Hauke Mehrtens e9929ebeea ramips: Fix sysupgrade for Xiaomi mir3g
Without this change sysupgrade from 18.06 to 19.07 is only possible with
the -F option.
In OpenWrt 18.06 the nand_do_platform_check() function is called with
the board name mir3g only, if the tar does not use mir3g it will fail.
OpenWrt 19.07 and later support the metadata with the supported_devices
attribute to allow renaming. Do the renaming of the target between 19.07
and master like it is done for some other boards.

I tested the following sysupgrades successfully without -F
18.06 -> 19.07
19.07 -> master
master -> 19.07

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Jack Chen dc399c4e12 ramips: remove duplicate dts nodes of MediaTek LinkIt Smart 7688
There are two identical wmac nodes in the dts file of MediaTek
LinkIt Smart 7688, so delete one of them.

Signed-off-by: Jack Chen <redchenjs@live.com>
(cherry picked from commit 4be271a486)
5 years ago
Petr Štetiar a5653ec87e package: remove accidentally added symlink
In the commit f3439c4019 ("procd: update to version 2020-01-04") I've
somehow managed to add local testing symlink to the uledd package, so
removing it now.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Jo-Philipp Wich 6395ac4126 fstools: update to latest Git HEAD
823faa0 block: re-discover mtd devices on extroot mount retry

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 22a178e892)
5 years ago
Petr Štetiar f3439c4019 procd: update to version 2020-01-04
Contains following changes:

 a5af33ce9a16 instance: strdup string attributes
 d2e8bf6ef7cf system: watchdog_set: fix misleading indentation
 9814807bd71c system: sysupgrade: fix possibly misleading error
 c7a2db3c1eb6 system: sysupgrade: rework firmware validation
 ea45c4a0f07c system: fix failing image validation due to EINTR
 4fde95506243 cmake: fix lookup of external libraries
 5ed190aae1b3 jail: remove accidentally added lines
 52c5c1980ba3 jail: set user and group inside jail
 3aa051b44177 system: sysupgrade: close input side of pipe before reading
 f47622e89c4d instance: Warn about unexpected number of parameters
 564ecdfd9cc4 instance: ujail: Fix allocated size for no_new_privs parameter
 7fb2e1dfa221 procd: simplify code in procd_inittab_run
 4a127c3c60af procd: replace exit(-1) with exit(EXIT_FAILURE)
 bc0a73eaad58 procd: add upgraded binary to .gitignore
 ba4c4dbbbd65 procd: add start-console support
 3e39fe539490 procd: shift arguments for askfirst only once
 5d6282906baf procd: skip respawn in case device disappeared
 d27949f12fd7 procd: guard fork_worker calls
 258aa04328a2 procd: Add cached and available to memory table
 8e9fb51fa66e procd: Switch to nanosleep
 c844ace9729a system: Fix possible integer overflows

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 64c45d95d6 ubus: update to version 2019-12-27
Contains following changes:

 041c9d1c052b ubusd/libubus-io: fix socket descriptor passing
 8f2292478c57 ci: enable unit testing
 a1523d76b016 fix blob parsing vulnerability by using blob_parse_untrusted
 c60583743ccf ubus_monitor: workaround possibly false positive uses of memory after it is freed
 dac6c7c575ac ubusd_monitor: fix possible null pointer dereference
 060dfbb26da3 ubus_common: remove duplicate ARRAY_SIZE and add missing include
 c5f2053dfcfd workaround possibly false positive uses of memory after it is freed
 72be8e93f07d lua: ubus_lua_do_subscribe: fix copy&paste error
 a995b1e68129 lua: workaround false positive dereference of null pointer
 08f17c87a000 add fuzzer and cram based unit tests
 c413be9b376c refactor ubusd.c into reusable ubusd_library
 afd47189e864 examples: remove dead increments
 b2e544238672 add initial GitLab CI support
 058f4e9526ed libubus: fix incompatible pointer types assigment
 d2e026a33df8 iron out all extra compiler warnings
 5d7ca8309d0a ubusd/libubus-io: fix variable sized struct position warning
 d61282db5640 ubusd: fix comparison of integers of different signs
 90fb16234c22 cmake: enable extra compiler checks
 2e051f628996 ubus: Support static builds
 588baa3cd784 ubusd: retry sending messages on EINTR
 76ea27a62774 libubus: attempt to receive data before calling poll
 4daab27d004f libubus: do not abort recv_retry before completing a message

and bumps ABI_VERSION to 20191227.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 04fd5e22b2 libubox: update to version 2019-12-28
Contains following changes:

 cd75136b1342 blobmsg: fix wrong payload len passed from blobmsg_check_array
 eb7eb6393d47 blobmsg: fix array out of bounds GCC 10 warning
 86f6a5b8d1f1 blobmsg: reuse blobmsg_namelen in blobmsg_data
 586ce031eaa0 tests: fuzz: fuzz _len variants of checking methods
 b0e21553ae8c blobmsg: add _len variants for all attribute checking methods
 cd3059796a57 Replace use of blobmsg_check_attr by blobmsg_check_attr_len
 143303149c8b Ensure blob_attr length check does not perform out of bounds reads
 f2b2ee441adb blobmsg: fix heap buffer overflow in blobmsg_parse
 4dfd24ed88c4 blobmsg: make blobmsg_len and blobmsg_data_len return unsigned value
 2df6d35e3299 tests: add test cases for blobmsg parsing
 8a34788b46c4 test: fuzz: add blobmsg_check_attr crashes
 478597b9f9ae blob: fix OOB access in blob_check_type
 325418a7a3c0 tests: use blob_parse_untrusted variant
 0b24e24b93e1 blob: introduce blob_parse_untrusted
 6d27336e4a8b blob: refactor attr parsing into separate function
 833d25797b16 test: fuzz: add blob_parse crashes
 09ee90f8d6ed tests: add test cases for blob parsing
 436d6363a10b tests: add libFuzzer based tests
 bf680707acfd tests: add unit tests covered with Clang sanitizers
 f804578847de cmake: add more hardening compiler flags
 46f8268b4b5b blobmsg/ulog: fix format string compiler warnings
 eb216a952407 cmake: use extra compiler warnings only on gcc6+
 07413cce72e1 tests: jshn: add more test cases
 26586dae43a8 jshn: fix missing usage for -p and -o arguments
 8e832a771d3a jshn: fix off by one in jshn_parse_file
 cb698e35409b jshn: jshn_parse: fix leaks of memory pointed to by 'obj'
 c42f11cc7c0f jshn: main: fix leak of memory pointed to by 'vars'
 93848ec96dc5 jshn: refactor main into smaller pieces
 9b6ede0e5312 avl: guard against theoretical null pointer dereference
 c008294a8323 blobmsg_json: fix possible uninitialized struct member
 0003ea9c45cc base64: fix possible null pointer dereference
 8baeeea1f52d add assert.h component
 b0a5cd8a28bf add cram based unit tests
 1fefb7c4d7f9 add initial GitLab CI support
 c955464d7a9b enable extra compiler checks
 6228df9de91d iron out all extra compiler warnings

and bumps ABI_VERSION to 20191228.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar bf99f79200 base-files: sysupgrade: exit if the firmware download failed
Sysupgrade process shouldn't continue if the firmware image couldn't be
downloaded.

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020940.html
Reported-by: Petr Novák <petrn@me.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit cf3da66d2c)
5 years ago
Klaus Kudielka 3140d38042 base-files: upgrade: add case to export_bootdevice
The factory uboot of the Turris Omnia boots with "root=b301", and we
instruct new users to sysupgrade from there (e.g. method 1, step 7).
Currently, this will fail with "Unable to determine upgrade device".
Add a new case to export_bootdevice, which parses the hex argument.

Ref: https://github.com/openwrt/openwrt/pull/2340#issuecomment-561317688
Fixes: 2e5a0b81ec ("mvebu: sysupgrade: sdcard: keep user added partitons")
Reviewed-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 3a4f587c46)
5 years ago
Florian Fainelli 3c11032039 sunxi: Turn on CONFIG_PINCTRL_SUN4I_A10 for A20
CONFIG_PINCTRL_SUN4I_A10 controls both the A10 and the A20 enablong of
the pinctrl driver, this is necessary since upstream commit
5d8d349618a9464714c07414c5888bfd9416638f ("pinctrl: sunxi: add A20
support to A10 driver") which has been included in v4.13 and onwards.

Fixes: ad2b3bf310 ("sunxi: Add support for kernel 4.14")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
(cherry picked from commit 32e4eaef1b)
5 years ago
Eneas U de Queiroz 3fc47dd443 wolfssl: bump to 4.3.0-stable
This update fixes many bugs, and six security vulnerabilities, including
CVE-2019-18840.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit d5ede68f8b)
5 years ago
Hauke Mehrtens 330046922b kernel: bump 4.14 to 4.14.162
Refreshed all patches.

Compile-tested on: ipq40xx, ramips
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 084dfb8ebd kernel: bump 4.14 to 4.14.161
Refreshed all patches.

Compile-tested on: ipq40xx, ramips
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
David Bauer f8543adb14 mt76: update to the latest openwrt-19.07 version
8a78567 mt76: fix compilation warning in mt76_eeprom_override()

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer bce5342fb6 mt76: fix incorrect firmware path
The mt76 driver does load the firmware for the MT7615 chip from
/lib/firmware/mediatek instead of /lib/firmware. The driver loads the
firmware from this path since mt76 commit
ea3ab68c7589 ("mt76: mt7615: fix mt7615 firmware path definitions").

Fixes: a2e2c40b5e ("mt76: update to the latest openwrt-19.07 version")

Reported-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Stijn Segers <foss@volatilesystems.org>
5 years ago
David Bauer 594f731e04 ramips: fix Archer C20i wireless MAC address
The TP-Link Archer C20i previously had a generic Ralink MAC address set
for both radios, as the caldata does only contain a generic MAC address.

Set the MAC address from the vendor firmware for both radios to assign
unique MAC addresses to every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3b013dcdf8)
5 years ago
David Bauer 037a151c56 ramips: fix Archer C2 v1 5GHz MAC address
The TP-Link Archer C2 v1 previously had a generic Ralink MAC address set
for the 5GHz radio (MT7610), as the caldata does only contain a generic
MAC address.

Set the MAC address from the vendor firmware for the 5GHz radio to
assign unique MAC addresses to every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit dcc923a4c4)
5 years ago
David Bauer 3e8b66e0da ramips: add system LED indicators for TP-Link C20i
Use the WPS LED to indicate system status like it is done for the
TP-Link Archer C2 v1 and many other boards.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit a272fafc9c)
5 years ago
David Bauer 80e0b97d07 ramips: convert TP-Link MT7620 boards to tpt trigger
This converts all MediaTek MT7620 boards from TP-Link to use the now
supported WiFi throughput LED trigger. This way, the LED state now
covers all VAPs regardless of their name.

Also align all single-WiFi LEDs to represent the state of the 2.4GHz
radio. This was not always the case previously, as later-added support
for the MT7610 altered the phy probing order.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 1e7c6381f0)
5 years ago
David Bauer a2e2c40b5e mt76: update to the latest openwrt-19.07 version
330e832 mt76: mt76x0: fix default mac address overwrite
f97c33e mt76: mt7603: fix input validation issues for powersave-filtered frames
875f6d7 mt76: mt7615: increase MCU command timeout
abd7d86 mt76: clear skb pointers from rx aggregation reorder buffer during cleanup
96c7b07 mt76: eeprom: add support for big endian eeprom partition
19c8e20 mt76: fix possible undetected invalid MAC address
df64c56 mt76: Off by one in mt76_calc_rx_airtime()
1702b24 mt76: mt7603: reset STA_CCA counter setting the channel
383a631 mt76: mt76x0u: do not reset radio on resume
2dcfbdd mt76: disable bh in mt76_dma_rx_poll
947d20d mt76: fix rx dma ring descriptor state on reset
f3348f5 mt7615: replace sta_state callback with sta_add/sta_remove
faf5e6f mt76: mt7615: read {tx,rx} mask from eeprom
db78ee0 mt76: move mt76_get_antenna in mt76_core module
7121e16 mt76: fix possible out-of-bound access in mt7615_fill_txs/mt7603_fill_txs
5dfb0ec mt76: mt7615: disable radar pattern detector during scanning
e2f90ad mt76: move interface_modes definition in mt76_core module
cfdb751 mt76: mt7615: add ibss support
e0731a8 mt76: move SUPPORTS_REORDERING_BUFFER hw property in mt76_register_device
a85c06c mt76: use mt76_dev in mt76_is_{mmio,usb}
ea19cd7 mt76: Remove set but not used variable 'idx'
3cbaf81 mt76: mt76u: rely on a dedicated stats workqueue
20f0589 mt76: mt76u: rely on usb_interface instead of usb_dev
f2be00b mt76: dma: fix buffer unmap with non-linear skbs
c14d656 mt76: mt76x2e: disable pcie_aspm by default
58e1e96 mt76: mt7615: remove unneeded semicolon
c93a2d1 mt76: mt76x02u: update ewma pkt len in mt76x02u_tx_prepare_skb
1987b74 mt76: mt76x0: remove 350ms delay in mt76x0_phy_calibrate
50b1e9b mt76: refactor cc_lock locking scheme
d868638 mt76: remove obsolete .add_buf() from struct mt76_queue_ops
dc14ac6 mt7615: remove vif sta from poll list on interface remove
2a0a191 mt7603: remove vif sta from poll list on interface remove
d3a5895 mt76: fix a-mpdu boundary detection issue for airtime reporting
391e148 mt76: add sanity check for a-mpdu rx wcid index
01642d8 mt76: mt76x02: fix use-after-free in tx status code handling airtime
c11a4ad mt76: mt76x0: eeprom: add support for MAC address from OF
d94cc81 mt76: drop rcu read lock in mt76_rx_aggr_stop
7d8764d mt76: avoid enabling interrupt if NAPI poll is still pending
5b02a07 mt76: add missing locking around ampdu action
71c2ef0 mt76: fix aggregation stop issue
6f7d0f5 mt76: fix use-after-free bug in airtime fairness code
8f22de0 mt76: do not use devm API for led classdev
e7199f9 mt76: enable airtime fairness
81f2be0 mt76: mt7615: track tx/rx airtime for airtime fairness
2579122 mt76: mt7615: introduce mt7615_mac_wtbl_update routine
d91f7c1 mt76: mt7615: fix survey channel busy time
028071d mt76: mt7615: report tx_time, bss_rx and busy time to mac80211
0e5050e mt76: mt76x02: track approximate tx airtime for airtime fairness and survey
3429cc7 mt76: mt76x02: move MT_CH_TIME_CFG init to mt76x02_mac_cc_reset
de118bb mt76: unify channel survey update code
fdf0163 mt76: mt7603: switch to a different counter for survey busy time
ee31030 mt76: mt7603: track tx airtime for airtime fairness and survey
f34b1ae mt76: track rx airtime for airtime fairness and survey
a1d6891 mt76: store current channel survey_state in struct mt76_dev
b042987 mt76: rename mt76_driver_ops txwi_flags to drv_flags and include tx aligned4
2027763 mt76: report rx a-mpdu subframe status
1ddcadb mt76: mt7603: remove q_rx field from struct mt7603_dev
ea3ab68 mt76: mt7615: fix mt7615 firmware path definitions
081926a mt76: mt7603: collect aggregation stats
696c0fc mt76: mt7615: collect aggregation stats
23e8aed mt76: move aggr_stats array in mt76_dev
1118b5e mt76: mt7615: add queue entry in debugfs
fbc59e6 mt76: move queue debugfs entry to driver specific code
0b01ace mt76: mt76x02u: move mt76x02u_mac_start in mt76x02-usb module
c394887 mt76: mt76x0u: reset counter starting the device
0355b7a mt76: mt76x2: move mt76x02_mac_reset_counters in mt76x02_mac_start
f3792b5 mt76: mt76x02: move mac_reset_counter in mt76x02_lib module
63e8152 mt76: mt7615: enable SCS by default
b140512 mt76: mt76x0e: make array mt76x0_chan_map static const, makes object smaller
a20c20b mt76: usb: add lockdep_assert_held in __mt76u_vendor_request
0308d75 mt76: remove empty flag in mt76_txq_schedule_list
0efbc5d mt76: use cancel_delayed_work_sync in mt76_rx_aggr_shutdown
9c5df3c mt76: remove aggr_work field from struct mt76_wcid
8739f87 mt76: mt7615: fix control frame rx in monitor mode
e07407a mt7603: fix build with CONFIG_KERNEL_DYNAMIC_DEBUG=y
c7f8214 mt76: mt7615: add support to read temperature from mcu
6797378 mt76: mt7615: introduce mt7615_txwi_to_txp utility routine
496c78e mt76: mt76x0: remove unneeded return value on set channel
1d2acd5 mt76: mt76x0: remove redundant chandef copy
0167bfa mt76: make mt76_rx_convert static

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Moritz Warning 1f927bd2f0 ramips: fix inverted reset button for Ravpower WD03
The button events "pressed" and "released" were switched. Tested with v18.06.4.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit 3e1325b219)
5 years ago
David Bauer 7ab5dc77b2 ramips: add LED trigger for TL-WR902AC v3 WAN LED
This adds an LED trigger for the WAN LED on top of the TP-Link
TL-WR902AC v3. Currently, only the LED on the port itself shows the link
state, while the LED on top of the device stays dark.

The WAN port of the device is a hybrid LAN/WAN one, hence why the LED at
the port was labled LAN.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c48b571ad7)
5 years ago
David Bauer ad4b939bd0 rt2x00: add throughput LED trigger
This adds a (currently missing) throughput LED trigger for the rt2x00
driver. Previously, LED triggers had to be assigned to the netdev, which
was limited to a single VAP.

Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Christoph Krapp <achterin@googlemail.com>
(cherry picked from commit 985ec835ae)
5 years ago
Felix Fietkau 91dde4291c mac80211: fix build without CONFIG_PCI
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit fa37dbbc43)
5 years ago
Felix Fietkau 30301dfcf0 mac80211: add patch to include local BSS rx time in survey information
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 6a3739dc42)
5 years ago
Felix Fietkau da7dde8993 mac80211: add pcie apsm backport changes
Required for newer versions of mt76

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit d64daf7026)
5 years ago
Adrian Schmutzler 62d5ece70b ramips: remove bogus ralink,mtd-eeprom with offset 0x4
Several devices in mt76x8 subtarget use the following line to set
up wmac in their DTS(I) files:

ralink,mtd-eeprom = <&factory 0x4>

This is strange for several reasons:
- They should use mediatek,mtd-eeprom on this SOC
- The caldata is supposed to start at 0x0
- The parent DTSI mt7628an.dtsi specifies mediatek,mtd-eeprom anyway,
  starting from 0x0
- The offset coincides with the default location of the MAC address
  in caldata

Based on the comment in b28e94d4bf ("ramips: MiWiFi Nano fixes"),
it looks like the author for this device wanted to actually use
mtd-mac-address instead of ralink,mtd-eeprom. A check on the same
device revealed that actually the MAC address start at offset 4 there,
so the correct caldata offset is 0x0.

Based on these findings, and the fact that the expected location on
this SOC is 0x0, we remove the "ralink,mtd-eeprom = <&factory 0x4>"
statement from all devices in ramips (being only mt7628an anyway).

Thanks to Sungbo Eo for finding and researching this.

Reported-by: Sungbo Eo <mans0n@gorani.run>
Fixes: b28e94d4bf ("ramips: MiWiFi Nano fixes")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 09d38a3bc3)
5 years ago
Paul Fertser 94153971bb ipq40xx: use ath10k-ct-smallbuffers for 128 MiB devices
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
(cherry picked from commit 0b7d779dcf)
5 years ago
Hauke Mehrtens d13c6d078e kernel: bump 4.14 to 4.14.160
Refreshed all patches.

Compile-tested on: ipq40xx, ath79
Runtime-tested on: ipq40xx

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Koen Vandeputte f80272dd9c kernel: bump 4.14 to 4.14.159
Refreshed all patches.

Remove upstreamed:
- 302-0002-dmaengine-dw-implement-per-channel-protection-contro.patch

Fixes:
- CVE-2019-19332

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Paul Fertser 3030abfa7e ath79: use ath10k-ct-smallbuffers for 64 MiB devices
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
5 years ago
Hauke Mehrtens 36057763fa ath10k-firmware: Add kmod-ath10k-ct-smallbuffers to depends
Only select ath10k-ct-regular when smallbuffers version was not
selected.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 80f06cb601)
5 years ago
Paul Fertser 450b306e54 kernel: ath10k-ct: provide a build variant for small RAM devices
According to many bugreports [0][1][2] the default ath10k-ct kernel
module is unusable on devices with just 64 MiB RAM or with 128 MiB and
dual ath10k cards. The target boards boot but eventually oom-killer
starts to interfere with normal operation, so the current state is
effectively broken.

Since the two patches in question have a performance impact (and
possibly some other unexpected side-effects) a dedicated build variant
is added so that users of the low RAM devices can still benefit from all
the ath10k-ct advantages.

According to testing [3] results, the issue can be experienced even with
"a 256MB device with three radios". Measured performance impact of
implementing small buffers was lowering "the maximum 5 GHz throughput on
an IPQ40xx device without RPS/XPS optimizations from 494/432 Mbit/s for
TCP transfers (download/upload) to 438/343 Mbit/s"

The patches were apparently inspired by QSDK tweaks used by ODMs for the
affected devices.

[0] http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020573.html
[1] https://github.com/openwrt/openwrt/pull/1077
[2] https://bugs.openwrt.org/index.php?do=details&task_id=2664
[3] https://github.com/freifunk-gluon/gluon/pull/1440#issue-195607701

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
[Remove double CONFIG_ATH10K-CT_LEDS entry]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1ac627024d)
5 years ago
Jo-Philipp Wich e50d44d985 fstools: update to latest git HEAD
b4e25d5 libblkid-tiny: fix symbol collision with full libblkid

Fixes: FS#2691, FS#2692
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5f4244150f)
5 years ago
Rafał Miłecki 6a151d6558 fstools: update to latest git HEAD
111a43f libblkid-tiny: vfat: Change parsing label in special cases
f43a1aa libblkid-tiny: vfat: Fix reading labels which starts with byte 0x05
157924d libblkid-tiny: add blkid_probe_set_id_label() stub
0c5761f libblkid-tiny: use separated buffer for each block device read
b82c5c1 libblkid-tiny: add functions for allocating & freeing probe struct
12851d6 blockd: don't flush devices list on "hotplug" call
5ea47fe blockd: fix vlist memory corruption

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 4ebc9dc9c4)
5 years ago
Yousong Zhou 43c5927312 fstools: bump to version 2019-11-03
2f2a09a block: mount_device: err log only when mp deviates from spec
da4edc1 block: mount_device: skip extroot earlier
32c3126 block: mount_action: handle mount/umount deps
fb0700f block: support hierarchical mount/umount
1212b5b block: umount: skip / unless -a is given
eda8b3f block: use fsck.fat instead of dosfsck
d05276d libblkid-tiny: ntfs: fix use-after-free

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit e4af39d563)
5 years ago
Hauke Mehrtens f7779d64ba fstools: update to latest Git HEAD
4327ed4 mkdev: Avoid out of bounds read
9b3eb63 libblkid-tiny: use blkid_probe_set_utf8label for label set
c9d0462 libblkid-tiny: adds blkid_probe_set_utf8label support

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 541a321070)
5 years ago
Yousong Zhou ab7386bd67 libubox: bump to version 2019-10-29
It contains a single change to vlist.h header file: "vlist: add more
macros for loop iteration".  This is needed for newer version of fstools

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 51e7624776)
5 years ago
Roman Yeryomin c34499a6e4 libubox: update to latest git HEAD
eb30a03 libubox, jshn: add option to write output to a file

Signed-off-by: Roman Yeryomin <roman@advem.lv>
(cherry picked from commit c0e7ec91a0)
5 years ago
Sungbo Eo 7203a58d7b kernel: remove LINUX_4_9 dependency of kmod-dax
This patch resolves recursive dependency warning on a feed package:

$ make defconfig
Collecting package info: done
tmp/.config-package.in:104721:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:104721:symbol PACKAGE_nfs-kernel-server depends on NFS_KERNEL_SERVER_V4
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
feeds/packages/net/nfs-kernel-server/Config.in:4:symbol NFS_KERNEL_SERVER_V4 depends on PACKAGE_nfs-kernel-server
#
# configuration written to .config
#

19.07 branch uses kernel 4.14 only, so CONFIG_LINUX_4_9 symbol is not
needed anyway.

Ref: https://github.com/openwrt/packages/issues/10490

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
5 years ago
Jiri Kastner 0c07224b5a scripts/dowload.pl: add archive.apache.org to apache mirror list
apache mirrors holds only latest releases, to download
older releases, one must use archive.apache.org to get
them.

Signed-off-by: Jiri Kastner <cz172638@gmail.com>
(cherry picked from commit dc34c695c4)
5 years ago
Sungbo Eo 4fba5dc103 kernel: fix *-gpio-custom module unloading
Unloading and reloading the modules fails, as platform_device_put() does not
release resources fully.

root@OpenWrt:/# insmod i2c-gpio-custom bus0=0,18,0,5
[  196.860620] Custom GPIO-based I2C driver version 0.1.1
[  196.871162] ------------[ cut here ]------------
[  196.880517] WARNING: CPU: 0 PID: 1365 at fs/sysfs/dir.c:31 0x80112158
[  196.893431] sysfs: cannot create duplicate filename '/devices/platform/i2c-gpio.0'
...
[  197.513200] kobject_add_internal failed for i2c-gpio.0 with -EEXIST, don't try to register things with the same name in the same directory.

This patch fixes it by replacing platform_device_put() to
platform_device_unregister().

Fixes: da77408537 ("i2c-gpio-custom: minor bugfix")
Fixes: 3bc81edc70 ("package: fix w1-gpio-custom package (closes #6770)")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit a22b7a60d9)
5 years ago
Rosen Penev df45ef5436 cmake: Install host packages to lib instead of lib64
Several CMake packages such as log4cplus and protobuf(-c) install to
lib64 instead of lib on some hosts. This completely breaks rpath linking.
Override it globally to avoid fixing each package individually.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Tested-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit 383abffb11)
5 years ago
Bjørn Mork 6351205d73 adb: fix for SuperSpeed devices
The USB descriptor parsing in adb fails to detect SuperSpeed devices
because of the SuperSpeed Endpoint Companion Descriptor.  This
cherry-picks the upstream fix for the problem.

Unfortunately there never were a release with this fix before the
conversion to C++, so upgrading to a newer version isn't an option.

This makes adb work with SuperSpeed devices like the Sierra Wireless
EM7565.  Tested and verified.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit d034a1f457)
5 years ago
Jeffery To d2e87c7800 toolchain/gcc: Backport patch to fix unconditional MULTIARCH_DIRNAME
This backports the patch for GCC PR target/89587 (gcc's rs6000
configuration unconditionally sets MULTIARCH_DIRNAME, even when
multiarch is disabled).

This currently affects apm821xx and may cause issues when
cross-compiling packages, e.g. Python 3[1].

This includes patches for GCC 8 (with the changelog diff removed);
this change is already included in GCC 9.2 and 7.5.

[1]: https://github.com/openwrt/packages/issues/10552

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
[Removed patch for GCC 7.4.0, GCC 7.5.0 already contains this]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c102f702e7)
5 years ago
Yorkie Liu a7d880e830 toolchain/gcc: correct the check expr for newer clang
This fixes gcc build error within clang 11.0, it tweaks the version
string from LLVM to clang.

Signed-off-by: Yorkie Liu <yorkiefixer@gmail.com>
(cherry picked from commit 65a561fd09)
5 years ago
Aleksander Jan Bajkowski 3a863da268 lantiq: fix phys led
led2l and led2h value is incorrectly set by led3l and led3h.
Bug was introduced in commit: 863e79f8d5

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
Fixes: 863e79f8d5 ("lantiq: add support for kernel 4.9")
(cherry picked from commit 692390225d)
5 years ago
Jo-Philipp Wich 18107f4481 uhttpd: reset PKG_RELEASE
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 97af1fc979)
5 years ago
Jo-Philipp Wich 414ea30927 uhttpd: update to latest Git HEAD
5f9ae57 client: fix invalid data access through invalid content-length values

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f34f9a414d)
5 years ago
Sungbo Eo 27eea24921 ar71xx: fix MAC address setup for TL-WDR4300 board
The current ethernet MAC address setup of TL-WDR4300 board is different
from the setup of stock firmware:

OpenWrt: lan = label_mac -2, wan = label_mac -2
  stock: lan = label_mac,    wan = label_mac +1

This patch applies to all devices using TL-WDR4300 board:
TL-WDR3600 v1
TL-WDR4300 v1
TL-WDR4300 v1 (IL)
TL-WDR4310 v1
Mercury MW4530R v1

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 9b02d32e34)
5 years ago
Sungbo Eo 9bdd3d39ad ath79: fix MAC address setup for TP-Link TL-WDR3600/TL-WDR4300
The current ethernet MAC address setup of TL-WDR4300 board is different
from the setup of stock firmware:

OpenWrt: lan = label_mac -2, wan = label_mac -2
  stock: lan = label_mac,    wan = label_mac +1

The full address assignment is as follows:
LAN  label
WAN  label + 1
5G   label
2G   label - 1

This patch changes all devices using TL-WDR4300 board:
TL-WDR3600 v1 (checked on device)
TL-WDR4300 v1 (checked on device)
TL-WDR4300 v1 (IL)

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rephrase/extend commit title/message, backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a4260eaab7)
5 years ago
Sungbo Eo 08c850f046 ramips: fix USB LED for Belkin F9K1109v1
Device support for Belkin F9K1109v1 was added using set_usb_led()
although this was removed in 772b27c207 ("ramips: set F5D8235 v1
usb led trigger via devicetree").

Use ucidef_set_led_usbport() instead.

Fixes: f2c83532f9 ("ramips: add support for Belkin F9K1109v1")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rephrase commit title and message, backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 1f455418ef)
5 years ago
Rafał Miłecki 2c16044ccf mac80211: brcm: add support for BCM4359 SDIO chipset
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 17e2246eca)
5 years ago
Rafał Miłecki c0f2905fa9 mac80211: brcm: backport 5.5 and 5.6 kernel patches
This update doesn't include:
3b1e0a7bdfee brcmfmac: add support for SAE authentication offload
be898fed355e brcmfmac: send port authorized event for FT-802.1X
due to nl80211 dependencies.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit c3aa33bf70)
5 years ago
Sungbo Eo 3243523c46 ath79: migrate LED paths of TL-WDR4300 board
TL-WDR4300 board uses only green LED names in DTSI.
This patch adds migration for them.

The actual LED colors on the devices have been reported to vary
across subrevisions (v1.x). Despite, the USB LEDs on the back might
have different color than the other LEDs on the front.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[extended commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 01d39cd18c)
5 years ago
Daniel Golle d0a71a89e1 malta: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit e964338110)
5 years ago
Daniel Golle 9e6fb4463b sunxi: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 2105354968)
5 years ago
Daniel Golle 4aebbaeac1 layerscape: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 414d027ae8)
5 years ago
Daniel Golle a2ac5b3a97 kirkwood: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 411e824ec3)
5 years ago
Daniel Golle a467f39e55 at91: disable legacy PTYs and virtual terminals
Enabling legacy PTYs causes problems with procd-hotplug.
And as this is a headless target, no need to have virtual terminals.
Remove corresponding kernel config options, they are disabled in
generic kernel config.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit c1db4d9c56)
5 years ago
Daniel Golle a77d4bc3a5 mpc85xx: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit d0d7f5d9e4)
5 years ago
Daniel Golle 40a7e761a0 uml: remove CONFIG_LEGACY_PTY from kernel config
Having legacy PTYs enabled causes problems with procd-hotplug.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit dcf48fda05)
5 years ago
Daniel Golle 852ec97e1c oxnas: disable legacy PTYs and virtual terminals
Enabling legacy PTYs causes problems with procd-hotplug.
And as this is a headless target, no need to have virtual terminals.
Remove corresponding kernel config options, they are disabled in
generic kernel config.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit c881769a55)
5 years ago
Hans Dedecker 1f1867dd9b odhcpd: optimize syslog priority values
e53fec8 treewide: optimize syslog priority values

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Manuel Kock 03c93679b4 lantiq: remove redundant WiFi LED on FRITZ!Box 7320
The led wireless trigger is already set correctly to phy0tpt through the
alias in the device tree.

Signed-off-by: Manuel Kock <github.web@manu.li>
[rephrased commit title]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 509894cffb)
5 years ago
David Bauer 795df80917 mpc85xx: add support for Enterasys WS-AP3710i
Hardware
--------

SoC:   NXP P1020 (2x e500 @ 800MHz)
RAM:   256M DDR3 (Micron)
FLASH: 32M NOR (Spansion S29GL128S)
BTN:   1x Reset
WiFi:  1x Atheros AR9590 2.4 bgn 3x3
       2x Atheros AR9590 5.0 an 3x3
ETH:   1x Gigabit Ethernet (Atheros AR8033)
LED:   System (green/red) - Radio{0,1} (green)
       LAN (connected to PHY)
        - GE blue
        - FE green

Serial is a Cisco-compatible RJ45 next to the ethernet port.
115200-N-8 are the settings for OS and U-Boot.

Installation
------------

1. Grab the OpenWrt initramfs, rename it to 01C8A8C0.img. Place it in
   the root directory of a TFTP server and serve it at
   192.168.200.200/24.

2. Connect to the serial port and boot the AP. Stop autoboot in U-Boot
   by pressing Enter when prompted. Credentials are identical to the one
   in the APs interface. By default it is admin / new2day.

3. Set the bootcmd so the AP can boot OpenWrt by executing

   $ setenv boot_openwrt "setenv bootargs;
     cp.b 0xee000000 0x1000000 0x1000000; bootm 0x1000000"
   $ setenv bootcmd "run boot_openwrt"
   $ saveenv

   If you plan on going back to the vendor firmware - the bootcmd for it
   is stored in the boot_flash variable.

4. Load the initramfs image to RAM and boot by executing

   $ tftpboot 0x1000000 192.168.200.200:01C8A8C0.img; bootm

5. Make a backup of the "firmware" partition if you ever wish to go back
   to the vendor firmware.

6. Upload the OpenWrt sysupgrade image via SCP to the devices /tmp
   folder.

7. Flash OpenWrt using sysupgrade.

   $ sysupgrade -n /tmp/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 16b01fb1b9)
5 years ago
Hans Dedecker 3959f11005 glibc: update to latest 2.27 commit (BZ #2503, BZ #2504)
bef0b1cb31 libio: Disable vtable validation for pre-2.1 interposed handles [BZ #25203]
4d5cfeb510 rtld: Check __libc_enable_secure before honoring LD_PREFER_MAP_32BIT_EXEC (CVE-2019-19126) [BZ #25204]
92f04eedb5 mips: Force RWX stack for hard-float builds that can run on pre-4.8 kernels

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Alin Nastac a50c2190d3 glibc: backport fix for regexec buffer read overrun
Problem found by AddressSanitizer[1]:

 Latest `grep` (git commit 1019e6e) compiled with asan may cause a
 heap-buffer-overflow when `-i` is specified.

     ./grep -i '\(\(\)*.\)*\(\)\(\)\1' /bin/chvt

 =================================================================
 ==16206==ERROR: AddressSanitizer: heap-buffer-overflow on address

1. https://debbugs.gnu.org/34140

Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=24114
Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
[commit title and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Hans Dedecker 929c6d733a glibc: update to latest 2.27 commit (BZ#23637)
5b4f7382af Add undef to fix test failure.
9456483fb2 Improve performance of memmem
373f8b06a3 Improve performance of strstr
4ec1b9e913 Fix strstr bug with huge needles (bug 23637)
ecd6271ed8 Speedup first memmem match
bba6b9288f Simplify and speedup strstr/strcasestr first match
7a4da6ef7a Improve strstr performance

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Hans Dedecker e8e09c5893 glibc: update to latest 2.27 commit (BZ #24228, BZ #24744, BZ #24699)
5f0d2e0491 [AArch64] Add ifunc support for Ares
e6b7252040 aarch64,falkor: Use vector registers for memcpy
c74b884f70 aarch64,falkor: Ignore prefetcher tagging for smaller copies
0fc5934ebd aarch64/strncmp: Use lsr instead of mov+lsr
e0a0bd3acc aarch64/strncmp: Unbreak builds with old binutils
638caf3000 aarch64: Improve strncmp for mutually misaligned inputs
d5f45a29ff aarch64/strcmp: fix misaligned loop jump target
7f690fafad aarch64: Improve strcmp unaligned performance
40df047b3b aarch64: Fix branch target to loop16
062139f233 aarch64: Optimized memcmp for medium to large sizes
f3e2add213 aarch64: Use the L() macro for labels in memcmp
22bd3ab40e posix: Fix large mmap64 offset for mips64n32 (BZ#24699)
bdd16894aa aarch64: handle STO_AARCH64_VARIANT_PCS
0b48caab9a aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS
949da7f2fd io: Remove copy_file_range emulation [BZ #24744]
f056ac8363 libio: do not attempt to free wide buffers of legacy streams [BZ #24228]
5f90e009b1 NEWS: add entries for bugs 22964, 24180, and 24531

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Adrian Schmutzler 6e24df296c ath79: add support for TP-Link TL-WDR4300 v1 (IL)
The TL-WDR4300 v1 sold in Israel has a different TPLINK_HWID.

Thanks to Josh4300 for testing on device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit c642a97aa6)
5 years ago
Adrian Schmutzler 52c9f95178 ramips: allow JCG_MAXSIZE in kiB in Build/jcg-header
This allows JCG_MAXSIZE to be specified in kilobytes. This makes
this value more consistent and easier comparable with other size
variables.

This also changes the only occurence of the variable, for Cudy WR1000.

This is backported to 19.07 for convenience, as other developers
backporting device support might not be aware that JCG_MAXSIZE in
kilobytes would not work there.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 0bf4d681d4)
5 years ago
Olli Asikainen e33a123140 brcm47xx: add switch configuration for WNR3500L
Netgear WNR3500L is an already supported device, but out of the
box, the device has no switch configuration and there is no wan.
The correct configuration for this specific model is similar to
some other models. This simple commit adds the correct switch
and the out-of-the-box experience is improved.

Experimentally determined:

Port 0 => WAN
Port 1..4 => LAN
Port 5..7 => unused
Port 8 => CPU

Signed-off-by: Olli Asikainen <olli.asikainen@gmail.com>
Tested-by: Fabian Zaremba <fabian@youremail.eu>
[added port mapping to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit deb835849a)
5 years ago
Martin Schiller d1d84da1c3 ramips: fix number of LAN Ports for Mikrotik RBM33G
The Mikrotik RBM33G has only 2 LAN ports.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
[moved node in 02_network to maintain alphabetic sorting; backport]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 3a55c7935d)
5 years ago
Walter Sonius fa700ed714 ramips: fix switch port order for TP-Link Archer C20i
Physical port order watched from the backside of the C20i
(from left to right) is: Internet / 1 / 2 / 3 / 4

Physical Port	Switch port
WAN             0
LAN 3           1
LAN 4           2
LAN 1           3
LAN 2           4
(not used)      5
CPU             6

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[commit message/title improvements; backport to 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a065cd29bf)
5 years ago
Koen Vandeputte 0bb4733e67 ath10k-firmware: update Candela Tech firmware images
The release notes since last time for wave-1:

  *  November 29, 2019:  Fix IBSS merge issue, related to TSF id leakage bug in firmware code.
                         Thanks for Ahmed Zaki @ Mage-Networks for helping to diagnose and test.

The release notes since last time for wave-2:

  *  December 6, 2019:  Fix 160Mhz problem caused by logic that did not take into account the fact that
                        160Mhz has only 1/2 of the NSS of lower bandwidths in the rate table.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 30109782df3c74becd60dd13216346e1ea2fcc96)
5 years ago
Koen Vandeputte c3cc419cc6 kernel: bump 4.14 to 4.14.158
Refreshed all patches.

Altered patches:
- 400-mtd-add-rootfs-split-support.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Santiago Piccinini d2d12346e8 mac80211: unify setup of iw htmode for mesh and adhoc
This also fixes mac80211_prepare_vif iw set channel in monitor or
mesh mode.

Signed-off-by: Santiago Piccinini <spiccinini@altermundi.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[daniel@makrotopia.org: fixed commit message]
(cherry picked from commit c7fb12beb1)
5 years ago
Daniel Golle 06bf1a9b67 ucert: update to latest git HEAD
e4bd927 cast ucert_argv to proper type when passing to execv

Fixes warnings:

warning: passing argument 2 of 'execv' from incompatible pointer type
[-Wincompatible-pointer-types]
  254 |       execv(usign_argv[0], usign_argv)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 9c272dd3e4)
5 years ago
Hauke Mehrtens d74526c1c5 OpenWrt v19.07.0-rc2: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens 628e996928 OpenWrt v19.07.0-rc2: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
David Bauer db8345d8e4 generic ar8xxx: increase VLAN table for AR83x7
The Atheros AR8327 and AR8337 have (according to their datasheet) a
VLAN table with a maximum of 4096 entries.

Currently, there's a hard limit of 128 VLANs, which is the same as
for most other Atheros switches. Increase this limit only for the
AR83x7 series and modify some shared functions to allow them to work
with a variable max VLAN count.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3f79aaa297)
5 years ago
Satadru Pramanik cde70954ef busybox: add glibc dependency for vi regex option
Build with musl libc fails with BUSYBOX_DEFAULT_FEATURE_VI_REGEX_SEARCH
enabled. Enabling BusyBox's vi regex search option depends upon GNU
regex.  Musl libc does not support GNU regex[1].

So this patch adds explicit dependency on GNU libc and while at it
remove the FIXME comment.

1. https://wiki.musl-libc.org/functional-differences-from-glibc.html

Ref: https://dev.archive.openwrt.org/ticket/21741.html
Ref: https://forum.openwrt.org/t/busybox-not-compiling/
Ref: https://github.com/openwrt/packages/issues/4453
Signed-off-by: Satadru Pramanik <satadru@umich.edu>
[commit subject/description tweaks, From: fix, USE_GLIBC fix, removed comments]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f1410902e6)
5 years ago
Hauke Mehrtens a4d798e8dd usign: Activate LTO compile option
This decreases the size of the usign application by 16% on MIPS BE.

old:
24,597 /usr/bin/usign

new:
20,501 /usr/bin/usign

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6ffd8a8f92)
5 years ago
Hauke Mehrtens 1fc05c3115 swconfig: Activate LTO compile option
This decreases the size of the swconfig application by 25% on MIPS BE.

old:
16,916 /sbin/swconfig

new:
12,565 /sbin/swconfig

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e926681387)
5 years ago
Hauke Mehrtens 5cb845ebfe mtd: Activate LTO compile option
This decreases the size of the mtd application by 25% on MIPS BE.

old:
20,597 /sbin/mtd

new:
16,421 /sbin/mtd

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1eb34b7287)
5 years ago
Jo-Philipp Wich c38074de92 ramips: disable ZyXel Keenetic by default
Disable the ZyXel Keenetic images by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 432a349761 ramips: disable WR512-3GN 4MB variant by default
Disable the WR512-3GN 4MB image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 67aca5f0ae ramips: disable A5-V11 by default
Disable the A5-V11 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich eb836ea8e9 ar71xx: disable TP-Link TL-WA855RE by default
Disable the TP-Link TL-WA855RE image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 59ef47ae2c brcm47xx: disable Linksys E1000 v1 by default
Disable the Linksys E1000 v1 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/72
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 7232d9247e ramips: disable TP-Link TL-WA750RE by default
Disable the TP-Link TL-WA750RE image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/30
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 531ab59804 ar71xx: disable TP-Link TL-WA850RE by default
Disable the TP-Link TL-WA850RE image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/30
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 634db7930a ramips: disable TP-Link TL-WR840N v5 by default
Disable the TP-Link TL-WR840N v5 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/29
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 6a124efb99 ramips: disable Sitecom WL-351 by default
Disable the Sitecom WL-351 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/24
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 2607c02ed5 ramips: disable D-Link DIR-645 by default
Disable the D-Link DIR-645 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/23
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 02fc43b4b4 ramips: disable D-Link DIR-300 B5/B6/B7 by default
Disable the D-Link DIR-300 B5/B6/B7 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/18
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 0686418338 ar71xx: disable Netgear WNR2000v4 by default
Disable the Netgear WNR2000v4 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/11
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 6af348f6a1 ar71xx: disable On Networks N150R by default
Disable the On Networks N150R image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/10
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich c65f09b641 ar71xx: disable TP-Link TL-WA850RE v2 by default
Disable the TP-Link TL-WA850RE v2 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/9
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 1793baee46 ar71xx: disable Netgear WNR612 v2 by default
Disable the Netgear WNR612 v2 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/4
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 4b759caf51 ramips: disable ASUS RT-N10+ B1 by default
Disable the ASUS RT-N10+ B1 image by default as the device has
insufficient flash space for release build images.

Ref: https://forum.openwrt.org/t/devices-too-big-to-save-overlay/18161/1
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Koen Vandeputte 953d9c384f kernel: bump 4.14 to 4.14.156
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Stijn Tintel 7581a7bebc config: kernel: fix typo in HFSPLUG_FS_POSIX_ACL
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 5f68333952)
5 years ago
Piotr Dymacz 1859391e9e uboot-envtools: ath79: add support for YunCore XD4200 and A782
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 5d2a900163)
5 years ago
Piotr Dymacz 45c9923edf ath79: add support for YunCore XD4200 and A782
YunCore XD4200 ('XD4200_W6.0' marking on PCB) is Qualcomm/Atheros based
(QCA9563, QCA9886, QCA8334) dual-band, Wave-2 AC1200 ceiling AP with PoE
(802.3at) support. A782 model ('T750_V5.1' marking on PCB) is a smaller
version of the XD4200, with similar specification but lower TX power.

Specification:

- QCA9563 (775 MHz)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100/1000 Mbps Ethernet (QCA8334), with 802.3at PoE support (WAN)
- Wi-Fi 2.4 GHz:
  - XD4200: 2T2R (QCA9563), with ext. PA (SKY65174-21) and LNA
  - A782: 2T2R (QCA9563), with ext. FEM (SKY85329-11)
- Wi-Fi 5 GHz:
  - XD4200: 2T2R (QCA9886), with ext. FEM (SKY85728-11)
  - A782: 2T2R (QCA9886), with ext. FEM (SKY85735-11)
- LEDs:
  - XD4200: 5x (2x driven by SOC, 1x driven by AC radio, 2x Ethernet)
  - A782: 3x (1x RGB, driven by SOC and radio, 2x Ethernet)
- 1x button (reset)
- 1x UART (4-pin, 2.54 mm pitch) header on PCB
- 1x DC jack (12 V)

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit e5d4c09667)
5 years ago
Vincent Wiemann 83a18aefbd ath79: add support for YunCore TFTP image generation
YunCore QCA9k based devices released in 2019 require a custom TFTP image
for U-Boot built-in recovery mode (triggered with reset button). Image
has to be prepended with 'YUNCORE' keyword followed by U-Boot CLI
commands which will be executed later. Images without the custom header
will be ignored by U-Boot.

To be able to support both the vendor firmware (QSDK) and OpenWrt flash
layouts, used here commands change the 'bootcmd' before flashing image.

This commit adds generic helper script for YunCore devices with 16 MB of
flash and enables TFTP image generation for A770 model.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[pepe2k@gmail.com: commit description reworded, recipe renamed]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 8016f64864)
5 years ago
Adrian Schmutzler 449433d131 ath79: Add support for TP-Link Archer C60 v2
TP-Link Archer C60 v2 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561 + QCA9886.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed IP address 192.168.0.66
2. Download *-factory.bin image and rename it to tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root
   directory
4. Turn off the router
5. Press and hold reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time the firmware should
   be transferred from the tftp server
8. Wait ~30 second to complete recovery

Flash instruction (under U-Boot, using UART):
tftp 0x81000000 ...-sysupgrade.bin
erase 0x9f030000 +$filesize
cp.b $fileaddr 0x9f030000 $filesize
reset

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 974d6958a7)
5 years ago
Adrian Schmutzler 70233e3afe ath79: Add support for TP-Link Archer C60 v1
TP-Link Archer C60v1 is a dual-band AC1350 router,
based on Qualcomm/Atheros QCA9561+QCA9886.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

Flash instruction (WebUI):
Download *-factory.bin image and upload it via the firmwary upgrade
function of the stock firmware WebUI.

Flash instruction (TFTP):
1. Set PC to fixed ip address 192.168.0.66
2. Download *-factory.bin image and rename it to tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Flash instruction under U-Boot, using UART:
1. tftp 0x81000000 ...-sysupgrade.bin
2. erase 0x9f020000 +$filesize
3. cp.b $fileaddr 0x9f020000 $filesize
4. reset

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6d313da6dc)
5 years ago
Sungbo Eo a2d9de21b8 base-files: config_generate: split macaddr with multiple ifaces
netifd does not handle network.@device[x].name properly if it
contains multiple ifaces separated by spaces. Due to this, board.d
lan_mac setup does not work if multiple ifaces are set to LAN by
ucidef_set_interface_lan.

To fix this, create a device node for each member iface when
running config_generate instead. Those are named based on the
member ifname:

  ucidef_set_interface_lan "eth0 eth1.1"
  ucidef_set_interface_macaddr "lan" "yy:yy:yy:yy:yy:01"

will return

  config device 'lan_eth0_dev'
        option name 'eth0'
        option macaddr 'yy:yy:yy:yy:yy:01'

  config device 'lan_eth1_1_dev'
        option name 'eth1.1'
        option macaddr 'yy:yy:yy:yy:yy:01'

ref: https://github.com/openwrt/openwrt/pull/2542

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[always use new scheme, extend description, change commit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 298814e6be)
5 years ago
Lech Perczak 3a5e28bd26 ar71xx: ubnt-(xm,xw): add rssileds package
In order to make RSSI indicator on the device work out of box,
include "rssileds" package in per-device rootfs image by default
for Ubiquiti XM and XW devices, namely:
- Bullet M (XM/XW)
- Rocket M (XM/XW)
- Nanostation M (XM/XW)
- Nanostation Loco-M (XW)

This moves the package addition to the individual devices in order
to prevent accidental inclusions of the package when not looking
at the parent node carefully enough.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[add bullet-m-xw, remove rocket-m-ti, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 08d9c95417)
5 years ago
Adrian Schmutzler 1cb763c559 ath79: add PoE passthrough switch for Ubiquiti Nanostation (XM/XW)
This adds the gpio switch to enable PoE passthrough on Ubiquiti
Nanostation (XM/XW).

Values are copied from the implementation in ar71xx.

GPIO values checked on:
- NanoStation M5 XW
- NanoStation M2 XM

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 317e98a5a2)
5 years ago
Piotr Dymacz a0897f8a46 uboot-envtools: ramips: add support for ALFA Network Quad-E4G
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 10bcf1eb40)
5 years ago
Piotr Dymacz 71469caa0a ramips: add support for ALFA Network Quad-E4G
ALFA Network Quad-E4G is a universal Wi-Fi/4G platform, which offers
three miniPCIe (PCIe, USB 2.0, SIM) and a single M.2 B-key (dual-SIM,
USB 3.0) slots, RTC and five Gigabit Ethernet ports with PoE support.

Specification:

- MT7621A (880 MHz)
- 256/512 MB of RAM (DDR3)
- 16/32+ MB of FLASH (SPI NOR)
- optional second SPI flash (8-pin WSON/SOIC)
- 1x microSD (SDXC) flash card reader
- 5x 10/100/1000 Mbps Ethernet, with passive PoE support (24 V) in LAN1
- optional 802.3at/af PoE module for WAN
- 3x miniPCIe slot (with PCIe and USB 2.0 buses, micro SIM and 5 V)
- 1x M.2/NGFF B-key 3042 (USB 3.0/2.0, mini + micro SIM)
- RTC (TI BQ32002, I2C bus) with backup battery (CR2032)
- external hardware watchdog (EM Microelectronic EM6324)
- 1x USB 2.0 Type-A
- 1x micro USB Type-B for system serial console (Holtek HT42B534)
- 11x LED (5 for Ethernet, 5 driven by GPIO, 1x power indicator)
- 3x button (reset, user1, user2)
- 1x I2C (4-pin, 2.54 mm pitch) header on PCB
- 4x SIM (6-pin, 2.00 mm pitch) headers on PCB
- 2x UART2/3 (4-pin, 2.54 mm pitch) headers on PCB
- 1x mechanical power switch
- 1x DC jack with lock (24 V)

Other:

- U-Boot selects default SIM slot, based on value of 'default_sim' env
  variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This board
  has additional logic circuit for M.2 SIM switching. The 'sim-select'
  will work only if both SIM slots are occupied. Otherwise, always slot
  with SIM inside is selected, no matter 'sim-select' value.
- U-Boot enables power in all three miniPCIe and M.2 slots before
  loading the kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
  U-Boot environment variable)
- all three miniPCIe slots have additional 5 V supply on pins 47 and 49
- the board allows to install up to two oversized miniPCIe cards (vendor
  has dedicated MediaTek MT7615N/D cards for this board)
- this board has additional logic circuit controlling PERSTn pins inside
  miniPCIe slots. By default, PERSTn (GPIO19) is routed to all miniPCIe
  slots but setting GPIO22 to high allows PERSTn control per slot, using
  GPIO23-25 (value is inverted)

Flash instructions:

You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:

1. Power the device with reset button pressed, the modem LED will start
   blinking slowly and after ~3 seconds, when it starts blinking faster,
   you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit e68539aca4)
5 years ago
Piotr Dymacz 939dfe61ed uboot-envtools: ramips: add support for ALFA Network R36M-E4G
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 3cfea3a321)
5 years ago
Piotr Dymacz c515cd7c34 ramips: add support for ALFA Network R36M-E4G
ALFA Network R36M-E4G is a dual-SIM, N300 Wi-Fi, compact size platform
based on MediaTek MT7620A WiSoC. This product is designed for operation
with 4G modem (can be bought in bundle with Quectel EC25, EG25 or EP06)
but supports also Wi-Fi modules (miniPCIe slot has USB and PCIe buses).

Specification:

- MT7620A (580 MHz)
- 64/128/256 MB of RAM (DDR2)
- 16/32+ MB of FLASH (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R 2.4 GHz (MT7620A), with ext. LNA (RFFM4227)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses and optional 5 V)
- 2x SIM slot (mini, micro) with detect and switch driven by GPIO
- 2x u.fl antenna connectors (for Wi-Fi)
- 8x LED (7 driven by GPIO)
- 2x button (reset, wifi)
- 2x UART (4-pin/2.54 mm pitch, 10-pin/1.27 mm pitch) headers on PCB
- 1x I2C (4-pin, 1.27 mm pitch) header on PCB
- 1x LED (8-pin, 1.27 mm pitch) header on PCB
- 1x DC jack with lock (12 V)

Other:

- there is a dedicated, 4-pin connector for optional RTC module (Holtek
  HT138x) with 'enable' input, not available at the time of preparing
  support for this board
- miniPCIe slot supports additional 5 V supply on pins 47 and 49 but a
  jumper resistor (R174) is not installed by default
- U-Boot selects default SIM slot, based on value of 'default_sim' env
  variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This will
  work only if both slots are occupied, otherwise U-Boot will always
  select slot with SIM card inside (user can override it later, in
  user-space)
- U-Boot resets the modem, using PERSTn signal, before starting kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
  U-Boot environment variable)

Flash instruction:

You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:

1. Power the device with reset button pressed, the modem LED will start
   blinking slowly and after ~3 seconds, when it starts blinking faster,
   you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit dfecf94c20)
5 years ago
Piotr Dymacz 7a62e909b2 ramips: support dual image feature on ALFA Network boards
New U-Boot version for MediaTek MT76x8/MT762x based ALFA Network boards
includes support for a 'dual image' feature. Users can enable it using
U-Boot environment variable 'dual_image' ('1' -> enabled).

When 'dual image' feature is enabled, U-Boot will modify DTB and divide
the original 'firmware' flash area into two, equal in size and aligned
to 64 KB partitions: 'firmware' and 'backup'. U-Boot will also adjust
size of 'firmware' area to match installed flash chip size.

U-Boot will load kernel from active partition which is marked with env
variable 'bootactive' ('1' -> first partition, '2' -> second partition)
and rename both partitions accordingly ('firmware' <-> 'backup').

There are 3 additional env variables used to control 'dual image' mode:
- bootlimit   - maximum number of unsuccessful boot tries (default: '3')
- bootcount   - current number of boot tries
- bootchanged - flag which informs that active partition was changed; if
                it is set and 'bootcount' reaches 'bootlimit' value,
                U-Boot will start web-based recovery which then updates
                both partitions with provided image

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit bc173ddd83)
5 years ago
Piotr Dymacz ee71837e38 ramips: refresh all subtargets kernel configs
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Chuanhong Guo 3806899a50 ramips: use upstream RAW_APPENDED_DTB instead of our OWRTDTB
Upstream kernel added support for RAW_APPENDED_DTB on ralink arch
in the following commit:
02564fc89d3d ("ralink: Introduce fw_passed_dtb to arch/mips/ralink")

Use upstream solution and get rid of our OWRTDTB hack.
This commit set DEVICE_DTS to $$(DTS) instead of replacing DTS with
DEVICE_DTS in device profile because DTS variable will be dropped
in later commits.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[Tested on mt7621/mt76x8]
Tested-by: Chuanhong Guo <gch981213@gmail.com>
[Tested on rt305x/mt7620]
Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com>
(cherry picked from commit 7a8d3432c7)
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Stijn Segers f97d2351e2 ath79: remove ath10k drivers from Archer C7 v1 profile
Ath10k packages were removed from ar71xx in master in commit
34113999ef ("ar71xx: Remove ath10k packages from archer-c7-v1 (fixes
FS#1743)") but ath79 in master and the 19.07 branch still suffer from
the issue.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
[commit subject and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Yousong Zhou 7c321e00dd kernel: nf_conntrack_rtcache: fix WARNING on rmmod
Fixes b7c58a1ee ("kernel: nf_conntrack_rtcache: fix cleanup on netns
delete and rmmod")

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit b3779e920e)
5 years ago
Yousong Zhou 2a2f9ffe81 kernel: nf_conntrack_rtcache: fix WARNING on forward path
Fixes b7c58a1ee ("kernel: nf_conntrack_rtcache: fix cleanup on netns
delete and rmmod")

Resolves FS#2624

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 1c5df850a0)
5 years ago
Kamil Wcislo 15ce616c2d
build: add PKG_SOURCE_URL_FILE support
It seems that there is a missing PKG_SOURCE_URL_FILE support.
This little fix adds the support for packages to change the name of the
downloaded file.

Sometimes it is desirable to change the downloaded archive file name, like
for mitigating name conflicts for different packages (some files on the server
could be named like, e.g. 2018-01-01.tar.gz) or for the cases that there is
no name for the file in the URL (e.g. http://someserver.com/download).

Signed-off-by: Kamil Wcislo <kamil.wcislo@lpnplant.io>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 09c428ec6b)
5 years ago
Yousong Zhou 436dbf12aa kernel: nf_conntrack_rtcache: fix cleanup on netns delete and rmmod
Fixes FS#1472, FS#2353, FS#2426

Fixes: b3f95490 ("kernel: generic: Add kernel 4.14 support")
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b7c58a1eeb)
5 years ago
Sebastian Kemper b177b180bb mac80211: add default value for noscan
Commit b3d8b3a introduced a new test:

[ -n "$noscan" -a "$noscan" -gt 0 ] && hostapd_noscan=1

But if length of "$noscan" is zero (noscan is not set) this doesn't stop
the shell to evaluate the rest of the test.

root@hank2:~# [ -n "$noscan" -a "$noscan" -gt 0 ]
ash: out of range
root@hank2:~#

So when radios are brought up this shows in the log:

Sat Nov 23 10:51:38 2019 daemon.info procd: - init complete -
Sat Nov 23 10:52:24 2019 daemon.notice netifd: radio1 (1243): sh: out of range
Sat Nov 23 10:52:25 2019 user.notice firewall: Reloading firewall due to ifup of wan (eth0.2)
Sat Nov 23 10:52:25 2019 daemon.notice netifd: radio0 (1242): sh: out of range
Sat Nov 23 10:52:26 2019 authpriv.info dropbear[1536]: Not backgrounding

This commit sets noscan to 0 if unset and removes the gratuitous length
check, preventing the warning.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry picked from commit 28d84331f4)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Hauke Mehrtens e68d589e7b e2fsprogs: Fix CVE-2019-5094 in libsupport
This adds the following patch from debian:
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?h=debian/stable&id=09fe1fd2a1f9efc3091b4fc61f1876d0785956a8
libsupport: add checks to prevent buffer overrun bugs in quota code

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0062aad8ec)
5 years ago
David Bauer 6160f773fe
ipq40xx: add support for AVM FRITZ!Repeater 1200
Hardware
--------
SoC:   Qualcomm IPQ4019
RAM:   256M DDR3
FLASH: 128M NAND
WiFi:  2T2R IPQ4019 bgn
       2T2R IPQ4019 a/n/ac
ETH:   Atheros AR8033 RGMII PHY
BTN:   1x Connect (WPS)
LED:   Power (green/red/yellow)

Installation
------------

1. Grab the uboot for the Device from the 'u-boot-fritz1200'
   subdirectory. Place it in the same directory as the 'eva_ramboot.py'
   script. It is located in the 'scripts/flashing' subdirectory of the
   OpenWRT tree.

2. Assign yourself the IP address 192.168.178.10/24. Connect your
   Computer to one of the boxes LAN ports.

3. Connect Power to the Box. As soon as the LAN port of your computer
   shows link, load the U-Boot to the box using following command.

   > ./eva_ramboot.py --offset 0x85000000 192.168.178.1 uboot-fritz1200.bin

4. The U-Boot will now start. Now assign yourself the IP address
   192.168.1.70/24. Copy the OpenWRT initramfs (!) image to a TFTP
   server root directory and rename it to 'FRITZ1200.bin'.

5. The Box will now boot OpenWRT from RAM. This can take up to two
   minutes.

6. Copy the U-Boot and the OpenWRT sysupgrade (!) image to the Box using
   scp. SSH into the Box and first write the Bootloader to both previous
   kernel partitions.

   > mtd write /path/to/uboot-fritz1200.bin uboot0
   > mtd write /path/to/uboot-fritz1200.bin uboot1

7. Remove the AVM filesystem partitions to make room for our kernel +
   rootfs + overlayfs.

   > ubirmvol /dev/ubi0 --name=avm_filesys_0
   > ubirmvol /dev/ubi0 --name=avm_filesys_1

8. Flash OpenWRT peristently using sysupgrade.

   > sysupgrade -n /path/to/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 7f187229a8)
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
5 years ago
David Bauer 63b1e8f8d2
ipq-wifi: add AVM FRITZ!Repeater 1200 bdf
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c0f4078164)
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
5 years ago
David Bauer 496489ea95
uboot-fritz4040: update to latest HEAD
f92be9d add support for AVM FRITZ!Repeater 1200
d651302 enable support for Atheros AR8033 PHY
e4c857c add machtype override hack

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 36f43b61a7)
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
5 years ago
Hauke Mehrtens e30ca0d90a mac80211: update to version 4.19.85
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Hauke Mehrtens b1ef0e4437 layerscape: Fix kernel patch
The kernel update added one "+" too much.

Fixes: db345220b4 ("kernel: bump 4.14 to 4.14.155")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens ad0463c2e8 kernel: Add missing configuration option
This was found by the build bot.

Fixes: db345220b4 ("kernel: bump 4.14 to 4.14.155")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 103e49f62e)
5 years ago
Jo-Philipp Wich b0adf79c9e firewall: update to latest Git HEAD
8174814 utils: persist effective extra_src and extra_dest options in state file
72a486f zones: fix emitting match rules for zones with only "extra" options

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 482114d3f7)
5 years ago
Hans Dedecker b416195927 firewall: update to latest git HEAD
daed0cf utils: fix resource leak

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 27bf8abe69)
5 years ago
Koen Vandeputte 3685f86cef cns3xxx: use proper macros for defining partition regions
While at it, also reorder the items for
improved readability.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 6b2f953db346cfb4ddf05654efa3ad7eb84ed99f)
5 years ago
Koen Vandeputte db345220b4 kernel: bump 4.14 to 4.14.155
Refreshed all patches.

Altered patches:
- 707-dpaa-ethernet-support-layerscape.patch

Remove upstreamed:
- 034-v4.20-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch
- 001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch
- 073-qcom-ipq4019-fix-cpu0-s-qcom-saw2-reg-value.patch

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Petr Štetiar 538ca42dda wireless-regdb: fix build when python2 from package feeds exists
wireless-regdb fails to build if there is python2 installed from package
feeds, as staging_dir/hostpkg/bin/python is python2 and
staging_dir/hostpkg/bin takes precedence over staging_dir/host/bin
(proper place with python -> python3 symlink) which leads to the build
failure of wireless-regdb, so this patch makes it explicit which python
should be used.

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Tested-by: Russell Senior <russell@personaltelco.net>
Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b6bae4a2c9)
5 years ago
Kevin Darbyshire-Bryant 2751c5c752 wireless-regdb: fix patch fuzz
Refresh patches to tidy up some fuzz warnings

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 12840674d0)
5 years ago
John Crispin d6ecadb05c wireless-regdb: fix Makefile indentation
Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 8562e77953)
5 years ago
Petr Štetiar 0a4071b550 wireless-regdb: set PKGARCH:=all
As it's an architecture-independent binary file.

Ref: https://github.com/openwrt/openwrt/pull/1521#issuecomment-514687053
Suggested-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 57d1c05ec9)
5 years ago
Petr Štetiar e8d528af7e wireless-regdb: prefer python provided by make variable
Usage of predefined make variables is preferred.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit d3853d17a3)
5 years ago
Hauke Mehrtens 53d8de0207 wireless-regdb: Make it build with python2
This backports a patch to build it work with python2 in addition to
python3.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit d3a8a62692)
5 years ago
Zachary Riedlshah f2ef9b4fea wireless-regdb: update to 2019.06.03
Fixes build issues on a python3 host (issues with the print statement
formatting in the current build).

Includes 100-regdb-write-firmware-file-format-version-code-20.patch and
other fixes.

Closes bugs.openwrt.org/index.php?do=details&task_id=1605.

Uses the tarball as requested.

Signed-off-by: Zachary Riedlshah <git@zacharyrs.me>
(cherry picked from commit ef3f868da0)
5 years ago
Adrian Schmutzler 8fac0b398c ar71xx: fix buttons for TP-Link TL-WDR4900 v2
TP-Link TL-WDR4900 v2 only has one combined WPS/Reset button, so
don't set up an RFKILL for this device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 25127f58b4)
5 years ago
Adrian Schmutzler 3c65c47ce6 ar71xx: fix LED setup for TL-WDR4900 v2
In ar71xx there is only one combined mach file for Archer C5/C7 and
TL-WDR4900 v2. This one uses the same LED struct for all devices,
defining "green" LEDs for them. However, WDR4900 uses blue front
LEDs, while only C5/C7 uses green ones. Despite, in base-files
WDR4900 is actually set up with "blue" for the mentioned LEDs.

Thus, this patch creates a separate LED struct for WDR4900, so the
LEDs can be set up correctly. Despite, the wlan5g LED is removed as
it is controlled by ath9k chip for WDR4900 (in contrast to C5/C7).

Note: While front LEDs are blue, USB LEDs (on the back) are green,
so colors are mixed intentionally for the WDR4900 v2.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 93f2bcc35e)
5 years ago
Sungbo Eo b6c80f85cb ramips: set uImage name of WeVO 11AC NAS and W2914NS v2
The stock firmware and bootloader only accept uImage with names that
match certain patterns. This patch enables OpenWrt installation from
stock firmware without having to reflash the bootloader or access the
UART console.

Installation via web interface:
1.  Flash **initramfs** image through the stock web interface.
2.  Boot into OpenWrt and perform sysupgrade with sysupgrade image.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 19800ac095)
[backported]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler e945c43142 ar71xx: fix MAC address setup for TL-WDR4900 v2
The MAC address setup of the TL-WDR4900 v2 is different from the
C5/C7. This aligns ar71xx with the setup in ath79:

wlan0 (5GHz) : -2
wlan1 (2.4GHz) : -1
eth1 (LAN) : 0
eth0 (WAN) : 1

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a9d3084b83)
5 years ago
Adrian Schmutzler 8a21bc3622 ar71xx: fix MAC addresses for Archer C5 v1, C7 v1/v2, WDR4900 v2
As discussed in 1d18a14a90 ("ath79: really fix TP-Link Archer C7
v2 MAC address"), stock firmware MAC address assignment is
actually as follows:

wlan0 (5GHz) : -1
wlan1 (2.4GHz) : 0
eth1 (LAN) : 0
eth0 (WAN) : 1

This has never been fixed for ar71xx, so let's do it now.
Note that with WDR4900 v2 even both wlan0 and wlan1 where assigned
to basemac-1 before ...

Fixes: FS#408

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a021268032)
5 years ago
Koen Vandeputte ca3339c0fc ipq40xx: fix build error
Add missing brace which was accidentally omitted

Fixes: 3c5c49af8b ("kernel: bump 4.14 to 4.14.154")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 75d11f665c mac80211: backport upstream fixes
This potentially fixes some issues seen on IBSS
when interfaces go out of range and then re-appear.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte dd284c6c57 toolchain/gcc: bump to 7.5.0
This updates the GCC to the next minor release which fixes +213 bugs.
Tested on ARMv6, ARMv7, MIPS R2, x86

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 3c5c49af8b kernel: bump 4.14 to 4.14.154
Refreshed all patches.

Altered patches:
- 902-debloat_proc.patch
- 040-dmaengine-qcom-bam-Process-multiple-pending-descript.patch
- 807-usb-support-layerscape.patch
- 809-flexcan-support-layerscape.patch
- 816-pcie-support-layerscape.patch

Remove upstreamed:
- 303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch

New symbols:
X86_INTEL_MPX
X86_INTEL_MEMORY_PROTECTION_KEYS
CONFIG_X86_INTEL_TSX_MODE_OFF
X86_INTEL_TSX_MODE_ON
X86_INTEL_TSX_MODE_AUTO
SGL_ALLOC

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 ago
Hauke Mehrtens 17d8e47d35 mac80211: Adapt to changes to skb_get_hash_perturb()
The skb_get_hash_perturb() function now takes a siphash_key_t instead of
an u32. This was changed in commit 55667441c84f ("net/flow_dissector:
switch to siphash"). Use the correct type in the fq header file
depending on the kernel version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit eaa047179a)
5 years ago
Rafał Miłecki 67957cd807 mac80211: brcmfmac: fix PCIe reset crash and WARNING
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit cde8c2f2fb)
5 years ago
Adrian Schmutzler a8b293598f ath79: fix sysupgrade from ar71xx for WNDR3700 V2 and WNDR3800(CH)
ar71xx has just one board name "wndr3700" for WNDR3700 V1/V2,
WNDR3800 and WNDR3800CH, whereas ath79 provides separate images for
the boards. So, update SUPPORTED_DEVICES to store the correct
ar71xx board names.

Fixes: FS#2510

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit fc44a8481c)
5 years ago
Roger Pueyo Centelles fe82c71964 ath79: include rssileds package for ubnt devices with LEDs
Some Ubiquiti devices had the RSSI LEDs configured in 01_leds but
were missing the rssileds package, while others that don't have
RSSI LEDS had the package included.

This commit includes the rssileds package only for those devices
that need it.

Tested on a NanoStation M XW.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit 1c6066a867)
[backported to 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Christian Lamparter 960de44fa9 ramips: assign correct key-code to wps buttons
The two ASUS WL-330N and WL-330N3G had the
reset keycode assigned to the WPS button. This patch
changes all three devices to use KEY_WPS_BUTTON in
the hopes that this fixes unwanted restarts/
unexpected behavior from the users point of view.

[dropped RG21S]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit ad65d9d7b2)
5 years ago
Christian Lamparter b50177d151 ath79: remap D-Link DIR-859 A1 WPS button to WPS
The WPS button was mapped to the restart/reset. This patch
changes it to emit the KEY_WPS_BUTTON keycode so pressing
the WPS button does initiate WPS.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 7a7610c21b)
5 years ago
Jo-Philipp Wich 1bd280b1ef ramips: disable D-Link DIR-300 B1 by default
Disable the DIR-300 B1 image by default as the device has insufficient
flash space for release build images.

Fixes: FS#2606
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Petr Štetiar a1ff175dbf ramips: rt3833: fix build breakage
Commit 60f41c6c9e ("ramips: add usb-ledtrig-usbport to DEVICE_PACKAGES
of CY-SWR1100") added stray | during backport which caused build
breakage on the buildbots:

 bash: -c: line 0: syntax error near unexpected token `|'
 bash: -c: line 0: `echo kmod-usb-core kmod-usb-ledtrig-usbport kmod-usb-ohci kmod-usb2 swconfig | | mkhash md5 | head -c 8'

Fixes: 60f41c6c9e ("ramips: add usb-ledtrig-usbport to DEVICE_PACKAGES of CY-SWR1100")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Sungbo Eo 60f41c6c9e ramips: add usb-ledtrig-usbport to DEVICE_PACKAGES of CY-SWR1100
CY-SWR1100 has a USB LED but kmod-usb-ledtrig-usbport is missing
in default images. This commit adds it.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[changed commit title, backported to 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 261c746631)
5 years ago
Sungbo Eo 079b202749 ramips: fix MAC address setup for Samsung CY-SWR1100
Ethernet MAC address setup has been broken since c3e420f28c. Restore
original setting.

Fixes: c3e420f28c ("ramips: Add support for D-Link DCH-M225")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 7231c1edd9)
[backported due to base-files split]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Sungbo Eo 2117f632e3 kernel: fix typo in fb-sys-fops autoload
AutoLoad parameter must match the exact kernel module name. Fix it.

Fixes: 125f1ce9ad ("kernel: video: add DRM core and IMX DRM support for HDMI/LVDS")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 6990510aca)
5 years ago
Kyle Copperfield a6e7f68c7f hostapd: add IEEE 802.11k support
Enables radio resource management to be reported by hostapd to clients.

Ref: https://github.com/lede-project/source/pull/1430
Co-developed-by: Lorenzo Santina <lorenzo.santina@edu.unito.it>
Signed-off-by: Lorenzo Santina <lorenzo.santina@edu.unito.it>
Signed-off-by: Kyle Copperfield <kmcopper@danwin1210.me>
[removed the DMARC crap]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 87f9292300)
5 years ago
Hauke Mehrtens f6111dbeed hostapd: Add mesh support for wpad full
This increases the size of the binary slightly:

old:
427722 wpad-wolfssl_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk
431696 wpad-openssl_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk

new:
442109 wpad-wolfssl_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk
445997 wpad-openssl_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 49cc712b44)
5 years ago
Hauke Mehrtens 0e85b638f7 hostapd: use getrandom syscall
hostapd will not use the getrandom() syscall and as a fallback use
/dev/random, the syscall is supported since Linux 3.17 and in the musl,
glibc and uclibc version used by OpenWrt.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 998686364d)
5 years ago
Hauke Mehrtens 81908622a9 hostapd: Remove unneeded patch
All the content of this function is proceeded by IEEE8021X_EAPOL no code
accesses the ssid variable outside of this ifdef.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0d86bf518a)
5 years ago
Hauke Mehrtens 90a0daf4fe hostapd: use config option CONFIG_NO_LINUX_PACKET_SOCKET_WAR
Instead of patching the workaround away, just use the config option.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 9b4a27455c)
5 years ago
Hauke Mehrtens 5e8d1b52da hostapd: Update to version 2.9 (2019-08-08)
The size of the ipkgs increase a bit (between 0.7% and 1.1%):

old 2019-04-21 (2.8):
288264 wpad-basic_2019-04-21-63962824-1_mipsel_24kc.ipk
256188 wpad-mini_2019-04-21-63962824-1_mipsel_24kc.ipk
427475 wpad-openssl_2019-04-21-63962824-1_mipsel_24kc.ipk
423071 wpad-wolfssl_2019-04-21-63962824-1_mipsel_24kc.ipk

new 2019-08-08 (2.9):
290217 wpad-basic_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk
258745 wpad-mini_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk
431732 wpad-openssl_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk
427641 wpad-wolfssl_2019-08-08-ca8c2bd2-1_mipsel_24kc.ipk

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 167028b750)
5 years ago
Hauke Mehrtens 80b58a9db6 hostapd: Update to version 2.8 (2019-04-21)
This also syncs the configuration files with the default configuration
files, but no extra options are activated or deactivated.

The mesh patches were partially merged into hostapd 2.8, the remaining
patches were extracted from patchwork and are now applied by OpenWrt.
The patches still have open questions which are not fixed by the author.
They were taken from this page:
https://patchwork.ozlabs.org/project/hostap/list/?series=62725&state=*

The changes in 007-mesh-apply-channel-attributes-before-running-Mesh.patch
where first applied to hostapd, but later reverted in hostapd commit
3e949655ccc5 because they caused memory leaks.

The size of the ipkgs increase a bit (between 1.3% and 2.3%):

old 2018-12-02 (2.7):
283337 wpad-basic_2018-12-02-c2c6c01b-11_mipsel_24kc.ipk
252857 wpad-mini_2018-12-02-c2c6c01b-11_mipsel_24kc.ipk
417473 wpad-openssl_2018-12-02-c2c6c01b-11_mipsel_24kc.ipk
415105 wpad-wolfssl_2018-12-02-c2c6c01b-11_mipsel_24kc.ipk

new 2019-04-21 (2.8):
288264 wpad-basic_2019-04-21-63962824-1_mipsel_24kc.ipk
256188 wpad-mini_2019-04-21-63962824-1_mipsel_24kc.ipk
427475 wpad-openssl_2019-04-21-63962824-1_mipsel_24kc.ipk
423071 wpad-wolfssl_2019-04-21-63962824-1_mipsel_24kc.ipk

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
(cherry picked from commit 8af79550e6)
5 years ago
Jo-Philipp Wich e1854815aa hostapd: mirror ieee80211w ap mode defaults in station mode
For AP mode, OpenWrt automatically sets ieee80211w to either 1 or 2, depending
on whether the encryption is set to sae-mixed, or sae/owe/eap suite-b.

Mirror the same defaults for client mode connections, in order to allow an
OpenWrt station to associate to an OpenWrt ap with SAE, OWE or Suite-B encryption
without the need to manually specify "option ieee80211w" on the station.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit abb4f4075e)
5 years ago
Jo-Philipp Wich 3e9b3d0ba9 hostapd: fix OWE settings in client mode
This changes fixes the generation of the wpa_supplicant client configuration
in WPA3 OWE client mode. Instead of incorrectly emitting key_mgmt=NONE, use
the proper key_mgmt=OWE setting instead.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4209b28d23)
5 years ago
Leon M. George eba68342f9 hostapd: declare struct wpa_bss early
wps_supplicant.h assumes that 'struct wpa_bss' is forward declared if
CONFIG_WPS is not defined.  With the later inclusion of
600-ubus_support, the issue manifests in warnings like these:

wps_supplicant.h:113:15: warning: 'struct wpa_bss' declared inside parameter list will not be visible outside of this definition or declaration
        struct wpa_bss *bss)
               ^~~~~~~

This patch forward declares 'struct wpa_bss' regardless.

Signed-off-by: Leon M. George <leon@georgemail.eu>
[commit message facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f974f8213b)
5 years ago
Leon M. George 0fcf02d0a5 hostapd: revert signature change in patch
The original wpa_hexdump uses a 'void *' for the payload.  With patch
410-limit_debug_messages, the signature changes and compiler warnings
occur at various places.  One such warning is:

 wpa_debug.h:106:20: note: expected 'const u8 * {aka const unsigned char *}' but argument is of type 'struct wpa_eapol_key *'

Signed-off-by: Leon M. George <leon@georgemail.eu>
[commit message facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit a123df2758)
5 years ago
Eneas U de Queiroz 047329273b hostapd: adjust removed wolfssl options
This edjusts the selection of recently removed wolfssl options which
have always been built into the library even in their abscence.
Also remove the selection of libwolfssl itself, allowing the library to
be built as a module.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 94d131332b)
5 years ago
Russell Senior d5f509861e base-files: add /usr/share/libubox/jshn.sh to sysupgrade stage2
Discovered recent changes had broken sysupgrade for ar71xx mikrotik
rb-493g, traced the problem to missing /usr/share/libubox/jshn.sh after
switching to tmpfs.

Signed-off-by: Russell Senior <russell@personaltelco.net>
5 years ago
Michal Cieslakiewicz d1fbaa3fbc ath79: update uboot-envtools for Netgear WNR routers
Boards added: WNR1000v2, WNR2000v3, WNR612v2, WNDR3700.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
(cherry picked from commit d47b687006)
[removed WNR1000v2/WNR2000v3 since not supported in 19.07]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler ab29ffbb10 ath79: fix SUPPORTED_DEVICES for TP-Link TL-WR1043ND v3
In ar71xx, the board name for the TL-WR1043ND v3 is equal to v2:
tl-wr1043nd-v2

Fix SUPPORTED_DEVICES for v3 in ath79 accordingly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit b5791118cc)
5 years ago
南浦月 3d840ee798 ar71xx: fix tl-wdr3320-v2 upgrade
Fix the error that tl-wdr3320-v2 can't upgrade firmware via web
interface by using magic_ver="0200" for this device.

Signed-off-by: 南浦月 <nanpuyue@gmail.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 0ff2385a92)
5 years ago
Michal Cieslakiewicz c9e5979dbe ar71xx: update uboot-envtools for Netgear WNR routers
Boards added: WNR1000v2, WNR2000v3, WNR2200, WNR612v2, WNDR4300.
Boards changed: WNDR3700 (u-boot env size is 2 sectors not 1).

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
(cherry picked from commit 1105290049)
5 years ago
Koen Vandeputte 6ac1aa1957 kernel: bump 4.14 to 4.14.152
Refreshed all patches.

Altered patches:
- 301-arch-support-layerscape.patch

Remove upstreamed:
- 950-0311-sc16is7xx-Fix-for-Unexpected-interrupt-8.patch

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 ago
Zoltan HERPAI 5e1864da33 firmware: intel-microcode: bump to 20190918
* New upstream microcode datafile 20190918

      *Might* contain mitigations for INTEL-SA-00247 (RAMBleed), given
      the set of processors being updated.
  * Updated Microcodes:
      sig 0x000306d4, pf_mask 0xc0, 2019-06-13, rev 0x002e, size 19456
      sig 0x000306f4, pf_mask 0x80, 2019-06-17, rev 0x0016, size 18432
      sig 0x00040671, pf_mask 0x22, 2019-06-13, rev 0x0021, size 14336
      sig 0x000406f1, pf_mask 0xef, 2019-06-18, rev 0xb000038, size 30720
      sig 0x00050654, pf_mask 0xb7, 2019-07-31, rev 0x2000064, size 33792
      sig 0x00050657, pf_mask 0xbf, 2019-08-12, rev 0x500002b, size 51200
      sig 0x00050662, pf_mask 0x10, 2019-06-17, rev 0x001c, size 32768
      sig 0x00050663, pf_mask 0x10, 2019-06-17, rev 0x7000019, size 24576
      sig 0x00050664, pf_mask 0x10, 2019-06-17, rev 0xf000017, size 24576
      sig 0x00050665, pf_mask 0x10, 2019-06-17, rev 0xe00000f, size 19456

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
5 years ago
Zoltan HERPAI 8cd24d3256 firmware: intel-microcode: bump to 20190618
* Implements MDS mitigation (RIDL, Fallout, Zombieload), INTEL-SA-00223
    CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
  * Updated Microcodes:
    sig 0x000206d6, pf_mask 0x6d, 2019-05-21, rev 0x061f, size 18432
    sig 0x000206d7, pf_mask 0x6d, 2019-05-21, rev 0x0718, size 19456

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
5 years ago
Zoltan HERPAI a6b30f962c firmware: intel-microcode: bump to 20190514
* New Microcodes:
    sig 0x00030678, pf_mask 0x02, 2019-04-22, rev 0x0838, size 52224
    sig 0x00030678, pf_mask 0x0c, 2019-04-22, rev 0x0838, size 52224
    sig 0x00030679, pf_mask 0x0f, 2019-04-23, rev 0x090c, size 52224
    sig 0x000406c3, pf_mask 0x01, 2019-04-23, rev 0x0368, size 69632
    sig 0x000406c4, pf_mask 0x01, 2019-04-23, rev 0x0411, size 68608
    sig 0x00050657, pf_mask 0xbf, 2019-02-27, rev 0x5000021, size 47104
    sig 0x000806e9, pf_mask 0x10, 2018-10-18, rev 0x009e, size 98304
    sig 0x000806eb, pf_mask 0xd0, 2018-10-25, rev 0x00a4, size 99328
    sig 0x000806ec, pf_mask 0x94, 2019-02-12, rev 0x00b2, size 98304
    sig 0x000906ec, pf_mask 0x22, 2018-09-29, rev 0x00a2, size 98304
    sig 0x000906ed, pf_mask 0x22, 2019-02-04, rev 0x00b0, size 97280

  * Updated Microcodes:
    sig 0x000206a7, pf_mask 0x12, 2019-02-17, rev 0x002f, size 12288
    sig 0x000306a9, pf_mask 0x12, 2019-02-13, rev 0x0021, size 14336
    sig 0x000306c3, pf_mask 0x32, 2019-02-26, rev 0x0027, size 23552
    sig 0x000306d4, pf_mask 0xc0, 2019-03-07, rev 0x002d, size 19456
    sig 0x000306e4, pf_mask 0xed, 2019-03-14, rev 0x042e, size 16384
    sig 0x000306e7, pf_mask 0xed, 2019-03-14, rev 0x0715, size 17408
    sig 0x000306f2, pf_mask 0x6f, 2019-03-01, rev 0x0043, size 34816
    sig 0x000306f4, pf_mask 0x80, 2019-03-01, rev 0x0014, size 18432
    sig 0x00040651, pf_mask 0x72, 2019-02-26, rev 0x0025, size 21504
    sig 0x00040661, pf_mask 0x32, 2019-02-26, rev 0x001b, size 25600
    sig 0x00040671, pf_mask 0x22, 2019-03-07, rev 0x0020, size 14336
    sig 0x000406e3, pf_mask 0xc0, 2019-04-01, rev 0x00cc, size 100352
    sig 0x000406f1, pf_mask 0xef, 2019-03-02, rev 0xb000036, size 30720
    sig 0x00050654, pf_mask 0xb7, 2019-04-02, rev 0x200005e, size 32768
    sig 0x00050662, pf_mask 0x10, 2019-03-23, rev 0x001a, size 32768
    sig 0x00050663, pf_mask 0x10, 2019-03-23, rev 0x7000017, size 24576
    sig 0x00050664, pf_mask 0x10, 2019-03-23, rev 0xf000015, size 23552
    sig 0x00050665, pf_mask 0x10, 2019-03-23, rev 0xe00000d, size 19456
    sig 0x000506c9, pf_mask 0x03, 2019-01-15, rev 0x0038, size 17408
    sig 0x000506ca, pf_mask 0x03, 2019-03-01, rev 0x0016, size 15360
    sig 0x000506e3, pf_mask 0x36, 2019-04-01, rev 0x00cc, size 100352
    sig 0x000506f1, pf_mask 0x01, 2019-03-21, rev 0x002e, size 11264
    sig 0x000706a1, pf_mask 0x01, 2019-01-02, rev 0x002e, size 73728
    sig 0x000806e9, pf_mask 0x10, 2019-04-01, rev 0x00b4, size 98304
    sig 0x000806e9, pf_mask 0xc0, 2019-04-01, rev 0x00b4, size 99328
    sig 0x000806ea, pf_mask 0xc0, 2019-04-01, rev 0x00b4, size 99328
    sig 0x000806eb, pf_mask 0xd0, 2019-03-30, rev 0x00b8, size 98304
    sig 0x000806ec, pf_mask 0x94, 2019-03-30, rev 0x00b8, size 97280
    sig 0x000906e9, pf_mask 0x2a, 2019-04-01, rev 0x00b4, size 99328
    sig 0x000906ea, pf_mask 0x22, 2019-04-01, rev 0x00b4, size 98304
    sig 0x000906eb, pf_mask 0x02, 2019-04-01, rev 0x00b4, size 99328
    sig 0x000906ec, pf_mask 0x22, 2019-02-14, rev 0x00ae, size 98304
    sig 0x000906ed, pf_mask 0x22, 2019-03-17, rev 0x00b8, size 97280
  * Implements MDS mitigation (RIDL, Fallout, Zombieload), INTEL-SA-00223
    CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
5 years ago
Adrian Schmutzler cc598c91c1 ath79: fix identifier for Nanostation M in ath9k caldata extraction
When Nanostation M was renamed from ubnt,nano-m to ubnt,nanostation-m
in commit f1396ac753 ("ath79: align naming of Ubiquiti Nanostation M"),
the caldata extraction in 10-ath9k-eeprom was overlooked.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 5dc535419f)
5 years ago
Jo-Philipp Wich 42aa51a898 rpcd: update to latest Git HEAD
77ad0de plugin: avoid truncating numeric values

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit aa89bdcd04)
5 years ago
Eneas U de Queiroz 6cabbe9646 wolfssl: update to v4.2.0-stable
Many bugs were fixed--2 patches removed here.

This release of wolfSSL includes fixes for 5 security vulnerabilities,
including two CVEs with high/critical base scores:

- potential invalid read with TLS 1.3 PSK, including session tickets
- potential hang with ocspstaping2 (always enabled in openwrt)
- CVE-2019-15651: 1-byte overread when decoding certificate extensions
- CVE-2019-16748: 1-byte overread when checking certificate signatures
- DSA attack to recover DSA private keys

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit f4853f7cca)
5 years ago
Eneas U de Queiroz 9be3501dc3 wolfssl: allow building with hw-crytpo and AES-CCM
Hardware acceleration was disabled when AES-CCM was selected as a
workaround for a build failure.  This applies a couple of upstream
patches fixing this.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit ab19627ecc)
5 years ago
Jo-Philipp Wich 58db9bee0f ustream-ssl: update to latest Git HEAD
c9b6668 ustream-ssl: skip writing pending data if .eof is true after connect

Fixes: CVE-2019-5101, CVE-2019-5102
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 6f9157e6bd)
5 years ago
Hauke Mehrtens 2a09f43ae6 ustream-ssl: Update to latest git HEAD
465f8dc wolfssl: adjust to new API in v4.2.0
3b06c65 Update example certificate & key, fix typo
1c38fd8 wolfssl: enable CN validation
33308ee ustream-io-cyassl.c: fix client-mode connections
79d91aa Remove CyaSSL, WolfSSL < 3.10.4 support

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 57ff06405e)
5 years ago
Hauke Mehrtens d3e11e8ad8 mac80211: Fix dependencies of kmod-rsi91x-usb
Instead of depending on kmod-usb2 make it depend on the normal USB
dependencies. This should hopefully fix some problems seen in the build
bot builds for powerpc_8540.

In addition also activate DRIVER_11N_SUPPORT support.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 3ff3b044c0)
5 years ago
Hauke Mehrtens 69dcd89dcd strace: Fix build on PowerPC
This patch breaks building on PowerPC, like the mpc85xx_generic
target for me.

Fixes: FS#2585
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b01305c8d2)
5 years ago
Hauke Mehrtens 0803b62fc6 uboot-envtools: Add TARGET_LDFLAGS to fix PIE and RELRO
Forward the OpenWrt TARGET_LDFLAGS to the linker of the fw_printenv tool.
In addition also use the more standard make invocation script.
With this change the fw_printenv tool is built with PIE and Full RELRO
support when activated globally in OpenWrt.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
(cherry picked from commit b7b2be0b26)
5 years ago
Rosen Penev 963cee15e8 xfsprogs: Fix compilation with newer musl
Backported upstream patch.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 39035df71c)
5 years ago
David Bauer 5d30ff1bc6 ramips: correct R6220 button flag
All buttons on the Netgear R6220 are active-low while they are flagged
as active-high.

The GPIO status reads the following for no buttons pressed:

root@64367-r6220:~# cat /sys/kernel/debug/gpio
gpio-7   (                    |wps                 ) in  hi
gpio-8   (                    |wifi                ) in  hi
gpio-14  (                    |reset               ) in  hi

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f7f9fe5256ebb660d3160452c3c01a9eb080938f)
5 years ago
Martin Schiller 9834c3dae0 kernel: fix LED netdev trigger on interface rename
This fixes the netdev LED trigger for interfaces, which are renamed
during initialization (e.g. ppp interfaces).

Fixes: FS#2193
Fixes: FS#2239
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit edbadec843)
5 years ago
Etienne Champetier 799de7c641 build: cleanup possibly dangling Python 3 host symlink
When switching from master branch to 19.07 or older, we need to ensure
that Python symlink in staging bin directory points to Python 2.

We can't rely completly just on SetupHostCommand as its executed only in
cases when the $(STAGING_DIR_HOST)/bin/python doesn't already exist, so
we need to remove it before running SetupHostCommand.

This is a cherry-pick of 3b68fb57c9
with python3 instead of python2

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
5 years ago
Etienne Champetier 785d4f3efd build: fixup python SetupHostCommand to use python2
Here is a way to break your build env without this patch:
1) have python point to python3, and no python2
2) start the build, SetupHostCommand will create a symlink
./staging_dir/host/bin/python -> /usr/bin/python
3) build fails on scons because it can't find any python2
4) install python2 and restart the build
5) the build fails on wireless-regdb compile because python is python3 instead of python

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
5 years ago
Josef Schlehofer 502c4a81d3 expat: Update to version 2.2.9
Fixes CVE-2019-15903

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit b4af2c689f)
5 years ago
Josef Schlehofer 9943506816 tools/e2fsprogs: Update to version 1.45.4
Fixes CVE-2019-5094

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 700e7a2eb9)
5 years ago
Hans Dedecker 569bec190c curl: bump to 7.66.0
Refresh patches, for changes in version 7.66.0 see https://curl.haxx.se/changes.html#7_66_0

Fixes CVEs:
    CVE-2019-5481
    CVE-2019-5482

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 71cf4a272c)
5 years ago
Adrian Schmutzler 5fc63ec8a4 ath79: disable building future NAND images for GL-AR300M/GL-AR750S
To simplify the upgrade process and ensure easier identification of
device partitioning, the following devices are disabled on ath79
target in openwrt-19.07 branch:

- glinet,gl-ar300m-nor
- glinet,gl-ar300m-nand
- glinet,gl-ar750s

Proper ath79 (NAND) support for the devices is expected to be
introduced based on kernel 4.19 (see GitHub PR #2184).

In openwrt-19.07, ar71xx should be used for those devices.

With this, we ensure that the new ath79 image names (at least for
releases) refer to the updated partitioning.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
David Bauer 2b4d9b6850 mac80211 ath9k: force QCA953x clock to 25MHz
The QCA953x only supports 25 MHz refclk, however some OEMs set an
invalid bootstrap value for the REF_CLK option, which would break the
clock detection in ath9k.

Force the QCA953x refclk to 25MHz in ath9k, as this is (according to the
datasheet) the only valid frequency.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 4c6fe32468)
5 years ago
Adrian Schmutzler b3514e3569 ar71xx: improve support for TP-Link CPE510 v2
This fixes commit bae927c551 ("ar71xx: add support for TP-LINK CPE510
V2.0") where the support for this device wasn't optimal.

Device support for the CPE510v2 so far has been a hack to enable
flashing with CPE510v1 images. Those even have different hardware (e.g.
additional ethernet port).

With this patch, we provide proper support for this device in ar71xx.

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

Fixes: bae927c551 ("ar71xx: add support for TP-LINK CPE510 V2.0")
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[Rebased onto revert commit, changed comments in mach-cpe510.c,
changed commit title and description, fixed eth0 MAC address,
removed eth1 initialization]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[squashed revert, added fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c79b796280)
[added CPE510V2 entry to tplink-safeloader.c]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 0c9be4f76b gitignore: ignore patches in OpenWrt root directory
This will have GIT ignore patches in root directory, as created
when using "git format-patch".

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 2c54135598)
5 years ago
Jo-Philipp Wich 112df2ac56 OpenWrt v19.07.0-rc1: revert to branch defaults
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Jo-Philipp Wich 88bff692a5 OpenWrt v19.07.0-rc1: adjust config defaults
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Petr Štetiar c4fdb377a2 Revert "ipq806x: fix EA8500 switch control"
There is a problem with the EA8500, the switch will not work after soft
reboot, the only way to get it working again is to power cycle it
manually.

There are probably several issues in the play, it's quite hard to fix it
without having access to the actual device, so I don't see any other
option now, then revert the offending commit.

Ref: PR#2047
Fixes: FS#2168 ("Switch no longer work after restart on Linksys EA8500")
Reported-by: Adam <424778940z@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 04d6753d03)
5 years ago
Koen Vandeputte d7ea380363 ath10k-firmware: update Candela Tech firmware images
The release notes since last time for wave-1:

  *  October 5,  2019:  Fix too-short msg caused by invalid use of PayloadLen in receive path.
                        This appears to resolve the issue of getting (and ignoring) too-short commands
                        when we detect loss of CE interrupts and go into polling mode.

  *  October 12, 2019:  Fix regression in IBSS mode that caused SWBA overrun issues.  Related to
                        regression added during the ct-station logic, specifically TSF allocation.
                        Thanks for Ahmed Zaki @ Mage-Networks for helping to diagnose and test.

  *  October 15, 2019:  Only send beacon tx completion events if we can detect CT driver is being
                        used (based on CT_STATS_OK flag being set).  This should help CT firmware work
                        better on stock driver.

The release notes since last time for wave-2:

  *  October 15, 2019:  Only send beacon tx completion events if we can detect CT driver is being
                        used (based on ATH10k_USE_TXCOMPL_TXRATE2 | ATH10k_USE_TXCOMPL_TXRATE1 flags being set).
                        This should help CT firmware work better on stock driver.

  *  October 31, 2019:  Compile out peer-ratecode-list-event.  ath10k driver ignores the event.

  *  November 1, 2019:  Fix rate-ctrl related crash when nss and other things were changed while
                        station stays associated.  See bug: https://github.com/greearb/ath10k-ct/issues/96

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit e716e93a2f7290086f49992c9980773c88100c3a)
5 years ago
Jo-Philipp Wich c5d5cdb759 ustream-ssl: backport fix for CVE-2019-5101, CVE-2019-5102
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Daniel Golle 439ac8104b mac80211: rt2x00: backport upstream patches
Import patches from upstream to sync 19.07 with master:
 9f3e3323e996 rt2x00: allow to specify watchdog interval
 2034afe4db4a rt2800: add helpers for reading dma done index
 759c5b599cf4 rt2800: initial watchdog implementation
 09db3b000619 rt2800: add pre_reset_hw callback
 710e6cc1595e rt2800: do not nullify initialization vector data
 e403fa31ed71 rt2x00: add restart hw
 0f47aeeada2a rt2800: do not enable watchdog by default
 41a531ffa4c5 rt2x00usb: fix rx queue hang
 3b902fa811cf rt2x00usb: remove unnecessary rx flag checks
 1dc244064c47 rt2x00: no need to check return value of debugfs_create functions
 706f0182b1ad rt2800usb: Add new rt2800usb device PLANEX GW-USMicroN
 95844124385e rt2x00: clear IV's on start to fix AP mode regression
 567a9b766b47 rt2x00: do not set IEEE80211_TX_STAT_AMPDU_NO_BACK on tx status
 14d5e14c8a6c rt2x00: clear up IV's on key removal
 13fa451568ab Revert "rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band"
 --pending--  rt2800: remove errornous duplicate condition

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
David Bauer d6d9f58290 ipq806x: use switch trigger for WAN LED on NETGEAR boards
With this commit, the WAN LED is triggered by the switch port state
instead of the eth0 netdev.
Otherwise, the LED is always illuminated, regardless of the WAN port
link state.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 70d5989c9c)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer bee28adf6e hostapd: enable PMKSA and OK caching for WPA3-Personal
This enables PMKSA and opportunistic key caching by default for
WPA2/WPA3-Personal, WPA3-Personal and OWE auth types.
Otherwise, Apple devices won't connect to the WPA3 network.

This should not degrade security, as there's no external authentication
provider.

Tested with OCEDO Koala and iPhone 7 (iOS 13.1).

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3034f8c3b8)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Yousong Zhou 5d6308ecae scripts/dl_github_archive.py: fix python3 str, bytes confusion
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit d26738bc76)
5 years ago
Yousong Zhou 22c443c20c uboot-fritz4040: build with ipq40xx "generic" subtarget
Fixes: 853e4dd3 ("ipqx0xx: add Generic subtarget")
Ref: https://forum.openwrt.org/t/ipq40xx-snapshot-not-updated-since-22nd-august/44126
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 40e3f660c1)
5 years ago
Paul Spooren 7407e72399 ipqx0xx: add Generic subtarget
Both targets miss a subtarget causing an image naming style which is
different from other all othe targets, even tho it already uses
`x/generic/` as subfolder as if the subtarget would exist.

This commit adds the Generic subtarget resulting in consistent naming.

    ~/src/openwrt/openwrt/bin/targets/ipq806x/generic$ ls
    openwrt-ipq806x-generic-netgear_d7800-initramfs-uImage
    openwrt-ipq806x-generic-netgear-d7800.manifest
    openwrt-ipq806x-generic-netgear_d7800-squashfs-factory.img
    openwrt-ipq806x-generic-netgear_d7800-squashfs-sysupgrade.bin

CC: John Crispin <john@phrozen.org>

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 853e4dd306)
5 years ago
Roger Pueyo Centelles 9b2a147cfe ramips: enable external amplifier for D-Link DIR-810L
The 2.4 GHz radio had very poor signal reception (-89 dBm for an AP
sitting 5 m away). By enabling the external amplifier, received signal
has improved to -50 dBm for the same AP.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit e667d6f46b)
5 years ago
Jeff Kletsky e539dc2daa ath79: Clean up GL-AR300M DTS/DTSI inclusions
Modify GL-AR300M-Lite and GL-AR300M (NOR):

* Include qca9531_glinet_gl-ar300m.dtsi directly
  rather than qca9531_glinet_gl-ar300m-nor.dts

* Remove redundant inclusion of gpio.h and input.h

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit f5c7fe2ff0)
5 years ago
Adrian Schmutzler 8f0deedc11 ramips: fix WiFi MAC addresses for D-Link DIR-810L
So far, WiFi MAC addresses for this device have been set up from
caldata. However, this returns values which do not look like MAC
addresses. They also do not match stock firmware:

wlan0 (5.0): 00:11:22:00:17:D0 from 0x8004
wlan1 (2.4): 00:11:22:00:17:CD from 0x4 (and 0x2e)

It looks like the only valid MAC address on this device is at 0x28.

So, this patch changes setup to calculate addresses based on the
value at 0x28:

lan: *:0A (flash, label)
wan: *:0B (flash + 1)
wifi2: *:0A (flash)
wifi5: *:0C (flash + 2)

Thanks to Roger Pueyo Centelles <roger.pueyo@guifi.net> for
investigating this on his devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit d1072096f4)
5 years ago
Daniel Engberg f051a967b8 libevent2: Update to 2.1.11
Update libevent to 2.1.11
Use CMake instead GNU Autotools
Backport following commits:
f05ba67193
..and partially
7201062f3e
to fix compilation

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit f351beedfd)
(resolves FS#2435)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Jo-Philipp Wich 466d499d03 rpcd: update to latest Git HEAD
d442d62 plugin: fix double free in finish callback
ee26d83 main: exec_self: make clang analyzer happy
90e40bd file: exec: properly free memory on error
9ecfada uci: free configs list memory on return
32fba36 exec: always call finish_cb to allow plugin to free up memory
ca3e2d5 plugin: do not free method name separately
02c6e1d exec: properly free memory on rpc_exec() error
cc50263 plugin: exec: properly free memory on parse error
bd0ed25 uci: reset uci_ptr flags when merging set operations
37aa919 plugin: fix leaking invoked method name for exec plugins

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c2675bb0ce)
5 years ago
Koen Vandeputte 7f29dc0fda kernel: bump 4.14 to 4.14.151
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 ago
Yousong Zhou 2436e521b4 kernel: mark kmod-usb-serial-wwan as hidden
The kconfig symbol is an invisible one since its introduction.  It is
not supposed to be enabled on its own.

Resolves FS#1821

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 4bf9bec361)
5 years ago
Koen Vandeputte 79e6391600 kernel: bump 4.14 to 4.14.150
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 ago
Felix Fietkau c51a39d4a5 mac80211: add an improved moving average algorithm to minstrel
Improves rate control responsiveness and performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
[reworked to apply on 4.19.79 mac80211 + renumbered + refreshed]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Andreas Ziegler 8cf67728d3 ath79: add support for UniFi AC-LR
The Unifi AC-LR has identical hardware to the Unifi AC-Lite.
The antenna setup is different according to the vendor,
which explains the thicker enclosure.

Therefore, it is helpful to know the exact device variant,
instead of having "Ubiquiti UniFi-AC-LITE/LR".

Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
[fix legacy name in commit message; add old boardname to
SUPPORTED_DEVICES]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 07c1ddf522)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Andreas Ziegler b7ee43ecac ar71xx: add model detection for UniFi AC-LR
This commit adds correct model detection for UniFi
AC-LR. Previously, said device was incorrectly detected
as UniFi-AC-LITE/MESH.

The Information about the device is stored at 0xC in the EEPROM
partition. It corresponds to the sysid in /etc/board.info of the
Ubiquiti stock firmware.

Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
[adjust naming style of target to existing ones]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 2bc7c519dc)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 0e7113e6ec ath10k-firmware: update wave 1 firmware to 10.2.4-1.0-00047
This fixes frequent crashes observed on a UniFi AC Mesh using OpenWrt
master and 19.07. 18.06 seems not affected from our testing.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 641a93f0f2)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 98da3c8cdb ath10k-firmware: retrieve wave 1 firmware from kvalo
This commit changes the source of the Wave 1 ath10k-firmware
from linux-firmware to Kall Valos ath10k-firmware repository.

This is necessary as the firmware selected in linux-firmware produces
frequent crashes in some circumstances.

This patch can be removed as soon as linux-firmware carries
10.2.4-1.0-00047 firmware.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit a3914783a3)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Adrian Schmutzler 8385d121d0 ath79: add LED migration for several Archer Cxx devices
Several Archer Cxx devices were using board-specific LED names in
ar71xx, which were changed to "tp-link:*" in ath79.

This patch adds migration for them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 53e6cc7a81)
5 years ago
Adrian Schmutzler 144379e149 ath79: use board name in LED migrations
Several devices added to LED migration script will just have their
(old) board name converted to tp-link.

By using a variable for this, the amount of code in the migration
script can be reduced and the chance for typos is reduced.

This patch also introduces the marker for beginning of a pattern
"^" to the regex, so the match is more specific.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6b0eb84336)
5 years ago
Adrian Schmutzler 77d8efe80e ath79: fix patching ath9k MAC address for MyNet WiFi Range Extender
The code line patching ath9k MAC address for this device contains
a wrong number of arguments including an unset "$mac", which
looks like a typo or copy/paste mistake.

This has been introduced already in the device support commit
745dee11ac ("ath79: add support for WD My Net Wi-Fi Range
Extender").

This patch just removes the "$mac" argument, leaving a formally
valid line. (No on-device test has been performed.)

Cc: Christian Lamparter <chunkeey@gmail.com>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6b53033783)
5 years ago
Adrian Schmutzler 081d96bece ath79: fix SUPPORTED_DEVICES for ubnt_nanostation-m
The ar71xx images for the Ubiquiti NanoStation M (XM) devices use
"nanostation-m" as board name, but the ath79 images are only
compatible with the "nano-m" board name, so sysupgrade complains.

By changing this additional supported device, sysupgrade smoothly
upgrades from ar71xx to ath79.

Ref: openwrt#2418

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit f473ce6f23)
5 years ago
Roger Pueyo Centelles 77b96c5068 ath79: add SUPPORTED_DEVICES to ubnt_nanostation-m-xw
The ar71xx images for the Ubiquiti NanoStation M (XW) devices use
"nanostation-m-xw" as the board name, but the ath79 images are only
compatible with the "nano-m-xw" board name, so sysupgrade complains.

By adding this additional supported device, sysuspgrade smoothly
upgrades from ar71xx to ath79.

Tested on a NanoStation M (XW) running OpenWrt ar71xx r10250-016d1eb.

Ref: https://github.com/openwrt/openwrt/pull/2418
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
[removed duplicate DEVICE_VARIANT, removed uneeded nano-m-xw support]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 6dda2ea6ad)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Daniel Gimpelevich 24fddfa1be ath79: fix gigabit link pll-data for EX7300
The device did not appear to be reachable unless the connection were
forced to 100Mb or lower. Revert to previously working pll-data.

Also fix the phy-mode to represent the actual state needed for ethernet
to function.

Reported-by: Moritz Schreiber <moritz@mosos.de>
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
[add remark about phy-mode property]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit ee41b602a2)
5 years ago
Masafumi UTSUGI bf800022b2 ipq40xx: essedma: Fix dead lock
edma_read_append_stats() gets called from two places in the driver.
The first place is the kernel timer that periodically updates
the statistics, so nothing gets lost due to overflows.
The second one it's part of the userspace ethtool ioctl handler
to provide up-to-date values.

For this configuration, the use of spin_lock() is not sufficient
and as per:
<https://mirrors.edge.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c214.html>
the locking has to be upgraded to spin_lock_bh().

Signed-off-by: Masafumi UTSUGI <mutsugi@allied-telesis.co.jp>
[folded patch into 710-, rewrote message]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit f1d761f95e)
5 years ago
Eneas U de Queiroz cd1136e550 openssl: Add engine configuration to openssl.cnf
This adds engine configuration sections to openssl.cnf, with a commented
list of engines.  To enable an engine, all you have to do is uncomment
the engine line.

It also adds some useful comments to the devcrypto engine configuration
section.  Other engines currently don't have configuration commands.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit cebf024c4d)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
David Bauer b058da3a7b ath79: correct ar71xx boardname for UniFi AC Lite
This corrects the additional boardname for the image metadata to the one
used in ar71xx. The previously present additional entry was never used
on a running system.

Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 1a256470e7)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer bcb0fd1fa1 mpc85xx: correct TP-LINK TL-WDR4900 MAC addresses
This commit fixes TP-Link TL-WDR4900 v1 MAC address assignment.
Previously, the MAC addrss was read for the ethernet from the "config"
partition. However, the content of this partition is dependent on the
firmware which was previously installed on the device.

Switch the MAC address source to the U-Boot partition, where the MAC
address is always present at a fixed partition. The partition was
previously already used for the WiFi MAC-addresses.

Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 07e555d873)
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
DENG Qingfang e5ab602c69 tcpdump: update to 4.9.3
Fixed CVEs:
	CVE-2017-16808
	CVE-2018-10103
	CVE-2018-10105
	CVE-2018-14461
	CVE-2018-14462
	CVE-2018-14463
	CVE-2018-14464
	CVE-2018-14465
	CVE-2018-14466
	CVE-2018-14467
	CVE-2018-14468
	CVE-2018-14469
	CVE-2018-14470
	CVE-2018-14879
	CVE-2018-14880
	CVE-2018-14881
	CVE-2018-14882
	CVE-2018-16227
	CVE-2018-16228
	CVE-2018-16229
	CVE-2018-16230
	CVE-2018-16300
	CVE-2018-16301
	CVE-2018-16451
	CVE-2018-16452
	CVE-2019-15166
	CVE-2019-15167

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit 394273c066)
5 years ago
DENG Qingfang 8e78bbb7bb libpcap: update to 1.9.1
Fixed CVEs:
	CVE-2018-16301
	CVE-2019-15161
	CVE-2019-15162
	CVE-2019-15163
	CVE-2019-15164
	CVE-2019-15165

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit 44f11353de)
5 years ago
Sungbo Eo 0f3c06b0a5 kernel: fix typos in video KernelPackage description
Fixes: 4b3d17b709 ("kernel: add kmod-fb-sys-ram")
Fixes: b774acb479 ("package/modules: add missing gspca video drivers for 2.6.32 (patch from #6595)")

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 9f73fad359)
5 years ago
Eubert Bao 69586db84b kirkwood: Fix FS#505 - Can't install LEDE on Linksys EA3500
The default sizes render Device/linksys_audi mage un-flashable.
Restore the pagesize, subpagesize, and blocksize for linksys_audi
from https://github.com/openwrt/archive.

Signed-off-by: Eubert Bao <bunnier@gmail.com>
(cherry picked from commit e11fc8439c)
5 years ago
Rosen Penev 5ad47b1ed8 uClibc++: Fix three bugs
The first allows usage of several functions in the std namespace, which
broke compilation of gddrescue specifically with uClibc-ng and uClibc++.

The second allows usage of long long with normal C++11, which is part of
the standard. Before, std=gnu++11 needed to be passsed to work around it.

As a result of the second patch, the pedantic patch can safely be removed.

Both patches are upstream backports.

Added -std=c++11 to CFLAGS to guarentee proper inclusion of long long.

Added another patch that fixes a typo with the long long support. Sent to
upstream.

Fixed up license information according to SPDX.

Small cleanups for consistency.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 6ab386c9bc)
5 years ago
Eneas U de Queiroz 82a3beac9d hostapd: adjust to removal of WOLFSSL_HAS_AES_GCM
WolfSSL is always built with AES-GCM support now.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit ee5a3f6d60)
5 years ago
Ali MJ Al-Nasrawy b17c95bbdc trelay: fix deadlock on remove
Upon writing to "remove" file, debugfs_remove_recursive() blocks while
holding rtnl_lock. This is because debugfs' file_ops callbacks are
executed in debugfs_use_file_*() context which prevents file removal.

Fix this by only flagging the device for removal and then do the cleanup
in file_ops.release callback which is executed out of that context.

Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
(cherry picked from commit c2635b871d)
5 years ago
Ali MJ Al-Nasrawy 9784a470bb trelay: handle netdevice events correctly
Since v3.11, netdevice notification data are of type
"struct netdev_notifier_info". Handle it as such!

This should fix a critical bug in which devices are unable get released
because trelay does not release resources in response to UNREGISTER
event spamming the log with something like:

unregister_netdevice: waiting for eth0.1 to become free. Usage count = 1

Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
(cherry picked from commit 77cfc0739d)
5 years ago
leo chung 3b1d71ffd8 bzip2: add linker option LDFLAGS
if gcc not linker whith this LDFLAGS, "file libbz2.so.1.0.8" will
recognize as pie executable ELF file ( which should be shared object).

this because the file command version before 5.36 not recognize
correctly.

Signed-off-by: leo chung <gewalalb@gmail.com>
(cherry picked from commit 56ab58fb6c)
5 years ago
Biwen Li ddff739d15 kernel: layerscape: fix compilation error
This fixes a compilation error as follows:
drivers/staging/fsl_qbman/qman_config.c:815:29: error: bitwise comparison
always evaluates to false [-Werror=tautological-compare]
  if ((qman_ip_rev & 0xFF00) == QMAN_REV31) {

Signed-off-by: Biwen Li <biwen.li@nxp.com>
(cherry picked from commit 53b73131e9)
5 years ago
Ilya Gordeev 8c8212c680 tplink-safeloader: fix compilation warnings
Signed-off-by: Ilya Gordeev <Mirraz@users.noreply.github.com>
(cherry picked from commit 5daf094353)
5 years ago
Hauke Mehrtens cabd12d2e3 mac80211: Update to version 4.19.79
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Paul Spooren 6fe6853d7e build: add buildinfo as single Makefile target
The prepare target was added some 11 years ago to build tools and
toolchain and was recently extended to  create buildinfo files for
reproducibility, meaning {feeds,version,config}.buildinfo.

As the buildbot workflow is more complex than the single prepare (kmod
feed insertion), prepare is only used to create those buildinfo files.
Running prepare however runs `target/compile` as well, taking time even
everything is already compiled.

Splitting this allows the buildbot to run only the `buildinfo` target
while others can still use the convenience feature `prepare`.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 6caf437652)
5 years ago
Christian Franke 3468a4435a lantiq: Fix fw_cutter LzmaWrapper
The destination buffer size `d_len` is passed to `lzma_inflate` as a
pointer. Therefore, it needs to be dereferenced to compare its content.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
(cherry picked from commit d544bc84a0)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Jo-Philipp Wich c987955f82 rpcd: update to latest Git HEAD
95f0973 file: increase minimum read buffer size to 4096 bytes

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2a603cfcfc)
5 years ago
Jo-Philipp Wich d04c07003d rpcd: update to latest Git HEAD
e2a7bc4 iwinfo: add WPA3 support

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d6a405280f)
5 years ago
Jo-Philipp Wich 5bd83825ad rpcd: update to latest Git HEAD
69eeb1b file: refactor message parsing and permission checking
f65527a iwinfo: expose all rate info fields in assoclist reply
7fec636 sys: fix symbol redeclaration
27c24c7 rpcd: sys: actually move timespec declaration
345363b file: add remove operation
604db20 rpcd: Switch to nanosleep

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2f9f8769e3)
5 years ago
Jo-Philipp Wich 07dcbfa6e8 fwtool: do not omit final 16 byte when image does not contain signature
The fwutil command will interpret the final 16 byte of a given firmware
image files as "struct fwimage_trailer".

In case these bytes do look like a valid trailer, we must ensure that we
print them out along with the remainder of the image to not accidentally
truncate non-trailer-images by 16 bytes when they're piped through fwtool,
e.g. as part of an image verification command sequence.

Some command sequences pipe images through fwtool in order to strip any
possible metadata, certificate or signature trailers and do not expect
bare images without any of that metadata to get truncated as other non-
fwtool specific metadata is expected at the end of the file, e.g. an
information block with an md5sum in case of the combined image format.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 889b841048)
5 years ago
Jo-Philipp Wich 180bd75973 iwinfo: update to latest Git HEAD
07315b6 nl80211: handle hidden SSIDs in wpa_supplicant scan results
3ac846e lua: fix string description of mixed WPA3 modes

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit bc61458b73)
5 years ago
Dan Haab f4b1926be0 bcm53xx: sysupgrade: support Luxul NAND devices
This adds support for UBI-aware sysupgrade using Luxul formats.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
(cherry picked from commit 63c43e5674)
5 years ago
Michael Heimpold 6179bf5be1 brcm47xx: fix switch port labels for Asus WL500GP V2
The switch port naming in LuCI does not fit the physical numbers
on the front of this device. Since this is confusing, fix it.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
(cherry picked from commit e56e5a454e)
5 years ago
Koen Vandeputte e8308747a1 gdb: bump to 8.3.1
GDB 8.3.1 brings the following fixes and enhancements over GDB 8.3:

PR c++/20020 (GDB segfault on printing objects)
PR gdb/24454 (nat/x86-linux-dregs.c failed assertion)
PR breakpoints/24541 (Incorrect evaluation of systemtap probes due to register being signed and probe expression assuming unsigned)
PR symtab/24545 (Symbol loading performance regression with cc1)
PR gdb/24592 (amd64->i386 linux syscall restart problem)
PR gdb/25009 (terminate called after throwing an instance of 'srchilite::ParserException')
PR gdb/25010 (Calls to error () can cause SIGTTOU to send gdb to the background)
PR breakpoints/25011 (Breakpoints on file reloads broken for PIE binaries)

This corrective release also brings the following testsuite fixes and
enhancements:

PR testsuite/25005 (gdb-caching-proc.exp takes a lot of time on skip_opencl_tests)
PR testsuite/25016 (Test-case failures for -pie)

GDB 8.3 includes the following changes and enhancements:

* Support for new native configurations (also available as a target configuration):
     - RISC-V GNU/Linux (riscv*-*-linux*)
     - RISC-V FreeBSD (riscv*-*-freebsd*)

* Support for new target configurations:
     - CSKY ELF (csky*-*-elf)
     - CSKY GNU/Linux (csky*-*-linux)
     - NXP S12Z ELF (s12z-*-elf)
     - OpenRISC GNU/Linux (or1k*-*-linux*)

* Native Windows debugging is only supported on Windows XP or later.

* The Python API in GDB now requires Python 2.6 or later.

* GDB now supports terminal styling for the CLI and TUI.
  Source highlighting is also supported by building GDB with GNU
  Highlight.

* Experimental support for compilation and injection of C++ source
  code into the inferior (requires GCC 7.1 or higher, built with
  libcp1.so).

* GDB and GDBserver now support IPv6 connections.

* Target description support on RISC-V targets.

* Various enhancements to several commands:
     - "frame", "select-frame" and "info frame" commands
     - "info functions", "info types", "info variables"
     - "info thread"
     - "info proc"
     - System call alias catchpoint support on FreeBSD
     - "target remote" support for Unix Domain sockets.

* Support for displaying all files opened by a process

* DWARF index cache: GDB can now automatically save indices of DWARF
  symbols on disk to speed up further loading of the same binaries.

* Various GDB/MI enhancements.

* GDBserver on PowerPC GNU/Linux now supports access to the PPR,
  DSCR, TAR, EBB/PMU, and HTM registers.

* Ada task switching support when debugging programs built with
  the Ravenscar profile added to aarch64-elf.

* GDB in batch mode now exits with status 1 if the last executed
  command failed.

* Support for building GDB with GCC's Undefined Behavior Sanitizer.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 04c81498df toolchain/gdb: bump to 8.3.1
GDB 8.3.1 brings the following fixes and enhancements over GDB 8.3:

PR c++/20020 (GDB segfault on printing objects)
PR gdb/24454 (nat/x86-linux-dregs.c failed assertion)
PR breakpoints/24541 (Incorrect evaluation of systemtap probes due to register being signed and probe expression assuming unsigned)
PR symtab/24545 (Symbol loading performance regression with cc1)
PR gdb/24592 (amd64->i386 linux syscall restart problem)
PR gdb/25009 (terminate called after throwing an instance of 'srchilite::ParserException')
PR gdb/25010 (Calls to error () can cause SIGTTOU to send gdb to the background)
PR breakpoints/25011 (Breakpoints on file reloads broken for PIE binaries)

This corrective release also brings the following testsuite fixes and
enhancements:

PR testsuite/25005 (gdb-caching-proc.exp takes a lot of time on skip_opencl_tests)
PR testsuite/25016 (Test-case failures for -pie)

GDB 8.3 includes the following changes and enhancements:

* Support for new native configurations (also available as a target configuration):
     - RISC-V GNU/Linux (riscv*-*-linux*)
     - RISC-V FreeBSD (riscv*-*-freebsd*)

* Support for new target configurations:
     - CSKY ELF (csky*-*-elf)
     - CSKY GNU/Linux (csky*-*-linux)
     - NXP S12Z ELF (s12z-*-elf)
     - OpenRISC GNU/Linux (or1k*-*-linux*)

* Native Windows debugging is only supported on Windows XP or later.

* The Python API in GDB now requires Python 2.6 or later.

* GDB now supports terminal styling for the CLI and TUI.
  Source highlighting is also supported by building GDB with GNU
  Highlight.

* Experimental support for compilation and injection of C++ source
  code into the inferior (requires GCC 7.1 or higher, built with
  libcp1.so).

* GDB and GDBserver now support IPv6 connections.

* Target description support on RISC-V targets.

* Various enhancements to several commands:
     - "frame", "select-frame" and "info frame" commands
     - "info functions", "info types", "info variables"
     - "info thread"
     - "info proc"
     - System call alias catchpoint support on FreeBSD
     - "target remote" support for Unix Domain sockets.

* Support for displaying all files opened by a process

* DWARF index cache: GDB can now automatically save indices of DWARF
  symbols on disk to speed up further loading of the same binaries.

* Various GDB/MI enhancements.

* GDBserver on PowerPC GNU/Linux now supports access to the PPR,
  DSCR, TAR, EBB/PMU, and HTM registers.

* Ada task switching support when debugging programs built with
  the Ravenscar profile added to aarch64-elf.

* GDB in batch mode now exits with status 1 if the last executed
  command failed.

* Support for building GDB with GCC's Undefined Behavior Sanitizer.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 942f020bf4d0f49e4c5586a59ddf21c00e9d8bbe)
5 years ago
Koen Vandeputte f3a265575c kernel: bump 4.14 to 4.14.149
Refreshed all patches.

Altered patches:
- 820-sec-support-layerscape.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 00f96dcddb toolchain/musl: bump to version 1.1.24
1.1.24 release notes

new features:
- GLOB_TILDE extension to glob
- non-stub catgets localization API, using netbsd binary catalog format
- posix_spawn file actions for [f]chdir (extension, pending future standard)
- secure_getenv function (extension)
- copy_file_range syscall wrapper (Linux extension)
- header-level support for new linux features in 5.2

performance:
- new fast path for lrint (generic C version) on 32-bit archs

major internal changes:
- functions involving time are overhauled to be time64-ready in 32-bit archs
- x32 uses the new time64 code paths to replace nasty hacks in syscall glue

compatibility & conformance:
- support for powerpc[64] unaligned relocation types
- powerpc[64] and sh sys/user.h no longer clash with kernel asm/ptrace.h
- select no longer modifies timeout on failure (or at all)
- mips64 stat results are no longer limited to 32-bit time range
- optreset (BSD extension) now has a public declaration
- support for clang inconsistencies in wchar_t type vs some 32-bit archs
- mips r6 syscall asm no longer has invalid lo/hi register clobbers
- vestigial asm declarations of __tls_get_new are removed (broke some tooling)
- riscv64 mcontext_t mismatch glibc's member naming is corrected

bugs fixed:
- glob failed to match broken symlinks consistently
- invalid use of interposed calloc to allocate initial TLS
- various dlsym symbol resolution logic errors
- semctl with SEM_STAT_ANY didn't work
- pthread_create with explicit scheduling was subject to priority inversion
- pthread_create failure path had data race for thread count
- timer_create with SIGEV_THREAD notification had data race getting timer id
- wide printf family failed to support l modifier for float formats

arch-specific bugs fixed:
- x87 floating point stack imbalance in math asm (i386-only CVE-2019-14697)
- x32 clock_adjtime, getrusage, wait3, wait4 produced junk (struct mismatches)
- lseek broken on x32 and mipsn32 with large file offsets
- riscv64 atomics weren't compiler barriers
- riscv64 atomics had broken asm constraints (missing earlyclobber flag)
- arm clone() was broken when compiled as thumb if start function returned
- mipsr6 setjmp/longjmp did not preserve fpu register state correctly

Refreshed all patches.
Removed upstreamed.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Jo-Philipp Wich 4c92859945 iwinfo: update to latest Git HEAD
a29b7d4 nl80211: align path to phy mapping logic with mac80211.sh

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 57b834281b)
5 years ago
Adrian Schmutzler 2155e94d4b ramips: remove memory node for ZBT-WE1326
Memory auto-detection for mt7621 has just been added to 19.07
stable branch.

This removes the memory node for the ZBT-WE1326, which will support
revision 5 that has 256MiB RAM (Nanya NT5CC128M16IP-DI) instead of
512MiB (up to revision 4).

ref: #1930

This is taken from master commit a2c19f1d2f ("ramips: dts: drop
memory nodes"), where _all_ memory nodes were removed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Chuanhong Guo 49c563a829 ramips: mt7621: add support for memory detection
mt7621 has the following memory map:
0x0-0x1c000000: lower 448m memory
0x1c000000-0x2000000: peripheral registers
0x20000000-0x2400000: higher 64m memory

detect_memory_region in arch/mips/kernel/setup.c only add the first
memory region and isn't suitable for 512m memory detection because
it may accidentally read the memory area for peripheral registers.

This commit adds memory detection capability for mt7621:
1. add the highmem area when 512m is detected.
2. guard memcmp from accessing peripheral registers:
     This only happens when some weird user decided to change
     kernel load address to 256m or higher address. Since this
     is a quite unusual case, we just skip 512m testing and return
     256m as memory size.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 6d91ddf517)
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Jo-Philipp Wich e8dc69fcb0 iwinfo: update to latest Git HEAD
Contains following updates squashed from 3 bump commits in master:

02112f9 cli: fix reporting of mixed WPA2/WPA3 versions
7faeaea nl80211: properly detect WEP encryption in wpa_supp scan results
629b5ff nl80211: do not confuse open connections with WEP ones
3d47ddd nl80211: rework hostapd and wpa_supplicant wpa suite parsing
313e827 nl80211: keep awaiting wpa_supplicant scan results on busy response
a766751 nl80211: fix parsing of mixed wpa encryption in wpa_supp scan results
f096bfd utils: support parsing SAE and OWE key management suites from IEs
2a95086 nl80211: recognize SAE encrypted mesh

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Felix Fietkau fcf87d5461 build: adjust gcc/g++ version checks for newer apple compilers
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 46a129194d)
5 years ago
leo chung 53a6aa5164 build: fix xconfig target
`make xconfig` fails with following linking error of qconf binary:

 g++ -lQt5Widgets -lQt5Gui -lQt5Core -o qconf qconf.o zconf.tab.o
 /usr/bin/ld: qconf.o: in function ConfigList::metaObject() const': qconf.cc:(.text+0x3eb): undefined reference to QObjectData::dynamicMetaObject() const'
 /usr/bin/ld: qconf.o: in function `ConfigList::qt_metacast(char const*)': link error.

which is caused by the wrong order of the linked objects/libraries so
this patch reorders the linker's arguments which makes the qconf compile
again.

Signed-off-by: leo chung <gewalalb@gmail.com>
[commit subject and message tweaks, whitespace fix]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b2c55d50f8)
5 years ago
Petr Štetiar f2c321fc07 build: fix host menu config targets using ncurses
On a recent Gentoo Linux installation, invoking `make menuconfig`, `make
kernel_menuconfig` or `make kernel_nconfig` in the build system fails,
whereas for example `make menuconfig` in the kernel tree alone works as
expected.

This is happening because STAGING_PREFIX is not defined when kernel's
{menu,n}config target calls pkg-config from the toolchain/host and thus
pkg-config returns an empty value, and the fallback values in the kernel
config script are applied but those are off and the linking fails.

Solution is to use system's pkg-config for all ncurses based menu config
targets in order to provide proper compiler/linker flags.

Ref: FS#2423
Cc: Thomas Albers <thomas.gameiro@gmail.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
Tested-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 965f341aa9)
5 years ago
Oldřich Jedlička 5e9aae9ef0 kernel: Fix off-by-one error in FIT mtd partition search.
This fixes off-by-one error introduced in commit dc76900021
("kernel: Correctly search for the FIT image in mtd partition.")

Function `mtd_read` starts reading at `offset` and
needs `hdr_len` number of bytes to be available. Suppose
the easiest case when `offset` is `0` and `hdr_len` equals
to `mtd->size` - the `for` loop will not be entered even
when enough bytes are available to be read.

Same happens for any non-zero `offset`, when `hdr_len` is
just enough bytes to be read until `mtd->size` is reached.
Imagine that for example `mtd->size=5`, `offset=4` and
`hdr_len=1`. Then `offset+hdr_len=5` and the check has to
be `offset+hdr_len <= mtd->size`, i.e. `5 <= 5`. The
check for `offset + hdr_len` value needs to be inclusive,
therefore use `<=`.

Fixes: dc76900021 ("kernel: Correctly search for the FIT image in mtd partition.")
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
[adjusted commit ref, fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit e0ce80d42a)
5 years ago
Fredrik Olofsson 4abf456b4a kernel: Correctly search for the FIT image in mtd partition.
Previously all iterations of the loop checked offset=0 in the partition.

Signed-off-by: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
(cherry picked from commit dc76900021)
5 years ago
Johann Neuhauser 830000855e build: make device tree arg really optional in mkits.sh
If no device tree is given there is no node generated, but
the configuration does still include the name of the missing node.
This will result in a successful build fit image, but bootm does
throw a error message if we want to boot the bad configuration.

Signed-off-by: Johann Neuhauser <jneuhauser@dh-electronics.com>
(cherry picked from commit 205e0939f0)
5 years ago
Koen Vandeputte 60ff8bf512 kernel: bump 4.14 to 4.14.148
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte c4b514b200 kernel: bump 4.14 to 4.14.147
Refreshed all patches.

Altered patches:
- 403-mtd_fix_cfi_cmdset_0002_status_check.patch (ar71xx)
- 403-mtd_fix_cfi_cmdset_0002_status_check.patch (ath79)

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte fd82b4fe70 kernel: add missing symbol when enabling PTP support
Discovered by enabling PTP_1588_CLOCK:

net/sched/Kconfig:44: warning: menuconfig statement without prompt
*
* Restart config...
*
*
* PTP clock support
*
PTP clock support (PTP_1588_CLOCK) [Y/n/?] y
Driver for the National Semiconductor DP83640 PHYTER (DP83640_PHY) [N/m/y/?] (NEW)

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte ac1858ddf0 treewide: remove 4.19 leftovers
19.07 branch focuses on kernel 4.14
so remove all remaining 4.19 configs

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Rafał Miłecki b3d70f628b bcm53xx: fix serial console on Luxul XWC-2000
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit fedc5b65dc)
5 years ago
Rafał Miłecki a66dd84758 bcm53xx: fix sysupgrade for Luxul XWC-2000
Use a correct "compatible" value as in the upstream DTS file.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 64b7dbb300)
5 years ago
Rafał Miłecki 047ef4b39a bcm53xx: add pending patch adding Luxul XWC-2000 DTS file
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 06091afada)
5 years ago
Adrian Schmutzler 28d3afc8d6 base-files: use get_mac_binary() in mtd_get_mac_binary_ubi()
The actual retrieval of the MAC address in mtd_get_mac_binary_ubi()
is the same as in get_mac_binary(). Thus, use the latter function
in the former to reduce duplicate code.

This will also allow to benefit from the enhanced path check there
and bring mtd_get_mac_binary_ubi() more in line with the similar
mtd_get_mac_binary().

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 45600124fc)
5 years ago
Tomasz Maciej Nowak 39ae849d0d ath79: image: add supported string for routerstations and ja76pf2
Now that the md5 check is fixed and metadata present, sysupgrade on
ar71xx will complain about device not being supported by the image.
Since the cause is not matching strings for supported devices add them
accordingly.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit a45cf75eca)
5 years ago
Tomasz Maciej Nowak 4e93d17f2a ath79: image: append metadata to routerstations and ja76pf2 images
This target enforces metadata check so add the necessary information. It
was previously removed because md5 sum check. When using these sysupgrade
images on ar71xx target the check would complain about them not matching.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 077d06a1a5)
5 years ago
Tomasz Maciej Nowak 6cdd518eb1 ar71xx: sysupgrade: accept ath79 combined-image
There is md5 sum of whole image embedded in combined-image header which
is checked on sysupgrade. The check will fail for ath79 images which
may have embedded metadata. This is because metadata are appended after
the combined image is created. To allow smooth transition from ar71xx to
ath79, strip metadata before calculating md5 sum for whole image.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit 8b4109c2b4)
5 years ago
Tomasz Maciej Nowak b5a70a3fcd ath79: dts: fix ja76pf2 spi frequency
The frequency was filled acording the information from datasheet for
particular chip (Winbond 25Q128BVFG). Unfortunately this led to
coruption and introduced bad blocks on the chip. Reducing the frequency
to commonly used in ath79, made the board more stable and no new bad
blocks were spoted.

Fixes: b3a0c97 ("ath79: add support for jjPlus JA76PF2")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
(cherry picked from commit c1db564cbc)
5 years ago
Jeff Kletsky 5a0a969e41 ath79: Restore GL.iNet GL-AR300M-Lite first-boot connectivity
The relationship between GMAC0 and GMAC1 and the kernel devices
eth0 and eth1 was reversed for many ath79 devices by commit 8dde11d521
ath79: dts: drop "simple-mfd" for gmacs in SoC dtsi

The GL-AR300M-Lite is a single-port device, with the "LAN" port of the
GL-AR300M board unpopulated and its sole port now referenced as eth1,
as a result of commit 8dde11d521. The device was unreachable on
first boot or fresh config.

By changing &eth1 (GMAC1) to an MFD, GMAC0 is able to associate with
the phy and is known by the kernel as "eth0".

Thanks to Chuanhong Guo for the suggestion of "simple-mfd"

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
(cherry picked from commit b90ea19860853dd538e704e3e4402686c316e43c)
5 years ago
Jeff Kletsky fb5a6d4926 ath79: Correct glinet, gl-ar300m-lite in 02_network
Previously, the board name for the GL-AR300M-Lite was incorrect
in 02_network, resulting in an unintended, fall-through condition
when initializing the network configuration.

While builds prior to commit 8dde11d521 (merged June 5, 2019)
    ath79: dts: drop "simple-mfd" for gmacs in SoC dtsi
functioned properly, the error was noted in resolving first-boot
connectivity issues related to the single-phy nature of the device
and the "swap" of eth0 and eth1 related to that commit.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
(cherry picked from commit 549ea4dc1878d95ee2b752b8840d75a64a67b679)
5 years ago
Eneas U de Queiroz ad07166ea7 ipq806x: remove unsupported hw-crypto qce driver
The following symbols, selected by the qce driver were removed:
	CONFIG_CRYPTO_CBC
	CONFIG_CRYPTO_CTR
	CONFIG_CRYPTO_DES
	CONFIG_CRYPTO_DEV_QCE
	CONFIG_CRYPTO_ECB
	CONFIG_CRYPTO_NULL
	CONFIG_CRYPTO_SEQIV
	CONFIG_CRYPTO_XTS

CONFIG_CRYPTO_GF128MUL was removed as well, since it is only needed by
some cipher modes (LRW, GCM), none of which are selected, and it is
packaged as a module.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
5 years ago
Eneas U de Queiroz 00e4d3e845 ipq40xx: fix hw-crypto detection of qce driver
This adds the CRYPTO_ALG_KERN_DRIVER_ONLY flag to Qualcomm crypto engine
driver algorithms, so that openssl devcrypto can recognize them as
hardware-accelerated.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
[refresh, move to ipq40xx as its the only target right now]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 391b14a892)
5 years ago
Christian Lamparter 7594c5e6dc apm821xx: fix fan control on highest step
This patch removes a typo (extra "0") so that the 'cpu-alert6'
step is triggered once the system reaches 85°C.

Note: Unless the WNDR4700 is placed in an hot oven, the
hardware-monitor will never reach this value.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Felix Fietkau 151bd9ee25 kernel: port upstream nft_flow_offload changes to xt_FLOWOFFLOAD and fix routing issues
Replace an old cleanup patch that never made it upstream with the proper
upstream fix. This patch was incompatible with the recent changes that
affected the way that the flow tuple dst entry was used.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commits 442ecce761 and c8933ce533)
5 years ago
HsiuWen Yen ac04be82c4 netfilter: fix crash in flow offload by adding netns support
Commit fcb41decf6 ("config: enable some useful features on
!SMALL_FLASH devices") enabled netns, which in turn lead to the crash in
the flow offload target.

When the flow offloading framework intends to delete a flow from the
hardware table, it is necessary to retrieve the namespace from
nf_flowtable->ft_net. However, no one ever wrote the namespace into
nf_flowtable->ft_net in advance. So the framework will mistakenly use a
NULL namespace to execute dev_get_by_index_rcu(net, ifindex), leading to
the kernel panic.

Ref: FS#2321
Fixes: fcb41decf6 ("config: enable some useful features on !SMALL_FLASH devices")
Tested-by: Simon Tretter <simon@mediaarchitectu.re>
Signed-off-by: HsiuWen Yen <y.hsiuwen@gmail.com>
[merged patch into offload patch, fix for 4.19, SOB fix, commit subj/msg touches]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry-picked from commit d344591e72)
5 years ago
Rafał Miłecki 9200b4a6a0 brcm47xx: sysupgrade: fix device model detection
$(board_name) was providing content on "boardtype" (and optionally
"boardnum") NVRAM values. That function requires & expects more specific
and detailed model name extracted from the /proc/cpuinfo.

Fixes: f12a32630f ("treewide: use the generic board_name function")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 years ago
David Bauer c7cdbf29c0 uboot-fritz4040: update to 2019-09-07
572ff7f fritzcreator: actually add checksum spacer
6edce1a fritzcreator: replace obscure padding generation with something more portable
2ff189f add ASUS RT-AC58U "easy install" factory u-boot shim
b91f9c2 readd spi-nand support
486ae53 improve cmd_sysupgrade
b0933f1 replace sstrip with strip
882e48a do not include generated files into git
0c5aa5f fix bugs in ipq40xx_cdp.c

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit af63436d2d)
5 years ago
David Bauer a48ed75d6c ipq40xx: abort ar40xx probe on missing PHYs
The ar40xx driver currently panics in case no QCA807x PHY has been
successfully probed. This happens when the external PHY is still
in reset when probing the ar40xx switch driver.

Note that this patch does not fix the root cause, ar40xx_probe now
simply fails instead of causing a kernel panic due to a nullpointer
dereference.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit e2c084cabc)
5 years ago
Koen Vandeputte 92953ae99f ath10k-ct: update to version 2019-09-09
5e8cd86f90da ath10k-ct: Backport ap-vlan code from 5.2 to 4.20 and 4.19 drivers.
0c518586bd7f ath10k-ct: Fix a few warning splats.

Adds AP VLAN.
Refreshed all patches.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Robert Marko 757fd85402 ath10k-firmware: update Candela Tech firmware images
This enables a feature flag in the wave-2 firmware wmi-services indicating it can send
software-encrypted raw frames.  This should in turn allow the AP-VLAN feature to work.

Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 7c930990af)
5 years ago
Koen Vandeputte 8a26f2a0a1 kernel: bump 4.14 to 4.14.146
Refreshed all patches.

Fixes:
- CVE-2019-14814
- CVE-2019-14815
- CVE-2019-14816
- CVE-2019-14821

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 ago
Etienne Champetier d897b32139 kernel: add disable_eap_hack sysfs attribute
We are not sure if 640-bridge-only-accept-EAP-locally.patch is still needed
as a first step, add disable_eap_hack sysfs config to allow to disable it

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit 7d542dc804)
5 years ago
Eneas U de Queiroz b610572a9b openssl: bump to 1.1.1d
This version fixes 3 low-severity vulnerabilities:

- CVE-2019-1547: ECDSA remote timing attack
- CVE-2019-1549: Fork Protection
- CVE-2019-1563: Padding Oracle in PKCS7_dataDecode and
		 CMS_decrypt_set1_pkey

Patches were refreshed.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit d868d0a5d7)
5 years ago
Adrian Schmutzler 0b9f3c28ef ath79: remove invalid uses of ath9k_patch_fw_mac_crc
Some ar9344-based devices are using ath9k_patch_fw_mac_crc, which
is meant to generate a checksum, for fixing their ath9k MAC
addresses.
However, those do not have a checksum field, and the calculated
checksum offset would be negative.

This patch will use ath9k_patch_fw_mac function for those devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit f8d8b3f85d)
5 years ago
Hauke Mehrtens 26c0bec13b hostapd: Fix AP mode PMF disconnection protection bypass
This fixes
* CVE-2019-16275 AP mode PMF disconnection protection bypass
https://w1.fi/security/2019-7/ap-mode-pmf-disconnection-protection-bypass.txt

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit a6981604b3)
5 years ago
Rosen Penev dc076160f9 uClibc++: Remove faulty patch
This patch was originally added to fix compilation with v4l2rtspserver.
Turns out it was v4l2rtspserver that was broken, not uClibc++. This now
causes issues with a different package where the arguments are being
split.

Note that with this patch, shellcheck throws an error:

SC2068: Double quote array expansions to avoid re-splitting elements.

More: https://github.com/openwrt/packages/pull/9972#discussion_r324878373

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 977a8fc5fc)
5 years ago
Magnus Kroken e105d03ee9 mbedtls: update to 2.16.3
Remove 300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch,
the issue has been fixed upstream.

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
(cherry picked from commit 49d96ffc5c)
5 years ago
Daniel Golle 44f32cd5e0 ltq-vdsl-fw: update firmware filename and download URL
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 4fc0a61ed3)
5 years ago
Alberto Bursi e9c16e4e1f kernel: add module for Emulex OneConnect 10Gbit
add module to support Emulex OneConnect
common in 10Gbit SFP+ cards by Dell/HP/IBM
supports OneConnect OCe10xxx OCe11xxx OCe14xxx,
LightPulse LPe12xxx

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
(cherry picked from commit 827f47749b)
5 years ago
Koen Vandeputte cd96cdaa60 kernel: bump 4.14 to 4.14.145
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 ago
Koen Vandeputte d14aa19904 kernel: bump 4.14 to 4.14.144
Refreshed all patches.

Altered patches:
- 816-pcie-support-layerscape.patch

Fixes:
- CVE-2019-15030

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 ago
Jo-Philipp Wich 9cae5a8289 procd: fix invalid JSON filter expression in procd_running()
Since service and instance names may contain characters which are not allowed
in JSON path labels, such as dashes or spaces, change the filter expression
to array square bracket notation to properly match these cases as well.

Fixes: 2c3dd70741 ("procd: add procd_running() helper for checking running state")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c933b6d224)
5 years ago
Jo-Philipp Wich c7e3ca59ab firewall: update to latest Git HEAD
383eb58 ubus: do not overwrite ipset name attribute
c26f890 firewall3: fix typo that affects ICMPv6 rules with numeric icmp_type
487bd0d utils: Fix string format message
4d0c703 firewall3: Fix some format string problems
8c404ef iptables.c: lock the xtables.lock
c1d3a4d utils: implement fw3_lock_path() & fw3_unlock_path()

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[cherry picked and squashed from commits
 7db6559914,
 359bff6052,
 2cf209ce91,
 5ef9e4f107]
Ref: https://forum.openwrt.org/t/fw3-ipset-procd-objects/44044
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Rafał Miłecki ad8b11213a procd: update to the latest git HEAD
62dc8c0 system: sysupgrade: send reply on error
2710c65 system: refuse sysupgrade with backup if it's unsupported

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 04e912d217)
5 years ago
David Bauer 250d57ac29 ramips: add factory image for NETGEAR R6220
This adds an easy-installation factory image for the NETGEAR R6220
router. The factory image can either be flashed via the vendor Web-UI or
the bootloader using nmrpflash.

Tested with NETGEAR V1.1.0.86 firmware.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 607dfdf211)
5 years ago
Dan Haab 11644ec8e1 brcm47xx: sysupgrade: support Luxul firmware format
Allow flashing Luxul devices using vendor firmware format.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
(cherry picked from commit 95240c4933)
5 years ago
Dan Haab f15441384c bcm53xx: sysupgrade: support Luxul firmware format
Allow flashing Luxul devices using vendor firmware format. The next step
will be building proper images once they are conirmed to work.

Signed-off-by: Dan Haab <dan.haab@legrand.com>
(cherry picked from commit bc5db7364d)
5 years ago
Rafał Miłecki bece406c2f mac80211: brcmfmac: backport the last 5.4 changes
This makes brcmfmac use the same wiphy after PCIe reset to help user
space handle corner cases (e.g. firmware crash).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit f39f4b2f6d)
5 years ago
Rafał Miłecki efa2db42b2 ar71xx: fix typo in platform_do_upgrade_compex()
Fixes: a717428828 ("treewide: use new procd sysupgrade $UPGRADE_BACKUP variable")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 63d611390c)
5 years ago
Rafał Miłecki c53a0ed5e3 treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup
Now that $UPGRADE_BACKUP is set conditionally there is no need to check
the $UPGRADE_OPT_SAVE_CONFIG anymore. All conditions can be simplified.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a858db3136)
5 years ago
Rafał Miłecki f69b855a75 procd: update to the latest git HEAD
b8238df sysupgrade: support "backup" attribute

This update requires "sysupgrade" method callers to pass "backup"
attribute if $UPGRADE_BACKUP is used in the project.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 9785a9121d)
5 years ago
Rafał Miłecki 47a5f5c7e7 base-files: sysupgrade: pass "backup" ubus attribute
This explicitly tells procd what backup file should be used during
sysupgrade (if any). It's much more generic this way compared to the
magic /tmp/sysupgrade.tgz file that had to be created before a call.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit c5223b26a4)
5 years ago
Hans Dedecker 0da990b773 odhcpd: retry failed PD assignments on addrlist change
88d9ab6 dhcpv6: retry failed PD assignments on addrlist change

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Felix Fietkau 169bb3d0cb scripts/feeds: fix accepting "-" in feed type string
Fixes a syntax error in processing the type src-git-full

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
David Bauer 0e0f9ff93c ath79: fix UniFi AC LED mapping
The UniFi AC LED mapping is currently off. The blue/white LED are used
as WiFi indicators, while the vendor firmware does not feature WiFI
LEDs.

Instead, the LEDs are used to indicate the devices status. Align the LED
mapping to match the vendor firmware as good as possible.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 18fa749df8)
5 years ago
David Bauer e1cf17b3ba iwinfo: update to latest Git HEAD
a88fb42 iwinfo: add device id for Qualcomm Atheros QCA9886
1b69d86 iwinfo: add device id for Qualcomm Atheros QCA9887

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 7db2f1a71f)
5 years ago
Koen Vandeputte cf3b50377e ar71xx: make IRQ fixes target specific
Move the IRQ fix from generic to ar71xx specific.
Other targets like ath79 have specific pathes to delete this code.
This resulted in a build failure on ath79

Fixes: 00d48bcac0 ("ar71xx: Fix potentially missed IRQ handling during
dispatch")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte febf9de9cf ar71xx: fix potential IRQ misses during dispatch for qca953x
If both interrupts are set in the current implementation
only the 1st will be handled and the 2nd will be skipped
due to the "if else" condition.

Fix this by using the same approach as done for QCA955x
just below it.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 9e8c36557cc0582986862f5a36e17adf6db2b90e)
5 years ago
Koen Vandeputte ca3c7a8868 ar71xx: Fix potentially missed IRQ handling during dispatch
If both interrupts are set in the current implementation
only the 1st will be handled and the 2nd will be skipped
due to the "if else" condition.

Fix this by using the same approach as done for QCA955x
just below it.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 63c0a08d49 kernel: bump 4.14 to 4.14.143
Refreshed all patches.

Remove upstreamed:
- 390-v5.3-net-sched-fix-action-ipt-crash.patch

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 ago
Rafał Miłecki 78d0d13c86 base-files: validate firmware for compatibility with backup
This allows platform code to check if firmware image can be used with
preserving a backup. It may be used e.g. when installing vendor
firmwares that won't restore appended backup archive.

Suggested-by: Luis Araneda <luaraneda@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 1c510fe298)
5 years ago
Rafał Miłecki 3dac34de25 bcm53xx: extend firmware validation
This provides TRX validation result to the validation JSON. It also
prevents users from installing broken firmware files.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit c19b9f9a26)
5 years ago
Rafał Miłecki 87fe1a560a brcm47xx: extend firmware validation
This provides TRX validation result, so final JSON may look like:
{
	"tests": {
		"fwtool_signature": true,
		"fwtool_device_match": true,
		"trx_valid": true
	},
	"valid": true,
	"forceable": true
}

It also prevents users from installing broken firmware files, e.g.:

root@OpenWrt:/# sysupgrade -F -n /tmp/TZ
Image metadata not found
Invalid image type. Please use firmware specific for this device.
Image check failed but --force given - will update anyway!
Commencing upgrade. Closing all shell sessions.
Firmware image is broken and cannot be installed

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit e68c1cebd1)
5 years ago
Rafał Miłecki a717428828 treewide: use new procd sysupgrade $UPGRADE_BACKUP variable
It's a variable set by procd that should replace hardcoded
/tmp/sysupgrade.tgz.

This change requires the most recent procd with the commit 0f3c136
("sysupgrade: set UPGRADE_BACKUP env variable").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 641f6b6c26)
5 years ago
Rafał Miłecki 1b9a4f0cb4 treewide: when copying a backup file always specify dest name
$CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz.
This change makes code more generic and allows refactoring $CONF_TAR.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 62dbe361a1)
5 years ago
Rafał Miłecki 37caec2d5e treewide: don't hardcode "sysupgrade.tgz" file name
1) Add BACKUP_FILE and use it when copying an archive to be restored
   after sysupgrade (on the next preinit).
2) Use CONF_TAR for copying backup prepared by the /sbin/sysupgrade

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit bf39047872)
5 years ago
Yousong Zhou f54bc3985a tools: mkimage: fix __u64 typedef conflict with new glibc
Including "sys/stat.h" from newer glibc will cause __u64 from linux uapi
header to be included, causing compilation failure for u-boot tools
USE_HOSTCC

Remove typedef for __u64 in include/compiler.h to fix the issue.  It should be
safe because as of u-boot-2018.03, no ref to __u64 is found under u-boot tools/
directory

Error message snippet follows

	  HOSTCC  tools/mkenvimage.o
	In file included from /usr/include/asm-generic/types.h:7,
			 from /usr/include/asm/types.h:5,
			 from /usr/include/linux/types.h:5,
			 from /usr/include/linux/stat.h:5,
			 from /usr/include/bits/statx.h:30,
			 from /usr/include/sys/stat.h:446,
			 from tools/mkenvimage.c:21:
	/usr/include/asm-generic/int-ll64.h:31:42: error: conflicting types for '__u64'
	   31 | __extension__ typedef unsigned long long __u64;
	      |                                          ^~~~~
	In file included from <command-line>:
	././include/compiler.h:69:18: note: previous declaration of '__u64' was here
	   69 | typedef uint64_t __u64;
	      |                  ^~~~~
	make[5]: *** [scripts/Makefile.host:116: tools/mkenvimage.o] Error 1

Ref: https://forum.openwrt.org/t/compile-error-19-07/44423
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1699194
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
5 years ago
Koen Vandeputte 3b8239e93e Revert "ar71xx: use platform code for qca955x usb0 init"
This reverts commit af91a370de.

As Piotr Dymacz pointed out:

In QCA MIPS based WiSOCs, for first USB interface,
device/host mode can be selected _only_ in hardware
see description of 57c641ba6e

QCA955x and QCA9563, second USB can be switched to device
mode in software (tested and confirmed on real hardware).

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Tomislav Požega 9ba9a91343 ar71xx: qca955x pci init/reset fixes
Current ar724x code does the reset only on single pci bus, and
in case of qca9558 writes the wrong register (0x10 vs 0x0c).
This change allows the reset of second pci bus, commonly used in
Archer C7 devices, in case host controller is stuck in reset.
If the resetting controller on boot can solve any other issue it
can be enabled unconditionally by removing reset check before
ar724x_pci_hw_init is called.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
[refreshed to apply cleanly]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 76d870871cb12fc0c170e5fd23bce568adfaae6d)
5 years ago
Tomislav Požega a3c3a8c5ab ar71xx: enable ddr wb flush on qca955x
Enable flushing of write buffers on qca955x. GPL code has 0x88 reg
defined for PCI flush which is likely an error since the device
freezes on boot. So use DS default value 0xA8 for PCI flush.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
(cherry picked from commit fe9e702dc94ece2a004f6db68d6fb9a94d9437cb)
5 years ago
Tomislav Požega af91a370de ar71xx: use platform code for qca955x usb0 init
Switch from ci_usb_setup to generic platform initialization of
usb0 port.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
(cherry picked from commit 36a0cfd24be1cb79f221964ed2bfe12b98befff3)
5 years ago
Koen Vandeputte 2cd89cf0d7 kernel: bump 4.14 to 4.4.142
Refreshed all patches.

Remove upstreamed:
- 0032-usb-host-fotg2-restart-hcd-after-port-reset.patch

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 ago
Hauke Mehrtens e8c5e6177d hostapd: SAE/EAP-pwd side-channel attack update
Fixes this security problem:
* SAE/EAP-pwd side-channel attack update
https://w1.fi/security/2019-6/sae-eap-pwd-side-channel-attack-update.txt

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 7bed9bf10f)
5 years ago
Hauke Mehrtens a0c8494704 hostapd: Fix security problem in EAP-pwd
This fixes:
CVE-2019-11555 "EAP-pwd message reassembly issue with unexpected fragment"
https://w1.fi/security/2019-5/eap-pwd-message-reassembly-issue-with-unexpected-fragment.txt

This should not affect OpenWrt in the default settings as we do not use
EAP-pwd.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 9f34bf51d6)
5 years ago
Adrian Schmutzler d889cc9887 ramips: fix ethernet MAC address of ASUS RT-AC57U
This backports the only non-cosmetic fix from 6640e1c368
("ramips: clean and improve MAC address setup in 02_network").

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 79b9bc44d6 ramips: fix duplicate network setup for dlink, dir-615-h1
In 555ca422d1 ("ramips: fix D-Link DIR-615 H1 switch port
mapping"), port setup for dir-615-h1 was changed without removing
the old one. This was working as the new one was triggered earlier
than the old one.

(In the meantine, changed sorting during ramips rename patches
actually inversed that order.)

Anyway, just remove the wrong case now.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit e35e4a996e)
5 years ago
Adrian Schmutzler f9ecee7913 ramips: remove duplicate case for MAC setup of freestation5
ARC FreeStation5 is present twice in MAC address setup.

>From older commits/changes, it is not possible to reconstruct
the correct choice only by reading the annotations.

Thus, remove the second case and keep the first one, so behavior
stays the same (as nobody seems to have complained about it).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit ad4eb2241b)
5 years ago
Rafał Miłecki c7f710e474 mac80211: brcmfmac: backport more kernel 5.4 changes
Patch getting RAM info got upstreamed. A debugging fs entry for testing
reset feature was added.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 681acdcc54)
5 years ago
Hauke Mehrtens 6d2044d62f mt7620: disable image generation for Nexx WT3020 (4MB)
Image generation is currently failing on builbots due to the following
error:

WARNING: Image file openwrt-19.07-snapshot-r10495-db5164d3d0-ramips-mt7620-wt3020-4M-squashfs-factory.bin is too big

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens ccd1335dcc apm821xx: Make patches apply again
This patch was applied to the upstream kernel in version 4.14.135,
remove it from our patches directory.

Fixes: 40379b0ec6 ("apm821xx: fix bogus key-presses on boot")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Jonas Gorski 4c8258c925 Revert "build: remove harmful -nopad option from mksquashfs"
This reverts commit 1c0290c5cc.

Dropping the nopad can make the padding overflow into the next erase
block on devices using a non-aligned rootfs start. This breaks the jffs2
overlay partition with the following messages:

[   30.343877] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
[   30.376512] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[   30.385253] jffs2: empty_blocks 196, bad_blocks 0, c->nr_blocks 197

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
(cherry picked from commit f11d90a76b)
5 years ago
David Bauer 271990321a ipq40xx: fix AVM NAND caldata extraction
The AVM Fritz!Box 7530 (and probably other AVM IPQ4019 NAND devices)
has it's caldata not stored consistently, but instead at currently
3 known possible offsets.

As we get a non-zero exit code from fritz_cal_extract, simply try all
three possible offsets on both bootloader partitions, until a matching
caldata for each radio is found.

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit a6f85b81b7)
5 years ago
Cong Wang 16985d2aab kernel: net_sched: fix a NULL pointer deref in ipt action
The net pointer in struct xt_tgdtor_param is not explicitly
initialized therefore is still NULL when dereferencing it.
So we have to find a way to pass the correct net pointer to
ipt_destroy_target().

The best way I find is just saving the net pointer inside the per
netns struct tcf_idrinfo, which could make this patch smaller.

Fixes: 0c66dc1ea3f0 ("netfilter: conntrack: register hooks in netns when needed by ruleset")
Reported-and-tested-by: Tony Ambardar <itugrok@xxxxxxxxx>
Cc: Jamal Hadi Salim <jhs@xxxxxxxxxxxx>
Cc: Jiri Pirko <jiri@xxxxxxxxxxx>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

[Backport for kernel v4.19 and v4.14]
[Bug Link: https://bugzilla.kernel.org/show_bug.cgi?id=204681]
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 7735cce0c5)
5 years ago
Rafał Miłecki 15292501a1 mvebu: sysupgrade: don't use $ARGV in platform_check_image()
sysupgrade passes image path to platform_check_image() as an argument so
it can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 76e43c82b5)
[rmilecki: dropping ARGV without this change broke sysupgrade]
Fixes: 6ac62c4b6c ("base-files: don't set ARGV and ARGC")
5 years ago
Rafał Miłecki 5ae87c76b7 treewide: sysupgrade: don't use $ARGV in platform_do_upgrade()
stage2 passes image path to platform_do_upgrade() as an argument so it
can be simply accessed using $1

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8b4bc7abe0)
[rmilecki: dropping ARGV without this change broke sysupgrade]
Fixes: 6ac62c4b6c ("base-files: don't set ARGV and ARGC")
5 years ago
Hans Dedecker 986c706cd1 odhcp6c: update to latest git HEAD
e199804 dhcpv6: sanitize oro options

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 1855c23794)
5 years ago
David Bauer db7a1e7c04 ath79: correct OCEDO Ursus phy-mode property
This fixes the previously incorrect phy-mode for the OCEDO Ursus GMAC0.

See 62abbd587d ("ath79: correct various phy-mode properties")
for more details.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 7b137e9df9)
5 years ago
David Bauer 15d84131fe ramips: fix network setup for various NETGEAR boards
There are currently the following issues present for the Netgear R6220,
R6350 and WNDR3700 v5:

 - LAN and WAN MAC-addresses are inverted
 - WAN MAC-address is off. It are +2 compared to the LAN MAC-address
   (R6350 only)
 - Switchport order is inverted in LuCi

This commit fixes both these issues by assigning correct MAC-addresses
to LAN and WAN interfaces and defining the switchports with the correct
labels.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 13937a16d4)
5 years ago
David Bauer f057133349 ramips: use phy trigger for various Netgear boards
This commit switches the default trigger for the WiFi LED from a netdev
trigger on "wlan0" to a wireless-phy based trigger. THis allows the LED
to work, even when the wireless interface is not named "wlan0" without
modifiying the LED settings.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit fa46c9b208)
5 years ago
David Bauer b8b62b8506 ramips: disable badblock shifting for MT7621 NAND
The MediaTek MT7621 NAND driver currently intransparently shifts NAND
pages when a block is marked as bad. Because of this, offsets for e.g.
caldata and MAC-addresses seem to be off.

This is, howeer, not a task for the mtd NAND driver, as the flash
translation layer is tasked with this.

This patch disables this badblock shifting. This fix was originally
proposed by Jo-Philipp Wich at
https://bugs.openwrt.org/index.php?do=details&task_id=1926

Fixes FS#1926 ("MTD partition offset not correctly mapped when bad
eraseblocks present")
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 527832e54b)
5 years ago
Rafał Miłecki afce041e2b treewide: fix invalid UPGRADE_OPT_SAVE_CONFIG spellings
That was a result of accidentally running "sed" twice on some files.

Fixes: 9b9412d55c ("treewide: replace remaining (not working now) $SAVE_CONFIG uses")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 1078de96e3)
5 years ago
Rafał Miłecki 9b9412d55c treewide: replace remaining (not working now) $SAVE_CONFIG uses
This var has been replaced by the $UPGRADE_OPT_UPGRADE_OPT_SAVE_CONFIG

Fixes: f25d164aca ("base-files: pass "save_config" option to the "sysupgrade" method")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 5797fe84a3)
5 years ago
Rafał Miłecki af7c186ead procd: update to the latest git HEAD
0f3c136 sysupgrade: set UPGRADE_BACKUP env variable
0bcbbbf system: fix uninitialized variables in firmware validation code

This update includes a fix for uninitialized variable usage.

Fixes: db5164d3d0 ("procd: update to the latest git HEAD")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit e8dcbbc865)
5 years ago
Rafał Miłecki db5164d3d0 procd: update to the latest git HEAD
34ac88c system: reject sysupgrade of invalid firmware images by default
f55c235 system: reject sysupgrade of broken firmware images
e990e21 system: add "validate_firmware_image" ubus method

This update changes "sysupgrade" ubus method API. It's now required to
pass "force" attribute whenever invalid firmware is meant to be
installed.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 7290963d09)
5 years ago
Rafał Miłecki d7af175321 base-files: pass "force" parameter to the "sysupgrade" call
This makes sysupgrade work with the most recent procd that validates
firmware before proceeding.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b71962da16)
5 years ago
Rosen Penev aa239ceaed upslug2: Update to git repository
This has two improvements over the current version. An autotools fix and
application of the wrt350v2 patch.

Cleaned up Makefile as a result of makefiles being fixed.

Note that this package is not really used as it depends on orion, which is
classified as broken.

This is the last package that uses svn in the tree.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit ac31ec0f62)
5 years ago
Jo-Philipp Wich 068e9210d5 sdk: use bundle-libraries.sh to ship kernel objtool tools
Ensure that the kernel objtool utilities are processed by the library
bundler in order to ensure that they're usable on foreign systems with
different libc versions.

Fixes: a9f6fceb42 ("sdk: fix building external modules when CONFIG_STACK_VALIDATION=y")
Acked-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit efaaadb49e)
5 years ago
Jo-Philipp Wich cf2dba5273 include: kernel-build: pass pkg-config overrides to kernel build
Pass suitable pkg-config overrides to the kernel build process in
order to let our pkg-config wrapper discover libraries provided
by tools/.

This mainly affects the use of libelf which is required for the
CONFIG_STACK_VALIDATION features. So far, the build system either
silently used host system libraries or kbuild simply disabled the
feature due to the lack of a suitable libelf.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit fe43969336)
5 years ago
Jo-Philipp Wich 5aa1b9ad68 tools: libelf: fix headers to trigger -Wundef warnings
When libelf from tools/ is used for building the kernel, compilation
aborts due to access to undefined defines since Kbuild adds -Wundef
to the compiler flags.

Patch the header files to use `#if defined(...)` instead of `#if ...`
to prevent such issues.

Ref: https://github.com/NixOS/nixpkgs/issues/59929
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f3ab336d7c)
5 years ago
Jo-Philipp Wich 2e490e7e46 tools: libelf: install pkg-config file
Install the pkg-config definition for libelf in order to allow the
kernel build process discover it later on.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d3f86c9cc3)
5 years ago
Bjørn Mork 7c811372d8 scripts/feeds: fix 'src-include' directive
Commit 775b70f8d5 renamed parse_file() parameters without
updating the recursive call. This broke parsing of any feeds.conf
using 'src-include'.

 $ scripts/feeds update -a
 Can't use string ("defaults") as a HASH ref while "strict refs" in use at scripts/feeds line 63, <$fh> line 1.

Fixes: 775b70f8d5 ("scripts/feeds: allow adding parameters to feeds")
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit a21b70be31)
5 years ago
Hauke Mehrtens 0d4ab1559a uci: update to latest Git HEAD
415f9e4 uci/file: replace mktemp() with mkstemp()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6aa962a622)
5 years ago
Hauke Mehrtens 5bda748af4 iwinfo: update to latest Git HEAD
f599a8d iwinfo: Fix rate buffer size
71ec9be iwinfo: Fix buffer size
f8ef450 iwinfo: Add support for WPA3

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6658447534)
5 years ago
Thomas Langer 76297c3454 Fix handling of BUILD_SUFFIX in remote-gdb script
When CONFIG_BUILD_SUFFIX is enabled, the target-* folders in build_dir
and staging_dir have this suffix in the name, but not the
toolchain directories. When detecting the names for "arch" and "libc",
also accept the suffix and do not use it for the toolchain path.

Signed-off-by: Thomas Langer <thomas.langer@intel.com>
(cherry picked from commit 035906fd05)
5 years ago
Daniel Engberg 32d27a9017 tools/cmake: Update to 3.15.1
Update CMake to 3.15.1
Refresh patches
Remove inofficial fossies.org and replace with GitHub (link on official site)
Remove 150-C-feature-checks-Match-warnings-more-strictly.patch as it's
a no longer needed backport from upstream.
Disable ccache if GCC is 4.8, 4.9 or 5.X to avoid build failures.
Reference: https://github.com/openwrt/openwrt/pull/1929

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit 413c68d120)
5 years ago
Konstantin Demin 6b5e0eede8 nftables: bump to version 0.9.2
- exclude Python-related stuff from build
- drop patches:
  * 010-uclibc-ng.patch, applied upstream

ipkg size decrease by 2.8%:
old:
194.851 nftables_0.9.0-2_arm_cortex-a7_neon-vfpv4.ipk
new:
189.581 nftables_0.9.2-1_arm_cortex-a7_neon-vfpv4.ipk

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
(cherry picked from commit b74f1f335a)
5 years ago
Konstantin Demin ab0088b239 libnftnl: bump to version 1.1.4
ABI version is same.

The ipkg size increase by about 2.2%:
old:
47.909 libnftnl11_1.1.3-1_arm_cortex-a7_neon-vfpv4.ipk
new:
48.985 libnftnl11_1.1.4-1_arm_cortex-a7_neon-vfpv4.ipk

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
(cherry picked from commit 699955a684)
5 years ago
Jo-Philipp Wich fe34c2538b rpcd: update to latest Git HEAD
821045f file: add path based read/write/exec ACL checks
fb337e5 file: add stat() information to directory listings

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 02169bd3f8)
5 years ago
Eneas U de Queiroz 882052caae uhttpd: add support to generate EC keys
This adds the key_type and ec_curve options to enable the generation of
EC keys during initialization, using openssl or the new options added to
px5g.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 7f2b230b3b)
5 years ago
Eneas U de Queiroz ad4af2b8df px5g: support EC keys
This adds an 'eckey' command to generate an EC key, with an optional
curve name argument, with P-256 as default.

For the 'selfsigned' command, it adds an 'ec' algorithm argument to the
'-newkey' option, and a '-pkeyopt ec_paramgen_curve:<curvename>' option,
mirroring the way openssl specifies the curve name.

Notice that curve names are not necessarily the same in mbedtls and
openssl.  In particular, secp256r1 works for mbedtls, but openssl uses
prime256v1 instead. px5g uses mbedtls, but short NIST curve names P-256
and P-384 are specifically supported.

Package size increased by about 900 bytes (arm).

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit a552ababd4)
5 years ago
Eneas U de Queiroz da10d4a779 openssl: always build with EC support
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit f40262697f)
5 years ago
Rosen Penev 6151609d07 libnfnetlink: Avoid passing both -fPIC and -fpic
Instead, instruct the configure script to use $(FPIC) only.

Mixing -fPIC and -fpic can cause issues on some platforms like PPC.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 926157c2cc)
5 years ago
Rosen Penev aa2980b859 ncurses: Do not pass both -fPIC and -fpic
The configure scripts matches Linux with -fPIC, which is not exactly what
is desired. Since we are already passing $(FPIC), added a CONFIGURE_VAR to
avoid passing -fPIC.

Removed PKG_BUILD_DIR as it is already the default value.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit e2ecf39e8e)
5 years ago
Christian Lamparter 5a102a010f build: remove harmful -nopad option from mksquashfs
While the -nopad option prevents mksquashfs from padding the
image to an arbitrary 4k. It does not take into consideration
that squashfs is programmed to have this 4k padding when it's
being used on on a block device... which is its main "use-case".

Now, after a week long discussion on the ML that included a
back-and-forth between some of the possible options.
But this is likely the best KISS patch to deal with the issue
right away given the limited resources.

From squashfs code point of view, be warned. The 4k padding is
not enough when dealing with devices that have a PAGE_SIZE
bigger than 4k.

if it turns out to be affecting you, then please look-up either:
"FS#2460 - kernel panic reading squashfs from ubi volume" bug
Or the discussion on the OpenWrt-Devel ML in
"amp821xx: use newly added pad-squashfs for Meraki MR24" and
"Squashfs breakage lottery with UBI..."
before making an educated guess.

Note: This will not affect the "tiny"/small flash devices as
much as it seems at first. This is because the the rootfs_data
partition that follows uses jffs2. And it requires to be aligned
to the flash block-size in order to work at all.

So either the involved FSes will meet in the middle as before,
or not at all. But in that latter case the image was already
hoping for the "undefined behaviour" gamble to turn out in its
favour and this is probably why this was unnoticed for so long.

Fixes: FS#2460
Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 1c0290c5cc)
5 years ago
Rafał Miłecki f65080793c base-files: use JSON for storing firmware validation info
So far firmware validation result was binary limited: it was either
successful or not. That meant various limitations, e.g.:
1) Lack of proper feedback on validation problems
2) No way of marking firmware as totally broken (impossible to install)

This change introduces JSON for storing detailed validation info. It
provides a list of performed validation tests and their results. It
allows marking firmware as non-forceable (broken image that can't be
even forced to install).
Example:
{
        "tests": {
                "fwtool_signature": true,
                "fwtool_device_match": true
        },
        "valid": true,
        "forceable": true
}

Implementation is based on *internal* check_image bash script that:
1) Uses existing validation functions
2) Provides helpers for setting extra validation info

This allows e.g. platform_check_image() to call notify_check_broken()
when needed & prevent user from bricking a device.

Right now the new JSON info is used by /sbin/sysupgrade only. It still
doesn't make use of "forceable" as that is planned for later
development.

Further plans for this feature are:
1) Expose firmware validation using some new ubus method
2) Move validation step from /sbin/sysupgrade into "sysupgrade" ubus
   method so:
   a) It's possible to safely sysupgrade using ubus only
   b) /sbin/sysupgrade can be more like just a CLI

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit f522047958)
5 years ago
Jo-Philipp Wich 34002d5c8b scripts/feeds: allow adding parameters to feeds
this allows adding "--" prefixed parameters inside feeds.conf between the
target and name. The first parameter is --force which has the same effect
as using -f when installing any of the packages. This allows creating
feeds that will override base packages by default.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 775b70f8d5)
5 years ago
Hans Dedecker 5f472afa2b procd: fix compile issue with glibc (FS#2469)
0430252 sysupgrade: add missing _GNU_SOURCE define (FS#2469)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 6e45ba4699)
5 years ago
Christian Lamparter 406434affa openssl: refresh patches
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 5ef3fe614c)
5 years ago
Rafał Miłecki 2c77562af8 treewide: sysupgrade: pass "save_partitions" option to the "sysupgrade" method
This explicitly lets stage2 know if partitions should be preserved. No
more "touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap" hack.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b6f4cd57e1)
5 years ago
Rafał Miłecki f25d164aca base-files: pass "save_config" option to the "sysupgrade" method
This explicitly lets stage2 know if config should be preserved.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b534ba9611)
5 years ago
Rafał Miłecki 4e85dc95b0 procd: update to latest git HEAD
9558031 system: support passing "options" to the "sysupgrade" ubus method

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 2b1a6d263c)
5 years ago
Kevin Darbyshire-Bryant 01345bd1f9 firewall: update to latest git HEAD
bf29c1e firewall3: ipset: Handle reload_set properly

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit bd01346bb4)
5 years ago
Luiz Angelo Daros de Luca bc7a755fe6 elfutils: bump to 0.177
200-uclibc-ng-compat.patch is upstream now.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
(cherry picked from commit 0851ce4ff9)
5 years ago
Christian Lamparter dff561c7c8 iftop: update to HEAD of 2018-10-03 - 77901c
Update iftop to commit 77901c8c53e01359d83b8090aacfe62214658183

git log --pretty=oneline --abbrev-commit 949ed0f7..77901c8c

77901c8 Support scales beyond 1Gbps

Created with the help of the make-package-update-commit.sh script.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit cfd0748497)
5 years ago
Hans Dedecker 54db6061ee nghttp2: bump to 1.39.2
957abacf Bump up version number to 1.39.2, LT revision to 32:0:18
83d362c6 Don't read too greedily
a76d0723 Add nghttp2_option_set_max_outbound_ack
db2f612a nghttpx: Fix request stall

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 58f929077f)
5 years ago
Yousong Zhou e7465da11e ltq-ifxos: refer to https://bugs.openwrt.org
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit f0f5cb26cb)
5 years ago
Yousong Zhou e62a6b661f ct-bugcheck: report to https://openwrt.org by default
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 26615ededc)
5 years ago
Yousong Zhou a929c1bad0 download.pl: use https://source.openwrt.org
https://sources.lede-openwrt.org now redirects to there

https://downloads.openwrt.org/sources returns 404, so remove it here

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 0f3667864d)
5 years ago
Luis Araneda 3112703077 u-boot.mk: use openwrt url instead of lede project
The LEDE URL is automatically redirected to the OpenWRT one,
returning an HTTP 301 code (Moved Permanently).

Also, use https, as indicated by the redirect.

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
(cherry picked from commit b39ded4ab7)
5 years ago
Hauke Mehrtens 730befb9e6 ustream-ssl: update to latest git HEAD
e8f9c22 Revise supported ciphersuites
7e9e269 wolfssl, openssl: use TLS 1.3, set ciphersuites

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ced2b7bb98)
5 years ago
Daniel Engberg f7d6579b47 tools/e2fsprogs: Update to 1.45.3
Update e2fsprogs to 1.45.3
Remove OpenBSD patch
Remove Darwin patch, neither macports or brew patches these files
Add patch to avoid crond detection on host OS

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit 234f7a9e5d)
5 years ago
Adrian Schmutzler 8be111d0ac build: fix indent in image-commands.mk
Convert leading spaces to tab to match rest of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 7e5a0da642)
5 years ago
Hauke Mehrtens 8b436c777c hostapd: Allow CONFIG_IEEE80211W for all but mini variant
This commit will activate CONFIG_IEEE80211W for all, but the mini
variant when at least one driver supports it. This will add ieee80211w
support for the mesh variant for example.

Fixes: FS#2397
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1d4df52c21)
5 years ago
Hauke Mehrtens f40f8fe1e7 hostapd: Remove ROBO switch support
The driver was removed from OpenWrt a long time ago.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit f34e825834)
5 years ago
Kevin Darbyshire-Bryant fcab45af13 firewall: improve ipset support
Bump to latest git HEAD

509e673 firewall3: Improve ipset support

The enabled option did not work properly for ipsets, as it was not
checked on create/destroy of a set. After this commit, sets are only
created/destroyed if enabled is set to true.

Add support for reloading, or recreating, ipsets on firewall reload.  By
setting "reload_set" to true, the set will be destroyed and then
re-created when the firewall is reloaded.

Add support for the counters and comment extensions. By setting
"counters" or "comment" to true, then counters or comments are added to
the set.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 51ffce0694)
5 years ago
Jonas Gorski f783ad5b5b build: allow overriding default selection state for devices
Allow overriding the default selection state for Devices, similar to
setting a default for packages.

E.g. by setting DEFAULT to n, they won't be selected by default anymore
when enabling all device in the multi device profile.

This allows preventing images being built by the default config for
known broken devices, devices without enough RAM/flash, or devices not
working with a certain kernel versions.

This does not prevent the devices from being manually selected or images
being built by the ImageBuilder. These devices often still have worth
with a reduced package-set, or as a device for regression testing, when
no better device is available.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
(cherry picked from commit 7546be6007)
5 years ago
Paul Spooren 378b51908c build: add buildinfo files for reproducibility
generate feeds.buildinfo and version.buildinfo in build dir after
containing the feed revisions (via ./scripts/feeds list -sf) as well as
the current revision of buildroot (via ./scripts/getver.sh).

With this information it should be possible to reproduce any build,
especially the release builds.

Usage would be to move feeds.buildinfo to feeds.conf and git checkout the
revision hash of version.buildinfo.

Content of feeds.buildinfo would look similar to this:

    src-git routing https://git.openwrt.org/feed/routing.git^bf475d6
    src-git telephony https://git.openwrt.org/feed/telephony.git^470eb8e
    ...

Content of version.buildinfo would look similar to this:

    r10203+1-c12bd3a21b

Without the exact feed revision it is not possible to determine
installed package versions.

Also rename config.seed to config.buildinfo to follow the recommended
style of https://reproducible-builds.org/docs/recording/

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 454021581f)
5 years ago
Petr Štetiar bdb11c725b sdk: fix GCC and Python dangling symlinks
Force prereq again in SDK in order to fix GCC and Python dangling
symlinks:

 staging_dir/host/bin/g++ -> /builder/ath79_generic/ccache_cxx.sh
 staging_dir/host/bin/gcc -> /builder/ath79_generic/ccache_cc.sh
 staging_dir/host/bin/python -> /usr/bin/python3.5
 staging_dir/host/bin/python3 -> /usr/bin/python3.5

Ref: FS#2424
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 200f2666fb)
5 years ago
Hans Dedecker 6e5e4366fb dnsmasq: use nettle ecc_curve access functions
Fixes compile issues with nettle 3.5.1

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 63ced14048)
5 years ago
Daniel Engberg 40c279b3d9 nettle: Update to 3.5.1
Update (lib)nettle to 3.5.1
Bump ABI_VERSION

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit 9e489b41b5)
5 years ago
Vincent Wiemann afa96d4f61 comgt-ncm: add driver dependencies again
In the commit 623716dd43 ("comgt-ncm: Fix NCM protocol")
the dependencies to vendor NCM drivers were removed, because:

> comgt-ncm should not depend on the USB-serial-related kernel modules,
> as the cdc-wdm control device works without them. There is also no need
> to depend on kmod-huawei-cdc-ncm, since other manufacturers (like
> Ericsson and Samsung) which use other kernel modules should also be
> supported.

From a user-perspective this does not make sense, as installing comgt-ncm
(or luci-proto-ncm) should install all needed dependencies for using such
a device.

Furthermore depending on kmod-huawei-cdc-ncm does not mean that Ericsson
and Samsung devices can't be supported. By the way it seems that Ericsson
and Samsung devices never used NCM, but act as serial modems.

Thus this commit adds the dependencies again.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[fixed title capitalization, formatted commit message,
renamed Sony-Ericsson to Ericsson]
Signed-off-by: David Bauer <mail@david-bauer.net>

(cherry picked from commit ccb4b96b8a)
5 years ago
Chuanhong Guo e2db2df644 gpio-button-hotplug: add volume button handling
This is used by PISEN WMB001N.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 11182349e1)
5 years ago
Hans Dedecker f7b53dfb2a procd: update to latest git HEAD (FS#2425)
8323690 state: fix shutdown when running in a container (FS#2425)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit d9364c1cbc)
5 years ago
Hans Dedecker d2103d3599 netifd: update to latest git HEAD
5e02f94 system-linux: fix resource leak

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit d70a35c365)
5 years ago
Daniel Engberg c55c64e0b4 expat: Update to 2.2.7
Update (lib)expat to 2.2.7

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit 7270fdb62f)
5 years ago
Rosen Penev ad64532334 linux-atm: Add missing headers
This fixes compilation with -Werror=implicit-function-declaration.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 1b1c47577b)
5 years ago
Hauke Mehrtens 930c141b69 toolchain: fix gcc depends on kernel headers
GCC needs the kernel headers to compile.
Some GCC file includes asm/unistd.h which is provided by the kernel headers.
Normally the kernel headers build is very fast and ready before the gcc uses
it, but if it clones the kernel from a slow git repository it takes longer
and then it could be that the gcc already wants to use the kernel headers
before they are available. This patch fixes this problem by adding the
missing dependency.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
(cherry picked from commit b20156ba70)
5 years ago
Jeffery To cc7560eb22 build: include BUILD_VARIANT in PKG_BUILD_DIR
This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into
account (if set), so that packages do not need to manually override
PKG_BUILD_DIR just to handle variants.

This also updates most base packages with variants to use the updated
default PKG_BUILD_DIR.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit e545fac8d9)
5 years ago
Hans Dedecker 3f974a954d ethtool: bump to 5.2
379c096 Release version 5.2.
2bce6d9 ethtool: Add 100BaseT1 and 1000BaseT1 link modes
67ffbf5 ethtool: sync ethtool-copy.h with linux-next from 30/05/2019
687152b ethtool.spec: Use standard file location macros

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 018395392c)
5 years ago
Hans Dedecker 5638375880 firewall: update to latest git HEAD
de94097 utils: coverity resource leak warning

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit efb7b7a12a)
5 years ago
DENG Qingfang 51198ae3cb ipset: update to 7.3
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit edd9b39fab)
5 years ago
Jeffery To 8a7dc58e0e sdk: Fix cryptodev-linux build when CONFIG_ARM64_MODULE_PLTS=y
When CONFIG_ARM64_MODULE_PLTS=y, arch/arm64/kernel/module.lds is
required to build cryptodev-linux. This updates the sdk to include this
file.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 6e300f6a0c)
5 years ago
DENG Qingfang 753f7213b0 ccache: update to 3.7.2
Update ccache to 3.7.2

Release notes:
https://ccache.dev/releasenotes.html#_ccache_3_7_2

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit 2caf747116)
5 years ago
Kevin Darbyshire-Bryant 19a854fdb9 toolchain/fortify-headers: Update to 1.1
Update fortify-headers to 1.1

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit cbe08e6b56)
5 years ago
Petr Štetiar fb99be49f9 autotools.mk: autoreconf: fix missing install-sh
I'm trying to create a package for libgpiod, which uses
AC_CONFIG_AUX_DIR macro, which is probably leading to the following
configure error:

 autoreconf: running: /openwrt.git/staging_dir/host/bin/libtoolize --force
 OpenWrt-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `autostuff'.
 OpenWrt-libtoolize: linking file `autostuff/ltmain.sh'
 OpenWrt-libtoolize: putting macros in `m4'.
 ...
 configure: error: cannot find install-sh, install.sh, or shtool in autostuff "."/autostuff

>From the build output it's clear, that libtoolize isn't installing
install-sh symlink, because libtoolize would install install-sh only if
it's being run with --install parameter. Corresponding part in
libtoolize:

 if $opt_install; then
   func_config_update config.guess \
     "$pkgdatadir/config" "$auxdir" pkgconfig_header
   func_config_update config.sub \
     "$pkgdatadir/config" "$auxdir" pkgconfig_header
   func_install_update install-sh \
     "$pkgdatadir/config" "$auxdir" pkgconfig_header
 fi
 func_ltmain_update ltmain.sh \
    "$pkgdatadir/config" "$auxdir" pkgconfig_header

Adding --install parameter to libtoolize fixes this build issue:

 autoreconf: running: /openwrt.git/staging_dir/host/bin/libtoolize --install --force
 OpenWrt-libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `autostuff'.
 OpenWrt-libtoolize: linking file `autostuff/config.guess'
 OpenWrt-libtoolize: linking file `autostuff/config.sub'
 OpenWrt-libtoolize: linking file `autostuff/install-sh'
 OpenWrt-libtoolize: linking file `autostuff/ltmain.sh'
 OpenWrt-libtoolize: putting macros in `m4'.

Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 5cf897779e)
5 years ago
Hans Dedecker 04413f7612 tools: libressl: fix compilation for non-glibc clib (FS#2400)
Fixes compilaton issue for non glibc clibs :

libtool: compile:  gcc -DPACKAGE_NAME=\"libressl\" -DPACKAGE_TARNAME=\"libressl\" -DPACKAGE_VERSION=\"2.9.2\" "-DPACKAGE_STRING=\"libressl 2.9.2\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libressl\" -DVERSION=\"2.9.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYMLINK=1 -DHAVE_ERR_H=1 -DHAVE_ASPRINTF=1 -DHAVE_MEMMEM=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRNLEN=1 -DHAVE_STRSEP=1 -DHAVE_TIMEGM=1 -DHAVE_SYSLOG=1 -DHAVE_ACCEPT4=1 -DHAVE_PIPE2=1 -DHAVE_POLL=1 -DHAVE_SOCKETPAIR=1 -DHAVE_EXPLICIT_BZERO=1 -DHAVE_GETAUXVAL=1 -DHAVE_GETAUXVAL=1 -DHAVE_DL_ITERATE_PHDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_VA_COPY=1 -DHAS_GNU_WARNING_LONG=1 -DSIZEOF_TIME_T=8 -I. -I../include -I../include/compat -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= -I../crypto/asn1 -I../crypto/bn -I../crypto/ec -I../crypto/ecdsa -I../crypto/evp -I../crypto/modes -I../crypto -I/builds/pantacor/pv-platforms/openwrt-base/openwrt/staging_dir/host/include -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE -D__STRICT_ALIGNMENT -O2 -I/builds/pantacor/pv-platforms/openwrt-base/openwrt/staging_dir/host/include -fpic -Wall -std=gnu99 -fno-strict-aliasing -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DHAVE_GNU_STACK -Wno-pointer-sign -MT compat/getprogname_linux.lo -MD -MP -MF compat/.deps/getprogname_linux.Tpo -c compat/getprogname_linux.c -o compat/getprogname_linux.o
compat/getprogname_linux.c: In function 'getprogname':
compat/getprogname_linux.c:32:2: error: #error "Cannot emulate getprogname"
 #error "Cannot emulate getprogname"
  ^~~~~

Reported-by: Anibal Portero <anibal.portero@pantacor.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 1282a63027)
5 years ago
Hans Dedecker f362ddc3b9 netifd: update to latest git HEAD
899f168 system-linux: Coverity fixes

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 11617bcb3b)
5 years ago
Kevin Darbyshire-Bryant 3cd27e5d1b tools: libressl: fix build on MacOS
Making all in tests
depbase=`echo handshake_table.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DPACKAGE_NAME=\"libressl\" -DPACKAGE_TARNAME=\"libressl\" -DPACKAGE_VERSION=\"2.9.2\" -DPACKAGE_STRING=\"libressl\ 2.9.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libressl\" -DVERSION=\"2.9.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYMLINK=1 -DHAVE_ERR_H=1 -DHAVE_READPASSPHRASE_H=1 -DHAVE_ASPRINTF=1 -DHAVE_MEMMEM=1 -DHAVE_READPASSPHRASE=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRNLEN=1 -DHAVE_STRSEP=1 -DHAVE_TIMEGM=1 -DHAVE_GETPROGNAME=1 -DHAVE_SYSLOG=1 -DHAVE_POLL=1 -DHAVE_SOCKETPAIR=1 -DHAVE_ARC4RANDOM=1 -DHAVE_ARC4RANDOM_BUF=1 -DHAVE_ARC4RANDOM_UNIFORM=1 -DHAVE_TIMINGSAFE_BCMP=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DSIZEOF_TIME_T=8 -I.  -I../include -I../include/compat -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= -I ../crypto/modes -I ../crypto/asn1 -I ../ssl -I ../tls -I ../apps/openssl -I ../apps/openssl/compat -D_PATH_SSL_CA_FILE=\"../apps/openssl/cert.pem\" -I/Users/kevin/wrt/staging_dir/host/include  -D__STRICT_ALIGNMENT  -O2 -I/Users/kevin/wrt/staging_dir/host/include  -fpic -Wall -std=gnu99 -fno-strict-aliasing  -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-strong  -Qunused-arguments -Wno-pointer-sign -MT handshake_table.o -MD -MP -MF $depbase.Tpo -c -o handshake_table.o handshake_table.c &&\
	mv -f $depbase.Tpo $depbase.Po
make[4]: *** No rule to make target `/Users/kevin/wrt/build_dir/host/libressl-2.9.2/crypto/.libs/libcrypto_la-cpuid-macosx-x86_64.o', needed by `handshake_table'.  Stop.
make[3]: *** [all-recursive] Error 1

A similar error & clues from
e783d60473

"
LibreSSL 2.9.1 now has a test that requires libtls.a, however, when building a
shared library only build, the --disable-static flag is passed to libressl,
which prevents the building of libtls.a.

With libtls.a not being built, the following error occurs:
libressl-2.9.1/tls/.libs/libtls.a', needed by 'handshake_table'.  Stop.

There are three options to fix this:
1) Stick with autotools, and provide a patch that removes building anything in
   the tests folder.
2) Pass --enable-static to LIBRESSL_CONF_OPTS
3) Change the package type to cmake, as a cmake build does not have this issue."

It appears we cannot change to cmake because cmake has a dependency on
an ssl library.

Take option 1 and do not build the tests.

Also take the opportunity to remove man page building as well.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 8d6d227bb6)
5 years ago
Hans Dedecker 9634ae8632 curl: update to 7.65.3
For changes in 7.65.3; see https://curl.haxx.se/changes.html#7_65_3

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit fc2df4f705)
5 years ago
Roman Yeryomin e8cbcce608 tools: libressl: update to 2.9.2 version
To keep in sync with OpenSSL 1.1.x branch version options.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
(cherry picked from commit 3f1e8c0131)
5 years ago
Martin Schiller f9a7a40ac4 openvpn: add new list option tls_ciphersuites
To configure the list of allowable TLS 1.3 ciphersuites, the option
tls_ciphersuites is used instead of tls_ciphers.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
(cherry picked from commit 261df949fa)
5 years ago
Rafał Miłecki 6ac62c4b6c base-files: don't set ARGV and ARGC
Those are not used by any image check function anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 3f4c785a6b)
5 years ago
Rafał Miłecki adec8aa291 mvebu: sysupgrade: drop platform_copy_config_sdcard() argument
That function doesn't take any arguments so don't pass anything when
calling it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 670ce65a44)
5 years ago
Eneas U de Queiroz 1e30a6bca9 target/toolchain/files/wrapper.sh: simplify 'case'
Removed an eglibc remnant, and while at it, grouped all of the
TOOLCHAIN_PLATFORMs using the same FLAGS together.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 7d97bc19f0)
5 years ago
Eneas U de Queiroz 7569e8ef86 libs/toolchain: remove eglibc remnant file
This removes package/libs/toolchain/eglibc-files/etc/nsswitch.conf.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit c47eff0df3)
5 years ago
Rafał Miłecki 67b3e44465 ubox: implement service_running() in log init.d script
It allows checking if service is running.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 1b937cb141)
5 years ago
Rafał Miłecki ff9255f7a1 rpcd: implement service_running() in init.d script
It allows checking if service is running.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 285c83a004)
5 years ago
Hans Dedecker 5eeda5350b procd: update to latest git HEAD
31f0765 procd: check strchr() result before using it

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 9a72e7f601)
5 years ago
Rafał Miłecki d6840e7b44 base-files: move stage2 upgrade to separated file
do_upgrade_stage2() isn't really any common code. It isn't used anywhere
except for /sbin/sysupgrade that passes it to the stage2.

Moving its code to separated file also simplifies COMMAND variable.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit f7edd94a65)
5 years ago
John Crispin 0f4a3be2f4 include/package.mk: Add support for src-checkout/ folder
This feature is similar to the SRC_TREE_OVERRIDE. However instead of having
to manually create a symlink inside the package folder, the buildsystem
will check if $(TOP_DIR)/src-checkout/$(PKG_NAME)/.git is present and use
this instead.

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 9e57b62783)
5 years ago
Rosen Penev c00c06b877 usbreset: Add missing header
Fixes undefined reference to strtoul

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 653e05d27f)
5 years ago
Daniel Engberg 7b06f3ba0a util-linux: Update to 2.34
Update util-linux to 2.34
Refresh patch

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit d51f53b5ba)
5 years ago
Daniel Engberg b7ceeb72a8 tools/gengetopt: Update to 2.23
Update gengetopt to 2.23
Remove 100-dependency_fix.patch, fixed upstream
Rework no tests and docs patch
Fix typo in copyright section

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit 6fac9077c6)
5 years ago
DENG Qingfang 89828932c5 iperf3: update to 3.7
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit 42b3a3a89b)
5 years ago
Rafał Miłecki a074ed2933 base-files: drop support for NAND upgrade in platform_pre_upgrade()
With bcm53xx switched to the new procedure there is no more need for
keeping that backward compatibility code.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ea4e1dac71)
5 years ago
Rafał Miłecki e98eab1b6b bcm53xx: sysupgrade: call nand_do_upgrade() from platform_do_upgrade()
Calling nand_do_upgrade() from platform_pre_upgrade() was obsoleted in
the commit 30f61a34b4 ("base-files: always use staged sysupgrade").

This change brings bcm53xx in sync with other targets and allows
dropping backward compatibility code. It shouldn't change any user
visible behavior.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ccf8a8e863)
5 years ago
Rafał Miłecki ebef2c27eb base-files: drop unused jffs2_copy_config()
Its last usage was dropped back in 2013 in the commit b95bdc8ab5
("kernel/base-files: clean up old code related to refreshing mtd
partitions, it is no longer used anywhere").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit f58ca6ee57)
5 years ago
Emil Muratov 1d68badbb3 zram-swap: Add extra commands for status/compaction
This patch adds two new commands:
  zram status - shows memory stats for all zram swaps
  zram compaction - trigger compaction for all zram swaps

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit a9deed62af)
5 years ago
Emil Muratov dc97db2e39 busybox: enable swapon/off by default to make it consistent with mkswap
No size increase on busybox binary.
  Since busybox mkswap is already enabled by default it seems reasonable
  to enable swapon/off too. For ex. this obsoletes installing block-mount
  dependency for zram-swap.

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
(cherry picked from commit afa5ce2493)
5 years ago
Emil Muratov 86735992c8 zram-swap: Add zram compaction and statistics info output
Executing '/etc/init.d/zram start' during runtime (with a swap being already
mounted) triggers zram device compaction and prints out nice stats info about
zram memory usage

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [use IEC's MiB unit]
(cherry picked from commit b062c90f47)
5 years ago
Emil Muratov 7580357dc0 zram-swap: Fix busybox dependency check
- fix dependency on BUSYBOX_CONFIG_SWAPONOFF (removed in 84da2a6)
   - add busybox defaults checking (fix zram-swap always installs swap-utils
     and libblkid as dependency, even if busybox includes mkswap by default)

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
(cherry picked from commit c0d93432f2)
5 years ago
Konstantin Demin c6698c7b34 libnftnl: bump to version 1.1.3
bump ABI version accordingly (thanks to Jo-Philipp Wich).

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
(cherry picked from commit ce8027ed29)
5 years ago
Felix Fietkau 3ff6397068 build: skip kernel stack validation when building on macOS
Since we switched to 4.19, the kernel build checks for libelf to decide if
it should build tools for stack validation.

On macOS, this check fails during target/compile, but succeeds during package
build (because of the pkg-config path picking up target libraries).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit c3e31b6a9b)
5 years ago
Florian Eckert 937a17de19 comgt: add delay option for 3g proto
All protos for wwan (ncm,qmi,mbim) do have a delay option.
To standardize that add also the missing delay option to the 3g proto.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 313444a79e)
5 years ago
Karel Kočí ec49bb64e7 base-files: supress service restart of umount
Restart is in default implemented so it calls stop and start. This is
pretty unsafe to call on umount service. This service should not do
anything on restart the same way as on start. Only use of this service
is on stop.

Signed-off-by: Karel Kočí <cynerd@email.cz>
(cherry picked from commit 537b801c54)
5 years ago
Florian Eckert 3cb0eed8a1 uqmi: fix indentation style and boundary
Fix indentation style and boundary.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit c06f2a2dcb)
5 years ago
Florian Eckert bd8e0746c8 uqmi: add mtu config option possibility
There are mobile carrier who have different MTU size in their network.
With this change it is now possible to configure this with the qmi
proto handler.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 8eb63cb7df)
5 years ago
Alban Bedel ffdf98b204 scripts: time.pl: Don't print the time on stderr
Having the build time written on stderr make it appear with V=w
although it is not an error or warning. Just write the time on stdout
to have it part of the build log like all the rest, but not clutter
the output when only warnings and errors should be shown.

Signed-off-by: Alban Bedel <albeu@free.fr>
(cherry picked from commit 340df72e07)
5 years ago
Jason A. Donenfeld a7be52284c wireguard: bump to 0.0.20190702
* curve25519: not all linkers support bmi2 and adx

This should allow WireGuard to build on older toolchains.

* global: switch to coarse ktime

Our prior use of fast ktime before meant that sometimes, depending on how
broken the motherboard was, we'd wind up calling into the HPET slow path. Here
we move to coarse ktime which is always super speedy. In the process we had to
fix the resolution of the clock, as well as introduce a new interface for it,
landing in 5.3. Older kernels fall back to a fast-enough mechanism based on
jiffies.

https://lore.kernel.org/lkml/tip-e3ff9c3678b4d80e22d2557b68726174578eaf52@git.kernel.org/
https://lore.kernel.org/lkml/20190621203249.3909-3-Jason@zx2c4.com/

* netlink: cast struct over cb->args for type safety

This follow recent upstream changes such as:

https://lore.kernel.org/lkml/20190628144022.31376-1-Jason@zx2c4.com/

* peer: use LIST_HEAD macro

Style nit.

* receive: queue dead packets to napi queue instead of empty rx_queue

This mitigates a WARN_ON being triggered by the workqueue code. It was quite
hard to trigger, except sporadically, or reliably with a PC Engines ALIX, an
extremely slow board with an AMD LX800 that Ryan Whelan of Axatrax was kind
enough to mail me.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit 7c23f741e9)
5 years ago
Alexander Couzens c26a970f5b Make linux kernel builds reproducible when BUILDBOT selected
The linux kernel is not reproducible because the build user
and domain is included into the kernel. Set the build user
to `builder` and build domain to buildhost.

It's also possible to build reproducible builds by setting
KERNEL_BUILD_USER KERNEL_BUILD_DOMAIN to static values.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
(cherry picked from commit fdd0a8d491)
5 years ago
Bjørn Mork 1e887ddc8d scripts/feeds: add src-include method
The src-include method allows recursive inclusion of feeds.conf snippets.

This can for example be used for adding static local feeds to
feeds.conf.default without ever having to update the local feeds.conf:

 src-include defaults feeds.conf.default
 src-link custom /usr/local/src/lede/custom

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 7a1b575ac4)
5 years ago
Florian Eckert 5a41c027e1 base-files: add network_get_uptime() to /lib/functions/network.sh
Add missing ubus api call for uptime value.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 9e780ed5f7)
5 years ago
Petr Štetiar f011347ad2 upgs: update to latest git HEAD
cd7eabcd8c9d ugps: Fix compilation under 64-bit
198c06051dd0 Fix build error caused by enabled extra compiler warnings
fc2ab8756b3b Enable extra compiler warnings

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f924fab3dc)
5 years ago
Jonas Gorski bdd1bf8b89 build: warn when packages have no associated install section
Declaring a package without the appropriate install section is an easy
mistake to make, especially when renaming packages. Since this is also
easy to detect, warn about it when it happens.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
No-objections-at-all-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5ede3fcdf7)
5 years ago
Eneas U de Queiroz c71f70fcdd ustream-ssl: update to 2019-06-24
This adds chacha20-poly1305 support to the mbedtls variant.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 82a8ddd603)
5 years ago
Joseph Tingiris 12e66c71d9 rssileds: change rssileds.init STOP index
This patch is in a series to allow additional STOP indexes after
umount, so that other block devices may stop cleanly.

rssileds.init is now STOP=89

Signed-off-by: Joseph Tingiris <joseph.tingiris@gmail.com>
(cherry picked from commit 8a5a01a677)
5 years ago
Joseph Tingiris c10b097198 kexec-tools: change kdump.init STOP index
This patch is in a series to allow additional STOP indexes after umount,
so that other block devices may stop cleanly.

kdumpinit is now STOP=90

Signed-off-by: Joseph Tingiris <joseph.tingiris@gmail.com>
(cherry picked from commit 5883b5a1f8)
5 years ago
Joseph Tingiris 7c9213b8b3 base-files: change boot & umount STOP indexes
This patch is in a series to allow additional STOP indexes after umount,
so that other block devices may stop cleanly.

boot is now STOP=90
umount is now STOP=90

After this patch series, the resulting STOP indexes in the 80s & 90s
will be:

STOP=85 odhcpd.init
STOP=89 conntrackd.init
STOP=89 log.init
STOP=89 rssileds.init
STOP=90 boot
STOP=90 kdump.init
STOP=90 network
STOP=90 sysfixtime
STOP=90 umount
STOP=98 mdadm.init (note: will be addressed in a separate patch)

Signed-off-by: Joseph Tingiris <joseph.tingiris@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[PKG_RELEASE is now 200]

(cherry picked from commit 04811007e5)
5 years ago
Josef Schlehofer dc10fd35f1 mbedtls: Update to version 2.16.2
Signed-off-by: Josef Schlehofer <josef.schlehofer@nic.cz>
(cherry picked from commit a2f54f6d5d)
5 years ago
Deng Qingfang c0c7377603 package/network: add PKGARCH:=all to non-binary packages
Packages such as xfrm contain only script files, add PKGARCH:=all

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit 6762e72524)
5 years ago
Eneas U de Queiroz 15a5b79132 nghttp2: deduplicate files in staging_dir
'38b22b1e: deduplicate files in libnghttp2' missed duplicates in
staging_dir by Build/InstallDev.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
(cherry picked from commit ee1a783314)
5 years ago
Daniel Engberg f1fa1c9d8d tools/bison: Update to 3.4.1
Update bison to 3.4.1
Remove 010-intl-stub-compat.patch

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit 9fc03832bc)
5 years ago
Jo-Philipp Wich a3a9e1d0fe rpcd: add direct dependency on libjson-c
The OpenWrt buildroot ABI version rebuild tracker does not handle
transient dependencies, therefor add all libraries linked by rpcd
as direct dependencies to the corresponding binary package definition.

This ensures that rpcd is automatically rebuilt and relinked if any
of these libraries has its ABI_VERSION updated in the future.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit eaad2211db)
5 years ago
Jo-Philipp Wich 193366ee23 metadata: handle ABI version rebuild tracking for transient dependencies
Extend the packageauxvars database to keep a list of possible package
dependencies for each provider, then utilize this information in buildroot
to resolve the ABI version dependencies of dependent packages up to five
levels deep.

This should properly trigger rebuilds for packages indirectly depending
on other packages whose ABI_VERSION changed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 27a4a71c24)
5 years ago
Yousong Zhou 6e0bd49014 base-files: apply new sysctl.conf at postinst
This is mainly for kmod-br-netfilter.  To turn off
bridge-netfilter-call-xxx immediately after installation

While at it

 - Define filelist="/usr/lib/opkg/info/${pkgname}.list"
 - Reuse "[ -z "$root" ]"
 - Grep with "-m1"

Fixes FS#2300

Reported-by: Marco Sartorius <tidbits@ormoorgmen.info>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 3dc4f59eab)
5 years ago
Linus Walleij 97e52258d7 gemini: Fix up DNS-313 compatible string
It's a simple typo in the DNS file, which was pretty serious.
No scripts were working properly. Fix it up.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[integrate upstream patch into openwrt target]

(cherry picked from commit 5470e928d0)
5 years ago
Christian Lamparter bf5dd92cea hostapd: remove stale WPA_SUPPLICANT_NO_TIMESTAMP_CHECK option
Support to disable the timestamp check for certificates in
wpa_supplicant (Useful for devices without RTC that cannot
reliably get the real date/time) has been accepted in the
upstream hostapd. It's implemented in wpa_supplicant as a
per-AP flag tls_disable_time_checks=[0|1].

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 99bf9a1ac2)
5 years ago
Christian Lamparter 40379b0ec6 apm821xx: fix bogus key-presses on boot
"There are often transient line events when
the system is powered up and initialized and it
is often necessary for the gpio_chip driver to
clear any interrupt flags in hardware before
setting up the gpio chip, especially the
irqchip portions of it."
<http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017630.html>

This patch adds a fix for the APM821XX's interrupt
controller to clear any bogus pending toggled
interrupts that happens on various APM821XX boards
on boot.

The patch also changes the debouce-interval from the
default 5ms debounce interval to 60ms all around.
The default setting caused on occasions that the button
state became stuck in a pressed state, even though the
button was released.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(backported from commit 971f31bedc)
5 years ago
Jonas Gorski f79e6e01bd scripts/config: fix *c_shipped build depency tracking
The Makefile was missing dependencies on *c_shipped, so changes never
triggered a rebuild. Add these as optional dependencies so their absence
isn't treated as an error.

In addition, fix a typo preventing the zconf.lex.o from being removed on
clean.

Fixes: 9d5510a500 ("build: add new menuconfig code based on linux 3.9")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0096a1cf00)
5 years ago
Jonas Gorski 0bfac320ea metadata: ensure one dependency provider to be y if a package is y
When there are multiple packages providing a meta-package, it is
possible to to create a config where a package is selected as =y, but
all of its dependency providers are just selected as =m. This is due to
the selection statement being just

  config PACKAGE_foo
    select PACKAGE_bar if !PACKAGE_baz

which is already fulfilled by PACKAGE_bar=m. Fix this by properly
comparing the selection states:

  config PACKAGE_foo
    select PACKAGE_bar if PACKAGE_baz<PACKAGE_foo

Also invert the select conditions to improve readability.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
[slightly reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

(cherry picked from commit 1fd50531ca)
5 years ago
Jo-Philipp Wich 1754dc2ddb treewide: fix syntax errors exposed after kconfig update
After commit e82a4d9cfb ("config: regenerate *_shipped sources") the mconf
parser became more strict as a side effect and started to spew a series of
warnings when evaluating our generated kconfig sources:

  tmp/.config-package.in:705:warning: ignoring unsupported character '@'

The root cause of these warnings is a wrong use of the @SYMBOL dependency
syntax in various Makefile. Fix the corresponding Makefiles by turning
`@SYM||@SYM2` expressions into the proper `@(SYM||SYM2)` form.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 74739c4228)
5 years ago
Nicolas Pitre e7ccc34478 config: fix relational operators for bool and tristate symbols
Since commit 31847b67bec0 ("kconfig: allow use of relations other than
(in)equality") it is possible to use relational operators in Kconfig
statements. However, those operators give unexpected results when
applied to bool/tristate values:

	(n < y) = y (correct)
	(m < y) = y (correct)
	(n < m) = n (wrong)

This happens because relational operators process bool and tristate
symbols as strings and m sorts before n. It makes little sense to do a
lexicographical compare on bool and tristate values though.

Documentation/kbuild/kconfig-language.txt states that expression can have
a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations).
Let's make it so for relational comparisons with bool/tristate
expressions as well and document them. If at least one symbol is an
actual string then the lexicographical compare works just as before.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
[rebased against OpenWrt kconfig, slightly reword commit message]
(backported from upstream 9059a3493efea6492451430c7e2fa0af799a2abb)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

(cherry picked from commit 75dcaf3d23)
5 years ago
Jonas Gorski 17ee485731 config: regenerate *_shipped sources
The pregenerated `zconf.hash.c` and `zconf.lex.c` files have not been
kept in sync with their respective `*.y` and `*.l` sources in the past
causing our kconfig implementation to not recognize important kconfig
grammer elements such as relational `<`, `<=`, `>` and `>=` operators.

Fixes: 2d7e602381 ("scripts/config: sync with latest linux upstream")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
[reword commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>

(cherry picked from commit 972123f1e0)
5 years ago
Jo-Philipp Wich 02c1e99d1b procd: add direct dependencies on libblobmsg-json and libjson-c
The OpenWrt buildroot ABI version rebuild tracker does not handle
transient dependencies, therefor add all libraries linked by procd
as direct dependencies to the corresponding binary package definition.

This ensures that procd is automatically rebuilt and relinked
if any of these libraries has its ABI_VERSION updated in the
future.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 66838cd851)
5 years ago
Petr Štetiar 8cd426de44 urngd: move project to git.openwrt.org
Let's move project to a proper place.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit bec8fb1ee7)
5 years ago
Hans Dedecker 5667768236 nghttp2: bump to 1.39.1
7ffc239b Bump up version number to 1.39.1
bc886a0e Fix FPE with default backend
a3a14a9c Fix log-level is not set with cmd-line or configuration file
acfb3607 Update manual pages
bdfd14c2 Bump up version number to 1.39.0, LT revision to 31:4:17
cddc09fe Update AUTHORS
3c3b6ae8 Add missing colon
2f83aa9e Fix multi-line text travis issue
fc591d0c Run nghttpx integration test with cmake build
9a17c3ef travis: use multi-line text
b7220f07 cmake: Remove SPDY related files
a1556fd1 Merge pull request #1356 from nghttp2/fix-log-level-on-reload
77f1c872 nghttpx: Fix unchanged log level on configuration reload
49ce44e1 Merge pull request #1352 from nghttp2/travis-osx
f54b3ffc Fix libxml2 CFLAGS output
b0f5e5cc Implement daemon() using fork() for OSX
8d6ecd66 Enable osx build on travis
f82fb521 Update doc
2e1975dd clang-format-8
97ce392b Merge pull request #1347 from nghttp2/nghttpx-ignore-cl-te-on-upgrade
afefbda5 Ignore content-length in 200 response to CONNECT request
4fca2502 nghttpx: Ignore Content-Length and Transfer-Encoding in 1xx or 200 to CONNECT
6975c336 Update llhttp to 1.1.3
0288093c Fix llhttp_get_error_pos usage
a3a03481 Merge pull request #1340 from nghttp2/nghttpx-llhttp
c64d2573 Replace http-parser with llhttp
f028cc43 clang-format
302e3746 Merge pull request #1337 from nghttp2/upgrade-mruby
3cdbc5f5 Merge pull request #1335 from adamgolebiowski/boost-1.70
a6925186 Fix mruby build error
45d63d20 Upgrade mruby to 2.0.1
cbba1ebf asio: support boost-1.70
e86d1378 Bump up version number to 1.39.0-DEV
4a9d2005 Update manual pages

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 865e25e049)
5 years ago
Hauke Mehrtens 670fd46b3f urngd: Fix more wrong type in format string
Also the other type is worng and causes compile problems on ARM64
platforms.

Fixes: 9b53201d9c ("urngd: Fix wrong type in format string")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 1ae1276eab)
5 years ago
Hauke Mehrtens 9697f4cf73 libubox: update to latest git HEAD
9dd2dcf libubox: add format string checking to ulog()
ecf5617 ustream: Add format string checks to ustream_(v)printf()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit fc454ca153)
5 years ago
Hauke Mehrtens 8a78e4dbb9 urngd: Fix wrong type in format string
GCC 9.1 complains about this wrong type used in the format string, fix
this to make the compiler happy.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 9b53201d9c)
5 years ago
Hauke Mehrtens 18e3ab9e34 ubox: bump to git HEAD
4df34a4 kmodloader: Increase path array size to make it always fit

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 22d3d91c77)
5 years ago
Hans Dedecker 512244e49a netifd: xfrm fixes
9932ed0 netifd: fix xfrm interface deletion and standardize netlink call

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 1fd900ddc2)
5 years ago
Adrian Schmutzler f44725ce92 ath79: Merge cases in 11-ath10k-caldata
Cosmetical patch that just merges two cases.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 28baaaae82)
5 years ago
Linus Walleij 0b1f62a277 gemini: Fix MAC address assignment for DIR-685
The DIR-685 has the MAC addresses in the RedBoot code just like
DNS-313. Check some magic numbers to determine that the MAC
address is where we want it and extract it from RedBoot.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[replaced ifconfig with ip, ! -z = -n, added string quotes]

(cherry picked from commit 86098ea87e)
5 years ago
Linus Walleij b790e346b9 gemini: Make a per-board case for ethernet MAC
The DNS-313 isn't the only special board so let's bite the
bullet and create a case ladder in preparation for DIR-685.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [refreshed]
(cherry picked from commit 38d85d2c9f)
5 years ago
Linus Walleij 28d8006866 gemini: Use library functions to assign MAC address
This simplifies the ethernet address extraction script
by using standard library functions to locate the MTD
partitions and extract ethernet address from a binary
offset location in the flash. Furthermore, the aging
ifconfig is replaced by the ip tool, which will now
assign the MAC addresses.

Suggested-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[ifconfig replacement, use -n instead of ! -z,
-n requires string to be quoted within the test brackets,
drop prepended "x" in check, add quotes, make local
variables local, kill whitespaces]

(cherry picked from commit cd6c3535cd)
5 years ago
Christian Lamparter c54818e205 gemini: enable CONFIG_PACKET
CONFIG_PACKET is a important feature to have.
The Packet protocol is used by applications which
communicate directly with network devices without
an intermediate network protocol implemented in
the kernel, e.g. tcpdump and ip.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit bdbb679adb)
5 years ago
André Valentin 09d37d67ec network/config/xfrm: add host-dependency for xfrm interface parent
Add proto_add_host_dependency to add a dependency to the tunlink interface

Signed-off-by: André Valentin <avalentin@marcant.net>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
(cherry picked from commit f6dab98044)
5 years ago
Hans Dedecker 37530be1ef netifd: update to latest git HEAD
42a3878 interface-ip: fix possible null pointer dereference
c1964d8 system-linux: remove superfluous dev check

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 55fcc77072)
5 years ago
Paul Spooren bbcd7d05e0 f2fs-tools: fixup SPDX license
The f2fs-tools have a wrong PKG_LICENSE with is not SPDX compatible.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 35a70d6262)
5 years ago
Konstantin Demin 141bc476f5 nghttp2: deduplicate files in libnghttp2
libnghttp2 accidentally ships library twice:

$ tar -Oxzf libnghttp2-14_1.38.0-1_mips_24kc.ipk ./data.tar.gz | tar -tzvf -
drwxr-xr-x root/root         0 2019-06-07 23:14 ./
drwxr-xr-x root/root         0 2019-06-07 23:14 ./usr/
drwxr-xr-x root/root         0 2019-06-07 23:14 ./usr/lib/
-rw-r--r-- root/root    144412 2019-06-07 23:14 ./usr/lib/libnghttp2.so.14
-rw-r--r-- root/root    144412 2019-06-07 23:14 ./usr/lib/libnghttp2.so.14.17.3

after fix, there's library and symlink (as designed):

$ tar -Oxzf libnghttp2-14_1.38.0-2_mips_24kc.ipk ./data.tar.gz | tar -tzvf -
drwxr-xr-x root/root         0 2019-06-07 23:14 ./
drwxr-xr-x root/root         0 2019-06-07 23:14 ./usr/
drwxr-xr-x root/root         0 2019-06-07 23:14 ./usr/lib/
lrwxrwxrwx root/root         0 2019-06-07 23:14 ./usr/lib/libnghttp2.so.14 -> libnghttp2.so.14.17.3
-rw-r--r-- root/root    144412 2019-06-07 23:14 ./usr/lib/libnghttp2.so.14.17.3

Binary package size reduced accordingly: 134621 -> 66593.

Compile/run-tested: ar71xx/generic.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
(cherry picked from commit 38b22b1e70)
5 years ago
Hans Dedecker 49d35646ea odhcpd: various fixes
8f1347b odhcpd: router: Fix out of scope memory access
d37736e dhcpv6-ia: free assignment when validity timer expires

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Michal Cieslakiewicz 4fb6b8c553 ar71xx: WNR2200: remove redundant GPIO for WLAN LED
Without this patch, an extra entry appears for AR9287 GPIO
that duplicates WLAN LED but in fact drives nothing:

gpiochip1: GPIOs 502-511, ath9k-phy0:
 gpio-502 (                    |netgear:blue:wlan   ) out hi
 gpio-503 (                    |netgear:amber:test  ) out hi
 gpio-504 (                    |netgear:green:power ) out lo
 gpio-505 (                    |rfkill              ) in  hi
 gpio-507 (                    |wps                 ) in  hi
 gpio-508 (                    |reset               ) in  hi
 gpio-510 (                    |ath9k-phy0          ) out hi <===!

The pin pointed above is default LED GPIO (8) for AR9287.
For WNR2200 it is not connected anywhere - pin 0 drives blue WLAN
LED instead - but initialization code is missing that information.

This fix calls ap9x_pci_setup_wmac_led_pin() function at device
setup, forcing WLAN LED pin to be 0 and removing redundant entry.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Karl Pálsson a5762b45c2 ath79: etactica-eg200: fix restore button
The button is labelled reboot/restore in documentation, and has always
been used for that.  Naming it WPS has always been wrong.

Signed-off-by: Karl Pálsson <karlp@etactica.com>
[matched author with SoB]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Linus Walleij 4d5a47d206 gemini: Stop enforcing command line
The command line enforced by the kernel is harmful, we want to
use the command line passed from the device tree. This is
especially important for the SQ201, Teltonika RUT and WBD111
which has a console set to 115200n8 and not 19200n8 like all
the others, so their consoles will be confusingly changing
baudrate between boot loader and kernel. The setting in the
device tree corresponds to what the boot loader is using.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit ea44ed5f38)
5 years ago
Koen Vandeputte db94ee6256 kernel: bump 4.14 to 4.14.141
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Alin Nastac 22378beb58 iproute2: add libcap support, enabled in ip-full
Preserve optionality of libcap by having configuration script follow the
HAVE_CAP environment variable, used similarly to the HAVE_ELF variable.

Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase/refresh patches]
(backported from commit a6da3f9ef7)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Felix Fietkau 73d45c7378 mac80211: add config tweak for tx bursting when using VHT
By default, set BE tx queue TXOP limit to 2.0 in the hostapd config
Many vendor drivers are doing similar things to boost throughput.
On MT7612 under ideal conditions, it improves tx throughput from 470 Mbit/s
to about 570 Mbit/s.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 8650201f10)
5 years ago
Koen Vandeputte dd4b8a24a1 ath9k: backport dynack improvements
Close cooperation with Lorenzo Bianconi resulted
in these patches which fix all remaining seen issues
when using dynack.

Fix link losses when:
- Late Ack's are not seen or not present
- switching from too low static coverage class to dynack on a live link

These are fixed by setting the Ack Timeout/Slottime to
the max possible value for the currently used channel width when
a new station has been discovered.

When traffic flows, dynack is able to adjust to optimal values
within a few packets received (typically < 1 second)

These changes have been thoroughly tested on ~60 offshore devices
all interconnected using mesh over IBSS and dynack enabled on all.

Distances between devices varied from <100m up to ~35km

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
(cherry picked from commit f6e8ba0238fe349b7529357793e2fb18635819ed)
5 years ago
Koen Vandeputte 9e837873e7 kernel: bump 4.14 to 4.14.140
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Jo-Philipp Wich ee164007b0 fstools: update to latest Git HEAD
6a61b9a probe: fallback to libblkid.so.1 when libblkid.so does not exist

Also remove deprecation notices from init script while we're at it.

Fixes: FS#2274
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 517cb0b70b)
5 years ago
Christian Lamparter f2c6fa3dbb fstools: update to HEAD of 2019-07-01 - 1539b5
Update fstools to commit 1539b535ac327a3bc599d1ca871e14fd0dc3bba1

git log --pretty=oneline --abbrev-commit ff1ded63..1539b535

1539b53 libblkid-tiny: increment label size to 256
d563f3c libblkid-tiny: fix wrong btrfs label length
3957dd3 block: prevent mount point confusion
9b36dc2 libfstools: avoid false positives when matching devices and volumes

Created with the help of the make-package-update-commit.sh script.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 8036345225)
5 years ago
Jo-Philipp Wich 6710bb25b6 iwinfo: update to latest Git HEAD
a9f9557 nl80211: support reading hardware id from phy directly
c586cd3 iwinfo: add device id for MediaTek MT7612E
d4382dd iwinfo: add device id for Atheros AR9390

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b13f3300d5)
5 years ago
Koen Vandeputte 0a59e91973 ar71xx/ath79: ag71xx: dont fetch the same var again
tx_size was just declared above and set to BIT(tx->order)
Use the declaration instead, which could avoid a pointer deref

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 6852eab58236e3991f5d73f211018dfef01f2a64)
5 years ago
Koen Vandeputte db1a935e5c ar71xx: ag71xx: use base address value directly from the source
This brings the code more inline with the ath79 flavour

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 8d78aa8eaf ar71xx: ag71xx: make use of managed dev API simplifying code
Backport of a4eef43a12 ("ath79: ag71xx: replace alloc_etherdev with devm_alloc_etherdev")
combined with the initial changes from John Crispin.

Simplifies the code a lot by using the Managed dev API.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte c9b28b5703 ar71xx: ag71xx: replace ag71xx_get_phy_if_mode_name with phy_modes()
Backport of f73b2d64ed ("ath79: ag71xx: replace ag71xx_get_phy_if_mode_name() with phy_modes()")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte d143a0a4f6 ar71xx: ag71xx: pass correct device pointer to dma functions
Backport of 4eaa3626a8 ("ath79: ag71xx: pass correct device pointer to dma functions")

While 4.14 does not contain the warnings,
it still makes sense to use the proper pointers here.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 42b42d2c9b ar71xx/ath79: ag71xx: get ring_mask consistent
All other instances of this identical declaration fetch the
value directly from the ring_order.

Also do it here.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 576791b9b4 ar71xx: ag71xx: add missing register writes
These are added in ath79, but were not backported here

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
DENG Qingfang faaa52eff9 tools/mtd-utils: update to 2.1.1
Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit 1664d6698169bed1373db70acdf8ad46fa786b2e)
5 years ago
DENG Qingfang c03765e87a mtd-utils: update to 2.1.1
Removed upstream patch
Compile and run tested on mvebu

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
(cherry picked from commit fb57c617ba5269a6c2050e42b9d68813e262bf0d)
5 years ago
Koen Vandeputte 8fba3ebe88 kernel: bump 4.14 to 4.14.139
Refreshed all patches.

Also add a missing symbol for x86 which got used now in this bump.
- ISCSI_IBFT

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 9952c8cf40 ath10k-ct: update to version 2019-08-14
Changes:

9e5ab25027e0 ath10k-ct:  Update to latest 5.2 upstream, support bigger mtu, 160Mhz

Removed upstreamed patches:
- 204-ath10k-fix-max-antenna-gain-unit.patch
- 205-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte c46219021f ath10k-firmware: update Candela Tech firmware images
This should fix a problem with 1560 MTU, 160Mhz on DFS channels,
some other small issues on < 5.2 kernels, and for 5.2 driver,
it pulls in some upstream stable fixes.

wave-1 firmware changes since last update:

  *  June 24, 2019: Try allocating low-priority WMI msgs if high-prio are not available.

  *  June 24, 2019: Init rate-ctrl to start at lowest rate instead of in the middle.  Hoping
                    this helps DHCP when station connects from a long distance.

wave-2:

  *  June 24, 2019  Start rate-ctrl at minimal values to help DHCP work better for far-away peers.

  *  July 24, 2019  Fix old regression that made /a (and probably /b/g) perform poorly, at least on
                    diet-compiled images.

  *  Aug 8, 2019  Improve a/b/g rate-ctrl by damping the PER swings caused by the all-or-nothing logic
                  of transmitting non-block-ack frames one at a time.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit de5f0764883ad6a0767da58d7359f3e01aa91139)
5 years ago
Hauke Mehrtens 5c47bfb735 ath10k-ct: remove patches for old versions
the ath10k-ct package ships multiple versions of the ath10k-ct driver,
OpenWrt currently only uses the version 4.19, but we still ship some
patches for older versions. Remove all patches only touching older
versions and also remove the patch for older versions from patches which
do the same changes to multiple versions of ath10k-ct.

This removes some unneeded patches, the end binary should stay the same.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 10fe5ca362)
5 years ago
Hauke Mehrtens 218cc22a43 ath10k-ct: update to version 2019-06-13
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 8f61b4cac4)
5 years ago
Adrian Schmutzler 10671619dc ath79: Fix whitespace errors in 11-ath10k-caldata
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 1174b94bc9)
5 years ago
Hauke Mehrtens 3a2bdf91bf ath10k-firmware: Fix mirror hash
Fixes: 7f79882d44 ("ath10k-firmware: update board-2.bin for community firmwares")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 7c640c2960)
5 years ago
Christian Lamparter e57a756487 ath10k-firmware: update board-2.bin for community firmwares
This patch updates the board-2.bin for the default
IPQ4019, QCA9984 and QCA9888 ath10k-firmware-xyz-ct
and -ct-htt firmwares.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 7f79882d44)
5 years ago
Kevin Darbyshire-Bryant 3898d98061 ath10k-firmware: update Candela Tech firmware images
wave-1:

2019-05-09: Tweak rate-ctrl:  Ramp PER up faster, down slower.  This
	    helps throughput in rate-vs-range test, especially with
	    nss1.

2019-05-20: Disable adaptive-CCA.  I am not sure it helps, and it may
	    make it slower to detect noise that should tell the system
	    to stop transmitting.  If someone has means to test this
	    properly, I'd be happy to work with them.

wave-2:

2019-05-15: Fix problem where rate-ctrl sometimes used rix of 0x0.

2019-05-15: Allow raw-tx of encrypted frame.  Requires a patch to the
	    driver to use raw mode when skb has WEP flag enabled AND
	    skb is flagged to not be encrypted.  Lightly tested.

2019-05-16: Fix tx-hang that happened when rate-ctrl chose an OFDM rate
	    for 20Mhz and sent that as AMPDU.  To fix, limit to (V)HT
	    rates if peer is (V)HT.  It seems that MCS0 (V)HT20 should
	    have as good of a chance of being detected as CCK or OFDM.

2019-06-06: Disable TX-BFEE, TX-BFER for IBSS connections.  I suspect
	    this is part of the tx-hang issue seen with IBSS between
	    two 9984 radios.

2019-06-12: Fix rx-rate reporting in 'fw_stats' logic.  This was at
	    least partly due to regressions I had added earlier when
	    working on some multi-vdev enhancements.

2019-6-12: Fix case where extd peer-stats were not always populated.
	   The stats gathering code did not handle error conditions
	   well.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit ff2382e36c)
5 years ago
Kevin Darbyshire-Bryant f830903c37 ath10k-ct: Update to 2019-06-13
Changes:

ath10k:  Improve PMF/MPF mgt frame check

And add a driver for 5.2 (beta, not even tested yet) kernel.

Refresh patches.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 49b3dcb2ab)
5 years ago
Felix Fietkau c3327f48dc mt76: update to the latest version
b3a29655ae0b mt76x02: fix crash on device reset
ffddb685a679 mt76x02u: check chip version on probe
7fc5f925ec35 mt76x2u: remove duplicated entry in mt76x2u_device_table
61311d9b307a mt76: introduce mt76_free_device routine
a7dfcf2e2498 mt76: move mac_work in mt76_dev
334b4cedf2b0 mt76: add mac80211 driver for MT7615 PCIe-based chipsets
edb2a001b695 mt76: add unlikely() for dma_mapping_error() check
355c07904da7 mt76: use macro for sn and seq_ctrl conversion
133bffba8bb2 add firmware for MT7615E
49d9c1b29f1d mt76: usb: reduce locking in mt76u_tx_tasklet
3e371ca35c7f mt76: set txwi_size according to the driver value
50073265559a mt76: add skb pointer to mt76_tx_info
c47a5685d00b mt76: dma: introduce skb field in mt76_txwi_cache
9029560fad1f mt76: dma: add skb check for dummy pointer
e9eea3923774 mt76: mt7615: use sizeof instead of sizeof_field
98c5359e9649 Revert "mt76: fix potential deadlock on cancelling workqueues"
bc9baa7b12b9 mt76x02u: remove bogus stop on suspend
6c1cab9abafc mt76usb: fix tx/rx stop
0e674c50a5a3 mt76x02: remove bogus mutex usage
59f7bb6fbfc5 Revert "mt76: mt76x02: send no-skb tx status without holding the status lock"
b0f2a30452f0 mt76x02: avoid status_list.lock and sta->rate_ctrl_lock dependency
62054defd78a mt76: mt7603: remove query from mt7603_mcu_msg_send signature
e79d96acf597 mt76: mt7603: use standard signature for mt7603_mcu_msg_send
be8f0394e335 mt76: mt7603: initialize mt76_mcu_ops data structure
9a9c6569e987 mt76: introduce mt76_mcu_restart macro
980b91e04006 mt76: mt7603: init mcu_restart function pointer
a97db3f3ceee mt76: mt7603: run __mt76_mcu_send_msg in mt7603_mcu_send_firmware
151115f8160b mt76: mt76x02: mt76x02_poll_tx() can be static
7391f98f8b4b mt76: fix endianness sparse warnings
6c06f7381129 mt76: mt7603: report firmware version using ethtool
f06647efbd1c mt76: usb: use EP max packet aligned buffer sizes for rx
f43fccf0990e mt76: move beacon_int in mt76_dev
74ab2cf6171e mt76: move beacon_mask in mt76_dev
23c2f94deeeb mt76: add TX/RX antenna pattern capabilities
6e790e106a84 mt76: move pre_tbtt_tasklet in mt76_dev
7606c08414e5 mt76: mt7603: enable/disable pre_tbtt_tasklet in mt7603_set_channel
ff22eee58520 mt76: do not enable/disable pre_tbtt_tasklet in scan_start/scan_complete
3157385e2277 mt76: mt7603: dynamically alloc mcu req in mt7603_mcu_set_eeprom
cc674e2d1f10 mt76: mt76x02: remove useless return in mt76x02_resync_beacon_timer
6b184272ba15 mt76: move tx_napi in mt76_dev
bce63c453c85 mt76: mt7603: use napi polling for tx cleanup
4afd89e8ab20 mt76: mt7615: use napi polling for tx cleanup
2cb46830faf7 mt76: move netif_napi_del in mt76_dma_cleanup
b4ceb9f7c791 mt76: Fix a signedness bug in mt7615_add_interface()
d00dc9524068 mt76: mt7615: Use after free in mt7615_mcu_set_bcn()
4e0ccc6a2da6 mt76: mt7615: Make mt7615_irq_handler static
0fd552a55847 mt7615: mcu: simplify __mt7615_mcu_set_wtbl
50f70948ffcc mt7615: mcu: simplify __mt7615_mcu_set_sta_rec
4434d04d3c50 mt7615: mcu: remove bss_info_convert_vif_type routine
083fbb97223c mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl_bmc
f61ca8019129 mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl
35bd12d609ac mt7615: mcu: unify mt7615_mcu_add_wtbl_bmc and mt7615_mcu_del_wtbl_bmc
f8f990b9092e mt7615: mcu: remove unused parameter in mt7615_mcu_del_wtbl
965bca14795e mt7615: remove query from mt7615_mcu_msg_send signature
9b9ca18d9602 mt7615: remove dest from mt7615_mcu_msg_send signature
935b7e5edaba mt7615: mcu: remove skb_ret from mt7615_mcu_msg_send
2442db44c2ab mt7615: mcu: unify __mt7615_mcu_set_dev_info and mt7615_mcu_set_dev_info
645bc458e1ab mt7615: mcu: do not use function pointers whenever possible
40c4201c28bf mt7615: mcu: remove unused structure in mcu.h
a8834a233fa7 mt7615: mcu: use standard signature for mt7615_mcu_msg_send
824d25c44124 mt7615: initialize mt76_mcu_ops data structure
d9434275a872 mt7615: mcu: init mcu_restart function pointer
c2211e478c6e mt7615: mcu: run __mt76_mcu_send_msg in mt7615_mcu_send_firmware
cb63a06c403a mt76: mt7603: stop mac80211 queues before setting the channel
c6aaa3a2a9ea mt76: mt7615: rearrange cleanup operations in mt7615_unregister_device
97609f3708c7 mt76: mt7615: add static qualifier to mt7615_rx_poll_complete
f9dadd2d9377 mt76: mt7603: add debugfs knob to enable/disable edcca
89cda5d85498 mt7603: fix reading target tx power from eeprom
77d0e3378bd1 mt76: fix setting chan->max_power
f575da2f01a4 mt76: mt76x02: fix tx status reporting issues
a5d18dca9d3e mt76: mt76x02: fix tx reordering on rate control probing without a-mpdu
bd32a93e4996 mt76: mt76x02: remove enable from mt76x02_edcca_init signature
18386eef1d22 mt76: mt76x2u: remove mt76x02_edcca_init in mt76x2u_set_channel
da3514f6de4f mt76: mt76x2: move mutex_lock inside mt76x2_set_channel
0d4719c327ca mt76: mt76x02: run mt76x02_edcca_init atomically in mt76_edcca_set
fd5af7397257 mt76: mt76x02: fix edcca file permission
a0f51f276104 mt76: mt7615: do not process rx packets if the device is not initialized
753cdee4f6f6 mt76: mt7615: stop mcu first in mt7615_unregister_device
899efe755bae mt76: move mt76_insert_ccmp_hdr in mt76-module
6960b6e2d163 mt76: mt7615: add support for mtd eeprom parsing
4bcb0577daa5 mt76: mt7615: select wifi band according to eeprom
866f2c6cd0a2 mt76: generalize mt76_get_txpower for 4x4:4 devices
514fb04492a6 mt76: mt7615: add the capability to configure tx power
ced9d43a8a85 mt76: mt7615: init get_txpower mac80211 callback
8abd502a5f86 mt76: mt7615: rearrange locking in mt7615_config
5b9b62e0b00c mt76: move mt76_get_rate in mt76-module
661c7c8e1acc mt76: Remove set but not used variables 'pid' and 'final_mpdu'
f072c7ba2150 mt76: mt7615: enable support for mesh
28d9496205a6 mt76: mt7615: fix slow performance when enable encryption
827b9ade1672 mt76: mt7615: remove unused variable in mt7615_mcu_set_bcn
34eea1414b8b mt76: mt7615: remove key check in mt7615_mcu_set_wtbl_key
2bfae5a25251 mt76: usb: fix rx A-MSDU support
b0335320fc2c mt76: usb: do not always copy the first part of received frames
3e7fc1573c6f mt76x02: fix reporting of non-probing frames with tx status requested
0d5caead9765 Revert "mt76: usb: do not always copy the first part of received frames"
335e8c6baf77 Revert "mt76: usb: fix rx A-MSDU support"
47ddf4b722a1 mt76: revert support for TX_NEEDS_ALIGNED4_SKBS
0b6520bd1c98 mt7603: rework and fix tx status reporting
539b6796605c mt7603: improve hardware rate switching configuration
d86d6efa7214 mt76x0: fix RF frontend initialization for external PA
f476a14761ec mt76x02: fix endian issue in tx status reporting patch
f8d051785221 mt76: mt7615: simplify mt7615_mcu_set_sta_rec routine
73ff45f618fd mt76: mt7615: add support for per-chain signal strength reporting
9b67ae62d9ea mt76: mt7615: init per-channel target power
160fdc05e260 mt76: mt7615: take into account extPA when configuring tx power
2211d9370976 mt76: mt76x02u: fix sparse warnings: should it be static?
3750533a37a4 mt76: mt7615: fix incorrect settings in mesh mode
c37c1ca3fa01 mt76: mt7615: update peer's bssid when state transition occurs
9dd1089a29af mt76: mt76u: reduce rx memory footprint
0789f45e52c5 mt76: mt7615: remove cfg80211_chan_def from mt7615_set_channel signature
2dca431cd7fc mt76: move nl80211_dfs_regions in mt76_dev data structure
3386ccf7842b mt76: mt76u: get rid of {out,in}_max_packet
d680ab01cddd mt76: usb: fix rx A-MSDU support
6cafaca7225d mt7603: use READ_ONCE instead of ACCESS_ONCE
9e2e0b857710 mt76: round up length on mt76_wr_copy
e378ef1bc1e5 mt76: mt7615: fix sparse warnings: warning: restricted __le16 degrades to integer
7991dd7e25c8 mt76: mt7615: introduce mt7615_regd_notifier
901a4c7b7f8c mt76: mt7615: add hw dfs pattern detector support
57c600e5b945 mt76: mt7615: do not perform txcalibration before cac is complited
6afc9521962f mt76: mt7615: add csa support
8919516006e4 mt76: mt7615: add radar pattern test knob to debugfs
3be723cad7a9 mt76: mt7615: clean up FWDL TXQ during/after firmware upload
47fe37e22fdf mt76: mt7615: fall back to sw encryption for unsupported ciphers
bc5e0417939f mt76: mt7603: enable hardware rate up/down selection
ae760db52abc mt76: mt7615: move mt7615_mcu_set_rates to mac.c
2ae01f7e7715 mt76: mt7615: reset rate index/counters on rate table update
6f9837833baf mt76: mt7615: sync with mt7603 rate control changes
edbe88ec7c1f mt76: usb: fix endian in mt76u_copy
f43b6228facf mt76: usb: remove unneeded {put,get}_unaligned
5e1e5b75d6e8 mt76: usb: use full intermediate buffer in mt76u_copy
017d0ff097f7 mt76: mt76u: fix typo in mt76u_fill_rx_sg
2c0ccf1561c1 mt76: mt7615: always release sem in mt7615_load_patch
0c6f1a2b3c33 mt76: mt7615: introduce mt7615_mcu_send_ram_firmware routine
3dfc1eeffedf mt76: mt7615: fix sparse warnings: incorrect type in assignment (different base types)
947532099c3e mt76: mt7603: fix sparse warnings: warning: incorrect type in assignment (different base types)
e07451d27941 mt76: mt7615: fix sparse warnings: warning: cast from restricted __le16
b973bef0f87f mt7603: do not use tssi-off power value for mt7628
8fc3e6e02e96 mt76: mt7615: fix using VHT STBC rates
b21b99187a54 mt76: mt7615: fix PS buffering of action frames
3d43dd886951 mt76: mt7615: fix invalid fallback rates
0ce46825b8df mt76: mt7603: fix invalid fallback rates
3b08966d99ae Revert "mt76: usb: use full intermediate buffer in mt76u_copy"
48800e7b6088 Revert "mt76: usb: remove unneeded {put,get}_unaligned"
439354d54085 Revert "mt76: usb: fix endian in mt76u_copy"
8c1da9367beb mt76: usb: fix endian in mt76u_copy
307be50cc5f4 mt76: usb: remove unneeded {put,get}_unaligned
5d298297c00c mt76: mt76x02: use params->ssn value directly
f74d117ed41c mt76: mt7603: use params->ssn value directly
649f2e83742e mt76: mt7615: use params->ssn value directly
b647180c86be mt76: mt7615: unlock dfs bands
410923fa24de Revert accidental debugging change
3d7f7384bef0 mt76: mt7615: add missing register initialization
75656a4590a3 net: wireless: support of_get_mac_address new ERR_PTR error
fb0f432834c0 mt76: stop rx aggregation on station removal
76aada563b66 mt76: dma: reset q->rx_buf on rx reset
3245ca8b8aeb mt76: check of_get_mac_address for NULL as well to restore old kernel compat
8e495245ab3d mt76: mt7615: move mt7615_mac_get_key_info in mac.c
e4f48a8df6aa mt76: mt7615: add mt7615_mac_wtbl_addr routine
e8c95e5a41f0 mt76: mt7615: introduce mt7615_mac_wtbl_set_key routine
d998b90c4bed mt76: mt7615: remove wtbl_sec_key definition
60d279ec2762 mt76: mt7615: add set_key_cmd and mt76_wcid to mt7615_mac_wtbl_set_key signature
4947ad4eab6a mt76: introduce mt76_mmio_read_copy routine
4d9001b8ab1d mt76: mt7615: fix MT7615_WATCHDOG_TIME definition
3d6796b867b6 mt76: mt7603: fix watchdog rescheduling in mt7603_set_channel
8d7a48030005 mt76: mt7615: add 4 WMM sets support
ae0f11149248 mt76: mt7615: update cw_min/max related settings
8b7bbd017654 mt76: mt7603: fix some checkpatch warnings
e6045467848d mt76: mt7615: fix some checkpatch warnings
c415c676e255 mt76: mt76x02: fix some checkpatch warnings
f625afcedc9b mt76: switch to SPDX tag instead of verbose boilerplate text
4d57f1cee4aa mt76: mt7615: rework locking scheme for mt7615_set_channel
2becd13be766 mt76: mt7615: add Smart Carrier Sense support
20f0c196722a mt76: mt76x02: introduce mt76x02_pre_tbtt_enable and mt76x02_beacon_enable macros
ae83a05b1050 mt76: mt76x02: do not copy beacon skb in mt76x02_mac_set_beacon_enable
92fa62ace198 mt76: mt76x02u: enable multi-vif support
c6dabfe953af mt76: mt76x02u: enable survey support
1f44159b41ff mt76: mt7603: move survey_time in mt76_dev
9657e6304322 mt76: mt7615: enable survey support
af860c0decb1 mt76: move mt76_tx_tasklet in mt76 module
a9d2a28b39fc mt76: mt7603: remove unnecessary mcu queue initialization
281b10fc1fe6 mt76: mt7615: add BIP_CMAC_128 cipher support
37673a4181e4 mt76: fix some checkpatch warnings
a7fa32603981 mt76: add default implementation for mt76_sw_scan/mt76_sw_scan_complete
5c35bdf057af mt7615: apply calibration-free data from OTP
0e3baf0213c9 mt76: fix a leaked reference by adding a missing of_node_put
2d5928fef23d net: Remove dev_err() usage after platform_get_irq()
a0824197ab00 mt76: mt76x0e: disable 5GHz band for MT7630E
4d8a9f20610f mt76: do not send BAR frame on tx aggregation flush stop
2a0edbb4473b mt76: remove offchannel check in tx scheduling

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau 7c32f8eff0 mac80211: backport support for the IEEE80211_KEY_FLAG_GENERATE_MMIE flag
Required for an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 0441edfb7f)
5 years ago
Felix Fietkau 1a1a504a54 mac80211: add new minstrel_ht patches to improve probing on mt76x2
Also include follow-up regression fix from master

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commits 9861050b85 and f0992d7a30)
5 years ago
Paul Spooren 8bf8de95a2 imagebuilder: fix `make info` for empty SUPPORTED_DEVICES
For x86/64 (maybe more) target the SUPPORTED_DEVICES variable is empty
which causes the `&&` junction to fail, producing a non zero exit code.

Tested-by: Paul Spooren <mail@aparcar.org>
Fixed-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 07926d7def)
5 years ago
Hauke Mehrtens 7d300326ee mdadm: Use upstream fix for musl 1.1.23 compile
Fixes: d720f83f87 ("mdadm: Fix compile with musl 1.1.23")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ebbec2fdc6)
5 years ago
Hauke Mehrtens d720f83f87 mdadm: Fix compile with musl 1.1.23
This adds missing includes for sys/sysmacros.h which are needed with
musl libc 1.1.23.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ba8aeb02ea)
5 years ago
Hans Dedecker c85f9a245a odhcpd: remove socket from uloop upon NETEV_IFINDEX_CHANGE
949476e router: close socket upon NETEV_IFINDEX_CHANGE fixed

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Hauke Mehrtens b2cb6bb48a musl: Fix CVE-2019-14697
musl libc through 1.1.23 has an x87 floating-point stack adjustment
imbalance, related to the math/i386/ directory. In some cases, use of
this library could introduce out-of-bounds writes that are not present
in an application's source code.

This problem only affects x86 and no other architectures.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c262daf308)
5 years ago
Jo-Philipp Wich 5d906a656e uhttpd: update to latest Git HEAD
6b03f96 ubus: increase maximum ubus request size to 64KB

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d1f207ecc9)
5 years ago
Jo-Philipp Wich 190c5626ff uhttpd: add direct dependency on libjson-c
The OpenWrt buildroot ABI version rebuild tracker does not handle
transient dependencies, therefor add all libraries linked by uhttpd
as direct dependencies to the corresponding binary package definition.

This ensures that uhttpd is automatically rebuilt and relinked if any
of these libraries has its ABI_VERSION updated in the future.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a95ddaba02)
5 years ago
Hauke Mehrtens a2a311fc2b uhttpd: Fix format string build problems
91fcac34ac uhttpd: Fix multiple format string problems

Fixes: fc454ca153 libubox: update to latest git HEAD
Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 3c401f45c9)
5 years ago
Luiz Angelo Daros de Luca 3b34fcaf94 musl: ldso/dlsym: fix mips returning undef dlsym
This happens only the second time a library is loaded by dlopen().
After lib1 is loaded, dlsym(lib1,"undef1") correctly resolves the undef
symbol from lib1 dependencies. After the second library is loaded,
dlsym(lib2,"undef1") was returning the address of "undef1" in lib2
instead of searching lib2 dependencies.

Using upstream fix which now uses the same logic for relocation time
and dlsym.

Fixes openwrt/packages#9297

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
(cherry picked from commit 0d0617ff14)
5 years ago
Rosen Penev 6868188101 bzip2: Update to 1.0.8
It seems bzip2 was abandoned by the author and adopted by the sourceware
people. The last release of bzip2 was from 2010.

Several security bugs were fixed as well as others.

Fixed up PKG_LICENSE to be compatible with SPDX.

Changed URLs to point to the new home.

Added patch that gets rid of deprecated utime function and switches it to
utimensat.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
5 years ago
Eneas U de Queiroz b35e1360cd wolfssl: bump to 4.1.0-stable
Always build AES-GCM support.
Unnecessary patches were removed.

This includes two vulnerability fixes:

CVE-2019-11873: a potential buffer overflow case with the TLSv1.3 PSK
extension parsing.

CVE-2019-13628 (currently assigned-only): potential leak of nonce sizes
when performing ECDSA signing operations. The leak is considered to be
difficult to exploit but it could potentially be used maliciously to
perform a lattice based timing attack.

This brings the package up-to-date with master, so it incorporates
changes from 4.0.0 in master:
* Removed options that can't be turned off because we're building with
  --enable-stunnel, some of which affect hostapd's Config.in.
* Adjusted the title of OCSP option, as OCSP itself can't be turned off,
  only the stapling part is selectable.
* Mark options turned on when wpad support is selected.
* Add building options for TLS 1.0, and TLS 1.3.
* Add hardware crypto support, which due to a bug, only works when CCM
  support is turned off.
* Reorganized option conditionals in Makefile.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
5 years ago
Hauke Mehrtens 3809b6662d mac80211: Update to version 4.19.66-1
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hauke Mehrtens ac7ccf739a mac80211: Update to version 4.19.57
This updates to backports-4.19.57-1 which contains the wireless
subsystem and driver from kernel 4.19.57.
The removed patches are applied upstream.

Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Hans Dedecker 0f0ed2451e odhcpd: fix closing of router socket
c2d6032 router: fix previous commit

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Hauke Mehrtens 6db454e9b6 kernel: Activate CONFIG_OPTIMIZE_INLINING
This will reduce the size of the kernel if CONFIG_CC_OPTIMIZE_FOR_SIZE is
set like for all targets with small_flash feature flag.
I haven't seen any changes for an ARM64 target which optimizes the
kernel for speed instead.

On the ath79/tiny target the uncompressed kernel size was reduced by
3.2% and the compressed kernel size by 2.1%

kernel size with CONFIG_OPTIMIZE_INLINING=n
4346412 build_dir/target-mips_24kc_musl/linux-ath79_tiny/vmlinux
1391169 build_dir/target-mips_24kc_musl/linux-ath79_tiny/tplink_tl-wr941-v4-kernel.bin

Kernel size with CONFIG_OPTIMIZE_INLINING=y
4212396 build_dir/target-mips_24kc_musl/linux-ath79_tiny/vmlinux
1362051 build_dir/target-mips_24kc_musl/linux-ath79_tiny/tplink_tl-wr941-v4-kernel.bin

This change is currently pending for kernel 5.2 and already in
linux-next, this updates our patch to match the upstream version.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 6dac1c0a9b)
5 years ago
Klaus Kudielka e79f192c0a mvebu: sysupgrade: sdcard: fix platform_do_upgrade_sdcard
Unconditionally execute the final case statement, even if the disk layout
changed. This is necessary, to keep the original Turris Omnia flash
instructions working: The disk layout WILL change, when switching from
TurrisOS to OpenWRT. Without updating the uboot environment at the same
time, the user would end up with an unbootable system.

Fixes commit 2e5a0b81ec ("mvebu: sysupgrade: sdcard: keep user added ...")

Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
5 years ago
Tomasz Maciej Nowak 342bcb739f mvebu: enable xHCI USB controller connected to PCIe
This commit fixes regression on Linksys WRT1900 (Mamba) where this device
doesn't have USB 3.0 controller integrated in SoC, instead it has Etron
EJ168 connected to PCIe lane. Previously enabled in kernel 4.4 and 4.9,
was lost in transition to 4.14.

Fixes: 4ccad92 ("mvebu: Add support for kernel 4.14")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Hans Dedecker 45a26cb211 odhcpd: fix sending RA when link state brings bridge down
13928b3 router: close socket upon NETEV_IFINDEX_CHANGE

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
David Bauer d97c6d9f09 lantiq: unify Fritz!Box LED mappings
This commit unifies the LED mapping of the AVM Fritz!Box routers, which
have a combined Power/DSL LED.

With the stock firmware, the Power LED has the following
characteristics:

 - Blink when DSL sync is being established
 - Solid when DSL sync is present

We can't completely resemble this behavior in OpenWrt. Currently, the
Power LED is completely off, when DSL sync is missing. This is not
really helpful, as a user might have the impression, that he bricked his
device.

Instead, map the Info-LED to the state of the DSL connection.
There is no consistent behavior for the Info-LED in the stock
firmware, as the user can set it's function by himself. The DSL
connection state is one possible option for the Info LED there.

Also use the red Power LED to indicate a running upgrade, in case the
board has a two-color Power LED.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3032bf7f89)
5 years ago
Jo-Philipp Wich ce41f468e1 Revert "ath79: make target source-only"
This reverts commit 2b074654b0.

Due to popular demand, I've decided to revert this commit after
deliberating with Petr. This means that 19.07 will ship ath79 binary
images after all.

We do however consider the ath79 target on Kernel 4.14 in the 19.07
branch to be beta quality at best.

Acked-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Koen Vandeputte bc138c5b72 kernel: bump 4.14 to 4.14.138
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Russell Senior 46e9a9b04e tools/patch: apply upstream patch for cve-2019-13638
GNU patch through 2.7.6 is vulnerable to OS shell command injection that
can be exploited by opening a crafted patch file that contains an ed style

diff payload with shell metacharacters. The ed editor does not need to be
present on the vulnerable system. This is different from CVE-2018-1000156.

https://nvd.nist.gov/vuln/detail/CVE-2019-13638

Signed-off-by: Russell Senior <russell@personaltelco.net>
(cherry picked from commit bcfd1d7685)
5 years ago
David Bauer 61e51473c2 lantiq: add led-upgrade alias for Fritz!Box 7412
This adds the led-upgrade alias for the AVM Fritz!Box 7412 to indicate a
running firmware upgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 920abb9b58)
5 years ago
David Bauer b72fa3e4a8 lantiq: enable second VPE on Fritz!Box 7412
The AVM Fritz!Box 7412 does not use the VMMC part of the Lantiq chip but
rather a proprietary solution based on the DECT chip for the FXS ports.

Therefore, the second VPE can be enabled for use with OpenWrt.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 891a700759)
5 years ago
David Bauer 5355665cc8 lantiq: correct Fritz!Box 7412 button logic level
The AVM FRITZ!Box 7412 buttons are both active low, which is currently
incorrectly defined in the device-tree.

This leads to the device booting directly into failsafe.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c12947b39e)
5 years ago
Johann Neuhauser af2ceb93d7 lantiq: use wpad-basic for boards with enough storage
This commit selects wpad-basic for the FRITZ!Box 7312 and 7412 as
wpad-mini is only selected on boards with small flash.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
[add short description]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit c3c3cd5e4a)
5 years ago
Hans Dedecker 30798132bf odhcpd: fix lingering uloop socket descriptor
e9e8240 router: fix lingering uloop socket descriptor

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Koen Vandeputte 62eae4805b ar71xx: ag71xx: init rings with GFP_KERNEL
ar71xx got lost during final rebase ..

Fixes: c8a6ce71e4 ("ar71xx/ath79: ag71xx: init rings with GFP_KERNEL")
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte c8a6ce71e4 ar71xx/ath79: ag71xx: init rings with GFP_KERNEL
Upstream commit	246902bdf562d45ea3475fac64c93048a7a39f01

Which contains following explanation:

--
There is no need to use GFP_ATOMIC here, GFP_KERNEL should be enough.
The 'kcalloc()' just a few lines above, already uses GFP_KERNEL.
--

Looking at the code, all other descriptors also use plain GFP_KERNEL

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte dda342abba ar71xx/ath79: ag71xx: fix sleep in atomic
When enabling atomic-sleep-debugging options in the kernel,
following splat is seen when disabling the interface (which happens on boot):

[   10.892878] eth0: link down
[   10.896788] BUG: sleeping function called from invalid context at net/core/dev.c:5563
[   10.904730] in_atomic(): 1, irqs_disabled(): 1, pid: 425, name: ip
[   10.911004] 2 locks held by ip/425:
[   10.914539]  #0:  (rtnl_mutex){....}, at: [<80377474>] rtnetlink_rcv_msg+0x2d8/0x380
[   10.922441]  #1:  (&(&ag->lock)->rlock){....}, at: [<80330158>] ag71xx_hw_disable+0x24/0x94
[   10.930976] CPU: 0 PID: 425 Comm: ip Not tainted 4.14.136 #0
[   10.936716] Stack : 805e0000 80589228 80557404 876998ec 80610000 80610000 87cdcafc 805b5327
[   10.945233]         80551534 000001a9 8061386c 87699ccc 87cfb180 00000001 876998a0 84f70903
[   10.953751]         00000000 00000000 80b00000 8769979c 6a7407fa 00000000 00000007 00000000
[   10.962270]         000000b7 16d0954a 000000b6 00000000 80000000 87cb658c 87cb65b0 00000001
[   10.970787]         8046f97c 87699ccc 87cfb180 87ff2810 00000003 802ce724 0806e098 80610000
[   10.979306]         ...
[   10.981797] Call Trace:
[   10.984287] [<8006cb0c>] show_stack+0x58/0x100
[   10.988814] [<800aab34>] ___might_sleep+0x100/0x120
[   10.993774] [<8035c434>] napi_disable+0x30/0xd8
[   10.998377] [<80330198>] ag71xx_hw_disable+0x64/0x94
[   11.003418] [<8033069c>] ag71xx_stop+0x24/0x38
[   11.007959] [<80359e30>] __dev_close_many+0xcc/0x104
[   11.013009] [<80362eac>] __dev_change_flags+0xc8/0x1ac
[   11.018227] [<80362fb8>] dev_change_flags+0x28/0x70
[   11.023182] [<80376890>] do_setlink+0x31c/0x91c
[   11.027786] [<80379360>] rtnl_newlink+0x3ec/0x7f8
[   11.032563] [<80377498>] rtnetlink_rcv_msg+0x2fc/0x380
[   11.037799] [<8039a734>] netlink_rcv_skb+0xd4/0x178
[   11.042754] [<80399d10>] netlink_unicast+0x168/0x250
[   11.047796] [<8039a2d4>] netlink_sendmsg+0x3d8/0x434
[   11.052841] [<8033f0e4>] ___sys_sendmsg+0x1dc/0x290
[   11.057794] [<80340140>] __sys_sendmsg+0x54/0x84
[   11.062495] [<8007212c>] syscall_common+0x34/0x58

This is caused by calling napi_disable() while holding the spinlock.

Fix it by omitting the spinlock, which is not required here
Extensively tested on GL-MiFi, RB-912 and RB-922 hardware

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 33af038bec kernel: bump 4.14 to 4.14.137
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Jo-Philipp Wich 872cbcc628 config: introduce separate CONFIG_SIGNATURE_CHECK option
Introduce a new option CONFIG_SIGNATURE_CHECK which defaults to the value
of CONFIG_SIGNED_PACKAGES and thus is enabled by default.

This option is needed to support building target opkg with enabled
signature verification while having the signed package lists disabled.

Our buildbots currently disable package signing globally in the
buildroot and SDK to avoid the need to ship private signing keys to
the build workers and to prevent the triggering of random key generation
on the worker nodes since package signing happens off-line on the master
nodes.

As unintended side-effect, updated opkg packages will get built with
disabled signature verification, hence the need for a new override option.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f565f276e2)
5 years ago
Petr Štetiar ff550dae32 adb: fix build breakage on recent musl
Fix build breakage as upstream has removed implicit include of
sys/sysmacros.h from sys/types.h:

 remove implicit include of sys/sysmacros.h from sys/types.h

 this reverts commit f552c792c7ce5a560f214e1104d93ee5b0833967, which
 exposed the sysmacros.h macros (device major/minor calculations) for
 BSD and GNU profiles to mimic an unintentional glibc behavior some
 code depended on. glibc has deprecated and since removed them as the
 resolution to bug #19239, so it makes no sense for us to keep this
 behavior. affected code should all have been fixed by now, and if it's
 not yet fixed it needs to be for use with modern glibc anyway.

Ref: https://git.musl-libc.org/cgit/musl/commit/include/sys/types.h?id=a31a30a0076c284133c0f4dfa32b8b37883ac930
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 79596f782e)
5 years ago
Jo-Philipp Wich 4fd7a30c70 packages: apply usign padding workarounds to package indexes if needed
Since usign miscalculates SHA-512 digests for input sizes of exactly
64 + N * 128 + 110 or 64 + N * 128 + 111 bytes, we need to apply some
white space padding to avoid triggering the hashing edge case.

While usign itself has been fixed already, there is still many firmwares
in the wild which use broken usign versions to verify current package
indexes so we'll need to carry this workaround in the forseeable future.

Ref: https://forum.openwrt.org/t/signature-check-failed/41945
Ref: https://git.openwrt.org/5a52b379902471cef495687547c7b568142f66d2
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e1f588e446)
5 years ago
Jo-Philipp Wich 7a10c7b882 usign: update to latest Git HEAD
This update fixes usign signature verification on files with certain
file sizes triggering a bug in the shipped SHA-512 implementation.

5a52b37 sha512: fix bad hardcoded constant in sha512_final()
3e6648b README: replace unicode character
716c3f2 README: add reference to OpenBSD signify
86d3668 README: provide reference for ed25519 algorithm
939ec35 usign: main.c: describe necessary arguments for -G

Ref: https://forum.openwrt.org/t/signature-check-failed/41945
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 991dd5a893)
5 years ago
Koen Vandeputte bcbc7ba768 kernel: bump 4.14 to 4.14.136
Refreshed all patches.

Altered patches:
- 306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch

Remove upstreamed:
- 100-powerpc-4xx-uic-clear-pending-interrupt-after-irq-ty.patch
- 088-0002-i2c-qup-fixed-releasing-dma-without-flush-operation.patch
- 500-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch

Fixes:
- CVE-2019-13648
- CVE-2019-10207

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
David Bauer 0f3d54f5b7 mpc85xx: correct OCEDO Panda LED definition
WLAN0 and the unused LED are currently swapped. Fix this, so the LED
behavior matches the other OCEDo devices.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit a3a2b4857e)
5 years ago
Russell Senior a941d39460 tools/patch: apply upstream patch for CVE-2019-13636
In GNU patch through 2.7.6, the following of symlinks is mishandled in
certain cases other than input files. This affects inp.c and util.c.

https://nvd.nist.gov/vuln/detail/CVE-2019-13636

Signed-off-by: Russell Senior <russell@personaltelco.net>
(cherry picked from commit 995bcc5329)
5 years ago
Petr Štetiar 53b61baac6 scripts/ubinize-image.sh: fix buildbot breakage
New Docker based buildslaves install just bare minimum of packages, thus
not having bsdmainutils package installed which provides `hexdump`
utility, leading to the following build breakage on buildbots:

 ubinize-image.sh: 12: /builder/scripts/ubinize-image.sh: hexdump: not found

So this patch simply replaces `hexdump` with `od` utility provided by
coreutils package, which should be likely available.

Co-authored-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c6d41c320c)
5 years ago
David Bauer 862352cdbd ar71xx: fix HiveAP 121 PLL for 1000M
The Aerohive HiveAP 121 has the wrong PLL value set for Gigabit speeds,
leading to packet-loss. 10M and 100M work fine.

This commit sets the Gigabit Ethernet PLL value to the correct value,
fixing packet loss.

Confirmed with iperf and floodping.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit cb49e46a8a)
5 years ago
Koen Vandeputte a654ac0d6e ar71xx: really fix Mikrotik board detection
commit e09da0169a ("ar71xx: fix Mikrotik board detection")
was generated based on testing a rb-912 board, on which detection failed.

Testing on more hardware shows something fun:

machine	: MikroTik RouterBOARD 922UAGS-5HPacD
machine	: Mikrotik RouterBOARD 912UAG-5HPnD

Both lowercase and uppercase are used.
So ensure we support both now ..

Fixes: e09da0169a ("ar71xx: fix Mikrotik board detection")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 845b2a1cfe)
5 years ago
Koen Vandeputte 19f768f691 toolchain/musl: bump to version 1.1.23
new features:
- riscv64 port
- configure now allows customizing AR and RANLIB vars
- header-level support for new linux features in 5.1

major internal changes:
- removed extern __syscall; syscall header code is now fully self-contained

performance:
- new math library implementation for log/exp/pow
- aarch64 dynamic tlsdesc function is streamlined

compatibility & conformance:
- O_TTY_INIT is now defined
- sys/types.h no longer pollutes namespace with sys/sysmacros.h in any profile
- powerpc asm is now compatible with clang internal assembler

changes for new POSIX interpretations:
- fgetwc now sets stream error indicator on encoding errors
- fmemopen no longer rejects 0 size

bugs fixed:
- static TLS for shared libraries was allocated wrong on "Variant I" archs
- crash in dladdr reading through uninitialized pointer on non-match
- sigaltstack wrongly errored out on invalid ss_size when doing SS_DISABLE
- getdents function misbehaved with buffer length larger than INT_MAX
- set*id could deadlock after fork from multithreaded process

arch-specfic bugs fixed:
- s390x SO_PEERSEC definition was wrong
- passing of 64-bit syscall arguments was broken on microblaze
- posix_fadvise was broken on mips due to missing 7-arg syscall support
- vrregset_t layout and member naming was wrong on powerpc64

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 4fd61b6220 kernel: bump 4.14 to 4.14.134
Refreshed all patches.

Remove upstreamed:
- 049-v4.20-mips-remove-superfluous-check-for-linux.patch

Fixes:
- CVE-2019-3846
- CVE-2019-3900

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 ago
Koen Vandeputte 8c57d88fcc imx6: bump SDMA firmware to 3.5
- add uart rom script address in header of sdma firmware to support
  the uart driver of latest kernel working well while old firmware
  assume ram script used for uart driver as NXP internal legacy
  kernel.
- add multi-fifo SAI/PDM scripts.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 819b6345a206ad182dd3c2d786a3d7f04e33f751)
5 years ago
Petr Štetiar 2b074654b0 ath79: make target source-only
In order to prevent build of images for this release as ath79 is going
to deprecate ar71xx in the next release.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Koen Vandeputte 1172d809f2 ar71xx: fix Mikrotik board detection
Fix a typo in the machine type being extracted from /proc/cpuinfo
which causes all Mikrotik board to be undetected properly.

This lead to sysupgrade issues and probably some others too.

Fixes: 76c963bb01 ("ar71xx: base-files: fix board detect on new MikroTik devices")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Tomislav Požega 5ec609815e ar71xx: fix WLAN LED names for Archer C7
Update WLAN LED colour identifier for both interfaces on Archer C7

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
(cherry picked from commit 65762cdd22)
5 years ago
Tomislav Požega be14b1feae ar71xx: fix system LED names on Archer C5/C7
Move system LED board definitions of Archer C5/C7 to reflect
actual system LED colour used

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
(cherry picked from commit a73934fc9a)
5 years ago
Tomislav Požega c59e24ca30 ar71xx: Archer C7 v1 LED names and RFKILL fixes
All leds on these boards are green. v1 has RFKILL GPIO 23 for production
units (it had GPIO 13 only for test phase units, and these are rather
very rare to find). As for the previous attempt to fix this and revert
due to WDR boards have blue leds, it was wrong: WDR board does not use
common setup (false).

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
(cherry picked from commit c79c001b59)
5 years ago
Tomislav Požega 3c65433186 ar71xx: update qca-usb-quirks patch
Base address for USB0 has changed from 0x18116c94 on AR934X
to 0x18116d94 on QCA9558. CP Typo remained for years here...

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
(cherry picked from commit fd5aa19480)
5 years ago
Rafał Miłecki 8efccf76f8 mac80211: brcm: improve brcmfmac debugging of firmware crashes
This provides a complete console messages dump.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 6a7b201b6c)
5 years ago
Rafał Miłecki d8c59fa699 mac80211: brcm: update brcmfmac 5.4 patches
Use commits from wireless-drivers-next.git.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8e466fb7e3)
5 years ago
Biwen Li e0f468864b tfa-layerscape: fix create_pbl and byte_swap host build
- make create_pbl and byte_swap as host tools

- fix a bug that maybe use the cross compiler
to compile create_pbl and byte_swap:

	# -a option appends the image for Chassis 3 devices in case of non secure boot
	aarch64-openwrt-linux-musl-gcc -Wall -Werror -pedantic -std=c99 -O2
	 -DVERSION=v1.5(release):reboot-10604-ge9216b3336 -D_GNU_SOURCE -D_XOPEN_SOURCE=700
	 -c -o create_pbl.o create_pbl.c
	cc1: note: someone does not honour COPTS correctly, passed 0 times
	  LD      create_pbl
	/usr/bin/ld: create_pbl.o: Relocations in generic ELF (EM: 183)
	/usr/bin/ld: create_pbl.o: Relocations in generic ELF (EM: 183)
	/usr/bin/ld: create_pbl.o: Relocations in generic ELF (EM: 183)
	create_pbl.o: error adding symbols: File in wrong format
	collect2: error: ld returned 1 exit status
	Makefile:43: recipe for target create_pbl failed
	make[4]: *** [create_pbl] Error 1
	plat/nxp/tools/pbl_ch2.mk:45: recipe for target pbl failed
	make[3]: *** [pbl] Error 2

- add tfa- prefix to all tools in order to avoid future clashes with
  other toolnames

Signed-off-by: Biwen Li <biwen.li@nxp.com>
[added missing HOST_CFLAGS, added tfa- prefix to the tools]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 83d5ca2186)
5 years ago
Petr Štetiar 94e9084e1e tfa-layerscape: fix fiptool host build
fiptool is a host tool, used in a firmware generation pipeline, but it's
not treated as such, leading to the build breakage on the hosts which
don't have {Open,Libre}SSL dev package installed:

 In file included from fiptool.h:16:0,
                 from fiptool.c:19:
		 fiptool_platform.h:18:27: fatal error: openssl/sha.h:
		 No such file or directory
		  #  include <openssl/sha.h>

So this patch promotes fiptool into the host tool with proper host
include and library paths under STAGING_DIR.

Ref: https://github.com/openwrt/openwrt/pull/2267
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b8249cef9f)
5 years ago
Jo-Philipp Wich 0a64b70e4e openwrt-keyring: update to Git HEAD
8080ef3 usign: add 19.07 release build pubkey
e24fe0d usign: use distro agnostic comments
251ded7 usign: fix filename of Stijn's usign key
14f0efc gpg: update snapshots public signing key
14f845b gpg: replace my public GPG key
4f735b8 gpg: add OpenWrt 19.07 signing key
228f8da gpg: add OpenWrt 18.06 v2 signing key
36057d9 gpg: update LEDE 17.01 public signing key
f2989ab Add my public GPG and usign key

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e9216b3336)
5 years ago
Petr Štetiar 5100629e32 urngd: move project to git.openwrt.org
Let's move project to a proper place.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit bec8fb1ee7)
5 years ago
Petr Štetiar a624821474 build: add urandom-seed and urngd to default packages set
urandom-seed content was split from base-files into separate package so
in order to preserve the current functionality and to provide some
fallback mechanism in case jent-rng initialization fails in urngd we
need to add it back.

urngd is OpenWrt's micro non-physical true random number generator based
on timing jitter.

Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f5387b754f)
5 years ago
Petr Štetiar f573d3de11 base-files: move urandom seed bits into separate package
So it's possible to install or remove it as needed.

Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 27bfde9c9f)
5 years ago
Petr Štetiar 81c5a5c4b3 ubox: move getrandom into separate getrandom package
So it's possible to install or remove it as needed.

Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 9b4de712ca)
5 years ago
Petr Štetiar 5082c1b204 urngd: add micro non-physical true RNG based on timing jitter
μrngd is OpenWrt's micro non-physical true random number generator based
on timing jitter.

Using the Jitter RNG core, the rngd provides an entropy source that
feeds into the Linux /dev/random device if its entropy runs low. It
updates the /dev/random entropy estimator such that the newly provided
entropy unblocks /dev/random.

The seeding of /dev/random also ensures that /dev/urandom benefits from
entropy. Especially during boot time, when the entropy of Linux is low,
the Jitter RNGd provides a source of sufficient entropy.

Acked-by: Jo-Philip Wich <jow@mein.io>
Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 714bd89fce)
5 years ago
Rafał Miłecki bc0c0a5564 mac80211: brcm: backport first set of 5.4 brcmfmac changes
This doesn't include 9ff8614a3dbe ("brcmfmac: use separate Kconfig file
for brcmfmac") due to a few conflicts with backports changes.

An important change is:
[PATCH 2/7] brcmfmac: change the order of things in brcmf_detach()
which fixes a rmmod crash in the brcmf_txfinalize().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit db8e08a5a4)
5 years ago
David Bauer abe137ff5e ramips: add support for ASUS RT-AC57U
SoC:   MediaTek MT7621AT
RAM:   128M (Winbond W631GG6KB-15)
FLASH: 16MB (Spansion S25FL128SA)
WiFi:  MediaTek MT7603EN bgn 2SS
WiFi:  MediaTek MT7612EN nac 2SS
BTN:   Reset - WPS
LED:    - Power
        - LAN {1-4}
        - WAN
        - WiFi 2.4 GHz
        - WiFi 5 GHz
        - USB
UART:  UART is present next to the Power LED.
       TX - RX - GND - 3V3 / 57600-8N1
       3V3 is the nearest one to the Power LED.

Installation
------------
Via TFTP:
1. Set your computers IP-Address to 192.168.1.75.
2. Power up the Router with the Reset button pressed.
3. Release the Reset button after 5 seconds.
4. Upload OpenWRT sysupgrade image via TFTP:
 > tftp -4 -v -m binary 192.168.1.1 -c put <IMAGE>

Via SSH:
Note: User/password for SSH is identical with the one used in the
Web-interface.
1. Complete the initial setup wizard.
2. Activate SSH under "Administration" -> "System".
3. Transfer the OpenWrt sysupgrade image via scp:
 > scp owrt.bin admin@192.168.1.1:/tmp
4. Connect via SSH to the router.
 > ssh admin@192.168.1.1
5. Write the OpenWrt image to flash.
 > mtd-write -i /tmp/owrt.bin -d linux
6. Reboot the router
 > reboot

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 14e0e4f138)
5 years ago
David Bauer 5cd9b50d69 ath79: add support for devolo WiFi pro 1750x
Hardware
--------
CPU:   Qualcomm Atheros QCA9558
RAM:   128M DDR2
FLASH: 16MiB
ETH:   1x Atheros AR8035 (PoE in)
WiFi2: QCA9558 3T3R
WiFi5: QCA9880 3T3R
BTN:   1x Reset
LED:   1x LED Power (non-controllable)
       1x LED Status (internal)
       1x LED LAN (controlled by PHY)
       1x LED WLAN
BEEP:  1x GPIO attached piezo beeper
UART:  3.3V GND TX RX (115200-N-8) (3.3V is square pad)
       Header is located next to external-LED header.

Installation
------------
Make sure you set a password for the root user as prompted on first
setup!

1. Upload OpenWRT sysupgrade image via SSH to the device.
Use /tmp as the destination folder on the device.
User is root, password the one set in the web interface.

2. Install OpenWRT with

> sysupgrade -n -F /tmp/<openwrt-image-name>

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit cb3cd52694)
5 years ago
Etienne Champetier 76a4c93f9d ar71xx: enable SGMII fixup on Mikrotik wAP AC
fixes intermittent loss of connectivity on 1Gbit port, with log message:
> 803x_aneg_done: SGMII link is not ok

Thanks to David Bauer for pointing me in the right direction.
I just had to figure out the right bus_id, which you find in this log:
> ag71xx ag71xx.1: connected to PHY at gpio-1:00 [uid=004dd074,
  driver=Atheros 8031 ethernet]

Fixes FS#2236

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
[Wrapped commit message - Fixed whitespace erors]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 2a7519e29d)
5 years ago
Petr Štetiar 4022035aaf mt7620: disable image generation for Netgear EX2700
Image generation is currently failing on builbots due to the following
error:

 WARNING: Image file [...] mt7620-ex2700-squashfs-factory.bin is too big

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Alberto Bursi 299faa7ab7 x86: add modern network modules to Generic target
Many Atom-based embedded/industrial x86 boards can't run 64bit operating
systems due to either processor or board firmware limitations, but they
have modern interfaces (PCIe) or have modern Intel gigabit controllers
onboard.  With the current default package selection for x86 Generic
target their network won't work.

Add the modern gigabit network modules needed or most likely going to be
used as add-in cards, similar to what is the list on x86_64 target.

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
[fixed whitespace issue]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit bb27cde257)
5 years ago
Petr Štetiar 2938d6530a ath25: disable image generation for ubnt2 and ubnt5 devices
Image generations is currently failing on builbots due to the following
errors:

 mkfwimage -B XS2 -v XS2 [...] ath25-ubnt2-squashfs-sysupgrade.bin
 ERROR: Failed creating firmware layout description - error code: -2

 mkfwimage -B XS5 -v XS5 [...] ath25-ubnt5-squashfs-sysupgrade.bin
 ERROR: Failed creating firmware layout description - error code: -2

That cryptic -2 error simply means, that kernel+rootfs doesn't fit into
the firmware partition.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
David Bauer 6d59f4eeb4 gpio-button-hotplug: unify polled and interrupt code
This patch unifies the polled and interrupt-driven gpio_keys code
paths as well implements consistent handling of the debounce
interval set for the GPIO buttons and switches.

Hotplug events will only be fired if

1. The input changes its state and remains stable for the duration
   of the debounce interval (default is 5 ms).

2. In the initial stable (no state-change for duration of the
   debounce interval) state once the driver module gets loaded.

   Switch type inputs will always report their stable state.
   Unpressed buttons will not trigger an event for the initial
   stable state. Whereas pressed buttons will trigger an event.
   This is consistent with upstream's gpio-key driver that uses
   the input subsystem (and dont use autorepeat).

Prior to this patch, this was handled inconsistently for interrupt-based
an polled gpio-keys. Hence this patch unifies the shared logic into the
gpio_keys_handle_button() function and modify both implementations to
handle the initial state properly.

The changes described in 2. ) . can have an impact on the
failsafe trigger. Up until now, the script checked for button
state changes. On the down side, this allowed to trigger the
failsafe by releasing a held button at the right time. On the
plus side, the button's polarity setting didn't matter.

Now, the failsafe will only engage when a button was pressed
at the right moment (same as before), but now it can
theoretically also trigger when the button was pressed the
whole time the kernel booted and well into the fast-blinking
preinit phase. However, the chances that this can happen are
really small. This is because the gpio-button module is usually
up and ready even before the preinit state is entered. So, the
initial pressed button event gets lost and most devices behave
as before.

Bisectors: If this patch causes a device to permanently go into
failsafe or experience weird behavior due to inputs, please
check the following:
 - the GPIO polarity setting for the button
 - the software-debounce value

Run-tested for 'gpio-keys' and 'gpio-keys-polled' on

 - devolo WiFi pro 1200e
 - devolo WiFi pro 1750c
 - devolo WiFi pro 1750x
 - Netgear WNDR4700
 - Meraki MR24
 - RT-AC58U

Signed-off-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [further
cleanups, simplification and unification]
(cherry picked from commit 27f3f493de)
5 years ago
Petr Štetiar 074c8e296c gpio-button-hotplug: fix 4.19 build breakage on malta/be64
While testing 4.19 build on malta/be64, I've encountered following
error:

 gpio-button-hotplug/gpio-button-hotplug.c:529:18: error: implicit
 declaration of function 'gpio_to_desc'

which is caused by the missing include fixed by this patch.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit dd6d82112a)
5 years ago
Adrian Schmutzler 96cc390d88 ath79: Use -v1 suffix for TP-Link WDR3600/4300
In ath79, identifiers tplink_tl-wdr3600 and tplink_tl-wdr4300 have
been used while most other TP-Link devices include the revision.

Although there actually is only one major revision of these
devices, they bear the revision on their bottom (v1.x). TP-Link
also refers to the devices as V1 on its web page.

This patch thus adds -v1 to both so it is more consistent
with other devices and with what you would expect from reading
the on-device sticker and the support pages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Matt Merhar c0a715f75e openvpn: fix handling of list options
This addresses an issue where the list option specified in
/etc/config/openvpn i.e. 'tls_cipher' would instead show up in the
generated openvpn-<name>.conf as 'ncp-ciphers'. For context,
'ncp_ciphers' appears after 'tls_cipher' in OPENVPN_LIST from
openvpn.options.

Also, the ordering of the options in the UCI config file is now
preserved when generating the OpenVPN config. The two currently
supported list options deal with cipher preferences.

Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
(cherry picked from commit 1d4c4cbd20)
5 years ago
Petr Štetiar 0254087e92 ath79: ar9330: add missing watchdog node
It was reported in FS#2385, that Carambola2 doesn't currently have
working watchdog so fix it by adding watchdog node.

Ref: FS#2385
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 0893f28e19)
5 years ago
Deng Qingfang 7a4acfce6d iptables: update to 1.8.3
Update iptables to 1.8.3

ChangeLog:
  https://netfilter.org/projects/iptables/files/changes-iptables-1.8.3.txt

Removed upstream patches:
- 001-extensions_format-security_fixes_in_libip.patch
- 002-include_fix_build_with_kernel_headers_before_4_2.patch
- 003-ebtables-vlan-fix_userspace_kernel_headers_collision.patch

Altered patches:
- 200-configurable_builtin.patch
- 600-shared-libext.patch

No notable size changes

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [lipibtc ABI_VERSION fix]
(cherry picked from commit 299f6cb2da)
5 years ago
Rafał Miłecki 74b0b42fc6 libroxml: bump to the 3.0.2 version
* Fix for memory leak regression
* Support for (un)escaping

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 430d65c544)
5 years ago
Petr Štetiar 48662712b2 fstools: add direct dependencies on libblobmsg-json and libjson-c
The OpenWrt buildroot ABI version rebuild tracker does not handle
transient dependencies, therefore add all libraries linked by
block-mount and blockd as direct dependencies to the corresponding
binary package definition.

This ensures that block-mount and blockd is automatically rebuilt and
relinked if any of these libraries has its ABI_VERSION updated in the
future.

Fixes: FS#2373
[jow: similar fix for procd and 98.42% of commit message]
Signed-off-by: Jo-Philip Wich <jow@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit cbae306815)
5 years ago
Yousong Zhou 1c3587cad9 busybox: strip off ALTERNATIVES spec
Now that busybox is a known alternatives provider by opkg, we remove the
ALTERNATIVES spec and add a note to make the implicit situation clear

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry-picked from commit 62be427067)
5 years ago
Yousong Zhou 8936bdb269 opkg: bump to version 2019-06-14
Opkg starting from this version special-cases busybox as alternatives
provider.  There should be no need to add entries to ALTERNATIVES of
busybox package

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry-picked from commit e51b513f75)
5 years ago
Koen Vandeputte b947de25a6 ar71xx: fix nand init issues on some rb2011 devices
While flashing lots of RB2011 devices, I noticed that
some of them refused to boot properly, failing over the NAND parameters.

Checking in detail shows that some device seem to use another NAND flash
which only support standard 2048-byte pages, without 512-byte subpage support.

This commit disables usage of these small subpage completely.

Advantages:
- Both NAND's with(out) subpage support are working now
- The nand speed increases a bit (measured roughly 1%) in typical usecases

Disadvantages:
- The maximum storage capacity decreases by ~0.2%
as small changes can consume a full page (2048 bytes) now.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 519cdf377a kernel: delete leftovers from unused kernel versions
Commit 000d400baa ("kernel: drop everything not on kernel version 4.14")
dropped everything not related to kernel 4.14, but forgot
to remove the parts in kernel-version.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte f40f7b0fb5 kernel: bump 4.14 to 4.14.133
Refreshed all patches.

Fixes:

- CVE-2019-3900

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 ago
Hauke Mehrtens 87457ad81b mac80211: Do not build b43legacy on BRCM47xx mips74 subtarget
b43legacy needs ssb support and we do not compile the mips74 subtarget
of the brcm47xx target with SSB support. This causes a build failure in
the mac80211 package and only some of the kernel modules are being
created.

I am not aware of any device with a BRCM47xx mips74 CPU which uses a
b43legacy compatible device.

Fixes: FS#2334
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e05310b9b8)
5 years ago
Fredrik Olofsson 955b393cf0 kernel: cherry pick patch removing __linux__ check
This is already included in newer upstream. Needed to build BPF programs
using the MIPS kernel include files.

Without this patch, clang fails with "#error Use a Linux compiler or
give up." in sgidefs.h when building BPF programs.

Signed-off-by: Fredrik Olofsson <fredrik.olofsson@anyfinetworks.com>
(cherry-picked from commit 7d96c301d6)
5 years ago
Adrian Schmutzler 65034359ee base-files: Fix path check in get_mac_binary
Logic was inverted when changing from string check to file check.
Fix it.

Fixes: 8592602d0a ("base-files: Really check path in get_mac_binary")
Reported-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6ed3349308)
5 years ago
Koen Vandeputte 7f4510a251 kernel: bump 4.14 to 4.14.132
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Hauke Mehrtens 411e42cdc6 wolfssl: Fix package hash
Fixes: 3167a57f72 ("wolfssl: update to 3.15.7, fix Makefile")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Konstantin Demin 5ef6c20183 netsupport: move out mqprio from kmod-sched
Currently, there's unable to install "kmod-sched-mqprio" after
"kmod-sched" (or vice versa), because "sch_mqprio.ko" is
shipped in both packages.

Fixes: f83522fa63 ("linux: Add kmod-sched-mqprio")
Fixes: 6af639e0bf ("linux: Add kmod-sched-act-vlan")
Fixes: 72c7e2dc46 ("linux: Add kmod-sched-flower")
Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
[Add cls_flower and act_vlan]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Eneas U de Queiroz 3167a57f72 wolfssl: update to 3.15.7, fix Makefile
This includes a fix for a medium-level potential cache attack with a
variant of Bleichenbacher’s attack.  Patches were refreshed.
Increased FP_MAX_BITS to allow 4096-bit RSA keys.
Fixed poly1305 build option, and some Makefile updates.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 2792daab5a)
5 years ago
Adrian Schmutzler cd4fcd46f1 base-files: Really check path in get_mac_binary
Currently, path argument is only checked for being not empty.

This changes behavior to actually check whether path exists.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Pawel Dembicki acd2497cfb mpc85xx: Use gzip compressed kernel on HiveAP-330
After commit 1e41de2f48 ("mpc85xx: convert TL-WDR4900 v1 to simpleImage")
XZ compression of zImage was enabled. This change exposed a problem with
the HiveAP-330 images, which was fixed by foregoing the compression on
the kernel altogether with commit 98089bb8ba
("mpc85xx: Use uncompressed kernel on the HiveAP-330").

This patch adds back the gzip compression of the kernel image by
utilizing the generic OpenWRT uImage method instead of relying on
the PowerPC bootwrapper script that did it previously.

Compile-tested: p1020/hiveap-330

Tested-by: Chris Blake <chrisrblake93@gmail.com> [run-tested]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[filled in even more text]
5 years ago
Mathias Kresin 1b99051399 lantiq: enable STP where referenced
While moving common used parts to dtsi files, the was disabled by
default but not enabled for all boards using the STP.

Fixes: f519fea4c6 ("lantiq: kernel 4.14: cleanup dts files")

Reported-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
5 years ago
W. Michael Petullo cb9db2a0c3 ar71xx: fix ath79/rb4xx IRQ initialization on kernel 4.14
Apply the same approach as in commit 3b53d6fdbc ("ar71xx: fix pci irq
init on kernel 4.14") to fix IRQ initialization for ath79-based chipsets
on rb4xx.

Ref: PR#2182
Acked-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: W. Michael Petullo <mike@flyn.org>
[commit ref fix]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8c7d6c47a7)
5 years ago
Karel Kočí 4a7a8d93fa fstools: block-mount: fix restart of fstab service
Restarting service causes file-systems to be unmounted without being
mounted back. When this service was obsoleted it should have been
implemented in a way that all actions are ignored. Up to this commit
default handler was called when restart was requested. This default
handler just simply calls stop and start. That means that stop called
unmount but start just printed that this service is obsoleted.

This instead implements restart that just prints same message like start
does. It just calls start in reality. This makes restart unavailable for
call.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
(cherry picked from commit 3ead9e7b74)
5 years ago
Brett Mastbergen 34d3eaff4a mvebu: Fix platform.sh for non-generic espressobin versions
When the non-generic espressobin targets were added these board checks
were not updated.   One side effect of this is that config is not saved
during an upgrade of -emmc,-v7, or -v7-emmc devices.

Signed-off-by: Brett Mastbergen <bmastbergen@untangle.com>
(cherry picked from commit 95c1dc5e86)
5 years ago
Vladimir Vid 6c9a744588 mvebu: fix regression for non-generic ESPRESSObin versions
When targets for multiple ESPRESSObin devices were added, not all
files were updated which means any ESPRESSObin version beside generic
won't have proper networking, sysupgrade and uboot-env. This patch
fixes the issue.

* fixup network detection
* fixup uboot-env
* fixup platform.sh for sysupgrade

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
(cherry picked from commit bc47285cb3)
5 years ago
Vladimir Vid 886f524c6b mvebu: image: fix generic-arm64.bootscript mmc selection
Not all versions of ESPRESSObin require SD card, but can
be booted from the internal emmc flash (mmc dev 1) instead.
Add a simple check in the bootscript to see which mmc device
is detected and boot from it using mmcdev variable.

Tested-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
(cherry picked from commit 008b41b9b0)
5 years ago
Bjørn Mork 9deef062a4 base-files: use OPENWRT prefix for os-release variables
Just stumbled across this LEDE legacy, without finding any real reason
to keep it.  There is a single LEDE_DEVICE_MANUFACTURER_URL dependency
in the luci feed repo which needs to be syncronized.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
[re-added missing commit message]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8a34a54b6a)
5 years ago
Chuanhong Guo a353f2ee7f ramips: mt7621: add IRQ for GPIO node
This makes interrupt-based gpio-keys working.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 110daa16e4)
5 years ago
Koen Vandeputte 096a67796a uqmi: bump to latest git HEAD
1965c7139374 uqmi: add explicit check for message type when expecting a response
01944dd7089b uqmi_add_command: fixed command argument assignment

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 47986dc6ea1d643cd348501da09cd2e3ee2f9ee1)
5 years ago
Koen Vandeputte 1792df73c4 kernel: bump 4.14 to 4.14.131
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Yangbo Lu 94a1999b4f layerscape: drop pause frame support for aquantia phy
An aquantia phy patch which dropped pause frame support was
missing when integrated LSDK-19.03 kernel patches into OpenWrt.
Without this patch, LS1043A 10G port would not work. So apply it.

Patch link
https://source.codeaurora.org/external/qoriq/qoriq-components/
linux/commit/?h=linux-4.14&id=66346b115818365cfaf99d292871b19f0a1d2850

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
5 years ago
Koen Vandeputte eee336ee4a kernel: bump 4.14 to 4.14.130
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Christian Lamparter dbe5730bf9 apm821xx: fix bogus key-presses on boot
"There are often transient line events when
the system is powered up and initialized and it
is often necessary for the gpio_chip driver to
clear any interrupt flags in hardware before
setting up the gpio chip, especially the
irqchip portions of it."
<http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017630.html>

This patch adds a fix for the APM821XX's interrupt
controller to clear any bogus pending toggled
interrupts that happens on various APM821XX boards
on boot.

The patch also changes the debouce-interval from the
default 5ms debounce interval to 60ms all around.
The default setting caused on occasions that the button
state became stuck in a pressed state, even though the
button was released.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Chris Blake 43b8e5b120 mpc85xx: Use uncompressed kernel on the HiveAP-330
It seems that newer builds of OpenWRT have a gzip kernel
larger than 2MB~, which for some reason fails to boot on this board.

However, we have 8MB of kernel space and currently the uncompressed
kernel is 6.5MB~, so we have some space to grow until a better
solution is worked out.

Before:
 ## Booting kernel from Legacy Image at ee840000 ...
  Image Name:   Linux-4.19.53
  Created:      2019-06-22  11:17:48 UTC
  Image Type:   PowerPC Linux Kernel Image (gzip compressed)
  Data Size:    2315724 Bytes =  2.2 MB
  Load Address: 00000000
  Entry Point:  00000000
  Verifying Checksum ... OK
 ## Loading init Ramdisk from Legacy Image at 02000000 ...
  Image Name:   OpenWrt fake ramdisk
  Created:      2019-06-22  11:17:48 UTC
  Image Type:   PowerPC Linux RAMDisk Image (uncompressed)
  Data Size:    0 Bytes =  0 kB
  Load Address: 00000000
  Entry Point:  00000000
  Verifying Checksum ... OK
 ## Flattened Device Tree blob at ec000000
  Booting using the fdt blob at 0xec000000
  Uncompressing Kernel Image ... Error: Bad gzipped data
  GUNZIP: uncompress, out-of-mem or overwrite error -
	must RESET board to recover
  Loading Ramdisk to 10000000, end 10000000 ... OK
  Loading Device Tree to 00ffa000, end 00fffc78 ... OK
  ft_fixup_l2cache: FDT_ERR_NOTFOUND

After:
 ## Booting kernel from Legacy Image at ee840000 ...
  Image Name:   POWERPC OpenWrt Linux-4.19.53
  Created:      2019-06-22  11:17:48 UTC
  Image Type:   PowerPC Linux Kernel Image (uncompressed)
  Data Size:    6724584 Bytes =  6.4 MB
  Load Address: 00000000
  Entry Point:  00000000
  Verifying Checksum ... OK
 ## Loading init Ramdisk from Legacy Image at 02000000 ...
  Image Name:   OpenWrt fake ramdisk
  Created:      2019-06-22  11:17:48 UTC
  Image Type:   PowerPC Linux RAMDisk Image (uncompressed)
  Data Size:    0 Bytes =  0 kB
  Load Address: 00000000
  Entry Point:  00000000
  Verifying Checksum ... OK
 ## Flattened Device Tree blob at ec000000
  Booting using the fdt blob at 0xec000000
  Loading Kernel Image ... OK
  OK
  Loading Ramdisk to 10000000, end 10000000 ... OK
  Loading Device Tree to 00ffa000, end 00fffc78 ... OK

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [75 cpl limit]
5 years ago
Jeff Kletsky a471d8c595 ipq40xx: Linksys: sysupgrade: Ensure OEM volumes are removed
When OEM volumes are present in the [alt_]firmware partition,
sysupgrade will write a new kernel, but will fail to write
the root file system. The next boot will hang indefinitely

    Waiting for root device /dev/ubiblock0_0...

Modified ipq40xx/base-files/lib/upgrade/linksys.sh
to remove both `squashfs` and `ubifs` if found
on the target firmware partition's UBI device.

Run-tested-on: Linksys EA8300

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[applied some shellcheck suggestions as well]
5 years ago
Koen Vandeputte b8fc9c1580 kernel: bump 4.14 to 4.14.129
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Stefan Lippers-Hollmann 69b988c994 mac80211: update WDS/4addr fix to the version accepted upstream
This updates "{nl,mac}80211: allow 4addr AP operation on crypto
controlled devices" to the version (v3), which was accepted into
upstream mac80211.git and which is tagged for -stable backporting
(v4.18+).

https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git/commit/?id=33d915d9e8ce811d8958915ccd18d71a66c7c495

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[format-patch]
5 years ago
Kevin Darbyshire-Bryant 2cb8ae2079 iproute2: update ctinfo support
Follow upstream changes - header file changes only
no functional or executable changes, hence no package bump
required

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit a8f0c02f80)
5 years ago
Kevin Darbyshire-Bryant 7888adb0aa kernel: update act_ctinfo
Follow upstream changes - header file changes
no executable  difference at all

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 5273fb6b21)
5 years ago
Adrian Schmutzler 136c8a889f ath79: Add SUPPORTED_DEVICES for Archer C7 v1/v2
The identifier for both devices is "archer-c7" on ar71xx, set here:
https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L348
https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/base-files/lib/ar71xx.sh#L511

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Robinson Wu 4e925d0b82 base-files: fix uci led oneshot/timer trigger
This patch adds a missing type property which prevented
the creation of oneshot and timer led triggers when they
are specified in the /etc/board.d/01_leds files.

i.e.:

ucidef_set_led_timer "system" "system" "zhuotk:green:system" "1000" "1000"

Fixes: b06a286a48 ("base-files: cleanup led functions in uci-defaults.sh")
Signed-off-by: Robinson Wu <wurobinson@qq.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Koen Vandeputte 9ed98198cb kernel: bump 4.14 to 4.14.128
Refreshed all patches.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Henryk Heisig 76c963bb01 ar71xx: base-files: fix board detect on new MikroTik devices
Move all MikroTik devices to new function to increase script execution
speed.

Machine name in new version of MikroTik RouterBOARD devices add "RB"
before model name:

 Old machine name: MikroTik RouterBOARD 951Ui-2nD
 New:              MikroTik RouterBOARD RB951Ui-2nD

So this patch should fix it for all currently supported MikroTik boards.

Tested-by: Cezary Jackiewicz <cezary@eko.one.pl> [wAP R-2nD]
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
[rebased,commit message facelift,script fixes]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[spotted missing 922UAGS-5HPacD]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 17fc5375f0 kernel: bump 4.14 to 4.14.127
Refreshed all patches.

Fixes:

- CVE-2019-11479
- CVE-2019-11478
- CVE-2019-11477

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte c26420b914 kernel: bump 4.14 to 4.14.126
Refreshed all patches.

Altered patches:
- 816-pcie-support-layerscape.patch

This patch also restores the initial implementation
of the ath79 perfcount IRQ issue. (78ee6b1a40)
It was wrongfully backported upstream initially and got reverted now.

Compile-tested on: cns3xxx
Runtime-tested on: cns3xxx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
George Amanakis 1d1dca45ea mvebu: fixes commit 4089df4f4b
err_free_stats has been deprecated. Replace with err_netdev.

Compile-tested on: mvebu
Runtime-tested on: mvebu

Fixes: 4089df4f4b ("kernel: bump 4.14 to 4.14.125 (FS#2305 FS#2297)")
Signed-off-by: George Amanakis <gamanakis@gmail.com>
[altered hashes]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 1e3800df18)
5 years ago
Rafał Miłecki 4fce09c1ec kernel: backport 4.18 patch adding DMI_PRODUCT_SKU
It's needed for applying some hardware quirks. This fixes:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c:60:20: error: 'DMI_PRODUCT_SKU' undeclared here (not in a function); did you mean 'DMI_PRODUCT_UUID'?
    DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "T8"),

Fixes: c52054e568 ("mac80211: brcm: backport remaining brcmfmac 5.2 patches")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 4d11c4c378)
5 years ago
Rafał Miłecki c52054e568 mac80211: brcm: backport remaining brcmfmac 5.2 patches
This improves FullMAC firmware compatibility, adds logging in case of
firmware crash and *may* fix "Invalid packet id" errors.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8888cb725d)
5 years ago
Christian Lamparter 158a716215 mac80211: refresh patches
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Christian Lamparter 78049d448c iwinfo: update PKG_MIRROR_HASH
This patch updates the PKG_MIRROR_HASH to match the one
of the current version.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
Sven Eckelmann 5913543190 ath10k-ct: adjust tx power reduction for US regulatory domain
FCC allows maximum antenna gain of 6 dBi. 15.247(b)(4):

> (4) The conducted output power limit
> specified in paragraph (b) of this section
> is based on the use of antennas
> with directional gains that do not exceed
> 6 dBi. Except as shown in paragraph
> (c) of this section, if transmitting
> antennas of directional gain greater
> than 6 dBi are used, the conducted
> output power from the intentional radiator
> shall be reduced below the stated
> values in paragraphs (b)(1), (b)(2),
> and (b)(3) of this section, as appropriate,
> by the amount in dB that the
> directional gain of the antenna exceeds
> 6 dBi.

https://www.gpo.gov/fdsys/pkg/CFR-2013-title47-vol1/pdf/CFR-2013-title47-vol1-sec15-247.pdf

Signed-off-by: Sven Eckelmann <sven@narfation.org>
5 years ago
Sven Eckelmann f1d4da3029 ath10k-ct: fix max antenna gain unit
Most of the txpower for the ath10k firmware is stored as twicepower (0.5 dB
steps). This isn't the case for max_antenna_gain - which is still expected
by the firmware as dB.

The firmware is converting it from dB to the internal (twicepower)
representation when it calculates the limits of a channel. This can be seen
in tpc_stats when configuring "12" as max_antenna_gain. Instead of the
expected 12 (6 dB), the tpc_stats shows 24 (12 dB).

Tested on QCA9888 and IPQ4019 with firmware 10.4-3.5.3-00057.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
5 years ago
Sven Eckelmann 06222ce73e mac80211: ath10k: adjust tx power reduction for US regulatory domain
FCC allows maximum antenna gain of 6 dBi. 15.247(b)(4):

> (4) The conducted output power limit
> specified in paragraph (b) of this section
> is based on the use of antennas
> with directional gains that do not exceed
> 6 dBi. Except as shown in paragraph
> (c) of this section, if transmitting
> antennas of directional gain greater
> than 6 dBi are used, the conducted
> output power from the intentional radiator
> shall be reduced below the stated
> values in paragraphs (b)(1), (b)(2),
> and (b)(3) of this section, as appropriate,
> by the amount in dB that the
> directional gain of the antenna exceeds
> 6 dBi.

https://www.gpo.gov/fdsys/pkg/CFR-2013-title47-vol1/pdf/CFR-2013-title47-vol1-sec15-247.pdf

Signed-off-by: Sven Eckelmann <sven@narfation.org>
5 years ago
Sven Eckelmann af76c19d53 mac80211: ath10k: fix max antenna gain unit
Most of the txpower for the ath10k firmware is stored as twicepower (0.5 dB
steps). This isn't the case for max_antenna_gain - which is still expected
by the firmware as dB.

The firmware is converting it from dB to the internal (twicepower)
representation when it calculates the limits of a channel. This can be seen
in tpc_stats when configuring "12" as max_antenna_gain. Instead of the
expected 12 (6 dB), the tpc_stats shows 24 (12 dB).

Tested on QCA9888 and IPQ4019 with firmware 10.4-3.5.3-00057.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
5 years ago
Sven Eckelmann 918f4c8887 mac80211: ath9k: Increase allowed antenna gain to 6 dBi
FCC allows maximum antenna gain of 6 dBi. 15.247(b)(4):

> (4) The conducted output power limit
> specified in paragraph (b) of this section
> is based on the use of antennas
> with directional gains that do not exceed
> 6 dBi. Except as shown in paragraph
> (c) of this section, if transmitting
> antennas of directional gain greater
> than 6 dBi are used, the conducted
> output power from the intentional radiator
> shall be reduced below the stated
> values in paragraphs (b)(1), (b)(2),
> and (b)(3) of this section, as appropriate,
> by the amount in dB that the
> directional gain of the antenna exceeds
> 6 dBi.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
5 years ago
Mantas Pucka 8386f975a9 kernel: mt29f_spinand: fix memory leak during page program
Memory is allocated with devm_kzalloc() on every page program
and leaks until device is closed (which never happens).

Convert to kzalloc() and handle error paths manually.

Signed-off-by: Mantas Pucka <mantas@8devices.com>
5 years ago
Koen Vandeputte f96fbf0328 iwinfo: update to latest git HEAD
1372f47eff34 iwinfo: Add Mikrotik R11e-5HnDr2

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years ago
Koen Vandeputte 4089df4f4b kernel: bump 4.14 to 4.14.125 (FS#2305 FS#2297)
Refreshed all patches.

This bump contains upstream commits which seem to avoid (not properly fix)
the errors as seen in FS#2305 and FS#2297

Altered patches:
- 403-net-mvneta-convert-to-phylink.patch
- 410-sfp-hack-allow-marvell-10G-phy-support-to-use-SFP.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 ago
Daniel Golle 000d400baa kernel: drop everything not on kernel version 4.14
* Remove testing patches for kernel version 4.19
 * remove targets ar7, ixp4xx, orion
Those targets are still on kernel 4.9, patches for 4.14 were not ready
in time. They may be readded once people prepare and test patches for
kernel 4.14.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Yousong Zhou c4e727f01c dnsmasq: move feature detection inside a shell func
Resolves openwrt/packages#9219

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
(cherry picked from commit 04b45d3a31)
5 years ago
Alexander Couzens b344ca9ca6 OpenWrt v19.07: set branch defaults
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
5 years ago

5824
.config

File diff suppressed because it is too large Load Diff

3
.gitignore vendored

@ -3,7 +3,6 @@
.*.swp
/env
/dl
/.config
/.config.old
/bin
/build_dir
@ -12,10 +11,10 @@
/logs
/feeds
/feeds.conf
/files
/overlay
/package/feeds
/package/openwrt-packages
/*.patch
key-build*
*.orig
*.rej

@ -18,6 +18,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir
world:
DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep -E '\/usr' | head -n 1)
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
ifneq ($(OPENWRT_BUILD),1)
@ -89,12 +90,21 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
checksum: FORCE
$(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))
buildversion: FORCE
$(SCRIPT_DIR)/getver.sh > $(BIN_DIR)/version.buildinfo
feedsversion: FORCE
$(SCRIPT_DIR)/feeds list -fs > $(BIN_DIR)/feeds.buildinfo
diffconfig: FORCE
mkdir -p $(BIN_DIR)
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.buildinfo
buildinfo: FORCE
$(_SINGLE)$(SUBMAKE) -r diffconfig buildversion feedsversion
prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
$(_SINGLE)$(SUBMAKE) -r diffconfig
$(_SINGLE)$(SUBMAKE) -r buildinfo
world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
$(_SINGLE)$(SUBMAKE) -r package/index

@ -34,6 +34,10 @@ menu "Global build settings"
bool "Cryptographically signed package lists"
default y
config SIGNATURE_CHECK
bool "Enable signature checking in opkg"
default SIGNED_PACKAGES
comment "General build options"
config TESTING_KERNEL
@ -89,7 +93,7 @@ menu "Global build settings"
bool "Include build configuration in firmware" if DEVEL
default n
help
If enabled, config.seed will be stored in /etc/build.config of firmware.
If enabled, config.buildinfo will be stored in /etc/build.config of firmware.
config COLLECT_KERNEL_DEBUG
bool

@ -6,6 +6,7 @@
config KERNEL_BUILD_USER
string "Custom Kernel Build User Name"
default "builder" if BUILDBOT
default ""
help
Sets the Kernel build user string, which for example will be returned
@ -14,6 +15,7 @@ config KERNEL_BUILD_USER
config KERNEL_BUILD_DOMAIN
string "Custom Kernel Build Domain Name"
default "buildhost" if BUILDBOT
default ""
help
Sets the Kernel build domain string, which for example will be
@ -773,7 +775,7 @@ menu "Filesystem ACL and attr support options"
select KERNEL_FS_POSIX_ACL
default y if USE_FS_ACL_ATTR
config KERNEL_HFSPLUG_FS_POSIX_ACL
config KERNEL_HFSPLUS_FS_POSIX_ACL
bool "Enable POSIX ACL for HFS+ Filesystems"
select KERNEL_FS_POSIX_ACL
default y if USE_FS_ACL_ATTR

@ -1,9 +1,4 @@
src-git packages https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
src-git telephony https://git.openwrt.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git
#src-git targets https://github.com/openwrt/targets.git
#src-git management https://github.com/openwrt-management/packages.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed
src-git packages https://git.openwrt.org/feed/packages.git^2e6bd4cb86682b224803325127d3f777d40b3231
src-git luci https://git.openwrt.org/project/luci.git^fb2f36306756d0d0782dcab8413a8bb7ec379e54
src-git routing https://git.openwrt.org/feed/routing.git^3f8571194c2765ed31aa73459e86c2ebf943d27d
src-git telephony https://git.openwrt.org/feed/telephony.git^036cd451c35b82b3d8cac519864986894d9f6958

@ -0,0 +1,5 @@
# https://gitlab.com/mikhailnov/nastr/-/blob/master/conf/id_rsa_ISO_preinstalled.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDc7k9kMs9bxo+8ODA+H/LrtU6p1d18DrxDPHCOPvLcut0ECvtbMOjVh3Me/Eh4Eee8ZCaYJb5Kxvd4AZ0CA5L9/ZsNKsH5Fo3ZT1sajQ2MTdVDay8/W8gHLpRSd9U9gpw22sNtomDlJXtntwKkXYIkApjt0iiXGRTeacUpr151OTXkQRXXSY3OcnnWd8oCfkKEmKmitPex7w/7HvBTyaa39HUi8Q3VzHluFyK0W5In8gz+EjSlSdXZPr6abtjt5QM365PGSAyXc4g2JeaApeiogOqGdQ59W+J3CvDCjwc7kVXjcwbTXZJZcf9SXiFhl9g7bBJiFRTM3cFw3DaBRUwoElBie5XDFqEGNiJNBac8x0nijTj9gScU2xWgOchPrl9jC9SW/T0nTaUMvDYAI2w/l5zTqxoe/4lkKEnkAEKkTLK1ViwXkxYKDhZujb/A1tkRE7exKbeoJ1J99ZcMvH6vE9xcHUilqSXwBr1SZLt9+zy7NRcPDVz8oH/upbW/Po3qm+2awqsQJYcEpzJoySZOdy8anYLKdREjJ3MjzGq69Vw9moJZrFc5uR3gyC0kpoSmS1Ux0ORS0VadQrthI7YPnGxeoob1OAXDIH7snzQFHlhKL4VndpF9HfMZR3aMJtFASCWjResTNcUVOsopRs43EChaa/SfuJ2Q+jGL5ZzTrw== user@pay2
# m1/s8
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYVk2SNi5cJ9xqqPqv2cQxjvpMwQDXz/hqRsqC4/vsOLpn14iPf+IRvhzoOPrrs+L4zYYSr1SvV4xB34aN3IDWfwqSQXCNfhBLqbRwJ7Pg6SSuMwsACtIglorwR1w50b4+ggjj39TL1S7Qk1bLOsp4B6+I5BA5CZte4DnbWWKMp06y1jWywOZc95G6GfjhnUJW25fDcD5UIinIxU1kCBAwFTkYo2w8I/7wMOfvyjR7/NJ1dhl8uJk44+NfAOuR5ACpHlPETHPf3XkSbraTGzLsb1p8KYnBOLZwcEhB5PhwwZezpfwgAzzmknKONZNxvKOeW/Xk66UgDCGJX4hEdnCh user@localhost

@ -39,7 +39,9 @@ define autoreconf
[ -e $(p)/config.rpath ] || \
ln -s $(SCRIPT_DIR)/config.rpath $(p)/config.rpath; \
touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; \
$(AM_TOOL_PATHS) $(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
$(AM_TOOL_PATHS) \
LIBTOOLIZE='$(STAGING_DIR_HOST)/bin/libtoolize --install' \
$(STAGING_DIR_HOST)/bin/autoreconf -v -f -i -s \
$(if $(word 2,$(3)),--no-recursive) \
-B $(STAGING_DIR_HOST)/share/aclocal \
$(patsubst %,-I %,$(5)) \

@ -103,6 +103,7 @@ define Host/Configure/Default
-DCMAKE_INSTALL_PREFIX=$(HOST_BUILD_PREFIX) \
-DCMAKE_PREFIX_PATH=$(HOST_BUILD_PREFIX) \
-DCMAKE_SKIP_RPATH=TRUE \
-DCMAKE_INSTALL_LIBDIR=lib \
$(CMAKE_HOST_OPTIONS) \
$(HOST_CMAKE_SOURCE_DIR) \
)

@ -289,6 +289,7 @@ endef
define Download/default
FILE:=$(PKG_SOURCE)
URL:=$(PKG_SOURCE_URL)
URL_FILE:=$(PKG_SOURCE_URL_FILE)
SUBDIR:=$(PKG_SOURCE_SUBDIR)
PROTO:=$(PKG_SOURCE_PROTO)
$(if $(PKG_SOURCE_MIRROR),MIRROR:=$(filter 1,$(PKG_MIRROR)))

@ -120,7 +120,7 @@ define Build/append-uImage-fakehdr
endef
define Build/tplink-safeloader
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
-$(STAGING_DIR_HOST)/bin/tplink-safeloader \
-B $(TPLINK_BOARD_ID) \
-V $(REVISION) \
-k $(IMAGE_KERNEL) \

@ -385,6 +385,8 @@ define Device/Init
FILESYSTEMS := $(TARGET_FILESYSTEMS)
UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-$(1)
DEFAULT :=
endef
DEFAULT_DEVICE_VARS := \
@ -561,6 +563,7 @@ Target-Profile-Name: $(DEVICE_TITLE)
Target-Profile-Packages: $(DEVICE_PACKAGES)
Target-Profile-hasImageMetadata: $(if $(foreach image,$(IMAGES),$(findstring append-metadata,$(IMAGE/$(image)))),1,0)
Target-Profile-SupportedDevices: $(SUPPORTED_DEVICES)
$(if $(DEFAULT),Target-Profile-Default: $(DEFAULT))
Target-Profile-Description:
$(DEVICE_DESCRIPTION)
@@

@ -131,10 +131,16 @@ define BuildKernel
$(Kernel/Configure)
touch $$@
$(LINUX_DIR)/.modules: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
$(LINUX_DIR)/.modules: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(LINUX_DIR)/.modules: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(LINUX_DIR)/.modules: $(STAMP_CONFIGURED) $(LINUX_DIR)/.config FORCE
$(Kernel/CompileModules)
touch $$@
$(LINUX_DIR)/.image: export STAGING_PREFIX=$$(STAGING_DIR_HOST)
$(LINUX_DIR)/.image: export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(LINUX_DIR)/.image: export PKG_CONFIG_LIBDIR=$$(STAGING_DIR_HOST)/lib/pkgconfig
$(LINUX_DIR)/.image: $(STAMP_CONFIGURED) $(if $(CONFIG_STRIP_KERNEL_EXPORTS),$(KERNEL_BUILD_DIR)/symtab.h) FORCE
$(Kernel/CompileImage)
$(Kernel/CollectDebug)

@ -6,13 +6,9 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
LINUX_VERSION-4.9 = .180
LINUX_VERSION-4.14 = .123
LINUX_VERSION-4.19 = .48
LINUX_VERSION-4.14 = .180
LINUX_KERNEL_HASH-4.9.180 = d25a490d62a3e96a587333e163862585eac4086fc8d4893b4ec1711e7d387c5f
LINUX_KERNEL_HASH-4.14.123 = 25f58cb56bde388ac9bcee984f5f2d0ca094b0a8af6b92ad1f5b2fd0e6725b85
LINUX_KERNEL_HASH-4.19.48 = 01d0db4f10cc8e384241a605e29413e32c442aa6853c116877538b07c16893fa
LINUX_KERNEL_HASH-4.14.180 = 444ef973d9b6a6ea174e4a9086f0aea980d8575d13302e431ad688f22e27ed0e
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

@ -77,7 +77,7 @@ else
TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
ifneq ($(TARGET_BUILD),1)
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
endif
endif
@ -129,6 +129,10 @@ ifdef CONFIG_USE_SPARSE
KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse
endif
ifeq ($(HOST_OS),Darwin)
export SKIP_STACK_VALIDATION:=1
endif
PKG_EXTMOD_SUBDIRS ?= .
define populate_module_symvers

@ -124,6 +124,8 @@ ifeq ($(DUMP),)
endif
$(PKG_INSTALL_STAMP).$(1): prepare-package-install
echo "$(1)" >> $(PKG_INSTALL_STAMP)
else
$(if $(CONFIG_PACKAGE_$(1)),$$(warning WARNING: skipping $(1) -- package has no install section))
endif
endif

@ -11,7 +11,7 @@ all: $(if $(DUMP),dumpinfo,$(if $(CHECK),check,compile))
include $(INCLUDE_DIR)/download.mk
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
PKG_BUILD_DIR ?= $(BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
PKG_BUILD_PARALLEL ?=
PKG_USE_MIPS16 ?= 1
@ -40,6 +40,10 @@ include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk
ifneq ($(wildcard $(TOPDIR)/git-src/$(PKG_NAME)/.git),)
USE_GIT_SRC_CHECKOUT:=1
QUILT:=1
endif
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
USE_GIT_TREE:=1
QUILT:=1
@ -53,14 +57,26 @@ endif
include $(INCLUDE_DIR)/quilt.mk
find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
$(filter-out $(BUILD_PACKAGES),$(foreach dep, \
$(filter-out @%, $(patsubst +%,%,$(1))), \
$(if $(findstring :,$(dep)), \
$(word 2,$(subst :,$(space),$(dep))), \
$(dep) \
) \
))))
find_library_dependencies = \
$(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
$(sort $(foreach dep4, \
$(sort $(foreach dep3, \
$(sort $(foreach dep2, \
$(sort $(foreach dep1, \
$(sort $(foreach dep0, \
$(Package/$(1)/depends), \
$(Package/$(dep0)/depends) $(dep0) \
)), \
$(Package/$(dep1)/depends) $(dep1) \
)), \
$(Package/$(dep2)/depends) $(dep2) \
)), \
$(Package/$(dep3)/depends) $(dep3) \
)), \
$(Package/$(dep4)/depends) $(dep4) \
)), \
))
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild)
@ -117,6 +133,18 @@ ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
endif
endif
ifdef USE_GIT_SRC_CHECKOUT
define Build/Prepare/Default
mkdir -p $(PKG_BUILD_DIR)
ln -s $(TOPDIR)/git-src/$(PKG_NAME)/.git $(PKG_BUILD_DIR)/.git
( cd $(PKG_BUILD_DIR); \
git checkout .; \
git submodule update --recursive; \
git submodule foreach git config --unset core.worktree; \
git submodule foreach git checkout .; \
)
endef
endif
ifdef USE_GIT_TREE
define Build/Prepare/Default
mkdir -p $(PKG_BUILD_DIR)
@ -236,7 +264,7 @@ define Build/CoreTargets
endef
define Build/DefaultTargets
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(DUMP),,$(Build/CoreTargets))
define Build/DefaultTargets
@ -258,7 +286,7 @@ endef
endif
BUILD_PACKAGES += $(1)
$(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(DEPENDS)))
$(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(1)))
$(foreach FIELD, TITLE CATEGORY SECTION VERSION,
ifeq ($($(FIELD)),)

@ -28,16 +28,9 @@ $(eval $(call TestHostCommand,proper-umask, \
$(eval $(call SetupHostCommand,gcc, \
Please install the GNU C Compiler (gcc) 4.8 or later, \
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
gcc48 --version | grep gcc, \
gcc49 --version | grep gcc, \
gcc5 --version | grep gcc, \
gcc6 --version | grep gcc, \
gcc7 --version | grep gcc, \
gcc8 --version | grep gcc, \
gcc9 --version | grep gcc, \
gcc --version | grep Apple.LLVM ))
$(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
gcc --version | grep -E 'Apple.(LLVM|clang)' ))
$(eval $(call TestHostCommand,working-gcc, \
\nPlease reinstall the GNU C Compiler (4.8 or later) - \
@ -47,16 +40,9 @@ $(eval $(call TestHostCommand,working-gcc, \
$(eval $(call SetupHostCommand,g++, \
Please install the GNU C++ Compiler (g++) 4.8 or later, \
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \
g++48 --version | grep g++, \
g++49 --version | grep g++, \
g++5 --version | grep g++, \
g++6 --version | grep g++, \
g++7 --version | grep g++, \
g++8 --version | grep g++, \
g++9 --version | grep g++, \
g++ --version | grep Apple.LLVM ))
$(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?|10\.?)', \
g++ --version | grep -E 'Apple.(LLVM|clang)' ))
$(eval $(call TestHostCommand,working-g++, \
\nPlease reinstall the GNU C++ Compiler (4.8 or later) - \
@ -141,10 +127,12 @@ $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \
$(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \
perl --version | grep "perl.*v5"))
$(eval $(call CleanupPython3))
$(eval $(call SetupHostCommand,python,Please install Python 2.x, \
python2.7 -V 2>&1 | grep Python, \
python2 -V 2>&1 | grep Python, \
python -V 2>&1 | grep Python))
python2.7 -V 2>&1 | grep 'Python 2.7', \
python2 -V 2>&1 | grep 'Python 2', \
python -V 2>&1 | grep 'Python 2'))
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))

@ -66,6 +66,18 @@ define RequireHeader
$$(eval $$(call Require,$(1),$(2)))
endef
define CleanupPython3
define Require/python3-cleanup
if [ -f "$(STAGING_DIR_HOST)/bin/python" ] && \
$(STAGING_DIR_HOST)/bin/python -V 2>&1 | \
grep -q 'Python 3'; then \
rm $(STAGING_DIR_HOST)/bin/python; \
fi
endef
$$(eval $$(call Require,python3-cleanup))
endef
define QuoteHostCommand
'$(subst ','"'"',$(strip $(1)))'
endef

@ -13,7 +13,7 @@ __target_inc=1
DEVICE_TYPE?=router
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd urandom-seed urngd
# For nas targets
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
# For router targets

@ -99,13 +99,18 @@ prepare-tmpinfo: FORCE
$(_SINGLE)$(NO_TRACE_MAKE) menuconfig $(PREP_MK); \
fi
ifneq ($(DISTRO_PKG_CONFIG),)
scripts/config/mconf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
endif
scripts/config/mconf:
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config all CC="$(HOSTCC_WRAPPER)"
$(eval $(call rdep,scripts/config,scripts/config/mconf))
scripts/config/qconf:
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf CC="$(HOSTCC_WRAPPER)"
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf \
CC="$(HOSTCC_WRAPPER)" \
DISTRO-PKG-CONFIG="$(DISTRO_PKG_CONFIG)"
scripts/config/conf:
@$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)"
@ -157,6 +162,10 @@ endif
kernel_oldconfig: prepare_kernel_conf
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux oldconfig
ifneq ($(DISTRO_PKG_CONFIG),)
kernel_menuconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
kernel_nconfig: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
endif
kernel_menuconfig: prepare_kernel_conf
$(_SINGLE)$(NO_TRACE_MAKE) -C target/linux menuconfig

@ -3,7 +3,7 @@ PKG_NAME ?= u-boot
ifndef PKG_SOURCE_PROTO
PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL = \
http://sources.lede-project.org \
https://sources.openwrt.org \
ftp://ftp.denx.de/pub/u-boot
endif

@ -26,13 +26,13 @@ PKG_CONFIG_DEPENDS += \
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),19.07.3)
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r11063-85e04e9f46)
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/snapshots)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/19.07.3)
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)

@ -84,8 +84,12 @@ $(curdir)/index: FORCE
mkdir -p $$d; \
cd $$d || continue; \
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages && \
gzip -9nc Packages > Packages.gz; \
grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require)' Packages.manifest > Packages; \
case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
$(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
{ echo ""; echo ""; } >> Packages;; \
esac; \
gzip -9nc Packages > Packages.gz; \
); done
ifdef CONFIG_SIGNED_PACKAGES
@echo Signing package index...

@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
PKG_RELEASE:=197
PKG_RELEASE:=204.2
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
@ -43,6 +43,15 @@ define Package/base-files
VERSION:=$(PKG_RELEASE)-$(REVISION)
endef
define Package/urandom-seed
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+libc +ubox-getrandom
TITLE:=/etc/urandom.seed handling for OpenWrt
URL:=http://openwrt.org/
VERSION:=$(PKG_RELEASE)-$(REVISION)
endef
define Package/base-files/conffiles
/etc/config/
/etc/config/network
@ -189,7 +198,7 @@ define Package/base-files/install
$(if $(CONFIG_INCLUDE_CONFIG), \
echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \
cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config)
cat $(BIN_DIR)/config.buildinfo >>$(1)/etc/build.config)
$(if $(CONFIG_CLEAN_IPKG),, \
mkdir -p $(1)/etc/opkg; \

@ -85,12 +85,16 @@ generate_network() {
set network.$1.proto='none'
EOF
[ -n "$macaddr" ] && uci -q batch <<-EOF
delete network.$1_dev
set network.$1_dev='device'
set network.$1_dev.name='$ifname'
set network.$1_dev.macaddr='$macaddr'
EOF
if [ -n "$macaddr" ]; then
for name in $ifname; do
uci -q batch <<-EOF
delete network.$1_${name/./_}_dev
set network.$1_${name/./_}_dev='device'
set network.$1_${name/./_}_dev.name='$name'
set network.$1_${name/./_}_dev.macaddr='$macaddr'
EOF
done
fi
case "$protocol" in
static)

@ -2,7 +2,7 @@
# Copyright (C) 2006-2011 OpenWrt.org
START=10
STOP=98
STOP=90
uci_apply_defaults() {
. /lib/functions/system.sh

@ -1,7 +1,12 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
STOP=99
STOP=90
restart() {
:
}
stop() {
sync
/bin/umount -a -d -r

@ -213,6 +213,7 @@ add_group_and_user() {
default_postinst() {
local root="${IPKG_INSTROOT}"
local pkgname="$(basename ${1%.*})"
local filelist="/usr/lib/opkg/info/${pkgname}.list"
local ret=0
add_group_and_user "${pkgname}"
@ -227,23 +228,29 @@ default_postinst() {
rm -fR $root/rootfs-overlay/
fi
if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then
kmodloader
fi
if [ -z "$root" ]; then
if grep -m1 -q -s "^/etc/modules.d/" "$filelist"; then
kmodloader
fi
if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then
. /lib/functions/system.sh
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
for i in $(grep -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"); do
( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
done
uci commit
fi
if grep -m1 -q -s "^/etc/sysctl.d/" "$filelist"; then
/etc/init.d/sysctl restart
fi
[ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null
if grep -m1 -q -s "^/etc/uci-defaults/" "$filelist"; then
. /lib/functions/system.sh
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
for i in $(grep -s "^/etc/uci-defaults/" "$filelist"); do
( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i"
done
uci commit
fi
rm -f /tmp/luci-indexcache
fi
local shell="$(which bash)"
for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do
for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do
if [ -n "$root" ]; then
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable
else

@ -271,6 +271,11 @@ network_is_up()
# 2: interface
network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; }
# determine the uptime of the given logical interface
# 1: destination variable
# 2: interface
network_get_uptime() { __network_ifstatus "$1" "$2" ".uptime"; }
# determine the metric of the given logical interface
# 1: destination variable
# 2: interface

@ -4,7 +4,7 @@ get_mac_binary() {
local path="$1"
local offset="$2"
if [ -z "$path" ]; then
if ! [ -e "$path" ]; then
echo "get_mac_binary: file $path not found!" >&2
return
fi
@ -79,12 +79,7 @@ mtd_get_mac_binary_ubi() {
local ubidev=$(nand_find_ubi $CI_UBIPART)
local part=$(nand_find_volume $ubidev $1)
if [ -z "$part" ]; then
echo "mtd_get_mac_binary: ubi volume $mtdname not found!" >&2
return
fi
hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' /dev/$part 2>/dev/null
get_mac_binary "/dev/$part" "$offset"
}
mtd_get_part_size() {

@ -476,6 +476,7 @@ _ucidef_set_led_timer() {
_ucidef_set_led_common "$1" "$2" "$3"
json_add_string type "$trigger_name"
json_add_string trigger "$trigger_name"
json_add_int delayon "$delayon"
json_add_int delayoff "$delayoff"

@ -2,6 +2,8 @@
RAM_ROOT=/tmp/root
export BACKUP_FILE=sysupgrade.tgz # file extracted by preinit
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; }
@ -101,7 +103,7 @@ get_magic_long() {
}
export_bootdevice() {
local cmdline bootdisk rootpart uuid blockdev uevent line
local cmdline bootdisk rootpart uuid blockdev uevent line class
local MAJOR MINOR DEVNAME DEVTYPE
if read cmdline < /proc/cmdline; then
@ -137,6 +139,18 @@ export_bootdevice() {
/dev/*)
uevent="/sys/class/block/${rootpart##*/}/../uevent"
;;
0x[a-f0-9][a-f0-9][a-f0-9] | 0x[a-f0-9][a-f0-9][a-f0-9][a-f0-9] | \
[a-f0-9][a-f0-9][a-f0-9] | [a-f0-9][a-f0-9][a-f0-9][a-f0-9])
rootpart=0x${rootpart#0x}
for class in /sys/class/block/*; do
while read line; do
export -n "$line"
done < "$class/uevent"
if [ $((rootpart/256)) = $MAJOR -a $((rootpart%256)) = $MINOR ]; then
uevent="$class/../uevent"
fi
done
;;
esac
if [ -e "$uevent" ]; then
@ -207,16 +221,6 @@ get_partitions() { # <device> <filename>
fi
}
jffs2_copy_config() {
if grep rootfs_data /proc/mtd >/dev/null; then
# squashfs+jffs2
mtd -e rootfs_data jffs2write "$CONF_TAR" rootfs_data
else
# jffs2
mtd jffs2write "$CONF_TAR" rootfs
fi
}
indicate_upgrade() {
. /etc/diag.sh
set_state upgrade
@ -228,34 +232,10 @@ indicate_upgrade() {
# $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m
default_do_upgrade() {
sync
if [ "$SAVE_CONFIG" -eq 1 ]; then
get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}"
if [ -n "$UPGRADE_BACKUP" ]; then
get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}"
else
get_image "$1" "$2" | mtd $MTD_ARGS write - "${PART_NAME:-image}"
fi
[ $? -ne 0 ] && exit 1
}
do_upgrade_stage2() {
v "Performing system upgrade..."
if [ -n "$do_upgrade" ]; then
eval "$do_upgrade"
elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
platform_do_upgrade "$IMAGE"
else
default_do_upgrade "$IMAGE"
fi
if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
platform_copy_config
fi
v "Upgrade completed"
sleep 1
v "Rebooting system..."
umount -a
reboot -f
sleep 5
echo b 2>/dev/null >/proc/sysrq-trigger
}

@ -0,0 +1,25 @@
#!/bin/sh
. /lib/functions.sh
include /lib/upgrade
v "Performing system upgrade..."
if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then
platform_do_upgrade "$IMAGE"
else
default_do_upgrade "$IMAGE"
fi
if [ -n "$UPGRADE_BACKUP" ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then
platform_copy_config
fi
v "Upgrade completed"
sleep 1
v "Rebooting system..."
umount -a
reboot -f
sleep 5
echo b 2>/dev/null >/proc/sysrq-trigger

@ -109,7 +109,7 @@ nand_restore_config() {
rmdir /tmp/new_root
return 1
fi
mv "$1" "/tmp/new_root/sysupgrade.tgz"
mv "$1" "/tmp/new_root/$BACKUP_FILE"
umount /tmp/new_root
sync
rmdir /tmp/new_root
@ -280,15 +280,6 @@ nand_upgrade_tar() {
# Recognize type of passed file and start the upgrade process
nand_do_upgrade() {
if [ -n "$IS_PRE_UPGRADE" ]; then
# Previously, nand_do_upgrade was called from the platform_pre_upgrade
# hook; this piece of code handles scripts that haven't been
# updated. All scripts should gradually move to call nand_do_upgrade
# from platform_do_upgrade instead.
export do_upgrade="nand_do_upgrade '$1'"
return
fi
local file_type=$(identify $1)
if type 'platform_nand_pre_upgrade' >/dev/null 2>/dev/null; then

@ -6,24 +6,13 @@
export IMAGE="$1"
COMMAND="$2"
export ARGV="$IMAGE"
export ARGC=1
export SAVE_CONFIG=1
export SAVE_PARTITIONS=1
export INTERACTIVE=0
export VERBOSE=1
export CONFFILES=/tmp/sysupgrade.conffiles
export CONF_TAR=/tmp/sysupgrade.tgz
RAMFS_COPY_BIN= # extra programs for temporary ramfs root
RAMFS_COPY_DATA= # extra data files
[ -f "$CONF_TAR" ] || export SAVE_CONFIG=0
[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0
include /lib/upgrade
@ -59,7 +48,7 @@ switch_to_ramfs() {
local file="$(which "$binary" 2>/dev/null)"
[ -n "$file" ] && install_bin "$file"
done
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA
install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh /lib/upgrade/do_stage2 /usr/share/libubox/jshn.sh $RAMFS_COPY_DATA
[ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64
@ -136,10 +125,7 @@ sleep 1
if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then
IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE"
# Needs to be unset again because of busybox weirdness ...
IS_PRE_UPGRADE=
platform_pre_upgrade "$IMAGE"
fi
if [ -n "$(rootfs_type)" ]; then

@ -2,6 +2,7 @@
. /lib/functions.sh
. /lib/functions/system.sh
. /usr/share/libubox/jshn.sh
# initialize defaults
export MTD_ARGS=""
@ -191,9 +192,6 @@ add_overlayfiles() {
return 0
}
# hooks
sysupgrade_image_check="fwtool_check_signature fwtool_check_image platform_check_image"
if [ $SAVE_OVERLAY = 1 ]; then
[ ! -d /overlay/upper/etc ] && {
echo "Cannot find '/overlay/upper/etc', required for '-c'" >&2
@ -296,7 +294,7 @@ type platform_check_image >/dev/null 2>/dev/null || {
case "$IMAGE" in
http://*|\
https://*)
wget -O/tmp/sysupgrade.img "$IMAGE"
wget -O/tmp/sysupgrade.img "$IMAGE" || exit 1
IMAGE=/tmp/sysupgrade.img
;;
esac
@ -316,20 +314,19 @@ case "$IMAGE" in
;;
esac
export ARGV="$IMAGE"
export ARGC=1
for check in $sysupgrade_image_check; do
( $check "$IMAGE" ) || {
if [ $FORCE -eq 1 ]; then
echo "Image check '$check' failed but --force given - will update anyway!" >&2
break
else
echo "Image check '$check' failed." >&2
exit 1
fi
}
done
json_load "$(/usr/libexec/validate_firmware_image "$IMAGE")" || {
echo "Failed to check image"
exit 1
}
json_get_var valid "valid"
[ "$valid" -eq 0 ] && {
if [ $FORCE -eq 1 ]; then
echo "Image check failed but --force given - will update anyway!" >&2
else
echo "Image check failed." >&2
exit 1
fi
}
if [ -n "$CONF_IMAGE" ]; then
case "$(get_magic_word $CONF_IMAGE cat)" in
@ -354,24 +351,27 @@ if [ $TEST -eq 1 ]; then
exit 0
fi
if [ $SAVE_PARTITIONS -eq 0 ]; then
touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap
else
rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
fi
install_bin /sbin/upgraded
v "Commencing upgrade. Closing all shell sessions."
COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2'
COMMAND='/lib/upgrade/do_stage2'
if [ -n "$FAILSAFE" ]; then
printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade
lock -u /tmp/.failsafe
else
force_attr=""
[ $FORCE -eq 1 ] && force_attr="\"force\": true,"
backup_attr=""
[ $SAVE_CONFIG -eq 1 ] && backup_attr="\"backup\": $(json_string $CONF_TAR),"
ubus call system sysupgrade "{
\"prefix\": $(json_string "$RAM_ROOT"),
\"path\": $(json_string "$IMAGE"),
\"command\": $(json_string "$COMMAND")
$force_attr
$backup_attr
\"command\": $(json_string "$COMMAND"),
\"options\": {
\"save_partitions\": $SAVE_PARTITIONS
}
}"
fi

@ -8,11 +8,11 @@ HOME_URL="%u"
BUG_URL="%b"
SUPPORT_URL="%s"
BUILD_ID="%R"
LEDE_BOARD="%S"
LEDE_ARCH="%A"
LEDE_TAINTS="%t"
LEDE_DEVICE_MANUFACTURER="%M"
LEDE_DEVICE_MANUFACTURER_URL="%m"
LEDE_DEVICE_PRODUCT="%P"
LEDE_DEVICE_REVISION="%h"
LEDE_RELEASE="%D %V %C"
OPENWRT_BOARD="%S"
OPENWRT_ARCH="%A"
OPENWRT_TAINTS="%t"
OPENWRT_DEVICE_MANUFACTURER="%M"
OPENWRT_DEVICE_MANUFACTURER_URL="%m"
OPENWRT_DEVICE_PRODUCT="%P"
OPENWRT_DEVICE_REVISION="%h"
OPENWRT_RELEASE="%D %V %C"

@ -0,0 +1,66 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/system.sh
. /usr/share/libubox/jshn.sh
include /lib/upgrade
VALID=1
FORCEABLE=1
ALLOW_BACKUP=1
# Mark image as invalid but still possible to install
notify_firmware_invalid() {
VALID=0
}
# Mark image as broken (impossible to install)
notify_firmware_broken() {
VALID=0
FORCEABLE=0
}
# Mark image as incompatible with preserving a backup
notify_firmware_no_backup() {
ALLOW_BACKUP=0
}
# Add result of validation test
notify_firmware_test_result() {
local old_ns
json_set_namespace validate_firmware_image old_ns
json_add_boolean "$1" "$2"
json_set_namespace $old_ns
}
err_to_bool() {
[ "$1" -ne 0 ] && echo 0 || echo 1
}
fwtool_check_signature "$1" >&2
FWTOOL_SIGNATURE=$?
[ "$FWTOOL_SIGNATURE" -ne 0 ] && notify_firmware_invalid
fwtool_check_image "$1" >&2
FWTOOL_DEVICE_MATCH=$?
[ "$FWTOOL_DEVICE_MATCH" -ne 0 ] && notify_firmware_invalid
json_set_namespace validate_firmware_image old_ns
json_init
json_add_object "tests"
json_add_boolean fwtool_signature "$(err_to_bool $FWTOOL_SIGNATURE)"
json_add_boolean fwtool_device_match "$(err_to_bool $FWTOOL_DEVICE_MATCH)"
# Call platform_check_image() here so it can add its test
# results and still mark image properly.
json_set_namespace $old_ns
platform_check_image "$1" >&2 || notify_firmware_invalid
json_set_namespace validate_firmware_image old_ns
json_close_object
json_add_boolean valid "$VALID"
json_add_boolean forceable "$FORCEABLE"
json_add_boolean allow_backup "$ALLOW_BACKUP"
json_dump -i
json_set_namespace $old_ns

@ -183,7 +183,7 @@ if VERSIONOPT
config VERSION_REPO
string
prompt "Release repository"
default "http://downloads.openwrt.org/snapshots"
default "http://downloads.openwrt.org/releases/19.07.3"
help
This is the repository address embedded in the image, it defaults
to the trunk snapshot repo; the url may contain the following placeholders:
@ -259,7 +259,7 @@ if VERSIONOPT
config VERSION_CODE_FILENAMES
bool
prompt "Revision code in filenames"
default y
default n
help
Enable this to include the revision identifier or the configured
version code into the firmware image, SDK- and Image Builder archive

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=kexec-tools
PKG_VERSION:=2.0.16
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
@ -44,7 +44,7 @@ define Package/kexec
$(call Package/kexec-tools/Default)
TITLE:=Kernel boots kernel
DEPENDS:=\
@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips \
@(armeb||arm||i386||x86_64||powerpc64||mipsel||mips) \
+KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC
endef
@ -55,7 +55,7 @@ endef
define Package/kdump
$(call Package/kexec-tools/Default)
TITLE:=Kernel crash analysis
DEPENDS:=+kexec @i386||@x86_64||@arm @KERNEL_CRASH_DUMP
DEPENDS:=+kexec @(i386||x86_64||arm) @KERNEL_CRASH_DUMP
endef
define Package/kdump/description

@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
START=41
STOP=98
STOP=90
EXTRA_COMMANDS="status"
EXTRA_HELP=" status Print crashkernel status"

@ -15,9 +15,9 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf
PKG_SOURCE_VERSION:=7e34aebe658c7c3439d2d68b0ce6b9776e8e6996
PKG_MIRROR_HASH:=9cf0bc32fa589a0ee7c48c87898679e645341f29da1253d0ba5d2e82c6ea074d
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=uboot-layerscape
PKG_BUILD_DEPENDS:=uboot-layerscape tfa-layerscape/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/tfa-layerscape/Config
@ -46,7 +46,27 @@ define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) \
fip pbl PLAT=$(PLAT) BOOT_MODE=$(BOOT_MODE) \
RCW=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-rcw.bin \
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin \
FIPTOOL=$(STAGING_DIR_HOST)/bin/tfa-fiptool \
CREATE_PBL=$(STAGING_DIR_HOST)/bin/tfa-create-pbl \
BYTE_SWAP=$(STAGING_DIR_HOST)/bin/tfa-byte-swap
endef
HOST_CFLAGS += -Wall -Werror -pedantic -std=c99
define Host/Compile
$(MAKE) -C \
$(HOST_BUILD_DIR)/tools/fiptool \
CFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)"
$(MAKE) -C \
$(HOST_BUILD_DIR)/plat/nxp/tools \
CFLAGS="$(HOST_CFLAGS)"
endef
define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/fiptool/fiptool $(STAGING_DIR_HOST)/bin/tfa-fiptool
$(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/create_pbl $(STAGING_DIR_HOST)/bin/tfa-create-pbl
$(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap
endef
define Package/tfa-layerscape/ls1012ardb
@ -132,6 +152,7 @@ TFAS := \
ls1088ardb-sdboot \
ls2088ardb
$(eval $(call HostBuild))
$(foreach tfa,$(TFAS), \
$(eval $(Package/tfa-layerscape/$(tfa))) \
$(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \

@ -0,0 +1,71 @@
--- a/Makefile
+++ b/Makefile
@@ -448,10 +448,6 @@ endif
CRTTOOLPATH ?= tools/cert_create
CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT}
-# Variables for use with Firmware Image Package
-FIPTOOLPATH ?= tools/fiptool
-FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT}
-
################################################################################
# Include BL specific makefiles
################################################################################
@@ -661,14 +657,12 @@ endif
clean:
@echo " CLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_PLAT})
- ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean
realclean distclean:
@echo " REALCLEAN"
$(call SHELL_REMOVE_DIR,${BUILD_BASE})
$(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*)
- ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean
${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean
checkcodebase: locate-checkpatch
@@ -717,7 +711,7 @@ certificates: ${CRT_DEPS} ${CRTTOOL}
@${ECHO_BLANK_LINE}
endif
-${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL}
+${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS}
${Q}${FIPTOOL} create ${FIP_ARGS} $@
${Q}${FIPTOOL} info $@
@${ECHO_BLANK_LINE}
@@ -733,21 +727,16 @@ fwu_certificates: ${FWU_CRT_DEPS} ${CRTT
@${ECHO_BLANK_LINE}
endif
-${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL}
+${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS}
${Q}${FIPTOOL} create ${FWU_FIP_ARGS} $@
${Q}${FIPTOOL} info $@
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}
-fiptool: ${FIPTOOL}
fip: ${BUILD_PLAT}/${FIP_NAME}
fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
-.PHONY: ${FIPTOOL}
-${FIPTOOL}:
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${FIPTOOLPATH}
-
cscope:
@echo " CSCOPE"
${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files
--- a/tools/fiptool/Makefile
+++ b/tools/fiptool/Makefile
@@ -37,7 +37,7 @@ all: ${PROJECT} fip_create
${PROJECT}: ${OBJECTS} Makefile
@echo " LD $@"
- ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
+ ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS} $(LDFLAGS)
@${ECHO_BLANK_LINE}
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}

@ -0,0 +1,30 @@
From 65e9a722b44bf28b98fe25b3b174761b47ec7dbd Mon Sep 17 00:00:00 2001
From: Biwen Li <biwen.li@nxp.com>
Date: Mon, 1 Apr 2019 13:41:55 +0800
Subject: [PATCH 2/3] plat/nxp/tools: fix a makefile bug that will use default
implicit rules
The patch fix a makefile bug that will use default implicit rules,
because do not have explicit rules for the destination files.
Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
plat/nxp/tools/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plat/nxp/tools/Makefile b/plat/nxp/tools/Makefile
index 2095294b..0082a0be 100644
--- a/plat/nxp/tools/Makefile
+++ b/plat/nxp/tools/Makefile
@@ -53,7 +53,7 @@ ${PROJECT_2}: ${OBJECTS_2} Makefile
@echo "Built $@ successfully"
@${ECHO_BLANK_LINE}
-%.o: %.c %.h Makefile
+%.o: %.c Makefile
@echo " CC $<"
${Q}${HOSTCC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@
--
2.17.1

@ -0,0 +1,60 @@
From 8a458876013991fe2f288bbe4694264b16c3b9e9 Mon Sep 17 00:00:00 2001
From: Biwen Li <biwen.li@nxp.com>
Date: Fri, 26 Jul 2019 15:44:10 +0800
Subject: [PATCH 3/3] plat/nxp/tools: fix create_pbl and byte_swap host build
Not compile create_pbl and byte_swap in the process of cross compilation
Signed-off-by: Biwen Li <biwen.li@nxp.com>
---
plat/nxp/tools/pbl_ch2.mk | 3 ---
plat/nxp/tools/pbl_ch3.mk | 5 -----
2 files changed, 8 deletions(-)
diff --git a/plat/nxp/tools/pbl_ch2.mk b/plat/nxp/tools/pbl_ch2.mk
index afa43520..ff624dd9 100644
--- a/plat/nxp/tools/pbl_ch2.mk
+++ b/plat/nxp/tools/pbl_ch2.mk
@@ -20,8 +20,6 @@ ifeq ($(RCW),"")
else
# Generate header for bl2.bin
$(Q)$(CST_DIR)/create_hdr_isbc --in ${BUILD_PLAT}/bl2.bin --out ${BUILD_PLAT}/hdr_bl2 ${BL2_INPUT_FILE}
- # Compile create_pbl tool
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};\
# Add bl2.bin to RCW
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE}\
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl ;\
@@ -43,7 +41,6 @@ ifeq ($(RCW),"")
${Q}echo "Platform ${PLAT} requires rcw file. Please set RCW to point to the right RCW file for boot mode ${BOOT_MODE}"
else
# -a option appends the image for Chassis 3 devices in case of non secure boot
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE} \
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl ;
# Swapping of RCW is required for QSPi Chassis 2 devices
diff --git a/plat/nxp/tools/pbl_ch3.mk b/plat/nxp/tools/pbl_ch3.mk
index 944ae3bb..9aa8f635 100644
--- a/plat/nxp/tools/pbl_ch3.mk
+++ b/plat/nxp/tools/pbl_ch3.mk
@@ -27,9 +27,6 @@ else
# Generate header for bl2.bin
$(Q)$(CST_DIR)/create_hdr_isbc --in ${BUILD_PLAT}/bl2.bin --out ${BUILD_PLAT}/hdr_bl2 ${BL2_INPUT_FILE}
- # Compile create_pbl tool
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};\
-
# Add Block Copy command for bl2.bin to RCW
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE}\
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl -f ${BL2_SRC_OFFSET};\
@@ -57,8 +54,6 @@ else #SECURE_BOOT
ifeq ($(RCW),"")
${Q}echo "Platform ${PLAT} requires rcw file. Please set RCW to point to the right RCW file for boot mode ${BOOT_MODE}"
else
- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};
-
# Add Block Copy command and populate boot loc ptrfor bl2.bin to RCW
${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE} \
-o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl -f ${BL2_SRC_OFFSET};
--
2.17.1

@ -51,16 +51,11 @@ define Build/Configure
touch $(PKG_BUILD_DIR)/include/generated/autoconf.h
endef
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CROSS_COMPILE="$(TARGET_CROSS)" \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
HOSTLDFLAGS= \
no-dot-config-targets=envtools \
envtools
endef
MAKE_FLAGS += \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
no-dot-config-targets=envtools \
envtools
define Package/uboot-envtools/conffiles
/etc/config/ubootenv

@ -58,7 +58,10 @@ sr3200|\
t830|\
tube2h|\
wam250|\
wndr3700|\
wnr1000-v2|\
wnr2000-v3|\
wnr2200|\
wnr612-v2|\
xd3200)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
@ -82,6 +85,11 @@ dr342|\
dr531)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000"
;;
gl-ar150|\
gl-domino|\
gl-mifi)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
;;
rambutan)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000"
@ -92,6 +100,12 @@ qihoo-c301)
wi2a-ac200i)
ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000"
;;
wndr3700)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
;;
wndr4300)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
;;
esac
config_load ubootenv

@ -23,12 +23,22 @@ glinet,gl-ar300m-nor|\
librerouter,librerouter-v1|\
netgear,ex6400|\
netgear,ex7300|\
netgear,wnr612-v2|\
ocedo,koala|\
ocedo,raccoon|\
openmesh,om5p-ac-v2|\
yuncore,a770)
yuncore,a770|\
yuncore,a782|\
yuncore,xd4200)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
glinet,gl-ar150)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000"
;;
netgear,wndr3700|\
netgear,wndr3700-v2)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000"
;;
esac
config_load ubootenv

@ -18,6 +18,9 @@ cznic,turris-omnia)
ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
;;
globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc|\
marvell,armada8040-mcbin)
ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
;;

@ -15,6 +15,8 @@ board=$(board_name)
case "$board" in
alfa-network,ac1200rm|\
alfa-network,awusfree1|\
alfa-network,quad-e4g|\
alfa-network,r36m-e4g|\
alfa-network,tube-e4g)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
;;

@ -1,12 +1,15 @@
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -10,6 +10,10 @@
@@ -10,6 +10,13 @@
# with "CC" here for the maximum code reuse of scripts/Makefile.host.
override HOSTCC = $(CC)
+ifneq ($(TARGET_CFLAGS),)
+HOSTCFLAGS = $(TARGET_CFLAGS)
+endif
+ifneq ($(TARGET_LDFLAGS),)
+HOSTLDFLAGS = $(TARGET_LDFLAGS)
+endif
+
# Compile for a hosted environment on the target
HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \

@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5f383305f4f0be631b51f89e3dc717318057bde9
PKG_SOURCE_DATE:=2019-03-03
PKG_MIRROR_HASH:=35f761659027366f5121d04db1ad263321b6a252f6573a98faae4938b861c247
PKG_SOURCE_VERSION:=f92be9d783b1210c020d5d6129e210a94bb7e290
PKG_SOURCE_DATE:=2019-10-19
PKG_MIRROR_HASH:=e40a7f624b1758b276f81c765ef1da568c595b8bd54568b9cceca7d170ebc612
PKG_RELEASE:=1
@ -21,10 +21,16 @@ include $(INCLUDE_DIR)/package.mk
define U-Boot/Default
BUILD_TARGET:=ipq40xx
BUILD_SUBTARGET:=generic
UBOOT_BOARD:=$(1)
UBOOT_IMAGE:=uboot-$(1).bin
endef
define U-Boot/fritz1200
NAME:=FritzRepeater 1200
BUILD_DEVICES:=avm_fritzrepeater-1200
endef
define U-Boot/fritz3000
NAME:=FritzRepeater 3000
BUILD_DEVICES:=avm_fritzrepeater-3000
@ -66,6 +72,6 @@ define Package/u-boot/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/upload-to-f4040.sh $(1)/
endef
UBOOT_TARGETS := fritz3000 fritz4040 fritz7530
UBOOT_TARGETS := fritz1200 fritz3000 fritz4040 fritz7530
$(eval $(call BuildPackage/U-Boot))

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=2019.01
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_HASH:=50bd7e5a466ab828914d080d5f6a432345b500e8fba1ad3b7b61e95e60d51c22

@ -0,0 +1,38 @@
From 599f7aa541bb5a658cbfd2af73bd9d2f6e828d43 Mon Sep 17 00:00:00 2001
From: Chris Packham <judge.packham@gmail.com>
Date: Mon, 18 Mar 2019 20:51:58 +1300
Subject: [PATCH] ARM: kirkwood: disable dcache for Kirkwood boards
Prior to commit 93b283d49f93 ("ARM: CPU: arm926ejs: Consolidate cache
routines to common file") the kirkwood boards didn't have and dcache
support. The network and usb drivers rely on this. Set
CONFIG_SYS_DCACHE_OFF in the Kirkwood specific config.h.
Reported-by: Leigh Brown <leigh@solinno.co.uk>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/arm/mach-kirkwood/include/mach/config.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm/mach-kirkwood/include/mach/config.h b/arch/arm/mach-kirkwood/include/mach/config.h
index fcd903887b..aea60688c2 100644
--- a/arch/arm/mach-kirkwood/include/mach/config.h
+++ b/arch/arm/mach-kirkwood/include/mach/config.h
@@ -26,6 +26,12 @@
#define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */
#define CONFIG_KIRKWOOD_RGMII_PAD_1V8 /* Set RGMII Pad voltage to 1.8V */
#define CONFIG_KIRKWOOD_PCIE_INIT /* Enable PCIE Port0 for kernel */
+/*
+ * Disable the dcache. Currently the network driver (mvgbe.c) and USB
+ * EHCI driver (ehci-marvell.c) and possibly others rely on the data
+ * cache being disabled.
+ */
+#define CONFIG_SYS_DCACHE_OFF
/*
* By default kwbimage.cfg from board specific folder is used
--
2.20.1

@ -49,6 +49,7 @@ define Package/binutils
CATEGORY:=Development
TITLE:=binutils
DEPENDS:=+objdump +ar
ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings
endef
define Package/objdump
@ -114,7 +115,7 @@ endef
define Package/binutils/install
$(INSTALL_DIR) $(1)/usr $(1)/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
mv $(1)/usr/bin/strings $(1)/bin/strings
mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
rm -f $(1)/usr/bin/objdump
rm -f $(1)/usr/bin/ar
endef

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gdb
PKG_VERSION:=8.2.1
PKG_VERSION:=8.3.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gdb
PKG_HASH:=0a6a432907a03c5c8eaad3c3cffd50c00a40c3a5e3c4039440624bae703f2202
PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
@ -57,7 +57,8 @@ CONFIGURE_ARGS+= \
--without-expat \
--without-lzma \
--disable-sim \
--disable-werror
--disable-werror \
--disable-source-highlight
CONFIGURE_VARS+= \
ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"

@ -1,5 +1,5 @@
See http://sourceware.org/bugzilla/show_bug.cgi?id=14523
---
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -348,6 +348,11 @@ gdb_signal_from_host (int hostsig)

@ -9,13 +9,7 @@ provide the same headers as the kernel or musl.
--- a/gdb/nat/aarch64-sve-linux-ptrace.h
+++ b/gdb/nat/aarch64-sve-linux-ptrace.h
@@ -20,12 +20,12 @@
#ifndef AARCH64_SVE_LINUX_PTRACE_H
#define AARCH64_SVE_LINUX_PTRACE_H
-#include <asm/sigcontext.h>
+#include <signal.h>
#include <sys/utsname.h>
@@ -25,7 +25,7 @@
#include <sys/ptrace.h>
#include <asm/ptrace.h>
@ -27,8 +21,8 @@ provide the same headers as the kernel or musl.
--- a/gdb/nat/aarch64-sve-linux-sigcontext.h
+++ b/gdb/nat/aarch64-sve-linux-sigcontext.h
@@ -19,6 +19,7 @@
#ifndef AARCH64_SVE_LINUX_SIGCONTEXT_H
#define AARCH64_SVE_LINUX_SIGCONTEXT_H
#ifndef NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H
#define NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H
+#ifndef SVE_MAGIC
#define SVE_MAGIC 0x53564501

@ -8,7 +8,7 @@
#include "defs.h"
#include "inferior.h"
#include "infrun.h"
@@ -71,6 +72,10 @@
@@ -72,6 +73,10 @@
#define SPUFS_MAGIC 0x23c9b64e
#endif
@ -29,8 +29,8 @@
--- a/gdb/nat/ppc-linux.h
+++ b/gdb/nat/ppc-linux.h
@@ -18,7 +18,10 @@
#ifndef PPC_LINUX_H
#define PPC_LINUX_H 1
#ifndef NAT_PPC_LINUX_H
#define NAT_PPC_LINUX_H
+#define pt_regs __pt_regs
#include <asm/ptrace.h>
@ -41,9 +41,9 @@
/* This sometimes isn't defined. */
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -21,7 +21,9 @@
#include "linux-low.h"
@@ -23,7 +23,9 @@
#include "elf/common.h"
#include <sys/uio.h>
#include <elf.h>
+#define pt_regs __pt_regs
#include <asm/ptrace.h>

@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1277,13 +1277,13 @@ if test -z "$LD"; then
@@ -1283,13 +1283,13 @@ if test -z "$LD"; then
fi
fi
@ -17,16 +17,16 @@
AC_LANG_PUSH(C++)
AC_LINK_IFELSE([AC_LANG_SOURCE([
#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
@@ -1609,7 +1609,7 @@ AC_ARG_WITH(stage1-ldflags,
# if supported. But if the user explicitly specified the libraries to use,
@@ -1629,7 +1629,7 @@ AC_ARG_WITH(stage1-ldflags,
# trust that they are doing what they want.
if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
-a "$have_static_libs" = yes; then
- stage1_ldflags="-static-libstdc++ -static-libgcc"
+ stage1_ldflags="-static-libstdc++"
fi])
AC_SUBST(stage1_ldflags)
@@ -1638,7 +1638,7 @@ AC_ARG_WITH(boot-ldflags,
@@ -1658,7 +1658,7 @@ AC_ARG_WITH(boot-ldflags,
# statically. But if the user explicitly specified the libraries to
# use, trust that they are doing what they want.
if test "$poststage1_libs" = ""; then
@ -37,7 +37,7 @@
--- a/configure
+++ b/configure
@@ -5043,14 +5043,14 @@ if test -z "$LD"; then
@@ -5053,14 +5053,14 @@ if test -z "$LD"; then
fi
fi
@ -56,16 +56,16 @@
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5833,7 +5833,7 @@ else
# if supported. But if the user explicitly specified the libraries to use,
@@ -5861,7 +5861,7 @@ else
# trust that they are doing what they want.
if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
-a "$have_static_libs" = yes; then
- stage1_ldflags="-static-libstdc++ -static-libgcc"
+ stage1_ldflags="-static-libstdc++"
fi
fi
@@ -5869,7 +5869,7 @@ else
@@ -5897,7 +5897,7 @@ else
# statically. But if the user explicitly specified the libraries to
# use, trust that they are doing what they want.
if test "$poststage1_libs" = ""; then

@ -52,6 +52,7 @@ MAKE_FLAGS = \
NO_LIBAUDIT=1 \
NO_LIBCRYPTO=1 \
NO_LIBUNWIND=1 \
NO_LIBCAP=1 \
CROSS_COMPILE="$(TARGET_CROSS)" \
CC="$(TARGET_CC)" \
LD="$(TARGET_CROSS)ld" \

@ -1,17 +0,0 @@
--- a/ptrace.h
+++ b/ptrace.h
@@ -30,7 +30,14 @@
# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
# endif
+#if POWERPC
+#include <linux/types.h>
+#define __ASSEMBLY__
+#endif
# include <linux/ptrace.h>
+#if POWERPC
+#undef __ASSEMBLY__
+#endif
# ifdef HAVE_STRUCT_IA64_FPREG
# undef ia64_fpreg

@ -8,9 +8,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ath10k-firmware
PKG_SOURCE_DATE:=2018-10-10
PKG_SOURCE_VERSION:=d366b80d41309531c0c98b26625f23e318f33e31
PKG_MIRROR_HASH:=ec06f10e6b1d4f7a28366a893c8a73a000454c2f031fc747381a1fb8aa1e0846
PKG_SOURCE_DATE:=2019-10-03
PKG_SOURCE_VERSION:=d622d160e9f552ead68d9ae81b715422892dc2ef
PKG_MIRROR_HASH:=2e504e071c3f896d629c4cfffe7ff4b5f1acdb4fecd3f01e8ff8c73e87a67cc7
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
@ -64,92 +64,92 @@ define Download/ct-firmware-htt
URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT)
endef
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.008
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.013
define Download/ath10k-firmware-qca988x-ct
$(call Download/ct-firmware,QCA988X,)
HASH:=c2407cbdaaf143c9796e654aed026f0aa70fc93a82dd1244c62e95ede894e829
HASH:=19db86003509dedb8ace339c183813ca637d65af24d00666411d1590efe33e13
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct))
QCA988X_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.008
QCA988X_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.013
define Download/ath10k-firmware-qca988x-ct-htt
$(call Download/ct-firmware-htt,QCA988X,)
HASH:=789c4d1c8ac5edeb43d507157944102b564cd6970c365a14b50cab08ffa4e3b5
HASH:=454e67dab545e720369a07be2fee16de008c76db4ab3119e7760bf9f7504c066
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct-htt))
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.008
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.013
define Download/ath10k-firmware-qca9887-ct
$(call Download/ct-firmware,QCA9887,ath10k-9887)
HASH:=07692a63ab9d11a65c17cc896aff89ea33b7af4e0e1e51ae100651291afe3a4d
HASH:=b3c738328427e124701a5735d65cde0f60e4172ae5bc23b00e5b16df7995dbd4
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct))
QCA9887_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.008
QCA9887_FIRMWARE_FILE_CT_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.013
define Download/ath10k-firmware-qca9887-ct-htt
$(call Download/ct-firmware-htt,QCA9887,ath10k-9887)
HASH:=ef336462d4a44ab9a0d89e83064124e647a9fb4a8af8be9df5724378611d2e82
HASH:=4432ccee23133bbaa4a5552e50a1e7e889b257362603e05530e751b67c29b7b5
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct-htt))
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.008
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.013
define Download/ath10k-firmware-qca99x0-ct
$(call Download/ct-firmware,QCA99X0,ath10k-10-4b)
HASH:=3357d7ba739512619ccd14043338cfe8e148d5d8e99343e3ccf7a2ff0d07d05f
HASH:=6fa74a3fc87cba97dbc4a7213b760f8d997cd9c5f11900d47d387b23764cf20a
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct))
QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.008
QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.013
define Download/ath10k-firmware-qca99x0-ct-htt
$(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b)
HASH:=ce81e1b9b80b30263e9d5010e38fac3f005214fd955dc2cff95e7fe633796212
HASH:=68e92820c51270eba4f68b24654c4a9408902b2600762b70204f4cb5419bb714
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-htt))
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.008
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.013
define Download/ath10k-firmware-qca9984-ct
$(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b)
HASH:=e2794ce577ff7942dc5f767a77fa52167f323bc8f50f04570fc5efe92ed761cf
HASH:=08aeb883bd2d9258e8f1907cca8a0d2eda1c559a66e228dadffd6798f6877c7d
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct))
QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.008
QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.013
define Download/ath10k-firmware-qca9984-ct-htt
$(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b)
HASH:=1f90555963c2e52ac8fc5581b2a0f9c658e3f5205844898bdc48c78d009bb6eb
HASH:=38ed59a2b3c66c10926706a21ae2d3aeaf83e589f19345a8f48d6520522e4fde
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-htt))
QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.008
QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.013
define Download/ath10k-firmware-qca4019-ct
$(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b)
HASH:=4e73cf8e24e83df87d6dce2038e350b3f67753ccca37a8c0d1b861818991e6aa
HASH:=feca75fe89af9a3e998047f85ff3428676f4d574b770d51773bb419d0dd98e5a
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct))
QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.008
QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.013
define Download/ath10k-firmware-qca4019-ct-htt
$(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b)
HASH:=8f6434856d6f0207bc3f519cf50d2bf45df1bfcbc69b864ed02fcb5cd5ef6f4b
HASH:=6a4977689343f43edd934823512f031fd1a026e872004343b9952077f9607cb0
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-htt))
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.008
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.013
define Download/ath10k-firmware-qca9888-ct
$(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b)
HASH:=6b627746f88c1bfecb872e72c61d6097192e389592e391630d2661b44f13b10d
HASH:=d6a59c17bfbec1abc8498762d9f00b2449cab352feb8bef8b621771168376dbf
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct))
QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.008
QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.013
define Download/ath10k-firmware-qca9888-ct-htt
$(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b)
HASH:=4ef46b2bdd3ddc894f79da2dbf90ee04cb58781f3eb193840bd5fdb8624b447b
HASH:=fe242c0d56494975d7a1aeb6969d90cc21cb133fba99040d4da7a25fdb90d92c
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-htt))
@ -174,7 +174,7 @@ $(Package/ath10k-firmware-default)
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca988x
DEPENDS:=+kmod-ath10k-ct
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9887-ct
@ -190,7 +190,7 @@ $(Package/ath10k-firmware-default)
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9887
DEPENDS:=+kmod-ath10k-ct
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca988x-ct/description
@ -308,7 +308,7 @@ $(Package/ath10k-firmware-default)
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
DEPENDS:=+kmod-ath10k-ct
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9984-ct
@ -324,7 +324,7 @@ $(Package/ath10k-firmware-default)
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
DEPENDS:=+kmod-ath10k-ct
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca4019-ct
@ -340,7 +340,7 @@ $(Package/ath10k-firmware-default)
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
DEPENDS:=+kmod-ath10k-ct
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9888-ct
@ -356,7 +356,7 @@ $(Package/ath10k-firmware-default)
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
DEPENDS:=+kmod-ath10k-ct
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
@ -410,7 +410,7 @@ endef
define Package/ath10k-firmware-qca9887/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9887/hw1.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00033 \
$(PKG_BUILD_DIR)/QCA9887/hw1.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00047 \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-5.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9887/hw1.0/board.bin \
@ -433,7 +433,7 @@ define Package/ath10k-firmware-qca988x/install
$(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00037 \
$(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00047 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
endef
@ -606,9 +606,9 @@ define Package/ath10k-firmware-qca9888-ct-htt/install
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin
endef
#$(eval $(call BuildPackage,ath10k-firmware-qca9887))
$(eval $(call BuildPackage,ath10k-firmware-qca9887))
#$(eval $(call BuildPackage,ath10k-firmware-qca9888))
#$(eval $(call BuildPackage,ath10k-firmware-qca988x))
$(eval $(call BuildPackage,ath10k-firmware-qca988x))
#$(eval $(call BuildPackage,ath10k-firmware-qca99x0))
#$(eval $(call BuildPackage,ath10k-firmware-qca6174))
#$(eval $(call BuildPackage,ath10k-firmware-qca9984))

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=intel-microcode
PKG_VERSION:=20180807a
PKG_VERSION:=20190918
PKG_RELEASE:=1
PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/
PKG_HASH:=1a7cb96d5c6a4abac2936236223d9bea79d7442dc1cfe9b712ff8e35374f0f9f
PKG_HASH:=b7ecb5dd30d71e9b3c2ab184693a876171392e0d80d138c3560c662e5f2a2247
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
PKG_BUILD_DEPENDS:=iucode-tool/host

@ -27,6 +27,7 @@ ALLWIFIBOARDS:= \
alfa-network_ap120c-ac \
asus_map-ac2200 \
avm_fritzbox-7530 \
avm_fritzrepeater-1200 \
avm_fritzrepeater-3000 \
engenius_eap1300 \
engenius_ens620ext \
@ -98,6 +99,7 @@ endef
$(eval $(call generate-ipq-wifi-package,alfa-network_ap120c-ac,ALFA Network AP120C-AC))
$(eval $(call generate-ipq-wifi-package,asus_map-ac2200,ASUS MAP-AC2200))
$(eval $(call generate-ipq-wifi-package,avm_fritzbox-7530,AVM FRITZ!Box 7530))
$(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200))
$(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-3000,AVM FRITZ!Repeater 3000))
$(eval $(call generate-ipq-wifi-package,engenius_eap1300,EnGenius EAP1300))
$(eval $(call generate-ipq-wifi-package,engenius_ens620ext,EnGenius ENS620EXT))

@ -31,7 +31,7 @@ define Package/ath10k-firmware-qca9887/install
$(PKG_BUILD_DIR)/ath10k/QCA9887/hw1.0/board.bin \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
$(eval $(call BuildPackage,ath10k-firmware-qca9887))
# $(eval $(call BuildPackage,ath10k-firmware-qca9887))
Package/ath10k-firmware-qca9888 = $(call Package/firmware-default,ath10k qca9888 firmware)
define Package/ath10k-firmware-qca9888/install
@ -55,7 +55,7 @@ define Package/ath10k-firmware-qca988x/install
$(PKG_BUILD_DIR)/ath10k/QCA988X/hw2.0/firmware-5.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
endef
$(eval $(call BuildPackage,ath10k-firmware-qca988x))
# $(eval $(call BuildPackage,ath10k-firmware-qca988x))
Package/ath10k-firmware-qca6174 = $(call Package/firmware-default,ath10k qca6174 firmware)
define Package/ath10k-firmware-qca6174/install

@ -1,26 +1,27 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wireless-regdb
PKG_VERSION:=2019.06.03
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git
PKG_SOURCE_DATE:=2017-10-20
PKG_SOURCE_VERSION:=4343d359ed5e7404de8803a74df186457b26ab79
PKG_MIRROR_HASH:=5f5b669f32ae36cb65b1d99efbbbfd42c2983cda32f6448346e3e54ffaba3889
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
PKG_HASH:=cd917ed86b63ce8d93947979f1f18948f03a4ac0ad89ec25227b36ac00dc54bf
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
include $(INCLUDE_DIR)/package.mk
define Package/wireless-regdb
PKGARCH:=all
SECTION:=firmware
CATEGORY:=Firmware
URL:=$(patsubst pub/scm,cgit,$(PKG_SOURCE_URL))
URL:=https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git/
TITLE:=Wireless Regulatory Database
endef
define Build/Compile
python $(PKG_BUILD_DIR)/db2fw.py $(PKG_BUILD_DIR)/regulatory.db $(PKG_BUILD_DIR)/db.txt
$(STAGING_DIR_HOST)/bin/$(PYTHON) $(PKG_BUILD_DIR)/db2fw.py $(PKG_BUILD_DIR)/regulatory.db $(PKG_BUILD_DIR)/db.txt
endef
define Package/wireless-regdb/install

@ -0,0 +1,58 @@
From 651e39dee8605995b736b6056c6f7dc5c5a9c948 Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg@intel.com>
Date: Thu, 22 Aug 2019 21:46:27 +0200
Subject: [PATCH] regdb: fix compatibility with python2
Various changes in the commit mentioned below broke
compatibility with python2. Restore it in a way that
makes it worth with both versions.
Fixes: f3c4969c2485 ("wireless-regdb: make scripts compatible with Python 3")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
db2bin.py | 2 +-
db2fw.py | 2 +-
dbparse.py | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
--- a/db2bin.py
+++ b/db2bin.py
@@ -118,7 +118,7 @@ reg_country_ptr.set()
for alpha2 in countrynames:
coll = countries[alpha2]
# struct regdb_file_reg_country
- output.write(struct.pack('>BBxBI', alpha2[0], alpha2[1], coll.dfs_region, reg_rules_collections[coll.permissions]))
+ output.write(struct.pack('>2sxBI', alpha2, coll.dfs_region, reg_rules_collections[coll.permissions]))
if len(sys.argv) > 3:
--- a/db2fw.py
+++ b/db2fw.py
@@ -85,7 +85,7 @@ countrynames = list(countries)
countrynames.sort()
for alpha2 in countrynames:
coll = countries[alpha2]
- output.write(struct.pack('>BB', alpha2[0], alpha2[1]))
+ output.write(struct.pack('>2s', alpha2))
country_ptrs[alpha2] = PTR(output)
output.write(b'\x00' * 4)
--- a/dbparse.py
+++ b/dbparse.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-from builtins import bytes
from functools import total_ordering
import sys, math
from math import ceil, log
@@ -359,7 +358,7 @@ class DBParser(object):
for cname in cnames:
if len(cname) != 2:
self._warn("country '%s' not alpha2" % cname)
- cname = bytes(cname, 'ascii')
+ cname = cname.encode('ascii')
if not cname in self._countries:
self._countries[cname] = Country(dfs_region, comments=self._comments)
self._current_countries[cname] = self._countries[cname]

@ -1,251 +0,0 @@
From: Johannes Berg <johannes.berg@intel.com>
Date: Mon, 9 Oct 2017 11:50:57 +0200
Subject: [PATCH] regdb: write firmware file format (version code 20)
TODO: clean up the Makefile stuff ...
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
create mode 100755 db2fw.py
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,5 @@
# Install prefix
PREFIX ?= /usr
-CRDA_PATH ?= $(PREFIX)/lib/crda
-CRDA_KEY_PATH ?= $(CRDA_PATH)/pubkeys
MANDIR ?= $(PREFIX)/share/man/
@@ -30,39 +28,47 @@ REGDB_AUTHOR ?= $(shell if [ -f $(DISTRO
fi)
REGDB_PRIVKEY ?= ~/.wireless-regdb-$(REGDB_AUTHOR).key.priv.pem
-REGDB_PUBKEY ?= $(REGDB_AUTHOR).key.pub.pem
-
-REGDB_UPSTREAM_PUBKEY ?= sforshee.key.pub.pem
+REGDB_PUBCERT ?= $(REGDB_AUTHOR).x509.pem
REGDB_CHANGED = $(shell $(SHA1SUM) -c --status sha1sum.txt >/dev/null 2>&1; \
if [ $$? -ne 0 ]; then \
- echo maintainer-clean $(REGDB_PUBKEY); \
+ echo maintainer-clean $(REGDB_PUBCERT); \
fi)
.PHONY: all clean mrproper install maintainer-clean install-distro-key
-all: $(REGDB_CHANGED) regulatory.bin sha1sum.txt
+all: $(REGDB_CHANGED) regulatory.db.p7s sha1sum.txt
clean:
@rm -f *.pyc *.gz
maintainer-clean: clean
- @rm -f regulatory.bin
+ @rm -f regulatory.db regulatory.db.p7s
mrproper: clean maintainer-clean
- @echo Removed public key, regulatory.bin and compresed man pages
- @rm -f $(REGDB_PUBKEY) .custom
+ @echo Removed public key, regulatory.db* and compressed man pages
+ @rm -f $(REGDB_PUBCERT) .custom
-regulatory.bin: db.txt $(REGDB_PRIVKEY) $(REGDB_PUBKEY)
- @echo Generating $@ digitally signed by $(REGDB_AUTHOR)...
- ./db2bin.py regulatory.bin db.txt $(REGDB_PRIVKEY)
+regulatory.db: db.txt db2fw.py
+ @echo "Generating $@"
+ ./db2fw.py regulatory.db db.txt
+
+regulatory.db.p7s: regulatory.db $(REGDB_PRIVKEY) $(REGDB_PUBCERT)
+ @echo "Signing regulatory.db (by $(REGDB_AUTHOR))..."
+ @openssl smime -sign \
+ -signer $(REGDB_PUBCERT) \
+ -inkey $(REGDB_PRIVKEY) \
+ -in $< -nosmimecap -binary \
+ -outform DER -out $@
sha1sum.txt: db.txt
sha1sum $< > $@
-$(REGDB_PUBKEY): $(REGDB_PRIVKEY)
- @echo "Generating public key for $(REGDB_AUTHOR)..."
- openssl rsa -in $(REGDB_PRIVKEY) -out $(REGDB_PUBKEY) -pubout -outform PEM
+$(REGDB_PUBCERT): $(REGDB_PRIVKEY)
+ @echo "Generating certificate for $(REGDB_AUTHOR)..."
+ @openssl req -config regulatory.openssl.conf \
+ -key $(REGDB_PRIVKEY) -days 36500 -utf8 -nodes -batch \
+ -x509 -outform PEM -out $(REGDB_PUBCERT)
@echo $(REGDB_PUBKEY) > .custom
@@ -97,16 +103,7 @@ install-distro-key: maintainer-clean $(D
# make maintainer-clean
# make
# sudo make install
-install: regulatory.bin.5.gz
- install -m 755 -d $(DESTDIR)/$(CRDA_PATH)
- install -m 755 -d $(DESTDIR)/$(CRDA_KEY_PATH)
- if [ -f .custom ]; then \
- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(shell cat .custom); \
- fi
- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(REGDB_UPSTREAM_PUBKEY)
- install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.bin
+install: regulatory.db.5.gz
+ install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.db
install -m 755 -d $(DESTDIR)/$(MANDIR)/man5/
- install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.bin.5.gz
-
-uninstall:
- rm -rf $(DESTDIR)/$(CRDA_PATH)/
+ install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.db.5.gz
--- a/README
+++ b/README
@@ -18,8 +18,8 @@ python module is used by the web viewer
implemented as a MoinMoin macro (and used on http://wireless.kernel.org)
to allow viewing the database for verification.
-The dbparse module is also used by db2bin.py, the `compiler', which
-compiles and signs the binary database.
+The dbparse module is also used by db2bin.py and db2fw.py, the `compilers'
+that compile the database to its binary formats.
For more information, please see the CRDA git repository:
--- /dev/null
+++ b/db2fw.py
@@ -0,0 +1,133 @@
+#!/usr/bin/env python
+
+from cStringIO import StringIO
+import struct
+import hashlib
+from dbparse import DBParser
+import sys
+
+MAGIC = 0x52474442
+VERSION = 20
+
+if len(sys.argv) < 3:
+ print 'Usage: %s output-file input-file' % sys.argv[0]
+ sys.exit(2)
+
+def create_rules(countries):
+ result = {}
+ for c in countries.itervalues():
+ for rule in c.permissions:
+ result[rule] = 1
+ return result.keys()
+
+def create_collections(countries):
+ result = {}
+ for c in countries.itervalues():
+ result[(c.permissions, c.dfs_region)] = 1
+ return result.keys()
+
+
+def be32(output, val):
+ output.write(struct.pack('>I', val))
+def be16(output, val):
+ output.write(struct.pack('>H', val))
+
+class PTR(object):
+ def __init__(self, output):
+ self._output = output
+ self._pos = output.tell()
+ be16(output, 0)
+ self._written = False
+
+ def set(self, val=None):
+ if val is None:
+ val = self._output.tell()
+ assert val & 3 == 0
+ self._offset = val
+ pos = self._output.tell()
+ self._output.seek(self._pos)
+ be16(self._output, val >> 2)
+ self._output.seek(pos)
+ self._written = True
+
+ def get(self):
+ return self._offset
+
+ @property
+ def written(self):
+ return self._written
+
+p = DBParser()
+countries = p.parse(file(sys.argv[2]))
+rules = create_rules(countries)
+rules.sort(cmp=lambda x, y: cmp(x.freqband, y.freqband))
+collections = create_collections(countries)
+collections.sort(cmp=lambda x, y: cmp(x[0][0].freqband, y[0][0].freqband))
+
+output = StringIO()
+
+# struct regdb_file_header
+be32(output, MAGIC)
+be32(output, VERSION)
+
+country_ptrs = {}
+countrynames = countries.keys()
+countrynames.sort()
+for alpha2 in countrynames:
+ coll = countries[alpha2]
+ output.write(struct.pack('>cc', str(alpha2[0]), str(alpha2[1])))
+ country_ptrs[alpha2] = PTR(output)
+output.write('\x00' * 4)
+
+reg_rules = {}
+flags = 0
+for reg_rule in rules:
+ freq_range, power_rule = reg_rule.freqband, reg_rule.power
+ reg_rules[reg_rule] = output.tell()
+ assert power_rule.max_ant_gain == 0
+ flags = 0
+ # convert to new rule flags
+ assert reg_rule.flags & ~0x899 == 0
+ if reg_rule.flags & 1<<0:
+ flags |= 1<<0
+ if reg_rule.flags & 1<<3:
+ flags |= 1<<1
+ if reg_rule.flags & 1<<4:
+ flags |= 1<<2
+ if reg_rule.flags & 1<<7:
+ flags |= 1<<3
+ if reg_rule.flags & 1<<11:
+ flags |= 1<<4
+ rule_len = 16
+ cac_timeout = 0 # TODO
+ if not (flags & 1<<2):
+ cac_timeout = 0
+ if cac_timeout:
+ rule_len += 2
+ output.write(struct.pack('>BBHIII', rule_len, flags, power_rule.max_eirp * 100,
+ freq_range.start * 1000, freq_range.end * 1000, freq_range.maxbw * 1000,
+ ))
+ if cac_timeout:
+ output.write(struct.pack('>H', cac_timeout))
+ while rule_len % 4:
+ output.write('\0')
+ rule_len += 1
+
+for coll in collections:
+ for alpha2 in countrynames:
+ if (countries[alpha2].permissions, countries[alpha2].dfs_region) == coll:
+ assert not country_ptrs[alpha2].written
+ country_ptrs[alpha2].set()
+ slen = 3
+ output.write(struct.pack('>BBBx', slen, len(list(coll[0])), coll[1]))
+ coll = list(coll[0])
+ for regrule in coll:
+ be16(output, reg_rules[regrule] >> 2)
+ if len(coll) % 2:
+ be16(output, 0)
+
+for alpha2 in countrynames:
+ assert country_ptrs[alpha2].written
+
+outfile = open(sys.argv[1], 'w')
+outfile.write(output.getvalue())

@ -5,7 +5,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/db.txt
+++ b/db.txt
@@ -6,7 +6,7 @@ country 00:
@@ -16,7 +16,7 @@ country 00:
# Channel 14. Only JP enables this and for 802.11b only
(2474 - 2494 @ 20), (20), NO-IR, NO-OFDM
# Channel 36 - 48

@ -0,0 +1,47 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Willi <martin@strongswan.org>
Date: Tue, 2 Jul 2019 16:19:44 +0200
Subject: [PATCH] wireless-regdb: Fix overlapping ranges for Switzerland and
Liechtenstein
The commit referenced below changes the 5GHz frequency range 5250-5330
to 5150-5330, making that range overlapping with the existing range
5170-5250. This imposes DFS limitations and a reduced maximum power
level for the range 5170-5250.
The change of the frequency range seems not intentional. Instead the
commit should have changed the 5170-5250 range to 5150-5250, and the
5250-5330 range to 5250-5350 (see [1]).
[1] https://www.ofcomnet.ch/api/rir/1010/05
Fixes: 957a7cff72a3 ("wireless-regdb: update regulatory rules for Switzerland (CH), and Liechtenstein (LI) on 5GHz")
Signed-off-by: Martin Willi <martin@strongswan.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
diff --git a/db.txt b/db.txt
index d47ab94c3aa5..37393e6a793e 100644
--- a/db.txt
+++ b/db.txt
@@ -271,8 +271,8 @@ country CF: DFS-FCC
# transmitter power control is in use: 5250-5330@23db, 5490-5710@30db
country CH: DFS-ETSI
(2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5150 - 5330 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
(5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
# 60 GHz band channels 1-4, ref: Etsi En 302 567
(57000 - 66000 @ 2160), (40)
@@ -747,8 +747,8 @@ country LC: DFS-ETSI
# transmitter power control is in use: 5250-5330@23db, 5490-5710@30db
country LI: DFS-ETSI
(2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5150 - 5330 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
(5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
# 60 GHz band channels 1-4, ref: Etsi En 302 567
(57000 - 66000 @ 2160), (40)

@ -0,0 +1,843 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Emil Petersky <emil.petersky@streamunlimited.com>
Date: Tue, 17 Sep 2019 09:49:19 +0200
Subject: [PATCH] wireless-regdb: Fix ranges of EU countries as they are
harmonized since 2014
This patch unites entries for EU countries, as they have been harmonized
latest by July 2014...
EU decision 2005/513/EC:
https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
EU decision 2006/771/EC:
https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
Signed-off-by: Emil Petersky <emil.petersky@streamunlimited.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
diff --git a/db.txt b/db.txt
index 2e149b6e0ea2..a57452479a9b 100644
--- a/db.txt
+++ b/db.txt
@@ -87,12 +87,20 @@ country AS: DFS-FCC
(5490 - 5730 @ 160), (24), DFS
(5735 - 5835 @ 80), (30)
+# AT as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# AT: https://www.rtr.at/en/tk/Spektrum5GHz/1997_bmvit-info-052010en.pdf
+# AT: acceptance https://www.ris.bka.gv.at/Dokumente/BgblAuth/BGBLA_2014_II_63/BGBLA_2014_II_63.pdfsig
country AT: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
# Source:
@@ -139,12 +147,22 @@ country BD: DFS-JP
(2402 - 2482 @ 40), (20)
(5735 - 5835 @ 80), (30)
+# BE as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# BE: https://www.ibpt.be/public/files/en/21760/B03-01_2.1_EN.pdf
+# BE: https://www.ibpt.be/public/files/en/21761/B03-02_2.1_EN.pdf
+# BE: https://www.ibpt.be/public/files/en/21762/B03-03_2.1_EN.pdf
+# BE: https://www.ibpt.be/public/files/en/22165/B01-28_3.1_EN.pdf
country BE: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country BF: DFS-FCC
@@ -167,22 +185,29 @@ country BF: DFS-FCC
#
# Note: The transmit power limits in the 5250-5350 MHz and 5470-5725 MHz bands
# can be raised by 3 dBm if TPC is enabled. Refer to BDS EN 301 893 for details.
+#
+# BG as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# BG: https://crc.bg/files/_en/Electronic_Communications_Revised_EN1.pdf
+# BG: acceptance of 2006/771/EC https://crc.bg/files/Pravila_06_12_2018.pdf
country BG: DFS-ETSI
# Wideband data transmission systems (WDTS) in the 2.4GHz ISM band, ref:
# I.22 of the List, BDS EN 300 328
- (2402 - 2482 @ 40), (20)
+ (2400 - 2483.5 @ 40), (100 mW)
# 5 GHz Radio Local Area Networks (RLANs), ref:
# II.H01 of the List, BDS EN 301 893
- (5170 - 5250 @ 80), (23), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
# II.H01 of the List, I.54 from the List, BDS EN 301 893
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # Short range devices (SRDs) in the 5725-5875 MHz frequency range, ref:
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
# I.43 of the List, BDS EN 300 440-2, BDS EN 300 440-1
- (5725 - 5875 @ 80), (14)
- # 60 GHz Multiple-Gigabit RLAN Systems, ref:
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
# II.H03 of the List, BDS EN 302 567-2
- (57000 - 66000 @ 2160), (40), NO-OUTDOOR
+ (57000 - 66000 @ 2160), (40)
country BH: DFS-JP
(2402 - 2482 @ 40), (20)
@@ -265,16 +290,22 @@ country CF: DFS-FCC
(5490 - 5730 @ 40), (24), DFS
(5735 - 5835 @ 40), (30)
-# Source:
-# https://www.ofcomnet.ch/#/fatTable
-# Note that the maximum transmitter power can be doubled for 5250-5710MHz if
-# transmitter power control is in use: 5250-5330@23db, 5490-5710@30db
+# CH as part of CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# CH: https://www.ofcomnet.ch/api/rir/1010/05
+# CH: https://www.ofcomnet.ch/api/rir/1010/04
+# CH: https://www.ofcomnet.ch/api/rir/1008/12
+# CH: https://www.ofcomnet.ch/#/fatTable
country CH: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country CI: DFS-FCC
@@ -329,26 +360,42 @@ country CX: DFS-FCC
(5490 - 5730 @ 160), (24), DFS
(5735 - 5835 @ 80), (30)
+# CY as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# CY: http://www.mcw.gov.cy/mcw/dec/dec.nsf/all/292484CFC7013DD4C2256EBA0023D447/$file/Sxedio%20Radiosyxnothtwn%20ths%20Dhmokratias-3-8-2018-E2.2(English%20Unified%20Unofficial).pdf?openelement
country CY: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
-# Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf
-# and http://www.ctu.eu/164/download/VOR/VOR-12-05-2007-6-AN.pdf
-# Power at 5250 - 5350 MHz and 5470 - 5725 MHz can be doubled if TPC is
-# implemented.
+# CZ as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# CZ: https://www.ctu.cz/cs/download/vseobecna-opravneni/archiv/vo-r_12-06_2010-09.pdf
+# CZ: https://www.ctu.cz/sites/default/files/obsah/ctu/vseobecne-opravneni-c.vo-r/10/12.2017-10/obrazky/vo-r10-122017-10.pdf
country CZ: DFS-ETSI
(2400 - 2483.5 @ 40), (100 mW)
(5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
(5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
(5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
+# DE as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+#
# Allocation for the 2.4 GHz band (Vfg 10 / 2013, Allgemeinzuteilung von
# Frequenzen für die Nutzung in lokalen Netzwerken; Wireless Local Area
# Networks (WLAN-Funkanwendungen).
@@ -379,16 +426,22 @@ country DE: DFS-ETSI
# 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
-# Sources:
+# DK as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# DK: https://ens.dk/sites/ens.dk/files/Tele/frekvensplan_0.pdf
# 5GHz: https://erhvervsstyrelsen.dk/sites/default/files/007_interface-datanet_5-6_ghz.pdf.pdf
# 60GHz: https://erhvervsstyrelsen.dk/sites/default/files/radiograenseflader-63.pdf
country DK: DFS-ETSI
- (2400 - 2483.5 @ 40), (20)
- (5150 - 5250 @ 80), (23), AUTO-BW, wmmrule=ETSI
- (5250 - 5350 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5470 - 5725 @ 160), (27), DFS, wmmrule=ETSI
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
# 60 GHz band channels 1-4 (ETSI EN 302 567)
- (57000 - 66000 @ 2160), (40), NO-OUTDOOR
+ (57000 - 66000 @ 2160), (40)
# Source:
# http://www.ntrcdom.org/index.php?option=com_content&view=category&layout=blog&id=10&Itemid=55
@@ -417,12 +470,20 @@ country EC: DFS-FCC
(5490 - 5730 @ 20), (24), DFS
(5735 - 5835 @ 20), (30)
+# EE as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# EE: https://www.ttja.ee/et/ettevottele-organisatsioonile/sideteenused/raadioseadmed/wifi-seade
+# EE: https://www.itu.int/ITU-D/study_groups/SGP_1998-2002/JGRES09/pdf/estonia.pdf
country EE: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country EG: DFS-ETSI
@@ -430,17 +491,19 @@ country EG: DFS-ETSI
(5170 - 5250 @ 40), (20)
(5250 - 5330 @ 40), (20), DFS
-# Source:
-# Cuadro nacional de atribución de frecuencias (CNAF)
-# https://avancedigital.gob.es/espectro/Paginas/cnaf.aspx
+# ES as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# ES: https://avancedigital.gob.es/espectro/Paginas/cnaf.aspx
country ES: DFS-ETSI
(2400 - 2483.5 @ 40), (100 mW)
(5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
(5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
(5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
- # Short Range Devices (SRD) (ETSI EN 300 440)
+ # short range devices (ETSI EN 300 440-1)
(5725 - 5875 @ 80), (25 mW)
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country ET: DFS-ETSI
@@ -449,14 +512,18 @@ country ET: DFS-ETSI
(5250 - 5330 @ 80), (20), DFS, AUTO-BW
(5490 - 5710 @ 160), (27), DFS
+# FI as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
country FI: DFS-ETSI
- (2400 - 2483.5 @ 40), (20)
- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5470 - 5725 @ 160), (27), DFS, wmmrule=ETSI
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
# short range devices (ETSI EN 300 440-1)
(5725 - 5875 @ 80), (25 mW)
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country FM: DFS-FCC
@@ -466,22 +533,34 @@ country FM: DFS-FCC
(5490 - 5730 @ 160), (24), DFS
(5735 - 5835 @ 80), (30)
+# FR as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
country FR: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5470 - 5725 @ 160), (27), DFS, wmmrule=ETSI
- # short range devices (ETSI EN 300 440)
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
(5725 - 5875 @ 80), (25 mW)
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
+# GB as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# GB: https://www.ofcom.org.uk/__data/assets/pdf_file/0019/136009/Ofcom-Information-Sheet-5-GHz-RLANs.pdf
+# GB: https://www.ofcom.org.uk/__data/assets/pdf_file/0028/84970/ir-2030.pdf
country GB: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country GD: DFS-FCC
@@ -523,12 +602,20 @@ country GP: DFS-ETSI
(5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
(5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
+# GR as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# GR: https://www.eett.gr/opencms/export/sites/default/EETT_EN/Electronic_Communications/Radio_Communications/TelecommunicationEquipment/Radio_equipment_interface_requirement_2012.pdf
+# GR: https://www.eett.gr/opencms/export/sites/default/EETT_EN/Electronic_Communications/Radio_Communications/TelecommunicationEquipment/Radio_equipment_interface_requirement_107.pdf
country GR: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country GT: DFS-FCC
@@ -563,11 +650,18 @@ country HN: DFS-FCC
(5735 - 5835 @ 80), (30)
country HR: DFS-ETSI
- (2400 - 2483.5 @ 40), (20)
- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5470 - 5725 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+# HR as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# HR: http://tablice.hakom.hr:8080/vis?lang=en
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country HT: DFS-FCC
@@ -577,37 +671,42 @@ country HT: DFS-FCC
(5490 - 5730 @ 160), (24), DFS
(5735 - 5835 @ 80), (30)
-# http://stir.nmhh.hu/?oldal=dokumentumGeneralo&root_rendeletelem_id=3&hatalyos=1
-# http://english.nmhh.hu/cikk/297/Eljarasi_tajekoztato_a_24_GHzes_es_az_5_GHzes_savban_mukodo_berendezesek_engedelyezeserol
-# http://nmhh.hu/dokumentum/319/kis_hatotavolsagu_eszkozok_srdk.pdf
+# HU as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# HU: http://stir.nmhh.hu/?oldal=dokumentumGeneralo&root_rendeletelem_id=3&hatalyos=1
+# HU: http://english.nmhh.hu/cikk/297/Eljarasi_tajekoztato_a_24_GHzes_es_az_5_GHzes_savban_mukodo_berendezesek_engedelyezeserol
+# HU: http://nmhh.hu/dokumentum/319/kis_hatotavolsagu_eszkozok_srdk.pdf
country HU: DFS-ETSI
- # ref: 2006/771/EK, (EU) 2017/1483, MSZ EN 300 328
- # additionally: 100mW @ 10MHz channels, 50mW @ 5MHz (max. 10mW/MHz)
- (2400 - 2483.5 @ 40), (20)
- # ref: 2005/513/EK
- # note: TPC not needed @ 5150-5250
- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- # note: max would be +3dB with TPC @ 5250-5725
- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5470 - 5725 @ 160), (27), DFS, wmmrule=ETSI
- # "Short Range Devices (SRD)"
- # ref: 2006/771/EK, (EU) 2017/1483, MSZ EN 300 440, MSZ EN 302 064
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
(5725 - 5875 @ 80), (25 mW)
- # 60 GHz band channels 1-4, "Fixed outdoor installation not allowed"
- # ref: 2006/771/EK, (EU) 2017/1483, MSZ EN 302 567
- (57000 - 66000 @ 2160), (40), NO-OUTDOOR
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
+ (57000 - 66000 @ 2160), (40)
country ID: DFS-JP
# ref: http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf
(2402 - 2482 @ 20), (20)
(5735 - 5815 @ 20), (23)
+# IE as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# IE: https://www.comreg.ie/publication-download/interface-requirements-for-radio-services-in-ireland
+# IE: https://www.comreg.ie/publication-download/permitted-short-range-devices-ireland
country IE: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country IL: DFS-ETSI
@@ -626,20 +725,33 @@ country IR: DFS-JP
(2402 - 2482 @ 40), (20)
(5735 - 5835 @ 80), (30)
+# IS as part of CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# IS: https://www.pfs.is/library/Skrar/Tidnir-og-taekni/MHZ_21022019.pdf
country IS: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
+# IT as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
country IT: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country JM: DFS-FCC
@@ -741,16 +853,22 @@ country LC: DFS-ETSI
(5490 - 5710 @ 160), (30), DFS
(5735 - 5815 @ 80), (30)
-# Source:
-# https://www.ofcomnet.ch/#/fatTable
-# Note that the maximum transmitter power can be doubled for 5250-5710MHz if
-# transmitter power control is in use: 5250-5330@23db, 5490-5710@30db
+# LI as part of CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# LI: https://www.ofcomnet.ch/api/rir/1010/05
+# LI: https://www.ofcomnet.ch/api/rir/1010/04
+# LI: https://www.ofcomnet.ch/api/rir/1008/12
+# LI: https://www.ofcomnet.ch/#/fatTable
country LI: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country LK: DFS-FCC
@@ -768,28 +886,50 @@ country LS: DFS-ETSI
(5250 - 5330 @ 80), (20), DFS, AUTO-BW
(5490 - 5710 @ 160), (27), DFS
+# LT as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# LT: https://www.rrt.lt/en/radio-spectrum/frequency-management/ or direct link:
+# LT: https://www.e-tar.lt/portal/lt/legalAct/6e718fd037a011e69101aaab2992cbcd/dGRioCBBHb
country LT: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
+# LU as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# LU: https://assets.ilr.lu/frequences/Documents/ILRLU-1723895916-183.pdf#search=en%20300%20440
country LU: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
+# LV as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# LV: http://likumi.lv/doc.php?id=198903
country LV: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country MA: DFS-ETSI
@@ -875,12 +1015,19 @@ country MR: DFS-ETSI
(5250 - 5330 @ 80), (20), DFS, AUTO-BW
(5490 - 5710 @ 160), (27), DFS
+# MT as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# MT: https://www.mca.org.mt/sites/default/files/NFP_edition%206-1.pdf
country MT: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country MU: DFS-FCC
@@ -930,34 +1077,36 @@ country NI: DFS-FCC
(5490 - 5730 @ 160), (24), DFS
(5735 - 5835 @ 80), (30)
-# Regulation on the use of frequency space without a license and
-# without notification 2015
-#
-# http://wetten.overheid.nl/BWBR0036378/2015-03-05
-
+# NL as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# NL: http://wetten.overheid.nl/BWBR0036378/2015-03-05
country NL: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
# short range devices (ETSI EN 300 440-1)
(5725 - 5875 @ 80), (25 mW)
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
-# Data from http://www.lovdata.no/dokument/SF/forskrift/2012-01-19-77
-# Power at 5250 - 5350 MHz, 5470 - 5725 MHz and 5815 5850 MHz can
-# be doubled if TPC is implemented.
-# Up to 2W (or 4W with TPC) is allowed in the 5725 5795 MHz band
-# which has been merged with 5470 - 5725 MHz to allow wide channels
+# NO as part of CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# NO: https://eng.nkom.no/technical/temporary-licenses/mobile-videolink/wireless-cameras-mobile-video-links/_attachment/9947
+# NO: http://www.lovdata.no/dokument/SF/forskrift/2012-01-19-77
+# In addition to EU NO can use 57255795 MHz and 58155850 bands with limit of 4 W EIRP (with DFS and TPC)
country NO: DFS-ETSI
(2400 - 2483.5 @ 40), (100 mW)
- (5150 - 5250 @ 80), (200 mW), AUTO-BW, wmmrule=ETSI
- (5250 - 5350 @ 80), (100 mW), DFS, AUTO-BW, wmmrule=ETSI
- (5470 - 5795 @ 160), (500 mW), DFS, wmmrule=ETSI
- (5815 - 5850 @ 35), (2000 mW), DFS
- (17100 - 17300 @ 200), (100 mW)
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country NP: DFS-JP
@@ -1020,12 +1169,18 @@ country PK: DFS-JP
(2402 - 2482 @ 40), (20)
(5735 - 5835 @ 80), (30)
+# PL as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
country PL: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country PM: DFS-ETSI
@@ -1041,14 +1196,19 @@ country PR: DFS-FCC
(5490 - 5730 @ 160), (24), DFS
(5735 - 5835 @ 80), (30)
+# PT as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# PT: https://www.anacom.pt/render.jsp?categoryId=336334
country PT: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
# short range devices (ETSI EN 300 440-1)
(5725 - 5875 @ 80), (25 mW)
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
country PW: DFS-FCC
@@ -1079,15 +1239,21 @@ country RE: DFS-ETSI
(5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
(5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
+# RO as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# RO: http://www.ancom.org.ro/en/uploads/links_files/ordin_262_2006.pdf
country RO: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
-
# Source:
# http://www.ratel.rs/upload/documents/Plan_namene/Plan_namene-sl_glasnik.pdf
country RS: DFS-ETSI
@@ -1119,18 +1285,20 @@ country SA: DFS-ETSI
(5250 - 5330 @ 80), (20), DFS, AUTO-BW
(5490 - 5710 @ 160), (27), DFS
-# Source:
-# https://pts.se/globalassets/startpage/dokument/legala-dokument/foreskrifter/radio/beslutade_ptsfs-2018-3-undantagsforeskrifter.pdf
+# SE as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# SE: https://pts.se/globalassets/startpage/dokument/legala-dokument/foreskrifter/radio/beslutade_ptsfs-2018-3-undantagsforeskrifter.pdf
country SE: DFS-ETSI
- (2400 - 2483.5 @ 40), (20)
- (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
- # note: max would be +3dB with TPC @ 5250-5725
- (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
- (5470 - 5725 @ 160), (27), DFS, wmmrule=ETSI
- # short range devices (ETSI EN 300 440)
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
(5725 - 5875 @ 80), (25 mW)
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
- (57000 - 66000 @ 2160), (40), NO-OUTDOOR
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
+ (57000 - 66000 @ 2160), (40)
# Source
# https://www.imda.gov.sg/~/media/imda/files/regulation%20licensing%20and%20consultations/ict%20standards/telecommunication%20standards/radio-comms/imdatssrd.pdf?la=en
@@ -1144,20 +1312,36 @@ country SG: DFS-FCC
# (5470 - 5725 @ 160), (30), DFS
(5725 - 5850 @ 80), (30)
+# SI as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# SI: https://www.akos-rs.si/bwa
country SI: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
+# SK as part of EU/CEPT accepted decisions 2005/513/EC (5GHz RLAN, EN 301 893)
+# and 2006/771/EC (amended by 2008/432/EC, Short-Range Devices, EN 300 440)
+# EU decision 2005/513/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02005D0513-20070213
+# EU decision 2006/771/EC: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02008D0432-20080611
+# SK: https://www.teleoff.gov.sk/data/files/25911.pdf
+# SK: https://www.teleoff.gov.sk/data/files/41072.pdf
+# SK: https://www.teleoff.gov.sk/data/files/49125_vpr-01_2018-rusi-vpr-10_2014a21_2012-nespecifik-srd_021018.pdf
country SK: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW, wmmrule=ETSI
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW, wmmrule=ETSI
- (5490 - 5710 @ 160), (27), DFS, wmmrule=ETSI
- # 60 GHz band channels 1-4, ref: Etsi En 302 567
+ (2400 - 2483.5 @ 40), (100 mW)
+ (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW, wmmrule=ETSI
+ (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW, wmmrule=ETSI
+ (5470 - 5725 @ 160), (500 mW), DFS, wmmrule=ETSI
+ # short range devices (ETSI EN 300 440-1)
+ (5725 - 5875 @ 80), (25 mW)
+ # 60 GHz band channels 1-4 (ETSI EN 302 567)
(57000 - 66000 @ 2160), (40)
# Source:

@ -0,0 +1,44 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dmitry Tunin <hanipouspilot@gmail.com>
Date: Sat, 24 Aug 2019 11:48:10 +0300
Subject: [PATCH] wireless-regdb: Update regulatory rules for Russia (RU)
Russian entry is incorrect. According to the last regulations
document of Feb 29, 2016, 160 MHz channels and 802.11ad are allowed.
http://rfs-rf.ru/upload/medialibrary/c1a/prilozhenie-1-k-resheniyu-gkrch-_-16_36_03.pdf
Note that there was never a DFS requirement in Russia, but always was
NO-OUTDOOR on 5GHz.
Maximum power is 200mW that is ~23dBm on all 5GHz channels.
Also Russia has never been regulated by ETSI.
EIRP has been reduced by 4dBm because of TPC requirement.
Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
diff --git a/db.txt b/db.txt
index f6b2f921416c..9c4b447536e4 100644
--- a/db.txt
+++ b/db.txt
@@ -1349,14 +1349,12 @@ country RS: DFS-ETSI
# 60 GHz band channels 1-4, ref: Etsi En 302 567
(57000 - 66000 @ 2160), (40)
-country RU: DFS-ETSI
- (2402 - 2482 @ 40), (20)
- (5170 - 5250 @ 80), (20), AUTO-BW
- (5250 - 5330 @ 80), (20), DFS, AUTO-BW
- (5650 - 5730 @ 80), (30), DFS
- (5735 - 5835 @ 80), (30)
+country RU:
+ (2400 - 2483.5 @ 40), (20)
+ (5150 - 5350 @ 160), (20), NO-OUTDOOR
+ (5650 - 5850 @ 160), (20), NO-OUTDOOR
# 60 GHz band channels 1-4, ref: Changes to NLA 124_Order №129_22042015.pdf
- (57000 - 66000 @ 2160), (40)
+ (57000 - 66000 @ 2160), (40), NO-OUTDOOR
country RW: DFS-FCC
(2402 - 2482 @ 40), (20)

@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2019-05-08
PKG_SOURCE_VERSION:=f98b6dc4d27ea2d79a1577285d1d5cb0641b3eb4
PKG_MIRROR_HASH:=ca2f0e9da25fc7140d26ddeeb8e929e172755aa0e41e4e92e5b87bb972b8ed41
PKG_SOURCE_DATE:=2019-09-09
PKG_SOURCE_VERSION:=5e8cd86f90dac966d12df6ece84ac41458d0e95f
PKG_MIRROR_HASH:=dc1097f3a7b4b7e346918f206746d00a0b7df07ae3be9b89be55dfaef3cbbe45
# Build the 4.19 ath10k-ct driver version. Other options are "-4.16", or
# leave un-defined for 4.7 kernel. Probably this should match as closely as
@ -35,6 +35,7 @@ define KernelPackage/ath10k-ct
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
AUTOLOAD:=$(call AutoProbe,ath10k_pci)
PROVIDES:=kmod-ath10k
VARIANT:=regular
endef
define KernelPackage/ath10k-ct/config
@ -42,7 +43,13 @@ define KernelPackage/ath10k-ct/config
config ATH10K-CT_LEDS
bool "Enable LED support"
default y
depends on PACKAGE_kmod-ath10k-ct
depends on PACKAGE_kmod-ath10k-ct || PACKAGE_kmod-ath10k-ct-smallbuffers
endef
define KernelPackage/ath10k-ct-smallbuffers
$(call KernelPackage/ath10k-ct)
TITLE+= (small buffers for low-RAM devices)
VARIANT:=smallbuffers
endef
NOSTDINC_FLAGS = \
@ -90,6 +97,10 @@ ifeq ($(CONFIG_ATH10K-CT_LEDS),y)
NOSTDINC_FLAGS += -DCONFIG_ATH10K_LEDS
endif
ifeq ($(BUILD_VARIANT),smallbuffers)
NOSTDINC_FLAGS += -DCONFIG_ATH10K_SMALLBUFFERS
endif
define Build/Configure
cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
endef
@ -107,3 +118,4 @@ define Build/Compile
endef
$(eval $(call KernelPackage,ath10k-ct))
$(eval $(call KernelPackage,ath10k-ct-smallbuffers))

@ -1,113 +0,0 @@
From d06f26c5c8a41f246a9c40862a77a55725cedbd3 Mon Sep 17 00:00:00 2001
From: Sven Eckelmann <sven.eckelmann@openmesh.com>
Date: Fri, 8 Dec 2017 11:37:42 +0100
Subject: ath10k: search DT for qcom,ath10k-calibration-variant
Board Data File (BDF) is loaded upon driver boot-up procedure. The right
board data file is identified on QCA4019 using bus, bmi-chip-id and
bmi-board-id.
The problem, however, can occur when the (default) board data file cannot
fulfill with the vendor requirements and it is necessary to use a different
board data file.
This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
Something similar has to be provided for systems without SMBIOS but with
device trees. No solution was specified by QCA and therefore a new one has
to be found for ath10k.
The device tree requires addition strings to define the variant name
wifi@a000000 {
status = "okay";
qcom,ath10k-calibration-variant = "RT-AC58U";
};
wifi@a800000 {
status = "okay";
qcom,ath10k-calibration-variant = "RT-AC58U";
};
This would create the boarddata identifiers for the board-2.bin search
* bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
* bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Origin: upstream, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d06f26c5c8a41f246a9c40862a77a55725cedbd3
---
ath10k-4.13/core.c | 40 ++++++++++++++++++++++++++++------
1 file changed, 33 insertions(+), 7 deletions(-)
--- a/ath10k-4.13/core.c
+++ b/ath10k-4.13/core.c
@@ -893,6 +893,28 @@ static int ath10k_core_check_smbios(stru
return 0;
}
+static int ath10k_core_check_dt(struct ath10k *ar)
+{
+ struct device_node *node;
+ const char *variant = NULL;
+
+ node = ar->dev->of_node;
+ if (!node)
+ return -ENOENT;
+
+ of_property_read_string(node, "qcom,ath10k-calibration-variant",
+ &variant);
+ if (!variant)
+ return -ENODATA;
+
+ if (strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext)) < 0)
+ ath10k_dbg(ar, ATH10K_DBG_BOOT,
+ "bdf variant string is longer than the buffer can accommodate (variant: %s)\n",
+ variant);
+
+ return 0;
+}
+
static int ath10k_download_and_run_otp(struct ath10k *ar)
{
u32 result, address = ar->hw_params.patch_load_addr;
@@ -1532,19 +1554,19 @@ static int ath10k_core_create_board_name
/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
+ if (ar->id.bdf_ext[0] != '\0')
+ scnprintf(variant, sizeof(variant), ",variant=%s",
+ ar->id.bdf_ext);
+
if (ar->id.bmi_ids_valid) {
scnprintf(name, name_len,
- "bus=%s,bmi-chip-id=%d,bmi-board-id=%d",
+ "bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s",
ath10k_bus_str(ar->hif.bus),
ar->id.bmi_chip_id,
- ar->id.bmi_board_id);
+ ar->id.bmi_board_id, variant);
goto out;
}
- if (ar->id.bdf_ext[0] != '\0')
- scnprintf(variant, sizeof(variant), ",variant=%s",
- ar->id.bdf_ext);
-
scnprintf(name, name_len,
"bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
ath10k_bus_str(ar->hif.bus),
@@ -3014,7 +3036,11 @@ static int ath10k_core_probe_fw(struct a
ret = ath10k_core_check_smbios(ar);
if (ret)
- ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n");
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n");
+
+ ret = ath10k_core_check_dt(ar);
+ if (ret)
+ ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n");
ret = ath10k_core_fetch_board_file(ar);
if (ret) {

@ -1,119 +0,0 @@
--- a/ath10k/debug.c
+++ b/ath10k/debug.c
@@ -166,11 +166,11 @@ void ath10k_debug_print_hwfw_info(struct
ar->id.subsystem_vendor, ar->id.subsystem_device);
ath10k_info(ar, "kconfig debug %d debugfs %d tracing %d dfs %d testmode %d\n",
- config_enabled(CONFIG_ATH10K_DEBUG),
- config_enabled(CONFIG_ATH10K_DEBUGFS),
- config_enabled(CONFIG_ATH10K_TRACING),
- config_enabled(CONFIG_ATH10K_DFS_CERTIFIED),
- config_enabled(CONFIG_NL80211_TESTMODE));
+ IS_ENABLED(CONFIG_ATH10K_DEBUG),
+ IS_ENABLED(CONFIG_ATH10K_DEBUGFS),
+ IS_ENABLED(CONFIG_ATH10K_TRACING),
+ IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED),
+ IS_ENABLED(CONFIG_NL80211_TESTMODE));
firmware = ar->normal_mode_fw.fw_file.firmware;
if (firmware)
@@ -3422,7 +3422,7 @@ int ath10k_debug_register(struct ath10k
debugfs_create_file("nf_cal_period", S_IRUSR | S_IWUSR,
ar->debug.debugfs_phy, ar, &fops_nf_cal_period);
- if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) {
+ if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) {
debugfs_create_file("dfs_simulate_radar", S_IWUSR,
ar->debug.debugfs_phy, ar,
&fops_simulate_radar);
--- a/ath10k/mac.c
+++ b/ath10k/mac.c
@@ -3604,7 +3604,7 @@ static void ath10k_regd_update(struct at
regpair = ar->ath_common.regulatory.regpair;
- if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
+ if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
nl_dfs_reg = ar->dfs_detector->region;
wmi_dfs_reg = ath10k_mac_get_dfs_region(nl_dfs_reg);
ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
@@ -3638,7 +3638,7 @@ static void ath10k_reg_notifier(struct w
ath_reg_notifier_apply(wiphy, request, &ar->ath_common.regulatory);
- if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
+ if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "reg-notifier: dfs region 0x%x\n",
request->dfs_region);
result = ar->dfs_detector->set_dfs_domain(ar->dfs_detector,
@@ -8939,7 +8939,7 @@ int ath10k_mac_register(struct ath10k *a
if (!test_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags))
ar->hw->netdev_features = NETIF_F_HW_CSUM;
- if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED)) {
+ if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED)) {
/* Init ath dfs pattern detector */
ar->ath_common.debug_mask = ATH_DBG_DFS;
ar->dfs_detector = dfs_pattern_detector_init(&ar->ath_common,
@@ -8984,7 +8984,7 @@ err_unregister:
ieee80211_unregister_hw(ar->hw);
err_dfs_detector_exit:
- if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
+ if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
ar->dfs_detector->exit(ar->dfs_detector);
err_free:
@@ -8999,7 +8999,7 @@ void ath10k_mac_unregister(struct ath10k
{
ieee80211_unregister_hw(ar->hw);
- if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
+ if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)
ar->dfs_detector->exit(ar->dfs_detector);
kfree(ar->mac.sbands[NL80211_BAND_2GHZ].channels);
--- a/ath10k/thermal.c
+++ b/ath10k/thermal.c
@@ -192,7 +192,7 @@ int ath10k_thermal_register(struct ath10
/* Avoid linking error on devm_hwmon_device_register_with_groups, I
* guess linux/hwmon.h is missing proper stubs. */
- if (!config_enabled(CONFIG_HWMON))
+ if (!IS_ENABLED(CONFIG_HWMON))
return 0;
hwmon_dev = devm_hwmon_device_register_with_groups(ar->dev,
--- a/ath10k/wmi.c
+++ b/ath10k/wmi.c
@@ -3903,7 +3903,7 @@ void ath10k_wmi_event_dfs(struct ath10k
phyerr->tsf_timestamp, tsf, buf_len);
/* Skip event if DFS disabled */
- if (!config_enabled(CONFIG_ATH10K_DFS_CERTIFIED))
+ if (!IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED))
return;
ATH10K_DFS_STAT_INC(ar, pulses_total);
--- a/ath10k-4.13/wmi.c
+++ b/ath10k-4.13/wmi.c
@@ -4033,7 +4033,7 @@ static void ath10k_dfs_radar_report(stru
ATH10K_DFS_STAT_INC(ar, pulses_detected);
- if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) {
+ if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) {
ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
"dfs no pulse pattern detected, yet\n");
return;
--- a/ath10k-4.16/wmi.c
+++ b/ath10k-4.16/wmi.c
@@ -4117,7 +4117,7 @@ static void ath10k_dfs_radar_report(stru
ATH10K_DFS_STAT_INC(ar, pulses_detected);
- if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) {
+ if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) {
ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
"dfs no pulse pattern detected, yet\n");
return;

@ -1,11 +0,0 @@
--- a/ath10k/htt_rx.c
+++ b/ath10k/htt_rx.c
@@ -2514,7 +2514,7 @@ bool ath10k_htt_t2h_msg_handler(struct a
u32 freq = __le32_to_cpu(resp->chan_change.freq);
ar->tgt_oper_chan =
- __ieee80211_get_channel(ar->hw->wiphy, freq);
+ ieee80211_get_channel(ar->hw->wiphy, freq);
ath10k_dbg(ar, ATH10K_DBG_HTT,
"htt chan change freq %u phymode %s\n",
freq, ath10k_wmi_phymode_str(phymode));

@ -1,104 +0,0 @@
--- a/ath10k/htt_rx.c
+++ b/ath10k/htt_rx.c
@@ -642,11 +642,11 @@ static void ath10k_htt_rx_h_rates(struct
sgi = (info3 >> 7) & 1;
status->rate_idx = mcs;
- status->flag |= RX_FLAG_HT;
+ status->encoding = RX_ENC_HT;
if (sgi)
- status->flag |= RX_FLAG_SHORT_GI;
+ status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
if (bw)
- status->flag |= RX_FLAG_40MHZ;
+ status->bw = RATE_INFO_BW_40;
break;
case HTT_RX_VHT:
case HTT_RX_VHT_WITH_TXBF:
@@ -698,10 +698,10 @@ static void ath10k_htt_rx_h_rates(struct
}
status->rate_idx = mcs;
- status->vht_nss = nss;
+ status->nss = nss;
if (sgi)
- status->flag |= RX_FLAG_SHORT_GI;
+ status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
switch (bw) {
/* 20MHZ */
@@ -709,18 +709,18 @@ static void ath10k_htt_rx_h_rates(struct
break;
/* 40MHZ */
case 1:
- status->flag |= RX_FLAG_40MHZ;
+ status->bw = RATE_INFO_BW_40;
break;
/* 80MHZ */
case 2:
- status->vht_flag |= RX_VHT_FLAG_80MHZ;
+ status->bw = RATE_INFO_BW_80;
break;
case 3:
- status->vht_flag |= RX_VHT_FLAG_160MHZ;
+ status->bw = RATE_INFO_BW_160;
break;
}
- status->flag |= RX_FLAG_VHT;
+ status->encoding = RX_ENC_VHT;
break;
default:
break;
@@ -900,13 +900,10 @@ static void ath10k_htt_rx_h_ppdu(struct
/* New PPDU starts so clear out the old per-PPDU status. */
status->freq = 0;
status->rate_idx = 0;
- status->vht_nss = 0;
- status->vht_flag &= ~RX_VHT_FLAG_80MHZ;
- status->flag &= ~(RX_FLAG_HT |
- RX_FLAG_VHT |
- RX_FLAG_SHORT_GI |
- RX_FLAG_40MHZ |
- RX_FLAG_MACTIME_END);
+ status->nss = 0;
+ status->encoding = RX_ENC_LEGACY;
+ status->bw = RATE_INFO_BW_20;
+ status->flag &= ~RX_FLAG_MACTIME_END;
status->flag |= RX_FLAG_NO_SIGNAL_VAL;
ath10k_htt_rx_h_signal(ar, status, rxd);
@@ -959,7 +956,7 @@ static void ath10k_process_rx(struct ath
*status = *rx_status;
ath10k_dbg(ar, ATH10K_DBG_DATA,
- "rx skb %p len %u peer %pM %s %s sn %u %s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%llx fcs-err %i mic-err %i amsdu-more %i\n",
+ "rx skb %p len %u peer %pM %s %s sn %u %s%s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n",
skb,
skb->len,
ieee80211_get_SA(hdr),
@@ -967,15 +964,15 @@ static void ath10k_process_rx(struct ath
is_multicast_ether_addr(ieee80211_get_DA(hdr)) ?
"mcast" : "ucast",
(__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4,
- status->flag == 0 ? "legacy" : "",
- status->flag & RX_FLAG_HT ? "ht" : "",
- status->flag & RX_FLAG_VHT ? "vht" : "",
- status->flag & RX_FLAG_40MHZ ? "40" : "",
- status->vht_flag & RX_VHT_FLAG_80MHZ ? "80" : "",
- status->vht_flag & RX_VHT_FLAG_160MHZ ? "160" : "",
- status->flag & RX_FLAG_SHORT_GI ? "sgi " : "",
+ (status->encoding == RX_ENC_LEGACY) ? "legacy" : "",
+ (status->encoding == RX_ENC_HT) ? "ht" : "",
+ (status->encoding == RX_ENC_VHT) ? "vht" : "",
+ (status->bw == RATE_INFO_BW_40) ? "40" : "",
+ (status->bw == RATE_INFO_BW_80) ? "80" : "",
+ (status->bw == RATE_INFO_BW_160) ? "160" : "",
+ status->enc_flags & RX_ENC_FLAG_SHORT_GI ? "sgi " : "",
status->rate_idx,
- status->vht_nss,
+ status->nss,
status->freq,
status->band, status->flag,
!!(status->flag & RX_FLAG_FAILED_FCS_CRC),

@ -1,448 +0,0 @@
From: Thomas Hebb <tommyhebb@gmail.com>
Date: Fri, 13 Apr 2018 17:40:26 +0300
Subject: [PATCH] ath10k: search all IEs for variant before falling back
commit f2593cb1b291 ("ath10k: Search SMBIOS for OEM board file
extension") added a feature to ath10k that allows Board Data File
(BDF) conflicts between multiple devices that use the same device IDs
but have different calibration requirements to be resolved by allowing
a "variant" string to be stored in SMBIOS [and later device tree, added
by commit d06f26c5c8a4 ("ath10k: search DT for qcom,ath10k-calibration-
variant")] that gets appended to the ID stored in board-2.bin.
This original patch had a regression, however. Namely that devices with
a variant present in SMBIOS that didn't need custom BDFs could no longer
find the default BDF, which has no variant appended. The patch was
reverted and re-applied with a fix for this issue in commit 1657b8f84ed9
("search SMBIOS for OEM board file extension").
But the fix to fall back to a default BDF introduced another issue: the
driver currently parses IEs in board-2.bin one by one, and for each one
it first checks to see if it matches the ID with the variant appended.
If it doesn't, it checks to see if it matches the "fallback" ID with no
variant. If a matching BDF is found at any point during this search, the
search is terminated and that BDF is used. The issue is that it's very
possible (and is currently the case for board-2.bin files present in the
ath10k-firmware repository) for the default BDF to occur in an earlier
IE than the variant-specific BDF. In this case, the current code will
happily choose the default BDF even though a better-matching BDF is
present later in the file.
This patch fixes the issue by first searching the entire file for the ID
with variant, and searching for the fallback ID only if that search
fails. It also includes some code cleanup in the area, as
ath10k_core_fetch_board_data_api_n() no longer does its own string
mangling to remove the variant from an ID, instead leaving that job to a
new flag passed to ath10k_core_create_board_name().
I've tested this patch on a QCA4019 and verified that the driver behaves
correctly for 1) both fallback and variant BDFs present, 2) only fallback
BDF present, and 3) no matching BDFs present.
Fixes: 1657b8f84ed9 ("ath10k: search SMBIOS for OEM board file extension")
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c8489668065a283d3027e86e877b103a87f99d22
---
ath10k-4.13/core.c | 134 ++++++++++++++++++---------------
1 file changed, 72 insertions(+), 62 deletions(-)
--- a/ath10k-4.13/core.c
+++ b/ath10k-4.13/core.c
@@ -1429,14 +1429,61 @@ out:
return ret;
}
+static int ath10k_core_search_bd(struct ath10k *ar,
+ const char *boardname,
+ const u8 *data,
+ size_t len)
+{
+ size_t ie_len;
+ struct ath10k_fw_ie *hdr;
+ int ret = -ENOENT, ie_id;
+
+ while (len > sizeof(struct ath10k_fw_ie)) {
+ hdr = (struct ath10k_fw_ie *)data;
+ ie_id = le32_to_cpu(hdr->id);
+ ie_len = le32_to_cpu(hdr->len);
+
+ len -= sizeof(*hdr);
+ data = hdr->data;
+
+ if (len < ALIGN(ie_len, 4)) {
+ ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
+ ie_id, ie_len, len);
+ return -EINVAL;
+ }
+
+ switch (ie_id) {
+ case ATH10K_BD_IE_BOARD:
+ ret = ath10k_core_parse_bd_ie_board(ar, data, ie_len,
+ boardname);
+ if (ret == -ENOENT)
+ /* no match found, continue */
+ break;
+
+ /* either found or error, so stop searching */
+ goto out;
+ }
+
+ /* jump over the padding */
+ ie_len = ALIGN(ie_len, 4);
+
+ len -= ie_len;
+ data += ie_len;
+ }
+
+out:
+ /* return result of parse_bd_ie_board() or -ENOENT */
+ return ret;
+}
+
static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
const char *boardname,
+ const char *fallback_boardname,
const char *filename)
{
- size_t len, magic_len, ie_len;
- struct ath10k_fw_ie *hdr;
+ size_t len, magic_len;
const u8 *data;
- int ret, ie_id;
+ int ret;
ar->normal_mode_fw.board = ath10k_fetch_fw_file(ar,
ar->hw_params.fw.dir,
@@ -1474,73 +1521,28 @@ static int ath10k_core_fetch_board_data_
data += magic_len;
len -= magic_len;
- while (len > sizeof(struct ath10k_fw_ie)) {
- hdr = (struct ath10k_fw_ie *)data;
- ie_id = le32_to_cpu(hdr->id);
- ie_len = le32_to_cpu(hdr->len);
-
- len -= sizeof(*hdr);
- data = hdr->data;
-
- if (len < ALIGN(ie_len, 4)) {
- ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
- ie_id, ie_len, len);
- ret = -EINVAL;
- goto err;
- }
-
- switch (ie_id) {
- case ATH10K_BD_IE_BOARD:
- ret = ath10k_core_parse_bd_ie_board(ar, data, ie_len,
- boardname);
- if (ret == -ENOENT && ar->id.bdf_ext[0] != '\0') {
- /* try default bdf if variant was not found */
- char *s, *v = ",variant=";
- char boardname2[100];
-
- strlcpy(boardname2, boardname,
- sizeof(boardname2));
-
- s = strstr(boardname2, v);
- if (s)
- *s = '\0'; /* strip ",variant=%s" */
-
- ret = ath10k_core_parse_bd_ie_board(ar, data,
- ie_len,
- boardname2);
- }
-
- if (ret == -ENOENT)
- /* no match found, continue */
- break;
- else if (ret)
- /* there was an error, bail out */
- goto err;
-
- /* board data found */
- goto out;
- }
+ /* attempt to find boardname in the IE list */
+ ret = ath10k_core_search_bd(ar, boardname, data, len);
- /* jump over the padding */
- ie_len = ALIGN(ie_len, 4);
-
- len -= ie_len;
- data += ie_len;
- }
+ /* if we didn't find it and have a fallback name, try that */
+ if (ret == -ENOENT && fallback_boardname)
+ ret = ath10k_core_search_bd(ar, fallback_boardname, data, len);
out:
- if (!ar->normal_mode_fw.board_data || !ar->normal_mode_fw.board_len) {
+ if (ret == -ENOENT) {
ath10k_err(ar,
"failed to fetch board data for %s from %s/%s\n",
boardname, ar->hw_params.fw.dir, filename);
ret = -ENODATA;
- goto err;
}
/* Save firmware board name so we can display it later. */
strlcpy(ar->normal_mode_fw.fw_file.fw_board_name, filename,
sizeof(ar->normal_mode_fw.fw_file.fw_board_name));
+ if (ret)
+ goto err;
+
return 0;
err:
@@ -1549,12 +1551,12 @@ err:
}
static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
- size_t name_len)
+ size_t name_len, bool with_variant)
{
/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
- if (ar->id.bdf_ext[0] != '\0')
+ if (with_variant && ar->id.bdf_ext[0] != '\0')
scnprintf(variant, sizeof(variant), ",variant=%s",
ar->id.bdf_ext);
@@ -1580,21 +1582,31 @@ out:
static int ath10k_core_fetch_board_file(struct ath10k *ar)
{
- char boardname[100];
+ char boardname[100], fallback_boardname[100];
int ret;
- ret = ath10k_core_create_board_name(ar, boardname, sizeof(boardname));
+ ret = ath10k_core_create_board_name(ar, boardname,
+ sizeof(boardname), true);
if (ret) {
ath10k_err(ar, "failed to create board name: %d", ret);
return ret;
}
+ ret = ath10k_core_create_board_name(ar, fallback_boardname,
+ sizeof(boardname), false);
+ if (ret) {
+ ath10k_err(ar, "failed to create fallback board name: %d", ret);
+ return ret;
+ }
+
ar->bd_api = 2;
if (ar->fwcfg.bname[0])
ret = ath10k_core_fetch_board_data_api_n(ar, boardname,
+ fallback_boardname,
ar->fwcfg.bname);
else
ret = ath10k_core_fetch_board_data_api_n(ar, boardname,
+ fallback_boardname,
ATH10K_BOARD_API2_FILE);
if (!ret)
goto success;
--- a/ath10k-4.16/core.c
+++ b/ath10k-4.16/core.c
@@ -1563,14 +1563,61 @@ out:
return ret;
}
+static int ath10k_core_search_bd(struct ath10k *ar,
+ const char *boardname,
+ const u8 *data,
+ size_t len)
+{
+ size_t ie_len;
+ struct ath10k_fw_ie *hdr;
+ int ret = -ENOENT, ie_id;
+
+ while (len > sizeof(struct ath10k_fw_ie)) {
+ hdr = (struct ath10k_fw_ie *)data;
+ ie_id = le32_to_cpu(hdr->id);
+ ie_len = le32_to_cpu(hdr->len);
+
+ len -= sizeof(*hdr);
+ data = hdr->data;
+
+ if (len < ALIGN(ie_len, 4)) {
+ ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
+ ie_id, ie_len, len);
+ return -EINVAL;
+ }
+
+ switch (ie_id) {
+ case ATH10K_BD_IE_BOARD:
+ ret = ath10k_core_parse_bd_ie_board(ar, data, ie_len,
+ boardname);
+ if (ret == -ENOENT)
+ /* no match found, continue */
+ break;
+
+ /* either found or error, so stop searching */
+ goto out;
+ }
+
+ /* jump over the padding */
+ ie_len = ALIGN(ie_len, 4);
+
+ len -= ie_len;
+ data += ie_len;
+ }
+
+out:
+ /* return result of parse_bd_ie_board() or -ENOENT */
+ return ret;
+}
+
static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
const char *boardname,
+ const char *fallback_boardname,
const char *filename)
{
- size_t len, magic_len, ie_len;
- struct ath10k_fw_ie *hdr;
+ size_t len, magic_len;
const u8 *data;
- int ret, ie_id;
+ int ret;
ar->normal_mode_fw.board = ath10k_fetch_fw_file(ar,
ar->hw_params.fw.dir,
@@ -1608,73 +1655,28 @@ static int ath10k_core_fetch_board_data_
data += magic_len;
len -= magic_len;
- while (len > sizeof(struct ath10k_fw_ie)) {
- hdr = (struct ath10k_fw_ie *)data;
- ie_id = le32_to_cpu(hdr->id);
- ie_len = le32_to_cpu(hdr->len);
-
- len -= sizeof(*hdr);
- data = hdr->data;
-
- if (len < ALIGN(ie_len, 4)) {
- ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
- ie_id, ie_len, len);
- ret = -EINVAL;
- goto err;
- }
-
- switch (ie_id) {
- case ATH10K_BD_IE_BOARD:
- ret = ath10k_core_parse_bd_ie_board(ar, data, ie_len,
- boardname);
- if (ret == -ENOENT && ar->id.bdf_ext[0] != '\0') {
- /* try default bdf if variant was not found */
- char *s, *v = ",variant=";
- char boardname2[100];
-
- strlcpy(boardname2, boardname,
- sizeof(boardname2));
-
- s = strstr(boardname2, v);
- if (s)
- *s = '\0'; /* strip ",variant=%s" */
-
- ret = ath10k_core_parse_bd_ie_board(ar, data,
- ie_len,
- boardname2);
- }
-
- if (ret == -ENOENT)
- /* no match found, continue */
- break;
- else if (ret)
- /* there was an error, bail out */
- goto err;
-
- /* board data found */
- goto out;
- }
+ /* attempt to find boardname in the IE list */
+ ret = ath10k_core_search_bd(ar, boardname, data, len);
- /* jump over the padding */
- ie_len = ALIGN(ie_len, 4);
-
- len -= ie_len;
- data += ie_len;
- }
+ /* if we didn't find it and have a fallback name, try that */
+ if (ret == -ENOENT && fallback_boardname)
+ ret = ath10k_core_search_bd(ar, fallback_boardname, data, len);
out:
- if (!ar->normal_mode_fw.board_data || !ar->normal_mode_fw.board_len) {
+ if (ret == -ENOENT) {
ath10k_err(ar,
"failed to fetch board data for %s from %s/%s\n",
boardname, ar->hw_params.fw.dir, filename);
ret = -ENODATA;
- goto err;
}
/* Save firmware board name so we can display it later. */
strlcpy(ar->normal_mode_fw.fw_file.fw_board_name, filename,
sizeof(ar->normal_mode_fw.fw_file.fw_board_name));
+ if (ret)
+ goto err;
+
return 0;
err:
@@ -1683,12 +1685,12 @@ err:
}
static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
- size_t name_len)
+ size_t name_len, bool with_variant)
{
/* strlen(',variant=') + strlen(ar->id.bdf_ext) */
char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
- if (ar->id.bdf_ext[0] != '\0')
+ if (with_variant && ar->id.bdf_ext[0] != '\0')
scnprintf(variant, sizeof(variant), ",variant=%s",
ar->id.bdf_ext);
@@ -1714,21 +1716,31 @@ out:
static int ath10k_core_fetch_board_file(struct ath10k *ar)
{
- char boardname[100];
+ char boardname[100], fallback_boardname[100];
int ret;
- ret = ath10k_core_create_board_name(ar, boardname, sizeof(boardname));
+ ret = ath10k_core_create_board_name(ar, boardname,
+ sizeof(boardname), true);
if (ret) {
ath10k_err(ar, "failed to create board name: %d", ret);
return ret;
}
+ ret = ath10k_core_create_board_name(ar, fallback_boardname,
+ sizeof(boardname), false);
+ if (ret) {
+ ath10k_err(ar, "failed to create fallback board name: %d", ret);
+ return ret;
+ }
+
ar->bd_api = 2;
if (ar->fwcfg.bname[0])
ret = ath10k_core_fetch_board_data_api_n(ar, boardname,
+ fallback_boardname,
ar->fwcfg.bname);
else
ret = ath10k_core_fetch_board_data_api_n(ar, boardname,
+ fallback_boardname,
ATH10K_BOARD_API2_FILE);
if (!ret)
goto success;

@ -43,7 +43,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss)
{
switch ((mcs_map >> (2 * nss)) & 0x3) {
@@ -6333,9 +6349,10 @@ static void ath10k_bss_info_changed(stru
@@ -6405,9 +6421,10 @@ static void ath10k_bss_info_changed(stru
struct cfg80211_chan_def def;
u32 vdev_param, pdev_param, slottime, preamble;
u16 bitrate, hw_value;
@ -56,7 +56,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
mutex_lock(&ar->conf_mutex);
@@ -6541,6 +6558,30 @@ static void ath10k_bss_info_changed(stru
@@ -6613,6 +6630,30 @@ static void ath10k_bss_info_changed(stru
arvif->vdev_id, ret);
}

@ -26,7 +26,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
if (ath10k_rates[i].bitrate == bitrate)
return hw_value_prefix | ath10k_rates[i].hw_value;
}
@@ -6564,22 +6564,22 @@ static void ath10k_bss_info_changed(stru
@@ -6636,22 +6636,22 @@ static void ath10k_bss_info_changed(stru
return;
}

@ -17,7 +17,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -6349,8 +6349,8 @@ static void ath10k_bss_info_changed(stru
@@ -6421,8 +6421,8 @@ static void ath10k_bss_info_changed(stru
struct cfg80211_chan_def def;
u32 vdev_param, pdev_param, slottime, preamble;
u16 bitrate, hw_value;
@ -28,7 +28,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
enum nl80211_band band;
const struct ieee80211_supported_band *sband;
@@ -6523,7 +6523,11 @@ static void ath10k_bss_info_changed(stru
@@ -6595,7 +6595,11 @@ static void ath10k_bss_info_changed(stru
if (changed & BSS_CHANGED_MCAST_RATE &&
!WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) {
band = def.chan->band;

@ -11,7 +11,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -6545,6 +6545,7 @@ static void ath10k_bss_info_changed(stru
@@ -6617,6 +6617,7 @@ static void ath10k_bss_info_changed(stru
"mac vdev %d mcast_rate %x\n",
arvif->vdev_id, rate);
@ -19,7 +19,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
vdev_param = ar->wmi.vdev_param->mcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6553,6 +6554,7 @@ static void ath10k_bss_info_changed(stru
@@ -6625,6 +6626,7 @@ static void ath10k_bss_info_changed(stru
"failed to set mcast rate on vdev %i: %d\n",
arvif->vdev_id, ret);
@ -27,7 +27,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
vdev_param = ar->wmi.vdev_param->bcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6579,6 +6581,7 @@ static void ath10k_bss_info_changed(stru
@@ -6651,6 +6653,7 @@ static void ath10k_bss_info_changed(stru
return;
}

@ -1,81 +0,0 @@
From 42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61 Mon Sep 17 00:00:00 2001
Message-Id: <42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61.1515610034.git.mschiffer@universe-factory.net>
In-Reply-To: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net>
References: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net>
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Mon, 27 Nov 2017 18:56:23 +0100
Subject: [PATCH 2/2] ath10k: move spectral scan support under a separate
config symbol
At the moment, spectral scan support, and with it RELAY, is always enabled
with ATH10K_DEBUGFS. Spectral scan support is currently the only user of
RELAY in ath10k, and it unconditionally reserves a relay channel.
Having debugfs support in ath10k is often useful even on very small
embedded routers, where we'd rather like to avoid the code size and RAM
usage of the relay support. While ath10k-based devices usually have more
resources than ath9k-based ones, it makes sense to keep the configuration
symmetric to ath9k, so the same base kernel without RELAY can be used for
both ath9k and ath10k hardware.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
ath10k-4.13/Kconfig | 9 ++++++++-
ath10k-4.13/Makefile | 2 +-
ath10k-4.13/spectral.h | 4 ++--
3 files changed, 11 insertions(+), 4 deletions(-)
--- a/ath10k-4.13/Kconfig
+++ b/ath10k-4.13/Kconfig
@@ -40,12 +40,19 @@ config ATH10K_DEBUG
config ATH10K_DEBUGFS
bool "Atheros ath10k debugfs support"
depends on ATH10K && DEBUG_FS
- select RELAY
---help---
Enabled debugfs support
If unsure, say Y to make it easier to debug problems.
+config ATH10K_SPECTRAL
+ bool "Atheros ath10k spectral scan support"
+ depends on ATH10K_DEBUGFS
+ select RELAY
+ default n
+ ---help---
+ Say Y to enable access to the FFT/spectral data via debugfs.
+
config ATH10K_TRACING
bool "Atheros ath10k tracing support"
depends on ATH10K
--- a/ath10k-4.13/Makefile
+++ b/ath10k-4.13/Makefile
@@ -14,7 +14,7 @@ ath10k_core-y += mac.o \
p2p.o \
swap.o
-ath10k_core-$(CONFIG_ATH10K_DEBUGFS) += spectral.o
+ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
ath10k_core-$(CONFIG_THERMAL) += thermal.o
--- a/ath10k-4.13/spectral.h
+++ b/ath10k-4.13/spectral.h
@@ -44,7 +44,7 @@ enum ath10k_spectral_mode {
SPECTRAL_MANUAL,
};
-#ifdef CONFIG_ATH10K_DEBUGFS
+#ifdef CONFIG_ATH10K_SPECTRAL
int ath10k_spectral_process_fft(struct ath10k *ar,
struct wmi_phyerr_ev_arg *phyerr,
@@ -85,6 +85,6 @@ static inline void ath10k_spectral_destr
{
}
-#endif /* CONFIG_ATH10K_DEBUGFS */
+#endif /* CONFIG_ATH10K_SPECTRAL */
#endif /* SPECTRAL_H */

@ -82,519 +82,6 @@ v13:
12 files changed, 314 insertions(+), 1 deletion(-)
create mode 100644 ath10k-4.16/leds.c
create mode 100644 ath10k-4.16/leds.h
--- a/ath10k-4.16/Kconfig
+++ b/ath10k-4.16/Kconfig
@@ -60,6 +60,16 @@ config ATH10K_SPECTRAL
---help---
Say Y to enable access to the FFT/spectral data via debugfs.
+config ATH10K_LEDS
+ bool "Atheros ath10k LED support"
+ depends on ATH10K
+ select MAC80211_LEDS
+ select LEDS_CLASS
+ select NEW_LEDS
+ default y
+ ---help---
+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
+
config ATH10K_TRACING
bool "Atheros ath10k tracing support"
depends on ATH10K
--- a/ath10k-4.16/Makefile
+++ b/ath10k-4.16/Makefile
@@ -19,6 +19,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) +=
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
ath10k_core-$(CONFIG_THERMAL) += thermal.o
+ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o
ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
ath10k_core-$(CONFIG_PM) += wow.o
ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
--- a/ath10k-4.16/core.c
+++ b/ath10k-4.16/core.c
@@ -34,6 +34,7 @@
#include "testmode.h"
#include "wmi-ops.h"
#include "coredump.h"
+#include "leds.h"
/* Disable ath10k-ct DBGLOG output by default */
unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG;
@@ -73,6 +74,7 @@ static const struct ath10k_hw_params ath
.id = QCA988X_HW_2_0_VERSION,
.dev_id = QCA988X_2_0_DEVICE_ID,
.name = "qca988x hw2.0",
+ .led_pin = 1,
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
@@ -131,6 +133,7 @@ static const struct ath10k_hw_params ath
.id = QCA9887_HW_1_0_VERSION,
.dev_id = QCA9887_1_0_DEVICE_ID,
.name = "qca9887 hw1.0",
+ .led_pin = 1,
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
@@ -275,6 +278,7 @@ static const struct ath10k_hw_params ath
.id = QCA99X0_HW_2_0_DEV_VERSION,
.dev_id = QCA99X0_2_0_DEVICE_ID,
.name = "qca99x0 hw2.0",
+ .led_pin = 17,
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.otp_exe_param = 0x00000700,
@@ -309,6 +313,7 @@ static const struct ath10k_hw_params ath
.id = QCA9984_HW_1_0_DEV_VERSION,
.dev_id = QCA9984_1_0_DEVICE_ID,
.name = "qca9984/qca9994 hw1.0",
+ .led_pin = 17,
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
@@ -348,6 +353,7 @@ static const struct ath10k_hw_params ath
.id = QCA9888_HW_2_0_DEV_VERSION,
.dev_id = QCA9888_2_0_DEVICE_ID,
.name = "qca9888 hw2.0",
+ .led_pin = 17,
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
@@ -3084,6 +3090,10 @@ int ath10k_core_start(struct ath10k *ar,
ath10k_wmi_check_apply_board_power_ctl_table(ar);
}
+ status = ath10k_leds_start(ar);
+ if (status)
+ goto err_hif_stop;
+
return 0;
err_hif_stop:
@@ -3330,9 +3340,18 @@ static void ath10k_core_register_work(st
goto err_spectral_destroy;
}
+ status = ath10k_leds_register(ar);
+ if (status) {
+ ath10k_err(ar, "could not register leds: %d\n",
+ status);
+ goto err_thermal_unregister;
+ }
+
set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags);
return;
+err_thermal_unregister:
+ ath10k_thermal_unregister(ar);
err_spectral_destroy:
ath10k_spectral_destroy(ar);
err_debug_destroy:
@@ -3390,6 +3409,8 @@ void ath10k_core_unregister(struct ath10
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
+ ath10k_leds_unregister(ar);
+
ath10k_thermal_unregister(ar);
/* Stop spectral before unregistering from mac80211 to remove the
* relayfs debugfs file cleanly. Otherwise the parent debugfs tree
--- a/ath10k-4.16/core.h
+++ b/ath10k-4.16/core.h
@@ -24,6 +24,7 @@
#include <linux/pci.h>
#include <linux/uuid.h>
#include <linux/time.h>
+#include <linux/leds.h>
#include "htt.h"
#include "htc.h"
@@ -1273,6 +1274,13 @@ struct ath10k {
} testmode;
struct {
+ struct gpio_led wifi_led;
+ struct led_classdev cdev;
+ char label[48];
+ u32 gpio_state_pin;
+ } leds;
+
+ struct {
/* protected by data_lock */
u32 fw_crash_counter;
u32 fw_warm_reset_counter;
--- a/ath10k-4.16/hw.h
+++ b/ath10k-4.16/hw.h
@@ -499,6 +499,7 @@ struct ath10k_hw_params {
const char *name;
u32 patch_load_addr;
int uart_pin;
+ int led_pin;
u32 otp_exe_param;
/* Type of hw cycle counter wraparound logic, for more info
--- /dev/null
+++ b/ath10k-4.16/leds.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <linux/leds.h>
+
+#include "core.h"
+#include "wmi.h"
+#include "wmi-ops.h"
+
+#include "leds.h"
+
+static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
+{
+ struct ath10k *ar = container_of(led_cdev, struct ath10k,
+ leds.cdev);
+ struct gpio_led *led = &ar->leds.wifi_led;
+
+ mutex_lock(&ar->conf_mutex);
+
+ if (ar->state != ATH10K_STATE_ON)
+ goto out;
+
+ ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low;
+ ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin);
+
+out:
+ mutex_unlock(&ar->conf_mutex);
+
+ return 0;
+}
+
+int ath10k_leds_start(struct ath10k *ar)
+{
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return 0;
+
+ /* under some circumstances, the gpio pin gets reconfigured
+ * to default state by the firmware, so we need to
+ * reconfigure it this behaviour has only ben seen on
+ * QCA9984 and QCA99XX devices so far
+ */
+ ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0,
+ WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE);
+ ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1);
+
+ return 0;
+}
+
+int ath10k_leds_register(struct ath10k *ar)
+{
+ int ret;
+
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return 0;
+
+ snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s",
+ wiphy_name(ar->hw->wiphy));
+ ar->leds.wifi_led.active_low = 1;
+ ar->leds.wifi_led.gpio = ar->hw_params.led_pin;
+ ar->leds.wifi_led.name = ar->leds.label;
+ ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
+
+ ar->leds.cdev.name = ar->leds.label;
+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
+
+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+
+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+void ath10k_leds_unregister(struct ath10k *ar)
+{
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return;
+
+ led_classdev_unregister(&ar->leds.cdev);
+}
+
--- /dev/null
+++ b/ath10k-4.16/leds.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef _LEDS_H_
+#define _LEDS_H_
+
+#include "core.h"
+
+#ifdef CONFIG_ATH10K_LEDS
+void ath10k_leds_unregister(struct ath10k *ar);
+int ath10k_leds_start(struct ath10k *ar);
+int ath10k_leds_register(struct ath10k *ar);
+#else
+static inline void ath10k_leds_unregister(struct ath10k *ar)
+{
+}
+
+static inline int ath10k_leds_start(struct ath10k *ar)
+{
+ return 0;
+}
+
+static inline int ath10k_leds_register(struct ath10k *ar)
+{
+ return 0;
+}
+
+#endif
+#endif /* _LEDS_H_ */
--- a/ath10k-4.16/mac.c
+++ b/ath10k-4.16/mac.c
@@ -33,6 +33,7 @@
#include "wmi-tlv.h"
#include "wmi-ops.h"
#include "wow.h"
+#include "leds.h"
/*********/
/* Rates */
--- a/ath10k-4.16/wmi-ops.h
+++ b/ath10k-4.16/wmi-ops.h
@@ -199,6 +199,9 @@ struct wmi_ops {
(struct ath10k *ar,
enum wmi_bss_survey_req_type type);
struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
+ struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
+ u32 input, u32 pull_type, u32 intr_mode);
+ struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -983,6 +986,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
}
+static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num,
+ u32 input, u32 pull_type, u32 intr_mode)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_gpio_config)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid);
+}
+
+static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_gpio_config)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid);
+}
+
static inline int
ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
{
--- a/ath10k-4.16/wmi-tlv.c
+++ b/ath10k-4.16/wmi-tlv.c
@@ -3729,6 +3729,8 @@ static const struct wmi_ops wmi_tlv_ops
.gen_echo = ath10k_wmi_tlv_op_gen_echo,
.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
+ /* .gen_gpio_config not implemented */
+ /* .gen_gpio_output not implemented */
};
static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
--- a/ath10k-4.16/wmi.c
+++ b/ath10k-4.16/wmi.c
@@ -7593,6 +7593,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
return skb;
}
+static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar,
+ u32 gpio_num, u32 input,
+ u32 pull_type, u32 intr_mode)
+{
+ struct wmi_gpio_config_cmd *cmd;
+ struct sk_buff *skb;
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_gpio_config_cmd *)skb->data;
+ cmd->pull_type = __cpu_to_le32(pull_type);
+ cmd->gpio_num = __cpu_to_le32(gpio_num);
+ cmd->input = __cpu_to_le32(input);
+ cmd->intr_mode = __cpu_to_le32(intr_mode);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n",
+ gpio_num, input, pull_type, intr_mode);
+
+ return skb;
+}
+
+static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar,
+ u32 gpio_num, u32 set)
+{
+ struct wmi_gpio_output_cmd *cmd;
+ struct sk_buff *skb;
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_gpio_output_cmd *)skb->data;
+ cmd->gpio_num = __cpu_to_le32(gpio_num);
+ cmd->set = __cpu_to_le32(set);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n",
+ gpio_num, set);
+
+ return skb;
+}
+
static struct sk_buff *
ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
enum wmi_sta_ps_mode psmode)
@@ -9235,6 +9278,9 @@ static const struct wmi_ops wmi_ops = {
.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
+
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -9305,6 +9351,8 @@ static const struct wmi_ops wmi_10_1_ops
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -9383,6 +9431,8 @@ static const struct wmi_ops wmi_10_2_ops
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_pdev_enable_adaptive_cca not implemented */
};
@@ -9453,6 +9503,8 @@ static const struct wmi_ops wmi_10_2_4_o
.gen_pdev_enable_adaptive_cca =
ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -9529,6 +9581,8 @@ static const struct wmi_ops wmi_10_4_ops
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
.gen_echo = ath10k_wmi_op_gen_echo,
.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
};
int ath10k_wmi_attach(struct ath10k *ar)
--- a/ath10k-4.16/wmi.h
+++ b/ath10k-4.16/wmi.h
@@ -3013,6 +3013,41 @@ enum wmi_10_4_feature_mask {
};
+/* WMI_GPIO_CONFIG_CMDID */
+enum {
+ WMI_GPIO_PULL_NONE,
+ WMI_GPIO_PULL_UP,
+ WMI_GPIO_PULL_DOWN,
+};
+
+enum {
+ WMI_GPIO_INTTYPE_DISABLE,
+ WMI_GPIO_INTTYPE_RISING_EDGE,
+ WMI_GPIO_INTTYPE_FALLING_EDGE,
+ WMI_GPIO_INTTYPE_BOTH_EDGE,
+ WMI_GPIO_INTTYPE_LEVEL_LOW,
+ WMI_GPIO_INTTYPE_LEVEL_HIGH
+};
+
+/* WMI_GPIO_CONFIG_CMDID */
+struct wmi_gpio_config_cmd {
+ __le32 gpio_num; /* GPIO number to be setup */
+ __le32 input; /* 0 - Output/ 1 - Input */
+ __le32 pull_type; /* Pull type defined above */
+ __le32 intr_mode; /* Interrupt mode defined above (Input) */
+} __packed;
+
+/* WMI_GPIO_OUTPUT_CMDID */
+struct wmi_gpio_output_cmd {
+ __le32 gpio_num; /* GPIO number to be setup */
+ __le32 set; /* Set the GPIO pin*/
+} __packed;
+
+/* WMI_GPIO_INPUT_EVENTID */
+struct wmi_gpio_input_event {
+ __le32 gpio_num; /* GPIO number which changed state */
+} __packed;
+
struct wmi_ext_resource_config_10_4_cmd {
/* contains enum wmi_host_platform_type */
__le32 host_platform_config;
--- a/ath10k-4.19/Kconfig
+++ b/ath10k-4.19/Kconfig
@@ -64,6 +64,16 @@ config ATH10K_DEBUGFS
@ -674,7 +161,7 @@ v13:
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
@@ -3147,6 +3153,10 @@ int ath10k_core_start(struct ath10k *ar,
@@ -3167,6 +3173,10 @@ int ath10k_core_start(struct ath10k *ar,
ath10k_wmi_check_apply_board_power_ctl_table(ar);
}
@ -685,7 +172,7 @@ v13:
return 0;
err_hif_stop:
@@ -3401,9 +3411,18 @@ static void ath10k_core_register_work(st
@@ -3421,9 +3431,18 @@ static void ath10k_core_register_work(st
goto err_spectral_destroy;
}
@ -704,7 +191,7 @@ v13:
err_spectral_destroy:
ath10k_spectral_destroy(ar);
err_debug_destroy:
@@ -3461,6 +3480,8 @@ void ath10k_core_unregister(struct ath10
@@ -3481,6 +3500,8 @@ void ath10k_core_unregister(struct ath10
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
@ -723,7 +210,7 @@ v13:
#include "htt.h"
#include "htc.h"
@@ -1132,7 +1133,6 @@ struct ath10k {
@@ -1138,7 +1139,6 @@ struct ath10k {
u32 low_5ghz_chan;
u32 high_5ghz_chan;
bool ani_enabled;
@ -731,7 +218,7 @@ v13:
bool p2p;
bool ct_all_pkts_htt; /* CT firmware only: native-wifi for all pkts */
@@ -1383,6 +1383,13 @@ struct ath10k {
@@ -1389,6 +1389,13 @@ struct ath10k {
} testmode;
struct {
@ -1075,7 +562,7 @@ v13:
int ath10k_wmi_attach(struct ath10k *ar)
--- a/ath10k-4.19/wmi.h
+++ b/ath10k-4.19/wmi.h
@@ -3041,6 +3041,41 @@ enum wmi_10_4_feature_mask {
@@ -3084,6 +3084,41 @@ enum wmi_10_4_feature_mask {
};

@ -14,46 +14,9 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
ath10k-4.16/mac.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
--- a/ath10k-4.16/core.h
+++ b/ath10k-4.16/core.h
@@ -1366,6 +1366,10 @@ struct ath10k {
u8 csi_data[4096];
u16 csi_data_len;
+#ifdef CPTCFG_MAC80211_LEDS
+ const char *led_default_trigger;
+#endif
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
--- a/ath10k-4.16/leds.c
+++ b/ath10k-4.16/leds.c
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
ar->leds.cdev.name = ar->leds.label;
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
if (ret)
--- a/ath10k-4.16/mac.c
+++ b/ath10k-4.16/mac.c
@@ -9739,7 +9739,7 @@ int ath10k_mac_register(struct ath10k *a
wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
#ifdef CPTCFG_MAC80211_LEDS
- ieee80211_create_tpt_led_trigger(ar->hw,
+ ar->led_default_trigger = ieee80211_create_tpt_led_trigger(ar->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
ARRAY_SIZE(ath10k_tpt_blink));
#endif
--- a/ath10k-4.19/core.h
+++ b/ath10k-4.19/core.h
@@ -1482,6 +1482,10 @@ struct ath10k {
@@ -1488,6 +1488,10 @@ struct ath10k {
u8 csi_data[4096];
u16 csi_data_len;
@ -79,7 +42,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
if (ret)
--- a/ath10k-4.19/mac.c
+++ b/ath10k-4.19/mac.c
@@ -9908,7 +9908,7 @@ int ath10k_mac_register(struct ath10k *a
@@ -9982,7 +9982,7 @@ int ath10k_mac_register(struct ath10k *a
wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
#ifdef CPTCFG_MAC80211_LEDS

@ -29,7 +29,7 @@ Forwarded: https://patchwork.kernel.org/patch/10549245/
#include <net/mac80211.h>
#include <linux/etherdevice.h>
#include <linux/acpi.h>
@@ -9632,6 +9633,7 @@ int ath10k_mac_register(struct ath10k *a
@@ -9706,6 +9707,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
}

@ -0,0 +1,28 @@
--- a/ath10k-4.19/htt.h
+++ b/ath10k-4.19/htt.h
@@ -237,7 +237,11 @@ enum htt_rx_ring_flags {
};
#define HTT_RX_RING_SIZE_MIN 128
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
#define HTT_RX_RING_SIZE_MAX 2048
+#else
+#define HTT_RX_RING_SIZE_MAX 512
+#endif
#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
--- a/ath10k-5.2/htt.h
+++ b/ath10k-5.2/htt.h
@@ -225,7 +225,11 @@ enum htt_rx_ring_flags {
};
#define HTT_RX_RING_SIZE_MIN 128
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
#define HTT_RX_RING_SIZE_MAX 2048
+#else
+#define HTT_RX_RING_SIZE_MAX 512
+#endif
#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)

@ -0,0 +1,100 @@
--- a/ath10k-4.19/pci.c
+++ b/ath10k-4.19/pci.c
@@ -142,7 +142,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_htc_rx_cb,
},
@@ -151,7 +155,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 64,
+#endif
.recv_cb = ath10k_pci_htc_rx_cb,
},
@@ -178,7 +186,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 512,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_rx_cb,
},
@@ -203,7 +215,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 96,
+#endif
.recv_cb = ath10k_pci_pktlog_rx_cb,
},
--- a/ath10k-5.2/pci.c
+++ b/ath10k-5.2/pci.c
@@ -131,7 +131,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_htc_rx_cb,
},
@@ -140,7 +144,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 64,
+#endif
.recv_cb = ath10k_pci_htc_rx_cb,
},
@@ -167,7 +175,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 512,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_rx_cb,
},
@@ -192,7 +204,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 96,
+#endif
.recv_cb = ath10k_pci_pktlog_rx_cb,
},

@ -32,15 +32,15 @@ include $(INCLUDE_DIR)/package.mk
define Package/broadcom-wl/Default
SECTION:=kernel
CATEGORY:=Kernel modules
DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mini
DEPENDS:=@(PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mini)
SUBMENU:=Proprietary BCM43xx WiFi driver
SUBMENUDEP:=@TARGET_brcm47xx||TARGET_brcm63xx
SUBMENUDEP:=(TARGET_brcm47xx||TARGET_brcm63xx)
endef
define KernelPackage/brcm-wl/Default
$(call Package/broadcom-wl/Default)
SECTION:=kernel
DEPENDS:=@TARGET_brcm47xx||TARGET_brcm63xx +wireless-tools
DEPENDS:=@(TARGET_brcm47xx||TARGET_brcm63xx) +wireless-tools
TITLE:=Kernel driver for BCM43xx chipsets
FILES:=$(PKG_BUILD_DIR)/driver$(1)/wl.ko $(PKG_BUILD_DIR)/glue/wl_glue.ko
AUTOLOAD:=$(call AutoProbe,wl)

@ -27,7 +27,6 @@ include $(INCLUDE_DIR)/package.mk
define KernelPackage/cryptodev
SUBMENU:=Cryptographic API modules
DEFAULT:=m if ALL
TITLE:=Driver for cryptographic acceleration
URL:=http://cryptodev-linux.org/
VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=gpio-button-hotplug
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

@ -28,16 +28,13 @@
#include <linux/of_gpio.h>
#include <linux/of_irq.h>
#include <linux/gpio_keys.h>
#include <linux/gpio/consumer.h>
#define BH_SKB_SIZE 2048
#define DRV_NAME "gpio-keys"
#define PFX DRV_NAME ": "
struct bh_priv {
unsigned long seen;
};
struct bh_event {
const char *name;
unsigned int type;
@ -55,7 +52,8 @@ struct bh_map {
struct gpio_keys_button_data {
struct delayed_work work;
struct bh_priv bh;
unsigned long seen;
int map_entry;
int last_state;
int count;
int threshold;
@ -97,6 +95,8 @@ static struct bh_map button_map[] = {
BH_MAP(KEY_RESTART, "reset"),
BH_MAP(KEY_RFKILL, "rfkill"),
BH_MAP(KEY_VIDEO, "video"),
BH_MAP(KEY_VOLUMEDOWN, "volume_down"),
BH_MAP(KEY_VOLUMEUP, "volume_up"),
BH_MAP(KEY_WIMAX, "wwan"),
BH_MAP(KEY_WLAN, "wlan"),
BH_MAP(KEY_WPS_BUTTON, "wps"),
@ -237,39 +237,6 @@ static int button_get_index(unsigned int code)
return -1;
}
static void button_hotplug_event(struct gpio_keys_button_data *data,
unsigned int type, int value)
{
struct bh_priv *priv = &data->bh;
unsigned long seen = jiffies;
int btn;
pr_debug(PFX "event type=%u, code=%u, value=%d\n", type, data->b->code, value);
if ((type != EV_KEY) && (type != EV_SW))
return;
btn = button_get_index(data->b->code);
if (btn < 0)
return;
if (priv->seen == 0)
priv->seen = seen;
button_hotplug_create_event(button_map[btn].name, type,
(seen - priv->seen) / HZ, value);
priv->seen = seen;
}
struct gpio_keys_button_dev {
int polled;
struct delayed_work work;
struct device *dev;
struct gpio_keys_platform_data *pdata;
struct gpio_keys_button_data data[0];
};
static int gpio_button_get_value(struct gpio_keys_button_data *bdata)
{
int val;
@ -282,27 +249,61 @@ static int gpio_button_get_value(struct gpio_keys_button_data *bdata)
return val ^ bdata->b->active_low;
}
static void gpio_keys_polled_check_state(struct gpio_keys_button_data *bdata)
static void gpio_keys_handle_button(struct gpio_keys_button_data *bdata)
{
unsigned int type = bdata->b->type ?: EV_KEY;
int state = gpio_button_get_value(bdata);
unsigned long seen = jiffies;
if (state != bdata->last_state) {
unsigned int type = bdata->b->type ?: EV_KEY;
pr_debug(PFX "event type=%u, code=%u, pressed=%d\n",
type, bdata->b->code, state);
/* is this the initialization state? */
if (bdata->last_state == -1) {
/*
* Don't advertise unpressed buttons on initialization.
* Just save their state and continue otherwise this
* can cause OpenWrt to enter failsafe.
*/
if (type == EV_KEY && state == 0)
goto set_state;
/*
* But we are very interested in pressed buttons and
* initial switch state. These will be reported to
* userland.
*/
} else if (bdata->last_state == state) {
/* reset asserted counter (only relevant for polled keys) */
bdata->count = 0;
return;
}
if (bdata->count < bdata->threshold) {
bdata->count++;
return;
}
if (bdata->count < bdata->threshold) {
bdata->count++;
return;
}
if (bdata->last_state != -1 || type == EV_SW)
button_hotplug_event(bdata, type, state);
if (bdata->seen == 0)
bdata->seen = seen;
bdata->last_state = state;
}
button_hotplug_create_event(button_map[bdata->map_entry].name, type,
(seen - bdata->seen) / HZ, state);
bdata->seen = seen;
set_state:
bdata->last_state = state;
bdata->count = 0;
}
struct gpio_keys_button_dev {
int polled;
struct delayed_work work;
struct device *dev;
struct gpio_keys_platform_data *pdata;
struct gpio_keys_button_data data[0];
};
static void gpio_keys_polled_queue_work(struct gpio_keys_button_dev *bdev)
{
struct gpio_keys_platform_data *pdata = bdev->pdata;
@ -321,7 +322,9 @@ static void gpio_keys_polled_poll(struct work_struct *work)
for (i = 0; i < bdev->pdata->nbuttons; i++) {
struct gpio_keys_button_data *bdata = &bdev->data[i];
gpio_keys_polled_check_state(bdata);
if (bdata->gpiod)
gpio_keys_handle_button(bdata);
}
gpio_keys_polled_queue_work(bdev);
}
@ -341,8 +344,7 @@ static void gpio_keys_irq_work_func(struct work_struct *work)
struct gpio_keys_button_data *bdata = container_of(work,
struct gpio_keys_button_data, work.work);
button_hotplug_event(bdata, bdata->b->type ?: EV_KEY,
gpio_button_get_value(bdata));
gpio_keys_handle_button(bdata);
}
static irqreturn_t button_handle_irq(int irq, void *_bdata)
@ -350,8 +352,8 @@ static irqreturn_t button_handle_irq(int irq, void *_bdata)
struct gpio_keys_button_data *bdata =
(struct gpio_keys_button_data *) _bdata;
schedule_delayed_work(&bdata->work,
msecs_to_jiffies(bdata->software_debounce));
mod_delayed_work(system_wq, &bdata->work,
msecs_to_jiffies(bdata->software_debounce));
return IRQ_HANDLED;
}
@ -412,7 +414,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
return ERR_PTR(error);
}
} else {
button->active_low = flags & OF_GPIO_ACTIVE_LOW;
button->active_low = !!(flags & OF_GPIO_ACTIVE_LOW);
}
if (of_property_read_u32(pp, "linux,code", &button->code)) {
@ -519,6 +521,19 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
return -EINVAL;
}
bdata->map_entry = button_get_index(button->code);
if (bdata->map_entry < 0) {
dev_warn(dev, DRV_NAME "does not support key code:%u\n",
button->code);
continue;
}
if (!(button->type == 0 || button->type == EV_KEY ||
button->type == EV_SW)) {
dev_warn(dev, DRV_NAME "only supports buttons or switches\n");
continue;
}
error = devm_gpio_request(dev, gpio,
button->desc ? button->desc : DRV_NAME);
if (error) {
@ -539,13 +554,13 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
}
bdata->can_sleep = gpio_cansleep(gpio);
bdata->last_state = -1;
bdata->last_state = -1; /* Unknown state on boot */
if (bdev->polled) {
bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
pdata->poll_interval);
} else {
bdata->threshold = 1;
/* bdata->threshold = 0; already initialized */
if (button->debounce_interval) {
error = gpiod_set_debounce(bdata->gpiod,
@ -591,6 +606,11 @@ static int gpio_keys_probe(struct platform_device *pdev)
struct gpio_keys_button_data *bdata = &bdev->data[i];
unsigned long irqflags = IRQF_ONESHOT;
INIT_DELAYED_WORK(&bdata->work, gpio_keys_irq_work_func);
if (!bdata->gpiod)
continue;
if (!button->irq) {
bdata->irq = gpio_to_irq(button->gpio);
@ -605,7 +625,8 @@ static int gpio_keys_probe(struct platform_device *pdev)
bdata->irq = button->irq;
}
INIT_DELAYED_WORK(&bdata->work, gpio_keys_irq_work_func);
schedule_delayed_work(&bdata->work,
msecs_to_jiffies(bdata->software_debounce));
ret = devm_request_threaded_irq(&pdev->dev,
bdata->irq, NULL, button_handle_irq,
@ -620,9 +641,6 @@ static int gpio_keys_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n",
button->gpio, bdata->irq);
}
if (bdata->b->type == EV_SW)
button_hotplug_event(bdata, EV_SW, gpio_button_get_value(bdata));
}
return 0;
@ -633,7 +651,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
struct gpio_keys_platform_data *pdata;
struct gpio_keys_button_dev *bdev;
int ret;
int i;
ret = gpio_keys_button_probe(pdev, &bdev, 1);
@ -647,9 +664,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
if (pdata->enable)
pdata->enable(bdev->dev);
for (i = 0; i < pdata->nbuttons; i++)
gpio_keys_polled_check_state(&bdev->data[i]);
gpio_keys_polled_queue_work(bdev);
return ret;

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=i2c-gpio-custom
PKG_RELEASE:=2
PKG_RELEASE:=3
include $(INCLUDE_DIR)/package.mk

@ -56,7 +56,7 @@
#define DRV_NAME "i2c-gpio-custom"
#define DRV_DESC "Custom GPIO-based I2C driver"
#define DRV_VERSION "0.1.1"
#define DRV_VERSION "0.1.2"
#define PFX DRV_NAME ": "
@ -101,7 +101,7 @@ static void i2c_gpio_custom_cleanup(void)
for (i = 0; i < nr_devices; i++)
if (devices[i])
platform_device_put(devices[i]);
platform_device_unregister(devices[i]);
}
static int __init i2c_gpio_custom_add_one(unsigned int id, unsigned int *params)

@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-adsl-mei
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-adsl-mei-$(BUILD_VARIANT)/
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_CHECK_FORMAT_SECURITY:=0

@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-atm
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-atm-$(BUILD_VARIANT)
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0+

@ -8,7 +8,6 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ltq-deu
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-deu-$(BUILD_VARIANT)
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=GPL-2.0+

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save