Skip to content

Commit

Permalink
ramips: fix Ethernet random MAC address for HILINK HLK-7628N
Browse files Browse the repository at this point in the history
Set the ethernet address from flash.

MAC addresses as verified by OEM firmware:

  use   interface  source
  2g    wlan0      factory 0x04 (label)
  LAN   eth0.1     factory 0x28 (label+1)
  WAN   eth0.2     factory 0x2e (label+2)

Fixes: 671c9d1 ("ramips: add support for HILINK HLK-7628N")

Signed-off-by: Liu Yu <f78fk@live.com>
[drop old MAC address setup from 02_network, cut out state_default
changes, face-lift commit message, add Fixes:]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
  • Loading branch information
liuyuf78fk authored and adschm committed Jun 9, 2021
1 parent 7f946a8 commit ae9c5cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
Expand Up @@ -80,6 +80,10 @@
};
};

&ethernet {
mtd-mac-address = <&factory 0x28>;
};

&wmac {
status = "okay";
};
5 changes: 1 addition & 4 deletions target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
Expand Up @@ -168,6 +168,7 @@ ramips_setup_macs()
lan_mac=$wan_mac
;;
cudy,wr1000|\
hilink,hlk-7628n|\
hilink,hlk-7688a|\
wavlink,wl-wn577a2|\
wavlink,wl-wn578a2)
Expand All @@ -187,10 +188,6 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_binary factory 0x22)
label_mac=$wan_mac
;;
hilink,hlk-7628n)
lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
hiwifi,hc5661a|\
hiwifi,hc5761a|\
hiwifi,hc5861b)
Expand Down

0 comments on commit ae9c5cd

Please sign in to comment.