The Netgear GS110TPv3 is a 10-port gigabit managed switch with 8x RJ45
ports and 2x SFP cages. All 8x RJ45 ports are PoE+ capable.
This switch is similar to the already supported GS108Tv3 and GS110TPP
models and even shares its stock firmware with these two. SFP cage
configuration, on the other hand, is identical to the GS310TP.
SoC: RTL8380M, 500MHz
RAM: 128MB DDR3
Flash: 32MB SPI-NOR
Ethernet: 8x 1GBE RJ45
2x 1GBE SFP Cages
PoE: 8x PoE+ via Nuvoton controller, 55W total power budget
UART: onboard, unpopulated (J1), 115200/8N1, 3.3V
LEDs: 1x dual color green/amber power LED, GPIO controlled
1x amber PoE-Max and 8x green/amber PoE port LEDs
- handled by PoE controller
8x green/amber port status LEDs, unsupported in OpenWrt
- handled by RTL8231 GPIO expander (see install instructions)
MAC address: base MAC from "ethaddr" U-Boot env variable, additional port
MACs assigned incrementally.
Installation instructions:
1. Install OpenWrt initramfs firmware to the "Image1" firmware slot via
vendor web GUI.
2. If not already so, set next startup firmware to "Image1" ("Activate"),
then reboot.
3. After booting into OpenWrt initramfs firmware, access the device at IP
192.168.1.1 and install the OpenWrt sysupgrade image.
4. Device automatically reboots once again into OpenWrt.
5. (Optional) To enable default port LED handling, change boot command by
running in OpenWrt CLI: fw_setenv bootcmd "rtk network on; boota"
Note: This may cause VLAN leaking during boot.
Back to stock:
1. Reset boot command to stock: "fw_setenv bootcmd boota"
2. Change to secondary firmware partition: "fw_setsys bootpartition 1"
3. Reboot. Device will now boot into stock firmware.
3. (Optional) Revert to stock firmware also for "Image1" firmware slot via
vendor web GUI.
Signed-off-by: Shine- GH <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/26006
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Add support for the Horaco ZX-SWTGW2C48NS, also sold as the HRUI
HR-SWTGW2C48NS and the SODOLA SL-SWTGW2C48NS.
Hardware
--------
* SoC: Realtek RTL9313
* RAM: 512 MiB (2 x 256 MiB window, as in the DTS)
* Flash: 32 MiB SPI NOR; U-Boot, two environment blocks, two stock
configuration partitions (jffs, jffs2), the 28 MiB firmware partition
(RUNTIME1) and a 1 MiB OEMINFO partition
* Ethernet: 4 x 10GBASE-T (RTL8264B PHY), 8 x SFP+ (10GBASE-R)
* Fan and temperature controller: ADT7476 on I2C
* Console: internal UART header, 38400n8 in the kernel (U-Boot itself
uses 115200). The exact location and pinout were not recorded.
* Power: internal AC power supply
* Buttons: reset
* LEDs: per-port LEDs through the SoC LED controller; system LED
The ports are wired for three LEDs each, of which two are fitted, so the
LED set carries an unused first entry. The port LEDs also need the
controller in single-colour scan mode, set through realtek,led-mode; the
rtl931x driver reads that property since "realtek: rtl931x: set the LED
interface mode from realtek,led-mode". The system LED is taken off
hardware control and driven as a GPIO LED.
The SFP+ transmit pairs are polarity-inverted. The SFP LOS signals are
not wired to a known GPIO. The four copper PHYs need the rtl826x
firmware; without it their ports do not come up.
The fan is left to the ADT7476 closed loop. hwmon_fancontrol now has
one function for the ADT747x, shared with the PlasmaCloud ESX28/PSX28
(their values are unchanged), which finds the chip on whichever I2C bus
it sits. On this board it uses all three temperature channels, duty 40
(the stock idle speed; the fan is not stable lower) from 45 C up to
full duty at 71.67 C (the chip's range step nearest 70 C), keeps the fan
at duty 40 below 45 C, and sets the critical limit to 85 C.
MAC address layout
------------------
A single address is stored in the U-Boot environment (ethaddr) and is
read through nvmem for ethernet0, which is also the label MAC. It is
applied to all ports, as the stock firmware does.
Installation
------------
The bootloader and the stock updater require the Realtek SDK uImage
magic 0x83800000, which factory.bin carries. Upload the factory image
through the stock web UI's manual firmware upgrade page (its TFTP-client
upgrade accepts the same image), then reboot from Diagnostics > Reboot:
the stock firmware does not reboot by itself. Only the RUNTIME1
partition is written; U-Boot, its environment and OEMINFO are kept.
Later upgrades use the sysupgrade image.
To return to stock, run "sysupgrade -F -n" with a vendor image. -F is
needed because a vendor image carries no OpenWrt metadata; it also
skips every image check, so first confirm the image starts with the
uImage magic 0x83800000 (for example with "hexdump -C -n 4").
Assisted-by: Claude:claude-opus-5
Assisted-by: Claude:claude-fable-5
Assisted-by: Claude:claude-sonnet-5-5
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25575
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
64dcf47aa7f8 ubus: reject list requests with non-string params in uh_ubus_send_list()
7a06a9d5623a client: fix build without TLS support
ca796d7dec56 ucode: add fallback to avoid compilation error
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Rename all QoS functions, including static helpers, to use the
otto_qos_ prefix. Use otto_qos_<family>_ for chip-specific functions
and otto_qos_83xx_ for the shared RTL83xx helper.
Update header declarations, internal calls and per-chip function
tables to match the new names.
No functional changes intended.
Assisted-by: ChatGPT (OpenAI GPT-6 Astra)
Link: https://github.com/openwrt/openwrt/pull/25974
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
RTL839x refuses 802.1ad bridges, although it has the provider port
blocks RTL930x uses for them (cypress SDK): a TPID pool, outer TPID
compare masks per port, an outer/inner forwarding bit per port and the
tag status with its keep bits. A port that joins an 802.1ad bridge now
parses S-TAGs (pool entry 0, 0x88a8), switches on the outer VID, sends
the outer tag of the VLAN table and keeps the customer's tag on ingress
and egress. Leaving the bridge restores the 802.1Q state.
Nothing is set up at boot, unlike on RTL930x. The TPID pool, the inner
compare masks and the egress TPID indexes keep their values after boot,
which the vendor SDK does not program either; HPE 1920-48G reads
0x88a8/0x8100 in all four pool entries and index 0. The CPU port needs
no outer compare: frames it sends with an S-TAG leave a provider port
with that tag.
HPE 1920-48G (RTL8393), lan48 and lan47 in an 802.1ad bridge, a host
behind lan48 with an 802.1ad VLAN 200 interface, the switch address on
VLAN 200: 8 of 8 pings get a reply that leaves lan48 with an outer
0x88a8 tag, VID 200; with an 802.1Q tag none does. The host's ARP in
S-VLAN 200 leaves lan47, with the S-TAG, only once lan47 is in VLAN 200,
and a C-TAG 10 inside it stays (without the egress keep on lan47 it is
stripped); the host's untagged ARP does not leave lan47. Changing the
bridge to 802.1Q is refused, and after leaving the registers read as
before the join. Not tested: traffic at line rate, a port untagged in
an S-VLAN.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25992
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
otto_vlan_839x_port_forward_on_inner() addresses VLAN_PORT_FWD with the
big-endian port accessor, which puts ports 0 to 31 in the second word.
The register holds one bit per port, port p at bit p % 32 of word p / 32
(VLAN_PORT_FWD in the cypress register list of the vendor SDK, which
addresses such arrays in ascending word order), so the little-endian
accessor is the right one.
So far the function only clears bits, at setup for every port but the
CPU port. With the fix the loop clears ports 20 to 31 too and no longer
clears the CPU port's bit; on HPE 1920-48G both words read 0 after boot
with and without this change. The 802.1ad provider port role needs to
set a port's bit.
HPE 1920-48G (RTL8393), lan48 (port 47) as an 802.1ad provider port on
a test build of that role: with its bit at 0x27B0 bit 15 the S-VLAN
stays off lan47; moved by hand to 0x27AC bit 15, where this function
wrote it, lan48 forwards on the inner VID and the frames leak out of
lan47.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25992
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Every port is a member of VID 0, so that the frames the CPU sends with
its PVID 0 reach the ports with untagged VLANs. A port without PVID
keeps PVID 0 too, so in a VLAN-filtering bridge its untagged and
priority tagged frames land in VID 0 and are flooded to the other ports
of the bridge, tagged VID 0, where the bridge would drop them.
The acceptable frame type of a port tells the two apart (one bit each
for inner and outer, tagged and untagged frames; vendor SDK). While a
port without PVID is in a VLAN-filtering bridge, it accepts only tagged
frames, outer tagged ones as an 802.1ad port; standalone ports, which
can have VLAN filtering on, and every other state accept all. The
driver tracks the bridge membership itself, since DSA rolls back a
failed join through port_bridge_leave() before it clears dp->bridge.
VID 0 and the CPU path stay as they are. The register has this layout
on all four families; only RTL839x sets its address here, the others
keep their behaviour until tested.
HPE 1920-48G (RTL8393), lan48 a UCI trunk with VLAN 3 and 7 tagged,
lan47 an access port in VLAN 1: untagged and priority tagged ARP from
the host behind lan48 left lan47 tagged VID 0, 3 of 3 each; now none
does. STP, LLDP, LACP and EAPOL frames on lan48 still reach the CPU,
5 of 5 each, and VLAN 3 tagged frames pass. With a PVID on lan48 again,
and in a bridge without VLAN filtering, the ARP leaves lan47 untagged;
as standalone ports both accept all frames again.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25992
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The DR5018S uses the integrated IPQ5018 radio and two QCN6122 radios.
Move its calibration handlers to the matching IPQ5018 and QCN6122
firmware cases and use the corresponding ART blocks.
The ART blocks already contain the radio MAC addresses; remove the
redundant read-and-write operations.
Extend q6_region to cover the BDF and M3 dump addresses used by the
second QCN6122. Without this, its BDF address lies outside the reserved
WCSS region and the 6 GHz radio fails with "qmi ioremap error for
bdf_addr".
Tested on a Wallys DR5018S: all three radios register with their ART
MAC addresses and continue working after reboot.
Signed-off-by: Alan Gao <1226010136@qq.com>
Link: https://github.com/openwrt/openwrt/pull/25950
Signed-off-by: Robert Marko <robimarko@gmail.com>
hostapd_bss_update_beacon() calls ieee802_11_set_beacon() for any BSS,
and that call starts a BSS in the driver that does not beacon. With a
station on the radio, wifi-scripts brings every AP BSS up with
start_disabled, and the apsta_state handler of hostapd.uc stops the
interface while the station is not connected. A client that refreshes
the beacon in that window starts the BSS early. The new channel
context aborts the first scan of the station on mt76, and
wpa_supplicant does not scan again after an aborted scan, so the
station stays in SCANNING.
Only refresh a BSS that is started and has its beacon set, as
ieee802_11_update_beacons() does. The elements stay in the
configuration, and the start of the BSS sends them.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Prepare for the addition of a 'container' feed which is going to use
a Make function called 'BuildContainer' to declare packages. Include
that pattern in scan.mk, so `scripts/feeds` is able to find and install
such packages.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The /lib/apk/packages/<pkg>.list file is read by the default_postinst
and default_prerm helpers to find init scripts and uci-defaults of a
package. A layer 1 package keeps its installed record on the uvol
.meta volume and ships volume payloads, not root filesystem files, so
the list would sit on the overlay away from the record that describes
it. Do not generate it when APK_INFO_ selects layer:1; the helpers
treat a missing list as empty.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
APK_TAGS_ and APK_SCRIPTS_ are the only per-package hooks into the apk
mkpkg command line, so a package that needs another pkginfo field has
to smuggle it through one of them. Add APK_INFO_<pkg>, spliced into
the mkpkg invocation after the tags, for fields such as "layer:1".
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
procd emits a service.data.update event per data key when an instance
carrying data is freed. Reload on it so odhcpd withdraws ephemeral
dhcp service when a container instance disappears while its host
bridge survives, matching netifd's init script.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Without CONFIG_FB in the subtarget configs, kmod-fb builds FB as a
module, which makes XEN_FBDEV_FRONTEND and FB_HYPERV visible with no
value in any config. A non-interactive kernel build then stops at the
syncconfig prompt for XEN_FBDEV_FRONTEND, which defaults to m on these
subtargets because XEN is enabled.
Set both drivers off: simpledrm, hyperv_drm and the hvc console cover
the display of these guests.
Fixes: b091137d79 ("x86: 64, generic: replace fbdev with simpledrm")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The kernel virtual terminal serves a framebuffer or VGA text console and
the console hotkeys in drivers/tty/vt/keyboard.c: Alt+Fn and Ctrl+Alt+Fn
switching, Ctrl+Alt+Del, SAK and the show-state keys. With fbdev gone
there is no console on it, while the hotkeys stay live on any attached
keyboard, which on an appliance means an unauthenticated reboot.
Drop CONFIG_VT and the symbols that depend on it. The serial console and
/dev/console are untouched, and a userspace terminal such as kmscon needs
no VT: it falls back to its fake VT backend and reads input from evdev.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add support for the ZTE T5400, based on the Qualcomm IPQ5018.
Specifications:
- Qualcomm IPQ5018 SoC, 2x ARM Cortex-A53
- 512 MiB RAM
- 256 MiB SPI-NAND (Winbond W25N02JWZEIF)
- integrated IPQ5018 2.4 GHz 802.11ax radio, 2x2
- Qualcomm QCN9024 5 GHz 802.11ax radio, 4x4, PCIe Gen2 x2,
exposed to ath11k under the QCN9074 hw1.0 profile
- QCA8337 switch providing 3x LAN ports, with an SGMII uplink via
GMAC1/UNIPHY0 and CPU port 6
- IPQ5018 internal GEPHY providing the fourth RJ45 Ethernet port,
configured as WAN, via GMAC0
- reset and WPS buttons
- red and white status LEDs
- USB2 + USB3 Type-C port (not enabled)
- 12 V / 2.0 A (24 W) DC power input
UART:
The UART pads are on the component side near the SoC/RAM shield.
With the Ethernet ports at the bottom and antenna connectors on the
left, the pads are at the upper-right edge of the shield area. They
are not labelled on the PCB. Access requires removing the shield
cover.
With the board oriented as above:
upper signal pad: router TX
lower signal pad: router RX
The UART uses 1.8 V logic, 115200 8N1, without flow control.
router TX -> adapter RXD
router RX <- adapter TXD
No dedicated UART ground pad was identified next to the TX/RX pads.
The shield is connected to ground and can be used for adapter GND.
Other board points can be verified as ground by checking continuity
against the shield.
Ethernet and MAC addresses:
Stock firmware derives interface addresses from a single factory base
MAC stored in the "mac" NAND partition by adjusting only the fourth
octet (mac[3]) by a per-interface constant.
This is intentionally not reproduced bit-for-bit. The port uses the
generic "mac-base" nvmem layout already used by other devices in-tree,
which matches stock except when an offset causes the fourth octet to
cross a boundary.
- label / br-lan (LAN): factory MAC, unmodified
- eth0 / GMAC0 (WAN): factory MAC, mac[3] - 2
- eth1 / GMAC1 (LAN conduit): factory MAC, mac[3] - 1
- integrated 2.4 GHz radio: factory MAC, unmodified
- external 5 GHz radio: factory MAC, mac[3] + 10
The generic mac-base layout performs normal 48-bit arithmetic on the
whole address, while stock firmware wraps the fourth octet
independently. The results can therefore differ when the affected
octet crosses a 0x00 or 0xff boundary.
Replicating the stock fourth-octet-only arithmetic exactly would
require device-specific handling for this edge case.
The tested unit does not hit the edge case, so all derived addresses
match stock and remain unique. It is not known from a single unit how
often such a boundary case occurs across production T5400 devices.
Flash layout:
On the tested unit, OpenWrt is installed entirely in the existing
60 MiB "rootfs" partition, exposed as mtd17. The second stock
slot, "rootfs_1", is exposed as mtd18 and remains untouched.
The stock U-Boot boot chain is left unmodified. Its bootcmd=bootipq
boots the OpenWrt UBI from mtd17 using FIT config@mp03.1. No
persistent U-Boot environment, MIBIB or BOOTCONFIG changes are
required.
Flashing instructions:
Connect a TFTP host to physical RJ45 port 4 (GMAC0/eth0).
For the procedure below, configure the router as 192.168.0.1 and
the TFTP host as 192.168.0.22.
The stock U-Boot autoboot delay is one second. Interrupt autoboot over
UART to reach the IPQ5018# prompt.
Use the following transient network settings:
setenv serverip 192.168.0.22
setenv ipaddr 192.168.0.1
Stock backup:
Before the first persistent write, both stock rootfs slots can be
exported directly from stock U-Boot:
nand read 0x44000000 0x00a60000 0x03c00000
tftpput 0x44000000 0x03c00000 192.168.0.22:zte-t5400-mtd17-rootfs.bin
nand read 0x44000000 0x04660000 0x03c00000
tftpput 0x44000000 0x03c00000 192.168.0.22:zte-t5400-mtd18-rootfs_1.bin
The saved mtd17 image provides the tested stock recovery path.
Boot the OpenWrt initramfs image over TFTP:
tftpboot 0x44000000 openwrt-qualcommax-ipq50xx-zte_t5400-initramfs-uImage.itb
bootm 0x44000000
The initramfs runs entirely from RAM and does not modify NAND by
itself.
Transfer the following factory image to /tmp on the running
OpenWrt initramfs system:
openwrt-qualcommax-ipq50xx-zte_t5400-squashfs-factory.ubi
Verify that /dev/mtd17 is the "rootfs" partition before writing
the image.
Then write mtd17:
ubiformat /dev/mtd17 -y \
-f /tmp/openwrt-qualcommax-ipq50xx-zte_t5400-squashfs-factory.ubi
Power-cycle the router after the write completes. The unchanged stock
bootipq path then boots OpenWrt from mtd17.
Subsequent upgrades use the normal OpenWrt NAND sysupgrade path with:
openwrt-qualcommax-ipq50xx-zte_t5400-squashfs-sysupgrade.bin
Normal installation and upgrade leave mtd18, ART, the MAC partition,
MIBIB, BOOTCONFIG and bootloader partitions unchanged.
Testing:
Tested on real hardware:
- initramfs boot over UART/TFTP
- factory installation and persistent cold boot
- clean and configuration-preserving sysupgrade
- all four Ethernet ports with routed iperf3 traffic
- both Wi-Fi radios in AP mode and with routed iperf3 traffic
- LEDs and reset/WPS buttons
- restoration of the saved stock mtd17 image and vendor-kernel boot,
followed by a clean OpenWrt reinstall
Signed-off-by: Wojciech Zwolinski <wojciech.zwolinski0@gmail.com>
f8c2d64f546c uloop: allow reusing the existing environment for a new process
1294001ec6cb uloop: fix array reference
dd91bd8396a5 tests: add test cases for use-after-free gc bugs
d96db3ea5ef2 json: fix use-after-free of read method across iterations
8a74d68a34ab lib: anchor working values in filter/map/callfunc across user code
2225a502e805 socket: anchor poll() result across user fileno() callbacks
6a061cf4ef34 zlib: fix use-after-free of read method across iterations
dbe92bca180b types: free uvcount=0 resources on retain=true sweep
b0574723d27d zlib: zero-fill the output reserve window
cc0698b723ed serial: add module skeleton, build wiring and fd helpers
114ffb8962e2 serial: add raw termios access and termios constants
3bdeeb0b1ef7 serial: add setspeed, setraw and setblocking helpers
2b22a1ac41b0 serial: add modem control line access (out-of-band signals)
bed2a12895ce serial: add break, drain, flush and queue inspection
697fe07b14db serial: add setserial-style serial_struct access (Linux)
504530a290ad serial: add termios round-trip test
d6544940e762 ubus: fix reply leak in deferred data callback
dfca6438bc55 fs: reimplement popen() with fork/exec and true shell-free array support
9a87ce92207a debug: rework memdump to invoke fileno() on resource values
bed321219636 types: expose exception_type_strings array
67b13e97a643 lib: allow die() to re-throw exception objects
f2d62f82a522 lib: deduplicate source files by resolved path in vm->sources cache
255f69081304 socket: add CAN socket support
6adff7054893 rtnl: add CAN link type support
b79e20e1eee5 rtnl: add vxcan link type support
5870b9995ff4 rtnl: zero reserved struct headers in nested attributes
abb80c69ed2d include: add `unused` macro
ff509e0698dc include: register resource type prototypes with VM
c404fe2d6556 types: add per-instance prototype support for extended resources
7fb34544e945 ci: install libffi on test runners
23d5561b04b2 ffi: add LibFFI-based foreign function interface module
f26fabfe3ecb ffi: Add .cast(), .copy(), .string() as ctype instance methods
19ffa8aa3218 vm: release resource type prototypes before the final GC
48e38fc6376f tests: move ffi ctype instance method tests to proper place
4d687afdc216 compiler, vm: implement tail call optimization
7074129727d9 vm: indicate tail call optimized frames in stack traces
c3dc162f0abc lib: reject circular prototype chains in proto()
fe9e2947d351 compiler: reject adjacent template literals
e9972df30d14 linux/types.h: add 128-bit integer types
76baa6fc264a types: fix instance-proto lookup offset in ucv_key_get()
fbdd169efd17 ubus: store per-call request proto in the instance proto slot
0aab97337e21 ubus: drop per-instance proto when releasing resources
4eff16514b57 uloop: report signal termination in process callbacks
9ba6ea147dee headers: split public and private API headers
4c6e64425d14 ffi: reject function values passed as variadic arguments
af69c8d226a9 types, vm, lib: add metamethod support for prototyped values
1fd07aa2ba34 ffi: represent wrapped C functions as "ffi.cfn" resources
c966006d635f ffi, vm: support property syntax for cdata via __get__ / __set__
672439e7c530 vm: add debugger infrastructure (breakpoints, offsets, nested-exit fix)
a5b5925b53ab debug: add interactive command line debugger with -x/-X CLI switches
c2476472eb23 debug: add remote debug protocol with a client/server split
d968d33f455e debug: move the debugger onto a line-based protocol, split server/client
1a771e3c1ffd debug: add line editing, EVAL, Ctrl-C interrupt and tail-call annotations
26bfd5851bcc debug: synthesize PAUSED when a resuming command cannot resume
00a8fa9dea6c ffi: add ffi.closure() for explicit C function pointer creation
f061ee2e4369 ffi: fix Clang static analyzer false positives in closure code
8c017f171f0a types: Fix warning unused variable
0273114f13a6 types: raise type error for non-index array property sets in strict mode
d2c7b24e366e struct: rename ucv_as_double to ucv_as_float64
4dd080fe47ab headers: privatize uc_program_entry/ucv_closure_new/ucv_compare, add uc_program_main()
fda0498102bd lib, vm: replace ad-hoc value casts with ucv_as_* macros
ad88dfb621d6 metamethods: object-valued __get__/__set__/__delete__ delegate instead of mis-delegating return values
ea4c65b3c255 lib/fs.c: set errno on failed open()
10e44a53f808 lib.c: add optional offset argument to index() and rindex()
37d10ce70189 lib/io.c: fix io.pipe() jsdoc example
100f354f5d75 lib/math.c: export math constants (PI, E, ...)
ca70f18e31b3 lib/resolv.c: validate retries/timeout and guard retry-interval division
22f64a32f784 treewide: adjust references after jow-/ucode => ucode-lang/ucode move
6373faeac549 docs: fix deep merge example
1561320a00b4 lib,main,types: include json-c compat shim where needed
83ed2a8ba815 tutorials: fix claims that disagree with the interpreter
cef095d846bd Update CNAME
0c39aaa3d277 lib/log.c: accept arrays of channel and option names
ad3a5d580983 lib/log.c: use the documented defaults for omitted arguments
9e1d747640fe devcontainer: add development container configuration
d2c81218773b vm: clear a pending exception when entering uc_vm_execute
deb063dba30d build: add minimal emscripten/wasm32 build guards
75489e3ca2d5 source: initialize runpath in uc_source_new_buffer
4e65efb46854 build: add emscripten/wasm32 CMake support
24b0a2ad2e05 lib: underline the statement an error occurred in
926a2bf7e219 lib: name the offending expression when a call fails
068e7b222b4f ucode: fix socket bind() ignoring port argument
a4da50de2430 io: read the current termios before applying attributes
38f21be1bcbb uloop: redirect the task child's standard descriptors to /dev/null
af8a3830661a uloop: close the task output pipe even without an input callback
e6e03000000f uloop: release the handle when uloop_fd_add() fails
1e6b56558617 uloop: read task messages without losing them to EAGAIN
6e1592a2862f fs: report a write that only fails when the file is closed
d075095287c8 fs: keep the bytes a short read already delivered
8c01857cadd0 resolv: file each NS, CNAME and PTR record under its own type
4fec71ddd26d struct: decode any non-zero byte as true in native mode
edf5b32c5d4c zlib: inflate every member of a concatenated stream
b844c63b2381 resolv: release the TXT buffer when the record is malformed
664b70791957 compiler: unwind the nested function compiler on a bad argument list
ab988ea3159a struct: accumulate signed integers in an unsigned type
d996fade5f36 compiler: do not overflow int building the wildcard import operand
24df8d20bde2 vm: give division by zero the right sign, and NaN for zero over zero
a5c102ea2cfd tests: expect statement underline in forward declaration error
ccbe4228913d types: clear resource value slots after releasing them
c7e550d05ec4 socket: reject recv() lengths that overflow the printbuf offset
b1c7693fc5c6 socket: do not free caller-owned control data in sendmsg()
0630355f1ce6 socket: size msg_controllen from the payload, not the cmsg length
b51836754a9e types: do not dereference tagged values in ucv_string_length()
8fac388410d4 struct: bound the base64 pack field to the space reserved for it
b8a8646cbb2c struct: bounds-check the field offset when unpacking
5544af285082 struct: allocate the string header when packing zero bytes
8bd004a1a423 lib: free the string match() allocated, not the one it advanced
e98574152fcb io: return ENOMEM rather than aborting on an oversized read
9b45eef92402 io: give ioctl() a heap buffer the kernel cannot overrun
531c09289a4f resolv: check the SOA rdata bound after the two names
4d12bc9af856 ubus: detect cycles when converting values to blobmsg
5bcb94aec84d vallist: reject an inline string constant longer than its buffer
cd73805bcb0f program: validate the export name length when loading bytecode
fe546444f289 program: terminate the strings the bytecode loader reads
ba4b639597e6 compiler: do not return a bytecode program that was just freed
19247f51e22a compiler: unwind the patchlist when an expression fails to parse
58774dd67277 rtnl, nl80211: check every netlink reserve return
8fff82c22a7c fs: stop readfile() losing data when the buffer cannot grow
39454f8830a9 zlib: act on the output reserve failing
a90a1d2c9ebe lib: size the b64dec output buffer from the ceiling
ad3be9a33322 ubus: bound the nesting depth when decoding a message
953cd5a9ea23 ubus: do not close a descriptor the script still owns
5a2c5d93ce53 lexer: discard the partial string when an escape is rejected
428232cfce1c vm: range-check local slots, upvalue indices and stack depth
e170905c143b program: bound the counts and lengths the bytecode loader reads
6065b2ce63cc program: bound an export name by the bytes left in the file
e1a8b8cf5d21 compiler: do not call a missing infix handler inside parentheses
2cd8d1b9726b compiler: do not read the last instruction of an empty chunk
468994d345ff compiler: compare local names without assuming they are strings
04d59c6395de compiler: guard the remaining local name comparisons
19656543aac0 types: dispatch __delete__ for keys arrays and resources cannot store
dd57d12404ec compiler: do not drop the loop condition at chunk offset 0
dc9386a190fb jsdoc: accept a doc comment at the very start of a file
04d3ae59abd4 serial: add JSDoc documentation for module functions and constants
959206e27878 netaddr: add new netaddr module ported from LuCI's luci-lib-ip
904358422b3b docs: restructure tutorials around the new manual
af9324c9e7c5 readme: point at the new project sites
212dd12150b6 lib: optimize trim(), ltrim(), rtrim()
2c8c36be454d struct: fix infinite loop in grow_buffer() for small sizes
131c041a61d5 platform: export the macOS pipe2() replacement to modules
e6a1f945db65 fs: find the PATH separator without strchrnul()
4711d3c2c5dc lib: reject mutations of the container being sorted
f0a4664b97b0 rtnl: recover the event listener from receive buffer overruns
eaa09ca64305 rtnl: free the partial reply of a request that fails
5c655c357c53 rtnl: return true for an acknowledgement without data
0bfb7b97bf2f nl80211: recover the event listener from receive buffer overruns
30dfbb218fa1 nl80211: return true for an acknowledgement without data
395cfeead63f nl80211: fail a request whose reply the event socket lost
f8f8fc55126f nl80211: run listener callbacks outside of a request
f60d9b01b59c nl80211: free the partial reply of a request that fails
234e524f7ae0 nl80211.h: update to mainline d24e8ac715de
80be3ab390ee nl80211: request and decode the per-link statistics of a station
c51e15921dc6 lib: fix module namespace export mapping for linked imports
b5ce44358354 compiler: report strict redeclarations at the redeclaring name
e22e4362e6d5 tests: allow restricting a testcase to platforms
ef5b35ea145e tests: do not check forked children with valgrind
a6b8bfe1b582 tests: allow a testcase to skip itself
7fe06b46f3c5 uloop: expose ULOOP_ERROR_CB
115d308a8514 uloop: release timers and handles once they are finished
0c1b005cd0d3 uloop: disarm a timer on set() without a timeout
986390458007 uloop: disarm an interval on set() without a value
503a9bfcffd2 uloop: test that a finished task closes its pipes
f4fa308dc4f2 uloop: keep a task alive while its output callback runs
fa81c11ff2a7 uloop: release a finished task after a callback exception
21a2140f2324 uloop: reject a handle without an IO event
0ea69b1e736a uloop: do not unregister a reused descriptor number on handle delete
ddb06a197ef5 compiler: make strict mode function names constant bindings
620eff6a772d uloop: keep a handle alive while epoll may still report it
1942e5fce058 uloop: disable a handle whose removal fails
9a3acc008531 uloop: expose ULOOP_PRIORITY
1f54bd285339 uloop: read task messages without blocking the event loop
c2319e9b26bb uloop: close the task pipes when fork() fails
db2191ab014e devcontainer: remove formatting options managed by editorconfig
486104700227 compiler: account for nested imports in the importer's export offset
be870dd61b95 types: give the collector a dedicated mark bit
2e0b25a23c09 socket: fall back to SO_TIMESTAMPNS for the OLD alias
4141cb38f398 ubus: pass an exception of a deferred completion callback to the guard
0fcd31713fee ubus: do not pass exit() in a callback to the guard
c80855059801 socket: fix the file descriptor on 64-bit big-endian
a18924e53045 tests: move the socket poll test to the lib_socket directory
f4ce7eb00d22 source: allocate and release a source in one place
8d25f029d96b compiler: give dynamic loads the position of the import
08f3be072dd0 vm: read the callee type before uc_vm_call() runs it
3c9f214a2d56 serial: add RS485 mode access (Linux)
100d19ac369f vm: keep the exception of a module that failed to load
3c0a3c7c1023 vm: read the importing frame after the module load
2cf103aded34 tests: skip the RS485 serial test under valgrind
5c8d6d544730 lib: fix stack use after scope in compile config parsing
0dc042eefa5b source: rework the text access API
1dd1f88c81bb source: close the file of a source after its compilation
69db946e7c39 lib: remove the source cache of loadfile()
4436a931dc38 compiler: start each compilation from a clean source
4503599e49f1 source: read a file that cannot seek into a buffer
330cdab782be compiler: release the name list of an import() statement
153c627fd445 lib: do not store a failed module in the module table
3bf604919140 vm: keep the exception of a failed dynamic module load
71b4a144b438 lib: compile a file loaded from a module body as a program
080cbd79727f lib: release the main function of a required file
6c30ef7fd30c vm: release the previous binding of an import
6e404de5c0b1 vm: let the main closure of a program own its module exports
0adb7ba6b4d1 vm: do not interrupt the exports of a module
8cfcffe5abcd lib: find the exports of a precompiled module by their count
53ebdff102e6 vm: size object literals from the compiler's key count
f8a757295dc9 types: start array entry vectors at 2 slots
00091f829801 types: avoid accessing values after converter exit
78f83f8d6b59 lib: take one reference on the prototype in proto()
96cdb4549b59 compiler: fix endless loop on syntax errors in template placeholders
fb54dfe1733c types: release the old instance prototype of a resource
struct uc_vm grows at its end, and programs such as hostapd embed it, so
bump PKG_ABI_VERSION.
Add packages for the new ffi, netaddr and serial modules. Turn them off
for the host build, since ffi is otherwise built whenever libffi happens
to be in the staging directory.
The project moved to ucode-lang/ucode, so update PKG_SOURCE_URL.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The ucode ffi module needs libffi. Move the package from the packages
feed (commit 3b7cdf03a6f2) without changes, so that the core tree
provides it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
A large number of generic procd, ujail and container related fixes and
improvements. See https://git.openwrt.org/project/procd/log/ for the
detailed history since commit 6a22d39648.
uxc keeps the per-run files of a container, the last exit record, the
generated environment file and the resources override, in
/tmp/run/uxc/<name>/. The pre-remove hook only stops a package
container and deletes it from procd, so that directory stays behind
until the next reboot. Remove it in the post-remove hook together with
the state and settings of the container.
When a container package is upgraded to a new image, the pre-install
hook only signals the old container and leaves its instance in procd.
The bring-up after the install then adds the container with once, which
procd refuses for a container it already has, so the new image starts
only after the next reboot.
Delete the old container in the pre-install hook, as the pre-remove hook
does. uxc kill without a signal returns once the container has stopped,
procd forgets a deleted container, and the bring-up starts the new
image.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add debug-level tracing for calibration requests, readiness polling,
attempts and results, retries, coefficient refinement and mode-change
invalidation. Record symbol-error samples, attempt duration and mutex
wait time to diagnose acquisition and scheduling issues.
Demote per-attempt link and error-count failures to debug level since
later attempts can recover. Include measured counts, thresholds, mode
and attempt context, sharing named XSGMII limits between checks and
messages. Retain warnings for exhausted attempts and errors for failed
register accesses.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Link: https://github.com/openwrt/openwrt/pull/25882
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The clock-ready debug readback is used by the SDK's 10G SerDes setup
sequence. Restrict polling to 10G-type SerDes while retaining the
existing exclusion for OFF mode.
This avoids applying the check to the 5G QSGMII SerDes 0 and 1, which can
report clock synchronization failures despite working links.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Link: https://github.com/openwrt/openwrt/pull/25882
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Store the calibration attempt count per SerDes and execute one full
attempt per worker invocation. Requeue failed attempts after one second,
up to a total of three attempts, checking RX readiness on each run.
Reset the count when arming a new configuration. Readiness polling does
not consume attempts, and success or exhaustion finishes the request.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Link: https://github.com/openwrt/openwrt/pull/25882
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Zero symbol errors can also be observed without an established receive
link. Require physical RX link-up after the error measurement window
before accepting a calibration attempt.
Reuse the 10G receive-link indication for 10GBase-R and USXGMII. For
XSGMII, require the full link-status bitmap on both backing digital
SerDes, accounting for the logical-to-physical mapping.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Link: https://github.com/openwrt/openwrt/pull/25882
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Apply the RX baseline in post-config and arm delayed work per SerDes.
Wait for RX_IDLE to deassert before running the full calibration
sequence, retaining initialization on each of up to three attempts.
Serialize the worker with PCS configuration, invalidate pending requests
on mode changes, and drain the work through a managed cleanup action on
probe failure or device removal.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Link: https://github.com/openwrt/openwrt/pull/25882
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The monitor rx length fix (949-wifi-ath11k-fix-monitor-rx-pktlen.patch)
logs every frame it trims with ath11k_warn. A monitor interface on
ipq807x/ipq60xx trims nearly every frame, so this fills dmesg and logread
with "DELIVER trim8" warnings: on an Arista C-360 with a monitor-mode
scan radio they were 960 of 1043 logread lines, pushed everything else
out of the log, and flooded the serial console.
Log it with ath11k_dbg (ATH11K_DBG_DATA) instead, as the rest of the
monitor path does. The trim itself is unchanged.
Tested on an Arista C-360 (ipq807x) with a monitor interface in use (a
scan radio's monitor survey): no trim messages in dmesg.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25988
Signed-off-by: Robert Marko <robimarko@gmail.com>
The XikeStor SKS8300-12x V2 is a managed switch based
on RTL9313 with 12 SFP+ ports.
Device specification:
- SoC: Realtek RTL9313
- RAM: 256MiB
- Flash: 32MiB Macronix SPI NOR
- Ethernet: 12x SFP+ cages
- Button: hard reset
- System LED: GPIO 0
- Bootloader: U-Boot 2011.12.(3.6_CURRENT)
- Vendor board model: RTL9313_12XGE
- UART: Cisco style RJ45 port on the front.
- Settings: 115200n8
- Power: 100-240 VAC 50/60 Hz C13/C14
- Monitoring: LM75
- Fan controller: Maxim 6651
Notes:
The MAC address can be extracted from the jffs2
partition in the file factoryData at offset 0x80.
As the jffs and jffs2 partitions are formatted
with 4K erase sectors this requires the kernel to be
configured with CONFIG_MTD_SPI_NOR_USE_4K_SECTORS or
dumping it with jefferson.
The switch has a RTL8231 connected to it via SMI
which seem to control the port LEDs.
"rtk network on" initializes the RTL8231 so the LED
works but can't be controlled via OpenWrt.
Booting the initramfs image:
1. Connect to the serial port, power on the device and press Esc
before autoboot starts to get to the u-boot CLI.
2. Run "rtk network on".
3. Boot the initramfs image.
Via YMODEM:
Run "loady 0x82000000".
And then "bootm 0x82000000".
Via TFTP:
Connect a SFP module or a DAC to port 1.
Run "rtk 10g 0 fiber1g".
If using a DAC replace fiber1g with the correct type.
The default TFTP server IP is 192.168.1.111.
Run "tftpboot 0x82000000 <image name>".
Where "<image name>" is the name of the initramfs image.
And then run "bootm 0x82000000".
Installation:
After booting the initramfs image transfer the sysupgrade
to the device and run sysupgrade <path to sysupgrade image>.
Set the bootcmd u-boot variable to "rtk network on ; boota"
and save the variable and reset the switch.
Signed-off-by: Erik Larsson <who+github@cnackers.org>
Link: https://github.com/openwrt/openwrt/pull/25782
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
This enables the two SFP cages for the Netgear GS310TP switch. The
GPIO numbers used have been harvested from the stock firmware's
"show tech-support" command.
Tested on real hardware with various optical and RJ45 transceivers.
Signed-off-by: Shine- GH <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/25987
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Linux 6.18 made migrate_disable()/migrate_enable() inline in
linux/sched.h. They use RQ_nr_pinned from include/generated/rq-offsets.h,
which the kernel only generates during 'make prepare'. bpf-headers only
runs archprepare, so the header is missing and BPF programs including
linux/sched.h fail to build.
Running 'prepare' instead is not an option: it compiles kernel objects
(scripts/mod, bounds.c, asm-offsets.c, rq-offsets.c) with the BPF clang
using the MIPS kernel flags, which fails right away.
Generate a placeholder header, as is already done for timeconst.h. The
offset value is irrelevant for BPF programs, which cannot call these
functions.
Signed-off-by: Sander van Deijck <sander@vandeijck.com>
Link: https://github.com/openwrt/openwrt/pull/25964
Signed-off-by: Robert Marko <robimarko@gmail.com>
Rename ppe-qos to qca-ppe-qos so the package name clearly identifies
it as specific to the Qualcomm PPE. Rename the UCI config, service and
hotplug hook to match.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support for AVM FRITZ!Box 4050, an IPQ5018 based WiFi 6 router.
Hardware
--------
SOC : Qualcomm IPQ5018 2x A53
RAM : 512MiB DDR3L Winbond W634GU6QB-11
Flash : 128MiB Winbond W25N01GWZEIG
ETH : 4x GbE
Switch : Qualcomm QCA8337
WiFi : IPQ5018, QCN6102
USB : 1x USB 2.0
Buttons : WLAN, DECT, WPS
LEDs : Power, WLAN, DECT, WPS, Info green, Info red
DECT : DCX81AC0CFAE3FNC
Power : DC 12V 1.5A
UART
----
4 holes, vcc is square
gnd - rx - tx - vcc
3.3v
Installation
------------
1. Download scripts/flashing/eva_ramboot.py, initramfs image and sysupgrade.bin
2. Connect to lan1 and set host ip to 192.168.178.2
3. Power the device and run
`./eva_ramboot.py --ramsize 0x20000000 --ramstart 0x40000000 192.168.178.1 <initramfs image>`
when only the 'Power' led blinks
4. Set host ip to 192.168.1.2 and connect to LuCi on 192.168.1.1
5. Sysupgrade in LuCi
Revert to OEM firmware
----------------------
Follow the OEM guide: https://fritz.com/en/pages/recover
The recovery process also works on Linux using Wine.
MAC Addresses
-------------
WAN : D4:24:DD:XX:XX:FF
LAN : D4:24:DD:XX:XX:02 (label mac)
2.4GHz : D4:24:DD:XX:XX:04
5GHz : D4:24:DD:XX:XX:05
Not Supported
-------------
DECT
analog phone port
Signed-off-by: Leonard Anderweit <leonard.anderweit@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25056
Signed-off-by: Robert Marko <robimarko@gmail.com>
The ingress VLAN rule of a filtering bridge VLAN keyed the CPU port as
well, so every frame the host sent with that VID was classified into the
VLAN's VSI, also when it was addressed to a port outside the bridge. A
standalone port, or the conduit of a QCA8337 behind the PPE, then dropped
it. On the RT-AX89X a VLAN-aware bridge of lan3 and 10g-copper with PVID
10 passed no traffic towards lan3.
The host sends each frame already formatted for the port it names, so
leave the CPU port out of the rule and keep it in the VSI's members.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
The EDMA block has a reset line of its own, but the driver asserts it
only at probe and when it rebuilds the rings. qca_edma is built in and
the switch sits on the conduit, so a reboot is the only other way back
to the engine's power-on state. Implement the ethtool reset op for
ETH_RESET_DMA with the rebuild ring resizing already uses.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
qca_ppe_setup() discards what ppe_fdb_flush() returns, so a flush that
never completes leaves the entries left behind by the boot loader in
place without a trace. Warn when it times out.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
edma_misc_irq_handle() reads MISC_INT_STAT and returns without clearing
the condition, so a condition that persists keeps the interrupt asserted
and the handler runs back to back. Mask the misc interrupt on the first
report, as qca-nss-dp does in edma_handle_misc_irq(). edma_hw_init()
unmasks it again.
Fixes: bdb0b722b7 ("qualcommax: add EDMA driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
edma_irq_disable_all() clears a TX interrupt mask for every TX
descriptor ring, but the TX interrupt registers come one per completion
ring. IPQ807x has eight completion rings, so indices 8 to 23 land in the
RXFILL block and zero the producer index and the interrupt mask of fill
rings 0 to 7. Bound the loop by the completion ring.
Fixes: bdb0b722b7 ("qualcommax: add EDMA driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
The CPU port reports the MAC counters of a MAC it does not have, all
zero, and none of its queue counters. Report its unicast and multicast
queue counters instead, as for the user ports.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
The queue manager has a WRED threshold pair per colour on every unicast
queue, but only a colour-blind red is offloaded. Offload gred in WRED
mode on the same queues a red takes: DP 0 sets the queue limit and the
green thresholds, DP 1 and 2 the yellow and red ones below it, and the
queue turns colour aware; ECN and per-VQ averaging are refused. On
IPQ8074, two uploads under the 165 Mbit/s WAN shaper, one marked yellow,
ran at 14/47/6 and 140/71/146 Mbit/s with only yellow dropped
(572/343/162), against 110/135/80 and 43/25/82 under a colour-blind red.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
sch_gred is only available inside kmod-sched. Package it on its own, 9K
compressed on ipq807x. kmod-sched depends on it, so what it installs is
unchanged.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
An ingress flower classid sets skb->tc_index, which gred reads as the
drop precedence, but the driver ignores the classid and offloads the
rule without it. Map classid :0 to :2 to the ACL action's internal drop
precedence, green, yellow or red, and refuse any other classid.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
A port's egress queues drop frames that tx_dropped never shows: the
counter it folds sits ahead of the queues. Add the drops of the port's
unicast and multicast queues to tx_dropped, folded like the others. On
IPQ8074 a port shaped to 20 Mbit/s under a download reports the same
drops in tx_dropped as its queues do in ethtool -S (618, 539 and 503).
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
VSI_TAG_EN in PORT_EG_VLAN is set out of reset, so every port takes its
egress tag mode from the per-VSI table instead of its own. On the CPU
port this strips the C-tag of a frame that enters a VLAN-unaware bridge
port tagged, and a VLAN upper of the bridge never receives it. Clear the
bit on every port at setup; a VLAN-filtering port sets it again.
Fixes: 142104bb90 ("qualcommax: add PPE driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
The TX preheader can carry a C-tag or S-tag for the switch to insert,
but the driver makes the stack push every tag into the frame. Add
NETIF_F_HW_VLAN_CTAG_TX and NETIF_F_HW_VLAN_STAG_TX: the tag is flagged
in pre2, its TCI written to pre3 and the insertion commanded in pre4.
They are in vlan_features, so the DSA user ports and their VLAN uppers
hand their tag to the conduit out of band. The switch inserts a C-tag
behind an S-tag already in the frame and drops a tag of the type the
frame starts with, so for those frames the stack still pushes the tag.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
The receive ring can strip the C-tag of a frame and report it in the
preheader, but the driver leaves every tag for the stack to pull. Add
NETIF_F_HW_VLAN_CTAG_RX: the ring strips the outer C-tag and the driver
hands it up out of band. A C-tag below an S-tag is not stripped and
stays in the frame.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
A GRO aggregate that outgrows MAX_SKB_FRAGS keeps its further segments
on a frag_list, and without NETIF_F_FRAGLIST the stack segments it
before it reaches the conduit. Write the heads and fragments of the
frag_list skbs to descriptors like any other fragment. An aggregate
that needs more than 32 descriptors is segmented in software by
ndo_features_check rather than linearised.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>
port_bridge_leave() marks the port's VSI invalid, and a port without a
valid VSI drops every frame it receives, so a port taken out of a bridge
stops receiving until the next probe. Program VSI 0, which carries the
standalone ports, as probe does.
Fixes: 142104bb90 ("qualcommax: add PPE driver")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25700
Signed-off-by: Robert Marko <robimarko@gmail.com>