Changeset 8521
- Timestamp:
- 12/05/07 17:46:46 (5 years ago)
- Location:
- src/router/wlconf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/router/wlconf/Makefile
r3496 r8521 14 14 include $(TOP)/.config 15 15 16 #ifeq ($(CONFIG_BUFFALO),y) 17 #CFLAGS += -I. -I$(TOP)/shared -I$(SRCBASE)/include.bcm -Wall -I$(SRCBASE)/ 18 #else 16 19 CFLAGS += -I. -I$(TOP)/shared -I$(SRCBASE)/include.v24 -Wall -I$(SRCBASE)/ 20 #endif 17 21 #CFLAGS += -g -DDEBUG 18 CFLAGS += -s -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -DBCMWPA2 19 LDFLAGS += -L$(TOP)/nvram -lnvram -L$(TOP)/shared -lshared 22 CFLAGS += -s -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -DBCMWPA2 -fpic -ffunction-sections -fdata-sections -Wl,--gc-sections 23 LDFLAGS += -L$(TOP)/nvram -lnvram -L$(TOP)/shared -lshared -ffunction-sections -fdata-sections -Wl,--gc-sections 24 ifeq ($(CONFIG_BUFFALO),y) 25 CFLAGS += -DHAVE_BUFFALO -DBUFFALO_COUNTRY="\"$(CONFIG_COUNTRY)\"" 26 endif 20 27 21 28 ifeq ($(CONFIG_MSSID),y) 29 ifeq ($(CONFIG_BUFFALO),y) 22 30 OBJS := wlconf.o 31 #OBJS := wlconfbcm.o 32 else 33 OBJS := wlconf.o 34 endif 23 35 else 24 36 OBJS := -
src/router/wlconf/wlconf.c
r7575 r8521 196 196 char *next; 197 197 198 wl_akm = nvram_ safe_get(strcat_r(prefix, "akm", comb));198 wl_akm = nvram_default_get(strcat_r(prefix, "akm", comb),"disabled"); 199 199 foreach(akm, wl_akm, next) { 200 200 if (!strcmp(akm, "wpa")) … … 221 221 int ret; 222 222 223 nvram_default_get(strcat_r(prefix, "crypto", tmp),"off"); 223 224 /* Set wsec bitvec */ 224 225 akm_val = wlconf_akm_options(prefix); … … 231 232 val = TKIP_ENABLED | AES_ENABLED; 232 233 } 233 if (nvram_ match(strcat_r(prefix, "wep", tmp), "enabled"))234 if (nvram_default_match(strcat_r(prefix, "wep", tmp), "enabled","disabled")) 234 235 val |= WEP_ENABLED; 235 236 WL_BSSIOVAR_SETINT(ifname, "wsec", bsscfg_idx, val); … … 281 282 WL_IOCTL(name, WLC_GET_PHYTYPE, &phytype, sizeof(phytype)); 282 283 /* get gmode */ 283 gmode = atoi(nvram_ safe_get(strcat_r(prefix, "gmode", nv)));284 gmode = atoi(nvram_default_get(strcat_r(prefix, "gmode", nv),"1")); 284 285 285 286 /* WME sta setting first */ … … 341 342 342 343 /* set no-ack */ 343 v = nvram_ safe_get(strcat_r(prefix, "wme_no_ack", nv));344 v = nvram_default_get(strcat_r(prefix, "wme_no_ack", nv),"off"); 344 345 no_ack = strcmp(v, "on") ? 0 : 1; 345 346 WL_IOVAR_SETINT(name, "wme_noack", no_ack); 346 347 347 348 /* set APSD */ 348 v = nvram_ safe_get(strcat_r(prefix, "wme_apsd", nv));349 v = nvram_default_get(strcat_r(prefix, "wme_apsd", nv),"on"); 349 350 apsd = strcmp(v, "on") ? 0 : 1; 350 351 WL_IOVAR_SETINT(name, "wme_apsd", apsd); … … 401 402 402 403 static chanspec_t 403 wlconf_auto_chanspec(char *name )404 wlconf_auto_chanspec(char *name,char *prefix) 404 405 { 405 406 chanspec_t chosen = 0; 406 407 wl_uint32_list_t request; 408 char tmp[100]; 407 409 int bandtype; 408 410 int ret; … … 428 430 //2006_05_29_Roly 429 431 //handle channel is auto and bw is 40MHz 430 if((chanspec_asus=atoi(nvram_ safe_get("wl0_nbw")))==40)432 if((chanspec_asus=atoi(nvram_default_get(strcat_r(prefix,"nbw",tmp),"40")))==40) 431 433 chosen=0x2d08;//channel 8 40MHz(lower) 432 if((chanspec_asus=atoi(nvram_safe_get( "wl0_nbw")))==20)433 chosen = (chosen&0xfbff);//20MHz434 if((chanspec_asus=atoi(nvram_safe_get(strcat_r(prefix,"nbw",tmp))))==20) 435 chosen = (chosen&0xfbff);//20MHz 434 436 435 437 printf("interface %s: chanspec selected %04x %d\n", name, chosen,chanspec_asus); … … 489 491 490 492 /* additional virtual BSS Configs from wlX_vifs */ 491 if (nvram_ match(strcat_r(prefix, "mode", tmp),"ap") || nvram_match(strcat_r(prefix, "mode", tmp),"apsta") || nvram_match(strcat_r(prefix, "mode", tmp),"apstawet"))493 if (nvram_default_match(strcat_r(prefix, "mode", tmp),"ap","ap") || nvram_match(strcat_r(prefix, "mode", tmp),"apsta") || nvram_match(strcat_r(prefix, "mode", tmp),"apstawet")) 492 494 { 493 495 foreach(var, nvram_safe_get(strcat_r(prefix, "vifs", tmp)), next) { … … 557 559 558 560 /* EAP Restrict if we have an AKM or radius authentication */ 559 val = ((val != 0) || (nvram_ match(strcat_r(prefix, "auth_mode", tmp), "radius")));561 val = ((val != 0) || (nvram_default_match(strcat_r(prefix, "auth_mode", tmp), "radius","disabled"))); 560 562 WL_BSSIOVAR_SETINT(name, "eap_restrict", bsscfg_idx, val); 561 563 562 564 /* Set WEP keys */ 563 if (nvram_ match(strcat_r(prefix, "wep", tmp), "enabled")) {565 if (nvram_default_match(strcat_r(prefix, "wep", tmp), "enabled","disabled")) { 564 566 for (i = 1; i <= DOT11_MAX_DEFAULT_KEYS; i++) 565 567 wlconf_set_wep_key(name, prefix, bsscfg_idx, i); … … 567 569 568 570 /* Set 802.11 authentication mode - open/shared */ 569 val = atoi(nvram_ safe_get(strcat_r(prefix, "auth", tmp)));571 val = atoi(nvram_default_get(strcat_r(prefix, "auth", tmp),"0")); 570 572 WL_BSSIOVAR_SETINT(name, "auth", bsscfg_idx, val); 571 573 } … … 618 620 * list otherwise return -1 619 621 */ 622 cprintf("get ifname unit\n"); 620 623 if (get_ifname_unit(name, &wlunit, &wlsubunit) == 0) 621 624 { … … 645 648 * so we use "wl_ap_build" to help us know how to configure the driver 646 649 */ 650 cprintf("get caps\n"); 647 651 if (wl_iovar_get(name, "cap", (void *)caps, WLC_IOCTL_SMLEN)) 648 652 return -1; … … 659 663 } 660 664 665 cprintf("wl probe\n"); 661 666 /* Check interface (fail silently for non-wl interfaces) */ 662 667 if ((ret = wl_probe(name))) 663 668 return ret; 664 669 670 cprintf("get wl addr\n"); 665 671 /* Get MAC address */ 666 672 (void) wl_hwaddr(name, (uchar *)buf); 667 673 /* Get instance */ 674 cprintf("get instance\n"); 668 675 WL_IOCTL(name, WLC_GET_INSTANCE, &unit, sizeof(unit)); 669 676 snprintf(prefix, sizeof(prefix), "wl%d_", unit); … … 678 685 679 686 687 cprintf("shut down %s\n",name); 680 688 /* Bring the interface down */ 681 689 WL_IOCTL(name, WLC_DOWN, NULL, sizeof(val)); 682 690 691 cprintf("disable bss %s\n",name); 683 692 /* Disable all BSS Configs */ 684 693 for (i = 0; i < WL_MAXBSSCFG; i++) { … … 721 730 ure_enab = TRUE; 722 731 } 732 cprintf("set mssid flags %s\n",name); 723 733 if (wl_ap_build) { 724 734 /* Enable MSSID mode if appropriate */ … … 733 743 bsscfg = &bclist->bsscfgs[i]; 734 744 strcat_r(bsscfg->prefix, "ssid", tmp); 735 ssid.SSID_len = strlen(nvram_ safe_get(tmp));745 ssid.SSID_len = strlen(nvram_default_get(tmp,"dd-wrt")); 736 746 if (ssid.SSID_len > sizeof(ssid.SSID)) 737 747 ssid.SSID_len = sizeof(ssid.SSID); … … 742 752 } 743 753 } 754 cprintf("set local addr %s\n",name); 744 755 if (!ure_enab) { 745 756 /* set local bit for our MBSS vif base */ … … 779 790 780 791 /* wlX_mode settings: AP, STA, WET, BSS/IBSS, APSTA */ 781 str = nvram_ safe_get(strcat_r(prefix, "mode", tmp));792 str = nvram_default_get(strcat_r(prefix, "mode", tmp),"dd-wrt"); 782 793 ap = (!strcmp(str, "") || !strcmp(str, "ap") || !strcmp(str, "mssid")); 783 794 apsta = (!strcmp(str, "apsta") || !strcmp(str, "apstawet") || ((!strcmp(str, "sta") || !strcmp(str, "wet")) && bclist->count > 1)); … … 789 800 /* Set AP mode */ 790 801 val = (ap || apsta || wds) ? 1 : 0; 802 cprintf("set ap flag %s\n",name); 791 803 WL_IOCTL(name, WLC_SET_AP, &val, sizeof(val)); 792 804 805 cprintf("set apsta flag %s\n",name); 793 806 WL_IOVAR_SETINT(name, "apsta", apsta); 794 807 795 808 /* Set mode: WET */ 809 cprintf("set wet flag %s\n",name); 796 810 if (wet) 797 811 WL_IOCTL(name, WLC_SET_WET, &wet, sizeof(wet)); 798 812 813 cprintf("set spoof flag %s\n",name); 799 814 if (mac_spoof) { 800 815 sta = 1; … … 805 820 * Use specified time (capped), or mode-specific defaults. 806 821 */ 822 cprintf("set sta retry time %s\n",name); 807 823 if (sta || wet || apsta) { 808 char *retry_time = nvram_ safe_get(strcat_r(prefix, "sta_retry_time", tmp));824 char *retry_time = nvram_default_get(strcat_r(prefix, "sta_retry_time", tmp),"5"); 809 825 val = atoi(retry_time); 810 826 WL_IOVAR_SETINT(name, "sta_retry_time", val); … … 817 833 val = 1; 818 834 if (wet || sta) 819 val = atoi(nvram_safe_get(strcat_r(prefix, "infra", tmp))); 835 val = atoi(nvram_default_get(strcat_r(prefix, "infra", tmp),"1")); 836 cprintf("set infra flag %s\n",name); 820 837 WL_IOCTL(name, WLC_SET_INFRA, &val, sizeof(val)); 821 838 839 cprintf("set maxassoc flag %s\n",name); 822 840 /* Set The AP MAX Associations Limit */ 823 841 if (ap | apsta) { 824 val = atoi(nvram_ safe_get(strcat_r(prefix, "maxassoc", tmp)));842 val = atoi(nvram_default_get(strcat_r(prefix, "maxassoc", tmp),"128")); 825 843 if (val > 0) 826 844 WL_IOVAR_SETINT(name, "maxassoc", val); 827 845 } 846 cprintf("set bsscfg %s\n",name); 828 847 829 848 for (i = 0; i < bclist->count; i++) { … … 855 874 856 875 /* Set network type */ 857 val = atoi(nvram_ safe_get(strcat_r(subprefix, "closed", tmp)));876 val = atoi(nvram_default_get(strcat_r(subprefix, "closed", tmp),"0")); 858 877 WL_BSSIOVAR_SETINT(name, "closednet", bsscfg->idx, val); 859 878 860 879 /* Set the ap isolate mode */ 861 val = atoi(nvram_ safe_get(strcat_r(subprefix, "ap_isolate", tmp)));880 val = atoi(nvram_default_get(strcat_r(subprefix, "ap_isolate", tmp),"0")); 862 881 WL_BSSIOVAR_SETINT(name, "ap_isolate", bsscfg->idx, val); 863 882 } 864 883 884 cprintf("get phy type %s\n",name); 865 885 /* Get current phy type */ 866 886 WL_IOCTL(name, WLC_GET_PHYTYPE, &phytype, sizeof(phytype)); … … 880 900 if (phytype == PHY_TYPE_N) 881 901 { 882 if (nvram_ match("wl0_net_mode","n-only") || nvram_match("wl0_net_mode","mixed"))902 if (nvram_default_match(strcat_r(prefix, "net_mode", tmp),"n-only","mixed") || nvram_match(strcat_r(prefix, "net_mode", tmp),"mixed")) 883 903 country="DE"; 884 904 } 885 905 //country = nvram_get(tmp); 886 906 #endif 907 cprintf("set country %s\n",name); 887 908 if (country) { 888 909 strncpy(country_code, country, sizeof(country_code)); … … 917 938 } 918 939 940 cprintf("set reg mode %s\n",name); 919 941 /* Setup regulatory mode */ 920 942 strcat_r(prefix, "reg_mode", tmp); 921 if (nvram_ match(tmp,"off")) {943 if (nvram_default_match(tmp, "off","off")) { 922 944 val = 0; 923 945 WL_IOCTL(name, WLC_SET_REGULATORY, &val, sizeof(val)); … … 946 968 WL_IOCTL(name, WLC_SET_REGULATORY, &val, sizeof(val)); 947 969 } 970 cprintf("set maclist %s\n",name); 948 971 949 972 /* Set the MAC list */ 950 973 maclist = (struct maclist *) buf; 951 974 maclist->count = 0; 952 if (!nvram_ match(strcat_r(prefix, "macmode", tmp),"disabled")) {975 if (!nvram_default_match(strcat_r(prefix, "macmode", tmp), "disabled","disabled")) { 953 976 ea = maclist->ea; 954 977 foreach(var, nvram_safe_get(strcat_r(prefix, "maclist", tmp)), next) { … … 963 986 WL_IOCTL(name, WLC_SET_MACLIST, buf, sizeof(buf)); 964 987 988 cprintf("set macmode %s\n",name); 965 989 /* Set the MAC list mode */ 966 990 (void) strcat_r(prefix, "macmode", tmp); 967 if (nvram_ match(tmp, "deny"))991 if (nvram_default_match(tmp, "deny","disabled")) 968 992 val = WLC_MACMODE_DENY; 969 993 else if (nvram_match(tmp, "allow")) … … 974 998 975 999 /* Change LED Duty Cycle */ 976 leddc = (uint32)strtoul(nvram_ safe_get(strcat_r(prefix, "leddc", tmp)), NULL, 16);1000 leddc = (uint32)strtoul(nvram_default_get(strcat_r(prefix, "leddc", tmp),"0x640000"), NULL, 16); 977 1001 if (leddc) 978 1002 WL_IOVAR_SETINT(name, "leddc", leddc); 979 1003 980 1004 /* Enable or disable the radio */ 981 val = nvram_match(strcat_r(prefix, "radio", tmp), "0"); 1005 cprintf("set radio flag %s\n",name); 1006 val = nvram_default_match(strcat_r(prefix, "radio", tmp), "0","1"); 982 1007 val += WL_RADIO_SW_DISABLE << 16; 983 1008 WL_IOCTL(name, WLC_SET_RADIO, &val, sizeof(val)); 984 1009 1010 cprintf("get phy flags %s\n",name); 985 1011 /* Get supported phy types */ 986 1012 WL_IOCTL(name, WLC_GET_PHYLIST, var, sizeof(var)); … … 1004 1030 (rev.radiorev & IDCODE_ID_MASK) >> IDCODE_ID_SHIFT); 1005 1031 } 1032 cprintf("set radio ids %s\n",name); 1006 1033 nvram_set(strcat_r(prefix, "radioids", tmp), buf); 1007 1034 1008 1035 /* Set band */ 1036 cprintf("set nband %s\n",name); 1009 1037 str = nvram_get(strcat_r(prefix, "phytype", tmp)); 1010 1038 val = WLCONF_STR2PHYTYPE(str); … … 1020 1048 val = WLCONF_PHYTYPE2BAND(val); 1021 1049 1050 cprintf("set band %s\n",name); 1022 1051 WL_SETINT(name, WLC_SET_BAND, val); 1023 1052 … … 1035 1064 1036 1065 /* Get current core revision */ 1066 cprintf("get core rev %s\n",name); 1037 1067 WL_IOCTL(name, WLC_GET_REVINFO, &rev, sizeof(rev)); 1038 1068 snprintf(buf, sizeof(buf), "%d", rev.corerev); … … 1042 1072 /* Set channel before setting gmode or rateset */ 1043 1073 /* Manual Channel Selection - when channel # is not 0 */ 1044 val = atoi(nvram_safe_get(strcat_r(prefix, "channel", tmp))); 1074 cprintf("set channel %s\n",name); 1075 val = atoi(nvram_default_get(strcat_r(prefix, "channel", tmp),"0")); 1045 1076 if (val && phytype != PHY_TYPE_N) { 1046 1077 WL_SETINT(name, WLC_SET_CHANNEL, val); … … 1100 1131 } 1101 1132 1133 cprintf("set rate set %s\n",name); 1102 1134 /* Reset to hardware rateset (band may have changed) */ 1103 1135 WL_IOCTL(name, WLC_GET_RATESET, &rs, sizeof(wl_rateset_t)); 1104 1136 WL_IOCTL(name, WLC_SET_RATESET, &rs, sizeof(wl_rateset_t)); 1105 1137 1138 cprintf("set g mode %s\n",name); 1106 1139 /* Set gmode */ 1107 1140 if (bandtype == WLC_BAND_2G) { … … 1110 1143 1111 1144 /* Set gmode */ 1112 gmode = atoi(nvram_ safe_get(strcat_r(prefix, "gmode", tmp)));1145 gmode = atoi(nvram_default_get(strcat_r(prefix, "gmode", tmp),"1")); 1113 1146 WL_IOCTL(name, WLC_SET_GMODE, &gmode, sizeof(gmode)); 1114 1147 1115 1148 /* Set gmode protection override and control algorithm */ 1116 1149 strcat_r(prefix, "gmode_protection", tmp); 1117 if (nvram_ match(tmp,"auto")) {1150 if (nvram_default_match(tmp, "auto","auto")) { 1118 1151 override = WLC_G_PROTECTION_AUTO; 1119 1152 control = WLC_G_PROTECTION_CTL_OVERLAP; … … 1123 1156 } 1124 1157 1158 cprintf("set n prot mode %s\n",name); 1125 1159 /* Set nmode_protectoin */ 1126 1160 if (phytype == PHY_TYPE_N) { … … 1133 1167 1134 1168 strcat_r(prefix, "nreqd", tmp); 1135 if (nvram_ match(tmp,"0"))1169 if (nvram_default_match(tmp, "0","0")) 1136 1170 nmode = 0; 1137 1171 if (nvram_match(tmp, "1")) … … 1140 1174 1141 1175 strcat_r(prefix, "nmode", tmp); 1142 if (nvram_ match(tmp, "0"))1176 if (nvram_default_match(tmp, "0","-1")) 1143 1177 nmode = OFF; 1144 1178 if (nvram_match(tmp, "-1")) … … 1151 1185 strcat_r(prefix, "nmode_protection", tmp); 1152 1186 1153 if (nvram_ match(tmp,"auto")) {1187 if (nvram_default_match(tmp, "auto","auto")) { 1154 1188 override = WLC_PROTECTION_AUTO; 1155 1189 control = WLC_PROTECTION_CTL_OVERLAP; … … 1172 1206 * -set wme mode before set afterburner mode 1173 1207 */ 1208 cprintf("set afterburner override %s\n",name); 1174 1209 val = OFF; 1175 1210 strcpy(var, "afterburner_override"); 1176 1211 wl_iovar_setint(name, var, val); 1177 wme = nvram_ safe_get(strcat_r(prefix, "wme", tmp));1212 wme = nvram_default_get(strcat_r(prefix, "wme", tmp),"on"); 1178 1213 val = strcmp(wme, "on") ? 0 : 1; 1214 cprintf("set wme %s\n",name); 1179 1215 wl_iovar_set(name, "wme", &val, sizeof(val)); 1180 1216 if (val) 1181 1217 wlconf_set_wme(name, prefix); 1182 1218 1219 cprintf("set btc mode %s\n",name); 1183 1220 /* Get bluetootch coexistance(BTC) mode */ 1184 btc_mode = atoi(nvram_ safe_get(strcat_r(prefix, "btc_mode", tmp)));1221 btc_mode = atoi(nvram_default_get(strcat_r(prefix, "btc_mode", tmp),"0")); 1185 1222 1186 1223 /* Set options based on capability */ 1224 cprintf("get caps %s\n",name); 1187 1225 wl_iovar_get(name, "cap", (void *)tmp, 100); 1188 1226 foreach(var, tmp, next) { … … 1220 1258 1221 1259 strcat_r(prefix, "rateset", tmp); 1222 if (nvram_ match(tmp, "all")) {1260 if (nvram_default_match(tmp, "all","default")) { 1223 1261 /* Make all rates basic */ 1224 1262 for (i = 0; i < rs.count; i++) … … 1233 1271 } 1234 1272 } 1273 cprintf("set btc mode %s\n",name); 1235 1274 1236 1275 /* Set BTC mode */ … … 1247 1286 } 1248 1287 1288 cprintf("set rate set %s\n",name); 1249 1289 /* Set rateset */ 1250 1290 WL_IOCTL(name, WLC_SET_RATESET, &rs, sizeof(wl_rateset_t)); 1251 1291 1292 cprintf("set plcphdr %s\n",name); 1252 1293 /* Allow short preamble override for b cards */ 1253 1294 if (phytype == PHY_TYPE_B || 1254 1295 (phytype == PHY_TYPE_G && (gmode == GMODE_LEGACY_B || gmode == GMODE_AUTO))) { 1255 1296 strcat_r(prefix, "plcphdr", tmp); 1256 if (nvram_ match(tmp,"long"))1297 if (nvram_default_match(tmp, "long","long")) 1257 1298 val = WLC_PLCP_AUTO; 1258 1299 else … … 1262 1303 1263 1304 /* Set rate in 500 Kbps units */ 1264 val = atoi(nvram_ safe_get(strcat_r(prefix, "rate", tmp))) / 500000;1305 val = atoi(nvram_default_get(strcat_r(prefix, "rate", tmp),"0")) / 500000; 1265 1306 1266 1307 1267 1308 /* Convert Auto mcsidx to Auto rate */ 1268 1309 if (phytype == PHY_TYPE_N) { 1269 int mcsidx = atoi(nvram_ safe_get(strcat_r(prefix, "nmcsidx", tmp)));1310 int mcsidx = atoi(nvram_default_get(strcat_r(prefix, "nmcsidx", tmp),"-1")); 1270 1311 /* -1 mcsidx used to designate AUTO rate */ 1271 1312 if (mcsidx == -1) … … 1278 1319 val = 11; 1279 1320 1321 cprintf("set get rates %s\n",name); 1280 1322 /* it is band-blind. try both band */ 1281 1323 error_bg = wl_iovar_setint(name, "bg_rate", val); … … 1323 1365 } 1324 1366 1367 cprintf("set mrates %s\n",name); 1325 1368 /* Set multicast rate in 500 Kbps units */ 1326 val = atoi(nvram_ safe_get(strcat_r(prefix, "mrate", tmp))) / 500000;1369 val = atoi(nvram_default_get(strcat_r(prefix, "mrate", tmp),"0")) / 500000; 1327 1370 /* 1Mbps and 2 Mbps are not allowed in BTC pre-emptive mode */ 1328 1371 if (btc_mode == WL_BTC_PREMPT && (val == 2 || val == 4)) … … 1345 1388 } 1346 1389 1390 cprintf("set frag tres %s\n",name); 1347 1391 /* Set fragmentation threshold */ 1348 val = atoi(nvram_ safe_get(strcat_r(prefix, "frag", tmp)));1392 val = atoi(nvram_default_get(strcat_r(prefix, "frag", tmp),"2346")); 1349 1393 wl_iovar_setint(name, "fragthresh", val); 1350 1394 1351 1395 /* Set RTS threshold */ 1352 val = atoi(nvram_ safe_get(strcat_r(prefix, "rts", tmp)));1396 val = atoi(nvram_default_get(strcat_r(prefix, "rts", tmp),"2347")); 1353 1397 wl_iovar_setint(name, "rtsthresh", val); 1354 1398 1355 1399 /* Set DTIM period */ 1356 val = atoi(nvram_ safe_get(strcat_r(prefix, "dtim", tmp)));1400 val = atoi(nvram_default_get(strcat_r(prefix, "dtim", tmp),"1")); 1357 1401 WL_IOCTL(name, WLC_SET_DTIMPRD, &val, sizeof(val)); 1358 1402 1359 1403 /* Set beacon period */ 1360 val = atoi(nvram_ safe_get(strcat_r(prefix, "bcn", tmp)));1404 val = atoi(nvram_default_get(strcat_r(prefix, "bcn", tmp),"100")); 1361 1405 WL_IOCTL(name, WLC_SET_BCNPRD, &val, sizeof(val)); 1362 1406 1407 cprintf("set wds %s\n",name); 1363 1408 /* AP only config */ 1364 1409 if (ap || apsta || wds) { 1365 1410 /* Set lazy WDS mode */ 1366 val = atoi(nvram_ safe_get(strcat_r(prefix, "lazywds", tmp)));1411 val = atoi(nvram_default_get(strcat_r(prefix, "lazywds", tmp),"0")); 1367 1412 WL_IOCTL(name, WLC_SET_LAZYWDS, &val, sizeof(val)); 1368 1413 … … 1385 1430 } 1386 1431 1432 cprintf("set wframeburst %s\n",name); 1387 1433 /* Set framebursting mode */ 1388 1434 if (btc_mode == WL_BTC_PREMPT) 1389 1435 val = FALSE; 1390 1436 else 1391 val = nvram_ match(strcat_r(prefix, "frameburst", tmp), "on");1437 val = nvram_default_match(strcat_r(prefix, "frameburst", tmp), "on","off"); 1392 1438 WL_IOCTL(name, WLC_SET_FAKEFRAG, &val, sizeof(val)); 1393 1439 1440 cprintf("set rifs mode %s\n",name); 1394 1441 /* Set RIFS mode based on framebursting */ 1395 1442 if (phytype == PHY_TYPE_N) { … … 1401 1448 } 1402 1449 1450 cprintf("set ba mode %s\n",name); 1403 1451 /* Override BA mode only if set to on/off */ 1404 1452 ba = nvram_safe_get(strcat_r(prefix, "ba", tmp)); … … 1408 1456 wl_iovar_setint(name, "ba", OFF); 1409 1457 1458 cprintf("set up %s\n",name); 1410 1459 /* Bring the interface back up */ 1411 1460 WL_IOCTL(name, WLC_UP, NULL, 0); 1412 1461 1462 cprintf("set antdiv mode %s\n",name); 1413 1463 /* Set antenna */ 1414 val = atoi(nvram_ safe_get(strcat_r(prefix, "antdiv", tmp)));1464 val = atoi(nvram_default_get(strcat_r(prefix, "antdiv", tmp),"3")); 1415 1465 WL_IOCTL(name, WLC_SET_ANTDIV, &val, sizeof(val)); 1416 1466 … … 1423 1473 */ 1424 1474 if (ap || apsta) { 1425 if (!(val = atoi(nvram_ safe_get(strcat_r(prefix, "channel", tmp))))) {1475 if (!(val = atoi(nvram_default_get(strcat_r(prefix, "channel", tmp),"0")))) { 1426 1476 if (phytype == PHY_TYPE_N) { 1427 chanspec_t chanspec = wlconf_auto_chanspec(name );1477 chanspec_t chanspec = wlconf_auto_chanspec(name,prefix); 1428 1478 if (chanspec != 0) 1429 1479 { … … 1470 1520 /* NAS runs if we have an AKM or radius authentication */ 1471 1521 nas_will_run = wlconf_akm_options(bclist->bsscfgs[i].prefix) || 1472 nvram_ match(strcat_r(bclist->bsscfgs[i].prefix, "auth_mode", tmp),1473 "radius" );1522 nvram_default_match(strcat_r(bclist->bsscfgs[i].prefix, "auth_mode", tmp), 1523 "radius","disabled"); 1474 1524 1475 1525 if (((ap || apsta) && !nas_will_run) || sta || wet) {
Note: See TracChangeset
for help on using the changeset viewer.
