blob: 719082084bb398982bf651cbc5758896937c63c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#!/bin/sh
. /lib/functions/system.sh
. /lib/ar71xx.sh
do_load_ath10k_board_bin() {
# load board.bin
case $(ar71xx_board_name) in
nbg6716)
dd if=/dev/mtdblock2 \
bs=1 skip=20480 count=2116 \
of=/tmp/ath10k-board.bin
;;
archer-c5 | \
archer-c7)
local mac
mac=$(macaddr_add $(cat /sys/class/net/eth1/address) -2)
dd if=/dev/mtdblock4 \
bs=1 skip=20480 count=6 \
of=/tmp/ath10k-board.bin
macaddr_2bin $mac >> /tmp/ath10k-board.bin
dd if=/dev/mtdblock4 \
bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
;;
r6100)
local mac
mac=$(macaddr_add $(cat /sys/class/net/eth1/address) +2)
dd if=/dev/mtdblock2 \
bs=1 skip=20480 count=6 \
of=/tmp/ath10k-board.bin
macaddr_2bin $mac >> /tmp/ath10k-board.bin
dd if=/dev/mtdblock2 \
bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
;;
qihoo-c301)
local mac
mac=$(mtd_get_mac_ascii devdata wlan5mac)
if [ -z "$mac" ]; then
mac=$(macaddr_add $(cat /sys/class/net/eth0/address) -2)
fi
dd if=/dev/mtdblock10 \
bs=1 skip=20480 count=6 \
of=/tmp/ath10k-board.bin
macaddr_2bin $mac >> /tmp/ath10k-board.bin
dd if=/dev/mtdblock10 \
bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin
;;
esac
[ -f /tmp/ath10k-board.bin ] || {
return
}
cmp -s /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin || {
cp /tmp/ath10k-board.bin /lib/firmware/ath10k/QCA988X/hw2.0/board.bin
rm /tmp/ath10k-board.bin
}
}
boot_hook_add preinit_main do_load_ath10k_board_bin
|