From owner-svn-src-all@FreeBSD.ORG Sat Jun 4 15:05:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5507E106566C; Sat, 4 Jun 2011 15:05:33 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 452E88FC12; Sat, 4 Jun 2011 15:05:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p54F5XYI014783; Sat, 4 Jun 2011 15:05:33 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p54F5XW6014781; Sat, 4 Jun 2011 15:05:33 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201106041505.p54F5XW6014781@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 4 Jun 2011 15:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222683 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 04 Jun 2011 15:05:33 -0000 Author: bschmidt Date: Sat Jun 4 15:05:32 2011 New Revision: 222683 URL: http://svn.freebsd.org/changeset/base/222683 Log: Certain adapters have HT40 support on some but not all channels. The Intel 4965 devices for example have HT40 on 2GHz completely disabled but it is still supported for 5GHz. To handle that in sta mode we need to check if we can "upgrade" to a HT40 channel after the association, if that is not possible but we are still announcing support to the remote side we are left with a very flabby connection. Reviewed by: adrian Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sat Jun 4 14:28:09 2011 (r222682) +++ head/sys/net80211/ieee80211_ht.c Sat Jun 4 15:05:32 2011 (r222683) @@ -2520,6 +2520,7 @@ ieee80211_add_htcap_body(uint8_t *frm, s frm[1] = (v) >> 8; \ frm += 2; \ } while (0) + struct ieee80211com *ic = ni->ni_ic; struct ieee80211vap *vap = ni->ni_vap; uint16_t caps, extcaps; int rxmax, density; @@ -2543,6 +2544,17 @@ ieee80211_add_htcap_body(uint8_t *frm, s /* use advertised setting (XXX locally constraint) */ rxmax = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); density = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); + + /* + * NB: Hardware might support HT40 on some but not all + * channels. We can't determine this earlier because only + * after association the channel is upgraded to HT based + * on the negotiated capabilities. + */ + if (ni->ni_chan != IEEE80211_CHAN_ANYC && + findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40U) == NULL && + findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40D) == NULL) + caps &= ~IEEE80211_HTCAP_CHWIDTH40; } else { /* override 20/40 use based on current channel */ if (IEEE80211_IS_CHAN_HT40(ni->ni_chan))