openwrt/openwrt.git
5 years agodnsmasq: bump to dnsmasq v2.80test3
Kevin Darbyshire-Bryant [Sat, 28 Jul 2018 09:47:32 +0000 (10:47 +0100)]
dnsmasq: bump to dnsmasq v2.80test3

Refresh patches

Upstream commits since last bump:

3b6eb19 Log DNSSEC trust anchors at startup.
f3e5787 Trivial comment change.
c851c69 Log failure to confirm an address in DHCPv6.
a3bd7e7 Fix missing fatal errors when parsing some command-line/config options.
ab5ceaf Document the --help option in the french manual
1f2f69d Fix recurrent minor spelling mistake in french manual
f361b39 Fix some mistakes in french translation of the manual
eb1fe15 When replacing cache entries, preserve CNAMES which target them.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 1e93ef84981f2722138824413a1b197fdab7fb6c)

5 years agodnsmasq: don't use network functions at boottime (FS#1542)
Hans Dedecker [Tue, 17 Jul 2018 11:42:17 +0000 (13:42 +0200)]
dnsmasq: don't use network functions at boottime (FS#1542)

As dnsmasq is started earlier than netifd usage of network.sh functions
at boottime will fail; therefore don't call at boottime the functions
which construct the dhcp pool/relay info.
As interface triggers are installed the dhcp pool/relay info will be
constructed when the interface gets reported as up by netifd.
At the same time also register interface triggers based on DHCP relay
config.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 2336b942b37f265c59547d738ca558b61102833d)

5 years agodnsmasq: bump to latest patches on 2.80rc2
Kevin Darbyshire-Bryant [Sun, 3 Jun 2018 03:44:12 +0000 (04:44 +0100)]
dnsmasq: bump to latest patches on 2.80rc2

Refresh patches and backport upstream to current HEAD:

a997ca0 Fix sometimes missing DNSSEC RRs when DNSSEC validation not enabled.
51e4eee Fix address-dependent domains for IPv6.
05ff659 Fix stupid infinite loop introduced by preceding commit.
db0f488 Handle some corner cases in RA contructed interfaces with addresses changing interface.
7dcca6c Warn about the impact of cache-size on performance.
090856c Allow zone transfer in authoritative mode whenever auth-peer is specified.
cc5cc8f Sane error message when pcap file header is wrong.
c488b68 Handle standard and contructed dhcp-ranges on the same interface.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit fbf475403b911f46e91b57fb7a6cf3c65276464c)

5 years agobrcm47xx: revert upstream commit breaking BCM4718A1
Rafał Miłecki [Fri, 27 Jul 2018 13:57:13 +0000 (15:57 +0200)]
brcm47xx: revert upstream commit breaking BCM4718A1

This fixes kernel hang when booting on BCM4718A1 (& probably BCM4717A1).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 4c1aa64b4d804e77dfaa8d53e5ef699fcced4b18)

5 years agomac80211: backport brcmfmac fixes & debugging helpers from 4.18
Rafał Miłecki [Thu, 26 Jul 2018 20:43:18 +0000 (22:43 +0200)]
mac80211: backport brcmfmac fixes & debugging helpers from 4.18

The most important is probably regression fix in handling platform
NVRAM. That bug stopped hardware from being properly calibrated breaking
e.g. 5 GHz for Netgear R8000.

Other than that it triggers memory dumps when experiencing firmware
problems which is important for debugging purposes.

Fixes: 2811c97803e5 ("mac80211: backport brcmfmac firmware & clm_blob loading rework")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b26214adb53da2816ff830b6cd6e31e1dafa2635)

5 years agoodhcpd: update to latest git HEAD
Jo-Philipp Wich [Tue, 26 Jun 2018 12:46:00 +0000 (14:46 +0200)]
odhcpd: update to latest git HEAD

Changes:

  81a281e dhcpv6-ia: fix border assignment size setting
  a2ffc59 dhcpv6-ia: fix status code for not on link IAs
  5b087a6 dhcpv6-ia: improve error checking in assign_pd()
  c9114a1 config: fix wrong assignment
  bb8470f dhcpv4: delay forced renew transaction start
  62a1b09 dhcpv4: fix DHCP address space logic
  d5726ff dhcpv4: improve logging when sending DHCP messages
  9484351 odhcpd: call handle_error when socket error can be retrieved
  c45e2eb dhcpv6: fix out of bounds write in handle_nested_message()
  c2ff5af dhcpv6-ia: log renew messages as well
  676eb38 router: fix possible segfault in send_router_advert()
  392701f odhcpd: fix passing possible negative parameter
  029123b treewide: switch to C-code style comments
  6b79748 router: improve error checking
  12e21bc netlink: fix incorrect sizeof argument
  d7aa414 dhcpv6: improve error checking in dhcpv6_setup_interface()
  373495a ubus: fix invalid ipv6-prefix json
  79d5e6f ndp: improve error checking
  d834ae3 dhcpv4: fix error checking in dhcpv4_setup_interface()
  f2aa383 dhcpv4: fix out of bound access in dhcpv4_put
  4591b36 dhcpv4: improve error checking in dhcpv4_setup_interface()
  4983ee5 odhcpd: fix strncpy bounds
  c0f6390 odhcpd: Check if open the ioctl socket failed
  345bba0 dhcpv4: improve error checking in handle_dhcpv4()
  44cce31 ubus: avoid dumping interface state with NULL message

Cherry picked and squashed from commits:

  b7ef10cbf0 odhcpd: update to latest git HEAD
  98a6bee09a odhcpd: update to latest git HEAD
  88c88823d5 odhcpd: update to latest git HEAD

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoubus: update to latest git HEAD
Jo-Philipp Wich [Thu, 26 Jul 2018 14:48:07 +0000 (16:48 +0200)]
ubus: update to latest git HEAD

40e0931 libubus: pass an empty UBUS_ATTR_DATA block if msg is NULL on invoke

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7316515891532a9d5f0b70db31a95d06f7b00e94)

5 years agofirewall: update to latest git HEAD and build with LTO
Hans Dedecker [Fri, 25 May 2018 12:29:58 +0000 (14:29 +0200)]
firewall: update to latest git HEAD and build with LTO

Reduces .ipk size on MIPS from 41.6k to 41.1k

Changes:

  30463d0 zones: add interface/subnet bound LOG rules
  0e77bf2 options: treat time strings as UTC times
  d2bbeb7 firewall3: make reject types selectable by user
  aa8846b ubus: avoid dumping interface state with NULL message

Cherry picked and squashed from commits:

  a3f2451fba firewall: update to latest git HEAD
  433d71e73e fw3: update to latest git HEAD
  ef96d1e34a firewall: compile with LTO enabled
  1e83f775a3 firewall3: update to latest git HEAD
  3ee2c76ae0 firewall: update to latest git HEAD

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoubus: update to latest git HEAD
John Crispin [Wed, 25 Jul 2018 10:15:45 +0000 (12:15 +0200)]
ubus: update to latest git HEAD

884be45 libubus: check for non-NULL data before running callbacks

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit a5c3bbaf56d6fb442ea16f26042cec83c7c00454)

5 years agolibubox: update to latest git HEAD
John Crispin [Wed, 25 Jul 2018 10:03:18 +0000 (12:03 +0200)]
libubox: update to latest git HEAD

c83a84a fix segfault when passed blobmsg attr is NULL

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 5dc32620c4aa66d05eb5585784ed954854e8194c)

