74924 Commits
Author SHA1 Message Date
Tianling Shen af85f902be kernel: backport pending fixes for FM25G0{1,2}B Quad I/O read
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2026-07-22 11:03:16 +08:00
Tianling Shen ef74cfd14f Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2026-07-22 11:02:55 +08:00
Hauke Mehrtens b5191da03c rpcd: update to Git HEAD (2026-07-19)
e37ed9d81469 file: re-authorize ACL against resolved path to close symlink bypass

Link: https://github.com/openwrt/openwrt/pull/24329
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-07-21 22:59:58 +02:00
Markus Stockhausen fb69055ed5 realtek: eth: rename packet to frag
Since the jumbo frame preparation the driver can work on fragments
and not only on complete packets in the receive path. This might be
implementet in the transmit patch in the future too. So a chunk of
data is best described as a fragment. Rename all occurrences.

Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 21:02:00 +02:00
Markus Stockhausen 57850d4bef realtek: eth: move tx skb into driver-only structure
The TX path stores the skb information in the coherent part. This
is only needed by the driver. Move it to its proper location.

Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 21:02:00 +02:00
Markus Stockhausen 25e30fd274 realtek: eth: move page/pool into driver structure
The paged pool handling is only required for the driver and not
for the SOC. Move it into the driver-specific part.

Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 21:02:00 +02:00
Markus Stockhausen 1588766cee realtek: eth: change skb helper function signatures
It is easier to work with ring/slot when shifting around variables
in the different structures. Replace packet pointers in existing
function signatures.

Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 21:01:59 +02:00
Markus Stockhausen 771f370d74 realtek: eth: add driver-only transmit info structure
Remove driver-only data from the coherent transmit structure.
It is not needed to keep this in uncached memory as the SOC
does not need access to it.

Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 21:01:59 +02:00
Markus Stockhausen 289011eac0 realtek: eth: Rename coherent structures
In the past the ring handling was split into a coherent (SOC/driver shared)
and a driver-only part. Give the coherent structure a meaningful name.

Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 21:01:59 +02:00
Carlo SzelinskyandJonas Jelonek b3ff21a2ec realtek: rtl9303: enable PSE on Hasivo S600WP-5GT-2SX-SE
Wire the HS104 controller (0x0d) on the PSE i2c-gpio bus and attach the
four PoE PHYs (lan1-4) via PHY_C45_PSE; lan5 is not PoE. Add the STC8 LED
MCU (0x4d) with per-port PoE LED triggers, and pull the HS104 PSE and STC8
kmods into the image.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 18:59:27 +02:00
Carlo SzelinskyandJonas Jelonek f728b4af35 realtek: rtl9313: enable PSE on Hasivo S1300WP-8XGT-4S+
Wire the two HS104 controllers (0x0d/0x15) on the i2c_sys bus and attach
the 8 PoE PHYs via PHY_C45_PSE. Add the STC8 LED MCU (0x4d) with per-port
PoE LED triggers, enable LEDS_SYSCON, and pull the PSE and STC8 kmods into
the image.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 18:59:26 +02:00
Carlo SzelinskyandJonas Jelonek dd8f705e85 realtek: rtl9303: enable PSE on Hasivo S1100WP-8GT-SE
Wire the two HS104 controllers on the i2c-gpio bus and attach the 8 PoE
PHYs via a new PHY_C45_PSE macro. Add the STC8 syscon with its per-port
PoE LED triggers, enable LEDS_SYSCON, and pull the PSE and STC8 kmods
into the image.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 18:59:26 +02:00
Carlo SzelinskyandJonas Jelonek d3c5d345d2 kernel: pse-pd: add Hasivo HS104 PoE PSE controller driver
Direct-I2C driver for the HS104 PSE chip (unlike the MCU-fronted
realtek-pse-mcu family). Packaged as kmod-pse-hasivo-hs104.

