ath79: Read MAC addresses from flash in 11-ath10k-caldata
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 5 Jun 2019 13:31:32 +0000 (15:31 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Mon, 10 Jun 2019 09:25:41 +0000 (11:25 +0200)
In commit c3a8518 eth0 and eth1 have been swapped for some devices,
but 11-ath10k-caldata has not been updated.
Instead of fixing this by swapping eth0/eth1, this patch will read
addresses from flash (as done for several devices already) so
adjustments due to eth order become obsolete.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata

index b2f5d17213c921604626a715b830cb832ac6d755..607c04a75f537930634dc2d3976ad027213b9bbd 100644 (file)
@@ -112,13 +112,18 @@ case "$FIRMWARE" in
                ath10kcal_extract "art" 20480 2116
                ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
                ;;
-       engenius,ews511ap|\
-       glinet,gl-ar750s|\
-       glinet,gl-x750|\
-       tplink,re450-v2)
+       engenius,ews511ap)
                ath10kcal_extract "art" 20480 2116
                ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
                ;;
+       glinet,gl-ar750s)
+               ath10kcal_extract "art" 20480 2116
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) +1)
+               ;;
+       glinet,gl-x750)
+               ath10kcal_extract "art" 20480 2116
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) +2)
+               ;;
        nec,wg800hp)
                ath10kcal_extract "art" 20480 2116
                ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 2176)
@@ -132,28 +137,32 @@ case "$FIRMWARE" in
                ath10kcal_extract "ART" 20480 2116
                ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
                ;;
+       tplink,archer-a7-v5|\
+       tplink,archer-c7-v4|\
+       tplink,archer-c7-v5)
+               ath10kcal_extract "art" 20480 2116
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 8) -1)
+               ;;
        tplink,archer-c2-v3)
                ath10kcal_extract "ART" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 8) -1)
                ;;
        tplink,archer-c5-v1|\
        tplink,archer-c7-v2)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1)
-               ;;
-       tplink,archer-a7-v5|\
-       tplink,archer-c7-v4|\
-       tplink,archer-c7-v5)
-               ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1)
                ;;
         tplink,archer-d50-v1)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2)
                 ;;
        tplink,re350k-v1)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +2)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x10008) +2)
+               ;;
+       tplink,re450-v2)
+               ath10kcal_extract "art" 20480 2116
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 8) +1)
                ;;
        ubnt,unifiac-lite|\
        ubnt,unifiac-mesh|\