mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 23:42:43 +00:00
ath79: provide label MAC address
This patch adds the label MAC address for several devices in ath79. 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: - alfa-network,ap121f - avm,fritz300e - ubnt-xm devices For the following devices, label MAC address is tied to lan or wan, so no node to link to exists in device tree: - adtran,bsap1800-v2 - adtran,bsap1840 - dlink,dir-842-c1/-c2/-c3 - engenius,ecb1750 - iodata,etg3-r - iodata,wn-ac1167dgr - iodata,wn-ac1600dgr - iodata,wn-ac1600dgr2 - iodata,wn-ag300dgr - nec,wg800hp - nec,wg1200cr - trendnet,tew-823dru Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
469e347f19
commit
50fdc0374b
@ -314,9 +314,19 @@ ath79_setup_macs()
|
||||
adtran,bsap1800-v2|\
|
||||
adtran,bsap1840)
|
||||
lan_mac=$(mtd_get_mac_binary "Board data" 2)
|
||||
label_mac=$lan_mac
|
||||
;;
|
||||
alfa-network,ap121f|\
|
||||
ubnt,airrouter|\
|
||||
ubnt,bullet-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,rocket-m|\
|
||||
ubnt,unifi)
|
||||
label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
|
||||
;;
|
||||
avm,fritz300e)
|
||||
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
|
||||
label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
|
||||
;;
|
||||
avm,fritz4020)
|
||||
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
|
||||
@ -334,8 +344,13 @@ ath79_setup_macs()
|
||||
dlink,dir-842-c1|\
|
||||
dlink,dir-842-c2|\
|
||||
dlink,dir-842-c3|\
|
||||
nec,wg1200cr)
|
||||
lan_mac=$(mtd_get_mac_ascii devdata "lanmac")
|
||||
wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
|
||||
label_mac=$lan_mac
|
||||
;;
|
||||
dlink,dir-859-a1|\
|
||||
nec,wg1200cr|\
|
||||
qihoo,c301|\
|
||||
wd,mynet-n750)
|
||||
lan_mac=$(mtd_get_mac_ascii devdata "lanmac")
|
||||
wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
|
||||
@ -346,12 +361,9 @@ ath79_setup_macs()
|
||||
;;
|
||||
engenius,ecb1750)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
label_mac=$(mtd_get_mac_ascii u-boot-env athaddr)
|
||||
;;
|
||||
engenius,epg5000|\
|
||||
iodata,wn-ac1167dgr|\
|
||||
iodata,wn-ac1600dgr|\
|
||||
iodata,wn-ac1600dgr2|\
|
||||
iodata,wn-ag300dgr)
|
||||
engenius,epg5000)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
|
||||
;;
|
||||
@ -364,6 +376,15 @@ ath79_setup_macs()
|
||||
iodata,etg3-r)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
wan_mac=$(macaddr_add "$lan_mac" -1)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
iodata,wn-ac1167dgr|\
|
||||
iodata,wn-ac1600dgr|\
|
||||
iodata,wn-ac1600dgr2|\
|
||||
iodata,wn-ag300dgr)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
jjplus,ja76pf2)
|
||||
wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n alias/ethaddr)
|
||||
@ -372,6 +393,7 @@ ath79_setup_macs()
|
||||
nec,wg800hp)
|
||||
lan_mac=$(mtd_get_mac_text board_data 0x280)
|
||||
wan_mac=$(mtd_get_mac_text board_data 0x480)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
netgear,wndr3700|\
|
||||
netgear,wndr3700v2|\
|
||||
@ -382,10 +404,6 @@ ath79_setup_macs()
|
||||
lan_mac=$(k2t_get_mac "lan_mac")
|
||||
wan_mac=$(k2t_get_mac "wan_mac")
|
||||
;;
|
||||
qihoo,c301)
|
||||
lan_mac=$(mtd_get_mac_ascii devdata lanmac)
|
||||
wan_mac=$(mtd_get_mac_ascii devdata wanmac)
|
||||
;;
|
||||
rosinson,wr818)
|
||||
wan_mac=$(mtd_get_mac_binary factory 0x0)
|
||||
lan_mac=$(macaddr_setbit_la "$wan_mac")
|
||||
@ -406,6 +424,7 @@ ath79_setup_macs()
|
||||
trendnet,tew-823dru)
|
||||
lan_mac=$(mtd_get_mac_text mac 0x4)
|
||||
wan_mac=$(mtd_get_mac_text mac 0x18)
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
ubnt,routerstation|\
|
||||
ubnt,routerstation-pro)
|
||||
@ -419,6 +438,7 @@ ath79_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
|
||||
|
@ -19,6 +19,7 @@
|
||||
led-failsafe = &power_red;
|
||||
led-running = &power_green;
|
||||
led-upgrade = &power_green;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
extosc: ref {
|
||||
|
@ -12,6 +12,7 @@
|
||||
led-failsafe = &power_orange;
|
||||
led-running = &power_green;
|
||||
led-upgrade = &power_orange;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
|
@ -11,6 +11,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = &ath9k;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -11,6 +11,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = &ath9k;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = &ath9k;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -12,6 +12,7 @@
|
||||
led-failsafe = &globe;
|
||||
led-running = &globe;
|
||||
led-upgrade = &globe;
|
||||
label-mac-device = &wifi;
|
||||
};
|
||||
|
||||
airrouter-leds {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &dome_green;
|
||||
led-running = &dome_green;
|
||||
led-upgrade = &dome_green;
|
||||
label-mac-device = &wifi;
|
||||
};
|
||||
|
||||
extosc: ref {
|
||||
@ -110,7 +111,7 @@
|
||||
&pcie {
|
||||
status = "okay";
|
||||
|
||||
wifi@0,0 {
|
||||
wifi: wifi@0,0 {
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
};
|
||||
|
@ -89,7 +89,7 @@
|
||||
&pcie {
|
||||
status = "okay";
|
||||
|
||||
wifi@0,0 {
|
||||
wifi: wifi@0,0 {
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
};
|
||||
|
@ -9,6 +9,7 @@
|
||||
aliases {
|
||||
led-boot = &link4;
|
||||
led-failsafe = &link4;
|
||||
label-mac-device = &wifi;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &power;
|
||||
led-running = &power;
|
||||
led-upgrade = &power;
|
||||
label-mac-device = &ath9k;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -10,6 +10,10 @@
|
||||
compatible = "buffalo,wzr-hp-g450h", "qca,ar7242";
|
||||
model = "Buffalo WZR-HP-G450H/WZR-450HP";
|
||||
|
||||
aliases {
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
extosc: ref {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
extosc: ref {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-boot = &wlan;
|
||||
led-failsafe = &wlan;
|
||||
led-upgrade = &wlan;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
aliases {
|
||||
serial0 = &uart;
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -13,6 +13,7 @@
|
||||
aliases {
|
||||
led-boot = &led_lan;
|
||||
led-failsafe = &led_lan;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -13,6 +13,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -13,6 +13,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
keys: keys {
|
||||
|
@ -14,6 +14,7 @@
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
led-failsafe = &system;
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-boot = &wan;
|
||||
led-failsafe = &wan;
|
||||
led-upgrade = &wan;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -7,6 +7,10 @@
|
||||
#include "ar9344.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
|
@ -6,6 +6,10 @@
|
||||
/ {
|
||||
model = "TP-Link TL-WDR3500 v1";
|
||||
compatible = "tplink,tl-wdr3500-v1", "qca,ar9344";
|
||||
|
||||
aliases {
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
|
@ -2,6 +2,12 @@
|
||||
|
||||
#include "ar9344_tplink_tl-wdrxxxx.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
label-mac-device = &ath9k;
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
usb1 {
|
||||
label = "tp-link:green:usb1";
|
||||
|
@ -10,6 +10,10 @@
|
||||
compatible = "comfast,cf-e5", "qca,qca9531";
|
||||
model = "COMFAST CF-E5/E7";
|
||||
|
||||
aliases {
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys-polled";
|
||||
poll-interval = <20>;
|
||||
|
@ -11,6 +11,7 @@
|
||||
led-failsafe = &led_status;
|
||||
led-running = &led_status;
|
||||
led-upgrade = &led_status;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
keys {
|
||||
|
@ -10,6 +10,10 @@
|
||||
compatible = "glinet,gl-ar750", "qca,qca9531";
|
||||
model = "GL.iNet GL-AR750";
|
||||
|
||||
aliases {
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
|
@ -10,6 +10,10 @@
|
||||
compatible = "tplink,archer-d50-v1", "qca,qca9531";
|
||||
model = "TP-Link Archer D50 v1";
|
||||
|
||||
aliases {
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
chosen {
|
||||
bootargs = "console=ttyS0,115200n8";
|
||||
};
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -11,6 +11,10 @@
|
||||
bootargs = "console=ttyS0,115200n8";
|
||||
};
|
||||
|
||||
aliases {
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
gpio_leds: leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
led-failsafe = &power_led;
|
||||
led-running = &power_led;
|
||||
led-upgrade = &power_led;
|
||||
label-mac-device = ð1;
|
||||
};
|
||||
|
||||
gpio_leds: leds {
|
||||
|
@ -10,6 +10,10 @@
|
||||
compatible = "ubnt,acb-isp", "qca,qca9533";
|
||||
model = "Ubiquiti airCube ISP";
|
||||
|
||||
aliases {
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = ð1;
|
||||
};
|
||||
|
||||
gpio_leds: leds {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &power_amber;
|
||||
led-running = &power_green;
|
||||
led-upgrade = &power_amber;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
led_spi {
|
||||
|
@ -19,6 +19,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð1;
|
||||
};
|
||||
|
||||
gpio_leds: leds {
|
||||
|
@ -17,6 +17,7 @@
|
||||
led-running = &led_power;
|
||||
led-upgrade = &led_power;
|
||||
mdio-gpio0 = &mdio2;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -19,6 +19,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = ð1;
|
||||
};
|
||||
|
||||
gpio_leds: leds {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -19,6 +19,7 @@
|
||||
led-failsafe = &led_system;
|
||||
led-running = &led_system;
|
||||
led-upgrade = &led_system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -55,6 +55,7 @@
|
||||
led-failsafe = &power;
|
||||
led-running = &power;
|
||||
led-upgrade = &power;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -13,6 +13,7 @@
|
||||
led-failsafe = &power;
|
||||
led-running = &power;
|
||||
led-upgrade = &power;
|
||||
label-mac-device = ð1;
|
||||
};
|
||||
|
||||
chosen {
|
||||
|
@ -19,6 +19,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
led_spi {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &power;
|
||||
led-running = &power;
|
||||
led-upgrade = &power;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
|
||||
gpio_leds: leds {
|
||||
|
@ -16,6 +16,7 @@
|
||||
led-failsafe = &system;
|
||||
led-running = &system;
|
||||
led-upgrade = &system;
|
||||
label-mac-device = &wmac;
|
||||
};
|
||||
|
||||
gpio_leds: leds {
|
||||
|
@ -2,6 +2,12 @@
|
||||
|
||||
#include "qca9563_ubnt_unifiac.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
|
||||
|
@ -2,6 +2,12 @@
|
||||
|
||||
#include "qca9563_ubnt_unifiac.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
label-mac-device = ð0;
|
||||
};
|
||||
};
|
||||
|
||||
&mdio0 {
|
||||
status = "okay";
|
||||
phy-mask = <0>;
|
||||
|
Loading…
Reference in New Issue
Block a user