ar71xx: use correct wan mac address for the TP-Link Archer C7 v4
authorDavid Santamaría Rogado <howl.nsp@gmail.com>
Fri, 18 Jan 2019 21:28:41 +0000 (22:28 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 30 Jan 2019 11:24:07 +0000 (12:24 +0100)
The correct MAC address for this device is lan_mac +1, there is no
need to set lan_mac so use base_mac variable instead lan_mac.

Based on this PR for ath79:
https://github.com/openwrt/openwrt/pull/1726

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>
[fix alphabetical ordering, reword subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
target/linux/ar71xx/base-files/etc/board.d/02_network

index 7f209fbcac2adc0d9c945458c8994001f074ae4d..ef83896664476de5d62708ae69df6e44558db34c 100755 (executable)
@@ -589,6 +589,10 @@ ar71xx_setup_macs()
        local wan_mac=""
 
        case $board in
+       archer-c7-v4)
+               base_mac=$(mtd_get_mac_binary config 8)
+               wan_mac=$(macaddr_add "$base_mac" 1)
+               ;;
        dgl-5500-a1|\
        dir-825-c1)
                wan_mac=$(mtd_get_mac_ascii nvram "wan_mac")
@@ -600,6 +604,13 @@ ar71xx_setup_macs()
                lan_mac=$(mtd_get_mac_binary caldata 0)
                wan_mac=$(mtd_get_mac_binary caldata 6)
                ;;
+       dir-869-a1|\
+       mynet-n750)
+               wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
+               ;;
+       esr900)
+               wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
+               ;;
        fritz300e)
                lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
                ;;
@@ -608,13 +619,6 @@ ar71xx_setup_macs()
                lan_mac=$(mtd_get_mac_binary product-info 8)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
-       esr900)
-               wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")
-               ;;
-       dir-869-a1|\
-       mynet-n750)
-               wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
-               ;;
        wlr8100)
                lan_mac=$(mtd_get_mac_ascii u-boot-env "ethaddr")
                wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr")