8 ath10kcal_from_file
() {
13 dd if=$source of
=/lib
/firmware
/$FIRMWARE bs
=1 skip
=$offset count
=$count 2>/dev
/null || \
14 ath10kcal_die
"failed to extract calibration data from $source"
23 mtd
=$
(find_mtd_chardev
$part)
25 ath10kcal_die
"no mtd device found for partition $part"
27 dd if=$mtd of
=/lib
/firmware
/$FIRMWARE bs
=1 skip
=$offset count
=$count 2>/dev
/null || \
28 ath10kcal_die
"failed to extract calibration data from $mtd"
31 ath10kcal_patch_mac
() {
34 [ -z "$mac" ] && return
36 macaddr_2bin
$mac |
dd of
=/lib
/firmware
/$FIRMWARE conv
=notrunc bs
=1 seek
=6 count
=6
39 [ -e /lib
/firmware
/$FIRMWARE ] && exit 0
42 .
/lib
/functions
/system.sh
47 "ath10k/cal-pci-0000:00:00.0.bin")
54 ath10kcal_extract
"ART" 20480 2116
55 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
0/address
) +16)
61 ath10kcal_extract
"art" 20480 2116
62 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
1/address
) -2)
70 ath10kcal_extract
"art" 20480 2116
73 ath10kcal_extract
"radiocfg" 20480 2116
74 ath10kcal_patch_mac $
(mtd_get_mac_ascii bdcfg wlanmac_a
)
78 ath10kcal_extract
"radiocfg" 20480 2116
79 ath10kcal_patch_mac $
(mtd_get_mac_ascii devdata wlan5mac
)
82 ath10kcal_extract
"art" 20480 2116
83 ath10kcal_patch_mac $
(mtd_get_mac_binary art
18)
87 ath10kcal_extract
"caldata" 20480 2116
88 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
0/address
) +1)
91 ath10kcal_extract
"art" 20480 2116
92 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
1/address
) -1)
95 ath10kcal_extract
"caldata" 20480 2116
96 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
1/address
) +2)
99 ath10kcal_from_file
"/sys/firmware/routerboot/ext_wlan_data" 20480 2116
103 ath10kcal_extract
"art" 20480 2116
104 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
0/address
) -2)
107 ath10kcal_extract
"art" 20480 2116
108 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
0/address
) +1)
112 ath10kcal_extract
"EEPROM" 20480 2116
115 ath10kcal_extract
"ART" 20480 2116
119 "ath10k/cal-pci-0000:01:00.0.bin")
123 ath10kcal_extract
"art" 20480 2116
124 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
1/address
) -2)
128 ath10kcal_extract
"RFdata" 20480 2116
129 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
1/address
) -2)
132 ath10kcal_extract
"ART" 20480 2116
133 ath10kcal_patch_mac $
(macaddr_add $
(cat /sys
/class
/net
/eth
0/address
) +16)
136 rb-962uigs-5hact2hnt
)
137 ath10kcal_from_file
"/sys/firmware/routerboot/ext_wlan_data" 20480 2116
141 "ath10k/pre-cal-pci-0000:00:00.0.bin")
144 ath10kcal_extract
"art" 20480 12064