5 years agowireguard-tools: add wireguard_watchdog script
Aleksandr V. Piskunov [Sun, 1 Jul 2018 12:40:31 +0000 (15:40 +0300)]
wireguard-tools: add wireguard_watchdog script

This watchdog script tries to re-resolve hostnames for inactive WireGuard peers.
Use it for peers with a frequently changing dynamic IP.
persistent_keepalive must be set, recommended value is 25 seconds.
Run this script from cron every minute:
echo '* * * * * /usr/bin/wireguard_watchdog' >> /etc/crontabs/root

Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
[bump the package release]
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 20c4819c7baf6f9b91420849caf30e5137bd75d6)

5 years agowireguard: bump to 0.0.20180718
Jason A. Donenfeld [Wed, 18 Jul 2018 23:36:33 +0000 (01:36 +0200)]
wireguard: bump to 0.0.20180718

80b41cd version: bump snapshot
fe5f0f6 recieve: disable NAPI busy polling
e863f40 device: destroy workqueue before freeing queue
81a2e7e wg-quick: allow link local default gateway
95951af receive: use gro call instead of plain call
d9501f1 receive: account for zero or negative budget
e80799b tools: only error on wg show if all interfaces failk

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
[Added commit log to commit description]
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 57b808ec88315db6743b3159a04dbb16097597ea)

5 years agowireguard: bump to 0.0.20180708
Jason A. Donenfeld [Tue, 10 Jul 2018 19:29:18 +0000 (21:29 +0200)]
wireguard: bump to 0.0.20180708

* device: print daddr not saddr in missing peer error
* receive: style

Debug messages now make sense again.

* wg-quick: android: support excluding applications

Android now supports excluding certain apps (uids) from the tunnel.

* selftest: ratelimiter: improve chance of success via retry
* qemu: bump default kernel version
* qemu: decide debug kernel based on KERNEL_VERSION

Some improvements to our testing infrastructure.

* receive: use NAPI on the receive path

This is a big change that should both improve preemption latency (by not
disabling it unconditionally) and vastly improve rx performance on most
systems by using NAPI. The main purpose of this snapshot is to test out this
technique.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit 4630159294024c0718077e49dbb440919440de87)

5 years agobuild: do not alter global default package selection from profiles
Jo-Philipp Wich [Sat, 21 Jul 2018 18:47:10 +0000 (20:47 +0200)]
build: do not alter global default package selection from profiles

This partly reverts ca32373c951c651f4fe5d8f99ddeb8d4f20bbe3e which lets
profiles that suppress packages to alter the package selection for all
devices of the target when building with CONFIG_TARGET_PER_DEVICE_ROOTFS.

In particular, this caused the brcm47xx Edimax PS-1208MFG profile to
disable mtd, dropbear, firewall and other essential packages for all
brcm47xx/generic builds.

To solve this problem, prevent profiles from mangling the global
DEFAULT_PACKAGES selection and restrict the supression of negated
packages to the local PACKAGE variable list only.

Fixes ca32373c95 ("target.mk: let profile remove from DEFAULT_PACKAGES")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 69ea512c62619b8b650d4e03d071b36a526734ce)

5 years agoWDR4900v1 remove dt node for absent hw crypto.
Tim Small [Wed, 4 Jul 2018 13:05:18 +0000 (14:05 +0100)]
WDR4900v1 remove dt node for absent hw crypto.

The WDR4900v1 uses the P1040 SoC, so the device tree pulls in the
definition for the related P1010 SoC.  However, the P1040 lacks the
CAAM/SEC4 hardware crypto accelerator which the P1010 device tree
defines.  If left defined, this causes the CAAM drivers (if present) to
attempt to use the non-existent device, making various crypto-related
operations (e.g. macsec and ipsec) fail.

This commit overrides the incorrect dt node definition in the included
file.

See also:
 - https://bugs.openwrt.org/index.php?do=details&task_id=1262
 - https://community.nxp.com/thread/338432#comment-474107

Signed-off-by: Tim Small <tim@seoss.co.uk>
(cherry picked from commit e97aaf483c71fd5e3072ec2dce53354fc97357c9)

5 years agoiproute2: tc: backport canonical cake support
Kevin Darbyshire-Bryant [Fri, 20 Jul 2018 15:12:37 +0000 (16:12 +0100)]
iproute2: tc: backport canonical cake support

iproute2's tc was updated to support the recently upstreamed cake qdisc.
Backport this canonical support from upstream into iproute2 v4.16

There is no kernel kmod/userspace tc ABI change in this release from the
previous package bump, so everyone can breath a sigh of relief.

This is largely a code style change, the exception to prove the rule:
option 'autorate_ingress' has been changed to 'autorate-ingress' to fit
in with upstream option naming expectations.

No openwrt package (e.g. sqm-scripts) has knowledge of
'autorate_ingress' thus only users who made their own scripts or used
it within the 'dangerous configuration' options of sqm-scripts will be
affected.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years agobuild: fix compile error when a package includes itself in PROVIDES
Felix Fietkau [Fri, 20 Jul 2018 08:40:43 +0000 (10:40 +0200)]
build: fix compile error when a package includes itself in PROVIDES

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 7c306ae640feb4d42b352175de27b034bd917938)

5 years agoapm821xx: fix sata access freezes
Christian Lamparter [Mon, 16 Jul 2018 20:56:34 +0000 (22:56 +0200)]
apm821xx: fix sata access freezes

The original vendor's driver programmed the dma controller's
AHB HPROT values to enable bufferable, privileged mode. This
along with the "same priorty for both channels" fixes the
freezes according to @takimata, @And.short, that have been
reported on the forum by @ticerex.

Furtheremore, @takimata reported that the patch also improved
the performance of the HDDs considerably:
|<https://forum.lede-project.org/t/wd-mybook-live-duo-two-disks/16195/55>
|It seems your patch unleashed the full power of the SATA port.
|Where I was previously hitting a really hard limit at around
|82 MB/s for reading and 27 MB/s for writing, I am now getting this:
|
|root@OpenWrt:/mnt# time dd if=/dev/zero of=tempfile bs=1M count=1024
|1024+0 records in
|1024+0 records out
|real    0m 13.65s
|user    0m 0.01s
|sys     0m 11.89s
|
|root@OpenWrt:/mnt# time dd if=tempfile of=/dev/null bs=1M count=1024
|1024+0 records in
|1024+0 records out
|real    0m 8.41s
|user    0m 0.01s
|sys     0m 4.70s
|
|This means: 121 MB/s reading and 75 MB/s writing!
|
|[...]
|
|The drive is a WD Green WD10EARX taken from an older MBL Single.
|I repeated the test a few times with even larger files to rule out
|any caching, I'm still seeing the same great performance. OpenWrt is
|now completely on par with the original MBL firmware's performance.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years agobase-files: fix wrong sysctl parameter order
Luiz Angelo Daros de Luca [Tue, 17 Jul 2018 22:41:09 +0000 (19:41 -0300)]
base-files: fix wrong sysctl parameter order

Restarting service sysctl echos multiple errors like:

  sysctl: -e: No such file or directory

After the first filename, all remaining arguments are treated
as files.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
5 years agoigmpproxy: run in foreground for procd
Kevin Darbyshire-Bryant [Wed, 18 Jul 2018 16:51:59 +0000 (17:51 +0100)]
igmpproxy: run in foreground for procd

