treewide: remove "+" sign for increment with macaddr_add
[openwrt/staging/chunkeey.git] / target / linux / ipq806x / base-files / etc / hotplug.d / firmware / 11-ath10k-caldata
1 #!/bin/sh
2
3 [ -e /lib/firmware/$FIRMWARE ] && exit 0
4
5 . /lib/functions/caldata.sh
6
7 board=$(board_name)
8
9 case "$FIRMWARE" in
10 "ath10k/pre-cal-pci-0000:01:00.0.bin")
11 case $board in
12 askey,rt4230w-rev6 |\
13 asrock,g10)
14 if [ -b "$(find_mtd_part 0:art)" ]; then
15 caldata_extract "0:art" 0x1000 0x2f20
16 else
17 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
18 caldata_extract "0:ART" 0x1000 0x2f20
19 fi
20 ;;
21 buffalo,wxr-2533dhp)
22 caldata_extract "ART" 0x1000 0x2f20
23 ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e)
24 ;;
25 edgecore,ecw5410)
26 if [ -b "$(find_mtd_part 0:art)" ]; then
27 caldata_extract "0:art" 0x1000 0x2f20
28 else
29 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
30 caldata_extract "0:ART" 0x1000 0x2f20
31 fi
32 ;;
33 linksys,ea7500-v1 |\
34 linksys,ea8500)
35 caldata_extract "art" 0x1000 0x2f20
36 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1)
37 ;;
38 nec,wg2600hp |\
39 nec,wg2600hp3)
40 caldata_extract "ART" 0x1000 0x2f20
41 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12)
42 ;;
43 netgear,d7800 |\
44 netgear,r7500v2 |\
45 netgear,r7800)
46 caldata_extract "art" 0x1000 0x2f20
47 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 1)
48 ;;
49 tplink,ad7200 |\
50 tplink,c2600)
51 caldata_extract "radio" 0x1000 0x2f20
52 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1)
53 ;;
54 tplink,vr2600v)
55 caldata_extract "ART" 0x1000 0x2f20
56 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1)
57 ;;
58 zyxel,nbg6817)
59 if [ -b "$(find_mtd_part 0:art)" ]; then
60 caldata_extract "0:art" 0x1000 0x2f20
61 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1)
62 else
63 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
64 caldata_extract "0:ART" 0x1000 0x2f20
65 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1)
66 fi
67 ;;
68 esac
69 ;;
70 "ath10k/pre-cal-pci-0001:01:00.0.bin")
71 case $board in
72 askey,rt4230w-rev6 |\
73 asrock,g10)
74 if [ -b "$(find_mtd_part 0:art)" ]; then
75 caldata_extract "0:art" 0x5000 0x2f20
76 else
77 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
78 caldata_extract "0:ART" 0x5000 0x2f20
79 fi
80 ;;
81 buffalo,wxr-2533dhp)
82 caldata_extract "ART" 0x5000 0x2f20
83 ath10k_patch_mac $(mtd_get_mac_binary ART 0x18)
84 ;;
85 linksys,ea7500-v1 |\
86 linksys,ea8500)
87 caldata_extract "art" 0x5000 0x2f20
88 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2)
89 ;;
90 nec,wg2600hp |\
91 nec,wg2600hp3)
92 caldata_extract "ART" 0x5000 0x2f20
93 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc)
94 ;;
95 netgear,d7800 |\
96 netgear,r7500v2 |\
97 netgear,r7800)
98 caldata_extract "art" 0x5000 0x2f20
99 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 2)
100 ;;
101 tplink,ad7200 |\
102 tplink,c2600)
103 caldata_extract "radio" 0x5000 0x2f20
104 ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x8)
105 ;;
106 tplink,vr2600v)
107 caldata_extract "ART" 0x5000 0x2f20
108 ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x0)
109 ;;
110 zyxel,nbg6817)
111 if [ -b "$(find_mtd_part 0:art)" ]; then
112 caldata_extract "0:art" 0x5000 0x2f20
113 ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr)
114 else
115 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
116 caldata_extract "0:ART" 0x5000 0x2f20
117 ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
118 fi
119 ;;
120 esac
121 ;;
122 "ath10k/pre-cal-pci-0002:01:00.0.bin")
123 case $board in
124 edgecore,ecw5410)
125 if [ -b "$(find_mtd_part 0:art)" ]; then
126 caldata_extract "0:art" 0x5000 0x2f20
127 else
128 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
129 caldata_extract "0:ART" 0x5000 0x2f20
130 fi
131 ;;
132 esac
133 ;;
134 *)
135 exit 1
136 ;;
137 esac