ar71xx: fix MAC addresses on TP-Link TL-WR1043ND v4
authorMatthias Schiffer <mschiffer@universe-factory.net>
Mon, 11 Sep 2017 17:41:41 +0000 (19:41 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Mon, 11 Sep 2017 17:48:28 +0000 (19:48 +0200)
The addresses were read from the 'config' partition, which would not always
contain the addresses at the same offsets, depending on the stock firmware
version used before flashing LEDE. Change this to get the addresses from
the 'product-info' partition, which is read-only.

Reported-and-tested-by: Andreas Ziegler <ml@andreas-ziegler.de>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c

index 01c947d531e4161fa1ccc52a9fc9180b0699c2ae..cb707f6169f48a9390b622cb26e8fab8de94e4bb 100755 (executable)
@@ -481,7 +481,8 @@ ar71xx_setup_macs()
                wan_mac=$(mtd_get_mac_binary caldata 6)
                ;;
        tl-wr1043nd-v4)
-               wan_mac=$(mtd_get_mac_binary config 0x1017c)
+               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")
index cb224f4611004aaaec6c3b2b737b3bb45c79d239..b1539c5d71a61806b88c50f1a78f6a27d98d7a2d 100644 (file)
@@ -57,7 +57,7 @@
 #define TL_WR1043_V4_KEYS_POLL_INTERVAL                20 /* msecs */
 #define TL_WR1043_V4_KEYS_DEBOUNCE_INTERVAL    (3 * TL_WR1043_V4_KEYS_POLL_INTERVAL)
 
-#define TL_WR1043_V4_MAC_LOCATION              0x1ff80174
+#define TL_WR1043_V4_MAC_LOCATION              0x1ff50008
 
 #define TL_WR1043_V4_EEPROM_ADDR               0x1fff0000
 #define TL_WR1043_V4_WMAC_CALDATA_OFFSET       0x1000