procd needs processes to stay in foreground to remain under its gaze and
control.  Failure to do so means service stop commands fail to actually
stop the process (procd doesn't think it's running 'cos the process has
exited already as part of its forking routing)

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 9d5a2469304eb23b6d09432a6d9b6a57d0019d2a)

5 years agomediatek: fix parallel build issues in image build code
Jo-Philipp Wich [Tue, 17 Jul 2018 12:40:04 +0000 (14:40 +0200)]
mediatek: fix parallel build issues in image build code

Drop the parallel-unsafe custom Build/dtb macro and use the .dtb artifacts
produced by the generic image build code.

Also remove unused .dtb references in the mt7623 subtarget.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 8194f9ef4a5ab4587e8f6cf1aec96ba89c5766fd)

5 years agomtd: improve check for TRX header being already fixed
Rafał Miłecki [Sun, 15 Jul 2018 21:23:42 +0000 (23:23 +0200)]
mtd: improve check for TRX header being already fixed

First of all lengths should be compared after checking all blocks for
being good/bad. It's because requested length may differ from a final
one if there were some bad blocks.

Secondly it makes sense to also compare crc32 since we already have a
new one calculated.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 82498a7f7aa86ad0e93ef60d50dccaa0a9549e4c)

5 years agomtd: support bad blocks within the mtd_fixtrx()
Rafał Miłecki [Sun, 15 Jul 2018 14:51:41 +0000 (16:51 +0200)]
mtd: support bad blocks within the mtd_fixtrx()

Reading MTD data with (p)read doesn't return any error when accessing
bad block. As the result, with current code, CRC32 covers "data" stored
in bad blocks.

That behavior doesn't match CFE's one (bootloader simply skips bad
blocks) and may result in:
1) Invalid CRC32
2) CFE refusing to boot firmware with a following error:
Boot program checksum is invalid

Fix that problem by checking every block before reading its content.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 0f54489f754e7bd34e0430c57a11b6a54740d58e)

5 years agokmod-sched-cake: bump to 20180716
Kevin Darbyshire-Bryant [Sun, 15 Jul 2018 10:01:15 +0000 (11:01 +0100)]
kmod-sched-cake: bump to 20180716

Bump to the latest cake recipe.

This backports tc class support to kernel 4.9 and other than conditional
kernel compilation pre-processor macros represents the cake that has
gone upstream into kernel 4.19.  Loud cheer!

Fun may be had by changing cake tin classification for packets on
ingress. e.g.

tc filter add dev ifb4eth0 parent 800b: protocol ip u32 match \
ip dport 6981 0xffff action skbedit priority 800b:1

Where 800b: represents the filter handle for the ifb obtained by 'tc
qdisc' and the 1 from 800b:1 represents the cake tin number.  So the
above example puts all incoming packets destined for port 6981 into the
BULK (lowest priority) tin.

f39ab9a Obey tin_order for tc filter classifiers
1e2473f Clean up after latest backport.
82531d0 Reorder includes to fix out of tree compilation
52cbc00 Code style cleanup
6cdb496 Fix argument order for NL_SET_ERR_MSG_ATTR()
cab17b6 Remove duplicate call to qdisc_watchdog_init()
71c7991 Merge branch 'backport-classful'
32aa7fb Fix compilation on Linux 4.9
9f8fe7a Fix compilation on Linux 4.14
ceab7a3 Rework filter classification
aad5436 Fixed version of class stats
be1c549 Add cake-specific class stats
483399d Use tin_order for class dumps
80dc129 Add class dumping
0c8e6c1 Fix dropping when using filters
c220493 Add the minimum class ops
5ed54d2 Start implementing tc filter/class support

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit c729c43b391e759b6700b28c8e02ba93fe15f8c2)

5 years agoqos-scripts: fix uci callback handling
Tony Ambardar [Fri, 8 Jun 2018 11:34:00 +0000 (04:34 -0700)]
qos-scripts: fix uci callback handling

The previous callback code was fragile, dependent on some UCI callback
bugs and side-effects now fixed in master commit 73d8a6ab.

Update scripts to use callbacks where appropriate and necessary, while
using normal UCI config parsing for all else. This results in smaller,
simpler, more robust code. Use callbacks in generate.sh to only process
'interface' defaults and the varying entries for 'reclassify', 'default'
and 'classify' sections. Also switch qos-stat to use non-callback UCI
handling.

The current changes work independently of 73d8a6ab (i.e. both before and
after), and are consistent with UCI config parsing documentation.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
5 years agobase-files: fix UCI config parsing and callback handling
Tony Ambardar [Thu, 8 Mar 2018 05:00:45 +0000 (21:00 -0800)]
base-files: fix UCI config parsing and callback handling

There are several long-standing issues present in the UCI shell API as
documented in https://wiki.openwrt.org/doc/devel/config-scripting. They
relate both to high-level, user-defined callback functions used to
process UCI config files, and also to low-level functions used within
scripts generally.

The related problems have been encountered now and in the past, e.g.
https://forum.openwrt.org/viewtopic.php?id=54295, and include:

a) UCI parsing option() function and user-defined option_cb() callbacks
being erroneously called during processing of "list" config file entries;

b) normal usage of the low-level config_set() unexpectedy calling any
defined option_cb() if present; and

c) handling of the list_cb() not respecting the NO_CALLBACK variable.

Root causes include a function stack "inversion", where the low-level
config_set() function incorrectly calls the high-level option() function,
intended only for processing the "option" keyword of UCI config files.

This change addresses the inversion and other issues, making the option
handling code more consistent and smaller, and simplifying developers'
usage of UCI callbacks.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
5 years agoapm821xx: fix usb-otg on 4.14
Christian Lamparter [Sat, 14 Jul 2018 15:21:55 +0000 (17:21 +0200)]
apm821xx: fix usb-otg on 4.14

Starting with 4.14, the "amcc,dwc-otg" needs to be used
in order to get the usb-otg to work.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 12b80f1cabf0a7995637fc9b0831b3e9f881f9e6)

5 years agoodhcp6c: add noserverunicast config option for broken DHCPv6 servers
Hans Dedecker [Sun, 15 Jul 2018 19:53:25 +0000 (21:53 +0200)]
odhcp6c: add noserverunicast config option for broken DHCPv6 servers

Fix broken DHCPv6 servers which provide the server unicast option but
do not reply on DHCPv6 renew messages directed to the IPv6 address
contained in the server unicast option which results in broken IPv6
connectivity.

67ae6a7 odhcp6c: add option to ignore Server Unicast option

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agoodhcp6c: update to latest git HEAD
Hans Dedecker [Wed, 20 Jun 2018 13:34:18 +0000 (15:34 +0200)]
odhcp6c: update to latest git HEAD

b99c1f6 odhcp6c: remove len check in option parsing handle

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agoodhcp6c: user string option support
Hans Dedecker [Mon, 11 Jun 2018 13:44:50 +0000 (15:44 +0200)]
odhcp6c: user string option support

ca8822b odhcp6c: add support for user string options

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agoipq40xx: add get_status_led to diag.sh
David Bauer [Tue, 12 Jun 2018 23:37:55 +0000 (01:37 +0200)]
ipq40xx: add get_status_led to diag.sh

This commit adds the get_status_led method to diag.sh, which sets the
boot-led as status-led for scripts using this method to get a
status-led.

This method is used platform-independent in downstream project gluon to
set the LED used to indicate the config-mode.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 4fc005197a320ff728544eba8028f7a9f23e1868)

