Changeset 10747
- Timestamp:
- 11/04/08 22:40:23 (5 years ago)
- Location:
- src/router
- Files:
-
- 1 added
- 9 edited
-
httpd/modules/upgrade.c (modified) (2 diffs)
-
httpd/validate/webs.c (modified) (2 diffs)
-
httpd/visuals/dd-wrt.c (modified) (2 diffs)
-
libutils/utils.c (modified) (5 diffs)
-
libutils/wl.c (modified) (5 diffs)
-
services/Makefile (modified) (2 diffs)
-
services/networking/firewall.c (modified) (3 diffs)
-
services/networking/network.c (modified) (32 diffs)
-
services/networking/rt2880.c (added)
-
services/services/services.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/router/httpd/modules/upgrade.c
r10356 r10747 97 97 #elif HAVE_LS2 98 98 write_argv[2] = "linux"; 99 #elif HAVE_RT2880 100 write_argv[2] = "linux"; 99 101 #elif HAVE_USR5453 100 102 write_argv[2] = "rootfs"; … … 149 151 #elif HAVE_LS2 150 152 eval( "fischecksum" ); 153 if( url ) 154 return eval( "write", url, "linux" ); 155 #elif HAVE_RT2880 151 156 if( url ) 152 157 return eval( "write", url, "linux" ); -
src/router/httpd/validate/webs.c
r10725 r10747 2585 2585 char *ifname = "wl0"; 2586 2586 2587 #ifndef HAVE_RT2880 2588 2587 2589 if( !strcmp( prefix, "wl0" ) ) 2588 2590 ifname = get_wl_instance_name( 0 ); … … 2591 2593 else 2592 2594 ifname = prefix; 2595 #endif 2593 2596 copytonv( wp, "%s_multicast", ifname ); 2594 2597 copytonv( wp, "%s_bridged", ifname ); -
src/router/httpd/visuals/dd-wrt.c
r10733 r10747 321 321 { 322 322 websWrite( wp, "300" ); 323 /* 324 * FILE *fp = fopen ("/proc/cpuinfo", "rb"); if (fp == NULL) { websWrite 325 * (wp, "unknown"); return; } int cnt = 0; int b = 0; while (b != EOF) { 326 * b = getc (fp); if (b == ':') cnt++; if (cnt == 2) { getc (fp); char 327 * cpuclk[4]; cpuclk[0] = getc (fp); cpuclk[1] = getc (fp); cpuclk[2] = 328 * getc (fp); cpuclk[3] = 0; websWrite (wp, cpuclk); fclose (fp); return; 329 * } } 330 * 331 * fclose (fp); websWrite (wp, "unknown"); 332 */ 333 return; 334 } 335 #elif HAVE_RT2880 336 void ej_get_clkfreq( webs_t wp, int argc, char_t ** argv ) 337 { 338 websWrite( wp, "384" ); 323 339 /* 324 340 * FILE *fp = fopen ("/proc/cpuinfo", "rb"); if (fp == NULL) { websWrite … … 4123 4139 #ifdef HAVE_MADWIFI 4124 4140 showbridgesettings( wp, prefix, 1 ); 4141 #elif HAVE_RT2880 4142 showbridgesettings( wp, "wl0", 1 ); 4125 4143 #else 4126 4144 if( !strcmp( prefix, "wl0" ) ) -
src/router/libutils/utils.c
r10744 r10747 377 377 int check_vlan_support( void ) 378 378 { 379 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) 379 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) || defined(HAVE_RT2880) 380 380 return 0; 381 381 #else … … 1717 1717 { 1718 1718 1719 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_FONERA) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) 1719 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_FONERA) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) || defined(HAVE_RT2880) 1720 1720 return 0; 1721 1721 #else … … 1744 1744 int C_led_4702( int i ) 1745 1745 { 1746 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) 1746 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) || defined(HAVE_RT2880) 1747 1747 return 0; 1748 1748 #else … … 1822 1822 int diag_led_4704( int type, int act ) 1823 1823 { 1824 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI)|| defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) 1824 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA) || defined(HAVE_MERAKI)|| defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) || defined(HAVE_RT2880) 1825 1825 return 0; 1826 1826 #else … … 1876 1876 unsigned int control, in, outen, out, ctr_mask, out_mask; 1877 1877 1878 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA)|| defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) 1878 #if defined(HAVE_GEMTEK) || defined(HAVE_RB500) || defined(HAVE_XSCALE) || defined(HAVE_MAGICBOX) || defined(HAVE_FONERA)|| defined(HAVE_MERAKI) || defined(HAVE_LS2) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_PB42) || defined(HAVE_LS5) || defined(HAVE_LSX) || defined(HAVE_DANUBE) || defined(HAVE_STORM) || defined(HAVE_ADM5120) || defined(HAVE_RT2880) 1879 1879 return 0; 1880 1880 #else -
src/router/libutils/wl.c
r10537 r10747 31 31 32 32 #ifndef HAVE_MADWIFI 33 34 #ifdef HAVE_RT2880 35 int getchannels( unsigned int *list, char *ifname ) 36 { 37 list[0]=1; 38 list[1]=2; 39 list[2]=3; 40 list[3]=4; 41 list[4]=5; 42 list[5]=6; 43 list[6]=7; 44 list[7]=8; 45 list[8]=9; 46 list[9]=10; 47 list[10]=11; 48 list[11]=12; 49 list[12]=13; 50 return 13; 51 } 52 #else 33 53 int getchannels( unsigned int *list, char *ifname ) 34 54 { … … 62 82 #endif 63 83 } 64 84 #endif 65 85 int wl_getbssid( char *wl, char *mac ) 66 86 { … … 1057 1077 #endif 1058 1078 1079 1080 1081 #ifdef HAVE_RT2880 1082 char *get_wl_instance_name( int instance ) 1083 { 1084 return "ra0"; 1085 } 1086 int get_wl_instances( void ) 1087 { 1088 return 1; 1089 } 1090 1091 int get_wl_instance( char *name ) 1092 { 1093 return 1; 1094 } 1095 1096 1097 1098 #else 1059 1099 char *get_wl_instance_name( int instance ) 1060 1100 { … … 1097 1137 return ret; 1098 1138 } 1099 1139 #endif 1100 1140 /* 1101 1141 * return wireless interface … … 1110 1150 return "ath0"; 1111 1151 } 1152 #elif HAVE_RT2880 1153 return "ra0"; 1112 1154 #else 1113 1155 if( !wl_probe( "eth1" ) ) -
src/router/services/Makefile
r10744 r10747 97 97 ifeq ($(CONFIG_WPA_SUPPLICANT),y) 98 98 ifneq ($(CONFIG_MADWIFI),y) 99 ifneq ($(CONFIG_RT2880),y) 99 100 CFLAGS += -DHAVE_WPA_SUPPLICANT 100 101 OBJS += brcm_80211x.o 101 102 endif 102 103 endif 104 endif 103 105 ifeq ($(CONFIG_WPA_SUPPLICANT2),y) 104 106 ifneq ($(CONFIG_MADWIFI),y) 107 ifneq ($(CONFIG_RT2880),y) 105 108 CFLAGS += -DHAVE_WPA_SUPPLICANT 106 109 OBJS += brcm_80211x.o 110 endif 107 111 endif 108 112 endif … … 253 257 CFLAGS += -DHAVE_HEARTBEAT 254 258 OBJS += heartbeat.o 259 endif 260 261 ifeq ($(CONFIG_RT2880),y) 262 OBJS += rt2880.o 255 263 endif 256 264 -
src/router/services/networking/firewall.c
r10744 r10747 743 743 char var[80]; 744 744 745 /*746 * #ifdef HAVE_MSSID747 *748 * #ifdef HAVE_MADWIFI int i;749 *750 * char wifivifs[16]; int devcount = getdevicecount (); for (i =751 * 0; i < devcount; i++) { sprintf (wifivifs, "ath%d_vifs", i);752 * if (nvram_nmatch ("0", "ath%d_bridged", i)) { save2file ("-A753 * POSTROUTING -o ath%d -m pkttype --pkt-type broadcast -j754 * RETURN\n", i); save2file ("-A POSTROUTING -o ath%d -s %s/%d -d755 * %s/%d -j MASQUERADE\n", i, nvram_nget ("ath%d_ipaddr", i),756 * getmask (nvram_nget ("ath%d_netmask", i)), nvram_nget757 * ("ath%d_ipaddr", i), getmask (nvram_nget ("ath%d_netmask",758 * i))); } char *vifs = nvram_safe_get (wifivifs); if (vifs !=759 * NULL) foreach (var, vifs, next) { if (nvram_nmatch ("0",760 * "%s_bridged", var)) { save2file ("-A POSTROUTING -o %s -m761 * pkttype --pkt-type broadcast -j RETURN\n", var); save2file762 * ("-A POSTROUTING -o %s -s %s/%d -d %s/%d -j MASQUERADE\n",763 * var, nvram_nget ("%s_ipaddr", var), getmask (nvram_nget764 * ("%s_netmask", var)), nvram_nget ("%s_ipaddr", var), getmask765 * (nvram_nget ("%s_netmask", var))); } } } #else int i; char766 * wifivifs[16]; int devcount = get_wl_instances (); for (i = 0;767 * i < devcount; i++) { sprintf (wifivifs, "wl%d_vifs", i); char768 * *iname = get_wl_instance_name (i); if (nvram_nmatch ("0",769 * "%s_bridged", iname)) { save2file ("-A POSTROUTING -o %s -m770 * pkttype --pkt-type broadcast -j RETURN\n", iname); save2file771 * ("-A POSTROUTING -o %s -s %s/%d -d %s/%d -j MASQUERADE\n",772 * iname, nvram_nget ("%s_ipaddr", iname), getmask (nvram_nget773 * ("%s_netmask", iname)), nvram_nget ("%s_ipaddr", iname),774 * getmask (nvram_nget ("%s_netmask", iname))); } char *vifs =775 * nvram_safe_get (wifivifs); if (vifs != NULL) foreach (var,776 * vifs, next) { if (nvram_nmatch ("0", "%s_bridged", var)) {777 * save2file ("-A POSTROUTING -o %s -m pkttype --pkt-type778 * broadcast -j RETURN\n", var); save2file ("-A POSTROUTING -o %s779 * -s %s/%d -d %s/%d -j MASQUERADE\n", var, nvram_nget780 * ("%s_ipaddr", var), getmask (nvram_nget ("%s_netmask", var)),781 * nvram_nget ("%s_ipaddr", var), getmask (nvram_nget782 * ("%s_netmask", var))); } } } #endif783 *784 *785 * #endif786 */787 745 char vifs[256]; 788 746 … … 1947 1905 char var[80]; 1948 1906 1949 #ifdef HAVE_MSSID1950 1951 /*1952 * #ifdef HAVE_MADWIFI int i;1953 *1954 * char wifivifs[16]; int devcount = getdevicecount (); for (i = 0; i <1955 * devcount; i++) { sprintf (wifivifs, "ath%d_vifs", i); if (nvram_nmatch1956 * ("0", "ath%d_bridged", i)) { save2file ("-A INPUT -i ath%d -j1957 * ACCEPT\n", i); } char *vifs = nvram_safe_get (wifivifs); if (vifs !=1958 * NULL) foreach (var, vifs, next) { if (nvram_nmatch ("0", "%s_bridged",1959 * var)) { save2file ("-A INPUT -i %s -j ACCEPT\n", var); } } } #else int1960 * i; char wifivifs[16]; int devcount = get_wl_instances (); for (i = 0;1961 * i < devcount; i++) { sprintf (wifivifs, "wl%d_vifs", i); char *iname =1962 * get_wl_instance_name (i); if (nvram_nmatch ("0", "%s_bridged", iname))1963 * { save2file ("-A INPUT -i %s -j ACCEPT\n", iname); } char *vifs =1964 * nvram_safe_get (wifivifs); if (vifs != NULL) foreach (var, vifs, next)1965 * { if (nvram_nmatch ("0", "%s_bridged", var)) { save2file ("-A INPUT -i1966 * %s -j ACCEPT\n", var); } } } #endif1967 */1968 1969 #endif1970 1907 char vifs[256]; 1971 1908 … … 2021 1958 char var[80]; 2022 1959 2023 /*2024 * #ifdef HAVE_MSSID2025 *2026 * #ifdef HAVE_MADWIFI int i; char wifivifs[16]; int devcount =2027 * getdevicecount (); for (i = 0; i < devcount; i++) { sprintf (wifivifs,2028 * "ath%d_vifs", i); if (nvram_nmatch ("0", "ath%d_bridged", i)) {2029 * save2file ("-A FORWARD -i ath%d -j ACCEPT\n", i); } char *vifs =2030 * nvram_safe_get (wifivifs); if (vifs != NULL) foreach (var, vifs, next)2031 * { if (nvram_nmatch ("0", "%s_bridged", var)) { save2file ("-A FORWARD2032 * -i %s -j ACCEPT\n", var); } } } #else int i; char wifivifs[16]; int2033 * devcount = get_wl_instances (); for (i = 0; i < devcount; i++) {2034 * sprintf (wifivifs, "wl%d_vifs", i); char *iname = get_wl_instance_name2035 * (i); if (nvram_nmatch ("0", "%s_bridged", iname)) { save2file ("-A2036 * FORWARD -i %s -j ACCEPT\n", iname); } char *vifs = nvram_safe_get2037 * (wifivifs); if (vifs != NULL) foreach (var, vifs, next) { if2038 * (nvram_nmatch ("0", "%s_bridged", var)) { save2file ("-A FORWARD -i %s2039 * -j ACCEPT\n", var); } } } #endif2040 *2041 *2042 * #endif2043 */2044 1960 char vifs[256]; // 2045 1961 -
src/router/services/networking/network.c
r10744 r10747 341 341 342 342 #ifndef HAVE_MADWIFI 343 #ifndef HAVE_RT2880 343 344 static int notify_nas( char *type, char *ifname, char *action ); 345 #endif 344 346 #endif 345 347 … … 455 457 int phytype, gmode, val, ret; 456 458 457 #if def HAVE_MADWIFI459 #if defined(HAVE_MADWIFI) || defined(HAVE_RT2880) 458 460 return -1; 459 461 #endif … … 654 656 } 655 657 #ifdef HAVE_MSSID 656 #if ndef HAVE_MADWIFI658 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 657 659 eval( "wl", "-i", name, "vlan_mode", "0" ); 658 660 char ifinst[32]; … … 1332 1334 diag_led( DIAG, STOP_LED ); // stop that blinking 1333 1335 strcpy( wl_face, get_wdev( ) ); 1334 #if def HAVE_MADWIFI1336 #if defined(HAVE_MADWIFI) || defined(HAVE_RT2880) 1335 1337 #ifndef HAVE_NOWIFI 1336 1338 deconfigure_wifi( ); … … 1348 1350 cprintf( "configure wl_face %s\n", wl_face ); 1349 1351 ifconfig( wl_face, 0, 0, 0 ); 1350 #if ndef HAVE_MADWIFI1352 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1351 1353 1352 1354 if( nvram_match( "mac_clone_enable", "1" ) && … … 1447 1449 */ 1448 1450 1449 #if ndef HAVE_MADWIFI1451 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1450 1452 strncpy( ifr.ifr_name, lan_ifname, IFNAMSIZ ); 1451 1453 if( ioctl( s, SIOCGIFHWADDR, &ifr ) == 0 && … … 1472 1474 * If not a wl i/f then simply add it to the bridge 1473 1475 */ 1474 #if ndef HAVE_MADWIFI1476 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1475 1477 if( wlconf_up( name ) ) 1476 1478 { … … 1491 1493 ifr.ifr_hwaddr.sa_data ); 1492 1494 1493 #ifndef HAVE_MADWIFI1494 1495 } 1495 1496 else … … 1520 1521 } 1521 1522 1522 #endif1523 #ifdef HAVE_MSSID1524 /*1525 * char tmac[16]; sprintf (tmac, "%s_hwaddr", "wl0");1526 * nvram_set (tmac, mac);1527 *1528 * char *next2; char var[80]; char *vifs = nvram_safe_get1529 * ("wl0_vifs"); if (vifs != NULL) foreach (var, vifs, next2)1530 * { sprintf (tmac, "%s_hwaddr", var); MAC_ADD (mac);1531 * nvram_set (tmac, mac); ether_atoe (mac,1532 * ifr.ifr_hwaddr.sa_data); ifr.ifr_hwaddr.sa_family =1533 * ARPHRD_ETHER; strncpy (ifr.ifr_name, var, IFNAMSIZ); if1534 * (ioctl (s, SIOCSIFHWADDR, &ifr) == -1) perror ("Write1535 * wireless mac fail : "); else cprintf ("Write wireless mac1536 * successfully\n"); }1537 */1538 #endif1539 1540 1523 #else 1541 1524 cprintf( "configure %s\n", name ); … … 1555 1538 int unit; 1556 1539 1557 #ifndef HAVE_MADWIFI 1540 #if defined(HAVE_MADWIFI) || defined(HAVE_RT2880) 1541 unit = 0; 1542 #else 1558 1543 wl_ioctl( name, WLC_GET_INSTANCE, &unit, sizeof( unit ) ); 1559 #else1560 unit = 0;1561 1544 #endif 1562 1545 snprintf( wl_name, sizeof( wl_name ), "wl%d_mode", unit ); … … 1613 1596 if( nvram_match( wl_name, "apsta" ) ) 1614 1597 { 1615 #if ndef HAVE_MADWIFI1598 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1616 1599 // eval ("wl", "ap", "0"); 1617 1600 eval( "wl", "-i", name, "ap", "0" ); … … 1623 1606 // eval("wlconf", name, "up"); 1624 1607 ifconfig( name, IFUP | IFF_ALLMULTI, NULL, NULL ); 1625 #if ndef HAVE_MADWIFI1608 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1626 1609 // eval ("wl", "ap", "0"); 1627 1610 eval( "wl", "-i", name, "ap", "0" ); … … 1648 1631 if( nvram_match( wl_name, "infra" ) ) 1649 1632 { 1650 #if ndef HAVE_MADWIFI1633 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1651 1634 // eval ("wl", "ap", "0"); 1652 1635 eval( "wl", "-i", name, "ap", "0" ); … … 1668 1651 if( nvram_match( wl_name, "sta" ) ) 1669 1652 { 1670 #if ndef HAVE_MADWIFI1653 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1671 1654 // eval ("wl", "ap", "0"); 1672 1655 eval( "wl", "-i", name, "ap", "0" ); … … 1678 1661 // eval("wlconf", name, "up"); 1679 1662 ifconfig( name, IFUP | IFF_ALLMULTI, NULL, NULL ); 1680 #if ndef HAVE_MADWIFI1663 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1681 1664 // eval ("wl", "ap", "0"); 1682 1665 eval( "wl", "-i", name, "ap", "0" ); … … 1712 1695 free( wan_ifname ); 1713 1696 free( lan_ifnames ); 1714 #if def HAVE_MADWIFI1697 #if defined(HAVE_MADWIFI) || defined(HAVE_RT2880) 1715 1698 #ifndef HAVE_NOWIFI 1716 1699 if( nvram_match( "mac_clone_enable", "1" ) && … … 1778 1761 */ 1779 1762 ifconfig( lan_ifname, IFUP, NULL, NULL ); 1780 #if ndef HAVE_MADWIFI1763 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 1781 1764 /* 1782 1765 * config wireless i/f … … 2070 2053 #ifdef HAVE_MADWIFI 2071 2054 int cnt = getifcount( "wifi" ); 2055 #elif HAVE_RT2880 2056 int cnt = 1; 2072 2057 #else 2073 2058 int cnt = get_wl_instances( ); … … 2135 2120 2136 2121 sleep( 2 ); 2137 #if ndef HAVE_MADWIFI2122 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2138 2123 notify_nas( "lan", "br1", "up" ); 2139 2124 #endif … … 2322 2307 2323 2308 #ifdef HAVE_MSSID 2324 #if ndef HAVE_MADWIFI2309 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2325 2310 eval( "wl", "vlan_mode", "0" ); 2326 2311 #endif … … 2335 2320 */ 2336 2321 start_set_routes( ); 2337 #if ndef HAVE_MADWIFI2322 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2338 2323 #ifndef HAVE_MSSID 2339 2324 eval( "wl", "radio", … … 2364 2349 } 2365 2350 2366 #ifndef HAVE_MADWIFI2367 #ifndef HAVE_MSSID2368 // if (nvram_match ("wl0_mode", "wet") || nvram_match ("wl0_mode",2369 // "sta"))2370 // {2371 // system2 ("wl wep sw");2372 // sleep (1);2373 // system2 ("wl wep hw");2374 // }2375 #endif2376 #endif2377 2351 if( nvram_match( "lan_stp", "0" ) ) 2378 2352 br_set_stp_state( "br0", 0 ); … … 2410 2384 2411 2385 #ifdef HAVE_MSSID 2412 #if ndef HAVE_MADWIFI2386 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2413 2387 br_del_interface( lan_ifname, "wl0.1" ); 2414 2388 ifconfig( "wl0.1", 0, NULL, NULL ); … … 2432 2406 if( !ifexists( name ) ) 2433 2407 continue; 2434 #if ndef HAVE_MADWIFI2408 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2435 2409 eval( "wlconf", name, "down" ); 2436 2410 #endif … … 2443 2417 * Bring down specific interface 2444 2418 */ 2445 #if ndef HAVE_MADWIFI2419 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2446 2420 else if( strcmp( lan_ifname, "" ) ) 2447 2421 eval( "wlconf", lan_ifname, "down" ); … … 2585 2559 2586 2560 #endif 2587 #if ndef HAVE_MADWIFI2561 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2588 2562 if( getWET( ) ) 2589 2563 { … … 2678 2652 { 2679 2653 ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; 2680 #ifndef HAVE_MADWIFI 2654 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2655 2681 2656 if( wlifname && !strcmp( wan_ifname, wlifname ) ) 2682 2657 eval( "wl", "-i", wan_ifname, "down" ); … … 2688 2663 } 2689 2664 #endif 2690 #if ndef HAVE_MADWIFI2665 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 2691 2666 if( wlifname && !strcmp( wan_ifname, wlifname ) ) 2692 2667 { … … 3572 3547 br_shutdown( ); 3573 3548 #endif 3574 #if def HAVE_MADWIFI3549 #if defined(HAVE_MADWIFI) || defined(HAVE_RT2880) 3575 3550 #ifndef HAVE_NOWIFI 3576 3551 start_hostapdwan( ); … … 3723 3698 } 3724 3699 3725 #if ndef HAVE_MADWIFI3700 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 3726 3701 static int notify_nas( char *type, char *ifname, char *action ) 3727 3702 { … … 3896 3871 { 3897 3872 fprintf( stderr, "adding WDS %s\n", interface ); 3898 /* struct ifreq ifr;3899 int s;3900 3901 if( ( s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW ) ) )3902 {3903 struct ifreq ifr;3904 int s;3905 if ((s = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)))3906 {3907 char eabuf[32];3908 strncpy (ifr.ifr_name, ifname, IFNAMSIZ);3909 ioctl (s, SIOCGIFHWADDR, &ifr);3910 char macaddr[32];3911 ifr.ifr_hwaddr.sa_data[0]|=0x02; // mask first byte to 0x023912 strcpy (macaddr,3913 ether_etoa ((unsigned char *) ifr.ifr_hwaddr.sa_data,3914 eabuf));3915 fprintf(stderr,"interface number is %s\n",nr);3916 int count = atoi(nr);3917 int i;3918 if (count>=0)3919 for (i=0;i<count+1;i++)3920 MAC_ADD (macaddr);3921 fprintf(stderr,"set %s mac addr to %s\n",interface,macaddr);3922 ether_atoe (macaddr, (unsigned char *) ifr.ifr_hwaddr.sa_data);3923 strncpy (ifr.ifr_name, interface, IFNAMSIZ);3924 // eval ("ifconfig", interface, "down");3925 ioctl (s, SIOCSIFHWADDR, &ifr);3926 close (s);3927 }*/3928 3873 3929 3874 eval( "ifconfig", interface, "up" ); … … 3975 3920 */ 3976 3921 sleep( 5 ); 3977 #if ndef HAVE_MADWIFI3922 #if !defined(HAVE_MADWIFI) && !defined(HAVE_RT2880) 3978 3923 notify_nas( "lan", interface, "up" ); 3979 3924 #endif -
src/router/services/services/services.c
r10738 r10747 120 120 void start_vpn_modules( void ) 121 121 { 122 #if defined(HAVE_XSCALE) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_X86) ||defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) 122 #if defined(HAVE_XSCALE) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_X86) ||defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) || defined(HAVE_RT2880) 123 123 124 124 if( ( nvram_match( "pptp_pass", "1" ) || nvram_match( "l2tp_pass", "1" ) … … 167 167 void stop_vpn_modules( void ) 168 168 { 169 #if defined(HAVE_XSCALE) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) 169 #if defined(HAVE_XSCALE) || defined(HAVE_FONERA) || defined(HAVE_WHRAG108) || defined(HAVE_X86) || defined(HAVE_LS2) || defined(HAVE_CA8) || defined(HAVE_TW6600) || defined(HAVE_LS5) || defined(HAVE_RT2880) 170 170 rmmod( "nf_nat_pptp" ); 171 171 rmmod( "nf_conntrack_pptp" );
Note: See TracChangeset
for help on using the changeset viewer.
