Commit graph

66744 commits

Author SHA1 Message Date
Chukun Pan
f911c2dc44 mediatek: update Bananapi BPi-R4 Lite support
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
Devices package:
  Add missing USB3 driver

Device tree:
  Fix model name and pwm usage
  Add missing supply for I2C and USB
  Update network port names based on the shell image [1]

[1] https://docs.banana-pi.org/bpi-r4_lite/banana_pi_bpi-r4_lite_case_1.png

Fixes: 8b6c6978 ("mediatek: add support for BananaPi BPi-R4 Lite")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2025-11-25 16:48:28 +00:00
Chukun Pan
21fe2a8e43 mediatek: update mt7987 SoC device tree
mt7987b.dtsi:
  Enabled lvts (for CPU thermal) and trng by default.
  Remove non-existent netsys include headers, fix build.

mt7987.dtsi:
  Remove unused rt5190a include headers
  Fix pwm-fan errors: binding cdev pwm-fan to trip 3 failed: -22

Fixes: 9de7189ed ("mediatek: build image for MT7987 RFB")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2025-11-25 16:48:28 +00:00
Chukun Pan
295601b0d4 mediatek: mt7987: enable usb 3.0 by default
There is no reason to limit USB to 2.0 mode by default. This
limitation should be done when both gmac2 and USB are enabled.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2025-11-25 16:48:28 +00:00
Chukun Pan
de8eb38db8 mediatek: move node from mt7987a SoC dtsi
Remove I2C, PCIe, PWM, UART and USB from the MT7987A SoC dtsi.
These should not be enabled by default, but rather enabled based
on the device.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2025-11-25 16:48:28 +00:00
Daniel Golle
7af6029644 mediatek: mt7987: sync mt7987.dtsi with MediaTek SDK
Make sure uart0 got all required clocks assigned.

Fixes: 1c3b32c45a ("mediatek: fix uart clocks in MT7987 infracfg clock driver")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-11-25 16:48:21 +00:00
Goetz Goerisch
b947b6af04
zynq: drop support for kernel 6.6
Drop support for kernel 6.6 as now kernel 6.12 is set as default kernel
version.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20892
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:27:24 +01:00
Goetz Goerisch
d263af38c0
zynq: switch to kernel 6.12
switch the kernel to 6.12 by default

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20892
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:27:24 +01:00
Goetz Goerisch
cd851fb96e
at91: drop support for kernel 6.6
Drop support for kernel 6.6 as now kernel 6.12 is set as default kernel
version.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20871
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:23:14 +01:00
Goetz Goerisch
ca626376d5
at91: switch to kernel 6.12
switch the kernel to 6.12 by default

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20871
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:23:14 +01:00
Hannu Nyman
9ba24e0ee9
tools/cmake: update to 4.2.0
Update cmake to version 4.2.0
Release notes at https://cmake.org/cmake/help/v4.2/release/4.2.html

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/20863
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:22:46 +01:00
Goetz Goerisch
117546b49a
bcm53xx: drop support for kernel 6.6
Drop support for kernel 6.6 as now kernel 6.12 is set as default kernel
version.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20874
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:21:50 +01:00
Goetz Goerisch
7748ed6c68
bcm53xx: switch to kernel 6.12
switch the kernel to 6.12 by default

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20874
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:21:50 +01:00
Goetz Goerisch
e34726bf66
bcm47xx: drop support for kernel 6.6
Drop support for kernel 6.6 as now kernel 6.12 is set as default kernel
version.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20887
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:21:17 +01:00
Goetz Goerisch
2aa9a41136
bcm47xx: switch to kernel 6.12
switch the kernel to 6.12 by default

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20887
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:21:17 +01:00
Goetz Goerisch
e9b7a9e42c
bcm4908: drop support for kernel 6.6
Drop support for kernel 6.6 as now kernel 6.12 is set as default kernel
version.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20888
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:20:35 +01:00
Goetz Goerisch
2830d3b434
bcm4908: switch to kernel 6.12
switch the kernel to 6.12 by default

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20888
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 17:20:34 +01:00
Konstantin Meshkov
2c2b048295
kirkwood: add aliases and new partition for support D-Link DNS-325 A1
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
- Added fan0 alias
- Implemented LED aliases and thermal zones
- Restructured partitions: u-boot, u-boot-env, ubi

