ar71xx: fix MAC addresses for Archer C5 v1, C7 v1/v2, WDR4900 v2
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 13 Nov 2019 14:05:29 +0000 (15:05 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 13 Nov 2019 14:12:32 +0000 (15:12 +0100)
As discussed in 1d18a14a90c7 ("ath79: really fix TP-Link Archer C7
v2 MAC address"), stock firmware MAC address assignment is
actually as follows:

wlan0 (5GHz) : -1
wlan1 (2.4GHz) : 0
eth1 (LAN) : 0
eth0 (WAN) : 1

This has never been fixed for ar71xx, so let's do it now.
Note that with WDR4900 v2 even both wlan0 and wlan1 where assigned
to basemac-1 before ...

Fixes: FS#408

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7.c

index 2ba8de47836d05338de579dea206e1f727eb9a35..5170fa518fc78b09ec608bb4dd2a8810a67b8c05 100644 (file)
@@ -143,7 +143,7 @@ case "$FIRMWARE" in
        archer-c5|\
        archer-c7)
                ath10kcal_extract "art" 0x5000 0x844
-               ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
+               ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1)
                ;;
        nbg6616|\
        nbg6716)
index 287252780d77555d3edac71c121c0db4a5548363..923ed28b4ad7cc6f65171a70478eace1e4e8b3ed 100644 (file)
@@ -212,8 +212,7 @@ static void __init common_setup(bool pcie_slot)
        ath79_register_leds_gpio(-1, ARRAY_SIZE(archer_c7_leds_gpio),
                                 archer_c7_leds_gpio);
 
-       ath79_init_mac(tmpmac, mac, -1);
-       ath79_register_wmac(art + ARCHER_C7_WMAC_CALDATA_OFFSET, tmpmac);
+       ath79_register_wmac(art + ARCHER_C7_WMAC_CALDATA_OFFSET, mac);
 
        if (pcie_slot) {
                ath79_register_pci();