From owner-svn-src-all@FreeBSD.ORG Thu Oct 31 02:21:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 80BEC6EC; Thu, 31 Oct 2013 02:21:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EB2425B4; Thu, 31 Oct 2013 02:21:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9V2LnMU061277; Thu, 31 Oct 2013 02:21:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9V2LnCh061276; Thu, 31 Oct 2013 02:21:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201310310221.r9V2LnCh061276@svn.freebsd.org> From: Adrian Chadd Date: Thu, 31 Oct 2013 02:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257415 - head/sys/dev/iwn 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: Thu, 31 Oct 2013 02:21:49 -0000 Author: adrian Date: Thu Oct 31 02:21:48 2013 New Revision: 257415 URL: http://svnweb.freebsd.org/changeset/base/257415 Log: Don't base the rate table selection based on the channel mode; it needs to check whether there are rate entries in there or not. PR: kern/183428 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Thu Oct 31 02:14:28 2013 (r257414) +++ head/sys/dev/iwn/if_iwn.c Thu Oct 31 02:21:48 2013 (r257415) @@ -4312,6 +4312,7 @@ iwn_set_link_quality(struct iwn_softc *s struct iwn_cmd_link_quality linkq; uint8_t txant; int i, rate, txrate; + int is_11n; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -4326,15 +4327,25 @@ iwn_set_link_quality(struct iwn_softc *s linkq.ampdu_threshold = 3; linkq.ampdu_limit = htole16(4000); /* 4ms */ + /* + * Are we using 11n rates? Ensure the channel is + * 11n _and_ we have some 11n rates, or don't + * try. + */ + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_htrates.rs_nrates > 0) + is_11n = 1; + else + is_11n = 0; + /* Start at highest available bit-rate. */ - if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + if (is_11n) txrate = ni->ni_htrates.rs_nrates - 1; else txrate = rs->rs_nrates - 1; for (i = 0; i < IWN_MAX_TX_RETRIES; i++) { uint32_t plcp; - if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + if (is_11n) rate = IEEE80211_RATE_MCS | txrate; else rate = RV(rs->rs_rates[txrate]);