mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-09 18:59:13 +08:00
ramips: mt76x8: use flash location for wan_mac in 02_network
This uses the flash locations instead of eth0 MAC address to calculate MAC address increments for WAN. The change will make the MAC address setup of a particular device more obvious and removes the dependency of 02_network on the eth0 initialization. While at it, change the partition label for zyxel,keenetic-extra-ii to factory to be consistent with node label and all the other devices. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
ed975a58e4
commit
fef1810897
@ -107,7 +107,7 @@
|
||||
};
|
||||
|
||||
factory: partition@40000 {
|
||||
label = "rf-eeprom";
|
||||
label = "factory";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
@ -138,27 +138,10 @@ ramips_setup_macs()
|
||||
;;
|
||||
duzun,dm06|\
|
||||
netgear,r6120|\
|
||||
rakwireless,rak633|\
|
||||
tplink,archer-c20-v4|\
|
||||
tplink,archer-c50-v3|\
|
||||
tplink,archer-c50-v4|\
|
||||
tplink,tl-mr3420-v5|\
|
||||
tplink,tl-wr840n-v4|\
|
||||
tplink,tl-wr840n-v5|\
|
||||
tplink,tl-wr841n-v13|\
|
||||
tplink,tl-wr841n-v14|\
|
||||
tplink,tl-wr842n-v5|\
|
||||
unielec,u7628-01-16m|\
|
||||
wavlink,wl-wn570ha1|\
|
||||
wavlink,wl-wn575a3|\
|
||||
wiznet,wizfi630s|\
|
||||
wrtnode,wrtnode2p|\
|
||||
wrtnode,wrtnode2r|\
|
||||
xiaomi,mir4a-100m|\
|
||||
xiaomi,miwifi-nano|\
|
||||
zbtlink,zbt-we1226|\
|
||||
zyxel,keenetic-extra-ii)
|
||||
wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
|
||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1)
|
||||
;;
|
||||
hilink,hlk-7628n)
|
||||
lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
|
||||
@ -185,14 +168,41 @@ ramips_setup_macs()
|
||||
mercury,mac1200r-v2)
|
||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory_info 0xd)" 1)
|
||||
;;
|
||||
rakwireless,rak633|\
|
||||
unielec,u7628-01-16m|\
|
||||
wavlink,wl-wn575a3|\
|
||||
wiznet,wizfi630s|\
|
||||
xiaomi,miwifi-nano)
|
||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x28)" 1)
|
||||
;;
|
||||
skylab,skw92a|\
|
||||
totolink,lr1200)
|
||||
wan_mac=$(mtd_get_mac_binary factory 0x2e)
|
||||
;;
|
||||
tplink,archer-c20-v4|\
|
||||
tplink,archer-c50-v3|\
|
||||
tplink,tl-mr3420-v5|\
|
||||
tplink,tl-wr840n-v4|\
|
||||
tplink,tl-wr840n-v5|\
|
||||
tplink,tl-wr841n-v13|\
|
||||
tplink,tl-wr841n-v14|\
|
||||
tplink,tl-wr842n-v5)
|
||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xf100)" 1)
|
||||
;;
|
||||
tplink,archer-c50-v4)
|
||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary rom 0xf100)" 1)
|
||||
;;
|
||||
vocore,vocore2|\
|
||||
vocore,vocore2-lite)
|
||||
label_mac=$(mtd_get_mac_binary factory 0x8)
|
||||
;;
|
||||
wavlink,wl-wn570ha1|\
|
||||
zbtlink,zbt-we1226)
|
||||
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x2e)" 1)
|
||||
;;
|
||||
xiaomi,mir4a-100m)
|
||||
wan_mac=$(mtd_get_mac_binary factory 0x4)
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
|
Loading…
x
Reference in New Issue
Block a user