Changeset 12085


Ignore:
Timestamp:
05/10/09 20:41:06 (4 years ago)
Author:
BrainSlayer
Message:

use kernel icplus driver (experimental)

Location:
src/router
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/router/rc/services.c

    r12072 r12085  
    817817    handle = start_service_nofree( "bonding", handle ); 
    818818#endif 
    819     handle = start_service_nofree( "wan", handle ); 
     819    handle = start_service_nofree_f( "wan", handle ); 
    820820    handle = start_service_nofree_f( "ttraff", handle ); 
    821821#ifdef HAVE_MADWIFI 
     
    899899        // we must use getWET as well 
    900900    { 
    901         handle = start_service_nofree( "wan", handle ); 
     901        handle = start_service_nofree_f( "wan", handle ); 
    902902        handle = start_service_nofree_f( "ttraff", handle ); 
    903903    } 
  • src/router/services/Makefile

    r11993 r12085  
    377377CFLAGS += -DHAVE_FONERA 
    378378CFLAGS += -DHAVE_DIR400 
    379 OBJS += icplus.o 
     379#OBJS += icplus.o 
    380380else 
    381381ifeq ($(CONFIG_DIR300),y) 
    382382CFLAGS += -DHAVE_FONERA 
    383383CFLAGS += -DHAVE_DIR300 
    384 OBJS += icplus.o 
     384#OBJS += icplus.o 
    385385endif 
    386386endif 
     
    438438ifeq ($(CONFIG_LS2),y) 
    439439CFLAGS += -DHAVE_LS2 
    440 OBJS += icplus.o 
     440#OBJS += icplus.o 
    441441endif 
    442442endif 
  • src/router/services/networking/interface.c

    r11273 r12085  
    513513              nvram_safe_get( "wan_ifnames" ) ); 
    514514#elif HAVE_DIR300 
    515     snprintf( all_ifnames, 255, "%s %s %s", "eth0 vlan0 vlan2", 
     515    snprintf( all_ifnames, 255, "%s %s %s", "eth0 vlan1 vlan2", 
    516516              nvram_safe_get( "lan_ifnames" ), 
    517517              nvram_safe_get( "wan_ifnames" ) ); 
  • src/router/services/networking/network.c

    r12083 r12085  
    971971    { 
    972972        nvram_set( "lan_ifname", "br0" ); 
    973         nvram_set( "lan_ifnames", "vlan0 vlan2 ath0" ); 
     973        nvram_set( "lan_ifnames", "vlan1 vlan2 ath0" ); 
    974974        PORTSETUPWAN( "" ); 
    975975    } 
     
    977977    { 
    978978        nvram_set( "lan_ifname", "br0" ); 
    979         nvram_set( "lan_ifnames", "vlan0 vlan2 ath0" ); 
     979        nvram_set( "lan_ifnames", "vlan1 vlan2 ath0" ); 
    980980        PORTSETUPWAN( "vlan2" ); 
    981981    } 
     
    24382438    int s; 
    24392439    struct ifreq ifr; 
     2440    if( isClient(  ) ) 
     2441    { 
     2442        char *ifn = getSTA(  ); 
     2443        int count = 10; 
     2444        while((count--) >0) // wait until wan is available (10 sek max) 
     2445        { 
     2446            if (ifexists(ifn)) 
     2447                { 
     2448                break; 
     2449                } 
     2450            sleep(1); 
     2451        } 
     2452    } 
    24402453 
    24412454    eval( "ifconfig", nvram_safe_get( "wan_ifname" ), "allmulti", "promisc" ); 
     
    25992612    { 
    26002613        pppoe_wan_ifname = getSTA(  ); 
     2614        int count = 10; 
     2615        while((count--) >0) 
     2616        { 
     2617         
     2618        } 
    26012619    } 
    26022620#endif 
  • src/router/services/networking/wshaper.c

    r11938 r12085  
    702702    ret = eval( script_name, "stop", "XX", "ath0" ); 
    703703#elif HAVE_DIR300 
    704     ret = eval( script_name, "stop", "XX", "vlan0" ); 
     704    ret = eval( script_name, "stop", "XX", "vlan1" ); 
    705705    ret = eval( script_name, "stop", "XX", "vlan2" ); 
    706706    ret = eval( script_name, "stop", "XX", "ath0" ); 
  • src/router/services/sysinit/sysinit-dir300.c

    r11752 r12085  
    285285    else 
    286286    { 
    287         vlan_init( 0xff );      // 4 lan + 1 wan 
     287//      system("swconfig dev eth0 set reset 1"); 
     288//      system("swconfig dev eth0 set enable_vlan 1"); 
     289        system("swconfig dev eth0 vlan 1 set ports \"0 1 2 3 5t\""); 
     290        system("swconfig dev eth0 vlan 2 set ports \"4 5t\""); 
     291        system("swconfig dev eth0 set apply"); 
     292        eval( "vconfig", "set_name_type", "VLAN_PLUS_VID_NO_PAD" ); 
     293        eval( "vconfig", "add", "eth0", "1" ); 
     294        eval( "vconfig", "add", "eth0", "2" ); 
     295//      set network.eth0_1.ports="0 1 2 3 5t" 
     296//      vlan_init( 0xff );      // 4 lan + 1 wan 
     297    struct ifreq ifr; 
     298    int s; 
     299 
     300    if( ( s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ) ) ) 
     301    { 
     302        char eabuf[32]; 
     303 
     304        strncpy( ifr.ifr_name, "eth0", IFNAMSIZ ); 
     305        ioctl( s, SIOCGIFHWADDR, &ifr ); 
     306        char macaddr[32]; 
     307 
     308        strcpy( macaddr, 
     309                ether_etoa( ( unsigned char * )ifr.ifr_hwaddr.sa_data, 
     310                            eabuf ) ); 
     311        nvram_set( "et0macaddr", macaddr ); 
     312        // MAC_ADD (macaddr); 
     313        ether_atoe( macaddr, ( unsigned char * )ifr.ifr_hwaddr.sa_data ); 
     314        strncpy( ifr.ifr_name, "vlan2", IFNAMSIZ ); 
     315        ioctl( s, SIOCSIFHWADDR, &ifr ); 
     316        close( s ); 
     317    } 
    288318    } 
    289319    // insmod("ipv6"); 
  • src/router/services/sysinit/sysinit-ls2.c

    r11802 r12085  
    138138#if !defined(HAVE_NS2) && !defined(HAVE_BS2) && !defined(HAVE_LC2) && !defined(HAVE_BS2HP) && !defined(HAVE_MS2) && !defined(HAVE_PICO2) && !defined(HAVE_PICO2HP) 
    139139    eval( "ifconfig", "eth0", "up" );   // wan 
    140     vlan_init( 0x31 );          // 1 lan + 1 wan, but only first one is used 
     140//      system("swconfig dev eth0 set reset 1"); 
     141//      system("swconfig dev eth0 set enable_vlan 1"); 
     142        system("swconfig dev eth0 vlan 1 set ports \"0 1 2 3 5t\""); 
     143        system("swconfig dev eth0 vlan 2 set ports \"4 5t\""); 
     144        system("swconfig dev eth0 set apply"); 
     145        eval( "vconfig", "set_name_type", "VLAN_PLUS_VID_NO_PAD" ); 
     146        eval( "vconfig", "add", "eth0", "1" ); 
     147        eval( "vconfig", "add", "eth0", "2" ); 
     148//      set network.eth0_1.ports="0 1 2 3 5t" 
     149//      vlan_init( 0xff );      // 4 lan + 1 wan 
     150    struct ifreq ifr; 
     151    int s; 
     152 
     153    if( ( s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ) ) ) 
     154    { 
     155        char eabuf[32]; 
     156 
     157        strncpy( ifr.ifr_name, "eth0", IFNAMSIZ ); 
     158        ioctl( s, SIOCGIFHWADDR, &ifr ); 
     159        char macaddr[32]; 
     160 
     161        strcpy( macaddr, 
     162                ether_etoa( ( unsigned char * )ifr.ifr_hwaddr.sa_data, 
     163                            eabuf ) ); 
     164        nvram_set( "et0macaddr", macaddr ); 
     165        // MAC_ADD (macaddr); 
     166        ether_atoe( macaddr, ( unsigned char * )ifr.ifr_hwaddr.sa_data ); 
     167        strncpy( ifr.ifr_name, "vlan2", IFNAMSIZ ); 
     168        ioctl( s, SIOCSIFHWADDR, &ifr ); 
     169        close( s ); 
     170    } 
    141171#endif 
    142172#endif 
  • src/router/services/sysinit/sysinit-wrt54g2v11.c

    r12080 r12085  
    141141    } 
    142142 
     143    system("swconfig dev eth0 set reset 1"); 
     144    system("swconfig dev eth0 set enable_vlan 1"); 
    143145    system("swconfig dev eth0 vlan 1 set ports \"0t 1 2 3 4\""); 
    144146    system("swconfig dev eth0 vlan 2 set ports \"0t 5\""); 
     147    system("swconfig dev eth0 set apply"); 
    145148    eval( "vconfig", "set_name_type", "VLAN_PLUS_VID_NO_PAD" ); 
    146149    eval( "vconfig", "add", "eth0", "1" ); 
Note: See TracChangeset for help on using the changeset viewer.