Changeset 13855


Ignore:
Timestamp:
02/05/10 12:09:10 (3 years ago)
Author:
BrainSlayer
Message:

TP-Link WR1043ND support

Location:
src/router
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/router/libutils/Makefile

    r13845 r13855  
    553553CFLAGS += -DHAVE_TG2521 
    554554endif 
     555ifeq ($(CONFIG_WR1043),y) 
     556CFLAGS += -DHAVE_WR1043 
     557endif 
    555558 
    556559 
  • src/router/libutils/utils.c

    r13851 r13855  
    27372737#ifndef HAVE_BUFFALO 
    27382738        case ROUTER_BOARD_PB42: 
     2739#ifdef HAVE_WR1043 
     2740                connected_gpio = 0x109; 
     2741                ses_gpio = 0x005; 
     2742                usb_gpio = 0x101; 
     2743#endif 
    27392744#ifdef HAVE_WRT160NL 
    27402745                power_gpio = 0x10e; 
  • src/router/rc/Makefile

    r13835 r13855  
    326326ifeq ($(CONFIG_TG2521),y) 
    327327CFLAGS += -DHAVE_TG2521 
     328endif 
     329ifeq ($(CONFIG_WR1043),y) 
     330CFLAGS += -DHAVE_WR1043 
    328331endif 
    329332ifeq ($(CONFIG_TEW632BRP),y) 
  • src/router/rc/resetbutton.c

    r13845 r13855  
    166166        return 0; 
    167167} 
     168#elif defined(HAVE_WR1043) 
     169int getbuttonstate() 
     170{ 
     171        int ret = get_gpio(3); 
     172 
     173        if (ret == 0) 
     174                return 1; 
     175        return 0; 
     176} 
    168177#elif defined(HAVE_WZRG300NH) 
    169178int getbuttonstate() 
     
    498507        sesgpio = 0x10c; 
    499508        val |= get_gpio(12) << 12;      //aoss pushbutton 
     509#elif defined(HAVE_WR1043) 
     510        sesgpio = 0x107; 
     511        val |= get_gpio(7) << 7;        //aoss pushbutton 
    500512#elif defined(HAVE_DIR825) 
    501513        sesgpio = 0x108; 
  • src/router/services/Makefile

    r13845 r13855  
    215215ifeq ($(CONFIG_TG2521),y) 
    216216CFLAGS_EXTRA += -DHAVE_TG2521 
     217endif 
     218ifeq ($(CONFIG_WR1043),y) 
     219CFLAGS_EXTRA += -DHAVE_WR1043 
    217220endif 
    218221 
  • src/router/services/sysinit/sysinit-ap83.c

    r13843 r13855  
    117117        unsigned char buf2[256]; 
    118118        fseek(fp, 0x1ff120c, SEEK_SET); 
     119        fread(buf2, 256, 1, fp); 
     120        fclose(fp); 
     121        char mac[32]; 
     122        unsigned int copy[256]; 
     123        int i; 
     124        for (i = 0; i < 256; i++) 
     125                copy[i] = buf2[i] & 0xff; 
     126        sprintf(mac, "%02x:%02x:%02x:%02x:%02x:%02x", 
     127                        copy[0], copy[1], 
     128                        copy[2], copy[3], 
     129                        copy[4], copy[5]); 
     130                fprintf(stderr, "configure eth0 to %s\n", mac); 
     131                eval("ifconfig", "eth0", "hw", "ether", mac); 
     132                fprintf(stderr, "configure eth1 to %s\n", mac); 
     133                eval("ifconfig", "eth1", "hw", "ether", mac); 
     134        } 
     135#endif 
     136#ifdef HAVE_WR1043 
     137        FILE *fp = fopen("/dev/mtdblock/0", "rb"); 
     138        if (fp) 
     139        { 
     140        unsigned char buf2[256]; 
     141        fseek(fp, 0x1fc00, SEEK_SET); 
    119142        fread(buf2, 256, 1, fp); 
    120143        fclose(fp); 
     
    284307        system2("echo 6 >/proc/sys/dev/wifi0/ledpin"); 
    285308        system2("echo 1 >/proc/sys/dev/wifi0/softled"); 
     309#elif HAVE_WR1043 
     310        system2("echo 9 >/proc/sys/dev/wifi0/ledpin"); 
     311        system2("echo 1 >/proc/sys/dev/wifi0/softled"); 
    286312#else 
    287313        system2("echo 2 >/proc/sys/dev/wifi0/ledpin"); 
Note: See TracChangeset for help on using the changeset viewer.