5 years agoOpenWrt v18.06.0-rc2: revert to branch defaults
Jo-Philipp Wich [Sun, 15 Jul 2018 15:54:39 +0000 (17:54 +0200)]
OpenWrt v18.06.0-rc2: revert to branch defaults

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoOpenWrt v18.06.0-rc2: adjust config defaults v18.06.0-rc2
Jo-Philipp Wich [Sun, 15 Jul 2018 15:54:33 +0000 (17:54 +0200)]
OpenWrt v18.06.0-rc2: adjust config defaults

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agouhttpd: update to latest Git head
Jo-Philipp Wich [Mon, 2 Jul 2018 06:58:38 +0000 (08:58 +0200)]
uhttpd: update to latest Git head

db86175 lua: honour size argument in recv() function
d3b9560 utils: add uh_htmlescape() helper
8109b95 file: escape strings in HTML output
393b59e proc: expose HTTP Origin header in process environment
796d42b client: flush buffered SSL output when tearing down client ustream

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b54bef205846e2b30da23c1316c4a9b941c5078d)

5 years agoinclude/prereq-build.mk: explicitly check for -f flag when using busybox time
Matthias Schiffer [Sat, 14 Jul 2018 13:44:47 +0000 (15:44 +0200)]
include/prereq-build.mk: explicitly check for -f flag when using busybox time

On Debian, busybox does have a time applet, but it does not support the -f
flag. Catch this in prereq check to give users to proper error message.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit b123921a92a957f08abb186e041aa38aa9328f3e)

5 years agoinclude/kernel-build.mk: fix kernel rebuild on backport patch changes
Matthias Schiffer [Sat, 14 Jul 2018 11:07:34 +0000 (13:07 +0200)]
include/kernel-build.mk: fix kernel rebuild on backport patch changes

An incorrect variable name was referenced in KERNEL_FILE_DEPENDS, leading
to the omission of the backport-* patch dirs in the generation of the
prepared stamp name.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 36fa1bbf6f510e57098edab3932015dc747bbd49)

5 years agokernel: backport page fragment API changes from 4.10+ to 4.9
Felix Fietkau [Sat, 14 Jul 2018 09:38:28 +0000 (11:38 +0200)]
kernel: backport page fragment API changes from 4.10+ to 4.9

mt76 now relies on this API

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agokernel: gen_stats: Fix netlink stats dumping in the presence of padding
Kevin Darbyshire-Bryant [Mon, 2 Jul 2018 17:27:02 +0000 (18:27 +0100)]
kernel: gen_stats: Fix netlink stats dumping in the presence of padding

Backport hot off the press upstream netlink patch.  Fixes stats display
from CAKE qdisc on MIPS allowing us to bump CAKE to latest version.

The gen_stats facility will add a header for the toplevel nlattr of type
TCA_STATS2 that contains all stats added by qdisc callbacks. A reference
to this header is stored in the gnet_dump struct, and when all the
per-qdisc callbacks have finished adding their stats, the length of the
containing header will be adjusted to the right value.

However, on architectures that need padding (i.e., that don't set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS), the padding nlattr is added
before the stats, which means that the stored pointer will point to the
padding, and so when the header is fixed up, the result is just a very
big padding nlattr. Because most qdiscs also supply the legacy TCA_STATS
struct, this problem has been mostly invisible, but we exposed it with
the netlink attribute-based statistics in CAKE.

Fix the issue by fixing up the stored pointer if it points to a padding
nlattr.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 3698b34a00d623f87a41179e656b8e89d0bb7267)

5 years agoramips: clean up and fix MT7621 NAND driver issues
Felix Fietkau [Wed, 11 Jul 2018 18:56:42 +0000 (20:56 +0200)]
ramips: clean up and fix MT7621 NAND driver issues

- remove misaligned custom buffer allocation in the NAND driver
- remove broken bounce buffer implementation for 16-byte align

Let the MTD core take care of both

Fixes messages like these:
[  102.820541] Data buffer not 16 bytes aligned: 87daf08c

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: update to the latest version
Felix Fietkau [Fri, 13 Jul 2018 14:36:39 +0000 (16:36 +0200)]
mt76: update to the latest version

08719b1 mt76: use a per rx queue page fragment cache
4d2c565 mt76x2: reset HW before probe
f622975 mt76x2: fix CCK protection control frame rate
6780375 mt76x2: add frame protection support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agoramips: ethernet: use own page_frag_cache
Felix Fietkau [Thu, 12 Jul 2018 15:19:07 +0000 (17:19 +0200)]
ramips: ethernet: use own page_frag_cache

Using the NAPI or netdev frag cache along with other drivers can lead to
32 KiB pages being held for a long time, despite only being used for
very few page fragment.
This can happen if the ethernet driver grabs one or two fragments for rx
ring refill, while other drivers use (and free up) the remaining
fragments. The 32 KiB higher-order page can only be freed once all users
have freed their fragments, which only happens after the rings of all
drivers holding the fragments have wrapped around.

Depending on the traffic patterns, this can waste a lot of memory and
look a lot like a memory leak

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agoramips: ethernet: use skb_free_frag to free fragments
Felix Fietkau [Thu, 12 Jul 2018 15:18:37 +0000 (17:18 +0200)]
ramips: ethernet: use skb_free_frag to free fragments

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agoinclude/feeds.mk: rework generation of opkg distfeeds.conf
Matthias Schiffer [Mon, 9 Jul 2018 22:00:01 +0000 (00:00 +0200)]
include/feeds.mk: rework generation of opkg distfeeds.conf

Allow enabling/commenting/disabling each feed individually by using a
tristate config symbol.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 16035a7dd370671670693af9ae63368ee4dd731f)

5 years agobase-files: fix feed list in PKG_CONFIG_DEPENDS
Matthias Schiffer [Mon, 9 Jul 2018 21:50:28 +0000 (23:50 +0200)]
base-files: fix feed list in PKG_CONFIG_DEPENDS

FEEDS_ENABLED and FEEDS_DISABLED are derived from FEEDS_AVAILABLE, not
FEEDS_INSTALLED.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 6dac434c0011524b9ac01725727faa1a19ea4a48)

5 years agoinclude/feeds.mk: always add available feeds to PACKAGE_SUBDIRS
Matthias Schiffer [Mon, 9 Jul 2018 20:13:19 +0000 (22:13 +0200)]
include/feeds.mk: always add available feeds to PACKAGE_SUBDIRS

Setting CONFIG_FEED_... symbols combined two different effects: Disabling
a feed in the generated opkg distfeeds.conf, and omitting the feed from
PACKAGE_SUBDIRS.

It does not make sense to omit built feeds from PACKAGE_SUBDIRS, as it will
only lead to packages that can be enabled in .config (and that will
consequently be built) not to be found during rootfs creation, breaking
the build. All feeds that packages are emitted to should simply always be
added to PACKAGE_SUBDIRS instead; the CONFIG_FEED_... only configure the
generated distfeeds.conf like this.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 9af22f1ac9122b54700dd38f627fdd446e1109f4)

5 years agoscripts/feeds: add src-dummy method
Matthias Schiffer [Mon, 9 Jul 2018 20:00:27 +0000 (22:00 +0200)]
scripts/feeds: add src-dummy method

The src-dummy method does not actually obtain any feed, but it can be used
to insert addtional entries into the opkg distfeeds.conf. This is useful to
make package feeds available to users without requiring the corresponding
source feeds to be available during build.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 6bdd5d8459cca7ceb93c841cccf61dc7ce830092)

