ath79: add support for Senao Watchguard AP100
[openwrt/staging/aparcar.git] / target / linux / ath79 / generic / base-files / etc / hotplug.d / firmware / 10-ath9k-eeprom
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 "ath9k-eeprom-ahb-18100000.wmac.bin")
11 case $board in
12 8dev,lima)
13 caldata_extract "art" 0x1000 0x800
14 ;;
15 asus,pl-ac56|\
16 asus,rp-ac51|\
17 asus,rp-ac66)
18 caldata_extract "art" 0x1000 0x440
19 ;;
20 avm,fritz1750e|\
21 avm,fritz4020|\
22 avm,fritz450e|\
23 avm,fritzdvbc)
24 caldata_extract_reverse "urlader" 0x1541 0x440
25 ;;
26 dlink,dir-505|\
27 dlink,dir-825-c1|\
28 dlink,dir-835-a1)
29 caldata_extract "art" 0x1000 0x440
30 ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
31 ;;
32 dlink,dir-842-c1|\
33 dlink,dir-842-c2|\
34 dlink,dir-842-c3|\
35 dlink,dir-859-a1|\
36 nec,wf1200cr|\
37 nec,wg1200cr|\
38 wd,mynet-n600|\
39 wd,mynet-n750)
40 caldata_extract "art" 0x1000 0x440
41 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
42 ;;
43 engenius,ecb1200|\
44 engenius,ecb1750)
45 caldata_extract "art" 0x1000 0x440
46 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
47 ;;
48 engenius,epg5000|\
49 iodata,wn-ac1167dgr|\
50 iodata,wn-ac1600dgr|\
51 iodata,wn-ac1600dgr2|\
52 iodata,wn-ag300dgr|\
53 sitecom,wlr-7100|\
54 sitecom,wlr-8100)
55 caldata_extract "art" 0x1000 0x440
56 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
57 ;;
58 enterasys,ws-ap3705i)
59 caldata_extract "calibrate" 0x1000 0x440
60 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1)
61 ;;
62 extreme-networks,ws-ap3805i)
63 caldata_extract "art" 0x1000 0x440
64 ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1)
65 ;;
66 nec,wg800hp)
67 caldata_extract "art" 0x1000 0x440
68 ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
69 ;;
70 qihoo,c301)
71 caldata_extract "radiocfg" 0x1000 0x440
72 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
73 ;;
74 *)
75 caldata_die "board $board is not supported yet"
76 ;;
77 esac
78 ;;
79 "ath9k-eeprom-pci-0000:00:00.0.bin")
80 case $board in
81 araknis,an-300-ap-i-n|\
82 atheros,db120|\
83 engenius,eap600|\
84 engenius,ecb600|\
85 mercury,mw4530r-v1|\
86 ocedo,raccoon|\
87 tplink,tl-wdr3500-v1|\
88 tplink,tl-wdr3600-v1|\
89 tplink,tl-wdr4300-v1|\
90 tplink,tl-wdr4300-v1-il|\
91 tplink,tl-wdr4310-v1|\
92 tplink,tl-wdr4900-v2|\
93 ubnt,unifi-ap-pro|\
94 watchguard,ap100|\
95 watchguard,ap200|\
96 winchannel,wb2000)
97 caldata_extract "art" 0x5000 0x440
98 ;;
99 avm,fritz300e)
100 caldata_extract_reverse "urloader" 0x1541 0x440
101 ;;
102 buffalo,wzr-hp-g302h-a1a0|\
103 ubnt,unifi-ap-outdoor-plus)
104 caldata_extract "art" 0x1000 0xeb8
105 ;;
106 buffalo,wzr-hp-g450h|\
107 ubnt,unifi)
108 caldata_extract "art" 0x1000 0x440
109 ;;
110 dlink,dir-825-c1|\
111 dlink,dir-835-a1)
112 caldata_extract "art" 0x5000 0x440
113 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1)
114 ;;
115 enterasys,ws-ap3705i)
116 caldata_extract "calibrate" 0x5000 0x440
117 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0)
118 ;;
119 meraki,mr12)
120 caldata_extract "art" 0x11000 0xeb8
121 ;;
122 netgear,wnr2200-8m|\
123 netgear,wnr2200-16m|\
124 pcs,cap324|\
125 tplink,tl-wr2543-v1|\
126 tplink,tl-wr842n-v1)
127 caldata_extract "art" 0x1000 0x1000
128 ;;
129 openmesh,mr600-v1|\
130 openmesh,mr600-v2|\
131 openmesh,om5p-an)
132 caldata_extract "ART" 0x5000 0x440
133 ;;
134 openmesh,om2p-v1)
135 caldata_extract "ART" 0x1000 0x440
136 ;;
137 wd,mynet-n600|\
138 wd,mynet-n750)
139 caldata_extract "art" 0x5000 0x440
140 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
141 ;;
142 wd,mynet-wifi-rangeextender)
143 caldata_extract "art" 0x1000 0x1000
144 ath9k_patch_mac $(nvram get wl0_hwaddr)
145 ;;
146 *)
147 caldata_die "board $board is not supported yet"
148 ;;
149 esac
150 ;;
151 "ath9k-eeprom-pci-0000:00:11.0.bin")
152 case $board in
153 buffalo,wzr-600dhp|\
154 buffalo,wzr-hp-ag300h|\
155 netgear,wndap360)
156 caldata_extract "art" 0x1000 0xeb8
157 ;;
158 dlink,dir-825-b1)
159 caldata_extract "caldata" 0x1000 0xeb8
160 ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c
161 ;;
162 meraki,mr16)
163 caldata_extract "art" 0x11000 0xeb8
164 ;;
165 *)
166 caldata_die "board $board is not supported yet"
167 ;;
168 esac
169 ;;
170 "ath9k-eeprom-pci-0000:00:12.0.bin")
171 case $board in
172 buffalo,wzr-600dhp|\
173 buffalo,wzr-hp-ag300h|\
174 netgear,wndap360)
175 caldata_extract "art" 0x5000 0xeb8
176 ;;
177 dlink,dir-825-b1)
178 caldata_extract "caldata" 0x5000 0xeb8
179 ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c
180 ;;
181 meraki,mr16)
182 caldata_extract "art" 0x15000 0xeb8
183 ;;
184 *)
185 caldata_die "board $board is not supported yet"
186 ;;
187 esac
188 ;;
189 esac