From owner-svn-src-all@FreeBSD.ORG Mon Dec 10 00:16:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D3B1BB9; Mon, 10 Dec 2012 00:16:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7ED168FC08; Mon, 10 Dec 2012 00:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBA0GdNO069428; Mon, 10 Dec 2012 00:16:39 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBA0GdPs069427; Mon, 10 Dec 2012 00:16:39 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201212100016.qBA0GdPs069427@svn.freebsd.org> From: Adrian Chadd Date: Mon, 10 Dec 2012 00:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244062 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2012 00:16:39 -0000 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.