3 .
/lib
/functions
/system.sh
7 do_patch_ath10k_firmware
() {
8 local firmware_file
="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin"
10 # bail out if firmware does not exist
11 [ -f "$firmware_file" ] ||
{
15 local firmware_md5_orig
="fcb2fbd42d73a63fbf603505c718cbde"
16 local firmware_md5_current
="$(md5sum $firmware_file)"
17 local firmware_md5_current
="${firmware_md5_current%% *}"
19 # verify md5sum before patching
20 [ "$firmware_md5_orig" != "$firmware_md5_current" ] ||
{
24 # some boards have bogus mac in otp, patch the default mac in the firmware
25 case $
(ar71xx_board_name
) in
26 dgl-5500-a1 | tew-823dru
)
28 mac
=$
(mtd_get_mac_ascii nvram wlan1_mac
)
30 cp $firmware_file /tmp
/ath10k-firmware.bin
31 macaddr_2bin
$mac |
dd of
=/tmp
/ath10k-firmware.bin \
32 conv
=notrunc bs
=1 seek
=276 count
=6
36 [ -f /tmp
/ath10k-firmware.bin
] ||
{
39 cp /tmp
/ath10k-firmware.bin
$firmware_file
40 rm /tmp
/ath10k-firmware.bin
43 check_patch_ath10k_firmware
() {
44 case $
(ar71xx_board_name
) in
45 dgl-5500-a1 | tew-823dru
)
46 do_patch_ath10k_firmware
51 boot_hook_add preinit_main check_patch_ath10k_firmware