5 years agoramips: TP-Link TL-WR902AC v3: add missing wps button
Peter Lundkvist [Mon, 9 Jul 2018 10:54:18 +0000 (12:54 +0200)]
ramips: TP-Link TL-WR902AC v3: add missing wps button

Signed-off-by: Peter Lundkvist <peter.lundkvist@gmail.com>
5 years agoramips: TP-Link TL-WR902AC v3: don't build factory image
Peter Lundkvist [Mon, 9 Jul 2018 10:54:17 +0000 (12:54 +0200)]
ramips: TP-Link TL-WR902AC v3: don't build factory image

The line that produces factory image was accidentally left by me while
testing before inital commit.

I came to the conclusion that flashing from OEM firmware does not work
(seems to share this behavior with other tplinks based on mt7628).

I have not done any further analysis, as I was unable to open the
case and attach a serial port (too much glue). Maybe i will try once
more.

So the way to do initial flashing (or un-bricking) is to use the
tftp-recover image. It is possible to revert to OEM firmware with tftp
recovery; in this case the first 512 bytes the image file need to be
cut off.

Signed-off-by: Peter Lundkvist <peter.lundkvist@gmail.com>
[add explaination provided via mail as commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years agokernel: bump 4.14 to 4.14.54 for 18.06
Koen Vandeputte [Wed, 11 Jul 2018 12:58:36 +0000 (14:58 +0200)]
kernel: bump 4.14 to 4.14.54 for 18.06

Refreshed all patches

Reworked patches to match upstream:
335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch

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

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bump 4.9 to 4.9.111 for 18.06
Koen Vandeputte [Wed, 11 Jul 2018 12:57:00 +0000 (14:57 +0200)]
kernel: bump 4.9 to 4.9.111 for 18.06

Refreshed all patches

Compile-tested on: ar71xx
Runtime-tested on: ar71xx

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agomac80211: Expose support for ath9k Dynack
Koen Vandeputte [Mon, 2 Jul 2018 08:23:44 +0000 (10:23 +0200)]
mac80211: Expose support for ath9k Dynack

Enables support for Dynack feature.

When a remote station is far away, we need to compensate for the distance
by allowing more time for an ACK to arrive back before issueing a retransmission.
Currently, it needs to be set fixed to indicate the maximum distance the remote
station will ever be.

While this mostly works for static antennae, it introduces 2 issues:
- If the actual distance is less, speed is reduced due to a lot of wates wait-time
- If the distance becomes greater, retries start to occur and comms can get lost.

Allowing to set it dynamically using dynack ensures the best possible tradeoff
between speed vs distance.

This feature is currently only supported in ath9k.
it is also disabled by default.

Enabling it can be done in 2 ways:
- issue cmd:  iw phy0 set distance auto
- sending the NL80211_ATTR_WIPHY_DYN_ACK flag to mac80211 driver using netlink

Disabling it can be done by providing a valid fixed value.

To give an idea of a practical example:

In my usecase, we have mesh wifi device installed on ships/platforms.
Currently, the coverage class is set at 12000m fixed.

When a vessel moved closer (ex. 1500m), the measured link capacity was a lot
lower compared to setting the coverage class fixed to 1500m

Dynack completely solved this, nearly providing double the bandwidth at closer range
compared to the fixed setting of 12000m being used.

Also when a vessel sailed to a distance greater than the fixed setting,
communication was lost as the ACK's never arrived within the max allowed timeframe.

Actual distance: 6010m
iperf 60s run avg

Fixed 12150m:  31 Mbit/s
Dynack:        58 Mbit/s

Fixed 6300m:   51 Mbit/s
Dynack:        59 Mbit/s

Fixed 3000m:   13 Mbit/s  (lots of retries)
Dynack:        58 Mbit/s

Actual distance: 1504m
iperf 60s run avg

Fixed 12150m:  31 Mbit/s
Dynack:        86 Mbit/s

Fixed 6300m:   55 Mbit/s
Dynack:        87 Mbit/s

Fixed 3000m:   67 Mbit/s
Dynack:        87 Mbit/s

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agokernel: bcm47xxpart: fix getting user-space data partition name
Rafał Miłecki [Tue, 10 Jul 2018 12:02:00 +0000 (14:02 +0200)]
kernel: bcm47xxpart: fix getting user-space data partition name

Partition name is picked by a parser_trx_data_part_name(). It has to
get correct partition offset (taking care of bad blocks) to work
properly.

This fixes UBI support for devices that have kernel flashed on partition
with a bad block.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 7ddba08d873a0ce6d2d32b8f6a1bea550107ca44)

5 years agomac80211: initialize sinfo in cfg80211_get_station
Sven Eckelmann [Wed, 6 Jun 2018 09:21:53 +0000 (11:21 +0200)]
mac80211: initialize sinfo in cfg80211_get_station

Most of the implementations behind cfg80211_get_station will not initialize
sinfo to zero before manipulating it. For example, the member "filled",
which indicates the filled in parts of this struct, is often only modified
by enabling certain bits in the bitfield while keeping the remaining bits
in their original state. A caller without a preinitialized sinfo.filled can
then no longer decide which parts of sinfo were filled in by
cfg80211_get_station (or actually the underlying implementations).

cfg80211_get_station must therefore take care that sinfo is initialized to
zero. Otherwise, the caller may tries to read information which was not
filled in and which must therefore also be considered uninitialized. In
batadv_v_elp_get_throughput's case, an invalid "random" expected throughput
may be stored for this neighbor and thus the B.A.T.M.A.N V algorithm may
switch to non-optimal neighbors for certain destinations.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
(cherry picked from commit 87493dac11f3c7bbbc1fed9aef1cf9ff62053ab0)

5 years agoath10k-ct: search DT for BDF variant info
Sven Eckelmann [Thu, 30 Nov 2017 13:30:06 +0000 (14:30 +0100)]
ath10k-ct: search DT for BDF variant info

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 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@open-mesh.com>
(cherry picked from commit 1c01e02575bd2af96741ba79ed12004fdfb15544)

5 years agowireguard: bump to 0.0.20180625
Kevin Darbyshire-Bryant [Tue, 26 Jun 2018 18:28:34 +0000 (19:28 +0100)]
wireguard: bump to 0.0.20180625

dfd9827 version: bump snapshot
88729f0 wg-quick: android: prevent outgoing handshake packets from being dropped
1bb9daf compat: more robust ktime backport
68441fb global: use fast boottime instead of normal boottime
d0bd6dc global: use ktime boottime instead of jiffies
18822b8 tools: fix misspelling of strchrnul in comment
0f8718b manpages: eliminate whitespace at the end of the line
590c410 global: fix a few typos
bb76804 simd: add missing header
7e88174 poly1305: give linker the correct constant data section size
fd8dfd3 main: test poly1305 before chacha20poly1305
c754c59 receive: don't toggle bh

Compile-tested-for: ath79 Archer C7 v2
Run-tested-on: ath79 Archer C7 v2

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 3ce11588f6346ebedde68ef30a06e01999e292bb)

5 years agokmod-sched-cake: bump to latest 20180706
Kevin Darbyshire-Bryant [Sat, 7 Jul 2018 10:05:52 +0000 (11:05 +0100)]
kmod-sched-cake: bump to latest 20180706

Fixes a potential infinite loop bug when in unlimited (ie not using
built in shaper) mode.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 4bd4ece9eafbcde62d1e6efc4cf820f05906dd28)

