Date: Mon, 10 Dec 2012 00:16:39 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244062 - head/sys/net80211 Message-ID: <201212100016.qBA0GdPs069427@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Mon Dec 10 00:16:38 2012 New Revision: 244062 URL: http://svnweb.freebsd.org/changeset/base/244062 Log: Update the aggressive mode logic to also enable aggressive mode parameters in IBSSes. IBSS was just being plainly ignored here even though aggressive mode was 'on'. This still doesn't fix the "why are the WME parameters reset upon interface down/up" issue. PR: kern/165969 Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Sun Dec 9 23:56:29 2012 (r244061) +++ head/sys/net80211/ieee80211_proto.c Mon Dec 10 00:16:38 2012 (r244062) @@ -996,6 +996,7 @@ ieee80211_wme_updateparams_locked(struct struct wmeParams *chanp, *bssp; enum ieee80211_phymode mode; int i; + int do_aggrmode = 0; /* * Set up the channel access parameters for the physical @@ -1036,11 +1037,38 @@ ieee80211_wme_updateparams_locked(struct * BE uses agressive params to optimize performance of * legacy/non-QoS traffic. */ - if ((vap->iv_opmode == IEEE80211_M_HOSTAP && - (wme->wme_flags & WME_F_AGGRMODE) != 0) || - (vap->iv_opmode == IEEE80211_M_STA && - (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0) || - (vap->iv_flags & IEEE80211_F_WME) == 0) { + + /* Hostap? Only if aggressive mode is enabled */ + if (vap->iv_opmode == IEEE80211_M_HOSTAP && + (wme->wme_flags & WME_F_AGGRMODE) != 0) + do_aggrmode = 1; + + /* + * Station? Only if we're in a non-QoS BSS. + */ + else if ((vap->iv_opmode == IEEE80211_M_STA && + (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0)) + do_aggrmode = 1; + + /* + * IBSS? Only if we we have WME enabled. + */ + else if ((vap->iv_opmode == IEEE80211_M_IBSS) && + (vap->iv_flags & IEEE80211_F_WME)) + do_aggrmode = 1; + + /* + * If WME is disabled on this VAP, default to aggressive mode + * regardless of the configuration. + */ + if ((vap->iv_flags & IEEE80211_F_WME) == 0) + do_aggrmode = 1; + + /* XXX WDS? */ + + /* XXX MBSS? */ + + if (do_aggrmode) { chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE]; bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE]; @@ -1058,7 +1086,14 @@ ieee80211_wme_updateparams_locked(struct chanp->wmep_acm, chanp->wmep_aifsn, chanp->wmep_logcwmin, chanp->wmep_logcwmax, chanp->wmep_txopLimit); } - + + + /* + * Change the contention window based on the number of associated + * stations. If the number of associated stations is 1 and + * aggressive mode is enabled, lower the contention window even + * further. + */ if (vap->iv_opmode == IEEE80211_M_HOSTAP && ic->ic_sta_assoc < 2 && (wme->wme_flags & WME_F_AGGRMODE) != 0) { static const uint8_t logCwMin[IEEE80211_MODE_MAX] = { @@ -1082,8 +1117,15 @@ ieee80211_wme_updateparams_locked(struct IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, "update %s (chan+bss) logcwmin %u\n", ieee80211_wme_acnames[WME_AC_BE], chanp->wmep_logcwmin); - } - if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* XXX ibss? */ + } + + /* + * Arrange for the beacon update. + * + * XXX what about MBSS, WDS? + */ + if (vap->iv_opmode == IEEE80211_M_HOSTAP + || vap->iv_opmode == IEEE80211_M_IBSS) { /* * Arrange for a beacon update and bump the parameter * set number so associated stations load the new values.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212100016.qBA0GdPs069427>