Changeset 9114


Ignore:
Timestamp:
02/25/08 19:36:07 (5 years ago)
Author:
BrainSlayer
Message:

vdsl support for broadcom vlan switch supported routers too

Location:
src/router
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • src/router/kromo/dd-wrt/index_pppoe.asp

    r8111 r9114  
    1717        <input class="spaceradio" type="radio" name="ppp_compression" value="0" <% nvram_checked("ppp_compression","0"); %> /><% tran("share.disable"); %>  
    1818</div> 
    19 <% startswith("wan_ifname","vlan","<!--"); %> 
    2019<div class="setting"> 
    2120        <div class="label"><% tran("share.vdsl"); %></div> 
     
    2322        <input class="spaceradio" type="radio" name="wan_vdsl" value="0" <% nvram_checked("wan_vdsl","0"); %> /><% tran("share.disable"); %>  
    2423</div> 
    25 <% startswith("wan_ifname","vlan","-->"); %> 
    2624<div class="setting"> 
    2725        <div class="label"><% tran("service.pptpd_encry"); %></div> 
  • src/router/services/networking/network.c

    r9108 r9114  
    12621262    cprintf ("Write wireless mac successfully\n"); 
    12631263  eval ("wl", "-i", wl_face, "up"); 
    1264   start_config_macs(wl_face); 
     1264  start_config_macs (wl_face); 
    12651265#ifdef HAVE_MSSID 
    12661266  set_vifsmac (mac); 
     
    13881388#ifndef HAVE_MADWIFI 
    13891389                    eval ("wl", "-i", name, "up"); 
    1390                     start_config_macs(name); 
     1390                    start_config_macs (name); 
    13911391#endif 
    13921392                  } 
     
    14051405                else 
    14061406                  cprintf ("Write wireless mac successfully\n"); 
    1407                   start_config_macs(wl_face); 
     1407                start_config_macs (wl_face); 
    14081408              } 
    14091409#endif 
     
    15791579      else 
    15801580        cprintf ("Write wireless mac successfully\n"); 
    1581         start_config_macs(wl_face); 
     1581      start_config_macs (wl_face); 
    15821582    } 
    15831583 
     
    21362136  int s; 
    21372137  struct ifreq ifr; 
    2138 eval("ifconfig",nvram_safe_get("wan_ifname"),"allmulti","promisc"); 
     2138  eval ("ifconfig", nvram_safe_get ("wan_ifname"), "allmulti", "promisc"); 
    21392139 
    21402140#ifdef HAVE_PPPOE 
     
    23162316#ifndef HAVE_MADWIFI 
    23172317      if (wlifname && !strcmp (wan_ifname, wlifname)) 
    2318         { 
    2319         eval ("wl", "-i", wan_ifname, "up"); 
    2320         start_config_macs(wan_ifname); 
     2318        { 
     2319          eval ("wl", "-i", wan_ifname, "up"); 
     2320          start_config_macs (wan_ifname); 
    23212321        } 
    23222322#endif 
     
    24292429      fprintf (fp, "\n"); 
    24302430      char vlannic[32]; 
    2431       sprintf (vlannic, "%s.0007", pppoe_wan_ifname); 
    2432       if (nvram_match ("wan_vdsl", "1"))        // Deutsche Telekom VDSL2 Vlan 7 Tag 
    2433         { 
    2434           if (!ifexists (vlannic)) 
     2431      if (!strncmp (pppoe_wan_ifname, "vlan", 4)) 
     2432        { 
     2433          sprintf (vlannic, "eth0.0007", pppoe_wan_ifname); 
     2434          if (nvram_match ("wan_vdsl", "1")) 
    24352435            { 
    2436               eval ("vconfig", "set_name_type", "DEV_PLUS_VID"); 
    2437               eval ("vconfig", "add", pppoe_wan_ifname, "7"); 
    2438               eval ("ifconfig", vlannic, "up"); 
     2436              enable_dtag_vlan (1); 
     2437              if (!ifexists (vlannic)) 
     2438                { 
     2439                  eval ("vconfig", "set_name_type", "DEV_PLUS_VID"); 
     2440                  eval ("vconfig", "add", "eth0", "7"); 
     2441                  eval ("ifconfig", vlannic, "up"); 
     2442                } 
     2443              fprintf (fp, "nic-%s\n", vlannic); 
    24392444            } 
    2440           fprintf (fp, "nic-%s\n", vlannic); 
     2445          else 
     2446            { 
     2447              enable_dtag_vlan (0); 
     2448              if (ifexists (vlannic)) 
     2449                eval ("vconfig", "rem", vlannic); 
     2450              fprintf (fp, "nic-%s\n", pppoe_wan_ifname); 
     2451            } 
     2452 
     2453 
    24412454        } 
    24422455      else 
    24432456        { 
    2444           if (ifexists (vlannic)) 
    2445             eval ("vconfig", "rem", vlannic); 
    2446           fprintf (fp, "nic-%s\n", pppoe_wan_ifname); 
     2457          sprintf (vlannic, "%s.0007", pppoe_wan_ifname); 
     2458          if (nvram_match ("wan_vdsl", "1"))    // Deutsche Telekom VDSL2 Vlan 7 Tag 
     2459            { 
     2460              if (!ifexists (vlannic)) 
     2461                { 
     2462                  eval ("vconfig", "set_name_type", "DEV_PLUS_VID"); 
     2463                  eval ("vconfig", "add", pppoe_wan_ifname, "7"); 
     2464                  eval ("ifconfig", vlannic, "up"); 
     2465                } 
     2466              fprintf (fp, "nic-%s\n", vlannic); 
     2467            } 
     2468          else 
     2469            { 
     2470              if (ifexists (vlannic)) 
     2471                eval ("vconfig", "rem", vlannic); 
     2472              fprintf (fp, "nic-%s\n", pppoe_wan_ifname); 
     2473            } 
    24472474        } 
    24482475 
  • src/router/services/sysinit/sysinit-broadcom.c

    r9080 r9114  
    136136    case ROUTER_LINKSYS_WRH54G: 
    137137      nvram_set ("wl0gpio0", "135"); 
    138       break;  
     138      break; 
    139139    case ROUTER_BUFFALO_WZRRSG54: 
    140140      nvram_unset ("wl0_abenable"); 
     
    143143      nvram_set ("wl0gpio1", "0"); 
    144144      nvram_set ("wl0gpio2", "0"); 
    145       break;           
     145      break; 
    146146    case ROUTER_ASUS_WL500W: 
    147147    case ROUTER_WRT54G: 
     
    419419      nvram_set ("wan_ifname", "eth1"); 
    420420      nvram_set ("wl0_ifname", "eth2"); 
    421       eval ("gpio", "init", "0"); //AOSS button 
    422       eval ("gpio", "init", "4"); //reset button 
     421      eval ("gpio", "init", "0");       //AOSS button 
     422      eval ("gpio", "init", "4");       //reset button 
    423423      break; 
    424424 
     
    702702            { 
    703703            case ROUTER_WRT300NV11: 
    704             case ROUTER_WRT310N:     
     704            case ROUTER_WRT310N: 
    705705            case ROUTER_WRT350N: 
    706706            case ROUTER_WRT600N: 
     
    11541154#endif 
    11551155} 
     1156 
     1157 
     1158void 
     1159enable_dtag_vlan (int enable) 
     1160{ 
     1161  char *vlan1ports = NULL; 
     1162  char *vlan2ports = NULL; 
     1163  char *vlan7ports = NULL; 
     1164  switch (getRouterBrand ()) 
     1165    { 
     1166    case ROUTER_MOTOROLA: 
     1167    case ROUTER_ASUS_WL520G: 
     1168    case ROUTER_WRT54G_V8: 
     1169      vlan1ports = "4 5"; 
     1170      vlan7ports = "4t 5"; 
     1171      break; 
     1172    case ROUTER_LINKSYS_WTR54GS: 
     1173      vlan1ports = "1 5"; 
     1174      vlan7ports = "1t 5"; 
     1175      break; 
     1176    case ROUTER_ASUS_WL550GE: 
     1177    case ROUTER_LINKSYS_WRH54G: 
     1178      vlan1ports = "0 5"; 
     1179      vlan7ports = "0t 5"; 
     1180      break; 
     1181    case ROUTER_WRT600N: 
     1182      vlan2ports = "0 8"; 
     1183      vlan7ports = "0t 8"; 
     1184      break; 
     1185    case ROUTER_WRT350N: 
     1186    case ROUTER_BUFFALO_WZRG144NH: 
     1187      vlan1ports = "4 8"; 
     1188      vlan7ports = "4t 8"; 
     1189      break; 
     1190    default: 
     1191      vlan1ports = "0 5"; 
     1192      vlan7ports = "0t 5"; 
     1193      break; 
     1194    } 
     1195  system2 ("echo 1 > /proc/switch/eth0/reset"); 
     1196  system2 ("echo 1 > /proc/switch/eth1/reset"); 
     1197  char tmp[200]; 
     1198  if (enable) 
     1199    { 
     1200      sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/7/ports", vlan7ports); 
     1201      system2 (tmp); 
     1202      sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/7/ports", vlan7ports); 
     1203      system2 (tmp); 
     1204      if (vlan1ports) 
     1205        { 
     1206          sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/1/ports", 
     1207                   vlan1ports); 
     1208          system2 (tmp); 
     1209          sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/1/ports", 
     1210                   vlan1ports); 
     1211          system2 (tmp); 
     1212        } 
     1213      if (vlan2ports) 
     1214        { 
     1215          sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/2/ports", 
     1216                   vlan2ports); 
     1217          system2 (tmp); 
     1218          sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/2/ports", 
     1219                   vlan2ports); 
     1220          system2 (tmp); 
     1221        } 
     1222      sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/0/ports", 
     1223               nvram_safe_get ("vlan0ports")); 
     1224      system2 (tmp); 
     1225      sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/0/ports", 
     1226               nvram_safe_get ("vlan0ports")); 
     1227      system2 (tmp); 
     1228    } 
     1229  else 
     1230    { 
     1231      int i; 
     1232      for (i = 0; i < 16; i++) 
     1233        { 
     1234          char vlanb[16]; 
     1235          sprintf (vlanb, "vlan%dports", i); 
     1236          if (nvram_get (vlanb) == NULL || nvram_match (vlanb, "")) 
     1237            continue; 
     1238          sprintf (tmp, "echo %s > /proc/switch/eth0/vlan/%d/ports", 
     1239                   nvram_safe_get (vlanb), i); 
     1240          system2 (tmp); 
     1241          sprintf (tmp, "echo %s > /proc/switch/eth1/vlan/%d/ports", 
     1242                   nvram_safe_get (vlanb), i); 
     1243          system2 (tmp); 
     1244        } 
     1245    } 
     1246 
     1247} 
  • src/router/services/sysinit/sysinit-ca8.c

    r9078 r9114  
    142142{ 
    143143} 
     144 
     145void enable_dtag_vlan(int enable) 
     146{ 
     147 
     148} 
  • src/router/services/sysinit/sysinit-dir300.c

    r9082 r9114  
    166166{ 
    167167} 
     168void enable_dtag_vlan(int enable) 
     169{ 
     170 
     171} 
  • src/router/services/sysinit/sysinit-fonera.c

    r9078 r9114  
    147147{ 
    148148} 
     149void enable_dtag_vlan(int enable) 
     150{ 
     151 
     152} 
  • src/router/services/sysinit/sysinit-gateworx.c

    r9070 r9114  
    357357{ 
    358358} 
     359void enable_dtag_vlan(int enable) 
     360{ 
     361 
     362} 
  • src/router/services/sysinit/sysinit-ls5.c

    r9078 r9114  
    143143{ 
    144144} 
     145void enable_dtag_vlan(int enable) 
     146{ 
     147 
     148} 
  • src/router/services/sysinit/sysinit-magicbox.c

    r9080 r9114  
    176176{ 
    177177} 
     178void enable_dtag_vlan(int enable) 
     179{ 
     180 
     181} 
  • src/router/services/sysinit/sysinit-mr3202a.c

    r9078 r9114  
    139139{ 
    140140} 
     141void enable_dtag_vlan(int enable) 
     142{ 
     143 
     144} 
  • src/router/services/sysinit/sysinit-newmedia-dual.c

    r9080 r9114  
    160160{ 
    161161} 
     162void enable_dtag_vlan(int enable) 
     163{ 
     164 
     165} 
  • src/router/services/sysinit/sysinit-pb42.c

    r8011 r9114  
    137137{ 
    138138} 
     139void enable_dtag_vlan(int enable) 
     140{ 
     141 
     142} 
  • src/router/services/sysinit/sysinit-rb532.c

    r9080 r9114  
    173173{ 
    174174} 
     175void enable_dtag_vlan(int enable) 
     176{ 
     177 
     178} 
  • src/router/services/sysinit/sysinit-supergerry.c

    r9080 r9114  
    150150{ 
    151151} 
     152void enable_dtag_vlan(int enable) 
     153{ 
     154 
     155} 
  • src/router/services/sysinit/sysinit-whrag108.c

    r9078 r9114  
    244244{ 
    245245} 
     246void enable_dtag_vlan(int enable) 
     247{ 
     248 
     249} 
  • src/router/services/sysinit/sysinit-wrt300nv2.c

    r9080 r9114  
    223223{ 
    224224} 
     225void enable_dtag_vlan(int enable) 
     226{ 
     227 
     228} 
  • src/router/services/sysinit/sysinit-x86.c

    r9080 r9114  
    401401{ 
    402402} 
     403void enable_dtag_vlan(int enable) 
     404{ 
     405 
     406} 
Note: See TracChangeset for help on using the changeset viewer.