Changeset 13102

Show
Ignore:
Timestamp:
10/17/2009 07:25:18 PM (5 months ago)
Author:
BrainSlayer
Message:

WP543 support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/router/httpd/modules/callvalidate.c

    r12656 r13102  
    281281{ 
    282282        if (nvram_match("console_debug", "1")) 
     283                { 
    283284                fprintf(stderr, "call_ej %s\n", name); 
     285                int i=0; 
     286                for (i=0;i<argc;i++) 
     287                fprintf(stderr,"argument %s\n",argv[i]); 
     288                } 
    284289        char service[64]; 
    285290        int nohandle = 0; 
  • src/router/libutils/Makefile

    r13077 r13102  
    259259  CFLAGS += -DHAVE_LS2 
    260260endif 
     261ifeq ($(CONFIG_WP543),y) 
     262  CFLAGS += -DHAVE_WP543 
     263endif 
    261264CFLAGS += -DARCH_$(ARCHITECTURE) 
    262265ifeq ($(CONFIG_BWRG1000),y) 
  • src/router/libutils/shutils.c

    r12225 r13102  
    111111        } 
    112112#endif 
     113 
     114#ifndef HAVE_SILENCE 
     115                fprintf(stderr, "system: %s\n", command); 
     116#endif 
    113117        return system(command); 
    114118} 
     
    147151                fprintf(stderr, "\n"); 
    148152        } 
     153        #ifndef HAVE_SILENCE 
     154                int i = 0; 
     155 
     156                while (argv[i] != NULL) { 
     157                        fprintf(stderr, "%s ", argv[i++]); 
     158                } 
     159                fprintf(stderr, "\n"); 
     160         
     161        #endif 
    149162#endif 
    150163 
  • src/router/libutils/utils.c

    r13088 r13102  
    898898        setRouter("Atheros AP83"); 
    899899        return ROUTER_BOARD_PB42; 
     900#elif HAVE_WP543 
     901        setRouter("Compex WP543"); 
     902        return ROUTER_BOARD_PB42; 
    900903#elif HAVE_LSX 
    901904        setRouter("Ubiquiti Litestation-SR71"); 
  • src/router/rc/Makefile

    r13083 r13102  
    2222else 
    2323LDFLAGS += -L$(TOP)/nvram -I$(LINUXDIR) -L$(INSTALLDIR)/nvram/usr/lib -lnvram -L$(TOP)/libutils -lutils  -ldl 
    24 CFLAGS += -I$(LINUXDIR) -I$(TOP)/libutils  
     24CFLAGS += -I$(LINUXDIR) -I$(TOP)/libutils -fpic 
    2525 
    2626ifneq ($(ARCHITECTURE),lsx) 
    27 CFLAGS += -fpic -ffunction-sections -fdata-sections -Wl,--gc-sections 
     27CFLAGS += -ffunction-sections -fdata-sections -Wl,--gc-sections 
     28endif 
     29ifeq ($(ARCHITECTURE),lsx) 
     30CFLAGS += -fomit-frame-pointer  
    2831endif 
    2932endif 
  • src/router/rc/init.c

    r12905 r13102  
    397397         * Basic initialization  
    398398         */ 
    399 #ifdef HAVE_LSX 
    400         sysprintf("echo \"trigger console\" > /dev/console"); 
    401 #endif 
    402         cprintf("console init\n"); 
    403399        if (console_init()) 
    404400                noconsole = 1; 
     
    407403        cprintf("first message\n"); 
    408404        lcdmessage("System Start"); 
    409         cprintf("start service\n"); 
     405        fprintf(stderr,"start service\n"); 
    410406        fprintf(stderr, "starting Architecture code for " ARCHITECTURE "\n"); 
    411407        start_service("sysinit"); 
  • src/router/services/Makefile

    r13077 r13102  
    542542ifeq ($(CONFIG_WP54G),y) 
    543543CFLAGS_EXTRA += -DHAVE_WP54G 
     544endif 
     545ifeq ($(CONFIG_WP543),y) 
     546CFLAGS_EXTRA += -DHAVE_WP543 
    544547endif 
    545548ifeq ($(CONFIG_NP28G),y) 
  • src/router/services/sysinit/sysinit-lsx.c

    r12637 r13102  
    127127        for (i = 0; i < 256; i++) 
    128128                copy[i] = buf2[i] & 0xff; 
    129         for (i = 0; i < 256 - 10; i++) { 
     129        for (i = 0; i < 256 - 12; i++) { 
    130130                if (!strncmp(&buf2[i], "ar7100_esa", 10)) { 
    131131                        offsetmac1 = i + 11; 
     
    164164                eval("ifconfig", "eth1", "hw", "ether", mac); 
    165165        } 
     166 
     167        fp = fopen("/dev/mtdblock/0", "r"); 
     168        if (fp) { 
     169                fseek(fp, 0x1f800, SEEK_SET); 
     170                unsigned int signature; 
     171 
     172                fread(&signature, 4, 1, fp); 
     173                if (signature == 0x20021103) { 
     174                        fprintf(stderr, "Compex WP543 detected\n"); 
     175                        eval("ifconfig", "eth0", "0.0.0.0", "down"); 
     176                        eval("ifconfig", "eth1", "0.0.0.0", "down"); 
     177                        unsigned char buf[16]; 
     178 
     179                        fseek(fp, 0x1f810, SEEK_SET); 
     180                        fread(&buf[0], 6, 1, fp); 
     181                        char mac[16]; 
     182                        int i; 
     183 
     184                        unsigned int copy[16]; 
     185 
     186                        for (i = 0; i < 12; i++) 
     187                                copy[i] = buf[i] & 0xff; 
     188 
     189                        sprintf(mac, "%02X:%02X:%02X:%02X:%02X:%02X", copy[0], 
     190                                copy[1], copy[2], copy[3], copy[4], copy[5]); 
     191                        fprintf(stderr, "configure ETH0 to %s\n", mac); 
     192                        nvram_set("et0macaddr_safe",mac); 
     193                        eval("ifconfig", "eth0", "hw", "ether", mac); 
     194                        fseek(fp, 0x1f818, SEEK_SET); 
     195                        fread(&buf[6], 6, 1, fp); 
     196                        for (i = 0; i < 12; i++) 
     197                                copy[i] = buf[i] & 0xff; 
     198                        sprintf(mac, "%02X:%02X:%02X:%02X:%02X:%02X", copy[6], 
     199                                copy[7], copy[8], copy[9], copy[10], copy[11]); 
     200                        fprintf(stderr, "configure ETH1 to %s\n", mac); 
     201                        eval("ifconfig", "eth1", "hw", "ether", mac); 
     202                        /* disable led's */ 
     203                        eval("gpio","disable","3"); // 1 
     204                        eval("gpio","disable","4"); // 2 
     205                        eval("gpio","disable","5"); //wlan 
     206                        eval("gpio","disable","6"); //conn 
     207                        eval("gpio","disable","7"); //diag 
     208 
     209 
     210                } 
     211                fclose(fp); 
     212        } 
     213 
     214 
     215 
     216 
    166217//#endif 
    167218        eval("ifconfig", "eth0", "up"); 
     
    202253        system2("echo 2 >/proc/sys/dev/wifi2/ledpin"); 
    203254        system2("echo 1 >/proc/sys/dev/wifi2/softled"); 
     255#elif HAVE_WP543 
     256        system2("echo 5 >/proc/sys/dev/wifi0/ledpin"); 
     257        system2("echo 1 >/proc/sys/dev/wifi0/softled"); 
    204258#else 
    205259        system2("echo 2 >/proc/sys/dev/wifi0/ledpin");