From owner-svn-src-head@FreeBSD.ORG Fri Feb 27 04:45:48 2015 Return-Path: Delivered-To: svn-src-head@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 469DEF2E; Fri, 27 Feb 2015 04:45:48 +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 27FEEE4B; Fri, 27 Feb 2015 04:45:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1R4jmiq037044; Fri, 27 Feb 2015 04:45:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1R4jmQh037043; Fri, 27 Feb 2015 04:45:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201502270445.t1R4jmQh037043@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 27 Feb 2015 04:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279350 - 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-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2015 04:45:48 -0000 Author: adrian Date: Fri Feb 27 04:45:47 2015 New Revision: 279350 URL: https://svnweb.freebsd.org/changeset/base/279350 Log: Fix kern/196290 - don't announce 11n HTINFO rates if the channel is configured as 11b. This came up when debugging other issues surrounding scanning and channel modes. What's going on: * The VAP comes up as an 11b VAP, but on an 11n capable NIC; * .. it announces HTINFO and MCS rates; * The AP thinks it's an 11n capable device and transmits 11n frames to the STA; * But the STA is in 11b mode, and thus doesn't receive/ACK the frames. It didn't happen for the ath(4) devices as the AR5416/AR9300 HALs unconditionally enable MCS frame reception, even if the channel mode is not 11n. But the Intel NICs are configured in 11b/11a/11g modes when doing those, even if 11n is enabled and available. So, don't announce 11n capabilities if the VAP isn't on an 11n channel when sending management assocation request / reassociation request frames. TODO: * Lots more testing - 11n should be "upgraded" after association, and I just want to make sure I haven't broken 11n upgrade. I shouldn't have - this is only happening for /sending/ association requests, which APs aren't doing. Tested: * ath(4) APs (AR9331, AR7161+AR9280, AR934x) * AR5416, STA mode * Intel 5100, STA mode PR: kern/196290 Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Feb 27 02:56:58 2015 (r279349) +++ head/sys/net80211/ieee80211_output.c Fri Feb 27 04:45:47 2015 (r279350) @@ -2322,18 +2322,33 @@ ieee80211_send_mgmt(struct ieee80211_nod ic->ic_curchan); frm = ieee80211_add_supportedchannels(frm, ic); } + + /* + * Check the channel - we may be using an 11n NIC with an + * 11n capable station, but we're configured to be an 11b + * channel. + */ if ((vap->iv_flags_ht & IEEE80211_FHT_HT) && + IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_ies.htcap_ie != NULL && - ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_HTCAP) + ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_HTCAP) { frm = ieee80211_add_htcap(frm, ni); + } frm = ieee80211_add_wpa(frm, vap); if ((ic->ic_flags & IEEE80211_F_WME) && ni->ni_ies.wme_ie != NULL) frm = ieee80211_add_wme_info(frm, &ic->ic_wme); + + /* + * Same deal - only send HT info if we're on an 11n + * capable channel. + */ if ((vap->iv_flags_ht & IEEE80211_FHT_HT) && + IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_ies.htcap_ie != NULL && - ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_VENDOR) + ni->ni_ies.htcap_ie[0] == IEEE80211_ELEMID_VENDOR) { frm = ieee80211_add_htcap_vendor(frm, ni); + } #ifdef IEEE80211_SUPPORT_SUPERG if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_F_ATHEROS)) { frm = ieee80211_add_ath(frm,