0122-ar71xx-fix-MAC-addresses-on-TP-Link-TL-WR1043ND-v4.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Mon, 11 Sep 2017 19:41:41 +0200
  3. Subject: ar71xx: fix MAC addresses on TP-Link TL-WR1043ND v4
  4. The addresses were read from the 'config' partition, which would not always
  5. contain the addresses at the same offsets, depending on the stock firmware
  6. version used before flashing LEDE. Change this to get the addresses from
  7. the 'product-info' partition, which is read-only.
  8. Reported-and-tested-by: Andreas Ziegler <ml@andreas-ziegler.de>
  9. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  10. Backport of LEDE 53839da46e6fb21e68b3878b4a2187c7d32d688e
  11. diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  12. index 4389bc894f8dd08a9231b35bbb4fba0e9e57560b..602ce71170dac1fe0e6cb80a83cbe401836f75ff 100755
  13. --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  14. +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
  15. @@ -213,7 +213,8 @@ tl-wr1043nd-v4)
  16. ucidef_add_switch "switch0" "1" "1"
  17. ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4"
  18. ucidef_add_switch_vlan "switch0" "2" "0t 5"
  19. - mac=$(mtd_get_mac_binary config 0x1017c)
  20. + lan_mac=$(mtd_get_mac_binary product-info 8)
  21. + mac=$(macaddr_add "$lan_mac" 1)
  22. [ -n "$mac" ] && ucidef_set_interface_macaddr "wan" "$mac"
  23. ;;
  24. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c
  25. index cb224f4611004aaaec6c3b2b737b3bb45c79d239..b1539c5d71a61806b88c50f1a78f6a27d98d7a2d 100644
  26. --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c
  27. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c
  28. @@ -57,7 +57,7 @@
  29. #define TL_WR1043_V4_KEYS_POLL_INTERVAL 20 /* msecs */
  30. #define TL_WR1043_V4_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR1043_V4_KEYS_POLL_INTERVAL)
  31. -#define TL_WR1043_V4_MAC_LOCATION 0x1ff80174
  32. +#define TL_WR1043_V4_MAC_LOCATION 0x1ff50008
  33. #define TL_WR1043_V4_EEPROM_ADDR 0x1fff0000
  34. #define TL_WR1043_V4_WMAC_CALDATA_OFFSET 0x1000