Changeset 13854
- Timestamp:
- 02/05/10 11:55:07 (3 years ago)
- File:
-
- 1 edited
-
src/router/services/sysinit/sysinit-broadcom.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/services/sysinit/sysinit-broadcom.c
r13786 r13854 1947 1947 } 1948 1948 1949 if (nvram_match("switch_type", "BCM5325") ) // special condition1949 if (nvram_match("switch_type", "BCM5325") && (getRouterBrand() != ROUTER_WRT160NV3)) // special condition 1950 1950 // for Broadcom 1951 1951 // Gigabit Phy … … 2029 2029 eth = "eth0"; 2030 2030 } 2031 2031 2032 char *vlan_lan_ports = nvram_save_get("vlan0ports"); 2033 char *vlan_wan_ports = nvram_save_get("vlan1ports"); 2034 int lan_vlan_num = 0; 2035 int wan_vlan_num = 1; 2036 2037 if (nvram_match("vlan2ports", "0 5") || nvram_match("vlan2ports", "4 5")) { //e.g wrt160nv3 2038 vlan_lan_ports = nvram_save_get("vlan1ports"); 2039 vlan_wan_ports = nvram_save_get("vlan2ports"); 2040 lan_vlan_num = 1; 2041 wan_vlan_num = 2; 2042 if (nvram_match("vlan2ports", "4 5")) 2043 vlan7ports = "4t 5"; 2044 else 2045 vlan7ports = "0t 5"; 2046 } 2047 2032 2048 if (!donothing) { 2033 2049 sysprintf("echo 1 > /proc/switch/%s/reset", eth); 2034 2050 if (enable) { 2035 2051 fprintf(stderr, "enable vlan port mapping %s/%s\n", 2036 nvram_safe_get("vlan0ports"), vlan7ports);2052 vlan_lan_ports, vlan7ports); 2037 2053 if (!nvram_match("dtag_vlan8", "1") 2038 2054 || nvram_match("wan_vdsl", "0")) { 2039 2055 sysprintf 2040 ("echo \"%s\" > /proc/switch/%s/vlan/ 0/ports",2041 nvram_safe_get("vlan0ports"), eth);2056 ("echo \"%s\" > /proc/switch/%s/vlan/%d/ports", 2057 vlan_lan_ports, eth, lan_vlan_num); 2042 2058 start_setup_vlans(); 2043 2059 sysprintf 2044 ("echo \"%s\" > /proc/switch/%s/vlan/ 1/ports",2045 "", eth );2060 ("echo \"%s\" > /proc/switch/%s/vlan/%d/ports", 2061 "", eth, wan_vlan_num); 2046 2062 sysprintf 2047 2063 ("echo \"%s\" > /proc/switch/%s/vlan/7/ports", … … 2049 2065 } else { 2050 2066 sysprintf 2051 ("echo \"%s\" > /proc/switch/%s/vlan/ 0/ports",2052 nvram_safe_get("vlan0ports"), eth);2067 ("echo \"%s\" > /proc/switch/%s/vlan/%d/ports", 2068 vlan_lan_ports, eth, lan_vlan_num); 2053 2069 start_setup_vlans(); 2054 2070 sysprintf 2055 ("echo \"%s\" > /proc/switch/%s/vlan/ 1/ports",2056 "", eth );2071 ("echo \"%s\" > /proc/switch/%s/vlan/%d/ports", 2072 "", eth, wan_vlan_num); 2057 2073 sysprintf 2058 2074 ("echo \"%s\" > /proc/switch/%s/vlan/7/ports", … … 2064 2080 } else { 2065 2081 fprintf(stderr, "disable vlan port mapping %s/%s\n", 2066 nvram_safe_get("vlan0ports"),2067 nvram_safe_get("vlan1ports"));2082 vlan_lan_ports, 2083 vlan_wan_ports); 2068 2084 sysprintf("echo \"%s\" > /proc/switch/%s/vlan/8/ports", 2069 2085 "", eth); 2070 2086 sysprintf("echo \"%s\" > /proc/switch/%s/vlan/7/ports", 2071 2087 "", eth); 2072 sysprintf("echo \"%s\" > /proc/switch/%s/vlan/ 0/ports",2073 nvram_safe_get("vlan0ports"), eth);2074 sysprintf("echo \"%s\" > /proc/switch/%s/vlan/ 1/ports",2075 nvram_safe_get("vlan1ports"), eth);2088 sysprintf("echo \"%s\" > /proc/switch/%s/vlan/%d/ports", 2089 vlan_lan_ports, eth, lan_vlan_num); 2090 sysprintf("echo \"%s\" > /proc/switch/%s/vlan/%d/ports", 2091 vlan_wan_ports, eth, wan_vlan_num); 2076 2092 start_setup_vlans(); 2077 2093 }
Note: See TracChangeset
for help on using the changeset viewer.
