ipq95xx: WF189 update BDF and set eth mac address

Fixes: WIFI-14096
Signed-off-by: Ken <xshi@actiontec.com>
This commit is contained in:
Ken
2024-08-30 15:18:48 +08:00
committed by John Crispin
parent 67c62ce445
commit ba5074c57f
3 changed files with 29 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
#!/bin/sh
. /lib/functions/uci-defaults.sh
. /lib/functions.sh
. /lib/functions/system.sh
ipq53xx_setup_interfaces()
{
@@ -20,9 +22,36 @@ ipq53xx_setup_interfaces()
esac
}
qcom_setup_macs()
{
local board="$1"
case $board in
cig,wf189)
mtd=$(find_mtd_chardev "0:APPSBLENV")
[ -z "$mtd" ] && return;
mac=$(grep BaseMacAddress= $mtd | cut -dx -f2)
[ -z "$mac" ] && return;
wan_mac=$(macaddr_canonicalize $mac)
lan_mac=$(macaddr_add "$wan_mac" 1)
ucidef_set_network_device_mac eth0 $lan_mac
ucidef_set_network_device_mac eth1 $wan_mac
ucidef_set_label_macaddr $wan_mac
;;
*)
wan_mac=$(cat /sys/class/net/eth1/address)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
[ -n "$wan_mac" ] && ucidef_set_label_macaddr "$wan_mac"
}
board_config_update
board=$(board_name)
ipq53xx_setup_interfaces $board
qcom_setup_macs $board
board_config_flush
exit 0