hook new way
authorThibaut VARÈNE <hacks@slashdirt.org>
Tue, 18 Aug 2020 16:08:17 +0000 (18:08 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Fri, 18 Sep 2020 23:33:06 +0000 (01:33 +0200)
target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata

index 74aea555fdbd9196ef11cad06a2a6e36b03b11a4..601e236e12b512536ffe2c755df7f3aa4cd9e14b 100644 (file)
@@ -130,7 +130,9 @@ case "$FIRMWARE" in
                ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +2)
                ;;
        mikrotik,hap-ac2)
-               caldata_sysfsload_from_file "/sys/firmware/mikrotik/hard_config/wlan_data" 0x0 0x2f20
+               wdata="/sys/firmware/mikrotik/hard_config/wlan_data"
+               ( [ -f "$wdata" ] && caldata_sysfsload_from_file "$wdata" 0x0 0x2f20 ) || \
+                       ( [ -d "$wdata" ] && caldata_sysfsload_from_file "$wdata/data_0" 0x0 0x2f20 )
                ;;
        netgear,ex6100v2 |\
        netgear,ex6150v2)
@@ -228,7 +230,9 @@ case "$FIRMWARE" in
                ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +3)
                ;;
        mikrotik,hap-ac2)
-               caldata_sysfsload_from_file "/sys/firmware/mikrotik/hard_config/wlan_data" 0x8000 0x2f20
+               wdata="/sys/firmware/mikrotik/hard_config/wlan_data"
+               ( [ -f "$wdata" ] && caldata_sysfsload_from_file "$wdata" 0x8000 0x2f20 ) || \
+                       ( [ -d "$wdata" ] && caldata_sysfsload_from_file "$wdata/data_2" 0x0 0x2f20 )
                ;;
        netgear,ex6100v2 |\
        netgear,ex6150v2)