From owner-svn-src-all@FreeBSD.ORG Wed Feb 27 00:49:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 11AD12C8; Wed, 27 Feb 2013 00:49:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 035F4E01; Wed, 27 Feb 2013 00:49:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1R0nWn5031492; Wed, 27 Feb 2013 00:49:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1R0nWjC031491; Wed, 27 Feb 2013 00:49:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201302270049.r1R0nWjC031491@svn.freebsd.org> From: Adrian Chadd Date: Wed, 27 Feb 2013 00:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r247368 - head/sys/dev/ath 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: Wed, 27 Feb 2013 00:49:33 -0000 Author: adrian Date: Wed Feb 27 00:49:32 2013 New Revision: 247368 URL: http://svnweb.freebsd.org/changeset/base/247368 Log: Enable STBC for the given rate series if it's negotiated: * If both ends have negotiated (at least) one stream; * Only if it's a single stream rate (MCS0-7); * Only if there's more than one TX chain enabled. Tested: * AR9280 STA mode -> Atheros AP; tested both MCS2 (STBC) and MCS12 (no STBC.) Verified using athalq to inspect the TX descriptors. TODO: * Test AR5416 - no STBC should be enabled; * Test AR9280 with one TX chain enabled - no STBC should be enabled. 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 Wed Feb 27 00:35:40 2013 (r247367) +++ head/sys/dev/ath/if_ath_tx_ht.c Wed Feb 27 00:49:32 2013 (r247368) @@ -536,17 +536,30 @@ ath_rateseries_setup(struct ath_softc *s series[i].RateFlags |= HAL_RATESERIES_HALFGI; /* - * XXX TODO: STBC if it's possible + * Setup rate and TX power cap for this series. */ + series[i].Rate = rt->info[rc[i].rix].rateCode; + series[i].RateIndex = rc[i].rix; + series[i].tx_power_cap = 0x3f; /* XXX for now */ + + + /* + * If we have STBC TX enabled and the receiver + * can receive (at least) 1 stream STBC, AND it's + * MCS 0-7, AND we have at least two chains enabled, + * enable STBC. + */ + if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC && + ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM && + (sc->sc_cur_txchainmask > 1) && + HT_RC_2_STREAMS(series[i].Rate) == 1) { + series[i].RateFlags |= HAL_RATESERIES_STBC; + } /* * XXX TODO: LDPC if it's possible */ - series[i].Rate = rt->info[rc[i].rix].rateCode; - series[i].RateIndex = rc[i].rix; - series[i].tx_power_cap = 0x3f; /* XXX for now */ - /* * PktDuration doesn't include slot, ACK, RTS, etc timing - * it's just the packet duration