Commit graph

69980 commits

Author SHA1 Message Date
Paul Spooren
9292f32fd9
toolchain: drop $(REVISION) from GCC version
Storing the ever changing revision in the GCC binary may result in leakage in
package builds. If two equal GCC versions build the same package version with
different OpenWrt revisions, the package becomes unreproducible.

Solve this by dropping the revision.

Below is an example of the `cni` package:

    │ ├── readelf --wide --decompress --string-dump=.comment {}
    │ │ @@ -1,4 +1,4 @@
    │ │
    │ │  String dump of section '.comment':
    │ │ -  [     0]  GCC: (OpenWrt GCC 14.4.0 r35470-1b2aeb4f8a) 14.4.0
    │ │ +  [     0]  GCC: (OpenWrt GCC 14.4.0 r35485-0f256a0a7a) 14.4.0

Signed-off-by: Paul Spooren <mail@aparcar.org>
2026-07-23 13:20:23 +02:00
Kyle Hendry
0622567492
bcm47xx: refresh 6.18 patches
- Manually rebase 830-huawei_e970_support.patch
- Update .remove_new to .remove in 831-old_gpio_wdt.patch, see
commit e70140ba0d2b1a30467d4af6bcfe761327b9ec95
- make target/linux/refresh the rest

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-23 09:08:57 +02:00
Kyle Hendry
6fc18a3c3d
bcm47xx: refresh 6.18 config
CONFIG_PAGE_BLOCK_MAX_ORDER was set to the default of 11

Refresh config with make kernel_oldconfig

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-23 09:08:56 +02:00
Kyle Hendry
2dee7d415a
bcm47xx: enable 6.18 testing kernel
Allow selecting 6.18 as testing kernel on bcm47xx.

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-23 09:08:56 +02:00
Kyle Hendry
3cfc4e4547
bcm47xx: restore files for v6.12
This is an automatically generated commit which aids following Kernel patch
history, as git will see the move and copy as a rename thus defeating the
purpose.

For the original discussion see:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-23 09:08:56 +02:00
Kyle Hendry
55f8c5b606
bcm47xx: create files for v6.18 (from v6.12)
This is an automatically generated commit.

When doing `git bisect`, consider `git bisect --skip`.

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-23 09:08:55 +02:00
David Bauer
f937146fa1 mtd mtdsplit-fit: fix potential out of bounds read
Account the offset_start in the bounds check of the for loop. This was
previously missing, differing in check and actual read.

Signed-off-by: David Bauer <mail@david-bauer.net>
2026-07-23 01:05:30 +02:00
David Bauer
f8386008c0 mtd mtdsplit-fit: fix fit not found case
Attempting to parse the mtdsplit-fit device can lead in a out of bounds
read error, as the driver did not validate a fit was found at all.

This can happen if the fit size in the header at the last scan iteration
is non-zero. In this case, the dmesg reads:

[    6.563676] Creating 6 MTD partitions on "ec000000.nor":
[    6.569058] 0x000000000000-0x000003d60000 : "firmware"
[    6.579192] read error in "firmware" at offset 0x3d60000
[    6.584534] Failed to parse subpartitions: -22
[    6.589010] Deleting MTD partitions on "ec000000.nor":

Validate after the scan loop if a fit image was found and abort in this
stage if it is not found.

Signed-off-by: David Bauer <mail@david-bauer.net>
2026-07-23 01:05:30 +02:00
Josef Schlehofer
7aa4eebc75
github: downgrade require_linked_github_account to warning
Some contributors still submit patches via the mailing list or are
not using GitHub entirely, so an unlinked commit author email
should not be treated as a hard failure.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24320
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 23:01:54 +02:00
Yubo Zhang
1ea29a6f49
airoha: an7583: adjust thermal polling delays
The CPU thermal zone in an7583.dtsi sets the polling-delay-passive to
10000 ms while the polling-delay is 5000 ms. The thermal driver rejects
zones whose passive polling delay is greater than the regular polling
delay, causing thermal_zone0 registration to fail with -EINVAL.

Reduce the passive polling delay to 1000 ms to fix thermal_zone0
registration.

Boot log:
thermal_sys: Failed to register thermal zone cpu-thermal: -22
... register thermal zone sensor failed
... probe with driver airoha-thermal failed with error -22

Signed-off-by: Yubo Zhang <zyb_1998@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/24337
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 17:20:30 +02:00
Caleb James DeLisle
3ae630b5b8
econet: add ChinaMobile GS3101
The ChinaMobile GS3101 has:
256MB RAM
256MB flash (TC58CVG1S3H)
1x MT7603 802.11 b/g/n - DISABLED
1x optical port
On-die MT7530 switch with:
- 1x gigabit ethernet port
- 3x 100Mb ethernet ports
1x USB 2.0 port
1x telephone VoIP port
3 controllable LEDs
1 GPIO button (reset), 1 WPS button (not detected in GPIOs)
UART header inside (solder required) 115200 baud
12v power (5.5mm x 2.1mm barrel connector)

Installation instructions: You will need a USB stick
1. Reformat the USB stick as VFAT with MBR partition table. This is important,
if it is GPT then it will silently fail to load.
2. Download openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx and
store it in the USB stick.
3. Start the device with the vendor OS
4. Connect a cable and request an IP address - it will issue in 192.168.1.0/24
5. Use telnet to connect to the modem on 192.168.1.1
6. Login as root@2024 / system
7. Plugin the USB stick
8. cp /mnt/usb1_1/openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx /tmp/openwrt.trx
9. mtd -r -f write /tmp/openwrt.trx tclinux
10. You will lose your shell, look at the power light on the device, it should
begin blinking and then go back to solid. You should NOT see any red light.
11. re-request an IP address
12. ssh root@192.168.1.1
13. You should be on OpenWrt now

