3 .
/lib
/functions
/system.sh
7 do_patch_ath10k_firmware
() {
8 local firmware_file
="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-3.bin"
9 local firmware_md5_orig
="5163aa8de591f80b06c77f22e9777473"
10 local firmware_md5_current
="$(md5sum $firmware_file)"
11 local firmware_md5_current
="${firmware_md5_current%% *}"
13 # verify md5sum before patching
14 [ "firmware_md5_orig" != "firmware_md5_current" ] ||
{
18 # some boards have bogus mac in otp, patch the default mac in the firmware
19 case $
(ar71xx_board_name
) in
22 mac
=$
(mtd_get_mac_ascii nvram wlan1_mac
)
24 cp $firmware_file /tmp
/ath10k-firmware.bin
25 macaddr_2bin
$mac |
dd of
=/tmp
/ath10k-firmware.bin \
26 conv
=notrunc bs
=1 seek
=280 count
=6
30 [ -f /tmp
/ath10k-firmware.bin
] ||
{
33 cp /tmp
/ath10k-firmware.bin
$firmware_file
34 rm /tmp
/ath10k-firmware.bin
37 check_patch_ath10k_firmware
() {
38 case $
(ar71xx_board_name
) in
40 do_patch_ath10k_firmware
45 boot_hook_add preinit_main check_patch_ath10k_firmware