From owner-svn-src-all@FreeBSD.ORG Sun May 10 06:57:54 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1A97AA; Sun, 10 May 2015 06:57:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C76E8179C; Sun, 10 May 2015 06:57:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4A6vrY2037126; Sun, 10 May 2015 06:57:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4A6vrm5037125; Sun, 10 May 2015 06:57:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201505100657.t4A6vrm5037125@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 10 May 2015 06:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282704 - 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.20 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: Sun, 10 May 2015 06:57:54 -0000 Author: adrian Date: Sun May 10 06:57:53 2015 New Revision: 282704 URL: https://svnweb.freebsd.org/changeset/base/282704 Log: Attempt to address Bug #176201 - don't advertise what the AP announced to us. Instead, advertise what we can do based on what the AP says and what we're capped at by the VAP settings. For non-STA modes we still advertise what our VAP settings are. It may be that I've over-complicated this and instead of capping things we can just always announce what we're capable of. But this should at least stop the blatantly wrong handling of A-MPDU parameters. (I'll happily simplify things if someone can dig up a replacement, better compliant behaviour.) PR: kern/176201 Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun May 10 04:33:01 2015 (r282703) +++ head/sys/net80211/ieee80211_ht.c Sun May 10 06:57:53 2015 (r282704) @@ -2662,10 +2662,24 @@ ieee80211_add_htcap_body(uint8_t *frm, s caps |= IEEE80211_HTCAP_CHWIDTH40; else caps &= ~IEEE80211_HTCAP_CHWIDTH40; - /* use advertised setting (XXX locally constraint) */ + + /* Start by using the advertised settings */ rxmax = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); density = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); + /* Cap at VAP rxmax */ + if (rxmax > vap->iv_ampdu_rxmax) + rxmax = vap->iv_ampdu_rxmax; + + /* + * If the VAP ampdu density value greater, use that. + * + * (Larger density value == larger minimum gap between A-MPDU + * subframes.) + */ + if (vap->iv_ampdu_density > density) + density = vap->iv_ampdu_density; + /* * NB: Hardware might support HT40 on some but not all * channels. We can't determine this earlier because only @@ -2682,9 +2696,12 @@ ieee80211_add_htcap_body(uint8_t *frm, s caps |= IEEE80211_HTCAP_CHWIDTH40; else caps &= ~IEEE80211_HTCAP_CHWIDTH40; + + /* XXX TODO should it start by using advertised settings? */ rxmax = vap->iv_ampdu_rxmax; density = vap->iv_ampdu_density; } + /* adjust short GI based on channel and config */ if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) == 0) caps &= ~IEEE80211_HTCAP_SHORTGI20;