This driver will be submitted upstream once the pending PSE-core
patches it builds on (above) have landed.

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 18:59:26 +02:00
Carlo SzelinskyandJonas Jelonek 7926c03b4d kernel: pse-pd: add poll helper and LED trigger support
Backport the pending v6 poll-based event detection (devm_pse_poll_helper)
and per-PI LED triggers via the notification path, plus the
poll-interval-ms binding. Unblocks the hs104 poll path and PoE LED
triggers.

Pending upstream as [PATCH net-next v5 0/2] (reviewed; v6 pending,
merge expected soon).
Link: https://lore.kernel.org/all/20260429213224.1747410-1-github@szelinsky.de/

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 18:59:25 +02:00
Carlo SzelinskyandJonas Jelonek d060557066 kernel: pse-pd: backport net fixes for unregister/isr
pse_isr() 32-bit OOB bitmap access, disable IRQ before freeing PI data
on unregister, and guard against freed PI data on regulator disable.

Pending upstream in the PSE-core teardown UAF fix series
[PATCH net v2 0/2] (in review; merge expected soon).
Link: https://lore.kernel.org/all/20260711121611.1639086-1-github@szelinsky.de/

Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 18:59:25 +02:00
Daniel Golle 0f256a0a7a kernel: modules: package OP-TEE and fTPM modules
Add kmod packages to support accessing the fTPM (in-firmware TPM) which
can be implemented in the boot firmware of most modern platforms.

 - kmod-optee: Open Portable Trusted Execution Environment
 - kmod-optee-rng: OP-TEE random number generator client
 - kmod-rtc-optee: OP-TEE real-time clock client
 - kmod-scmi-transport-optee: SCMI OP-TEE transport
 - kmod-tee: Generic Trusted Execution Environment
 - kmod-tee-stmm-efi: EFI variable service Trusted Application
 - kmod-tpm-ftpm-tee: Microsoft fTPM Trusted Application

Using the TPM 2.0 can be useful for various security applications,
such as encrypting on-disk credentials. OP-TEE itself alone is also
useful as it can provide a PKCS#11 token for authentication (eg. to
connect to a VPN) and significantly lower the risk of leaking secrets
used for authentication. Also, on some platforms RNG and RTC can only be
accessed via OP-TEE, and some ARM SystemReady platforms require EFI
variables to be access via a TA.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-07-21 11:56:04 +01:00
Markus Stockhausen 11a859cca7 realtek: eth: clean up non-dma ring data
The driver ring handling consists of two parts:

- rx_data: DMA coherent data shared with the SoC
- rx_qs: driver internal handling data

It is unclear what "qs" stands for. Rename that part to "rx_info".

While we are here:
- relocate slot from rx_data to rx_info as it is only needed by
  the driver and not the SoC.
- rename page_pool to pool because there is only this single pool
  inside the driver.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:10 +02:00
Markus Stockhausen 5cf2b66789 realtek: eth: align dma variables
The driver uses rx_data_dma and tx_dma although they have an
identical meaning. Align their naming.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:10 +02:00
Markus Stockhausen ec8d08496c realtek: eth: groundwork for jumbo frames
The Realtek SoC hardware can split incoming packets over multiple buffers.
This allows to receive packets that are larger than the current 2K page
pool limit without changing the design to higher order pages. Add a logic
to handle these fragments.

As a first proof of concept simulate fragmentation by reducing the buffer
size down to 400 bytes. With the current support for standard MTU (1500)
the packets might consist of up to 4 fragments.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:10 +02:00
Markus Stockhausen 7683e9e28e realtek: eth: increase error counters under lock
Change device error statistics like normal statistics - under a lock.
Reword associated messages in preparation for fragment handling.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:09 +02:00
Markus Stockhausen 7226c6edbf realtek: eth: add helper for SKB creation
Simplify rteth_hw_receive() by using a separate helper for SKB creation.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:09 +02:00
Markus Stockhausen 39d466aba3 realtek: eth: prepare napi receive for fragments
Reorder the code around napi_gro_receive() so that it fits nicely
for the upcoming fragment handling. For this relocate the FCS
stripping and eth_type_trans() calls short before the handover
when the packet is fully built.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:09 +02:00
Markus Stockhausen cba031de5d realtek: eth: Explain page allocation order
Add a comment why we are doing this and make use
of a helper variable.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:09 +02:00
Markus Stockhausen edc3c3f63f realtek: eth: prepare counters for fragments
Until now the driver packs each received packet into one ring buffer.
In the future jumbo packets will be split into multiple fragments.
Prepare the ring counters for this:

