aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/base-files/etc
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-06-24 17:57:15 +0200
committerPetr Štetiar <ynezz@true.cz>2019-09-19 23:43:27 +0200
commit7140394903b1bfbbb589dafa524e2dbd6cd79862 (patch)
tree06c042c40f460bdfa6b2d16f8f10a0fc1952512a /target/linux/ramips/base-files/etc
parentf8d96485298e15879b34eb49a00af020aa91d334 (diff)
downloadupstream-7140394903b1bfbbb589dafa524e2dbd6cd79862.tar.gz
upstream-7140394903b1bfbbb589dafa524e2dbd6cd79862.tar.bz2
upstream-7140394903b1bfbbb589dafa524e2dbd6cd79862.zip
ramips: provide label MAC address
This patch adds the label MAC address for several devices in ramips. Some devices require setting the MAC address in 02_network: For the following devices, the netif device can be linked in device tree, but the MAC address cannot be read: - cudy,wr1000 - dlink,dir-615-d - dlink,dir-615-h1 - dlink,dir-860l-b1 - glinet,gl-mt300a - glinet,gl-mt300n - glinet,gl-mt750 - vocore,vocore2 - vocore,vocore2-lite - zbtlink,zbt-we1326 - zbtlink,zbt-wg3526 For the following devices, label MAC address is tied to lan or wan, so no node to link to exists in device tree: - dlink,dir-510l - dlink,dwr-116-a1 - dlink,dwr-118-a1 - dlink,dwr-118-a2 - dlink,dwr-921-c1 - dlink,dwr-922-e2 - all hiwifi devices - lava,lr-25g001 - xiaomi,mir3p Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ramips/base-files/etc')
-rwxr-xr-xtarget/linux/ramips/base-files/etc/board.d/02_network36
1 files changed, 32 insertions, 4 deletions
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index b4634e0928..2aab2edfea 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -511,7 +511,6 @@ ramips_setup_macs()
8devices,carambola|\
alfa-network,w502u|\
arcwireless,freestation5|\
- cudy,wr1000|\
lenovo,newifi-y1|\
lenovo,newifi-y1s|\
netgear,wnce2001|\
@@ -547,7 +546,6 @@ ramips_setup_macs()
planex,vr500|\
samknows,whitebox-v8|\
youku,yk-l2|\
- zbtlink,zbt-we1326|\
zbtlink,zbt-we3526)
wan_mac=$(mtd_get_mac_binary factory 0xe006)
;;
@@ -558,6 +556,7 @@ ramips_setup_macs()
belkin,f9k1109v1)
wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC)
lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC)
+ label_mac=$wan_mac
;;
buffalo,wcr-1166ds|\
buffalo,wsr-1166dhp)
@@ -574,6 +573,10 @@ ramips_setup_macs()
zyxel,keenetic-start)
# This empty case has to be kept for devices without any MAC address adjustments
;;
+ cudy,wr1000)
+ wan_mac=$(mtd_get_mac_binary factory 0x2e)
+ label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+ ;;
dlink,dch-m225|\
samsung,cy-swr1100)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
@@ -587,6 +590,17 @@ ramips_setup_macs()
lava,lr-25g001)
wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
lan_mac=$(macaddr_add "$wan_mac" 1)
+ label_mac=$wan_mac
+ ;;
+ dlink,dir-615-d|\
+ dlink,dir-615-h1|\
+ glinet,gl-mt300a|\
+ glinet,gl-mt300n|\
+ glinet,gl-mt750|\
+ zbtlink,zbt-wg3526-16m|\
+ zbtlink,zbt-wg3526-32m)
+ wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
+ label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
;;
dlink,dir-645)
lan_mac=$(mtd_get_mac_ascii nvram lanmac)
@@ -595,6 +609,7 @@ ramips_setup_macs()
dlink,dir-860l-b1)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
wan_mac=$(mtd_get_mac_ascii factory wanmac)
+ label_mac=$(cat /sys/class/ieee80211/phy1/macaddress)
;;
dovado,tiny-ac)
lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR)
@@ -616,7 +631,8 @@ ramips_setup_macs()
hiwifi,hc5861|\
hiwifi,hc5861b|\
hiwifi,hc5962)
- lan_mac=`mtd_get_mac_ascii bdinfo "Vfac_mac "`
+ lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
+ label_mac=$lan_mac
[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
@@ -667,13 +683,24 @@ ramips_setup_macs()
trendnet,tew-691gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 3)
;;
- xiaomi,mir3g|\
+ vocore,vocore2|\
+ vocore,vocore2-lite)
+ label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+ ;;
+ xiaomi,mir3g)
+ lan_mac=$(mtd_get_mac_binary factory 0xe006)
+ ;;
xiaomi,mir3p)
lan_mac=$(mtd_get_mac_binary factory 0xe006)
+ label_mac=$lan_mac
;;
xiaomi,miwifi-mini)
lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
;;
+ zbtlink,zbt-we1326)
+ wan_mac=$(mtd_get_mac_binary factory 0xe006)
+ label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+ ;;
*)
wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
;;
@@ -681,6 +708,7 @@ ramips_setup_macs()
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
+ [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
}
board_config_update