[openwrt/openwrt] mediatek: bpi-r3-mini: persist WiFi and WAN MAC addresses
LEDE Commits
lede-commits at lists.infradead.org
Sun Apr 28 13:47:51 PDT 2024
dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/abbcbb92283d8cdb22828122ca476f5d8dd9f782
commit abbcbb92283d8cdb22828122ca476f5d8dd9f782
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Apr 28 03:00:50 2024 +0100
mediatek: bpi-r3-mini: persist WiFi and WAN MAC addresses
Derive WAN and WiFi MAC addresses from the (random) MAC address stored
in the U-Boot environment.
Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
target/linux/mediatek/filogic/base-files/etc/board.d/02_network | 3 ++-
.../filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index 51e02efb39..597754da7b 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -119,7 +119,8 @@ mediatek_setup_macs()
local label_mac=""
case $board in
- bananapi,bpi-r3)
+ bananapi,bpi-r3|\
+ bananapi,bpi-r3-mini)
wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1)
;;
cmcc,rax3000m)
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 bd6e775963..53c9b7f259 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
@@ -36,7 +36,8 @@ case "$board" in
[ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
;;
- bananapi,bpi-r3)
+ bananapi,bpi-r3|\
+ bananapi,bpi-r3-mini)
addr=$(cat /sys/class/net/eth0/address)
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
More information about the lede-commits
mailing list