From owner-svn-src-all@FreeBSD.ORG Wed Nov 28 01:55:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A68EA501; Wed, 28 Nov 2012 01:55:22 +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 82D5F8FC08; Wed, 28 Nov 2012 01:55:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAS1tM1k007726; Wed, 28 Nov 2012 01:55:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAS1tM3c007725; Wed, 28 Nov 2012 01:55:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211280155.qAS1tM3c007725@svn.freebsd.org> From: Adrian Chadd Date: Wed, 28 Nov 2012 01:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243642 - 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, 28 Nov 2012 01:55:22 -0000 Author: adrian Date: Wed Nov 28 01:55:22 2012 New Revision: 243642 URL: http://svnweb.freebsd.org/changeset/base/243642 Log: Pull out the debugging code from the critical path and make sure it happens _after_ all of the time delta calculations. Modified: head/sys/dev/ath/if_ath_tdma.c Modified: head/sys/dev/ath/if_ath_tdma.c ============================================================================== --- head/sys/dev/ath/if_ath_tdma.c Wed Nov 28 00:36:40 2012 (r243641) +++ head/sys/dev/ath/if_ath_tdma.c Wed Nov 28 01:55:22 2012 (r243642) @@ -402,28 +402,6 @@ ath_tdma_update(struct ieee80211_node *n * not just 0..65535 TU. */ nextslottu = TSF_TO_TU(nextslot>>32, nextslot); - DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, - "rs->rstamp %llu rstamp %llu tsf %llu txtime %d, nextslot %llu, nextslottu %d, nextslottume %d\n", - (unsigned long long) rs->rs_tstamp, rstamp, tsf, txtime, nextslot, nextslottu, TSF_TO_TU(nextslot >> 32, nextslot)); - DPRINTF(sc, ATH_DEBUG_TDMA, - " beacon tstamp: %llu (0x%016llx)\n", - le64toh(ni->ni_tstamp.tsf), - le64toh(ni->ni_tstamp.tsf)); - -#ifdef ATH_DEBUG_ALQ - if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE)) { - struct if_ath_alq_tdma_beacon_state t; - t.rx_tsf = htobe64(rstamp); - t.beacon_tsf = htobe64(le64toh(ni->ni_tstamp.tsf)); - t.tsf64 = htobe64(tsf); - t.nextslot_tsf = htobe64(nextslot); - t.nextslot_tu = htobe32(nextslottu); - t.txtime = htobe32(txtime); - if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE, - sizeof(t), (char *) &t); - } -#endif - /* * Retrieve the hardware NextTBTT in usecs * and calculate the difference between what the @@ -459,27 +437,22 @@ ath_tdma_update(struct ieee80211_node *n tsfdelta = (int32_t)((nextslot % TU_TO_TSF(HAL_BEACON_PERIOD + 1)) - nexttbtt); DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, + "rs->rstamp %llu rstamp %llu tsf %llu txtime %d, nextslot %llu, " + "nextslottu %d, nextslottume %d\n", + (unsigned long long) rs->rs_tstamp, rstamp, tsf, txtime, + nextslot, nextslottu, TSF_TO_TU(nextslot >> 32, nextslot)); + DPRINTF(sc, ATH_DEBUG_TDMA, + " beacon tstamp: %llu (0x%016llx)\n", + le64toh(ni->ni_tstamp.tsf), + le64toh(ni->ni_tstamp.tsf)); + + DPRINTF(sc, ATH_DEBUG_TDMA_TIMER, "nexttbtt %llu (0x%08llx) tsfdelta %d avg +%d/-%d\n", nexttbtt, (long long) nexttbtt, tsfdelta, TDMA_AVG(sc->sc_avgtsfdeltap), TDMA_AVG(sc->sc_avgtsfdeltam)); -#ifdef ATH_DEBUG_ALQ - if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC)) { - struct if_ath_alq_tdma_slot_calc t; - - t.nexttbtt = htobe64(nexttbtt_full); - t.next_slot = htobe64(nextslot); - t.tsfdelta = htobe32(tsfdelta); - t.avg_plus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltap)); - t.avg_minus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltam)); - - if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC, - sizeof(t), (char *) &t); - } -#endif - if (tsfdelta < 0) { TDMA_SAMPLE(sc->sc_avgtsfdeltap, 0); TDMA_SAMPLE(sc->sc_avgtsfdeltam, -tsfdelta); @@ -496,6 +469,33 @@ ath_tdma_update(struct ieee80211_node *n } tudelta = nextslottu - TSF_TO_TU(nexttbtt_full >> 32, nexttbtt_full); +#ifdef ATH_DEBUG_ALQ + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE)) { + struct if_ath_alq_tdma_beacon_state t; + t.rx_tsf = htobe64(rstamp); + t.beacon_tsf = htobe64(le64toh(ni->ni_tstamp.tsf)); + t.tsf64 = htobe64(tsf); + t.nextslot_tsf = htobe64(nextslot); + t.nextslot_tu = htobe32(nextslottu); + t.txtime = htobe32(txtime); + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_BEACON_STATE, + sizeof(t), (char *) &t); + } + + if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC)) { + struct if_ath_alq_tdma_slot_calc t; + + t.nexttbtt = htobe64(nexttbtt_full); + t.next_slot = htobe64(nextslot); + t.tsfdelta = htobe32(tsfdelta); + t.avg_plus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltap)); + t.avg_minus = htobe32(TDMA_AVG(sc->sc_avgtsfdeltam)); + + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TDMA_SLOT_CALC, + sizeof(t), (char *) &t); + } +#endif + /* * Copy sender's timetstamp into tdma ie so they can * calculate roundtrip time. We submit a beacon frame