3 .
/lib
/functions
/system.sh
4 .
/lib
/functions
/uci-defaults.sh
5 .
/lib
/functions
/k2t.sh
7 ath79_setup_interfaces
()
23 glinet
,gl-ar300m-lite|\
24 mikrotik
,routerboard-wap-g-5hact2hnd|\
43 tplink
,tl-wr902ac-v1|\
47 ubnt
,litebeam-ac-gen2|\
49 ubnt
,nanostation-ac-loco|\
50 ubnt
,nanostation-loco-m|\
51 ubnt
,nanostation-loco-m-xw|\
58 wd
,mynet-wifi-rangeextender|\
60 ucidef_set_interface_lan
"eth0"
64 tplink
,archer-c58-v1|\
65 tplink
,archer-c59-v1|\
67 ucidef_set_interface_wan
"eth1"
68 ucidef_add_switch
"switch0" \
69 "0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
73 ucidef_add_switch
"switch0" \
74 "0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
78 ucidef_add_switch
"switch0" \
79 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0"
81 buffalo
,wzr-hp-ag300h|\
82 tplink
,archer-c25-v1|\
83 tplink
,tl-wdr3500-v1|\
87 ucidef_set_interface_wan
"eth1"
88 ucidef_add_switch
"switch0" \
89 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
91 buffalo
,wzr-hp-g302h-a1a0
)
92 ucidef_add_switch
"switch0" \
93 "0@eth0" "1:lan:1" "3:lan:4" "4:lan:3" "5:lan:2" "2:wan"
107 ucidef_set_interfaces_lan_wan
"eth1" "eth0"
110 tplink
,archer-c60-v1|\
111 tplink
,archer-c60-v2
)
112 ucidef_set_interface_wan
"eth1"
113 ucidef_add_switch
"switch0" \
114 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
116 comfast
,cf-wr650ac-v1|\
117 comfast
,cf-wr650ac-v2
)
118 ucidef_add_switch
"switch0" \
119 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
124 ucidef_set_interface_lan
"eth0 eth1"
127 ucidef_set_interface_wan
"eth1"
128 ucidef_add_switch
"switch0" \
129 "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
138 tplink
,archer-c2-v3|\
139 tplink
,tl-wr1043nd-v4|\
140 tplink
,tl-wr1043n-v5
)
141 ucidef_add_switch
"switch0" \
142 "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
144 elecom
,wrc-1750ghbk2-i|\
145 elecom
,wrc-300ghbk2-i
)
146 ucidef_add_switch
"switch0" \
147 "0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan"
149 embeddedwireless
,dorin
)
150 ucidef_add_switch
"switch0" \
151 "0@eth0" "1:wan" "2:lan:3" "3:lan:2"
154 ucidef_set_interface_lan
"eth0 eth1" "dhcp"
157 ucidef_set_interface_lan
"eth0" "dhcp"
160 ucidef_set_interface_wan
"eth1"
161 ucidef_add_switch
"switch0" \
162 "0@eth0" "1:lan" "2:lan"
165 iodata
,wn-ac1167dgr|\
166 iodata
,wn-ac1600dgr|\
167 iodata
,wn-ac1600dgr2|\
172 ucidef_add_switch
"switch0" \
173 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
175 librerouter
,librerouter-v1
)
176 ucidef_add_switch
"switch0" \
177 "0@eth0" "5:wan" "6@eth1" "4:lan"
180 ubnt
,nanostation-ac|\
181 ubnt
,unifiac-mesh-pro|\
185 ucidef_add_switch
"switch0" \
186 "0@eth0" "2:lan" "3:wan"
189 ucidef_add_switch
"switch0" \
190 "0@eth0" "2:lan" "3:lan" "4:lan" "1:wan"
193 netgear
,wndr3700-v2|\
196 ucidef_set_interface_wan
"eth1"
197 ucidef_add_switch
"switch0" \
198 "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
199 ucidef_add_switch_attr
"switch0" "blinkrate" 2
200 ucidef_add_switch_port_attr
"switch0" 1 led
6
201 ucidef_add_switch_port_attr
"switch0" 2 led
9
202 ucidef_add_switch_port_attr
"switch0" 5 led
2
206 ucidef_set_interface_wan
"eth0"
207 ucidef_add_switch
"switch0" \
208 "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
211 ucidef_add_switch
"switch0" \
212 "0@eth0" "3:lan:1" "5:lan:2" "4:wan"
215 ucidef_set_interface_wan
"eth1"
216 ucidef_add_switch
"switch0" \
217 "0@eth0" "2:lan" "3:lan"
220 ucidef_add_switch
"switch0" \
221 "0@eth0" "1:lan" "2:lan" "3:wan"
224 ucidef_set_interface_wan
"eth1"
225 ucidef_add_switch
"switch0" \
226 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
228 tplink
,archer-a7-v5|\
229 tplink
,archer-c6-v2|\
230 tplink
,archer-c6-v2-us|\
231 tplink
,archer-c7-v4|\
232 tplink
,archer-c7-v5|\
233 tplink
,tl-wdr3600-v1|\
234 tplink
,tl-wdr4300-v1|\
235 tplink
,tl-wdr4300-v1-il
)
236 ucidef_add_switch
"switch0" \
237 "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
239 tplink
,archer-c5-v1|\
240 tplink
,archer-c7-v1|\
241 tplink
,archer-c7-v2|\
242 tplink
,tl-wdr4900-v2
)
243 ucidef_add_switch
"switch0" \
244 "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
246 tplink
,archer-d50-v1
)
247 ucidef_add_switch
"switch0" \
248 "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "1:wan"
251 ucidef_set_interfaces_lan_wan
"eth0.1 eth1" "usb0"
252 ucidef_add_switch
"switch0" \
253 "0@eth0" "1:lan:1" "2:lan:3" "3:lan:2"
256 ucidef_set_interface_wan
"eth1"
257 ucidef_add_switch
"switch0" \
258 "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
260 tplink
,tl-wr1043nd-v1
)
261 ucidef_add_switch
"switch0" \
262 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
264 tplink
,tl-wr1043nd-v2|\
265 tplink
,tl-wr1043nd-v3|\
266 tplink
,tl-wr1045nd-v2
)
267 ucidef_add_switch
"switch0" \
268 "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
271 ucidef_add_switch
"switch0" \
272 "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
275 ucidef_set_interface_wan
"eth1"
276 ucidef_add_switch
"switch0" \
277 "0@eth0" "2:lan:1" "3:lan:3" "4:lan:2"
280 ucidef_set_interface_wan
"eth1"
281 ucidef_add_switch
"switch0" \
282 "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan"
285 ucidef_set_interface_wan
"eth1"
286 ucidef_add_switch
"switch0" \
287 "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:lan:5" "5:lan:6" "6:lan:7" "7:lan:8" "8@eth0"
289 ubnt
,routerstation-pro
)
290 ucidef_set_interface_wan
"eth0"
291 ucidef_add_switch
"switch0" \
292 "0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
294 ubnt
,nanostation-m-xw
)
295 ucidef_add_switch
"switch0" \
296 "0@eth0" "5:lan" "1:wan"
300 ucidef_set_interface_wan
"eth1"
301 ucidef_add_switch
"switch0" \
302 "0@eth0" "3:lan:1" "4:lan:2"
305 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
317 lan_mac
=$
(mtd_get_mac_binary
"Board data" 2)
321 label_mac
=$
(mtd_get_mac_binary art
0x1002)
324 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
325 label_mac
=$
(fritz_tffs
-n macwlan
-i $
(find_mtd_part
"tffs (1)"))
328 lan_mac
=$
(fritz_tffs
-n maca
-i $
(find_mtd_part
"tffs (1)"))
329 wan_mac
=$
(fritz_tffs
-n macb
-i $
(find_mtd_part
"tffs (1)"))
332 lan_mac
=$
(mtd_get_mac_text
"caldata" 0xffa0)
333 wan_mac
=$
(mtd_get_mac_text
"caldata" 0xffb4)
336 lan_mac
=$
(mtd_get_mac_text
"mac" 0x4)
340 lan_mac
=$
(mtd_get_mac_text
"mac" 0x4)
341 wan_mac
=$
(mtd_get_mac_text
"mac" 0x18)
347 lan_mac
=$
(mtd_get_mac_ascii devdata
"lanmac")
348 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
354 lan_mac
=$
(mtd_get_mac_ascii devdata
"lanmac")
355 wan_mac
=$
(mtd_get_mac_ascii devdata
"wanmac")
357 elecom
,wrc-1750ghbk2-i|\
358 elecom
,wrc-300ghbk2-i
)
359 wan_mac
=$
(macaddr_add
"$(mtd_get_mac_binary art 0x1002)" -2)
362 lan_mac
=$
(mtd_get_mac_ascii u-boot-env ethaddr
)
363 label_mac
=$
(mtd_get_mac_ascii u-boot-env athaddr
)
366 lan_mac
=$
(mtd_get_mac_ascii u-boot-env ethaddr
)
367 wan_mac
=$
(mtd_get_mac_ascii u-boot-env wanaddr
)
370 lan_mac
=$
(mtd_get_mac_text
"u-boot-env" 0xe9)
371 eth1_mac
=$
(macaddr_add
"$lan_mac" 1)
372 ucidef_set_interface
"eth0" ifname
"eth0" protocol
"none" macaddr
"$lan_mac"
373 ucidef_set_interface
"eth1" ifname
"eth1" protocol
"none" macaddr
"$eth1_mac"
376 lan_mac
=$
(mtd_get_mac_ascii u-boot-env ethaddr
)
377 wan_mac
=$
(macaddr_add
"$lan_mac" -1)
380 iodata
,wn-ac1167dgr|\
381 iodata
,wn-ac1600dgr|\
382 iodata
,wn-ac1600dgr2|\
384 lan_mac
=$
(mtd_get_mac_ascii u-boot-env ethaddr
)
385 wan_mac
=$
(mtd_get_mac_ascii u-boot-env wanaddr
)
389 wan_mac
=$
(fconfig
-s -r -d $
(find_mtd_part
"RedBoot config") -n alias
/ethaddr
)
390 lan_mac
=$
(macaddr_add
"$wan_mac" 1)
393 lan_mac
=$
(mtd_get_mac_text board_data
0x280)
394 wan_mac
=$
(mtd_get_mac_text board_data
0x480)
398 netgear
,wndr3700-v2|\
400 lan_mac
=$
(macaddr_setbit_la
"$(mtd_get_mac_binary art 0x0)")
403 lan_mac
=$
(k2t_get_mac
"lan_mac")
404 wan_mac
=$
(k2t_get_mac
"wan_mac")
407 wan_mac
=$
(mtd_get_mac_binary factory
0x0)
408 lan_mac
=$
(macaddr_setbit_la
"$wan_mac")
411 lan_mac
=$
(mtd_get_mac_ascii u-boot-env ethaddr
)
412 wan_mac
=$
(mtd_get_mac_ascii u-boot-env wanaddr
)
415 tplink
,archer-a7-v5|\
416 tplink
,archer-c7-v4|\
417 tplink
,archer-c7-v5|\
418 tplink
,tl-wr1043nd-v4|\
419 tplink
,tl-wr1043n-v5
)
420 base_mac
=$
(mtd_get_mac_binary info
0x8)
421 wan_mac
=$
(macaddr_add
"$base_mac" 1)
423 tplink
,tl-wdr3600-v1|\
424 tplink
,tl-wdr4300-v1|\
425 tplink
,tl-wdr4300-v1-il
)
426 base_mac
=$
(mtd_get_mac_binary u-boot
0x1fc00)
427 wan_mac
=$
(macaddr_add
"$base_mac" 1)
430 lan_mac
=$
(mtd_get_mac_text mac
0x4)
431 wan_mac
=$
(mtd_get_mac_text mac
0x18)
436 ubnt
,nanostation-loco-m|\
441 label_mac
=$
(cat /sys
/class
/ieee80211
/phy
0/macaddress
)
443 ubnt
,litebeam-ac-gen2
)
444 label_mac
=$
(mtd_get_mac_binary art
0x5006)
447 ubnt
,routerstation-pro
)
448 wan_mac
=$
(fconfig
-s -r -d $
(find_mtd_part
"RedBoot config") -n ar7100_esa
)
449 lan_mac
=$
(macaddr_add
"$wan_mac" 1)
451 wd
,mynet-wifi-rangeextender
)
452 lan_mac
=$
(nvram get et0macaddr
)
456 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
457 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
458 [ -n "$label_mac" ] && ucidef_set_label_macaddr
$label_mac
463 ath79_setup_interfaces
$board
464 ath79_setup_macs
$board