From cb4d2b3fb2a85bcd2aa49c4d11732e5b55e458c5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 12 Feb 2025 11:54:59 +0100 Subject: [PATCH 1/9] hostapd: fix sta psk index for dynamic psk auth Depending on the config / circumstances, the get_psk call can be called multiple times from differnt places, which can lead to wrong sta->psk_idx values. The correct call is the one that is also interested in the vlan_id, so use the vlan_id pointer as indication of when to set sta->psk_idx. Also fix off-by-one error for secondary PSKs Fixes: b2a2c286170d ("hostapd: add support for authenticating with multiple PSKs via ubus helper") Signed-off-by: Felix Fietkau (cherry picked from commit 8118b2dace06de839e1e23f018059995f4af5e11) --- .../hostapd/patches/601-ucode_support.patch | 15 +++++++++++---- .../services/hostapd/patches/730-ft_iface.patch | 2 +- .../patches/803-hostapd-fix-80211be-build.patch | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/package/network/services/hostapd/patches/601-ucode_support.patch b/package/network/services/hostapd/patches/601-ucode_support.patch index 5a88687cf2..13fd2b1b51 100644 --- a/package/network/services/hostapd/patches/601-ucode_support.patch +++ b/package/network/services/hostapd/patches/601-ucode_support.patch @@ -816,7 +816,7 @@ as adding/removing interfaces. if (vlan_id) *vlan_id = 0; if (psk_len) -@@ -446,13 +447,16 @@ static const u8 * hostapd_wpa_auth_get_p +@@ -446,13 +447,18 @@ static const u8 * hostapd_wpa_auth_get_p * returned psk which should not be returned again. * logic list (all hostapd_get_psk; all sta->psk) */ @@ -830,16 +830,23 @@ as adding/removing interfaces. *vlan_id = 0; psk = sta->psk->psk; - for (pos = sta->psk; pos; pos = pos->next) { ++ if (vlan_id) ++ sta->psk_idx = psk_idx; + for (pos = sta->psk; pos; pos = pos->next, psk_idx++) { if (pos->is_passphrase) { if (pbkdf2_sha1(pos->passphrase, hapd->conf->ssid.ssid, -@@ -469,6 +473,8 @@ static const u8 * hostapd_wpa_auth_get_p +@@ -466,9 +472,13 @@ static const u8 * hostapd_wpa_auth_get_p + } + if (pos->psk == prev_psk) { + psk = pos->next ? pos->next->psk : NULL; ++ if (vlan_id) ++ sta->psk_idx = psk_idx + 1; break; } } -+ if (psk) -+ sta->psk_idx = psk_idx; ++ if (vlan_id && !psk) ++ sta->psk_idx = 0; } return psk; } diff --git a/package/network/services/hostapd/patches/730-ft_iface.patch b/package/network/services/hostapd/patches/730-ft_iface.patch index ac7d3abd78..f021f1f99b 100644 --- a/package/network/services/hostapd/patches/730-ft_iface.patch +++ b/package/network/services/hostapd/patches/730-ft_iface.patch @@ -29,7 +29,7 @@ a VLAN interface on top of the bridge, instead of using the bridge directly int bridge_hairpin; /* hairpin_mode on bridge members */ --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -1821,8 +1821,12 @@ int hostapd_setup_wpa(struct hostapd_dat +@@ -1825,8 +1825,12 @@ int hostapd_setup_wpa(struct hostapd_dat wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) { const char *ft_iface; diff --git a/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch index f197b71bd7..cbd6298d9d 100644 --- a/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch +++ b/package/network/services/hostapd/patches/803-hostapd-fix-80211be-build.patch @@ -25,7 +25,7 @@ + --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h -@@ -409,23 +409,8 @@ int ap_sta_re_add(struct hostapd_data *h +@@ -408,23 +408,8 @@ int ap_sta_re_add(struct hostapd_data *h void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta); From 5b7820534389346fa15e9a22cb638a20e99350b6 Mon Sep 17 00:00:00 2001 From: Pietro Ameruoso Date: Wed, 5 Feb 2025 11:40:48 +0100 Subject: [PATCH 2/9] mediatek: filogic: fix mt7986a-zyxel-ex5601-t0-stock.dts model name and eth1 wan definition Fix the model name to reflect the stock partitioning and the wan eth1 detection in the 02_network script. Fixes: https://github.com/openwrt/openwrt/issues/14432 Fixes: b5df398a36f1 ("mediatek: add Zyxel EX5601-T0 with uboot custom partition") Signed-off-by: Pietro Ameruoso Link: https://github.com/openwrt/openwrt/pull/17859 Signed-off-by: Hauke Mehrtens (cherry picked from commit d023ee7439f6d5c9bffa6f6e10b3b90f5782e84d) --- target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts | 4 ++-- target/linux/mediatek/filogic/base-files/etc/board.d/01_leds | 2 +- .../base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts index 4dbbd13677..b5553a8359 100644 --- a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts @@ -11,8 +11,8 @@ #include / { - model = "Zyxel EX5601-T0"; - compatible = "zyxel,ex5601-t0", "mediatek,mt7986a-rfb-snand"; + model = "Zyxel EX5601-T0 (stock layout)"; + compatible = "zyxel,ex5601-t0-stock", "mediatek,mt7986a"; memory@40000000 { device_type = "memory"; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index 5048e9bb8f..c2d9971f6f 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -126,7 +126,7 @@ xiaomi,redmi-router-ax6000-ubootmod) zbtlink,zbt-z8103ax) ucidef_set_led_netdev "wan" "wan" "green:wan" "eth1" "link tx rx" ;; -zyxel_ex5601-t0-stock|\ +zyxel,ex5601-t0-stock|\ zyxel,ex5601-t0-ubootmod) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" "link tx rx" ucidef_set_led_netdev "wan" "WAN" "green:inet" "eth1" "link tx rx" diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 6ee525e8d0..69e39f76fc 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -155,7 +155,7 @@ case "$board" in routerich,ax3000-ubootmod|\ zbtlink,zbt-z8102ax|\ zbtlink,zbt-z8103ax|\ - zyxel,ex5601-t0|\ + zyxel,ex5601-t0-stock|\ zyxel,ex5601-t0-ubootmod) addr=$(mtd_get_mac_binary "Factory" 0x4) [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress From d89527ce14152790a45993bf558fbb7ed29884c8 Mon Sep 17 00:00:00 2001 From: Klaas Demter Date: Sun, 9 Feb 2025 11:10:42 +0100 Subject: [PATCH 3/9] uboot-envtools: add support for ZyXEL GS-1900-24EP It seems the that this was forgotten during initial adding of the device in 0688cf5aebe1dc9a2e7f3820861783c2a7a75d44 Thanks to https://forum.openwrt.org/t/zyxel-gs1900-10hp-revision-b1-support-openwrt-firmware/131841/32 for putting me on the right track for this problem Error that is being fixed - running fw_printenv results in: "Warning: Bad CRC, using default environment" and not showing boardmodel Workaround, manually changing /etc/fw_env.config to "/dev/mtd1 0x0 0x400 0x10000" Signed-off-by: Klaas Demter Link: https://github.com/openwrt/openwrt/pull/17920 Signed-off-by: Hauke Mehrtens (cherry picked from commit 71a966c480432febcc5dd120e5b01662fa8ec328) --- package/boot/uboot-envtools/files/realtek | 1 + 1 file changed, 1 insertion(+) diff --git a/package/boot/uboot-envtools/files/realtek b/package/boot/uboot-envtools/files/realtek index cd2446432d..055730eb27 100644 --- a/package/boot/uboot-envtools/files/realtek +++ b/package/boot/uboot-envtools/files/realtek @@ -28,6 +28,7 @@ zyxel,gs1900-10hp|\ zyxel,gs1900-16|\ zyxel,gs1900-24-v1|\ zyxel,gs1900-24e|\ +zyxel,gs1900-24ep|\ zyxel,gs1900-24hp-v1|\ zyxel,gs1900-24hp-v2) idx="$(find_mtd_index u-boot-env)" From 424d758d1f1dc8feca008d4ce40cae3f233ea927 Mon Sep 17 00:00:00 2001 From: Lech Perczak Date: Wed, 12 Feb 2025 02:25:53 +0100 Subject: [PATCH 4/9] ath79: mikrotik: fix reference clock of Routerboard 911G When support for Routerboard 911G was introduced, Routerboad 912UAG device tree was used as a base, and the common part. This led to use of 40MHz as the reference clock frequency for both [1], while RB911G uses 25MHz crystal on the board, causing heavy system clock drift. Split the definition, and set the reference clock frequency for RB911G back to 25MHz. [1] a716ac556497 ("ath79: fix reference clock for RouterBoard 912UAG") Fixes: bcc44b1212b2 ("ath79: support for MikroTik RouterBOARD 911G-(2,5)HPnD") Signed-off-by: Lech Perczak Link: https://github.com/openwrt/openwrt/pull/17944 Signed-off-by: Hauke Mehrtens (cherry picked from commit 40fc6bd5cc679875e38ea1769527affdb5be12ba) --- .../ath79/dts/ar9342_mikrotik_routerboard-911g-xhpnd.dts | 4 ++++ target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g.dtsi | 4 ---- .../ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g-xhpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g-xhpnd.dts index 5fa44b4412..655c590f8c 100644 --- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g-xhpnd.dts +++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g-xhpnd.dts @@ -9,3 +9,7 @@ compatible = "mikrotik,routerboard-911g-xhpnd", "qca,ar9342"; model = "MikroTik RouterBOARD 911G-(2,5)HPnD"; }; + +&ref { + clock-frequency = <25000000>; +}; diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g.dtsi b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g.dtsi index 0c98a6634e..3a8c60456f 100644 --- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g.dtsi +++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-911g.dtsi @@ -146,10 +146,6 @@ }; }; -&ref { - clock-frequency = <40000000>; -}; - &spi { status = "okay"; diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts index 81d7284b3d..4cf62349f5 100644 --- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts +++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts @@ -10,6 +10,10 @@ model = "MikroTik RouterBOARD 912UAG-(2,5)HPnD"; }; +&ref { + clock-frequency = <40000000>; +}; + &pcie { status = "okay"; }; From 2efd34dfa6d4439bfc3a6ad84386fc2df21c4dd5 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Fri, 7 Feb 2025 21:00:22 +0800 Subject: [PATCH 5/9] mac80211: rt2x00: fix eeprom load from PCI eFuse When eeprom name is not defined, the file load function should return an error code so that it can fallthrough to read eeprom form NIC inside eFuse. Fixes: https://github.com/openwrt/openwrt/issues/17854 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17892 Signed-off-by: Hauke Mehrtens (cherry picked from commit 693108a31835d43d5e92f116b4dbd9fbed06b7ed) --- ...1-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch index b6b1e0da96..f3c8ddd4f6 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch @@ -151,7 +151,7 @@ Signed-off-by: Christian Marangi + } + + if (!ee_name) -+ return 0; ++ return -ENOENT; + + rt2x00_info(rt2x00dev, "Loading EEPROM data from '%s'.\n", ee_name); + From 9b05ca988c3a778c42d12dd34d9f7aa56c953cb6 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 8 Feb 2025 09:21:15 +0800 Subject: [PATCH 6/9] ramips: mt7620: add missing PA/LNA pinctrl for Linksys E1700 This device has high-power external PA and LNA[1]. So we must configure PA/LNA pins to make the wireless work properly. [1] https://fccid.io/Q87-E1700/Internal-Photos/Internal-Photos-pdf-2135639.pdf Fixes: https://github.com/openwrt/openwrt/issues/7959 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17892 Signed-off-by: Hauke Mehrtens (cherry picked from commit 3aa9b708364fd4a46c8466750f51069e22f3dde7) --- target/linux/ramips/dts/mt7620a_linksys_e1700.dts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts index caa6780d60..4dca56cd7e 100644 --- a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts +++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts @@ -167,6 +167,10 @@ }; &wmac { + pinctrl-names = "default", "pa_gpio"; + pinctrl-0 = <&pa_pins>; + pinctrl-1 = <&pa_gpio_pins>; + nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; }; From bccab05ac71e9d4ebec321dba997336e7ddff249 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 8 Feb 2025 15:36:24 +0800 Subject: [PATCH 7/9] base-files: fix offset conversion on caldata_patch_data() `$(( ))` will convert uninitialized variable to "0". If we want to use "-n" to check the string length, it's necessary to make sure the converted variable is not empty. Fixes: 652a6677d5fa ("base-files: Add new functions for ath11k caldata") Fixes: https://github.com/openwrt/openwrt/issues/17818 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17892 Signed-off-by: Hauke Mehrtens (cherry picked from commit 094b6f593fb4943005e13e2f8581e66bb7c2c8cf) --- package/base-files/files/lib/functions/caldata.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/functions/caldata.sh b/package/base-files/files/lib/functions/caldata.sh index 09289728c0..f0fc907aef 100644 --- a/package/base-files/files/lib/functions/caldata.sh +++ b/package/base-files/files/lib/functions/caldata.sh @@ -125,8 +125,8 @@ caldata_valid() { caldata_patch_data() { local data=$1 local data_count=$((${#1} / 2)) - local data_offset=$(($2)) - local chksum_offset=$(($3)) + [ -n "$2" ] && local data_offset=$(($2)) + [ -n "$3" ] && local chksum_offset=$(($3)) local target=$4 local fw_data local fw_chksum From cc5bc05a0e05b91266b498060dd2fb24b61de4fc Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 8 Feb 2025 15:39:13 +0800 Subject: [PATCH 8/9] Revert "Revert "ramips: mt7620: fix patching mac address in caldata"" This reverts commit f628467dfd6b32ead172d33a2593f04901395343. The initial fix was correct. However, a recently introduced bug in base-files can cause some unexpected byte overwriting in eeprom. Since it has been fixed, let's accept this patch again. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17892 Signed-off-by: Hauke Mehrtens (cherry picked from commit 43bc5e6e122b06eb9bfd22cf0bdf3212b84073f3) --- .../mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom index 2d1ac2e872..b68efcbba1 100644 --- a/target/linux/ramips/mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ b/target/linux/ramips/mt7620/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -34,12 +34,12 @@ case "$FIRMWARE" in wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000) wifi_mac=$(macaddr_add "$wan_mac" 1) jboot_eeprom_extract "config" 0xE000 - caldata_patch_mac $wifi_mac 0x4 + caldata_patch_data "${wifi_mac//:/}" 0x4 ;; dovado,tiny-ac) wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR) caldata_extract "factory" 0x0 0x200 - caldata_patch_mac $wifi_mac 0x4 + caldata_patch_data "${wifi_mac//:/}" 0x4 ;; *) caldata_die "Please define mtd-eeprom in $board DTS file!" From b7b6ae742440c41882d897e9798753dd3c122b5e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 14 Feb 2025 11:21:29 +0100 Subject: [PATCH 9/9] mt76: update to Git HEAD (2025-02-14) 2919ae2c0f94 wifi: mt76: mt7996: revise TXS size 1aaacd335577 wifi: mt76: mt7996: fix SER reset trigger on WED reset e9396ad2378f wifi: mt76: mt7996: remove unnecessary key->cipher check for BIP frames e5fef138524e mt76: only mark tx-status-failed frames as ACKed on mt76x0/2 Signed-off-by: Felix Fietkau (cherry picked from commit 3dfd1f69a769bd857061b4856270dfc78e30c610) --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index ef2c619885..ca7fe6c159 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2025-01-22 -PKG_SOURCE_VERSION:=a22d59e4ad50c89326342a0736cd2c1ba32e8a0b -PKG_MIRROR_HASH:=e8bbbada2171ea31a6788e3e46e81c409a9fe038eefe4b41f541da848a1b1bcd +PKG_SOURCE_DATE:=2025-02-14 +PKG_SOURCE_VERSION:=e5fef138524e63314cb96ff8314048d175294e95 +PKG_MIRROR_HASH:=4d6ea8669b3034c97f5b341a5473facf4fe21262a2fde71257b57c4d1c86be5e PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0