Changeset 9126
- Timestamp:
- 02/27/08 02:37:19 (5 years ago)
- File:
-
- 1 edited
-
src/router/services/sysinit/sysinit-broadcom.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/services/sysinit/sysinit-broadcom.c
r9124 r9126 1159 1159 enable_dtag_vlan (int enable) 1160 1160 { 1161 int donothing = 0; 1162 if (nvram_match ("vdsl_state", "1") && enable) 1163 donothing = 1; 1164 if (nvram_match ("vdsl_state", "0") && !enable) 1165 donothing = 1; 1166 1161 1167 char *vlan7ports = NULL; 1162 1168 vlan7ports = "4t 5"; … … 1176 1182 if (getRouterBrand () == ROUTER_WRT600N) 1177 1183 eth = "eth2"; 1184 if (donothing) 1185 return eth; 1178 1186 if (enable) 1179 1187 { … … 1198 1206 system2 ("echo 1 > /proc/switch/eth1/reset"); 1199 1207 char tmp[200]; 1200 if (enable) 1201 { 1202 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/1/ports", ""); 1203 system2 (tmp); 1204 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/1/ports", ""); 1205 system2 (tmp); 1206 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/0/ports", 1207 nvram_safe_get ("vlan0ports")); 1208 system2 (tmp); 1209 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/0/ports", 1210 nvram_safe_get ("vlan0ports")); 1211 system2 (tmp); 1212 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/7/ports", vlan7ports); 1213 system2 (tmp); 1214 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/7/ports", vlan7ports); 1215 system2 (tmp); 1216 } 1217 else 1218 { 1219 int i; 1220 for (i = 0; i < 16; i++) 1221 { 1222 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/%d/ports", "", i); 1208 if (!donothing) 1209 { 1210 if (enable) 1211 { 1212 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/1/ports", ""); 1223 1213 system2 (tmp); 1224 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/ %d/ports", "", i);1214 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/1/ports", ""); 1225 1215 system2 (tmp); 1226 } 1227 for (i = 0; i < 16; i++) 1228 { 1229 char vlanb[16]; 1230 sprintf (vlanb, "vlan%dports", i); 1231 if (nvram_get (vlanb) == NULL || nvram_match (vlanb, "")) 1232 continue; 1233 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/%d/ports", 1234 nvram_safe_get (vlanb), i); 1216 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/0/ports", 1217 nvram_safe_get ("vlan0ports")); 1235 1218 system2 (tmp); 1236 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/ %d/ports",1237 nvram_safe_get ( vlanb), i);1219 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/0/ports", 1220 nvram_safe_get ("vlan0ports")); 1238 1221 system2 (tmp); 1222 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/7/ports", 1223 vlan7ports); 1224 system2 (tmp); 1225 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/7/ports", 1226 vlan7ports); 1227 system2 (tmp); 1228 } 1229 else 1230 { 1231 int i; 1232 for (i = 0; i < 16; i++) 1233 { 1234 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/%d/ports", "", 1235 i); 1236 system2 (tmp); 1237 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/%d/ports", "", 1238 i); 1239 system2 (tmp); 1240 } 1241 for (i = 0; i < 16; i++) 1242 { 1243 char vlanb[16]; 1244 sprintf (vlanb, "vlan%dports", i); 1245 if (nvram_get (vlanb) == NULL || nvram_match (vlanb, "")) 1246 continue; 1247 sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/%d/ports", 1248 nvram_safe_get (vlanb), i); 1249 system2 (tmp); 1250 sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/%d/ports", 1251 nvram_safe_get (vlanb), i); 1252 system2 (tmp); 1253 } 1239 1254 } 1240 1255 }
Note: See TracChangeset
for help on using the changeset viewer.