- Add the more flag to SoC packet header. This denotes if a packet
  has more data after the current fragment.
- Ring counters must be handled per packet and not per fragment.
  Increase work_done after each packet and not after each fragment.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:09 +02:00
Markus Stockhausen 54a7e09329 realtek: eth: Adapt SKB defines
Testing shows that the existing performance boost by aligning the data
to 2 bytes (NET_IP_ALIGN) breaks fragment handling on RTL838x devices. The
SoC silently drops 2 bytes between each fragment. Use this tricky alignment
only when it is supported. This will bring down performance on RTL838x SoCs
by 30%. All other SoCs are unaffected. This is a legitimate tradeoff for
allowing multiple fragments. While we are here make clearer what the
definies are about and rename them to a SKB_ prefix.

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:09 +02:00
Markus Stockhausen 419f023ec3 realtek: eth: add rteth_free_skb() helper
Add a helper to simplify SKB freeing and rx counter handling. If SKB
is given, it is freed and the pointer is set to zero. The return value
is the number of freed SKBs (0/1). With this the existing cleanup and
error handling can be simplified like

dev->stats.tx_errors += rteth_free_skb(&packet->skb);

Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-21 09:30:09 +02:00
Rosen PenevandJonas Jelonek 3978d4e5ee swconfig: fix portmap memory leak and hardening
Free the per-port segment strings on unregister to avoid leaking them
across device rebind. Drop the dead (phys < 0) check and guard the
kstrdup allocation against failure.

Move swconfig_create_led_trigger() before list_add_tail() in
register_switch so a failing registration never publishes the device on
the global swdevs list with dangling portmap/portbuf pointers (a
use-after-free for any swdevs iterator). Route both the LED trigger
failure and the -ENFILE (swdev id exhaustion) failure paths through a
shared cleanup that frees portbuf, portmap, and the per-port segment
strings instead of leaking them.

Reorder the frees in unregister_switch to run after list_del so the
buffers are not freed while the device is still reachable from swdevs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24246
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 09:11:05 +02:00
Rosen PenevandJonas Jelonek ce120be361 kernel: disable qualcomm crypto
Upstream has marked it as BROKEN. Quote:

This driver is harmful:

- It is much slower than the CPU.
- It Has a history of bugs.
- It does not have exclusive access to the hardware, causing races
  with the secure world.
- It register its implementations with too low a cra_priority for them
  to be actually used.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24326
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 09:01:40 +02:00
Frank LangandJonas Jelonek cc80fc4cff ramips: mt76x8: fix MT7663 EEPROM cell for MERCUSYS MB130-4G v1
The nvmem cell for the MT7663 (5 GHz) radio was too small. The MT7663 EEPROM at
offset 0x8000 requires the full MT7615_EEPROM_FULL_SIZE (0x4da8), but the cell
only declared 0x200 bytes.
The driver always requests the full buffer, also for the MT7663, so the undersized
cell makes the nvmem read fail with -EINVAL. The driver then falls back to default
values, which limits TX power to 3 dBm.

Fix this by enlarging the cell to 0x4da8. The offset 0x8000 was already correct —
offset 0x0 holds the MT7628 (2.4 GHz) calibration data.

Fixes: #23632

Signed-off-by: Frank Lang <Frank_Lang@outlook.de>
Link: https://github.com/openwrt/openwrt/pull/24284
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 08:55:33 +02:00
Kyle HendryandJonas Jelonek 41ad8fff38 generic: mips: 6.18: backport fix for highmem init
Fix bug in MIPS highmem init that prevents bcm47xx devices from booting

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24286
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-21 08:53:03 +02:00
Semih BaskanandJonas Jelonek 1b2aeb4f8a mediatek: filogic: drop dead eth0 MAC assignment on TP-Link BE450
The eth0 assignment never takes effect. 05_set_preinit_iface brings eth0
up in its default case before 10_fix_eth_mac.sh runs, and the kernel
refuses a MAC change on a running interface, so ip link fails with EBUSY.
This script cannot run any earlier either, since it needs /tmp/tp_data
mounted by 09_mount_cfg_part.

