From 5dc8c8fedd80ef6e3a0f1a26fb8579a94ce3bc0c Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sun, 26 Mar 2023 23:50:43 +0800 Subject: [PATCH] ramips: fix 5g mac for TOTOLINK X5000R There's no valid mac address for the second band in the eeprom. The vendor fw uses 2.4G mac + 4 as the mac for 5G radio. Do the same in our firmware. Fixes: 23be410b3d ("ramips: add support for TOTOLINK X5000R") Signed-off-by: Chuanhong Guo (cherry picked from commit 212632540043cc9b911c2efb86156479f2710836) --- .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 5eafe3dc04..62091b96bb 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -45,6 +45,10 @@ case "$board" in macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \ > /sys${DEVPATH}/macaddress ;; + totolink,x5000r) + hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" + [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 4 > /sys${DEVPATH}/macaddress + ;; yuncore,ax820) [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0xe000)" > /sys${DEVPATH}/macaddress