Root/target/linux/lantiq/base-files/etc/uci-defaults/network

1#!/bin/sh
2#
3# Copyright (C) 2011-2012 OpenWrt.org
4#
5
6[ -e /etc/config/network ] && exit 0
7
8set_atm_wan() {
9    local vpi=$1
10    local vci=$2
11    local encaps=$3
12    local payload=$4
13    uci batch <<EOF
14set network.atm='atm-bridge'
15set network.atm.vpi='$vpi'
16set network.atm.vci='$vci'
17set network.atm.encaps='$encaps'
18set network.atm.payload='$payload'
19set network.wan='interface'
20set network.wan.ifname='nas0'
21set network.wan.proto='pppoe'
22set network.wan.username='foo'
23set network.wan.password='bar'
24EOF
25}
26
27. /lib/functions/uci-defaults.sh
28. /lib/functions/lantiq.sh
29
30touch /etc/config/network
31
32ucidef_set_interface_loopback
33ucidef_set_interface_lan 'eth0'
34
35vpi=1
36vci=32
37encaps="llc"
38payload="bridged"
39
40board=$(lantiq_board_id)
41
42case "$board" in
43# adm6996
44ARV4520PW)
45    ucidef_set_interface_lan "eth0.1"
46    ucidef_add_switch "eth0" "1" "1"
47    ucidef_add_switch_vlan "eth0" "1" "3 2 1 0 5t"
48    ;;
49
50GIGASX76X)
51    ucidef_set_interface_lan "eth0.1"
52    ucidef_add_switch "eth0" "1" "1"
53    ucidef_add_switch_vlan "eth0" "1" "4 3 2 1 5t"
54    ;;
55
56# ar8316
57ARV4519PW|ARV7518PW)
58    ucidef_set_interface_lan "eth0.1"
59    ucidef_add_switch "eth0" "1" "1"
60    ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
61    ;;
62
63WBMR)
64    ucidef_add_switch "eth0" "1" "0"
65    ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5"
66    ;;
67
68esac
69
70[ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload"
71
72
73uci commit network
74
75exit 0
76

Archive Download this file



interactive