Add everything that's needed to have a standalone setup of the XSGMII
mode without having to rely on previous U-boot setup. This includes
patch sequences for the SerDes and extensions of symbol error reset and
reading.
Jonas Jelonek [Mon, 26 Jan 2026 23:20:26 +0000 (23:20 +0000)]
realtek: pcs: rtl93xx: handle XSGMII autoneg
The XSGMII mode is special in several regards. The inband
autonegotiation for this mode is called 'XSG N-way'. It is controlled
using different bits and location, and using XSG operations.
Add support for this by enhancing the set_autoneg implementation shared
by RTL930x and RTL931x. This can stay shared since it works the same for
both variants.
Jonas Jelonek [Mon, 26 Jan 2026 22:57:10 +0000 (22:57 +0000)]
realtek: pcs: make set_autoneg a SerDes operation
Instead of having all kinds of SerDes-related operations in the global
pcs config structure, there's now a SerDes ops structure which is
intended to cover and separate this.
Move the set_autoneg hook to the SerDes ops to adhere to this desired
separation. Calling the operation is further encapsulated with a small
convenience helper.
Anton Danilov [Thu, 29 Jan 2026 11:43:17 +0000 (14:43 +0300)]
mediatek: add Motorcomm PHY support to Cudy AP3000 v1
Newer Cudy AP3000 v1 routers feature a Motorcomm YT8821 PHY
instead of the Realtek PHY [1]. Support for the YT8821
was recently introduced for the Cudy WR3000H router [2].
On the AP3000, the changes allow the PHY to be autodetected.
Shiji Yang [Wed, 28 Jan 2026 15:15:30 +0000 (23:15 +0800)]
kernel: mtd: limit Macronix lock feature to MX25L6405D only
Though most Macronix Flash support the lock feature, the generic lock
implementation is not fully compatible with the Macronix series Flash.
Enabling the lock feature globally is unsafe. These hack patches are
used to unlock the Flash of ubnt devices on the ath79 target. Rework
these patches and move it to the ath79 target to prevent the potential
risk.
Rongzeng Cai [Sat, 31 Jan 2026 12:46:42 +0000 (13:46 +0100)]
kernel: mtd: spinand: add support for SkyHigh S35ML-3
This introduces support for the SkyHigh S35ML-3 series SPI NAND flash
devices by importing two key patches:
- 430-v6.14-mtd-spinand-Introduce-a-way-to-avoid-raw-access.patch
- 431-v6.14-mtd-spinand-Add-support-for-SkyHigh-S35ML-3-family.patch
Linus Walleij [Mon, 26 Jan 2026 07:21:29 +0000 (08:21 +0100)]
gemini: override IB-4220-B partitions for firmware
To optimize the flash usage and to make firmware upgrades
simpler, catenate the three firmware partitions "Kern",
"Ramdisk" and "Application" into one, and use all of this
for the combined MTD-splitted kernel+rootfs.
This works fine as long as the kernel is placed in the
beginning of this firmware partition and we leave the
RedBoot partition as is, so the boot loader still can load
the kernel from the first two RedBoot partitions.
Using the RedBoot partitions "as is" can be considered
harmful, because when you flash to a RedBoot partition the
file size is used for downsizing of the partition and make
firmware upgrades fail if they are larger than the RedBoot
partition size after flashing, despite there is actually
flash there. So overriding with fixed partitions is just
generally a good idea.
The problem is the following: we have three fixed partitions
in a RedBoot partition for kernel, initrd and rootfs. On the
surface this looks good.
But we have little flash and want to use it efficiently. We want
to use the OpenWrt "firmware" partition scheme where the kernel,
initramfs and sqashfs+jffs2 rootfs is appended, leaving maximum
space for a writeable rootfs.
To do this we will override the existing RedBoot partition table
with one that merges the three separate partitions into one
"firmware" partition.
RedBoot is still booting the system. It still needs to read the
first two parts "as if" these were the kernel and initrd. This
works fine, because the kernel still comes first.
We already have hacks in place to merge the two kernel and initrd
into one binary image and execute it. This is done by prepending
a "prolog" to the kernel that does the necessary copying in
memory and then jumps to execute the kernel.
Since this "prolog" copying routine is just 92 bytes but has 512
bytes allocated, we can trivially create a firmware format that
can be used for splitting the image into kernel and rootfs
using a tagging scheme that can be done directly by scripting
so we don't need any special binary programs.
This splitter implements that idea.
This will be used on the Gemini platform and was tested on the
Raidsonic IB-4220-B.
Also fix an issue when joining peer IPv4 and IPv6 AllowedIPs
(${peer_a_ips/ /, } replaces only the first space, while
${peer_a_ips// /, } replaces all the spaces).
Closes: https://github.com/openwrt/openwrt/issues/21847 Signed-off-by: Paul Donald <newtwen+github@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21851 Signed-off-by: Robert Marko <robimarko@gmail.com>
realtek: eth: define hardware receive rings in config
Do not derive the number of hardware receive rings from the SoC
family. Instead add the information to the configuration
structure. Make use of it during ethernet driver probing.
Jonas Jelonek [Mon, 2 Feb 2026 19:31:11 +0000 (19:31 +0000)]
realtek: eth: rtl931x: reduce logging of special packet trap
For packets trapped to the CPU for a special reason (not normal
forward), the RTL931x tag decoding always print a log message with level
INFO. This is not needed and just spams the log, e.g. when LLDP packets
are running through the network, each of them causes a log message.
Make that a debug message instead of an info message. We can keep it,
just change when it's printed.
Felix Fietkau [Mon, 2 Feb 2026 17:15:41 +0000 (17:15 +0000)]
hostapd: add status ubus method
Add a status method to both hostapd and wpa_supplicant ubus objects
that lists all configured interfaces with their wiphy, MAC address,
and running/pending state. For MLO interfaces, links are grouped
under a single entry with per-link status.
Drop legacy sw_xxx() macros for RTL931x devices. While we are here
reorganize the access and avoid masked access where possible. So the
code is easier to read.
Drop legacy sw_xxx() macros for RTL930x devices. While we are here
reorganize the access and avoid masked access where possible. So the
code is easier to read.
Drop legacy sw_xxx() macros for RTL839x devices. While we are here
reorganize the access and avoid masked access where possible. So the
code is easier to read.
Hannu Nyman [Sun, 1 Feb 2026 16:28:57 +0000 (18:28 +0200)]
netifd: ensure netifd_loglevel default value as fallback
Commit 168d5af added the possibility to configure netifd logging level.
The option is read from /etc/config/network and validated.
Supposedly the validation sets 2 as default.
But in case of a syntax error in /etc/config/network, the validation
result can be empty. Then the always passed option to netifd is
just '-l' instead of '-l 2'. That crashes netifd and prevents network
from launching.
Add a fallback value to the variable, so that there will always be
a proper value after the '-l' option.
Improves: 168d5af "netifd: add loglevel config option (fixes #18001)" Fixes: #21816 Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi> Link: https://github.com/openwrt/openwrt/pull/21819 Signed-off-by: Robert Marko <robimarko@gmail.com>
MAC addresses are retrieved from the 'factory' partition via NVMEM.
LAN: 0xe000 (gmac0)
WAN: 0xe006 (gmac1)
WLAN: 0xe00c (pcie0)
Flash Instruction :-
1-Set a static IP on your PC (e.g., 192.168.0.10, Gateway 192.168.0.1).
2- Power off the router and connect your PC to a LAN port.
3- Hold the Reset button and power on the router; continue holding for 5 seconds.
4- Access the Recovery UI at http://192.168.0.1 in your browser.
5- Upload the OpenWrt factory.bin image and wait for the reboot.
With these definitions in place, the DIR-1360 A1 boots reliably, exposes all hardware features correctly, and can be flashed via both the OEM recovery interface and standard OpenWrt upgrade paths.
Daniel Golle [Fri, 30 Jan 2026 14:31:36 +0000 (14:31 +0000)]
kernel: mtk_eth_soc: fix memory leak in downstream patch
Bc-bocun Chen of MediaTek has discovered a memory leak in the error path
in our downstream patch for mtk_eth_soc which adds support for the 10G
PCS and PHY paths of the MT7988 SoC.
Fix this by freeing the at this point already allocated netdev resources
before returning the error.
Fixes: 4cb6bd9a6d ("mediatek: switch to pending XFI 10G Ethernet drivers") Reported-by: Bc-bocun Chen <bc-bocun.chen@mediatek.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Linus Lüssing [Thu, 15 May 2025 00:51:14 +0000 (02:51 +0200)]
realtek: change function prefixes from rtl83xx_ to rtldsa_
So far the function prefix rtl83xx_ is used for functions which are
exclusive to RTL8390_FAMILY_ID but also for ones shared between
RTL8390_FAMILY_ID/RTL9300_FAMILY_ID/RTL9310_FAMILY_ID.
For a more fitting, precise use of rtl83xx_ rename the ones in dsa.c
which are also used by RTL9300_FAMILY_ID and RTL9310_FAMILY_ID
to rtldsa_.
For the IPv4 unknown multicast flood portmask the first byte should be
for the higher port numbers and the following byte for the lower port
numbers, just like for the L2 unknown multicast flood portmask or the
IPv6 unknown multicast flood portmasks, too. Not the other way around.
Fix the debug output here by adjusting the offsets accordingly.
Fixes: 27029277f98d ("realtek: add switch driver support for the RTL93XX based switches") Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue> Link: https://github.com/openwrt/openwrt/pull/21786 Signed-off-by: Robert Marko <robimarko@gmail.com>
Avoid to reconfigure a SerDes when it has been configured for a mode
before. This usually applies to switches which drive multiple ports on a
single SerDes. For those, the phylink subsystem triggers PCS
configuration everytime although it's a single SerDes. For example, on
switches with XSGMII-connected RTL8218D the particular SerDes is
configured eight times but only a single run is needed.
Add a proper check to pcs_config which checks the mode stored in the
SerDes instance against the requested mode. Other 'settings' should be
executed though, e.g. setting autoneg. While at it, drop the check if
there is a 'setup_serdes' implementation. It's just a driver-internal
interface and all variants implement this now.
Jonas Jelonek [Sun, 25 Jan 2026 23:10:39 +0000 (23:10 +0000)]
realtek: pcs: move mode mapping to generic pcs_config
All variant-specific setup_serdes functions currently make equal use of
the mapping from the interface mode to the hardware mode. To reduce
redundancy, move this mapping to the generic pcs_config, from where the
setup_serdes implementations are called.
This includes slightly changing the setup_serdes signature and some
debug messages.
Bevan Weiss [Mon, 19 Jan 2026 08:05:31 +0000 (19:05 +1100)]
realtek: rtl838x_eth: Use printk MAC specifier instead of raw hex
The linux kernel printk has a MAC address specifier `%pM` that can be
used to pretty-print MAC addresses. We should use this specifier when
printing MAC addresses for humans since that ensure the appearance that
people are used to.
"features" describes the currently active device options and
"hw_features" describes all possible ones. So hw_features must
be a superset of features. Fix that.
Provide a new transmit function. It is cleaner and closer to
upstream than what we have now. The basic features are:
- Avoid memory moving and keep data in the SKBs
- Only protect really critcal parts by a lock as transmit
queues will be only called once by the kernel
The operating system has enough features to control the transmit
queues. There is no need to provide a hard coded distribution
function. Especially differentiating between a round robin for
RTL83xx and high/low priority for RTL93xx makes no sense. All
devices have the same low/high priority queues.
Simply present two "generic" queues to the kernel.
The ethernet driver will get a new transmit function. As a first
step add the required structures and initialize them.
To get an idea: In the future the transmit buffer will hold only
the needed packet header information. The real data is kept in the
SKBs. So only pointers will be changed and memory moving can be
avoided. The SoC will transfer packet data directly from the SKBs.
Additionally a new transmit lock will be established that is
separated from the current driver lock. This is only needed
to guard the "kick-the-engine" command. So contention of the old
global lock can be reduced.
Ethernet transmit handling processes data synchronously via a
packet buffer. As soon as it kicks the SoC to send the packet
no more post processing is needed. Especially there is no need
for transmit completion interrupts. Disable them to reduce the
CPU load.
Jonas Gorski [Wed, 14 Jan 2026 19:19:30 +0000 (20:19 +0100)]
build: use STAGING_DIR for special APK package versions
Removing tmp/ after having built base-files or toolchain currently
breaks rootfs generation:
$ rm -rf tmp
$ make V=w
...
make[2] package/install
cat: .../openwrt/tmp/base-files.version: No such file or directory
cat: .../openwrt/openwrt/tmp/libc.version: No such file or directory
ERROR: 'base-files=' is not a valid world dependency, format is name(@tag)([<>~=]version)
make[2]: *** [package/Makefile:100: package/install] Error 99
The only way to recover from here is to clean toolchain and base-files via
$ make package/{base-files,toolchain}/clean
tmp is supposed to be ephemeral, so clearing it is an expected action,
which normally just triggers a regeneration of all files there.
Fix this by moving the version files to $(STAGING_DIR).
Fixes: 63e178f067 ("build: lock versions for special APK packages") Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21803 Signed-off-by: Robert Marko <robimarko@gmail.com>
Felix Fietkau [Sat, 31 Jan 2026 16:56:53 +0000 (16:56 +0000)]
wifi-scripts: fix ieee80211w override for psk-sae/sae-mixed
The ucode wifi-scripts unconditionally set ieee80211w=1 for psk-sae
and eap-eap2 auth types, ignoring any user-configured value. This
caused ieee80211w=2 (MFP required) to be silently downgraded to 1
(MFP optional) when using sae-mixed encryption.
Change the logic to only set the default of 1 when ieee80211w is not
already configured by the user.
Fixes: https://github.com/openwrt/openwrt/issues/21751 Signed-off-by: Felix Fietkau <nbd@nbd.name>
Felix Fietkau [Sat, 31 Jan 2026 14:03:05 +0000 (14:03 +0000)]
uclient: update to Git HEAD (2026-01-31)
b3ee1209a3d0 uclient-http: reset fd to -1 after close in disconnect 9c2ad269c42b uclient-http: fix seq field check to use correct field 80c9bd29c233 uclient-http: fix hang on HTTP to HTTPS redirect 931bbfeb2c92 ucode: fix memory leak when using ssl context
Fixes: https://github.com/openwrt/uclient/issues/11 Fixes: https://github.com/openwrt/uclient/issues/13 Signed-off-by: Felix Fietkau <nbd@nbd.name>
Burak Aydos [Thu, 29 Jan 2026 19:25:04 +0000 (22:25 +0300)]
lantiq: xrx200: add env-size for P-2812HNU-F1 u-boot-env
The u-boot-env partition on the Zyxel P-2812HNU-F1 is 128 KiB but
the actual environment data is only 8 KiB (0x2000 bytes). Without
the env-size property, the u-boot,env nvmem layout driver assumes
env-size equals the full partition size and computes an incorrect
CRC32 over the entire 128 KiB, causing all nvmem cell reads to fail
silently.
Add env-size = <0x2000> so the CRC32 is computed over the correct
8 KiB region, allowing nvmem-cells (such as ethaddr) to be read
properly by the kernel.
Drop legacy sw_xxx() macros for rtl838x devices. While we are here
reorganize the access and aovid masked access where possible. So the
code is easier to read.
As a first step convert the central run command over to regmap.
Additional info: The command masks where changed because
sw_xxx() dont care about the to be set or to be cleared bits
(aka mask). In regmap the mask must always be a superset of the
to be set bits.
Port 21 definition was missed during addition of LGS328C.
Add it to the dts.
Fixes: 853d73f ("realtek: add support for Linksys LGS328C") Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21793 Signed-off-by: Robert Marko <robimarko@gmail.com>
Linus Walleij [Thu, 29 Jan 2026 22:40:50 +0000 (23:40 +0100)]
gemini: use tar stream to write firmware
The firmware update file can get big, so instead of extracting
the whole file into the tmp folder potentially running out of space
and make the upgrade fail, stream from tar xvf -O directly to the
mtd write command.
Refactor the checking of partitions and the actual upgrade into
two steps when we are at it.
Linus Walleij [Sun, 25 Jan 2026 18:01:45 +0000 (19:01 +0100)]
gemini: Fix up sysupgrade platform.sh script
The Storlink reference designs sometimes fail upgrade because
not the entire partition is used, so the size isn't equal to
the actual flash space available for the partition.
Fix this by calculating the actual partition sizes by measuring
across the partition offsets instead.
The MT7531 has an incorrect interrupt number described in the DTS.
This commit also adds PHY interrupts. They work the same as on
the MT7988.
Tested on Gemtek W1700k.
Suggested-by: Benjamin Larsson <benjamin.larsson@genexis.eu> Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl> Link: https://github.com/openwrt/openwrt/pull/21016 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Ivan Pavlov [Tue, 27 Jan 2026 14:40:18 +0000 (17:40 +0300)]
libpcap: update to 1.10.6
Vulnerabilities fixed: CVE-2025-11961 and CVE-2025-11964
Various improvements and bug fixes.
Changelog: https://github.com/the-tcpdump-group/libpcap/blob/libpcap-1.10.6/CHANGES
Jonas Jelonek [Fri, 16 Jan 2026 09:32:52 +0000 (09:32 +0000)]
realtek: pcs: add XSG write operations
There is some special logic used for certain writes to digital pages for
RTL93xx SerDes, especially when configuring the XSGMII mode. For
RTL930x this applies to SerDes 2 and 3, for RTL93xx to more. In this case,
a dual-read/write to SDS and SDS + 1 is done. While the corresponding
mapping from front to back SDS for RTL931x is currently covered in the
SerDes MDIO driver, it isn't for RTL930x.
To cover these special cases and provide a clear interface on that,
introduce an XSG write SerDes operation. All these dual-read/write cases
can be expressed with such an XSG operation whose internal semantics are
defined for each switchcore family.
This could be done just with plain dual read/write calls however this
isn't a clean approach and may be confusing while comparing our
functionality with the SDK, especially for RTL930x.
In practice, if this isn't handled correctly, only half of the ports of an
XSGMII-connected RTL8218D do work because some required values aren't
applied for the background SerDes 3.
Jonas Jelonek [Sun, 18 Jan 2026 17:58:58 +0000 (17:58 +0000)]
realtek: rtl930x: move SerDes mapping from MDIO to PCS
For RTL930x, the SerDes MDIO driver performed a slight SerDes ID mapping
on certain conditions. Instead of keeping this mapping in the MDIO and
try to extend it for further quirks, lets just be a plain MDIO here and
let the user (PCS) deal with these complex quirks.
Drop the mapping from the SerDes MDIO driver and move it to the PCS
driver by leveraging the previously introduced SerDes operations
structure. Define separate ops which incorporate this mapping and use
those instead of the generic implementations.
Jonas Jelonek [Sun, 18 Jan 2026 17:26:37 +0000 (17:26 +0000)]
realtek: pcs: introduce dedicated SerDes ops
Add a dedicated structure for SerDes operations. This will be used for
several common operations currently called individually in various
places of the code.
Start with defining the basic read and write operations for a SerDes in
this structure. Use generic implementations of these operations for all
variants (RTL83xx, RTL93xx) for now.
Linus Walleij [Wed, 28 Jan 2026 00:31:38 +0000 (01:31 +0100)]
ixp4xx: select CONFIG_BLK_DEV_LOOP
The ixp4xx is using split squashfs/jffs2 root filesystems on
some devices, so without CONFIG_BLK_DEV_LOOP the device does
not gain a writeable root filesystem with these boot messages:
mount_root: unable to create loop device
mount_root: jffs2 not ready yet, using temporary tmpfs overlay
and then it never gets out of that. Fix this so we get writeable
rootfs again.
Christoph Krapp [Mon, 26 Jan 2026 21:13:25 +0000 (22:13 +0100)]
ath79: add calibration variant for TP-Link TL-WA1201 v2
Now that we have a board file, add calibration variant for TP-Link
TL-WA1201 v2 and add ipq-wifi package for it.
Tested-by: Jim McDonald <122668301+jimmyd998@users.noreply.github.com> Signed-off-by: Christoph Krapp <achterin@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21736 Signed-off-by: Robert Marko <robimarko@gmail.com>
Robert Marko [Tue, 27 Jan 2026 12:53:37 +0000 (13:53 +0100)]
mvebu: cortex-a53: fix Methode eDPU migration to upstream DTS
Migration of the eDPU DTS to upstream one broke the eDPU plus model
since the required ethernet aliases are missing and U-Boot then cannot
find the required ethernet nodes.
So, after sending the required fix upstream, lets apply it in OpenWrt
as well.
Fixes: 9852dda4105c ("mvebu: move DTS diff into a patch for Methode uDPU") Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Linus Walleij [Tue, 27 Jan 2026 19:52:37 +0000 (20:52 +0100)]
gemini: select CONFIG_BLK_DEV_LOOP
The gemini is using split squashfs/jffs2 root filesystems on
all devices, so without CONFIG_BLK_DEV_LOOP the device does
not gain a writeable root filesystem with these boot messages:
mount_root: unable to create loop device
mount_root: jffs2 not ready yet, using temporary tmpfs overlay
and then it never gets out of that. Fix this so we get writeable
rootfs again.