Nothing is lost by dropping it: the DSA user ports carry their own
addresses, which the lan1-3 assignments below already take care of, and
br-lan takes its address from them.

Verified on a BE450 running an image built from main: eth0 comes up with
a different random address on every boot regardless of this line, while
lan1-3 and br-lan keep the label MAC across reboots even with no macaddr
in /etc/config/network.

Fixes: 1513da34bb ("mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450")
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24325
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 23:39:52 +02:00
Stijn SegersandJonas Jelonek ab649f19ab realtek: use Realtek PSE MCU driver for GS1900-8HP B1
Switch the GS1900-8HP B1 (which turns out to come with a Broadcom
PSE, still) to the PSU driver that is being upstreamed.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Link: https://github.com/openwrt/openwrt/pull/24306
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 23:29:21 +02:00
Aleksander Jan BajkowskiandJonas Jelonek 672400f361 ethtool: update to 7.1
Version 7.1 - Jul 7, 2026
	* Feature: track TX pause storm events (-I -a)
	* Feature: update doc for ETHTOOL_PFC_PREVENTION_TOUT tunable
	* Feature: RX CQE coalescing params (-c, -C)
	* Feature: allow hex dump of all pages (-m)
	* Feature: qsfp: support newer SFF-8636 compliance codes (-m)
	* Feature: sfpid: support newer SFF-8636 compliance codes (-m)
	* Fix: document --disable-netlink in help output (-h)
	* Fix: add missing newlines in FEC output (--show-fec)
	* Fix: sfpid: fix 10G Base-ER module detection (-m)
	* Misc: clarify 10000baseCR link mode in man page

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/24278
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 20:46:47 +02:00
Semih BaskanandJonas Jelonek 770a32e117 mediatek: filogic: set label MAC address on TP-Link BE450
The label-mac-device alias cannot work on this device: it is resolved
by reading the mac-address property of the aliased DT node, but gmac0
never has one. The MAC is stored in a file inside the tp_data UBIFS
volume, so there is no fixed flash offset an nvmem-layout could point
at, and the vendor bootloader does not fix up the FDT either. Drop the
dead alias.

Record the label MAC in board.d instead and assign it to the lan
interface, as is already done for the other devices reading
/tmp/tp_data/default-mac (Mercusys MR90X v1, Archer AX80 v1,
RE6000XD). The explicit lan MAC also makes the br-lan address
independent of the order of the bridge ports.

Suggested-by: Felix Baumann <felix.bau@gmx.de>
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24180
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 20:28:34 +02:00
Semih BaskanandJonas Jelonek 1513da34bb mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450
eth0 (gmac0) is declared label-mac-device, but nothing assigns its MAC,
so it and the DSA lan ports come up with a random locally administered
address that changes every boot. Assign the base MAC from tp_data
default-mac to eth0 and the lan ports, as is already done for eth1 and
eth2.

Each lan port needs its own assignment: a DSA user port copies the
conduit's MAC once when it is created, at driver probe before preinit
runs, and ignores later changes to eth0.

Run-tested on a BE450 on 25.12.5, where the case is identical.
Two boots without the fix each came up with a different
random address; with the fix applied, eth0 and the lan ports get the
label MAC and keep it across reboots.

Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24180
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 20:28:34 +02:00
Andris PEandJonas Jelonek e85fa66006 kernel: load vmware net modules early
Load vmware network modules early to make them available for failsafe
mode and first-time scripts
REF:
`https://knowledge.broadcom.com/external/article/321259/choosing-a-network-adapter-for-a-virtual.html`
Additionally add e1000 which is default on "Other Linux" vm profiles

