ar71xx: detect ALL0315N board
[openwrt.git] / target / linux / ar71xx / base-files / etc / uci-defaults / network
1 #!/bin/sh
2 #
3 # Copyright (C) 2011 OpenWrt.org
4 #
5
6 [ -e /etc/config/network ] && exit 0
7
8 touch /etc/config/network
9
10 . /lib/functions/uci-defaults.sh
11 . /lib/ar71xx.sh
12
13 ucidef_set_interface_loopback
14
15 board=$(ar71xx_board_name)
16
17 case "$board" in
18 all0315n |\
19 all0258n |\
20 ja76pf2)
21         ucidef_set_interface_lan "eth0 eth1"
22         ;;
23
24 db120)
25         ucidef_set_interfaces_lan_wan "eth0.1 eth1" "eth0.2"
26         ucidef_add_switch "eth0" "1" "1"
27         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
28         ucidef_add_switch_vlan "eth0" "2" "0t 1"
29         ucidef_add_switch "eth1" "1" "1"
30         ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5"
31         ;;
32
33 dir-825-b1|\
34 tew-673gru)
35         ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
36         ucidef_add_switch "rtl8366s" "1" "1"
37         ucidef_add_switch_vlan "rtl8366s" "1" "0 1 2 3 5t"
38         ;;
39
40 nbg460n_550n_550nh)
41         ucidef_set_interfaces_lan_wan "eth0" "eth1"
42         ucidef_add_switch "rtl8366s" "1" "1"
43         ucidef_add_switch_vlan "rtl8366s" "0" "0 1 2 3 5"
44         ;;
45
46 rb-433 |\
47 rb-433u)
48         ucidef_set_interfaces_lan_wan "eth1" "eth0"
49         ucidef_add_switch "switch0" "1" "1"
50         ucidef_add_switch_vlan "switch0" "1" "1 2 5"
51         ;;
52
53 rb-450)
54         ucidef_set_interfaces_lan_wan "eth1" "eth0"
55         ucidef_add_switch "eth1" "1" "1"
56         ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 5"
57         ;;
58
59 rb-450g |\
60 routerstation-pro)
61         ucidef_set_interfaces_lan_wan "eth1" "eth0"
62         ucidef_add_switch "switch0" "1" "1"
63         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
64         ;;
65
66 ap136 |\
67 rb-750gl |\
68 rb-751g |\
69 wzr-hp-g450h)
70         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
71         ucidef_add_switch "switch0" "1" "1"
72         ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
73         ucidef_add_switch_vlan "switch0" "2" "0t 1"
74         ;;
75
76 rb-493g)
77         ucidef_set_interfaces_lan_wan "eth0 eth1.1" "eth1.2"
78         ucidef_add_switch "switch0" "1" "1"
79         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4"
80         ucidef_add_switch "switch1" "1" "1"
81         ucidef_add_switch_vlan "switch1" "1" "0t 1 2 3 4"
82         ucidef_add_switch_vlan "switch1" "2" "0t 5"
83         ;;
84
85 wzr-hp-g300nh2 |\
86 pb92 |\
87 ap113)
88         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
89         ucidef_add_switch "eth0" "1" "1"
90         ucidef_add_switch_vlan "eth0" "1" "0t 1 3 4 5"
91         ucidef_add_switch_vlan "eth0" "2" "0t 2"
92         ;;
93
94 tl-wdr4300|\
95 tl-wr1041n-v2)
96         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
97         ucidef_add_switch "eth0" "1" "1"
98         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
99         ucidef_add_switch_vlan "eth0" "2" "0t 1"
100         ;;
101
102 tl-wr1043nd)
103         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
104         ucidef_add_switch "rtl8366rb" "1" "1"
105         ucidef_add_switch_vlan "rtl8366rb" "1" "1 2 3 4 5t"
106         ucidef_add_switch_vlan "rtl8366rb" "2" "0 5t"
107         ;;
108
109 tl-wr2543n)
110         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
111         ucidef_add_switch "switch0" "1" "1"
112         ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
113         ucidef_add_switch_vlan "switch0" "2" "0 9t"
114         ;;
115
116 tl-wr841n-v1|\
117 tl-wr941nd)
118         ucidef_set_interface_raw "eth" "eth0"
119         ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
120         ;;
121
122 wrt160nl)
123         ucidef_set_interfaces_lan_wan "eth0" "eth1"
124         ucidef_add_switch "eth0" "1" "1"
125         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
126         ;;
127
128 wzr-hp-g300nh)
129         ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
130         ucidef_add_switch "switch0" "1" "1"
131         ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
132         ;;
133
134 all0305 |\
135 aw-nr580 |\
136 bullet-m |\
137 eap7660d |\
138 ew-dorin |\
139 rb-411 |\
140 tl-mr11u |\
141 tl-mr3020 |\
142 tl-wa901nd |\
143 tl-wa901nd-v2 |\
144 tl-wr703n |\
145 wp543)
146         ucidef_set_interface_lan "eth0"
147         ;;
148
149 alfa-ap96 |\
150 alfa-nx |\
151 ap83 |\
152 jwap003 |\
153 pb42 |\
154 pb44 |\
155 routerstation|\
156 wpe72)
157         ucidef_set_interfaces_lan_wan "eth1" "eth0"
158         ;;
159
160 ap121 |\
161 ap121-mini |\
162 ap96 |\
163 airrouter |\
164 dir-600-a1 |\
165 dir-615-c1 |\
166 dir-615-e4 |\
167 ja76pf |\
168 rb-750 |\
169 rb-751 |\
170 tew-632brp |\
171 tew-712br |\
172 tl-mr3220 |\
173 tl-mr3420 |\
174 tl-wr741nd |\
175 tl-wr741nd-v4 |\
176 tl-wr841n-v7 |\
177 whr-g301n |\
178 whr-hp-g300n |\
179 whr-hp-gn |\
180 wzr-hp-ag300h)
181         ucidef_set_interfaces_lan_wan "eth0" "eth1"
182         ucidef_add_switch "eth0" "1" "1"
183         ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4"
184         ;;
185
186 wzr-hp-g450h)
187         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
188         ucidef_add_switch "eth0" "1" "1"
189         ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
190         ucidef_add_switch_vlan "eth0" "2" "0t 1"
191         ;;
192
193 ew-dorin-router)
194         ucidef_set_interfaces_lan_wan "eth0" "eth1"
195         ucidef_add_switch "eth0" "1" "1"
196         ucidef_add_switch_vlan "eth0" "1" "0 2 3"
197         ;;
198
199 *)
200         ucidef_set_interfaces_lan_wan "eth0" "eth1"
201         ;;
202 esac
203
204 uci commit network
205
206 exit 0