Signed-off-by: Konstantin Meshkov <skyline@mail.ru>
[ improve commit title ]
Link: https://github.com/openwrt/openwrt/pull/17924
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 15:41:38 +01:00
Konstantin Meshkov
7e829b8209
kirkwood: add support for D-Link DNS-325 A1
The D-Link DNS-325 A1 is NAS with 2x HDD (3.5 inch) bays, 1x 10/100/1000Base-T port and 1x USB 2.0 port

Device specification:

    SoC: Marvell 88F6281-A1 1.2 GHz
    RAM: 256 MB (2xSEC K4T1G084QF-HCF7:128Mx8 @400 CL6)
    Flash: 128 MB (SAMSUNG 946 K9F1G08U0B PCB0)
    SATA: 2x internal SATA II drives
    Ethernet: 1x Gigabit (Marvell 88E1116R-NNC1)
    LED: 7x (white: Power, white/red: Right SATA Activity, USB Activity, Left SATA Activity)
    Key: 3x (Power, Reset, USB Copy/Unmount)
    Serial: 5 pin header (RXD,GAP,3.3V,GND,TXD), (115200,8,N,1), 3.3V TTL
    USB ports: 1x USB 2.0

Flash instruction:

NOTE: this process uses a serial connection. It will upgrade the bootloader and reset the bootloader environment variables

USB flash stick setup

    Format to FAT32 without mbr
    Copy these files to USB flash stick: dlink_dns-325-a1-initramfs-uImage dlink_dns-325-a1-squashfs-factory.bin dlink_dns-325-a1-squashfs-sysupgrade.bin u-boot.kwb (from u-boot-dns325 directory)

NAS setup

    Connect LAN cable between router and NAS device
    Connetc USB flash stick to NAS device
    Connect serial to NAS device

Boot from new u-boot and install it

    $ kwboot -p -b u-boot.kwb -B115200 -t /dev/ttyUSB0
    Power on NAS
    After download copleted and booted NAS device with new u-boot stop in bootloader by pressing any key
    => usb start
    => fatload usb 0 0x1000000 /u-boot.kwb
    => nand erase.part u-boot
    => nand write 0x1000000 u-boot ${filesize}
    => reset

Update MAC address in u-boot env

    Stop in bootloader by pressing any key
    Get your MAC address from label on chassis
    => setenv ethaddr XX:XX:XX:XX:XX:XX
    => saveenv

Install OpenWrt by flashing factory image from u-boot

    => usb start
    => fatload usb 0 0x1000000 /dlink_dns-325-a1-squashfs-factory.bin
    => nand erase.part ubi
    => nand write 0x1000000 ubi ${filesize}
    => reset

Based-on: #9296
Signed-off-by: Konstantin Meshkov <skyline@mail.ru>
[ refresh uboot patches ]
Link: https://github.com/openwrt/openwrt/pull/17924
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 15:41:38 +01:00
Scott Mercer
6065edf3b2
mac80211: ath11k: fix rssi for IPQ5018 and QCN6122
Add pending patch to fix RSSI station data on IPQ5018 and QCN6122.

Signed-off-by: Scott Mercer <TheRootEd24@gmail.com>
[ improve commit description, replace patch ]
Link: https://github.com/openwrt/openwrt/pull/20834
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 15:30:47 +01:00
Nick Hainke
90a768aea8 libtraceevent: update to 1.8.6
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Update to latest release.

Link: https://github.com/openwrt/openwrt/pull/20921
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-11-25 14:09:07 +01:00
Nick Hainke
09360ef26a wpan-tools: update to 0.10
Release Notes:
https://github.com/linux-wpan/wpan-tools/releases/tag/wpan-tools-0.10

Link: https://github.com/openwrt/openwrt/pull/20920
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-11-25 14:08:07 +01:00
Christian Marangi
41541bf30e
libunistring: fix compilation error with MUSL
MUSL doesn't provide PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP as
it's only glibc and as the MACRO say, it's NP (not portable).