MAC address matches that of vendor OS but it is not the address on the label
of the device. It is in a compressed xml file in the 'romfile' partition.
WAN is this mac, LAN is mac+1 and 2.4Ghz WLAN is mac+2, there is no 5Ghz WLAN.

Wifi Note: Of the devices tested, there were numerous upon which starting the
wlan chip caused the CPU to hang. In the interest of avoiding bricked boards,
the wlan is disabled in the DT.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 17:11:24 +02:00
Caleb James DeLisle
77eda1ad1e
econet: add EN7526F chip variant
The EN7526F is a varient of the EN751221 with one USB port and one PCI
port only. Add a dtsi file for this chip varient.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 17:11:23 +02:00
Caleb James DeLisle
04c747b3fc
econet: tclinux-trx.sh make rootfs optional and move padding to kernel
The TRX header contains a checksum of the full kernel and rootfs length. Vendor
OS uses a raw squashfs on the NAND and relies on the BMT to resolve bad block
issues. OpenWrt typically uses UBI on NAND and places the root squashfs inside
of that. Since UBI changes over time, checksumming over it would cause a boot
failure later on. However, vendor TRX installers typically the entire file as
uploaded, without regard for the declared kernel and rootfs lengths.

Make --rootfs optional so that a UBI rootfs can be appended but excluded from
the checksum.

Secondly, this script previously prepended padding to the rootfs in order to
move the beginning of the rootfs 4MB away from the TRX header (the max kernel
size). That prepended padding was included in the rootfs length/checksum.

There is a bug https://econet-linux.pkt.wiki/en/bootloader#a-length-bug in some
versions of the bootloader which causes the bootloader to always use the length
of the first kernel, even if it is booting the second. The impact of this is if
the second slot kernel is larger than the first, it will fail to boot. Smaller
is okay because LZMA will stop when it is done.

Move padding from rootfs to kernel and include it in the length/checksum of the
kernel so that the kernel will always register as being 4MB-minus-TRX-header in
length. Therefore if A/B upgrading is used in the future, this bug will not
occur even if an upgrade with a larger kernel is installed into slot B.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 17:11:23 +02:00
Caleb James DeLisle
da78b5a384
econet: add GPIO/LEDs and mtd-concat support to EN751221
In prep for more fully supporting EN751221, add GPIO, LED, and
mtd-concat.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 17:11:23 +02:00
David Bauer
bd7188a81e ramips esw-rt3050: read port flow-control state
Read flow-control state of the fast ethernet as well as gig-e ports.

The fast ethernet ports only read a combined state for TX and RX
flow-control, the gigabit / CPU ports read a per-direction FC state.

Signed-off-by: David Bauer <mail@david-bauer.net>
2026-07-22 14:46:28 +02:00
Stijn Segers
64315f29c4
realtek: use Realtek PSE MCU driver for GS1900-8HP A1
Switch the GS1900-8HP A1 to the PSE driver that is being upstreamed.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Link: https://github.com/openwrt/openwrt/pull/24339
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 10:20:20 +02:00
Andris PE
1186b585ef
kernel: minimize kmod-sched-ctinfo dependencies
Do not pull iptables core for kmod-sched-ctinfo, only nf-conntrack,
reflecting kernel config dependencies.

There is no use of this module in openwrt repos, but it is used by
@hudra0 qosmate
and some less popular qos scripts.

Signed-off-by: Andris PE <neandris@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24104
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 10:17:49 +02:00
Rosen Penev
0ca7895173
kernel: use fwnode for GPIO export driver
Upstream prefers more generic fwnode/device handlers as opposed to OF
ones.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24176
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 10:14:05 +02:00
Rustam Adilov
4ff901f165
realtek: watchdog: backport upstream regmap patch
The patch to replace mmio access in the realtek watchdog
driver with regmap API has been accepted upstream [1].

Backport them here as this is one of the steps required
for a working system with SWAP_IO_SPACE config enabled.

[1] https://lore.kernel.org/linux-watchdog/20260710074316.46643-1-adilov@disroot.org/

Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/24169
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 10:10:05 +02:00
Rustam Adilov
2b156e77ba
realtek: watchdog: backport watchdog fix patches
Some issues were noticed with watchdog driver while the work
on bringing regmap API was being done.
The patches have been long accepted and are already in v7.2
of linux kernel.

As a prerequisite to the regmap patch, backport them to OpenWrt.

Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/24169
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 10:10:04 +02:00
Felix Fietkau
2c64257627 wifi-scripts: support multiple device paths per board.json wlan entry
The path field of a board.json wlan entry may now be an array of
device paths. ucidef_add_wlan accepts several leading path arguments
and stores them as a JSON array; a single path is still stored as a
plain string for backwards compatibility. A phy is matched if it
corresponds to any of the listed paths, so a radio that enumerates on
a non-deterministic PCI path still resolves to the correct named phy.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-07-22 09:32:52 +02: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 Szelinsky
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 Szelinsky
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 Szelinsky
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 Szelinsky
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 Szelinsky
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 Szelinsky
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 Penev
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 Penev
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 Lang
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 Hendry
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 Baskan
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