Changeset 8521


Ignore:
Timestamp:
12/05/07 17:46:46 (5 years ago)
Author:
BrainSlayer
Message:

resort order

Location:
src/router/wlconf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/router/wlconf/Makefile

    r3496 r8521  
    1414include $(TOP)/.config 
    1515 
     16#ifeq ($(CONFIG_BUFFALO),y) 
     17#CFLAGS += -I. -I$(TOP)/shared -I$(SRCBASE)/include.bcm -Wall -I$(SRCBASE)/ 
     18#else 
    1619CFLAGS  += -I. -I$(TOP)/shared -I$(SRCBASE)/include.v24 -Wall -I$(SRCBASE)/ 
     20#endif 
    1721#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 
     22CFLAGS  += -s -Os -pipe -mips32 -mtune=mips32 -funit-at-a-time -DBCMWPA2 -fpic -ffunction-sections -fdata-sections -Wl,--gc-sections 
     23LDFLAGS += -L$(TOP)/nvram -lnvram -L$(TOP)/shared -lshared -ffunction-sections -fdata-sections -Wl,--gc-sections 
     24ifeq ($(CONFIG_BUFFALO),y) 
     25CFLAGS += -DHAVE_BUFFALO -DBUFFALO_COUNTRY="\"$(CONFIG_COUNTRY)\"" 
     26endif 
    2027 
    2128ifeq ($(CONFIG_MSSID),y) 
     29ifeq ($(CONFIG_BUFFALO),y) 
    2230OBJS := wlconf.o  
     31#OBJS := wlconfbcm.o  
     32else 
     33OBJS := wlconf.o  
     34endif 
    2335else 
    2436OBJS :=  
  • src/router/wlconf/wlconf.c

    r7575 r8521  
    196196        char *next; 
    197197 
    198         wl_akm = nvram_safe_get(strcat_r(prefix, "akm", comb)); 
     198        wl_akm = nvram_default_get(strcat_r(prefix, "akm", comb),"disabled"); 
    199199        foreach(akm, wl_akm, next) { 
    200200                if (!strcmp(akm, "wpa")) 
     
    221221        int ret; 
    222222 
     223        nvram_default_get(strcat_r(prefix, "crypto", tmp),"off"); 
    223224        /* Set wsec bitvec */ 
    224225        akm_val = wlconf_akm_options(prefix); 
     
    231232                        val = TKIP_ENABLED | AES_ENABLED; 
    232233        } 
    233         if (nvram_match(strcat_r(prefix, "wep", tmp), "enabled")) 
     234        if (nvram_default_match(strcat_r(prefix, "wep", tmp), "enabled","disabled")) 
    234235                val |= WEP_ENABLED; 
    235236        WL_BSSIOVAR_SETINT(ifname, "wsec", bsscfg_idx, val); 
     
    281282        WL_IOCTL(name, WLC_GET_PHYTYPE, &phytype, sizeof(phytype)); 
    282283        /* 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")); 
    284285 
    285286        /* WME sta setting first */ 
     
    341342 
    342343        /* 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"); 
    344345        no_ack = strcmp(v, "on") ? 0 : 1; 
    345346        WL_IOVAR_SETINT(name, "wme_noack", no_ack); 
    346347 
    347348        /* 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"); 
    349350        apsd = strcmp(v, "on") ? 0 : 1; 
    350351        WL_IOVAR_SETINT(name, "wme_apsd", apsd); 
     
    401402 
    402403static chanspec_t 
    403 wlconf_auto_chanspec(char *name) 
     404wlconf_auto_chanspec(char *name,char *prefix) 
    404405{ 
    405406        chanspec_t chosen = 0; 
    406407        wl_uint32_list_t request; 
     408        char tmp[100]; 
    407409        int bandtype; 
    408410        int ret; 
     
    428430         //2006_05_29_Roly 
    429431        //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) 
    431433        chosen=0x2d08;//channel 8 40MHz(lower) 
    432         if((chanspec_asus=atoi(nvram_safe_get("wl0_nbw")))==20) 
    433         chosen = (chosen&0xfbff);//20MHz 
     434        if((chanspec_asus=atoi(nvram_safe_get(strcat_r(prefix,"nbw",tmp))))==20) 
     435        chosen = (chosen&0xfbff);//20MHz 
    434436 
    435437        printf("interface %s: chanspec selected %04x %d\n", name, chosen,chanspec_asus); 
     
    489491         
    490492        /* 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")) 
    492494        { 
    493495        foreach(var, nvram_safe_get(strcat_r(prefix, "vifs", tmp)), next) { 
     
    557559 
    558560        /* 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"))); 
    560562        WL_BSSIOVAR_SETINT(name, "eap_restrict", bsscfg_idx, val); 
    561563 
    562564        /* 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")) { 
    564566                for (i = 1; i <= DOT11_MAX_DEFAULT_KEYS; i++) 
    565567                        wlconf_set_wep_key(name, prefix, bsscfg_idx, i); 
     
    567569 
    568570        /* 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")); 
    570572        WL_BSSIOVAR_SETINT(name, "auth", bsscfg_idx, val); 
    571573} 
     
    618620         * list otherwise return -1 
    619621         */ 
     622cprintf("get ifname unit\n"); 
    620623        if (get_ifname_unit(name, &wlunit, &wlsubunit) == 0) 
    621624        { 
     
    645648         * so we use "wl_ap_build" to help us know how to configure the driver 
    646649         */ 
     650cprintf("get caps\n"); 
    647651        if (wl_iovar_get(name, "cap", (void *)caps, WLC_IOCTL_SMLEN)) 
    648652                return -1; 
     
    659663        } 
    660664 
     665cprintf("wl probe\n"); 
    661666        /* Check interface (fail silently for non-wl interfaces) */ 
    662667        if ((ret = wl_probe(name))) 
    663668                return ret; 
    664669 
     670cprintf("get wl addr\n"); 
    665671        /* Get MAC address */ 
    666672        (void) wl_hwaddr(name, (uchar *)buf); 
    667673        /* Get instance */ 
     674cprintf("get instance\n"); 
    668675        WL_IOCTL(name, WLC_GET_INSTANCE, &unit, sizeof(unit)); 
    669676        snprintf(prefix, sizeof(prefix), "wl%d_", unit); 
     
    678685 
    679686 
     687cprintf("shut down %s\n",name); 
    680688        /* Bring the interface down */ 
    681689        WL_IOCTL(name, WLC_DOWN, NULL, sizeof(val)); 
    682690 
     691cprintf("disable bss %s\n",name); 
    683692        /* Disable all BSS Configs */ 
    684693        for (i = 0; i < WL_MAXBSSCFG; i++) { 
     
    721730                ure_enab = TRUE; 
    722731        } 
     732cprintf("set mssid flags %s\n",name); 
    723733        if (wl_ap_build) { 
    724734                /* Enable MSSID mode if appropriate */ 
     
    733743                        bsscfg = &bclist->bsscfgs[i]; 
    734744                        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")); 
    736746                        if (ssid.SSID_len > sizeof(ssid.SSID)) 
    737747                                ssid.SSID_len = sizeof(ssid.SSID); 
     
    742752                } 
    743753        } 
     754cprintf("set local addr %s\n",name); 
    744755        if (!ure_enab) { 
    745756                /* set local bit for our MBSS vif base */ 
     
    779790 
    780791        /* 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"); 
    782793        ap = (!strcmp(str, "") || !strcmp(str, "ap") || !strcmp(str, "mssid")); 
    783794        apsta = (!strcmp(str, "apsta") || !strcmp(str, "apstawet") || ((!strcmp(str, "sta") || !strcmp(str, "wet")) && bclist->count > 1)); 
     
    789800        /* Set AP mode */ 
    790801        val = (ap || apsta || wds) ? 1 : 0; 
     802cprintf("set ap flag %s\n",name); 
    791803        WL_IOCTL(name, WLC_SET_AP, &val, sizeof(val)); 
    792804 
     805cprintf("set apsta flag %s\n",name); 
    793806        WL_IOVAR_SETINT(name, "apsta", apsta); 
    794807 
    795808        /* Set mode: WET */ 
     809cprintf("set wet flag %s\n",name); 
    796810        if (wet) 
    797811                WL_IOCTL(name, WLC_SET_WET, &wet, sizeof(wet)); 
    798812 
     813cprintf("set spoof flag %s\n",name); 
    799814        if (mac_spoof) { 
    800815                sta = 1; 
     
    805820         * Use specified time (capped), or mode-specific defaults. 
    806821         */ 
     822cprintf("set sta retry time %s\n",name); 
    807823        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"); 
    809825                val = atoi(retry_time); 
    810826                WL_IOVAR_SETINT(name, "sta_retry_time", val); 
     
    817833        val = 1; 
    818834        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")); 
     836cprintf("set infra flag %s\n",name); 
    820837        WL_IOCTL(name, WLC_SET_INFRA, &val, sizeof(val)); 
    821838 
     839cprintf("set maxassoc flag %s\n",name); 
    822840        /* Set The AP MAX Associations Limit */ 
    823841        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")); 
    825843                if (val > 0) 
    826844                        WL_IOVAR_SETINT(name, "maxassoc", val); 
    827845        } 
     846cprintf("set bsscfg %s\n",name); 
    828847 
    829848        for (i = 0; i < bclist->count; i++) { 
     
    855874 
    856875                /* 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")); 
    858877                WL_BSSIOVAR_SETINT(name, "closednet", bsscfg->idx, val); 
    859878 
    860879                /* 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")); 
    862881                WL_BSSIOVAR_SETINT(name, "ap_isolate", bsscfg->idx, val); 
    863882        } 
    864883 
     884cprintf("get phy type %s\n",name); 
    865885        /* Get current phy type */ 
    866886        WL_IOCTL(name, WLC_GET_PHYTYPE, &phytype, sizeof(phytype)); 
     
    880900        if (phytype == PHY_TYPE_N) 
    881901            { 
    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")) 
    883903                country="DE"; 
    884904            } 
    885905        //country = nvram_get(tmp); 
    886906#endif 
     907cprintf("set country %s\n",name); 
    887908        if (country) { 
    888909                strncpy(country_code, country, sizeof(country_code)); 
     
    917938        } 
    918939 
     940cprintf("set reg mode %s\n",name); 
    919941        /* Setup regulatory mode */ 
    920942        strcat_r(prefix, "reg_mode", tmp); 
    921         if (nvram_match(tmp, "off"))  { 
     943        if (nvram_default_match(tmp, "off","off"))  { 
    922944                val = 0; 
    923945                WL_IOCTL(name, WLC_SET_REGULATORY, &val, sizeof(val)); 
     
    946968                WL_IOCTL(name, WLC_SET_REGULATORY, &val, sizeof(val)); 
    947969        } 
     970cprintf("set maclist %s\n",name); 
    948971 
    949972        /* Set the MAC list */ 
    950973        maclist = (struct maclist *) buf; 
    951974        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")) { 
    953976                ea = maclist->ea; 
    954977                foreach(var, nvram_safe_get(strcat_r(prefix, "maclist", tmp)), next) { 
     
    963986        WL_IOCTL(name, WLC_SET_MACLIST, buf, sizeof(buf)); 
    964987 
     988cprintf("set macmode %s\n",name); 
    965989        /* Set the MAC list mode */ 
    966990        (void) strcat_r(prefix, "macmode", tmp); 
    967         if (nvram_match(tmp, "deny")) 
     991        if (nvram_default_match(tmp, "deny","disabled")) 
    968992                val = WLC_MACMODE_DENY; 
    969993        else if (nvram_match(tmp, "allow")) 
     
    974998 
    975999        /* 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); 
    9771001        if (leddc) 
    9781002                WL_IOVAR_SETINT(name, "leddc", leddc); 
    9791003 
    9801004        /* Enable or disable the radio */ 
    981         val = nvram_match(strcat_r(prefix, "radio", tmp), "0"); 
     1005cprintf("set radio flag %s\n",name); 
     1006        val = nvram_default_match(strcat_r(prefix, "radio", tmp), "0","1"); 
    9821007        val += WL_RADIO_SW_DISABLE << 16; 
    9831008        WL_IOCTL(name, WLC_SET_RADIO, &val, sizeof(val)); 
    9841009 
     1010cprintf("get phy flags %s\n",name); 
    9851011        /* Get supported phy types */ 
    9861012        WL_IOCTL(name, WLC_GET_PHYLIST, var, sizeof(var)); 
     
    10041030                                (rev.radiorev & IDCODE_ID_MASK) >> IDCODE_ID_SHIFT); 
    10051031        } 
     1032cprintf("set radio ids %s\n",name); 
    10061033        nvram_set(strcat_r(prefix, "radioids", tmp), buf); 
    10071034 
    10081035        /* Set band */ 
     1036cprintf("set nband %s\n",name); 
    10091037        str = nvram_get(strcat_r(prefix, "phytype", tmp)); 
    10101038        val = WLCONF_STR2PHYTYPE(str); 
     
    10201048                val = WLCONF_PHYTYPE2BAND(val); 
    10211049 
     1050cprintf("set band %s\n",name); 
    10221051        WL_SETINT(name, WLC_SET_BAND, val); 
    10231052 
     
    10351064 
    10361065        /* Get current core revision */ 
     1066cprintf("get core rev %s\n",name); 
    10371067        WL_IOCTL(name, WLC_GET_REVINFO, &rev, sizeof(rev)); 
    10381068        snprintf(buf, sizeof(buf), "%d", rev.corerev); 
     
    10421072        /* Set channel before setting gmode or rateset */ 
    10431073        /* Manual Channel Selection - when channel # is not 0 */ 
    1044         val = atoi(nvram_safe_get(strcat_r(prefix, "channel", tmp))); 
     1074cprintf("set channel %s\n",name); 
     1075        val = atoi(nvram_default_get(strcat_r(prefix, "channel", tmp),"0")); 
    10451076        if (val && phytype != PHY_TYPE_N) { 
    10461077                WL_SETINT(name, WLC_SET_CHANNEL, val); 
     
    11001131        } 
    11011132 
     1133cprintf("set rate set %s\n",name); 
    11021134        /* Reset to hardware rateset (band may have changed) */ 
    11031135        WL_IOCTL(name, WLC_GET_RATESET, &rs, sizeof(wl_rateset_t)); 
    11041136        WL_IOCTL(name, WLC_SET_RATESET, &rs, sizeof(wl_rateset_t)); 
    11051137 
     1138cprintf("set g mode %s\n",name); 
    11061139        /* Set gmode */ 
    11071140        if (bandtype == WLC_BAND_2G) { 
     
    11101143 
    11111144                /* 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")); 
    11131146                WL_IOCTL(name, WLC_SET_GMODE, &gmode, sizeof(gmode)); 
    11141147 
    11151148                /* Set gmode protection override and control algorithm */ 
    11161149                strcat_r(prefix, "gmode_protection", tmp); 
    1117                 if (nvram_match(tmp, "auto")) { 
     1150                if (nvram_default_match(tmp, "auto","auto")) { 
    11181151                        override = WLC_G_PROTECTION_AUTO; 
    11191152                        control = WLC_G_PROTECTION_CTL_OVERLAP; 
     
    11231156        } 
    11241157 
     1158cprintf("set n prot mode %s\n",name); 
    11251159        /* Set nmode_protectoin */ 
    11261160        if (phytype == PHY_TYPE_N) { 
     
    11331167 
    11341168                strcat_r(prefix, "nreqd", tmp); 
    1135                 if (nvram_match(tmp, "0")) 
     1169                if (nvram_default_match(tmp, "0","0")) 
    11361170                        nmode = 0; 
    11371171                if (nvram_match(tmp, "1")) 
     
    11401174 
    11411175                strcat_r(prefix, "nmode", tmp); 
    1142                 if (nvram_match(tmp, "0")) 
     1176                if (nvram_default_match(tmp, "0","-1")) 
    11431177                        nmode = OFF; 
    11441178                if (nvram_match(tmp, "-1")) 
     
    11511185                strcat_r(prefix, "nmode_protection", tmp); 
    11521186 
    1153                 if (nvram_match(tmp, "auto")) { 
     1187                if (nvram_default_match(tmp, "auto","auto")) { 
    11541188                        override = WLC_PROTECTION_AUTO; 
    11551189                        control = WLC_PROTECTION_CTL_OVERLAP; 
     
    11721206         *   -set wme mode before set afterburner mode 
    11731207         */ 
     1208cprintf("set afterburner override %s\n",name); 
    11741209        val = OFF; 
    11751210        strcpy(var, "afterburner_override"); 
    11761211        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"); 
    11781213        val = strcmp(wme, "on") ? 0 : 1; 
     1214cprintf("set wme %s\n",name); 
    11791215        wl_iovar_set(name, "wme", &val, sizeof(val)); 
    11801216        if (val) 
    11811217                wlconf_set_wme(name, prefix); 
    11821218 
     1219cprintf("set btc mode %s\n",name); 
    11831220        /* 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")); 
    11851222 
    11861223        /* Set options based on capability */ 
     1224cprintf("get caps %s\n",name); 
    11871225        wl_iovar_get(name, "cap", (void *)tmp, 100); 
    11881226        foreach(var, tmp, next) { 
     
    12201258 
    12211259        strcat_r(prefix, "rateset", tmp); 
    1222         if (nvram_match(tmp, "all"))  { 
     1260        if (nvram_default_match(tmp, "all","default"))  { 
    12231261                /* Make all rates basic */ 
    12241262                for (i = 0; i < rs.count; i++) 
     
    12331271                } 
    12341272        } 
     1273cprintf("set btc mode %s\n",name); 
    12351274 
    12361275        /* Set BTC mode */ 
     
    12471286        } 
    12481287 
     1288cprintf("set rate set %s\n",name); 
    12491289        /* Set rateset */ 
    12501290        WL_IOCTL(name, WLC_SET_RATESET, &rs, sizeof(wl_rateset_t)); 
    12511291 
     1292cprintf("set plcphdr %s\n",name); 
    12521293        /* Allow short preamble override for b cards */ 
    12531294        if (phytype == PHY_TYPE_B || 
    12541295            (phytype == PHY_TYPE_G && (gmode == GMODE_LEGACY_B || gmode == GMODE_AUTO))) { 
    12551296                strcat_r(prefix, "plcphdr", tmp); 
    1256                 if (nvram_match(tmp, "long")) 
     1297                if (nvram_default_match(tmp, "long","long")) 
    12571298                        val = WLC_PLCP_AUTO; 
    12581299                else 
     
    12621303 
    12631304        /* 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; 
    12651306 
    12661307 
    12671308        /* Convert Auto mcsidx to Auto rate */ 
    12681309        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")); 
    12701311                /* -1 mcsidx used to designate AUTO rate */ 
    12711312                if (mcsidx == -1) 
     
    12781319                val = 11; 
    12791320 
     1321cprintf("set get rates %s\n",name); 
    12801322        /* it is band-blind. try both band */ 
    12811323        error_bg = wl_iovar_setint(name, "bg_rate", val); 
     
    13231365        } 
    13241366 
     1367cprintf("set mrates %s\n",name); 
    13251368        /* 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; 
    13271370        /* 1Mbps and 2 Mbps are not allowed in BTC pre-emptive mode */ 
    13281371        if (btc_mode == WL_BTC_PREMPT && (val == 2 || val == 4)) 
     
    13451388        } 
    13461389 
     1390cprintf("set frag tres %s\n",name); 
    13471391        /* 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")); 
    13491393        wl_iovar_setint(name, "fragthresh", val); 
    13501394 
    13511395        /* 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")); 
    13531397        wl_iovar_setint(name, "rtsthresh", val); 
    13541398 
    13551399        /* 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")); 
    13571401        WL_IOCTL(name, WLC_SET_DTIMPRD, &val, sizeof(val)); 
    13581402 
    13591403        /* 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")); 
    13611405        WL_IOCTL(name, WLC_SET_BCNPRD, &val, sizeof(val)); 
    13621406 
     1407cprintf("set wds %s\n",name); 
    13631408        /* AP only config */ 
    13641409        if (ap || apsta || wds) { 
    13651410                /* 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")); 
    13671412                WL_IOCTL(name, WLC_SET_LAZYWDS, &val, sizeof(val)); 
    13681413 
     
    13851430        } 
    13861431 
     1432cprintf("set wframeburst %s\n",name); 
    13871433        /* Set framebursting mode */ 
    13881434        if (btc_mode == WL_BTC_PREMPT) 
    13891435                val = FALSE; 
    13901436        else 
    1391                 val = nvram_match(strcat_r(prefix, "frameburst", tmp), "on"); 
     1437                val = nvram_default_match(strcat_r(prefix, "frameburst", tmp), "on","off"); 
    13921438        WL_IOCTL(name, WLC_SET_FAKEFRAG, &val, sizeof(val)); 
    13931439 
     1440cprintf("set rifs mode %s\n",name); 
    13941441        /* Set RIFS mode based on framebursting */ 
    13951442        if (phytype == PHY_TYPE_N) { 
     
    14011448        } 
    14021449 
     1450cprintf("set ba mode %s\n",name); 
    14031451        /* Override BA mode only if set to on/off */ 
    14041452        ba = nvram_safe_get(strcat_r(prefix, "ba", tmp)); 
     
    14081456                wl_iovar_setint(name, "ba", OFF); 
    14091457 
     1458cprintf("set up %s\n",name); 
    14101459        /* Bring the interface back up */ 
    14111460        WL_IOCTL(name, WLC_UP, NULL, 0); 
    14121461 
     1462cprintf("set antdiv mode %s\n",name); 
    14131463        /* 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")); 
    14151465        WL_IOCTL(name, WLC_SET_ANTDIV, &val, sizeof(val)); 
    14161466 
     
    14231473         */ 
    14241474        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")))) { 
    14261476                        if (phytype == PHY_TYPE_N) { 
    1427                                 chanspec_t chanspec = wlconf_auto_chanspec(name); 
     1477                                chanspec_t chanspec = wlconf_auto_chanspec(name,prefix); 
    14281478                                if (chanspec != 0) 
    14291479                                        { 
     
    14701520                /* NAS runs if we have an AKM or radius authentication */ 
    14711521                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"); 
    14741524 
    14751525                if (((ap || apsta) && !nas_will_run) || sta || wet) { 
Note: See TracChangeset for help on using the changeset viewer.