All of the mux kmods depend on CONFIG_MULTIPLEXER being set, however its
currently tristate but with no user visible name so its not selectable by
passing it .config.
It can only be selected by other symbols, so when you select for example
GPIO mux kmod in reality nothing is built unless your target already
selects CONFIG_MULTIPLEXER by accident or ALL_KMODS is used.
So, as a workaround since it still works fine as tristate, simply add a
patch that makes it visible and thus user selectable.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
This patch is meant for platforms without OF and only for ARM SoCs. All
ARM stuff has OF. Removes warnings like:
b53-srab-switch b53-srab-switch: error -EINVAL: invalid resource (null)
b53-srab-switch b53-srab-switch: probe with driver b53-srab-switch failed with error -22
On platforms using b53.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25420
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The Quectel EG120K-EA (LTE Cat.12) reports USB ID 2c7c:030b and exposes
its QMI/RMNET function on a vendor-specific ff/ff/ff interface. The same
product ID is already known to the option driver as EM060K, which claims
the serial interfaces, but without a qmi_wwan entry the data interface is
left unbound and no cdc-wdm node appears.
Add the device using QMI_MATCH_FF_FF_FF so the DTR quirk is applied.
Tested on a GL.iNet GL-X2000, where the modem enumerates at SuperSpeed and
now brings up cdc-wdm0 and wwan0. A data session over MEO (268-06) was
verified end to end.
Accepted upstream via netdev/net, so this is carried as a backport and can
be dropped once the kernel is bumped to 7.3 or later. Inserting it ahead of
the MeigLink hack shifts that patch's offsets, so
780-usb-net-MeigLink_modem_support.patch is refreshed as well.
Link: https://patch.msgid.link/20260921093426.2870266-1-gilbertorconde@gmail.com
Signed-off-by: Gilberto Conde <gilbertorconde@gmail.com>
Both drivers implement the phylink tx_lpi methods but never fill
phylink_config.lpi_interfaces, so phylink decides at creation time
that the MAC does not support EEE and locks userspace out of enabling
it. On mt753x that has been the state since the conversion to phylink
managed EEE; on mtk_eth_soc since EEE was added there, which was
already in managed form.
Both fixes are in net:
https://git.kernel.org/netdev/net/c/3c18e3c9a54ehttps://git.kernel.org/netdev/net/c/d876c9cb2d16
The mtk_eth_soc fix is taken as upstream applied it. The mt7530 one is
adapted: upstream guards the block with an extra priv->id != ID_EN7528
arm, and that symbol only exists once econet's local EN7528 patch adds
it, so the generic backport drops the arm and the patch header records
that. The mtk_eth_soc fix lands ahead of three patches that touch the
same part of mtk_add_mac and the same capability enum, so 737-10,
795-05 and the mt7987 platform patch are refreshed for it; 795-05 also
loses a declaration hunk that this fix makes redundant. Seven more
mtk_eth_soc patches (702, hack 730, 732-00, 732-03, 737-09, 738-01 and
795-04) are refreshed for hunk offsets only.
The mtk_eth_soc fix fills lpi_interfaces only on SoCs carrying a new
MTK_GMAC_EEE capability, and only MT7981 sets it: the LPI wake-up times
the driver programs are borrowed from MT7531 and have been measured on
MT7981 alone, so the other SoCs keep EEE unreachable until someone
confirms them.
The econet EN7528 patch is rebased on top of the mt7530 fix: both
rewrite the same block in mt753x_phylink_get_caps(), and generic
applies first, so the EN7528 guard now sits on the reworked condition.
The behavior for EN7528 is unchanged: its LPI capabilities stay empty
and phylink keeps EEE disabled there.
Tested on an MT7981B board with an MT7531 switch: ethtool sees EEE on
every port where it saw nothing before, enabling it negotiates EEE
against a partner that advertises it, and a port whose partner does
not advertise settles at "enabled - inactive".
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/24863
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The Quectel EG060W (Cat 6 LTE) modem, as used by the Cudy LT700 Outdoor,
exposes its DIAG, NMEA and AT command interfaces as vendor-specific
(ff/00/00) under product ID 0x6004. Without a matching entry the option
driver does not bind these interfaces, so no /dev/ttyUSB* ports are
created and the modem cannot be configured.
Backport the upstream commit adding the 0x6004 product ID. The CDC-NCM
data interfaces use a standard class and are not affected.
Also refresh hack-6.18/780-usb-net-MeigLink_modem_support.patch, whose
option.c hunks are applied after this change and shift by one line.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/24689
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Since 6.18.45 backported b5964aac51e0 ("netfilter: flowtable: consolidate
xmit path"), FLOW_OFFLOAD_XMIT_NEIGH looks the output device up by
route->tuple[dir].out.ifindex instead of transmitting on the dst device.
Our copy of the route setup sets that field only for
FLOW_OFFLOAD_XMIT_DIRECT and only discovers the forward path when both
directions are FLOW_OFFLOAD_XMIT_NEIGH, so a flow with an undiscoverable
path, a non-ethernet egress or an xfrm dst in one direction gets an
ifindex of 0: every packet is dropped, the flow is torn down and
offloaded again.
Set the ifindex for every xmit type and look each direction up on its
own, as upstream does in the nftables path (b5964aac51e0 and 2bdc536c9da7
"netfilter: always set route tuple out ifindex"), and fall back to the
dst device where upstream leaves the ifindex at 0, so those flows stay
offloaded.
Fixes: da5c83ece675 ("kernel: bump 6.18 to 6.18.45")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/24800
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport upstream commit a3729e0df005 ("net/sched: sch_cake: skip
clearing unused tins during rate adjustment"), which landed in v7.2.
cake_configure_rates() is called from the dequeue path with
rate_adjust=true, where cake_clear_tin() overwrites q->cur_tin and
q->cur_flow while cake_dequeue() is using them, and purging the unused
tins adds overhead to the hot path. Skipping the loop restores loaded
latency to pre-15c2715a5264 levels; on IPQ8074A in besteffort mode the
loaded latency drops from ~470 ms to ~4 ms in Flent's tcp_nup test.
Refresh the sync_time debugfs hack patch, whose hunks shift by two
lines.
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Link: https://github.com/openwrt/openwrt/pull/25182
Signed-off-by: Robert Marko <robimarko@gmail.com>
RTL8221B unfortunately suffers from a issue where reading registers from
MMD 30 can break the PHY. Once it is in the broken state, recovery is
only possible by hardware reset.
Add a hack which prevents the kernel from reading MMD 30 while probing
for PHYs when a RTL8221B is detected, based on the ID from MMD 1.
Fixes: https://github.com/openwrt/openwrt/issues/22140
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/25017
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The GPIO direction was configured via the gpiod flags passed to
devm_fwnode_gpiod_get_index(), i.e. at request time. Restore the prior
behavior of requesting the GPIO as-is (GPIOD_ASIS) and setting the
direction afterwards with gpiod_direction_output_raw() /
gpiod_direction_input().
Note this deliberately does not restore the old skip-and-continue error
handling: before 0ca7895 a failing request or direction setup was skipped
with continue, leaving that GPIO unexported while the rest of the board
still came up. Direction setup failures now abort the probe, consistent
with the request failure handling introduced by 0ca7895. gpiod flags are
also not used for the direction since legacy gpio_request_one() applied
the initial output value raw (ignoring active-low), which
gpiod_direction_output_raw() matches.
Fixes: 0ca7895173 ("kernel: use fwnode for GPIO export driver")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24832
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
DSA copies the driver features to slave device, including offload
capabilities. Once a packet is sent through a DSA slave interface,
according to its features, the kernel does not calculate checksums,
expecting that the HW will fill the gaps. DSA adds the defined DSA
tag and sends the tagged packet through the master device.
Ethertype DSA tags expect the driver to calculate checksum based on the
csum_start/csum_offset. However, mtk_eth_soc does not use that info.
mtk_eth_soc checks the network header and decides if the HW can manage
that packet, unaware that MAC layer now contains an extra DSA tag. When
that tag is the Mediatek CPU tag, offload will work as expected.
When it is an incompatible DSA tag or if DSA is stacking two incompatible
DSA tags, the driver will still count on the HW offload. In this case,
packets are sent to the network with an incorrect checksum.
This patch adds an extra check that disables offloading only for the
RTL8367S switch's RTL8_4 tag, which is known to break MTK checksum
offload. The RTL8_4T (the trailing-tag variant) is not affected because
its rtl8_4t tagger already checksums the frame in software before appending
the tag, so ip_summed is no longer CHECKSUM_PARTIAL by the time this driver
sees it.
This approach avoids an overly conservative whitelist which would
disable offload for every non-Mediatek tag, regardless of whether
that tag is actually incompatible with MTK checksum offload.
Tags for other DSA-capable switches are left untouched by this fix
and are not claimed to be offload-safe.
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Schneider Azima <Schneider-Azima12@protonmail.com>
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/23996
Signed-off-by: Robert Marko <robimarko@gmail.com>
strlcat takes the total buffer size, not the remaining space.
Passing strlen(cmdline) + l caused it to truncate by one byte
when the appended string fit within the buffer.
This is also more consistent with the rest of the file.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23892
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
LED trigger for network interfaces.
- Aggregated per-family (lan/wan/wlan).
- Family and flags are taken from device tree properties:
- "family" : simple family string "lan" | "wan" | "wlan"
- "mode" : any combination of "link", "tx", "rx" flags
Priority/combination:
* If "mode" present: flags come from "mode" and take precedence.
Family is taken from "family" if present, otherwise from the LED name.
* If only "family" present: use its family and default flags = link+tx+rx.
* If neither present: fall back to LED device name parsing.
- Suffix "-online" is valid ONLY in the LED name (label),
e.g. "green:wlan-online". It indicates the online variant but is applied
only when DT "mode" is absent.
Behaviour:
- wlan (normal): blink/solid driven by throughput table
- lan/wan (normal): one-shot blink on TX/RX packet change
- *-online variants: steady ON while any interface of the family has carrier
Interfaces are auto-tracked by name match (lan0, wan1, wlan2, phy0, wl1,
ath0, ra0...). Up to MAX_IFACES (16) interfaces per family
This trigger is intended for board/device authors and drivers to provide simple
network-activity LED behaviour without per-interface wiring in userspace.
Refresh bcm27xx patches in the same commit to account for line shifts in
drivers/leds/trigger/Kconfig and Makefile, ensuring clean applies for
bisectability.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/19903
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add a pending patch to fix the WED flow timeout.
OpenWrt has recently migrated many platforms to kernel 6.18. On the
MediaTek platform, which supports hardware network offloading, WiFi
connections accelerated via the WED path were observed to drop after
roughly 300 seconds.
After several debugging sessions, assisted by the Claude LLM, the
problem was narrowed down as follows:
nf_flow_table_extend_ct_timeout() extends ct->timeout for offloaded
flows using:
cmpxchg(&ct->timeout, expires, new_timeout);
'expires' comes from nf_ct_expires(ct) and is a relative value, while
ct->timeout holds an absolute timestamp. The two are never equal, so
the cmpxchg always fails and the timeout is never extended.
This goes unnoticed for most flows, but a long-lived hardware (WED)
offloaded flow on MediaTek MT7986 eventually has ct->timeout decay to
zero, the conntrack entry is reaped and the connection breaks.
Open-code the relative value from a single READ_ONCE(ct->timeout)
snapshot and compare against that same absolute snapshot in the
cmpxchg, so the timeout extension actually takes effect while the
datapath remains authoritative if it updates ct->timeout concurrently.
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23611
Signed-off-by: Robert Marko <robimarko@gmail.com>
Kernel ae18b94099b0 (2025-08-20, in 6.18) introduced a dependency on the
Linux-specific O_LARGEFILE, and kernel 97169cd6d95b (2025-08-20, in
6.18) introduced a dependency on the Linux-specific copy_file_range.
Both of these commits were a part of the
https://lore.kernel.org/all/20250819032607.28727-1-ddiss@suse.de/
series. These new dependencies may not be available on non-Linux
systems, although it is possible to cross-build Linux on non-Linux build
hosts, and it is appropriate to run tools like gen_init_cpio on such
build hosts. It is straightforward to avoid these Linux-specific
features when not building on Linux.
This fixes:
HOSTCC usr/gen_init_cpio
usr/gen_init_cpio.c:460:16: error: call to undeclared
function 'copy_file_range'; ISO C99 and later do not support implicit
function declarations [-Wimplicit-function-declaration]
460 | this_read = copy_file_range(file, NULL, outfd, N...
| ^
usr/gen_init_cpio.c:677:31: error: use of undeclared
identifier 'O_LARGEFILE'
677 | O_WRONLY | O_CREAT | O_LARGEFILE | O_TRUNC,
| ^~~~~~~~~~~
2 errors generated.
gmake[7]: *** [scripts/Makefile.host:114: usr/gen_init_cpio] Error 1
Signed-off-by: Mark Mentovai <mark@mentovai.com>
Link: https://github.com/openwrt/openwrt/pull/23612
Signed-off-by: Robert Marko <robimarko@gmail.com>
Since kernel 5a406031d0719 (2025-03-17, in 6.15), objtool calls
sendfile, but sendfile is Linux-specific and a sendfile with the
requisite capabilities is not available on other operating systems.
Provide a more portable fallback implementation to be used when
cross-building on non-Linux hosts.
This fixes:
CC …/linux-6.18.33/tools/objtool/builtin-check.o
builtin-check.c:13:10: fatal error: 'sys/sendfile.h' file
not found
13 | #include <sys/sendfile.h>
| ^~~~~~~~~~~~~~~~
1 error generated.
gmake[8]: *** […/linux-6.18.33/tools/build/Makefile.build:86: …/linux-6.18.33/tools/objtool/builtin-check.o] Error 1
Fixes: https://github.com/openwrt/openwrt/issues/23356
Signed-off-by: Mark Mentovai <mark@mentovai.com>
Link: https://github.com/openwrt/openwrt/pull/23612
Signed-off-by: Robert Marko <robimarko@gmail.com>
Now that the upstream RealTek PHY driver is patched to support also
the new 5G and 10G PHYs we can start to phase-out the messy downstream
driver.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add patches to improve support for using 3rd-party DSA switches
like MaxLinear MxL862xx with MediaTek's mtk_eth_soc being the
conduit. This involves reorganizing hardware queues to avoid
overlap (currently dp->index is used -- if there is more than one
DSA switch this is problematic), and correctly programming flows
of the non-MTK DSA users ports in the PPE offloading engine.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Backport support for the RTL8157. The RTL8157 is a low-cost chipset
designed for USB to 5Gb Ethernet adapters.
Tested on Sabrent NT-C5GA (RTL8157), Wavlink WL-NWU340G (RTL8157) and
UGREEN CM648 (RTL8156BG) adapters.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/23088
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Motorcomm YT6801 is a PCIe ethernet controller based on DWMAC4 IP. It
integrates an GbE phy, supporting WOL, VLAN tagging and various types
of offloading. It ships an on-chip eFuse for storing various vendor
configuration, including MAC address.
The PM and plat_data functions were slightly modified to build with
current kernel.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/22923
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Import pending series introducing support for standalone PCS drivers.
This has previously already been used by the airoha target, and is
also the base for the closer-to-upstream patches for MediaTek MT7988
10G SerDes support.
In order to not having to diverge from upstream also backport series
for standardized handling for PHY and PCS SerDes pair polarity.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Daniel Pawlik figured out that a stale patch hunk breaks one of the
two 10G SerDes PCS ports of MT7988. Remove the hunk to make 10G
Ethernet work on both SerDes PCS with Linux 6.18.
Testing was done using a Aquantia AQR113C SFP+ module.
Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Our downstream patch for the new SerDes paths on MT7988 wasn't
correctly ported to Linux 6.18 which already got most of the XPCS
support upstream.
Fix (ie. reduce) the patch to make the built-in 2.5G PHY on MT7988 and
MT7987 work again.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add missing patch description, so all generic patches can be applied
to a kernel tree using 'git am'.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This patch enables for the configuration of the sync_time parameter.
The value of the sync_time needs to be specified in nanoseconds.
The default value is 200us (200 000 ns).
This is especially helpful to get feedback from users about suitable
values. Once a solid solution is found this patch can be removed.
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Link: https://github.com/openwrt/openwrt/pull/22380
[Add patch to kernel 6.18 too]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>