Changeset 33300


Ignore:
Timestamp:
2012-08-29T12:37:38+02:00 (5 years ago)
Author:
juhosg
Message:

ramips: Add switch setup to uci network defaults

Add switch setup to uci network defaults.

The 'lan' attribute is used to decide into which vlan to put the
port.
Currently 'disable' is never set, but the intention is to use this
for devices like the 8devices Carambola, which only has two ports
hooked up to the SoC.

Signed-off-by: Tobias Diedrich <ranma+openwrt@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/base-files/etc/uci-defaults/network

    r33206 r33300  
    99        return 
    1010fi 
     11 
     12ramips_setup_rt3x5x_vlans() 
     13{ 
     14        if [ ! -x /sbin/swconfig ]; then 
     15                # legacy default 
     16                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" 
     17                return 
     18        fi 
     19        local wanports="" 
     20        local lanports="" 
     21        for port in 5 4 3 2 1 0; do 
     22                if [ `swconfig dev rt305x port $port get disable` = "1" ]; then 
     23                        continue 
     24                fi 
     25                if [ `swconfig dev rt305x port $port get lan` = "0" ]; then 
     26                        wanports="$port $wanports" 
     27                else 
     28                        lanports="$port $lanports" 
     29                fi 
     30        done 
     31        ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" 
     32        ucidef_add_switch "rt305x" "1" "1" 
     33        ucidef_add_switch_vlan "rt305x" "1" "$lanports 6t" 
     34        ucidef_add_switch_vlan "rt305x" "2" "$wanports 6t" 
     35} 
    1136 
    1237ramips_setup_interfaces() 
     
    75100                RT3X5X=`cat /proc/cpuinfo | grep RT3.5` 
    76101                if [ -n "${RT3X5X}" ]; then 
    77                         ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" 
     102                        ramips_setup_rt3x5x_vlans 
    78103                else 
    79104                        ucidef_set_interfaces_lan_wan "eth0" "eth1" 
Note: See TracChangeset for help on using the changeset viewer.