5 years agokmod-sched-cake: bump to latest cake
Kevin Darbyshire-Bryant [Mon, 21 May 2018 19:29:41 +0000 (20:29 +0100)]
kmod-sched-cake: bump to latest cake

This bumps to the latest & possibly greatest cake, sadly it's still
inedible but from an SQM point of view quite tasty :-)

Main tweaks since previous bump, improved ack_filter, some extra stats,
support for 64bit netlink parameters (higher rates/byte counters)

0520a6c Fix NAT option handling
8da93e1 Make sure we always call qdisc_watchdog_init() in cake_init()
f65daf6 Fix mismatched parenthesis
51d4ab3 Change flag handling to be safe even when mixing with non-eligible ACKs
f2ea091 ack_filter: protect DCTCP with stricter filtering of ECE marks
28b4560 ACK filter: Handle wrapping sequence numbers and DSACKs
73f62d9 Use the right PAD attribute for options
5969c14 Use 32 for tin backlog
e289f31 Move all the u64 netlink attributes together
36180a0 Check ACK seqno before parsing SACKs
91bbc01 Merge branch 'mine' into cobalt
58c55ec Rework SACK check to compare the ranges of two SACKs
9a5d593 ack_filter: Add proper handling of SACKs
eca95d4 ack_filter: short-circuit TCP flag check
d50a246 compat: backport some ktime functions
7b7ad11 compat: define tcpopt_fastopen for pre-4.1 kernels
ca54cdb Fix ktime compare
9d7dcc0 ack filter: Parse TCP options and only drop safe ones
b119882 Return EOPNOTSUPP on NAT option if conntrack is not available
842d7f0 Don't try to pad stats with tin_stats padding
bd46dc2 Use 64-bit divide helper
8e41bf0 Make sure we never drop SACKs when filtering ACKs
66e5d60 Avoid comparing ktime_t to scalar values
7fab017 Actually commit the ktime_t changes
fca6d13 Switch to ktime_t and get rid of cobalt.h
6f7e5af Can't use do_div with 64-bit divisors

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit abeae38dbbe8b7fda10ad36fb5db57ed16c93479)

5 years agoiproute2: tc: update support for cake
Kevin Darbyshire-Bryant [Fri, 18 May 2018 19:57:44 +0000 (20:57 +0100)]
iproute2: tc: update support for cake

Bump iproute2/tc support of cake.

Add support for cake's change to u64 attribute passing for certain
attributes (rate & byte counts)

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit a2165f936e94ed71dff5fdbf0fbc58c88fb17158)

5 years agoipq806x: fix numbering for Netgear R7800 LAN ports
Aleksandr V. Piskunov [Sun, 1 Jul 2018 13:40:37 +0000 (16:40 +0300)]
ipq806x: fix numbering for Netgear R7800 LAN ports

Netgear R7800 switch LAN ports are numbered backwards in LuCI,
i.e. numbering is not corresponding to the actual physical port labels,
patch fixes that.

Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
[merged with existing board using the same config]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
5 years agolantiq: backport stp-xway get callback implementation
Mathias Kresin [Thu, 28 Jun 2018 18:28:19 +0000 (20:28 +0200)]
lantiq: backport stp-xway get callback implementation

To keep the status of a LED connected to the stp during boot, the get
callback is required. If the callback is missing and the LED default
state is set to keep in the devicetree, the gpio led driver errors out
during load.

Fixes: FS#1620
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years agobuild: fix target metadata scan dependencies
Felix Fietkau [Mon, 2 Jul 2018 12:23:19 +0000 (14:23 +0200)]
build: fix target metadata scan dependencies

