Changeset 15102


Ignore:
Timestamp:
09/08/10 01:07:34 (3 years ago)
Author:
BrainSlayer
Message:

WZR AG300NH support

Location:
src/router
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • src/router/libutils/Makefile

    r14935 r15102  
    265265  CFLAGS += -DHAVE_WZRG300NH 
    266266endif 
     267ifeq ($(CONFIG_WZRHPAG300NH),y) 
     268CFLAGS += -DHAVE_WZRHPAG300NH 
     269endif 
    267270ifeq ($(CONFIG_DIR825),y) 
    268271  CFLAGS += -DHAVE_DIR825 
  • src/router/libutils/utils.c

    r15099 r15102  
    10781078#else 
    10791079        setRouter("Buffalo WZR-HP-G300NH"); 
     1080#endif 
     1081        return ROUTER_BOARD_PB42; 
     1082#elif HAVE_WZRHPAG300NH 
     1083#ifdef HAVE_BUFFALO 
     1084        setRouter("WZR-HP-AG300NH"); 
     1085#else 
     1086        setRouter("Buffalo WZR-HP-AG300NH"); 
    10801087#endif 
    10811088        return ROUTER_BOARD_PB42; 
     
    20492056#ifdef HAVE_WZRG300NH 
    20502057#define UOFFSET 0x40000 
    2051 #else 
     2058#elif HAVE_WZRHPAG300NH 
    20522059#define UOFFSET 0x3E000 
    20532060#endif 
     
    29772984                ses_gpio = 0x111; 
    29782985#endif 
     2986#ifdef HAVE_WZRHPAG300NH 
     2987                diag_gpio = 0x101; 
     2988//              connected_gpio = 0x112; 
     2989//              ses_gpio = 0x105; 
     2990#endif 
    29792991#ifdef HAVE_DIR615E 
    29802992                power_gpio = 0x006; 
     
    31093121                ses_gpio = 0x111; 
    31103122#endif 
     3123#ifdef HAVE_WZRHPAG300NH 
     3124                diag_gpio = 0x101; 
     3125//              connected_gpio = 0x112; 
     3126                usb_gpio = 0x102; 
     3127//              ses_gpio = 0x111; 
     3128#endif 
    31113129                break; 
    31123130#endif 
  • src/router/rc/Makefile

    r15074 r15102  
    595595ifeq ($(CONFIG_HOTPLUG2),y) 
    596596CFLAGS += -DHAVE_HOTPLUG2 
     597endif 
     598ifeq ($(CONFIG_WZRHPAG300NH),y) 
     599CFLAGS += -DHAVE_WZRHPAG300NH 
    597600endif 
    598601 
  • src/router/rc/resetbutton.c

    r15041 r15102  
    198198        return 0; 
    199199} 
     200#elif defined(HAVE_TG1523) 
     201int getbuttonstate() 
     202{ 
     203        int ret = get_gpio(0); 
     204 
     205        if (ret == 0) 
     206                return 1; 
     207        return 0; 
     208} 
    200209#elif defined(HAVE_WR941) 
    201210int getbuttonstate() 
     
    234243        return 0; 
    235244} 
     245#elif defined(HAVE_WZRHPAG300NH) 
     246int getbuttonstate() 
     247{ 
     248        int ret = get_gpio(11);  
     249 
     250        if (ret == 0) 
     251                return 1; 
     252        return 0; 
     253} 
    236254#elif defined(HAVE_TEW632BRP) 
    237255int getbuttonstate() 
    238256{ 
    239         int ret = get_gpio(21); // nxp multiplexer connected 
     257        int ret = get_gpio(21); 
    240258 
    241259        if (ret == 0) 
     
    598616        sesgpio = 0x117; 
    599617        val |= get_gpio(23) << 23;      //aoss pushbutton 
     618#elif defined(HAVE_WZRHPAG300NH) 
     619        sesgpio = 0x105; 
     620        val |= get_gpio(5) << 5;        //aoss pushbutton 
    600621#elif defined(HAVE_WHRHPGN) 
    601622        sesgpio = 0x10c; 
     
    776797#if !defined(HAVE_XSCALE) && !defined(HAVE_MAGICBOX) && !defined(HAVE_FONERA) && !defined(HAVE_WHRAG108) && !defined(HAVE_GATEWORX) && !defined(HAVE_LS2) && !defined(HAVE_CA8) && !defined(HAVE_TW6600) && !defined(HAVE_LS5) && !defined(HAVE_LSX) && !defined(HAVE_SOLO51) 
    777798                                        led_control(LED_DIAG, LED_ON); 
    778 #elif defined(HAVE_WHRHPGN) || defined(HAVE_WZRG300NH) 
     799#elif defined(HAVE_WHRHPGN)  || defined(HAVE_WZRG300NH) || defined(HAVE_WZRHPAG300NH) 
    779800                                        led_control(LED_DIAG, LED_ON); 
    780801#endif 
     
    820841                                        // we're restoring 
    821842                                        // defaults. 
    822 #elif defined(HAVE_WHRHPGN) || defined(HAVE_WZRG300NH) 
     843#elif defined(HAVE_WHRHPGN) || defined(HAVE_WZRG300NH) || defined(HAVE_WZRHPAG300NH) 
    823844                                        led_control(LED_DIAG, LED_ON); 
    824845#endif 
  • src/router/services/Makefile

    r15074 r15102  
    255255ifeq ($(CONFIG_WZRG300NH),y) 
    256256CFLAGS_EXTRA += -DHAVE_WZRG300NH 
     257endif 
     258ifeq ($(CONFIG_WZRHPAG300NH),y) 
     259CFLAGS_EXTRA += -DHAVE_WZRHPAG300NH 
    257260endif 
    258261ifeq ($(CONFIG_WPS),y) 
  • src/router/services/networking/network.c

    r15011 r15102  
    967967        strcpy(mac, nvram_safe_get("et0macaddr")); 
    968968#elif HAVE_AP83 
     969        if (getSTA() || getWET() || CANBRIDGE()) { 
     970                nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 
     971                PORTSETUPWAN(""); 
     972        } else { 
     973                nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 
     974                PORTSETUPWAN("eth1"); 
     975        } 
     976        strncpy(ifr.ifr_name, "eth0", IFNAMSIZ); 
     977        ioctl(s, SIOCGIFHWADDR, &ifr); 
     978        nvram_set("et0macaddr", ether_etoa(ifr.ifr_hwaddr.sa_data, eabuf)); 
     979        strcpy(mac, nvram_safe_get("et0macaddr")); 
     980#elif HAVE_WZRHPAG300NH 
    969981        if (getSTA() || getWET() || CANBRIDGE()) { 
    970982                nvram_setz(lan_ifnames, "eth0 eth1 ath0"); 
  • src/router/services/sysinit/sysinit-wrt400.c

    r15069 r15102  
    149149        } 
    150150        detect_wireless_devices(); 
     151#ifdef HAVE_WZRHPAG300NH 
     152//      eval("ifconfig", "wifi1", "hw", "ether", wmac); 
     153        system2("echo 5 >/proc/sys/dev/wifi0/ledpin"); 
     154        system2("echo 1 >/proc/sys/dev/wifi0/softled"); 
     155        system2("echo 1 >/proc/sys/dev/wifi1/ledpin"); 
     156        system2("echo 1 >/proc/sys/dev/wifi1/softled"); 
     157 
     158#else 
     159 
     160 
    151161#ifndef HAVE_WNDR3700 
    152162        system2("echo 6 >/proc/sys/dev/wifi0/ledpin"); 
     
    161171        system2("echo 1 >/proc/sys/dev/wifi1/softled"); 
    162172#endif 
     173#endif 
    163174 
    164175        led_control(LED_POWER, LED_ON); 
  • src/router/services/sysinit/sysinit.c

    r15062 r15102  
    732732                {"lan_ifname", "br0", 0}, 
    733733                {"lan_ifnames", "eth0 eth1 ath0 ath1 ath2", 0}, 
     734                {"wan_ifname", "eth1", 0}, 
     735                {"wan_ifname2", "eth1", 0}, 
     736                {"wan_ifnames", "eth1", 0}, 
     737                {"wan_default", "eth1", 0}, 
     738                {0, 0, 0} 
     739        }; 
     740#elif HAVE_WZRHPAG300NH 
     741        struct nvram_tuple generic[] = { 
     742                {"lan_ifname", "br0", 0}, 
     743                {"lan_ifnames", "eth0 eth1 ath0 ath1", 0}, 
    734744                {"wan_ifname", "eth1", 0}, 
    735745                {"wan_ifname2", "eth1", 0}, 
Note: See TracChangeset for help on using the changeset viewer.