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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"ath9k-eeprom-ahb-18100000.wmac.bin")
case $board in
8dev,carambola3|\
8dev,lima)
caldata_extract "art" 0x1000 0x800
;;
aruba,ap-115)
caldata_extract "oemdata" 0x1000 0x440
;;
asus,pl-ac56|\
asus,rp-ac51|\
asus,rp-ac66)
caldata_extract "art" 0x1000 0x440
;;
avm,fritz1750e|\
avm,fritz4020|\
avm,fritz450e|\
avm,fritzdvbc)
caldata_extract_reverse "urlader" 0x1541 0x440
;;
dlink,dir-505)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
;;
dlink,dir-842-c1|\
dlink,dir-842-c2|\
dlink,dir-842-c3|\
nec,wf1200cr|\
nec,wg1200cr|\
wd,mynet-n600|\
wd,mynet-n750)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
engenius,ecb1200|\
engenius,ecb1750)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
;;
enterasys,ws-ap3705i)
caldata_extract "calibrate" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1)
;;
extreme-networks,ws-ap3805i)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1)
;;
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
iodata,wn-ag300dgr|\
sitecom,wlr-7100|\
sitecom,wlr-8100)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
;;
moxa,awk-1137c)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
;;
nec,wg800hp)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
;;
qihoo,c301)
caldata_extract "radiocfg" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
;;
tplink,deco-s4-v2)
caldata_extract "art" 0x1000 0x440
base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
ath9k_patch_mac $(macaddr_add $base_mac 1)
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:00.0.bin")
case $board in
aruba,ap-115)
caldata_extract "oemdata" 0x5000 0x440
;;
avm,fritz300e)
caldata_extract_reverse "urloader" 0x1541 0x440
;;
buffalo,wzr-hp-g450h|\
pcs,cap324)
caldata_extract "art" 0x1000 0x440
;;
dlink,dir-825-c1|\
dlink,dir-835-a1)
caldata_extract "art" 0x5000 0x440
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1)
;;
enterasys,ws-ap3705i)
caldata_extract "calibrate" 0x5000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0)
;;
meraki,mr12)
caldata_extract "art" 0x11000 0xeb8
;;
netgear,wnr2200-8m|\
netgear,wnr2200-16m|\
tplink,tl-wr842n-v1)
caldata_extract "art" 0x1000 0x3e0
;;
ubnt,powerbridge-m|\
ubnt,rocket-m)
caldata_extract "art" 0x1000 0x1000
;;
wd,mynet-n600|\
wd,mynet-n750)
caldata_extract "art" 0x5000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
;;
wd,mynet-wifi-rangeextender)
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(nvram get wl0_hwaddr)
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:11.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x1000 0xeb8
;;
trendnet,tew-673gru)
caldata_extract "caldata" 0x1000 0xeb8
ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c
;;
meraki,mr16)
caldata_extract "art" 0x11000 0xeb8
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
"ath9k-eeprom-pci-0000:00:12.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x5000 0xeb8
;;
trendnet,tew-673gru)
caldata_extract "caldata" 0x5000 0xeb8
ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c
;;
meraki,mr16)
caldata_extract "art" 0x15000 0xeb8
;;
*)
caldata_die "board $board is not supported yet"
;;
esac
;;
esac
|