diff options
Diffstat (limited to 'target/linux/mediatek/mt7622')
-rw-r--r-- | target/linux/mediatek/mt7622/base-files/etc/board.d/02_network | 18 | ||||
-rw-r--r-- | target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac | 17 |
2 files changed, 34 insertions, 1 deletions
diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network index 7b454314cf..4649d0dc57 100644 --- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network @@ -12,7 +12,8 @@ mediatek_setup_interfaces() linksys,e8450|\ linksys,e8450-ubi|\ mediatek,mt7622-rfb1|\ - mediatek,mt7622-rfb1-ubi) + mediatek,mt7622-rfb1-ubi|\ + ruijie,rg-ew3200gx-pro) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan ;; buffalo,wsr-2533dhp2) @@ -30,9 +31,24 @@ mediatek_setup_interfaces() esac } +mediatek_setup_macs() +{ + local board="$1" + local lan_mac="" + + case $board in + ruijie,rg-ew3200gx-pro) + lan_mac=$(macaddr_add $(get_mac_label) 1) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac +} + board_config_update board=$(board_name) mediatek_setup_interfaces $board +mediatek_setup_macs $board board_config_flush exit 0 diff --git a/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac new file mode 100644 index 0000000000..d573465745 --- /dev/null +++ b/target/linux/mediatek/mt7622/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -0,0 +1,17 @@ +[ "$ACTION" == "add" ] || exit 0 + +PHYNBR=${DEVPATH##*/phy} + +[ -n $PHYNBR ] || exit 0 + +. /lib/functions.sh +. /lib/functions/system.sh + +board=$(board_name) + +case "$board" in + 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 + ;; +esac |