From owner-svn-src-head@freebsd.org Tue Jul 19 00:27:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F922B9DCD3; Tue, 19 Jul 2016 00:27:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E259F1172; Tue, 19 Jul 2016 00:27:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6J0RI63001363; Tue, 19 Jul 2016 00:27:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6J0RInI001362; Tue, 19 Jul 2016 00:27:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201607190027.u6J0RInI001362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 19 Jul 2016 00:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303015 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 19 Jul 2016 00:27:19 -0000 Author: adrian Date: Tue Jul 19 00:27:17 2016 New Revision: 303015 URL: https://svnweb.freebsd.org/changeset/base/303015 Log: [ath] don't do LDPC, STBC or short-gi for locationing frames. The 11n duration calculation function in net80211 and the HAL round /up/ the duration calculation for short-gi, so we can't use that. The 11n duration calculation doesn't know about the extra symbol time needed for STBC, nor the LDPC encoding duration, so we can't use that. This (along with other, local hacks) allow the locationing services to get down to around 200nS (yes, nanoseconds) of variance when speaking to a "good" AP. Tested: * AR9380, STA mode, local locationing frame hacks 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 Tue Jul 19 00:25:27 2016 (r303014) +++ head/sys/dev/ath/if_ath_tx_ht.c Tue Jul 19 00:27:17 2016 (r303015) @@ -242,6 +242,14 @@ ath_tx_rate_fill_rcflags(struct ath_soft if ((ni->ni_vap->iv_htcaps & IEEE80211_HTCAP_LDPC) && (ni->ni_htcap & IEEE80211_HTCAP_LDPC)) do_ldpc = 1; + + /* + * The 11n duration calculation doesn't know about LDPC, + * so don't enable it for positioning. + */ + if (bf->bf_flags & ATH_BUF_TOA_PROBE) + do_ldpc = 0; + do_stbc = 0; for (i = 0; i < ATH_RC_NUM; i++) { @@ -279,29 +287,43 @@ ath_tx_rate_fill_rcflags(struct ath_soft if (ni->ni_chw == 40) rc[i].flags |= ATH_RC_CW40_FLAG; + /* + * NOTE: Don't do short-gi for positioning frames. + * + * For now, the ath_hal and net80211 HT duration + * calculation rounds up the 11n data txtime + * to the nearest multiple of 3.6 microseconds + * and doesn't return the fractional part, so + * we are always "out" by some amount. + */ if (ni->ni_chw == 40 && ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI40 && ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40 && - vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) + vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40 && + (bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) { rc[i].flags |= ATH_RC_SGI_FLAG; + } if (ni->ni_chw == 20 && ic->ic_htcaps & IEEE80211_HTCAP_SHORTGI20 && ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20 && - vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20) + vap->iv_flags_ht & IEEE80211_FHT_SHORTGI20 && + (bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) { rc[i].flags |= ATH_RC_SGI_FLAG; + } /* * 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. + * and we're not doing positioning, enable STBC. */ if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC && ni->ni_vap->iv_flags_ht & IEEE80211_FHT_STBC_TX && ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM && (sc->sc_cur_txchainmask > 1) && - HT_RC_2_STREAMS(rate) == 1) { + (HT_RC_2_STREAMS(rate) == 1) && + (bf->bf_flags & ATH_BUF_TOA_PROBE) == 0) { rc[i].flags |= ATH_RC_STBC_FLAG; do_stbc = 1; }