From 78257d8fe85027cdcef6037826595eba071dfdf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B8rn=20Mork?= Date: Wed, 24 Sep 2025 19:18:20 +0200 Subject: [PATCH] mediatek: filogic: use nvmem for Unifi 6 Plus WiFi mac MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Avoids the occacial lost race, where VAPs are created before the hotplug script has updated the phy mac address. Signed-off-by: Bjørn Mork Link: https://github.com/openwrt/openwrt/pull/20154 Signed-off-by: Hauke Mehrtens --- .../mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts | 16 ++++++++++++++++ .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 5 ----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts index 51b8c42021..9c1182e85d 100644 --- a/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts +++ b/target/linux/mediatek/dts/mt7981a-ubnt-unifi-6-plus.dts @@ -128,7 +128,9 @@ }; macaddr_eeprom_6: macaddr@6 { + compatible = "mac-base"; reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; }; }; }; @@ -169,5 +171,19 @@ }; &wifi { + #address-cells = <1>; + #size-cells = <0>; status = "okay"; + + band@0 { + reg = <0>; + nvmem-cells = <&macaddr_eeprom_6 0>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_eeprom_6 1>; + nvmem-cell-names = "mac-address"; + }; }; 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 d753941c62..93a3e86a16 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 @@ -206,11 +206,6 @@ case "$board" in tplink,tl-xtr8488) [ "$PHYNBR" = "1" ] && get_mac_label > /sys${DEVPATH}/macaddress ;; - ubnt,unifi-6-plus) - addr=$(mtd_get_mac_binary EEPROM 0x6) - [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress - ;; routerich,ax3000|\ routerich,ax3000-ubootmod|\ zbtlink,zbt-z8102ax|\ -- 2.30.2