memcpy() with overlapping src and dest buffers is an undefined behavior
in C. In the current code, a ConfRej response is generated by copying
input data in-place, where the dest address is lower than the src.
This happens to work in practice because memcpy() forward-copies data,
matching the behavior of memmove() in this case.
However, if FORTIFY_SOURCE or Address Sanitizer is enabled, memcpy()
will detect the overlap at run time and abort the program.
Replace the memcpy() with memmove() to ensure a well-defined behavior.
Reported-by: Filippo Carletti <filippo.carletti@gmail.com>
MRU patch https://github.com/ppp-project/ppp/pull/573
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22286
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Embed gpio_led struct in ath_led. Simpler Allocation.
Use a flex array for the name. Allows using a single allocation.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21933
Signed-off-by: Robert Marko <robimarko@gmail.com>
ath79 at this point supports no ath5k devices.
The only targets with ath5k usage are bcm47xx, ixp4xx, and lantiq.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19848
Signed-off-by: Robert Marko <robimarko@gmail.com>
The single user of the downstream gpio-cascade driver has been switched
to use the upstream gpio-line-mux driver. Thus, we can drop the former
now.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22206
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add the GPIO line mux driver as a kernel module for selected usage by
devices.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22206
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support for Richtek RTQ6056 Current and Power Monitor ADC.
RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
compatible interface, and the device provides full information for
system by reading out the load current and power.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add a label to the spi node to allow device trees to reference it
(i.e. to mark status = "okay").
Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Due to issues surrounding the implementation of the vendor BMT/BBT
on Airoha, upstream ATF + uboot has switched to UBI flash partitions.
However, some devices shipped on this platform are bootloader locked,
and thus it is impossible to replace ATF + uboot.
During testing for the Gemtek W1700K (#17869), sysupgrades from Linux
(which is unaware of the underlying BMT/BBT) would occasionally write
data into blocks which were remapped by the vendor uboot when it was
read on the following reboot, causing a soft brick.
An acceptable workaround [1],[2] was discussed where an intermediate
uboot would be written by the vendor uboot (which is aware of Airoha
BMT/BBT). This chainloader would then ignore the regions of flash
used by the vendor uboot, and store all relevant data inside of UBI.
UBI would then be used to handle bad block management. As the vendor
ATF + uboot do not read or interact with the UBI region, we would avoid
unwanted remaps from BMT/BBT.
This commit introduces support for building such a chainloader, by
packaging u-boot and DTS into a FIT image; to be flashed like a kernel.
Configuration for the Gemtek W1700K is provided as an example of how the
chainloader is used.
[1] https://github.com/openwrt/openwrt/pull/17869#discussion_r2836066746
[2] https://github.com/openwrt/openwrt/pull/17869#discussion_r2838395671
Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
[ move FIP_COMPRESS to Build/Compile, wrap some long lines ]
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
It is more accurate to describe the contents of the FIP as
compressed, instead of the FIP itself becoming compressed.
Update variable naming accordingly.
Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
OpenWrt issue:
https://github.com/openwrt/openwrt/issues/16183
Problem summary:
On qualcommax (ipq60xx/ipq807x) with ath11k, monitor-mode captures contain
frames that are consistently longer than expected by 8 bytes.
The symptom is visible in pcap/radiotap captures, and Wireshark parsing
becomes correct after manually cutting these 8 bytes from captured frames.
This patch:
- Remove merge-stage FCS/tail manipulations in ath11k_dp_rx_mon_merg_msdus().
- add length fix in ath11k_dp_rx_mon_deliver(), trim 8 bytes right
before radiotap update and delivery to mac80211.
This targets monitor capture length correctness only and keeps the fix scoped
to the monitor RX delivery path.
Tested-on: ipq8072 yuncore,ax880; ipq6018 yuncore,ax840; yuncore,fap650
Signed-off-by: Ruslan Isaev <legale.legale@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22244
Signed-off-by: Robert Marko <robimarko@gmail.com>
Port drivers for the hardware true random number generator found in
MediaTek SoCs and enable them for all boards.
This has the side-effect of U-Boot now providing '/chosen/kaslr-seed'
to Linux which is required to enabled KASLR.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add support for Airoha EN7581/AN7583 NPU variant firmware present in
linux-firmware. The Airoha EN7581 NPU variant is to support devices
equipped with the MT7996 WiFi chip.
While at it also add an extra new line to follow pattern of double new line to
separate each firmware package.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The fs_wait_for_key function runs multiple background processes that all
try to delete the same temporary file ($keypress_wait) when they exit.
This creates a race condition where one process successfully deletes the
file while others fail with ENOENT.
Busybox rm only suppresses "file not found" errors during the initial lstat()
check, not during the actual unlink() call. This causes error messages in the
boot log even with rm -f:
rm: can't remove '/tmp/tmp.hKjPDH': No such file or directory
Fixed by redirecting stderr to /dev/null for rm calls in concurrent contexts.
This change does not affect functionality and only avoids confusing log
output during boot.
Signed-off-by: Oliver Sedlbauer <os@dev.tdt.de>
Link: https://github.com/openwrt/openwrt/pull/22079
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Several OpenWrt-related fixes are included in this release.
Drop upstreamed patches and refresh the rest.
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
Link: https://github.com/openwrt/openwrt/pull/22240
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Introduce the devpath option to find the control channel device from a
hardware path for a USB or a WWAN device.
This option is useful when there are multiple modems connected to the
system. The name of the control channel device of a modem can change
depending on which modem initialises first or if it was recently plugged
in. The devpath option allows specifying the hardware path of the modem
where the control channel device will be found using that.
For the USB device hardware path, it is allowed to specify the USB port
number the modem is directly connected to.
If the device and devpath options are both set, devpath takes precedence
over device.
The USB device hardware path of a control channel device can be found by:
readlink -f /sys/class/usbmisc/cdc-wdmX/device
The WWAN device hardware path of a control channel device can be found by:
readlink -f /sys/class/wwan/wwanXqmiX/device
An example uci configuration would be:
config interface 'wwan_usb1'
option proto 'qmi'
option auth 'none'
option devpath '/sys/devices/platform/1e1c0000.xhci/usb1/1-1'
option apn 'internet'
option pdptype 'ipv4v6'
Or:
config interface 'wwan_pcie1'
option proto 'qmi'
option auth 'none'
option devpath '/sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0'
option apn 'internet'
option pdptype 'ipv4v6'
Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
Introduce the devpath option to find the control channel device from a
hardware path for a USB or a WWAN device.
This option is useful when there are multiple modems connected to the
system. The name of the control channel device of a modem can change
depending on which modem initialises first or if it was recently plugged
in. The devpath option allows specifying the hardware path of the modem
where the control channel device will be found using that.
For the USB device hardware path, it is allowed to specify the USB port
number the modem is directly connected to.
If the device and devpath options are both set, devpath takes precedence
over device.
The USB device hardware path of a control channel device can be found by:
readlink -f /sys/class/usbmisc/cdc-wdmX/device
The WWAN device hardware path of a control channel device can be found by:
readlink -f /sys/class/wwan/wwanXmbimX/device
An example uci configuration would be:
config interface 'wwan_usb1'
option proto 'mbim'
option auth 'none'
option devpath '/sys/devices/platform/1e1c0000.xhci/usb1/1-1'
option apn 'internet'
option pdptype 'ipv4v6'
Or:
config interface 'wwan_pcie1'
option proto 'mbim'
option auth 'none'
option devpath '/sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0'
option apn 'internet'
option pdptype 'ipv4v6'
Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
The &pointer + 1 trick is a C89 trick to point to area allocated after
the size of the struct. We have struct_size and flex arrays now.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22170
Signed-off-by: Robert Marko <robimarko@gmail.com>
This reverts commit c053b225731e81826b5b8acb144ac68f4ae14d30.
KSZ DSA driver is the only thing in the kernel selecting DCB support
instead of depending on it if required.
So, it will enable DCB support without asking and we do not want the
kernel size increase, as well as current Layerscape ARMv8 build failure.
So, revert this until its fixed upstream or worked around.
Signed-off-by: Robert Marko <robimarko@gmail.com>
This access point is a ‘friend’ of the T56 supplied by Odido but with DDR3 RAM and with two Ethernet 2.5 (GPY211)
The flash procedure is similar to other Zyxel T56/EX5600/EX5601
If you need backup please use the T56 guide
Please refer to https://openwrt.org/inbox/toh/zyxel/wx5600-t0 for detailed flash informations
Specifications:
SOC: MT7986b
RAM: 512MB
Flash: 512 MB SPI NAND
Ports: 2 LAN 2.5Gbps (GPY211C)
WIFI: MT7976GN + MT7976AN
LED: 3 bicolor LED - 1 monocolor LED
Buttons: Reset and WPS
We can install all with U-boot and mtk_uartboot.
Load Uboot:
```
./mtk_uartboot -a -p ./mt7986-ram-ddr3-bl2.bin -s /dev/ttyUSB0 -f openwrt-mediatek-filogic-zyxel_wx5600-t0-ubootmod-bl31-uboot.fip
```
**WARNING: Please use a GBIT ethernet or force it on system**
**WARNING: Please use only LAN2 port in Uboot**
Press 0 on Bootmenu
```
mtd erase ubi
run ubi_format
bootmenu
```
Load and write BL2 and U-boot:
```
8
7
```
Load and write recovery and production
```
6
5
```
Signed-off-by: Valerio 'ftp21' Mancini <ftp21@ftp21.eu>
Co-authored-by: Hal Martin <halmartin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18364
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This access point is a ‘friend’ of the T56 supplied by Odido but with DDR3 RAM and with two Ethernet 2.5 (GPY211)
The flash procedure is similar to other Zyxel T56/EX5600/EX5601
If you need backup please use the T56 guide
Please refer to https://openwrt.org/inbox/toh/zyxel/wx5600-t0 for detailed flash informations
We can install all with U-boot and mtk_uartboot.
Load Uboot:
```
./mtk_uartboot -a -p ./mt7986-ram-ddr3-bl2.bin -s /dev/ttyUSB0 -f openwrt-mediatek-filogic-zyxel_wx5600-t0-ubootmod-bl31-uboot.fip
```
**WARNING: Please use a GBIT ethernet or force it on system**
**WARNING: Please use only LAN2 port in Uboot**
Press 0 on Bootmenu
```
mtd erase ubi
run ubi_format
bootmenu
```
Load and write BL2 and U-boot:
```
8
7
```
Load and write recovery and production
```
6
5
```
Signed-off-by: Valerio 'ftp21' Mancini <ftp21@ftp21.eu>
Link: https://github.com/openwrt/openwrt/pull/18364
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add menuconfig options to include modules for (virtio) vsockets. These are
used when running as Guest OS in a VM.
OpenWRT can be run in a vm (mostly commonly on the x86/64 and armsr
targets). Often it is convenient to have some sort of guest agent running,
to ease communication from host to guest.
Virtual Sockets provide this communication channel.
Virtio is a transport for this communication channel.
Virtual Sockets over virtio are for example used by Incus.
Virtual Sockets in general are used by most hypervisors, including VMware,
Hyper-V, and libvirt (qemu). These may need other transport-specific
modules not included in this commit.
Signed-off-by: Mathijs Rietbergen <mathijs.rietbergen@proton.me>
There are a number of pse chips already present in upstream Linux.
OpenWrt is starting to support a number of devices can contain various pse
chips. But having all the pse chip combinations defined at the target
level will result in bloat on images.
Present the current upstream Linux pse drivers as packages so that they
can be selectively included per board (rather than per target).
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
[Make it depend on REGULATOR_SUPPORT, and !SMALL_FLASH]
Link: https://github.com/openwrt/openwrt/pull/22172
Signed-off-by: Robert Marko <robimarko@gmail.com>
Bump uboot-stm32 to upstream release 2026.01.
Two upstream patches were backported to resolve silent crash on
STM32MP135F-DK board.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/21965
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The key variable is not defined in the scope when setting wpa_psk. Use
config.key instead.
This fixes configuration the 64 characters wpa_psk directly.
Reported-by: donjoe in OpenWrt Forum
Link: https://github.com/openwrt/openwrt/pull/22182
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
75bedc5 wireless-regdb: Update regulatory info for Australia (AU) for 2025
a6e5195 wireless-regdb: Update broken link in regulatory.bin(5) manpage
9e8c67f wireless-regdb: Update regulatory info for Malaysia (MY) for 2024
61a4637 wireless-regdb: Update regulatory info for Malaysia (MY) for 2025
5cefe55 wireless-regdb: Update regulatory info for Tunisia (TN) on 6GHz for 2025
1a729ae wireless-regdb: Update regulatory info for Canada (CA) for 2025
ea20dfa wireless-regdb: update regulatory database based on preceding changes
Link: https://github.com/openwrt/openwrt/pull/22150
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Due to a missing include, the constant UINT_MAX is undefined. This
fixes issues when building v25.12.0-rc5. Including a newer version of
iproute2 would include the patch, but causes other building issues.
Signed-off-by: Jonas Lochmann <openwrt@jonaslochmann.de>
Link: https://github.com/openwrt/openwrt/pull/22128
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This adds kernel packages for the Microchip KSZ9477 switch family.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/22120
Signed-off-by: Robert Marko <robimarko@gmail.com>
sc->gpiochip is assigned to gc when it should be the other way around.
This allows gpiod_free to work properly.
Fixes: e78dc2eae4 ("mac80211: ath9k: clean up gpiochi")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22158
Signed-off-by: Robert Marko <robimarko@gmail.com>
It looks like commit 6d2f3b1b19 ("package: kernel: dtc: Add DTO support")
added this patch file 9 years ago without it ever being applied anywhere.
Back then there wasn't even a 'dtc' package, but we just used 'dtc' from
the Linux kernel sources.
Nowadays there is package/utils/dtc which is used to build dtc to be used
on the target (*not* a host-build!), and it of course already contains
support for device tree overlays since v1.4.3 from 2017...
This reverts commit 6d2f3b1b1974d742576b0902e9c4777c9ac1ba67.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://github.com/openwrt/openwrt/pull/22118
Signed-off-by: Robert Marko <robimarko@gmail.com>
Use substr() instead of array index syntax to access the first
character of the endpoint host string, as ucode does not support
array-style indexing on strings.
Fixes: https://github.com/openwrt/openwrt/issues/22116
Fixes: 8f977b4a4055 ("wireguard-tools: fix handling of multi-value config options")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
180ffcc instance: use mkdir_p helper
9493a3d signal: handle SIGUSR1 as halt
4dd22d0 cgroups: fix syntax error
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Config options like addresses and ip6prefix can be passed as either a
space-separated string or an array. Add a to_array() helper and use it
consistently for all multi-value options (addresses, ip6prefix,
allowed_ips).
Fixes: https://github.com/openwrt/openwrt/issues/22102
Fixes: 41bc454602f1 ("wireguard-tools: rewrite proto handler in ucode")
Signed-off-by: Felix Fietkau <nbd@nbd.name>