Fixup sta inactivity handling:
o reset ni_inact when ni_inact_reload is changed so we're assured a valid setting o never let ni_inact go negative o add a knob to disable hostap sta idle handling (e.g. so it can be done by a user application) o remove bogus reload on associate Reviewed by: avatar Approved by: re (blanket wireless)
This commit is contained in:
parent
5c096cfbe5
commit
c066143c08
@ -1105,6 +1105,9 @@ ieee80211_ioctl_get80211(struct ieee80211com *ic, u_long cmd, struct ieee80211re
|
||||
case IEEE80211_IOC_HTCOMPAT:
|
||||
ireq->i_val = (ic->ic_flags_ext & IEEE80211_FEXT_HTCOMPAT) != 0;
|
||||
break;
|
||||
case IEEE80211_IOC_INACTIVITY:
|
||||
ireq->i_val = (ic->ic_flags_ext & IEEE80211_FEXT_INACT) != 0;
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
@ -2470,6 +2473,12 @@ ieee80211_ioctl_set80211(struct ieee80211com *ic, u_long cmd, struct ieee80211re
|
||||
IEEE80211_IS_CHAN_HT(ic->ic_bsschan))
|
||||
error = ENETRESET;
|
||||
break;
|
||||
case IEEE80211_IOC_INACTIVITY:
|
||||
if (ireq->i_val)
|
||||
ic->ic_flags_ext |= IEEE80211_FEXT_INACT;
|
||||
else
|
||||
ic->ic_flags_ext &= ~IEEE80211_FEXT_INACT;
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
|
@ -491,6 +491,7 @@ struct ieee80211req {
|
||||
#define IEEE80211_IOC_COUNTRYCODE 90 /* ISO country code */
|
||||
#define IEEE80211_IOC_LOCATION 91 /* indoor/outdoor/anywhere */
|
||||
#define IEEE80211_IOC_HTCOMPAT 92 /* support pre-D1.10 HT ie's */
|
||||
#define IEEE80211_IOC_INACTIVITY 94 /* sta inactivity handling */
|
||||
|
||||
/*
|
||||
* Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
|
||||
|
@ -99,6 +99,8 @@ ieee80211_node_attach(struct ieee80211com *ic)
|
||||
|
||||
/* NB: driver should override */
|
||||
ic->ic_max_aid = IEEE80211_AID_DEF;
|
||||
|
||||
ic->ic_flags_ext |= IEEE80211_FEXT_INACT; /* inactivity processing */
|
||||
}
|
||||
|
||||
void
|
||||
@ -186,12 +188,16 @@ ieee80211_node_authorize(struct ieee80211_node *ni)
|
||||
|
||||
ni->ni_flags |= IEEE80211_NODE_AUTH;
|
||||
ni->ni_inact_reload = ic->ic_inact_run;
|
||||
ni->ni_inact = ni->ni_inact_reload;
|
||||
}
|
||||
|
||||
void
|
||||
ieee80211_node_unauthorize(struct ieee80211_node *ni)
|
||||
{
|
||||
ni->ni_flags &= ~IEEE80211_NODE_AUTH;
|
||||
ni->ni_inact_reload = ic->ic_inact_auth;
|
||||
if (ni->ni_inact > ni->ni_inact_reload)
|
||||
ni->ni_inact = ni->ni_inact_reload;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1468,13 +1474,14 @@ ieee80211_timeout_stations(struct ieee80211_node_table *nt)
|
||||
m_freem(ni->ni_rxfrag[0]);
|
||||
ni->ni_rxfrag[0] = NULL;
|
||||
}
|
||||
if (ni->ni_inact > 0)
|
||||
ni->ni_inact--;
|
||||
/*
|
||||
* Special case ourself; we may be idle for extended periods
|
||||
* of time and regardless reclaiming our state is wrong.
|
||||
*/
|
||||
if (ni == ic->ic_bss)
|
||||
continue;
|
||||
ni->ni_inact--;
|
||||
if (ni->ni_associd != 0 || isadhoc) {
|
||||
/*
|
||||
* Age frames on the power save queue.
|
||||
@ -1495,8 +1502,9 @@ ieee80211_timeout_stations(struct ieee80211_node_table *nt)
|
||||
* of); this will get fixed more properly
|
||||
* soon with better handling of the rate set.
|
||||
*/
|
||||
if (0 < ni->ni_inact &&
|
||||
ni->ni_inact <= ic->ic_inact_probe &&
|
||||
if ((ic->ic_flags_ext & IEEE80211_FEXT_INACT) &&
|
||||
(0 < ni->ni_inact &&
|
||||
ni->ni_inact <= ic->ic_inact_probe) &&
|
||||
ni->ni_rates.rs_nrates != 0) {
|
||||
IEEE80211_NOTE(ic,
|
||||
IEEE80211_MSG_INACT | IEEE80211_MSG_NODE,
|
||||
@ -1516,7 +1524,8 @@ ieee80211_timeout_stations(struct ieee80211_node_table *nt)
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
if (ni->ni_inact <= 0) {
|
||||
if ((ic->ic_flags_ext & IEEE80211_FEXT_INACT) &&
|
||||
ni->ni_inact <= 0) {
|
||||
IEEE80211_NOTE(ic,
|
||||
IEEE80211_MSG_INACT | IEEE80211_MSG_NODE, ni,
|
||||
"station timed out due to inactivity "
|
||||
@ -1742,8 +1751,6 @@ ieee80211_node_join(struct ieee80211com *ic, struct ieee80211_node *ni, int resp
|
||||
/* give driver a chance to setup state like ni_txrate */
|
||||
if (ic->ic_newassoc != NULL)
|
||||
ic->ic_newassoc(ni, newassoc);
|
||||
ni->ni_inact_reload = ic->ic_inact_auth;
|
||||
ni->ni_inact = ni->ni_inact_reload;
|
||||
IEEE80211_SEND_MGMT(ic, ni, resp, IEEE80211_STATUS_SUCCESS);
|
||||
/* tell the authenticator about new station */
|
||||
if (ic->ic_auth->ia_node_join != NULL)
|
||||
|
@ -333,6 +333,7 @@ struct ieee80211com {
|
||||
|
||||
/* ic_flags_ext */
|
||||
#define IEEE80211_FEXT_WDS 0x00000001 /* CONF: 4 addr allowed */
|
||||
#define IEEE80211_FEXT_INACT 0x00000002 /* CONF: sta inact handling */
|
||||
/* 0x00000006 reserved */
|
||||
#define IEEE80211_FEXT_BGSCAN 0x00000008 /* STATUS: complete bgscan */
|
||||
#define IEEE80211_FEXT_ERPUPDATE 0x00000200 /* STATUS: update ERP element */
|
||||
|
Loading…
Reference in New Issue
Block a user