Changeset 11165
- Timestamp:
- 12/11/08 00:54:45 (4 years ago)
- Location:
- src/router
- Files:
-
- 16 edited
-
httpd/Makefile (modified) (1 diff)
-
httpd/modules/callvalidate.c (modified) (1 diff)
-
libutils/Makefile (modified) (1 diff)
-
libutils/gpio.c (modified) (1 diff)
-
libutils/utils.c (modified) (2 diffs)
-
rc/Makefile (modified) (1 diff)
-
rc/resetbutton.c (modified) (6 diffs)
-
services/Makefile (modified) (1 diff)
-
services/networking/interface.c (modified) (1 diff)
-
services/networking/network.c (modified) (3 diffs)
-
services/networking/wshaper.c (modified) (1 diff)
-
services/sysinit/defaults.c (modified) (1 diff)
-
services/sysinit/sysinit-adm5120.c (modified) (5 diffs)
-
services/sysinit/sysinit-rt2880.c (modified) (1 diff)
-
services/sysinit/sysinit.c (modified) (1 diff)
-
shared/utils.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/router/httpd/Makefile
r11096 r11165 495 495 CFLAGS += -DHAVE_STORM 496 496 endif 497 ifeq ($(CONFIG_WP54G),y) 498 CFLAGS += -DHAVE_WP54G 499 endif 497 500 ifeq ($(CONFIG_ADM5120),y) 498 501 CFLAGS += -DHAVE_ADM5120 -
src/router/httpd/modules/callvalidate.c
r10750 r11165 61 61 // #include <shutils.h> 62 62 63 #if def HAVE_ADM512063 #if defined(HAVE_ADM5120) && !defined(HAVE_WP54G) 64 64 #define SERVICE_MODULE "/lib/validate.so" 65 65 #define VISSERVICE_MODULE "/lib/visuals.so" -
src/router/libutils/Makefile
r11160 r11165 195 195 CFLAGS += -DHAVE_PS5 196 196 endif 197 ifeq ($(CONFIG_WP54G),y) 198 CFLAGS += -DHAVE_WP54G 199 endif 197 200 ifeq ($(CONFIG_ADM5120),y) 198 201 CFLAGS += -DHAVE_ADM5120 -
src/router/libutils/gpio.c
r10775 r11165 19 19 #include <errno.h> 20 20 21 #if defined(HAVE_AR531X) || defined(HAVE_LSX) || defined(HAVE_DANUBE) 21 #if defined(HAVE_AR531X) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_ADM5120) 22 22 23 23 void set_gpio( int gpio, int value ) -
src/router/libutils/utils.c
r11160 r11165 462 462 return 0; 463 463 #else 464 #ifdef HAVE_ADM5120 464 #ifdef HAVE_WP54G 465 setRouter( "Compex WP54G" ); 466 return ROUTER_BOARD_WP54G; 467 #elif HAVE_ADM5120 465 468 setRouter( "Tonze AP-120" ); 466 469 return ROUTER_BOARD_ADM5120; … … 2555 2558 connected_gpio = 0x10; 2556 2559 break; 2560 case ROUTER_BOARD_WP54G: 2561 diag_gpio = 0x12; 2562 connected_gpio = 0x17; 2563 break; 2557 2564 case ROUTER_BOARD_GATEWORX: 2558 2565 connected_gpio = 0x3; -
src/router/rc/Makefile
r11137 r11165 240 240 ifeq ($(CONFIG_ADM5120),y) 241 241 CFLAGS += -DHAVE_ADM5120 242 endif 243 ifeq ($(CONFIG_WP54G),y) 244 CFLAGS += -DHAVE_WP54G 242 245 endif 243 246 ifeq ($(CONFIG_TW6600),y) -
src/router/rc/resetbutton.c
r11157 r11165 94 94 #endif 95 95 96 #if defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) 96 #if defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) || defined(HAVE_WP54G) 97 97 int getbuttonstate( ) 98 98 { … … 100 100 int ret = get_gpio( 5 ); 101 101 return 1-ret; 102 #elif HAVE_WP54G 103 int ret = get_gpio( 4 ); 104 return ret; 102 105 #else 103 106 int ret = get_gpio( 6 ); … … 111 114 int ret = get_gpio( 8 ); 112 115 113 /* 114 * in = fopen ("/proc/simple_config/push_button", "rb"); if (in == NULL) 115 * return 0; fscanf (in, "%d", &ret); fclose (in); 116 */ 116 117 117 if( ret == 0 ) 118 118 return 1; … … 342 342 // DEBUG("resetbutton: now time=%d\n", t); 343 343 344 #if defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_GATEWORX) || defined(HAVE_STORM) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) || defined(HAVE_LSX) 344 #if defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_GATEWORX) || defined(HAVE_STORM) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_WP54G) 345 345 val = getbuttonstate( ); 346 346 #ifdef HAVE_WRK54G … … 395 395 int state = 0; 396 396 397 #if defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_GATEWORX) || defined(HAVE_STORM) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) || defined(HAVE_LSX) 397 #if defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_GATEWORX) || defined(HAVE_STORM) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_WP54G) 398 398 state = val; 399 399 #else … … 570 570 } 571 571 } 572 #if !defined(HAVE_XSCALE) && !defined(HAVE_MAGICBOX) && !defined(HAVE_FONERA) && !defined(HAVE_WHRAG108) && !defined(HAVE_GATEWORX) && !defined(HAVE_STORM) && !defined(HAVE_LS2) && !defined(HAVE_CA8) && !defined(HAVE_TW6600) && !defined(HAVE_LS5) && !defined(HAVE_LSX) 572 #if !defined(HAVE_XSCALE) && !defined(HAVE_MAGICBOX) && !defined(HAVE_FONERA) && !defined(HAVE_WHRAG108) && !defined(HAVE_GATEWORX) && !defined(HAVE_STORM) && !defined(HAVE_LS2) && !defined(HAVE_CA8) && !defined(HAVE_TW6600) && !defined(HAVE_LS5) && !defined(HAVE_LSX) && !defined(HAVE_WP54G) 573 573 574 574 else if( ( sesgpio != 0xff ) -
src/router/services/Makefile
r11158 r11165 411 411 CFLAGS += -DHAVE_ADM5120 412 412 endif 413 ifeq ($(CONFIG_WP54G),y) 414 CFLAGS += -DHAVE_WP54G 415 endif 413 416 ifeq ($(CONFIG_TW6600),y) 414 417 CFLAGS += -DHAVE_TW6600 -
src/router/services/networking/interface.c
r11003 r11165 557 557 nvram_safe_get( "wan_ifnames" ) ); 558 558 #elif HAVE_ADM5120 559 snprintf( all_ifnames, 255, "%s %s %s", "eth0 ",559 snprintf( all_ifnames, 255, "%s %s %s", "eth0 eth1", 560 560 nvram_safe_get( "lan_ifnames" ), 561 561 nvram_safe_get( "wan_ifnames" ) ); -
src/router/services/networking/network.c
r11161 r11165 997 997 #endif 998 998 #ifdef HAVE_ADM5120 999 1000 if (getRouterBrand() == ROUTER_BOARD_WP54G) 1001 { 1002 if( getSTA( ) || getWET( ) || nvram_match( "wan_proto", "disabled" ) ) 1003 { 1004 nvram_set( "lan_ifname", "br0" ); 1005 nvram_set( "lan_ifnames", "eth0 eth1 ath0" ); 1006 PORTSETUPWAN( "" ); 1007 } 1008 else 1009 { 1010 nvram_set( "lan_ifname", "br0" ); 1011 nvram_set( "lan_ifnames", "eth0 eth1 ath0" ); 1012 PORTSETUPWAN( "eth0" ); 1013 } 1014 }else 1015 { 1016 999 1017 if( getSTA( ) || getWET( ) || nvram_match( "wan_proto", "disabled" ) ) 1000 1018 { … … 1009 1027 PORTSETUPWAN( "eth0" ); 1010 1028 } 1029 } 1030 1011 1031 strncpy( ifr.ifr_name, "eth0", IFNAMSIZ ); 1012 1032 ioctl( s, SIOCGIFHWADDR, &ifr ); … … 2837 2857 fp = fopen( "/tmp/ppp/options.pppoe", "w" ); 2838 2858 // rp-pppoe kernelmode plugin 2839 #if def HAVE_ADM51202859 #if defined(HAVE_ADM5120) && !defined(HAVE_WP54G) 2840 2860 fprintf( fp, "plugin /lib/rp-pppoe.so" ); 2841 2861 #else -
src/router/services/networking/wshaper.c
r11158 r11165 693 693 #elif HAVE_ADM5120 694 694 ret = eval( script_name, "stop", "XX", "eth0" ); 695 ret = eval( script_name, "stop", "XX", "eth1" ); 695 696 ret = eval( script_name, "stop", "XX", "ath0" ); 696 697 #elif HAVE_TW6600 -
src/router/services/sysinit/defaults.c
r11154 r11165 281 281 #elif HAVE_STORM 282 282 {"wan_proto", "disabled", 0}, /* [static|dhcp|pppoe|disabled] */ 283 #elif HAVE_WP54G 284 {"wan_proto", "dhcp", 0}, /* [static|dhcp|pppoe|disabled] */ 283 285 #elif HAVE_ADM5120 284 286 {"wan_proto", "disabled", 0}, /* [static|dhcp|pppoe|disabled] */ -
src/router/services/sysinit/sysinit-adm5120.c
r10736 r11165 67 67 return value; 68 68 } 69 struct mylo_eth_addr { 70 uint8_t mac[6]; 71 uint8_t csum[2]; 72 }; 73 74 struct mylo_board_params { 75 uint32_t magic; /* must be MYLO_MAGIC_BOARD_PARAMS */ 76 uint32_t res0; 77 uint32_t res1; 78 uint32_t res2; 79 struct mylo_eth_addr addr[8]; 80 }; 69 81 70 82 void start_change_mac(void) … … 174 186 * load some netfilter stuff 175 187 */ 176 188 #ifndef HAVE_WP54G 177 189 insmod( "nf_conntrack_ftp" ); 178 190 insmod( "nf_conntrack_irc" ); … … 222 234 insmod( "pppox" ); 223 235 insmod( "pppoe" ); 224 236 #endif 225 237 insmod( "adm5120_wdt" ); 226 238 insmod( "adm5120sw" ); 239 240 if (getRouterBrand() != ROUTER_BOARD_WP54G) 241 { 242 227 243 unsigned char mac[6]; 228 244 char eabuf[32]; … … 324 340 fclose( fp ); 325 341 } 342 }else 343 { 344 struct mylo_board_params params; 345 char mtdpath[32]; 346 FILE *fp; 347 int mtd = getMTD( "boot" ); 348 int foundmac = 0; 349 struct ifreq ifr; 350 int s; 351 char eabuf[32]; 352 353 sprintf( mtdpath, "/dev/mtdblock/%d", mtd ); 354 fp = fopen( mtdpath, "rb" ); 355 if( fp != NULL ) 356 { 357 fseek(fp,0xf800,SEEK_SET); 358 fread(¶ms,sizeof(params),1,fp); 359 fclose(fp); 360 if (params.magic == 0x20021103) 361 { 362 fprintf(stderr,"Found compex board magic!\n"); 363 if( ( s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ) ) ) 364 { 365 strncpy( ifr.ifr_name, "eth0", IFNAMSIZ ); 366 ioctl( s, SIOCGIFHWADDR, &ifr ); 367 memcpy( ( unsigned char * )ifr.ifr_hwaddr.sa_data, params.addr[0].mac, 6 ); 368 ioctl( s, SIOCSIFHWADDR, &ifr ); 369 close( s ); 370 } 371 if( ( s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ) ) ) 372 { 373 strncpy( ifr.ifr_name, "eth1", IFNAMSIZ ); 374 ioctl( s, SIOCGIFHWADDR, &ifr ); 375 memcpy( ( unsigned char * )ifr.ifr_hwaddr.sa_data, params.addr[1].mac, 6 ); 376 ioctl( s, SIOCSIFHWADDR, &ifr ); 377 close( s ); 378 } 379 if( ( s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ) ) ) 380 { 381 strncpy( ifr.ifr_name, "eth0", IFNAMSIZ ); 382 ioctl( s, SIOCGIFHWADDR, &ifr ); 383 nvram_set( "et0macaddr_safe", 384 ether_etoa( ( unsigned char * )ifr.ifr_hwaddr. 385 sa_data, eabuf ) ); 386 close( s ); 387 } 388 389 } 390 } 391 } 326 392 /* 327 393 * network drivers … … 355 421 { 356 422 } 357 void enable_dtag_vlan( int enable ) 358 { 359 360 } 423 424 char *enable_dtag_vlan( int enable ) 425 { 426 return "eth2"; 427 } -
src/router/services/sysinit/sysinit-rt2880.c
r11158 r11165 1 1 /* 2 * sysinit- adm5120.c2 * sysinit-rt2880.c 3 3 * 4 4 * Copyright (C) 2008 Sebastian Gottschall <gottschall@dd-wrt.com> -
src/router/services/sysinit/sysinit.c
r11162 r11165 395 395 {"wan_ifnames", "", 0}, 396 396 {"wan_default", "", 0}, 397 {0, 0, 0} 398 }; 399 #elif HAVE_WP54G 400 struct nvram_tuple generic[] = { 401 {"lan_ifname", "br0", 0}, 402 {"lan_ifnames", "eth1 ath0", 0}, 403 {"wan_ifname", "eth0", 0}, 404 {"wan_ifname2", "eth0", 0}, 405 {"wan_ifnames", "eth0", 0}, 406 {"wan_default", "eth0", 0}, 397 407 {0, 0, 0} 398 408 }; -
src/router/shared/utils.h
r11160 r11165 378 378 #define ROUTER_BOARD_ECB9750 0x6906 379 379 380 380 // Compex WP54G (and compatible) 381 #define ROUTER_BOARD_WP54G 0x7004 381 382 382 383 #define NVROUTER "DD_BOARD"
Note: See TracChangeset
for help on using the changeset viewer.
