From owner-svn-src-head@FreeBSD.ORG Mon Feb 21 03:52:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 763F5106564A; Mon, 21 Feb 2011 03:52:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AAA28FC12; Mon, 21 Feb 2011 03:52:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1L3qqNi054940; Mon, 21 Feb 2011 03:52:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1L3qq9F054938; Mon, 21 Feb 2011 03:52:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201102210352.p1L3qq9F054938@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Feb 2011 03:52:52 +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: r218907 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 21 Feb 2011 03:52:52 -0000 Author: adrian Date: Mon Feb 21 03:52:51 2011 New Revision: 218907 URL: http://svn.freebsd.org/changeset/base/218907 Log: Implement setting the short preamble bit if it's needed for the current node. Short preamble rates are only for legacy rates; MCS rate codes don't have a short preamble code like this. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Mon Feb 21 01:20:56 2011 (r218906) +++ head/sys/dev/ath/if_ath_tx_ht.c Mon Feb 21 03:52:51 2011 (r218907) @@ -103,7 +103,6 @@ ath_rateseries_setup(struct ath_softc *s HAL_BOOL shortPreamble = AH_FALSE; const HAL_RATE_TABLE *rt = sc->sc_currates; int i; - uint8_t txrate; if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE)) @@ -111,7 +110,6 @@ ath_rateseries_setup(struct ath_softc *s memset(series, 0, sizeof(HAL_11N_RATE_SERIES) * 4); for (i = 0; i < 4; i++) { - txrate = rt->info[rix[i]].rateCode; series[i].Tries = try[i]; series[i].ChSel = sc->sc_txchainmask; if (ic->ic_protmode == IEEE80211_PROT_RTSCTS || @@ -128,14 +126,16 @@ ath_rateseries_setup(struct ath_softc *s if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) series[i].RateFlags |= HAL_RATESERIES_HALFGI; - /* XXX should this check the short preamble value should be set for legacy rates? -adrian */ - series[i].Rate = txrate; + series[i].Rate = rt->info[rix[i]].rateCode; + /* the short preamble field is only applicable for non-MCS rates */ + if (shortPreamble && ! (series[i].Rate & IEEE80211_RATE_MCS)) + series[i].Rate |= rt->info[rix[i]].shortPreamble; /* PktDuration doesn't include slot, ACK, RTS, etc timing - it's just the packet duration */ - if (txrate & IEEE80211_RATE_MCS) { + if (series[i].Rate & IEEE80211_RATE_MCS) { series[i].PktDuration = ath_computedur_ht(pktlen - , txrate + , series[i].Rate , ic->ic_txstream , (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) , series[i].RateFlags & HAL_RATESERIES_HALFGI);