source: branches/attitude_adjustment/target/linux/lantiq/base-files/etc/uci-defaults/network

Last change on this file was 33324, checked in by luka, 4 years ago

lantiq: fix sx76x default uci network configuration

  • Property svn:executable set to *
File size: 1.6 KB
Line 
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.unit='0'
16set network.atm.vpi='$vpi'
17set network.atm.vci='$vci'
18set network.atm.encaps='$encaps'
19set network.atm.payload='$payload'
20set network.wan='interface'
21set network.wan.ifname='nas0'
22set network.wan.proto='pppoe'
23set network.wan.username='foo'
24set network.wan.password='bar'
25EOF
26}
27
28set_adsl() {
29        local fwannex=$1
30        local annex=$2
31        uci batch <<EOF
32set network.adsl='adsl-device'
33set network.adsl.fwannex='$fwannex'
34set network.adsl.annex='$annex'
35EOF
36}
37
38. /lib/functions/uci-defaults.sh
39. /lib/lantiq.sh
40
41touch /etc/config/network
42
43ucidef_set_interface_loopback
44ucidef_set_interface_lan 'eth0'
45
46vpi=1
47vci=32
48encaps="llc"
49payload="bridged"
50fwannex=$(lantiq_dsl_fwannex)
51board=$(lantiq_board_name)
52dsl=$(lantiq_soc_has_adsl)
53
54case "$board" in
55# annex B with adm6996
56ARV4520PW)
57        ucidef_set_interface_lan "eth0.1"
58        ucidef_add_switch "eth0" "1" "1"
59        ucidef_add_switch_vlan "eth0" "1" "3 2 1 0 5t"
60        set_adsl "b" "b2p"
61        ;;
62
63GIGASX76X)
64        ucidef_set_interface_lan "eth0.1"
65        ucidef_add_switch "eth0" "1" "1"
66        ucidef_add_switch_vlan "eth0" "1" "4 3 2 1 5t"
67        set_adsl "b" "b2p"
68        ;;
69
70# annex A with ar8316
71ARV4519PW|ARV7518PW)
72        ucidef_set_interface_lan "eth0.1"
73        ucidef_add_switch "eth0" "1" "1"
74        ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
75        set_adsl "a" "a2p"
76        ;;
77
78ARV7525PW|ARV4525PW|*)
79        set_adsl "$fwannex" "${fwannex}2p"
80        ;;
81esac
82
83[ -z "$dsl" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload"
84
85uci commit network
86
87exit 0
Note: See TracBrowser for help on using the repository browser.