3 # Copyright (C) 2011-2012 OpenWrt.org
6 [ -e /etc/config/network ] && exit 0
14 set network.atm='atm-bridge'
15 set network.atm.vpi='$vpi'
16 set network.atm.vci='$vci'
17 set network.atm.encaps='$encaps'
18 set network.atm.payload='$payload'
19 set network.wan='interface'
20 set network.wan.ifname='nas0'
21 set network.wan.proto='pppoe'
22 set network.wan.username='foo'
23 set network.wan.password='bar'
24 set network.wan.ipv6='1'
25 set network.wan6='interface'
26 set network.wan6.ifname='@wan'
27 set network.wan6.proto='dhcpv6'
35 set network.dsl='adsl'
36 set network.dsl.annex='$annex'
37 set network.dsl.firmware='$firmware'
47 set network.dsl='vdsl'
48 set network.dsl.annex='$annex'
49 set network.dsl.firmware='$firmware'
50 set network.dsl.tone='$tone'
51 set network.dsl.xfer_mode='$xfer_mode'
55 . /lib/functions/uci-defaults.sh
56 . /lib/functions/lantiq.sh
58 touch /etc/config/network
60 ucidef_set_interface_loopback
61 ucidef_set_interface_lan 'eth0'
71 board=$(lantiq_board_name)
76 lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
77 wan_mac=$(macaddr_add "$lan_mac" 1)
78 ucidef_set_interface_lan "eth0.1"
79 ucidef_add_switch "switch0" "1" "1"
80 ucidef_add_switch_vlan "switch0" "1" "3 2 1 0 5t"
84 ucidef_set_interface_lan "eth0.1"
85 ucidef_add_switch "switch0" "1" "1"
86 ucidef_add_switch_vlan "switch0" "1" "3 2 1 0 5t"
90 ucidef_set_interface_lan "eth0.1"
91 ucidef_add_switch "switch0" "1" "1"
92 ucidef_add_switch_vlan "switch0" "1" "4 3 2 1 5t"
96 ARV4519PW|ARV7510PW22|ARV7518PW|ARV752DPW22)
97 ucidef_set_interface_lan "eth0.1"
98 ucidef_add_switch "switch0" "1" "1"
99 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
104 lan_mac=$(mtd_get_mac_binary board_config 22)
105 wan_mac=$(macaddr_add "$lan_mac" 1)
106 ucidef_set_interface_lan "eth0.1"
107 ucidef_add_switch "switch0" "1" "1"
108 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4t"
112 ucidef_set_interface_lan "eth0.1"
113 ucidef_add_switch "switch0" "1" "1"
114 ucidef_add_switch_vlan "switch0" "1" "0t 2 3 4 5"
118 ucidef_set_interface_lan 'eth0'
119 uci set network.lan.type='none'
123 ucidef_set_interface_lan "eth0.1"
124 ucidef_add_switch "switch0" "1" "1"
125 ucidef_add_switch_vlan "switch0" "1" "3 2 1 0 5t"
129 ucidef_set_interface_wan "eth0"
130 uci set network.lan.ifname=''
134 ucidef_set_interface_lan "eth0.1"
135 ucidef_add_switch "switch0" "1" "1"
136 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4t"
141 ucidef_set_interface_lan "eth0.1"
142 ucidef_add_switch "switch0" "1" "1"
143 ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
147 lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr)
148 wan_mac=$(macaddr_add "$lan_mac" 1)
149 ucidef_set_interface_lan 'eth0.1'
150 ucidef_add_switch "switch0" "1" "1"
151 ucidef_add_switch_vlan "switch0" "1" "0 1 2 4 5 6t"
155 lan_mac=$(mtd_get_mac_binary boardconfig 61696)
156 wan_mac=$(macaddr_add "$lan_mac" 1)
157 ucidef_set_interface_lan 'eth0.1'
158 ucidef_add_switch "switch0" "1" "1"
159 ucidef_add_switch_vlan "switch0" "1" "0 2 4 5 6t"
163 lan_mac=$(mtd_get_mac_binary boardconfig 22)
164 wan_mac=$(macaddr_add "$lan_mac" 1)
165 ucidef_set_interface_lan "eth0.1"
166 ucidef_add_switch "switch0" "1" "1"
167 ucidef_add_switch_vlan "switch0" "1" "0 2 3 4 5 6t"
170 BTHOMEHUBV2B|BTHOMEHUBV3A)
171 lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
172 wan_mac=$(macaddr_add "$lan_mac" 1)
176 lan_mac=$(mtd_get_mac_binary board_config 22)
177 wan_mac=$(macaddr_add "$lan_mac" 1)
181 lan_mac=$(mtd_get_mac_binary board_config 22)
182 wan_mac=$(macaddr_add "$lan_mac" 1)
183 ucidef_set_interface_lan 'eth0.1'
184 ucidef_add_switch "switch0" "1" "1"
185 ucidef_add_switch_vlan "switch0" "1" "2 3 4 5 6t"
190 [ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload"
192 if [ -n "$(grep "system type.*: VR9" /proc/cpuinfo)" ]; then
193 set_vdsl_modem "$annex" "/lib/firmware/vdsl.bin" "av" "ptm"
195 set_adsl_modem "$annex" "/lib/firmware/adsl.bin"
198 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac
199 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan $wan_mac