Scripts need the map type to know how to interact with a map, e.g.
per-CPU value handling or keyless queue/stack semantics. Add an
info() map method returning type, key/value size and max_entries,
along with BPF_MAP_TYPE constants for comparison.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Add consumer support for BPF_MAP_TYPE_RINGBUF and
BPF_MAP_TYPE_PERF_EVENT_ARRAY maps. ringbuf(callback) and
perf_buffer(callback, pages, lost_callback) map methods return a
buffer resource with fileno, poll and consume methods. The fileno
method exposes the epoll fd and matches the interface uloop.handle()
expects, so a buffer can be passed directly to uloop for event loop
integration.
The ring buffer callback receives the sample data and may return a
negative integer to stop consumption; the perf callbacks additionally
receive the CPU number.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Updates on array/hash-of-maps and prog array maps take the fd of the
inner object as a 4-byte value. Accept bpf.map and bpf.program
resources as map values and convert them to their fd.
Lookups on map-in-map types return the inner map id; add open_map_id
and open_program_id to obtain a usable object from such an id.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Queue and stack maps have zero-sized keys and require a NULL key
pointer; the kernel rejects any non-NULL key with EINVAL, making
these maps unusable. Accept a null key argument on maps without a
key, mapping get() to peek, set() to push and delete() with return
to pop.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Lookup, update and lookup-and-delete on per-CPU maps use buffers of
roundup(value_size, 8) * num_possible_cpus bytes. The previous code
sized buffers for a single value, so get() on a per-CPU map made the
kernel overflow the stack buffer and set() passed undersized data.
Track the map type and size the buffers accordingly. get() and
delete() with return now yield an array with one value per CPU, set()
accepts either such an array or a single value replicated to all
CPUs.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Failures in the detach path returned NULL without recording any error
state, so error() reported a stale or empty error. Attach failures
reported a hardcoded ENOENT regardless of the actual cause. Record
errno for all failures; if_nametoindex, bpf_tc_attach and
bpf_tc_detach all set it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
bpf_object__next_map does not set errno when it runs out of maps, so
the reported error code was whatever errno happened to hold. With
errno 0 the failure was invisible to error(). Report ENOENT instead.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The iterator key buffer is a flexible array member placed directly
after a bool, leaving it without natural alignment for the u32/u64
loads in next_int. Copy the key via memcpy instead of dereferencing
a misaligned pointer, which traps on strict-alignment targets.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
uc_bpf_map_arg converted integer arguments through a single static
buffer. When map set was called with both an integer key and an integer
value, the second conversion overwrote the first, so the element was
written at the wrong key. Convert into a caller-provided buffer
instead.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
uc_fn_thisval can return NULL when a method is called with a foreign or
missing this context. pin, foreach and the iterator next functions
dereferenced the result without checking it, crashing the VM.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Firmware image signing in append-metadata/append-gl-metadata was conditional
only by the presence of the build key. Add an explicit SIGN_FIRMWARE option
(default enabled except with BUILDBOT) so appending the fwtool signature can be
toggled on its own.
It's disable on buildbot since we use a decentralized building with no
individual keys on builders. Instead, a fake key is currently used, which adds
an insecure signature.
The future of signing firmware and key distribution across the build
infrastructure should be discussed separately.
Link: https://github.com/openwrt/openwrt/pull/24291
Signed-off-by: Paul Spooren <mail@aparcar.org>
Add support for the Comfast CF-EW84 based on the MediaTek MT7621
SoC.
Hardware:
CPU/SoC: MediaTek MT7621DA
RAM: 128 MB DDR3
Flash: Macronix MX25L12805D 16 MB
Switch: MediaTek MT7530
WiFi 2.4 GHz: MediaTek MT7603E
WiFi 5 GHz: MediaTek MT7613B
Ports: 1x WAN, 2x LAN (10/100/1000 Mbps)
LEDs: Power, WAN, LAN1, LAN2, WLAN
Buttons: Reset
UART: through-hole on PCB
pinout: RX, TX, GND, 3.3V
settings: 115200n8
Flash instructions:
1. Connect the bundled PoE injector to power.
2. Connect the PC to the LAN1 or LAN2 port of the device.
3. Configure a static IP on the computer's Ethernet adapter:
IP: 192.168.1.x (x = 2 to 254)
Mask: 255.255.255.0
Gateway: empty
DNS: empty
4. Connect a second Ethernet cable to the PoE port of the
bundled injector.
5. Press and hold the reset button on the device.
6. While holding the reset button, plug the other end of the
second Ethernet cable into the WAN port.
7. Wait at least 3 seconds, then release the reset button.
8. Browse to http://192.168.1.1: the MediaTek U-Boot System
Recovery page should appear.
9. Click Upload and select the *-sysupgrade.bin firmware file.
10. After flashing completes, browse to http://192.168.1.1
again: the LuCI login page should appear.
Factory data:
2.4 GHz EEPROM: factory offset 0x0000
5 GHz EEPROM: factory offset 0x8000
LAN MAC address: factory offset 0xe000
WAN MAC address: factory offset 0xe000 (+1)
LED layout:
The Comfast CF-EW84 has five physical LEDs, but only the WLAN
LED is software-controllable through the Linux GPIO-LEDs
subsystem.
Signed-off-by: Vincenzo Suraci <vincenzo.suraci@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24112
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The GS1900-10HP B1 keeps the RTL8380M SoC and port layout but replaces the
A1's Broadcom PoE (Gen1) with a Realtek RTL8238 PSE fronted by a Nuvoton
MCU speaking the Gen2 protocol at 115200 baud. It reuses the shared
rtl8380_zyxel_gs1900-10hp.dtsi and only overrides the PSE compatible and
UART speed.
Specifications:
- SoC: Realtek RTL8380M
- Ports: 8x 10/100/1000 (PoE+), 2x SFP
- PoE: Realtek RTL8238 via Nuvoton MCU (Gen2, UART 115200)
Tested on hardware: driver probes RTL8238B (8 ports), per-port control via
ethtool, verified across a cold power-cycle.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/24283
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The GS1900-10HP A1 (Broadcom BCM59121 behind a Gen1 MCU on UART) was
driven by the userspace realtek-poe daemon. Move it to the in-kernel
realtek-pse-mcu (Gen1) driver so PoE is managed through the standard
PSE-PD / ethtool interface, and factor the board description shared with
the upcoming B1 variant into rtl8380_zyxel_gs1900-10hp.dtsi.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/24283
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The RTL839x has the following hard-coded bus topology:
- Bus 0: Port 0-23
- Bus 1: Port 24-51
So the bus number and the PHY address in the dts are mostly
ignored. Nevertheless fix the assignment for the Zyxel GS1920.
This does not change the functionality it just describes the
hardware correctly. While we are here add the PHY package
description too.
Link: https://github.com/openwrt/openwrt/pull/24281
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Remove the .github/workflows/labeler.yml workflow and enable the "enable_labeler_yml" option in .github/formalities.json to let the webhook bot handle pull request labeling. This avoids running on GitHub Actions, so it is faster and uses fewer resources.
It uses the existing .github/labeler.yml for labels.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24256
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit migrates the repository validation to a webhook-based bot instead of the GitHub Actions workflow (.github/workflows/formal.yml).
Since the bot handles stable branch labeling automatically (via the "branch_labeling: true" configuration option), the redundant branch check and labeling steps are removed from .github/workflows/labeler.yml.
The following configuration choices are applied in formalities.json:
- check_space_after_assignment: false (Disabled temporarily to catch any issues since it is a newly implemented check)
- check_makefile_indentation: false (Disabled temporarily to catch any issues since it is a new feature)
- check_patch_headers: 'warning' (Changed to warning instead of hard error since many legacy patches lack headers)
- enable_stale_bot: false (Disabled for now)
Other configurations can be adjusted in formalities.json based on the openwrt-bot-worker repository [1].
[1] https://github.com/openwrt/openwrt-bot-worker
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24256
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit adds initial support for Nokia XG-040G-MF XG-PON ONU.
Specification
-------------
- SoC : Airoha AN7583DT (dual-core ARM Cortex-A53 1.2 GHz)
- RAM : 512 MiB DDR4 (Winbond W664GG6RB-06)
- Flash : SPI-NAND 256 MiB (GigaDevice GD5F2GM7UEYIG)
- WLAN : -
- Ethernet : 1x 2500 Mbps (LAN1, Airoha EN8811HN)
3x 10/100/1000 Mbps (LAN2-LAN4, Airoha AN7583 SoC switch)
- XG-PON : ECONET EN7572, SLIC: MaxLinear PEF32001VSV12
- USB : 1x USB2 (with power control via gpio)
1x USB3 (with power control via gpio)
- Buttons : Reset
- LEDs : 1x Power (green)
1x WAN (green)
1x WAN (red)
4x LAN (green)
2x USB (green)
- Power : 12 VDC, 1 A
Unsupported functions, limitations and known issues
---------------------------------------------------
1. XG-PON won't be available after installing OpenWrt.
2. USB ports: AN7583 SoC in OpenWrt doesn't support USB at this time.
Installation (UART)
-------------------
1. Attach UART and run picocom:
picocom -b 115200 --send-cmd "sb -vv" /dev/ttyUSB0
2. Interrupt boot process by pressing Enter key to enter u-boot
Username: telecomadmin
Password: nE7jA%5m
3. Start download firmware via ymodem protocol (via UART):
loady 0x85000000
4. Press Ctrl + A then Ctrl + S in the picocom terminal (if you are using
a different terminal, please refer to the documentation) to start
upload OpenWrt initramfs image using ymodem protocol. Enter local path
to the OpenWrt initramfs image and press Enter.
5. Load OpenWrt initramfs image from the memory:
bootm 0x85000000
5. Sysupgrade with OpenWrt sysupgrade image
Alternative for the p.3-4. Load and boot OpenWrt initramfs from tftp IP
192.168.1.254:
tftpboot 0x85000000 192.168.1.254:openwrt-initramfs-uImage.itb
bootm 0x85000000
Backup and installation (without UART)
--------------------------------------
1. Unplug Fiber
2. Make ONU Reset
3. Navigate: http://192.168.1.1
Username: CMCCAdmin
Password: aDm8H%MdA
4. Go to Apps -> Home Storage -> FTP and check Enable FTP
5. Go to Apps -> Home Storage -> SAMBA Sharing and check Enable Samba
6. Visit the following URL to open Telnet:
http://192.168.1.1/system.cgi?telnet
7. Telnet account login:
Username: user
Password: <see ONU label>
8. Get root privileges:
su user_ftp
Password: <see ONU label>
9. Copy 'squashfs-factory-kernel.bin', 'squashfs-factory-rootfs.bin' and
'OpenWrt.mtd2.u-boot-env.bin' (backup of 'u-boot-env' partition from
the another Nokia XG-040G-MF with OpenWrt installed)
9. Attach USB flash drive and check the new dir in /mnt:
ls /mnt
10. Change current dir to the flash drive (change D to your flash drive
label):
cd /mnt/D
11. Make backup:
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; \
do cat /dev/mtd$i | gzip -9 > mtd$i.bin.gz; done
12. Check image sizes:
ls -l | awk '{if(NR>1) {$5=sprintf("0x%x", $5); print}}'
13. Write images:
mtd_debug erase /dev/mtd0 0x60000 0x20000
mtd_debug write /dev/mtd0 0x60000 0x20000 OpenWrt.mtd2.u-boot-env.bin
mtd_debug erase /dev/mtd14 0x0 0x2880000
mtd_debug write /dev/mtd14 0x0 0x3e6cfc squashfs-factory-kernel.bin
mtd_debug erase /dev/mtd11 0x0 0x80e0000
mtd_debug write /dev/mtd11 0x0 0x440000 squashfs-factory-rootfs.bin
0x3e6cfc - size of your 'squashfs-factory-kernel.bin'
0x440000 - size of your 'squashfs-factory-rootfs.bin'
14. Reboot:
reboot
Recovery
--------
The same as described in Installation (UART).
Return to stock
---------------
1. Follow the steps 1-5 of the Installation (UART)
2. Once in OpenWrt upload you backup to the /tmp dir of the router:
scp -O mtd16.bin.gz root@192.168.1.1:/tmp
5. Connect to the router using ssh and install kmod-mtd-rw:
apk update && apk add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
6. Unlock bootloader:
mtd unlock bootloader
7. Restore stock:
zcat /tmp/mtd16.bin.gz | mtd write - all_flash
8. Reboot:
reboot
Stock layout
------------
+-------+------------+---------+---------+
| mtd | label | start | size |
+-------+------------+---------+---------+
| mtd0 | bootloader | 0 | 80000 |
| mtd1 | romfile | 80000 | 40000 |
| mtd14 | nsb_master | c0000 | 2880000 |
| mtd15 | nsb_slave | 2940000 | 2880000 |
| mtd6 | bosa | 51c0000 | 40000 |
| mtd7 | ri | 5200000 | 40000 |
| mtd8 | flag | 5240000 | 40000 |
| mtd9 | flagback | 5280000 | 40000 |
| mtd10 | config | 52c0000 | a00000 |
| mtd11 | data | 5cc0000 | 80e0000 |
| mtd12 | oopsfs | dda0000 | 400000 |
| mtd13 | log | e1a0000 | a00000 |
+-------+------------+---------+---------+
UART
----
A view from the back side of the PCB:
------------------------
| GND RX TX
| X X X
Connection parameters:
115200, 8N1, 3.3V
MAC addresses
-------------
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| LAN | e0:xx:xx:xx:xx:a0 | label |
| WAN | e0:xx:xx:xx:xx:a1 | label + 1 |
+---------+-------------------+-----------+
The LAN MAC (hex) was found in 'ri', 0x3e
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23809
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Move shared DTS properties for Nokia XG-040G-MD and XG-040G-MF into
common DTSI files to reduce duplication:
- an758x-nokia_xg-040g-common.dtsi
- an758x-nokia_xg-040g-stock-parts.dtsi
- an758x-nokia_xg-040g-ubi-parts.dtsi
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23809
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Configure shared LAN PHY LED templates with standard LED_FUNCTION_LAN
macros and initial function-enumerators. These nodes remain disabled
by default.
Board-specific DTS files enabling them must provide the required 'color'
property, and must override the 'function-enumerator' values if identical
colors are used to guarantee unique sysfs names.
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23809
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Currently assembly code of the Kernel may contain the build path, resulting in
unreproducible firmware images (and Kernels). Fix this by adding a iremap
KAFLAG.
Before:
strings "/path/to/vmlinux" | grep linux-6.18.38
/path/to/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.18.38
/path/to/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.18.38
After
strings "/path/to/vmlinux" | grep linux-6.18.38
target-x86_64_musl/linux-x86_64/linux-6.18.38
target-x86_64_musl/linux-x86_64/linux-6.18.38
Link: https://github.com/openwrt/openwrt/pull/24271
Signed-off-by: Paul Spooren <mail@aparcar.org>
Add PoE support for GS1920-24HP by providing the device tree
definition and selecting the Realtek PSE MCU driver package for build.
Support includes both versions of the device since they basically share
the same PSE frontend. The common DTSI includes the shared definitions,
the device DTS files then set the correct compatibles.
Link: https://github.com/openwrt/openwrt/pull/24239
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add support for PoE on Zyxel XGS1930-28HP by leveraging the new Realtek
PSE driver. Define the PSE controller with all its properties in DTS of
the device and link it to the PHYs.
Link: https://github.com/openwrt/openwrt/pull/24239
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Use the kernel PSE driver for PoE functionality on this device instead
relying on userspace apps. Drop the automatic selection for poemgr in
favor of the driver module.
Link: https://github.com/openwrt/openwrt/pull/24239
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add PoE support to Linksys LGS328MPCv2 by adding the required device
tree definition and select the needed kernel module package, making use
of the Realtek PSE MCU driver.
Co-authored-by: Jan-Henrik Bruhn <git@jhbruhn.de>
Link: https://github.com/openwrt/openwrt/pull/24239
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add a macro PSE_PI for the common pse-pi definition, helping with
devices which make use of the Realtek PSE MCU driver. While those
definitions stay manageable for low port counts, this adds too much
visual boilerplate with 24 or even 48 ports. The macro keeps it short
with one line per pse-pi.
Also make use of this macro directly for the two devices XS1930-12HP and
XMG1915-10EP.
Link: https://github.com/openwrt/openwrt/pull/24239
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Use the compatible expected by the AN7583 pinctrl driver so the pinctrl and integrated GPIO driver can bind.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
In fis_remap(), when desc < last, the memset size is computed as
'tmp - end'. Since tmp is calculated as 'end - positive_value', tmp is
always less than end, making 'tmp - end' negative. When cast to size_t,
this wraps to a very large value, causing a massive buffer overflow.
Fix by swapping the operands to 'end - tmp' which correctly computes the
number of bytes to clear.
Signed-off-by: Anna Kiri <bredcorn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23550
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
MAX_RX_PKT_LEN value 2 selects 1552-byte frames, not jumbo mode.
Select value 3 so the configured 2 KiB frames are actually accepted by
the switch.
Tested on a ZBT-WE826 (MT7620). With value 2, 1534-byte IPv4
packets pass while 1535-byte packets are dropped. With value 3,
1792-byte and 1800-byte DF IPv4 packets pass.
Fixes: d083212e11 ("ramips: ethernet: ralink: mt7620 enable jumbo frames")
Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24242
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Ran a treewide trailing-whitespace cleanup for *.c, *.h, *.dts and *.dtsi.
Only files under target/linux/lantiq/... and target/linux/qualcommax/...
required changes, so the diff is limited to those paths.
Done by executing commands:
find . -type f | grep "\.c$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.h$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dts$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dtsi$" | xargs sed -i 's/[ \t]\+$//'
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/24255
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The current ipqess TX timeout handler only logs the timeout. If TX
completion interrupts are lost or left masked, descriptors can remain
pending indefinitely and the master Ethernet device stays wedged until a
reboot.
Log the TX ring indexes and interrupt state to make future failures
useful, then force the TX completion NAPI path to run and re-kick the TX
producer index. This gives the driver a chance to reclaim pending TX
descriptors and wake the queue instead of reporting the same watchdog
forever.
Signed-off-by: Denis Yarkovoy <dyarkovoy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24122
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The ipqess driver is carried locally in OpenWrt and is not present in
upstream Linux. Move the driver sources out of the source-adding kernel
patch and into target/linux/ipq40xx/files/ so the local source is easier
to maintain.
Keep the kernel patch only for the upstream-style Kconfig, Makefile and
MAINTAINERS wiring, and refresh the dependent ipqess patches.
Use the void-returning platform driver .remove callback.
Signed-off-by: Denis Yarkovoy <dyarkovoy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24122
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Fix a warning interpreted as error when building the Linux kernel
on macOS host, by setting MACOSX_DEPLOYMENT_TARGET to the version
of the host. Fixes:
make[5]: Entering directory '/Volumes/test/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-6.18.38'
HOSTCC scripts/mod/modpost.o
scripts/mod/modpost.c:1719:9: error: 'strchrnul' is only available on macOS 15.4 or newer [-Werror,-Wunguarded-availability-new]
1719 | sep = strchrnul(namespace, ',');
| ^~~~~~~~~
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24251
Signed-off-by: Robert Marko <robimarko@gmail.com>
Commit 82ddc472d7 ("realtek: dts: convert to upstream switch
notation") adjusted the switch description in the device tree to match
upstream. This was a correct change, however it broke the fan control
script for Plasma Cloud PSX28/ESX28 devices because it uses a
full-fledged platform device path including the switch node (because the
I2C is a child of the switch):
/sys/devices/platform/1b000000.switchcore/1b000000.switchcore:i2c@100c/i2c-4/4-002e/hwmon/
Since the mentioned change, this path doesn't exist anymore. Instead of
just changing the intermediate parts to match the DT structure again, do
not rely on that at all. Instead, use
/sys/bus/i2c/devices/4-002e/hwmon/
as the path which relies less on the DT structure and still points to
the same device. This makes fan control on those device work again,
reducing the fan speed during boot which has been broken since the
commit.
Fixes: 82ddc472d7 ("realtek: dts: convert to upstream switch notation")
Fixes: 2b5555c195 ("realtek: rtl931x: Add support for Plasma Cloud PSX28 Switch")
Link: https://github.com/openwrt/openwrt/pull/24248
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The AN7583 PCS match data does not initialize num_port. This leaves it at
zero, so probe allocates a zero-sized ports array and a later PCS lookup
returns a pointer derived from NULL.
Set the number of ports for each AN7583 PCS instance. Also reject
out-of-range PCS indices defensively.
Fixes kernel crashing on boot once ethernet starts probing on AN7583.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
20a2ae469089 io: support older linux ioctls
16929698e2d3 fs: implement ioctl for macOS
395bb888bd69 io: implement ioctl for macOS
8d7d15ee1a08 compiler: add support for shorthand method declarations
7d9febd13305 nl80211: add mesh peer link enum macros to constants list
e851bb64df91 lib: avoid allocating print buffer before NULL check in uc_error_message_indent
5f3a7b87d962 compiler: prevent unbounded recompilation on failed module imports
e2493b577250 compiler: scope named function expression names to their own body
c3f0d27d812e tests: add regression test for named function expression scoping
738b55299966 vm: release owned value when property assignment fails
1ffd7c5a1011 vm: fix out-of-bounds read in single-name module import
a255256db106 vm: fix SIGFPE on INT64_MIN division and modulo by -1
3f4b313d7d78 vm: do not assign to undeclared variables in strict mode
e523682670a2 vm: release upvalue reference when resolving it on stack push
6a837090bea3 vm: release module scope reference in dynamic import
395a0a16b4f9 vm: guard error context capture against empty callframe stack
04f103bb2270 vm: respect exponent parity in integer exponentiation
bd814a4b2ae3 vm: use UC_ARRAY instead of json_type_array in object spread
5a79aa56c15e vm: release resource type prototypes after the final GC
9c5f16c8e33a lexer: do not treat /*/ as a complete block comment
a018067fd12e lexer: preserve NUL bytes in regular expression literals
65d41a1929de lexer: do not consume a sign into hexadecimal number literals
05f9bf9e5d53 lexer: fix source position of ternary question mark token
7bca646e5f88 lib: preserve embedded NUL bytes in reverse()
6fc93bf5bd95 lib: preserve embedded NUL bytes in lc() and uc()
a51f4843bce5 lib: avoid passing a signed char to isxdigit() in hex()
e8af70e4375c compiler: fix use-after-free of shorthand method name
467fb4406a47 compiler: declare leading variable in counting for loop initializer
d256e153799b rtnl: fix stack buffer overflow parsing IFLA_LINKINFO
f741ac0a144c rtnl: fix stack buffer overflow parsing RTA_MULTIPATH nexthops
c41310f7c2df rtnl: fix inverted address check in multipath nexthop parsing
Signed-off-by: Felix Fietkau <nbd@nbd.name>
A reload during an in-flight setup ran wdev_config_init() immediately,
replacing handler_config/handler_data while the script was still running, so
its set_data notifications resolved against the new (renumbered) interface
table and link up/down calls became asymmetric. Defer the re-init in
check() while a handler run is in progress and re-apply from the setup and
teardown callbacks once it completes.
Signed-off-by: Felix Fietkau <nbd@nbd.name>