source: trunk/target/linux/ramips/base-files/etc/uci-defaults/network @ 30434

Last change on this file since 30434 was 30434, checked in by juhosg, 5 years ago

ramips: rt305x: add support for Accton WR6202 / SMCWBR11S-3GN

This patch adds support for the Accton WR6202 Mini 3G broadband router.
Full details for this device are available at
http://www.awbnetworks.com/products03.php?Fullkey=19.

This device is identical to the SMCWBR11S-3GN:
http://www.smc-asia.com/products03.php?Fullkey=210

It's also worth noting that this board has a GPIO line to control the
power to the USB port.

[juhosg:

  • fix checkpatch warnings,
  • reorder Kconfig entry,
  • merge the sysupgrade patch,
  • add GPL header]

Signed-off-by: Johnathan Boyce <jon.boyce@…>

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/sh
2
3. /etc/functions.sh
4. /lib/ramips.sh
5. /lib/functions/uci-defaults.sh
6
7if [ ! -x /usr/sbin/maccalc ]; then
8        echo "$0: maccalc not found!"
9        return
10fi
11
12ramips_setup_interfaces()
13{
14        local board="$1"
15
16        ucidef_set_interface_loopback
17
18        case $board in
19        all0256n)
20                ucidef_set_interface_lan "eth0.1"
21                ;;
22
23        argus-atp52b | \
24        b2c | \
25        nw718 | \
26        w502u | \
27        wr6202)
28                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
29                ;;
30
31        f5d8235-v1 | \
32        rt-n15)
33                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
34                ucidef_add_switch "rtl8366s" "1" "1"
35                ucidef_add_switch_vlan "rtl8366s" "1" "1 2 3 4 5t"
36                ucidef_add_switch_vlan "rtl8366s" "2" "0 5t"
37                ;;
38
39        f5d8235-v2 | \
40        wl-351)
41                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
42                ucidef_add_switch "rtl8366rb" "1" "1"
43                ucidef_add_switch_vlan "rtl8366rb" "1" "0 1 2 3 5t"
44                ucidef_add_switch_vlan "rtl8366rb" "2" "4 5t"
45                ;;
46
47        wcr-150gn)
48                ucidef_set_interface_lan_wan "eth0.2" "eth0.1"
49                ;;
50
51        wli-tx4-ag300n)
52                ucidef_set_interface_lan "eth0"
53                ;;
54
55        *)
56                RT3X5X=`cat /proc/cpuinfo | grep RT3.5`
57                if [ -n "${RT3X5X}" ]; then
58                        ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
59                else
60                        ucidef_set_interfaces_lan_wan "eth0" "eth1"
61                fi
62                ;;
63        esac
64}
65
66ramips_setup_macs()
67{
68        local board="$1"
69        local lan_mac=""
70        local wan_mac=""
71
72        case $board in
73        all0256n)
74                lan_mac=$(ramips_get_mac_binary factory 40)
75                ;;
76
77        argus-atp52b | \
78        b2c | \
79        f5d8235-v1 | \
80        nw718 | \
81        rt-n15 | \
82        wl-351)
83                lan_mac=$(ramips_get_mac_binary factory 4)
84                wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1)
85                ;;
86
87        dir-300-b1 |\
88        dir-300-b2 |\
89        dir-600-b1)
90                lan_mac=$(ramips_get_mac_binary devdata 16388)
91                wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1)
92                ;;
93
94        esr-9753 | \
95        nbg-419n | \
96        wcr-150gn)
97                lan_mac=$(ramips_get_mac_binary factory 4)
98                wan_mac=$(ramips_get_mac_binary factory 40)
99                ;;
100
101        f5d8235-v2)
102                lan_mac=$(ramips_get_mac_binary "u-boot" 262148)
103                wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1)
104                ;;
105
106        w502u)
107                lan_mac=$(ramips_get_mac_binary factory 40)
108                wan_mac=$(ramips_get_mac_binary factory 46)
109                ;;
110
111        wl341v3)
112                lan_mac=$(ramips_get_mac_binary board-nvram 65440)
113                wan_mac=$(/usr/sbin/maccalc add "$lan_mac" 1)
114                ;;
115
116        wli-tx4-ag300n)
117                lan_mac=$(ramips_get_mac_binary factory 4)
118                ;;
119
120        esac
121
122        [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac
123        [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan $wan_mac
124}
125
126[ -e /etc/config/network ] && exit 0
127
128touch /etc/config/network
129
130board=$(ramips_board_name)
131
132ramips_setup_interfaces $board
133ramips_setup_macs $board
134
135uci commit network
136
137exit 0
Note: See TracBrowser for help on using the repository browser.