mediatek: set persistent wifi mac for bpi-r64 and bpi-r3

Use persistent MAC address for the built-in wireless interfaces of the
BPi-R64 and BPi-R3 development boards.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle 2022-11-24 16:38:29 +00:00
parent 87fc485450
commit c1d1202e67
No known key found for this signature in database
GPG Key ID: 5A8F39C31C3217CA
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,18 @@
[ "$ACTION" == "add" ] || exit 0
PHYNBR=${DEVPATH##*/phy}
[ -n $PHYNBR ] || exit 0
. /lib/functions.sh
. /lib/functions/system.sh
board=$(board_name)
case "$board" in
bananapi,bpi-r3)
addr=$(macaddr_add $(cat /sys/class/net/eth0/address) 2)
[ "$PHYNBR" = "0" ] && macaddr_unsetbit $addr 6 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_setbit $addr 6 > /sys${DEVPATH}/macaddress
;;
esac

View File

@ -10,6 +10,9 @@ PHYNBR=${DEVPATH##*/phy}
board=$(board_name)
case "$board" in
bananapi,bpi-r64)
[ "$PHYNBR" = "0" ] && macaddr_add $(cat /sys/class/net/eth0/address) 2 > /sys${DEVPATH}/macaddress
;;
ruijie,rg-ew3200gx-pro)
[ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress