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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"ath11k/IPQ8074/hw2.0/cal-ahb-c000000.wifi.bin")
case "$board" in
arcadyan,aw1000|\
buffalo,wxr-5950ax12|\
cmcc,rm2-6|\
compex,wpq873|\
dynalink,dl-wrx36|\
edgecore,eap102|\
edimax,cax1800|\
linksys,mx5300|\
netgear,wax218|\
qnap,301w|\
redmi,ax6|\
xiaomi,ax3600|\
xiaomi,ax9000|\
yuncore,ax880|\
zte,mf269)
caldata_extract "0:art" 0x1000 0x20000
;;
linksys,mx4200v1|\
linksys,mx8500)
caldata_extract "0:art" 0x1000 0x20000
ath11k_remove_regdomain
;;
linksys,mx4200v2)
caldata_extract "0:art" 0x1000 0x20000
label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
ath11k_patch_mac $(macaddr_add $label_mac 2) 0
ath11k_patch_mac $(macaddr_add $label_mac 1) 1
ath11k_patch_mac $(macaddr_add $label_mac 3) 2
ath11k_remove_regdomain
ath11k_set_macflag
;;
netgear,rax120v2)
caldata_extract "0:art" 0x1000 0x20000
ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0xc) 0
ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0x0) 1
ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0x6) 2
ath11k_set_macflag
;;
netgear,sxr80|\
netgear,sxs80)
caldata_extract "0:art" 0x1000 0x20000
label_mac=$(get_mac_label)
ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0x0c) 0
#boarddata1 doesn't have a MAC for the 2G interface
ath11k_patch_mac $(macaddr_setbit_la $label_mac) 1
ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0x12) 2
ath11k_set_macflag
;;
netgear,wax620)
caldata_extract "0:art" 0x1000 0x20000
label_mac=$(get_mac_label)
ath11k_patch_mac $(macaddr_add $label_mac -31) 1
ath11k_patch_mac $(macaddr_add $label_mac 1) 0
ath11k_set_macflag
;;
netgear,wax630)
caldata_extract "0:art" 0x1000 0x20000
label_mac=$(get_mac_label)
ath11k_patch_mac $(macaddr_add $label_mac -31) 1
ath11k_patch_mac $(macaddr_add $label_mac 1) 0
ath11k_patch_mac $(macaddr_add $label_mac 33) 2
ath11k_set_macflag
;;
prpl,haze|\
spectrum,sax1v1k)
caldata_extract_mmc "0:ART" 0x1000 0x20000
;;
zbtlink,zbt-z800ax)
caldata_extract "0:art" 0x1000 0x20000
label_mac=$(get_mac_label)
ath11k_patch_mac $(macaddr_add $label_mac -1) 0
ath11k_patch_mac $(macaddr_add $label_mac -2) 1
ath11k_set_macflag
;;
zyxel,nbg7815)
caldata_extract "0:art" 0x1000 0x20000
label_mac=$(get_mac_label)
ath11k_patch_mac $(macaddr_add $label_mac 3) 0
ath11k_patch_mac $(macaddr_add $label_mac 2) 1
ath11k_patch_mac $(macaddr_add $label_mac 4) 2
ath11k_set_macflag
;;
esac
;;
"ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin"|\
"ath11k/QCN9074/hw1.0/cal-pci-0001:01:00.0.bin")
case "$board" in
linksys,mx8500)
caldata_extract "0:art" 0x26800 0x20000
ath11k_remove_regdomain
;;
prpl,haze)
caldata_extract_mmc "0:ART" 0x26800 0x20000
;;
xiaomi,ax9000)
caldata_extract "0:art" 0x26800 0x20000
;;
esac
;;
*)
exit 1
;;
esac
|