Add patch to check for this and disable overwriting the function
accordingly.

Fixes: 9bdf723476 ("libunistring: update to 1.4.1")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-25 13:41:11 +01:00
Álvaro Fernández Rojas
b0e9371cb1 generic: 6.12: add pending b53 fixes for BCM5325
These patches fix the remaining issues with BCM5325 switches and allow
dropping the default VLAN on Huawei HG556a.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-11-25 13:24:32 +01:00
Rany Hany
c15b85ee04 wifi-scripts: add missing na_mcast_to_ucast default when proxy_arp is disabled
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Adds missing default value for na_mcast_to_ucast when proxy_arp is not enabled
in order to silence the following msg:

   daemon.notice: netifd: radio1 (xxxx): sh: out of range

Fixes: bcdb29f78f ("wifi-scripts: add na_mcast_to_ucast option")
Reported-by: Antony Kolitsos <zeusomighty@hotmail.com>
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20806
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-25 11:46:55 +01:00
Rany Hany
2d7a6017f1 wifi-scripts: ucode: fix bug moving to empty wifi-station config
When transitioning from a config with one or more wifi-stations, to a configuration
that has no wifi-station; the file would not be empty/reset and the old wifi-station
entries would remain.

This is because iface_wpa_stations and iface_sae_stations return early if there
are no wifi-stations present, which is an incorrect behavior as it causes the
file to actually have old entries.

'sae_password_file' and 'wpa_psk_file' are also set by default inside
of iface_auth_type to same path as the one used by wifi-station, so it
is indeed going to be set in the config and would contain the old
entries.

This happens with reload and wifi restart. So the only solution
would be to manually remove the file.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20700
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-25 11:46:12 +01:00
Rany Hany
e740139302 wifi-scripts: iface should be optional in wifi-station definition
Similar to "wifi-scripts: iface should be optional in wifi-vlan definition"
(98435a3), wifi-station iface should also be optional. By default, it is
supposed to match all interfaces if omitted.

Fixes: https://github.com/openwrt/openwrt/issues/20705
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20694
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-25 11:45:24 +01:00
Rany Hany
63c146a464 wifi-scripts: ucode: fix wifi-vlan "network" option not working
The call to netifd.set_vlan(...) had an incorrect argument
order. It should be (interface, ifname, vlan) not
(interface, vlan, ifname). This prevented wifi-vlan's
"network" option from working as netifd was not able
to find the wifi-vlan section.

Fixes: https://github.com/openwrt/openwrt/issues/20705
Fixes: https://github.com/openwrt/openwrt/issues/20911
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20918
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-25 11:44:29 +01:00
Caleb James DeLisle
31f5fc8fea econet: New device: Zyxel PMG5617GA
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This device has one USB2.0 port, plus ethernet, 2x wifi, ethernet, xPON
and VoIP.

Installation instructions: (Assuming root shell via SSH or serial)
1. Place OpenWrt TRX file on a USB stick formatted VFAT
2. Plug in the stick to the modem
3. Type: mtd write -f -e tclinux /mnt/usb2_sda1/<name of file>.trx tclinux

At this point, both OpenWrt and the vendor OS will be installed
because the device has space for two operating systems. Switch the OS
to boot to OpenWrt:

1. mtd readflash tmpdata 999999999 0 reservearea
2. echo -n '0' | dd of=./tmpdata bs=1 count=1 seek=397311 conv=notrunc
3. mtd write -f -e reservearea ./tmpdata reservearea
4. reboot

WARNING: While you can install with SSH alone, you need serial to use
OpenWrt on EcoNet devices because the Ethernet driver has not yet been
developed.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/20580
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:50:54 +01:00
Paweł Owoc
8d8990a07e mtd: add dump command help
Add missing dump command help.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20725
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:43:23 +01:00
Paweł Owoc
693db5945b mtd: allow to use dump and verify on read-only devices
Dump and verify commands can be used on read-only devices.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20725
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:43:23 +01:00
Rany Hany
7ea659503a wifi-scripts: ucode: add missing config.auth_type assignment for psk2
This ends up breaking wifi-station and wifi-vlan as it depends on
config.auth_type being either psk or psk-sae. When set to psk2,
this would be unset causing that feature to not work.