Signed-off-by: Andris PE <neandris@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24212
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 20:15:11 +02:00
John AudiaandJonas Jelonek 276214fc06 kernel: bump 6.18 to 6.18.39
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.18.39

Removed upstreamed:
  backport-6.18/704-v7.2-netfilter-flowtable-fix-offloaded-ct-timeout-never-b.patch[1]

All other patches automatically rebased via update_kernel.sh

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.18.39&id=81a5971cbe18b474b49c651e32f2194b2fb171fe

Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/24282
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 20:05:54 +02:00
Markus Stockhausen b73b209693 realtek: i2c: replace shared gpio driver with upstream
Upstream will support I2C GPIO based buses with shared SCL shortly [1].
Drop downstream driver, provide backport and adapt DTS.

[1] https://lore.kernel.org/linux-i2c/20260714162915.3018703-1-markus.stockhausen@gmx.de/

Link: https://github.com/openwrt/openwrt/pull/24269
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-07-20 18:50:01 +02:00
Mieczyslaw NalewajandJonas Jelonek f31b65a870 ledtrig-network: default missing family to WLAN on non-DT LEDs
For LEDs that have no network trigger configuration in Device Tree
(no mode or family properties), net_activate() infers the family
from the LED name or function string. If that inference fails,
the trigger previously returned -EINVAL and refused to activate.

This is too strict for manual activation via sysfs (e.g.
echo "network" > /sys/class/leds/<led>/trigger) on LEDs that
were not declared for the network trigger in DT. In that case
the user expects the trigger to load with sensible defaults.

Change the non-DT activation path to fall back to NET_TRIG_WLAN
instead of failing, while keeping the condition visible via pr_warn().
Device Tree paths with dt_mode or dt_family are left unchanged
and continue to fail on invalid parameters

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/24235
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:52:07 +02:00
Nickolay SavchenkoandJonas Jelonek 364b4c0d24 ramips: reject invalid frame engine RX lengths
fe_poll_rx() takes the packet length directly from the RX descriptor and
passes it to skb_put() without checking that it fits in the allocated
buffer.  A malformed or stale descriptor can therefore extend the skb
beyond its tailroom and corrupt memory.

Reject lengths larger than skb_tailroom(), account the packet in
rx_length_errors and rx_dropped, free the affected skb, and continue by
installing the replacement descriptor.

Signed-off-by: Nickolay Savchenko <n.savchenko@axioma.lv>
Link: https://github.com/openwrt/openwrt/pull/24268
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:48:26 +02:00
Nickolay SavchenkoandJonas Jelonek 7c2586ffe7 ramips: fix frame engine DMA length cleanup
fe_txd_unmap() uses dma_len0 and dma_len1 to decide whether each TX
mapping must be passed to dma_unmap_page().  After unmapping, however,
the code passed the dma_addr0 and dma_addr1 field identifiers to
dma_unmap_len_set().

This leaves the actual length fields unchanged.  A reused descriptor
slot can therefore retain a non-zero length and attempt to unmap an old
DMA mapping again.

Clear dma_len0 and dma_len1 after the mappings have been released.

Signed-off-by: Nickolay Savchenko <n.savchenko@axioma.lv>
Link: https://github.com/openwrt/openwrt/pull/24268
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:48:26 +02:00
Jonas Jelonek 4894562049 realtek: pcs: drop unneeded pointer cast
The return value of device_get_match_data was still explicitly casted to
the driver-internal type. However, since this function returns 'const
void *' and in C void pointers are automatically casted, this isn't
needed. Thus, drop it.

Link: https://github.com/openwrt/openwrt/pull/24310
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:54 +02:00
Jonas Jelonek e1a6d77124 realtek: pcs: rtl930x: apply only needed patching
For 10GBase-R and 2500Base-X, the patching sequences for the slower
modes are also applied. This mirrors the SDK which uses some automatic
detection and only does a one-time initialization. However, Linux works
different. The PCS is configured to a specific mode on demand. Thus,
there is no need to apply the other patching when it isn't really
needed.