Move SCAN_DEPS to scan.mk to eliminate redundancy with scripts/feeds
Add image/*.mk to SCAN_DEPS for targets to pick up newly added devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agobuild: ensure that iwinfo is selected when building for multiple devices
Felix Fietkau [Mon, 2 Jul 2018 12:19:42 +0000 (14:19 +0200)]
build: ensure that iwinfo is selected when building for multiple devices

extra_packages needs to be added there, like on profiles and target
packages lists

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agoramips: limit dictionary size for lzma compression
Felix Fietkau [Tue, 19 Jun 2018 08:06:50 +0000 (10:06 +0200)]
ramips: limit dictionary size for lzma compression

In some cases, recent builds fail to boot from flash with at least some
MT7621 based devices. The error message is:
"LZMA ERROR 1 - must RESET board to recover"
Booting the same kernel via TFTP works for some reason.

Through testing I figured out that limiting the LZMA dictionary size
seems to prevent these errors

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agokernel: bump 4.14 to 4.14.52 for 18.06
Stijn Segers [Fri, 29 Jun 2018 20:29:06 +0000 (22:29 +0200)]
kernel: bump 4.14 to 4.14.52 for 18.06

Compile-tested on: ramips/mt7621, x86/64.
Run-tested on: ramips/mt7621.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
5 years agokernel: bump 4.9 to 4.9.110 for 18.06
Stijn Segers [Fri, 29 Jun 2018 20:29:05 +0000 (22:29 +0200)]
kernel: bump 4.9 to 4.9.110 for 18.06

Compile-tested on ar71xx.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
5 years agoramips: move mt7620n i2c_pins definition to right place
Andrey Jr. Melnikov [Wed, 27 Jun 2018 17:32:23 +0000 (20:32 +0300)]
ramips: move mt7620n i2c_pins definition to right place

Move to i2c pins pinmux node to the pinctrl node.

Fixes: a0685deec458 ("ramips: Add i2c support for mt7620n")
Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
[fix commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years agoipq806x: remove "firmware" partition definition from netgear routers
Hannu Nyman [Wed, 27 Jun 2018 18:52:45 +0000 (21:52 +0300)]
ipq806x: remove "firmware" partition definition from netgear routers

Remove the "firmware" partition definition from the DTS of R7800
to fix sysupgrade.

Commit 4645a6d3 defined CONFIG_MTD_SPLIT_UIMAGE_FW=y for ipq806x
and that causes mtd to misbehave as additional kernel and ubi
partitions are detected from inside the "firmware" partition.
  [    1.111324] 0x000001480000-0x000001880000 : "kernel"
  [    1.121005] 0x000001880000-0x000007900000 : "ubi"
  [    1.283912] 0x000007900000-0x000008000000 : "reserve"
  [    1.296407] 0x000001480000-0x000007900000 : "firmware"
  [    1.468043] no rootfs found after FIT image in "firmware"
  [    2.426860] 2 uimage-fw partitions found on MTD device firmware
  [    2.426931] 0x000001480000-0x000001880000 : "kernel"
  [    2.440420] 0x000001880000-0x000007900000 : "ubi"

Both kernel and ubi are already defined in DTS, so this duplication
leads into errors in sysupgrade:
  Writing from <stdin> to kernel ...
  ubiattach: error!: strtoul: unable to parse the number '6 mtd10'
  ubiattach: error!: bad MTD device number: "6 mtd10"

The partition is defined to same area as kernel+ubi, and is not
needed for sysupgrade anymore. Remove it to fix things.

Only tested for the R7800 but all of them should behave equal.

Fixes: FS#1617
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
[squashed commits, add "tested on" note]
Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years agoipq806x: Enlarge R7800 flash - use netgear partition
Hannu Nyman [Sun, 3 Jun 2018 13:33:15 +0000 (16:33 +0300)]
ipq806x: Enlarge R7800 flash - use netgear partition

Increase the available flash memory size in Netgear R7800
by taking into the use the unused "netgear" partition
that is located after the firmware partition.

Available flash space for kernel+rootfs+overlay increases
by 68 MB from 32 MB to 100 MB.

In a typical build, overlay space increases from 15 to 85,
increasing the package installation possibilities greatly.

Reverting to the OEM firmware is still possible, as the OEM
firmware contains logic to initialise the "netgear" partition
if its contents do not match expectations. In OEM firmware,
"netgear" contains 6 UBI sub-partitions that are defined in
/etc/netgear.cfg and initialisation is done by /etc/preinit

Tested with Openwrt master r7093-4fdc6ca31b and OEM V1.0.2.52

Reference to forum discussion in Netgear R7800 exploration thread:
https://forum.lede-project.org/t/netgear-r7800-exploration-ipq8065-qca9984/285/1118
(messages 1118-1158)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
5 years agoramips: add switch port index for I-O DATA WN-GX300GR
INAGAKI Hiroshi [Wed, 27 Jun 2018 05:51:25 +0000 (14:51 +0900)]
ramips: add switch port index for I-O DATA WN-GX300GR

WN-GX300GR has 5x RJ45 ports (port 0-4), and these ports are
orderd on the device as follows:
4 3 2 1 0

1-4: lan
0: wan

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years agouboot-kirkwood: fix malformed boot configuration
Alberto Bursi [Tue, 26 Jun 2018 19:48:09 +0000 (21:48 +0200)]
uboot-kirkwood: fix malformed boot configuration

With current uboot default configuration the bootloader will
fail to start the OpenWrt firmware with the following error:
-----
unexpected character 'b' at the end of partition
Error initializing mtdparts!
incorrect device type in ubi
Partition ubi not found!
Error, no UBI device/partition selected!
Wrong Image Format for bootm command
Error occured, error code = 112
-----

If the uboot configuration is examined with printenv
I can see that mdtparts line (on a nsa310) is wrong:
-----
mtdparts=mtdparts=orion_nand:0x0c0000(uboot),
0x80000(uboot_env),0x7ec0000(ubi)bootargs_root=
----

The "bootargs_root=" that was appended to it should not be there.

Fix the issue by adding a \0 line terminator at the end of affected lines,
mimicking what is also done by uboot upstream.

This issue was detected and confirmed on a nsa310, nsa325 and
a pogoplug v4, but it's not hardware-specific, so apply the same fix
to other devices as well.

Note that the issue is with the uboot's integrated boot configuration,
which is not used unless the uboot configuration in flash is unavailable
(erased or corrupted), which happens only on first time installation,
or if the user deletes the uboot configuration when upgrading uboot.
People just upgrading from an older uboot without erasing their previous
uboot configuration stored in flash would not have noticed this issue.

Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
5 years agomac80211: make rtl8xxxu build again
John Crispin [Tue, 26 Jun 2018 14:00:33 +0000 (16:00 +0200)]
mac80211: make rtl8xxxu build again

we only wanted to drop rtl8xxxue support

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit d8981133b27e7deebc79dc5fc51beb06b3b0a221)

5 years agomac80211: rtl8xxxu: drop support patches
John Crispin [Tue, 26 Jun 2018 13:39:38 +0000 (15:39 +0200)]
mac80211: rtl8xxxu: drop support patches

After a very enlightening but unfortunately far too short exchange with Jes
we mutually agreed to drop the patches. They are unfortunately not ready
yet.

Acked-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 66c5696cdf9599ccef652a651f52c0f7f53da44a)

5 years agobase-files: fix links in banner.failsafe
Sven Roederer [Tue, 12 Jun 2018 20:48:39 +0000 (22:48 +0200)]
base-files: fix links in banner.failsafe

Update the link to the current section in the documentaion wiki.
This fixes https://github.com/openwrt/packages/issues/6282

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
5 years agomusl: sys/socket.h: fix SO_PEERSEC value on MIPS
Matthias Schiffer [Sun, 24 Jun 2018 15:20:43 +0000 (17:20 +0200)]
musl: sys/socket.h: fix SO_PEERSEC value on MIPS

Differing from all other archs supported by musl, MIPS defines SO_PEERSEC
to 30 instead of 31.

Patch has also been submitted upstream.

Reported-by: Andrey Jr. Mlenikov <temnota.am@gmail.com>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 4b50854a60fce73aa83b50c445ea93970322d442)

5 years agoar71xx: Add support for TP-Link CPE210 v2
Adrian Schmutzler [Fri, 19 Jan 2018 13:45:42 +0000 (14:45 +0100)]
ar71xx: Add support for TP-Link CPE210 v2

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

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

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

Notes:
TP-Link does not use bootstrap registers so without this patch reference
clock detects as 40MHz while it is actually 25MHz.
This is due to messed up bootstrap resistor configuration on the PCB.
Provided GPL code just forces 25MHz reference clock.
That causes booting with completely wrong clocks, for example, CPU tries
to boot at 1040MHz while the stock is 650MHz.
So this PR depends on PR #672 to remove 40MHz reference clock.
Thanks to Sven Eckelmann <sven@narfation.org> for properly patching that.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 5c5bf8b8658a588423f6ec445d7ef6a36f99a396)

5 years agoar71xx: Add TP-Link Pharos v2 board detection
Adrian Schmutzler [Fri, 19 Jan 2018 11:58:40 +0000 (12:58 +0100)]
ar71xx: Add TP-Link Pharos v2 board detection

Add support for detecting TP-Link Pharos v2 boards.
They use different format in product-info partition than v1 boards.

Code was written mostly by Alexander Couzens <lynxis@fe80.eu>

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 2524febf7927a1bf430d64b7790feb126023e3d1)

5 years agomac80211: backport brcmfmac changes from kernel 4.18
Rafał Miłecki [Mon, 18 Jun 2018 05:32:34 +0000 (07:32 +0200)]
mac80211: backport brcmfmac changes from kernel 4.18

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit c446e38c862201dd4d6a4fb8ea6e49172980952d)

5 years agomac80211: backport brcmfmac firmware & clm_blob loading rework
Rafał Miłecki [Mon, 18 Jun 2018 05:09:14 +0000 (07:09 +0200)]
mac80211: backport brcmfmac firmware & clm_blob loading rework

It backports remaining brcmfmac changes from 4.17.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 7e8eb7f309a802ba10a13ddb807c6a31fecc9183)

5 years agomac80211: backport brcmfmac data structure rework
Rafał Miłecki [Sun, 17 Jun 2018 20:46:35 +0000 (22:46 +0200)]
mac80211: backport brcmfmac data structure rework

It backports brcmfmac commits from kernel 4.17.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 3c8bb92655c68a07abf5358ef23eb98422ed8d6d)

5 years agomac80211: backport "brcmfmac: cleanup and some rework" from 4.17
Rafał Miłecki [Sun, 17 Jun 2018 20:46:29 +0000 (22:46 +0200)]
mac80211: backport "brcmfmac: cleanup and some rework" from 4.17

It was described by Arend as:

> This series is intended for 4.17 and includes following:
>
>  * rework bus layer attach code.
>  * remove duplicate variable declaration.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 0da9303e5b444e2c98c24719c48c09f4c976c5a7)

5 years agobcm53xx: fix NAND partitions on D-Link DIR-885L
Rafał Miłecki [Sun, 17 Jun 2018 20:39:20 +0000 (22:39 +0200)]
bcm53xx: fix NAND partitions on D-Link DIR-885L

This fixes missing rootfs on above device:
[    2.652292] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
(...)
[    2.687909] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

Fixes: 05cb6aa69f66 ("bcm53xx: replace linux,part-probe with a proper partitions subnode")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit e53d0da775082ee5d1d18949b00850590cf81650)

5 years agobuild: change version.mk defaults to OpenWrt
Jo-Philipp Wich [Fri, 22 Jun 2018 11:45:03 +0000 (13:45 +0200)]
build: change version.mk defaults to OpenWrt

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 333e609703ff40a272b8f8832a8af682826fb572)

5 years agoOpenWrt v18.06.0-rc1: revert to branch defaults
Jo-Philipp Wich [Fri, 22 Jun 2018 10:30:02 +0000 (12:30 +0200)]
OpenWrt v18.06.0-rc1: revert to branch defaults

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoOpenWrt v18.06.0-rc1: adjust config defaults v18.06.0-rc1
Jo-Philipp Wich [Fri, 22 Jun 2018 10:30:02 +0000 (12:30 +0200)]
OpenWrt v18.06.0-rc1: adjust config defaults

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoRevert "LEDE v18.06.0-rc1: adjust config defaults"
Jo-Philipp Wich [Fri, 22 Jun 2018 10:22:30 +0000 (12:22 +0200)]
Revert "LEDE v18.06.0-rc1: adjust config defaults"

This reverts commit 97b1765a45499ecc56db44f79453d3c6040bb5e7.
The tree is in an inconsistent state and we need to complete some rebranding.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoRevert "LEDE v18.06.0-rc1: revert to branch defaults"
Jo-Philipp Wich [Fri, 22 Jun 2018 10:21:46 +0000 (12:21 +0200)]
Revert "LEDE v18.06.0-rc1: revert to branch defaults"

This reverts commit 55df39e684f8fde90c52212350062440dc6c9754.
The tree is in an inconsistent state and we need to complete some rebranding.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoLEDE v18.06.0-rc1: revert to branch defaults
Jo-Philipp Wich [Fri, 22 Jun 2018 10:12:13 +0000 (12:12 +0200)]
LEDE v18.06.0-rc1: revert to branch defaults

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoLEDE v18.06.0-rc1: adjust config defaults
Jo-Philipp Wich [Fri, 22 Jun 2018 10:12:09 +0000 (12:12 +0200)]
LEDE v18.06.0-rc1: adjust config defaults

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoiptables: set nonshared flag
John Crispin [Fri, 22 Jun 2018 09:46:21 +0000 (11:46 +0200)]
iptables: set nonshared flag

this makes sure that offloading support is properly included for v4.14 targets.

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit ebe1216c7cd10357c3277fb25bae4e508d4b165a)

5 years agokernel: cleanup offload hooks on netdev unregister
Chen Minqiang [Sun, 29 Apr 2018 06:15:59 +0000 (14:15 +0800)]
kernel: cleanup offload hooks on netdev unregister

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
(cherry picked from commit e317bb06fdfb46cf0c6496e3db4eb020ea28b656)

5 years agomac80211: fix up ath10k led patch
John Crispin [Fri, 22 Jun 2018 08:51:22 +0000 (10:51 +0200)]
mac80211: fix up ath10k led patch

Signed-off-by: John Crispin <john@phrozen.org>
5 years agomac80211: drop 355-ath9k-limit-retries-for-powersave-response-frames.patch
John Crispin [Fri, 22 Jun 2018 07:43:56 +0000 (09:43 +0200)]
mac80211: drop 355-ath9k-limit-retries-for-powersave-response-frames.patch

several people reported this bug to be causing drop out issues

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit cac1a4be66f548735878beccc10dc4b1ec7ad364)

5 years agomac80211: ath10k fix vht160 firmware crash
Ansuel Smith [Sun, 17 Jun 2018 20:35:42 +0000 (22:35 +0200)]
mac80211: ath10k fix vht160 firmware crash

When the 160mhz width is selected the ath10k firmware crash. This fix this problem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 134e832814f1986c7ee06ac00806ebb6e762fd15)

5 years agomac80211: ath10k add leds support
Ansuel Smith [Sun, 17 Jun 2018 20:36:46 +0000 (22:36 +0200)]
mac80211: ath10k add leds support

This adds support for leds handled by the wireless chipset.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 61d57a2f88b90ba951012e66c7c6fae9234c97b4)

5 years agowwan: Add support for Gemalto Cinterion cellular modules
David Thornley [Fri, 22 Jun 2018 06:25:22 +0000 (16:25 +1000)]
wwan: Add support for Gemalto Cinterion cellular modules

Includes specific support for PH8(1e2d-0053) / ELS61(1e2d-005b) modules.

Note for ELS61, the serial driver changes from serial option(ttyUSB) to usb-cdc (ttyACM).

Two additional fixes in this commit resolve issues with ttyACM devices: -

* wwan.sh - sys-fs has a subdirectory indirection (*/tty/ttyACMx) which was not handled properly
* wwan.usb - dependent scripts were not included, so this never actually called proto_set_available for example (and relied on inadvertent call for ttyUSB case)