See discussion in https://github.com/openwrt/openwrt/issues/20705#issuecomment-3568446006

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20914
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:37:46 +01:00
Sven Eckelmann
29a9c3feb1 realtek: Fix alignment of parameters
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
The parameters must be aligned based on the last opened parenthesis
(+1). If this not a multiple of the tab size (8) then the rest
alignment must be done using spaces.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:51 +01:00
Sven Eckelmann
0aa4f6a2f2 realtek: Fix typo "mutli"
It is written "multi" and not "mutli"

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:51 +01:00
Sven Eckelmann
07e4b82da5 realtek: Fix typo "intialization"
It is written "initialization" and not "intialization"

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:51 +01:00
Sven Eckelmann
53fee72216 realtek: Drop space after casts
The Linux kernel coding style recommends not to add a space after
casts.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:51 +01:00
Sven Eckelmann
4bd1cb66df realtek: Drop unnecessary newlines
It is recommended in the Linux kernel coding style not to add multiple
newlines after another.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:51 +01:00
Sven Eckelmann
583807806c realtek: Use BIT(x) helper instead of manual shift
Instead of manually writing shift operations, it is preferred to
use BIT(b) or GENMASK(e, s).

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
70563e6aa2 realtek: Switch to kernel integer types
uint(8|16|32|64)_t and int(8|16|32|64)_t types should not be used in
kernel code. The shorter s(8|16|32|64) and u(8|16|32|64) or the
endianness specific versions (le*, be*) must be used instead.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
612f1e6afb realtek: Don't reinitialize static variables to 0
Static variables (and global variables) are initialized to 0 by
default. It is not needed and discouraged to reinitialize them
to 0.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
6eb46033eb realtek: Use short name for "unsigned long int"
It is preferred in the Linux kernel to use the short type name
"unsigned long" instead of "unsigned long int". The same is true
for short and the signed version of the types.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
20fd6c9d10 realtek: Keep return statements on new line
It is not allowed in the Linux kernel to have the condition and
the actual statement(s) on the same line. This is required to
make it easier to identify the body of an if/do/while/for/..

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
281c90cb1b realtek: Drop repeated words in comments
The repeated words don't make any sense in these comments/sentences and can
just be dropped.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
f29c597324 realtek: Start function scope on newline
In contrast to array initializations, function scopes must start
on a newline and not at the a line which defines the function
parameters.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
1dd22279eb realtek: Fix spaces around braces, ops and keywords
The Linux kernel coding style has strict rules when spaces must be
added around operations or after keywords. The whole list is to
complex to summarize it here but can be found at
https://www.kernel.org/doc/html/v6.17/process/coding-style.html

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
230a1835c3 realtek: Clean up global array definitions
Global array initialization must have the open brace on the first
line and the next lines must be intended by one level. The closing
brace must be one a separate line.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
8f42966c08 realtek: Separate variables and code by newline
The Linux coding style requires to have a newline between the vaariables
definition block and the beginning of a scope and the code.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
5a2a2b2020 realtek: Use __packed helper
In the Linux kernel, it is preferred not to use compiler specific
attributes but instead utilize the kernel specific helpers.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
d5fec0b125 realtek: pcs: Fix overflow in rtpcs_930x_sds_clock_wait
It can happen that the calculation `start + (HZ / 1000) * timeout`
overflows `unsigned long`. This must be handled correctly to avoid too long
waits. Luckily, the `time_before()` helper already does this.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
69c6658c73 realtek: pcs: Reduce nesting during calibration
It is preferred in the kernel to have less nesting of scopes. More common
is to perform pre-condition checks (like error handlers) and then react to
them.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00
Sven Eckelmann
80375e5acd realtek: ethernet: Avoid usage of unsafe strcpy
strcpy doesn't check the length of the destination buffer. And strlcpy
would not make sure to null-terminate the destination buffer.

Even when it is clear that this string will fit in the currrent buffer, it
is just best practice to avoid strcpy.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:28:50 +01:00