Those patching sequences seem to initialize AFE blocks within the
SerDes, thus a 1G AFE shouldn't be needed for 10GBase-R. Testing
confirms this so far, no difference in any link characteristics when
e.g. 1G and 2.5G sequences aren't applied for a 10GBase-R link.

Link: https://github.com/openwrt/openwrt/pull/24310
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:54 +02:00
Jonas Jelonek e05153e47e realtek: pcs: rtl931x: do not configure 1000Base-X for 10GBase-R
So far, the 10GBase-R configuration mirrored the SDK which in addition
also sets up 1000Base-X and lets it run in a special mode having
autodetection of 10G/1G. This doesn't make that much sense given that
Linux will trigger PCS reconfiguration once the interface mode has
changed. Thus, we should only provide that for each mode standalone, not
for some proprietary and special mixed auto mode.

Link: https://github.com/openwrt/openwrt/pull/24310
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:54 +02:00
Jonas Jelonek b253af3698 realtek: pcs: rtl931x: add info to config bits
Give two SerDes register writes some meaningful information, since they
line up with usual PHY registers.

Link: https://github.com/openwrt/openwrt/pull/24310
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:53 +02:00
Jonas Jelonek b489ab0d86 realtek: pcs: rtl931x: drop RX channel resets during USXGMII config
The mode configuration calls LEQ/DFE reset and RX reset before doing
USXGMII configuration. Though the SDK does that similar, these calls are
actually unneeded because essentially the same is executed later again
in the attachment configuration. This is also the place where it
rather belongs. Thus, drop those calls in mode configuration.

Link: https://github.com/openwrt/openwrt/pull/24310
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:53 +02:00
Jonas Jelonek d9fdf451f1 realtek: pcs: rtl931x: drop unused helper
Drop the unused helper rtpcs_931x_sds_reset because it is unused and -
if it was used - would actively mess with the defined SerDes
deactivation/activation in pcs_config.

Link: https://github.com/openwrt/openwrt/pull/24310
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:53 +02:00
Jonas Jelonek 39cd3f8954 realtek: pcs: rtl931x: fix 1000Base-X config
Commit 7899dfa6ef ("realtek: pcs: rtl931x: separate and reuse
1000base-x config") introduced an issue by accident, using the register
value 0x12 instead of 0x13. A regression hasn't been noticed before, for
yet unknown reasons the 1000Base-X still worked here and there. Probably
due to some external setup.

However, this currently breaks 1000Base-X functionality on at least one
switch. Correcting the register value instantly restores 1000Base-X,
allowing the link to come up. It is unclear yet what this field means,
according to the SerDes register defines from related RTL8295 this might
be TX mode configuration field.

Also add another write which is present in several SDK versions.
Referring from related RTL8295, this might be a field called
EN_LINK_FIB1G, enabling 1000Base-X operation.

Fixes: 7899dfa6ef ("realtek: pcs: rtl931x: separate and reuse 1000base-x config")
Link: https://github.com/openwrt/openwrt/pull/24310
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:52 +02:00
Eric FahlgrenandJonas Jelonek 10dc55290e package: rtl826x-firmware: make package versions consistent
The two packages rtl826x-firmware and rtl826x-lp-firmware are built
from the same source, yet have 'VERSION=xxx' overrides that modify
the package name and metadata.  This causes issues with apk, as
it always selects the package with the higher version number (the
'-lp-' one), irrespective of which package is desired.

Remove the VERSION overrides and use the actual package version so
that apk can install the correct package.  The binary contents of
the packages remain unaffect, this only changes the package file
name and metadata related to versioning.

Before
  rtl826x-firmware-20221115.apk
  rtl826x-lp-firmware-20240729.apk

After
  rtl826x-firmware-2026.01.24~0cd4abe2-r4.apk
  rtl826x-lp-firmware-2026.01.24~0cd4abe2-r4.apk

Fixes: https://github.com/openwrt/openwrt/issues/24145
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24201
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-20 15:45:01 +02:00
Felix Fietkau 5b3b961f41 ucode-mod-bpf: bump PKG_RELEASE
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-07-20 10:43:36 +02:00