Signed-off-by: David Thornley <david.thornley@touchstargroup.com>
(cherry picked from commit cb262b09396edd171eb3903e50ce5ddeb593f963)

5 years agobusybox: udhcpc: replace udhcpc_no_msg_dontroute patch by upstream fix
Hans Dedecker [Thu, 21 Jun 2018 20:26:18 +0000 (22:26 +0200)]
busybox: udhcpc: replace udhcpc_no_msg_dontroute patch by upstream fix

Replace 204-udhcpc_no_msg_dontroute patch by the upstream busybox fix
which removes the code which requires the server ID to be on local
network

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agokernel: backport fix for missing tunnel encapsulation limit option
Hans Dedecker [Thu, 21 Jun 2018 20:09:12 +0000 (22:09 +0200)]
kernel: backport fix for missing tunnel encapsulation limit option

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years agolantiq: fix arcadyan vg3503j switch port indexing
Mathias Kresin [Thu, 21 Jun 2018 18:45:53 +0000 (20:45 +0200)]
lantiq: fix arcadyan vg3503j switch port indexing

Both version of the vg3503j have the LAN1 labelled port connected to
switch port 4 and the LAN2 labelled port connected to switch port 2.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years agoramips: Add support for Phicomm K2G
Chuanhong Guo [Wed, 20 Jun 2018 16:56:38 +0000 (00:56 +0800)]
ramips: Add support for Phicomm K2G

Specification:
- SoC: MediaTek MT7620A
- Flash: 8 MB
- RAM: 64 MB
- Ethernet: 4 FE ports and 1 GE port (RTL8211F on port 5)
- Wireless radio: MT7620 for 2.4G and MT7612E for 5G, both equipped with external PA.
- UART: 1 x UART on PCB - 57600 8N1

Flash instruction:
The U-boot is based on Ralink SDK so we can flash the firmware using UART:
1. Configure PC with a static IP address and setup an TFTP server.
2. Put the firmware into the tftp directory.
3. Connect the UART line as described on the PCB.
4. Power up the device and press 2, follow the instruction to
   set device and tftp server IP address and input the firmware
   file name. U-boot will then load the firmware and write it into
   the flash.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
5 years agoRevert "base-files: fix UCI config parsing and callback handling"
Hans Dedecker [Thu, 21 Jun 2018 19:40:48 +0000 (21:40 +0200)]
Revert "base-files: fix UCI config parsing and callback handling"

This reverts commit 023944853241920c20842c0f4649d1dd4e7e273b as users
report Qos scripts are broken (FS#1602)

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