Show
Ignore:
Timestamp:
01/31/08 00:50:16 (4 years ago)
Author:
mtaylor
Message:

This patch adds iwpriv values for setting the
time in ms, or the number of beacons for the
beacon miss alarm. If we haven't had a beacon
in this period, the alarm is sounded and
action (i.e. roaming) is taken.

This patch changes the storage of the beacon
miss threshold to integral beacon count but
corrects the previous intent.

The default beacon miss alarm is going to be
850ms which is half way between the two hard
coded limits that were there before.

The old hard coded limits assumed that the
beacon interval was 100ms and set the limit to
10 (1000ms) for software beacon miss timer
and 7 for hardware beacon miss timer.

The new default is 850ms (the midpoint between
the two previous defaults). This value is rounded
up to the next nearest beacon interval.

There is no upper bound on the beacon miss
threshold specified, since it may need to be
wildly inflated with 25ms beacon interval, or
wildly reduced with 1000ms beacon interval.

The minimum is still 2 beacons, regardless of
the beacon interval.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • madwifi/trunk/net80211/ieee80211_wireless.c

    r3279 r3314  
    22652265        unsigned int value = i[1];              /* NB: most values are TYPE_INT */ 
    22662266        int retv = 0; 
    2267         int j, caps
     2267        int j, caps, bmiss
    22682268        const struct ieee80211_authenticator *auth; 
    22692269        const struct ieee80211_aclator *acl; 
     
    25682568                        retv = EINVAL; 
    25692569                break; 
     2570        case IEEE80211_PARAM_BEACON_MISS_THRESH_MS: 
     2571                if ((vap->iv_opmode != IEEE80211_M_IBSS) && 
     2572                    (vap->iv_opmode != IEEE80211_M_STA)) 
     2573                        return -EOPNOTSUPP; 
     2574                /* Convert millis to TU to next highest integral # beacons */ 
     2575                bmiss = howmany(roundup(IEEE80211_MS_TO_TU(value),  
     2576                                ic->ic_lintval), ic->ic_lintval); 
     2577                if (IEEE80211_BMISSTHRESH_VALID(bmiss)) { 
     2578                        ic->ic_bmissthreshold = bmiss; 
     2579                        retv = ENETRESET;               /* requires restart */ 
     2580                } else 
     2581                        retv = EINVAL; 
     2582                break; 
     2583        case IEEE80211_PARAM_BEACON_MISS_THRESH: 
     2584                if ((vap->iv_opmode != IEEE80211_M_IBSS) && 
     2585                    (vap->iv_opmode != IEEE80211_M_STA)) 
     2586                        return -EOPNOTSUPP; 
     2587                if (IEEE80211_BMISSTHRESH_VALID(value)) { 
     2588                        ic->ic_bmissthreshold = value; 
     2589                        retv = ENETRESET;               /* requires restart */ 
     2590                } else 
     2591                        retv = EINVAL; 
     2592                break; 
    25702593        case IEEE80211_PARAM_BEACON_INTERVAL: 
    25712594                if ((vap->iv_opmode != IEEE80211_M_HOSTAP) && 
     
    25732596                        return -EOPNOTSUPP; 
    25742597                if (IEEE80211_BINTVAL_VALID(value)) { 
    2575                         ic->ic_lintval = value;         /* XXX multi-bss */ 
     2598                        /* Convert millis to TU to next highest integral # beacons */ 
     2599                        bmiss = howmany(roundup(ic->ic_bmissthreshold * ic->ic_lintval,  
     2600                                        value), value); 
     2601                        /* Adjust beacon miss interval during a beacon interval 
     2602                         * change so that the duration of missed beacons allowed 
     2603                         * is greater than or equal to the old allowed duration  
     2604                         * of missed beacons.  */ 
     2605                        ic->ic_bmissthreshold = bmiss; 
     2606                        ic->ic_lintval = value; 
    25762607                        retv = ENETRESET;               /* requires restart */ 
    25772608                } else 
     
    30233054        case IEEE80211_PARAM_DTIM_PERIOD: 
    30243055                param[0] = vap->iv_dtim_period; 
     3056                break; 
     3057        case IEEE80211_PARAM_BEACON_MISS_THRESH_MS: 
     3058                param[0] = IEEE80211_TU_TO_MS( 
     3059                        vap->iv_ic->ic_bmissthreshold * vap->iv_ic->ic_lintval); 
     3060                break; 
     3061        case IEEE80211_PARAM_BEACON_MISS_THRESH: 
     3062                param[0] = vap->iv_ic->ic_bmissthreshold; 
    30253063                break; 
    30263064        case IEEE80211_PARAM_BEACON_INTERVAL: 
     
    53825420        { IEEE80211_PARAM_BEACON_INTERVAL, 
    53835421          0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_bintval" }, 
     5422        { IEEE80211_PARAM_BEACON_MISS_THRESH_MS, 
     5423          IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "bmiss_ms" }, 
     5424        { IEEE80211_PARAM_BEACON_MISS_THRESH_MS, 
     5425          0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_bmiss_ms" }, 
     5426        { IEEE80211_PARAM_BEACON_MISS_THRESH, 
     5427          IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "bmiss" }, 
     5428        { IEEE80211_PARAM_BEACON_MISS_THRESH, 
     5429          0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_bmiss" }, 
    53845430        { IEEE80211_PARAM_DOTH, 
    53855431          IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "doth" },