summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-11-28 01:55:22 +0000
committeradrian <adrian@FreeBSD.org>2012-11-28 01:55:22 +0000
commit3200e6c453ea1d5fd9a33bbe4fa5a1d6d9152d0e (patch)
tree8b921f758415bc84183dec4da3e436da5ea87863
parent0077f34174770588e5d317fb335867216484d7f4 (diff)
downloadFreeBSD-src-3200e6c453ea1d5fd9a33bbe4fa5a1d6d9152d0e.zip
FreeBSD-src-3200e6c453ea1d5fd9a33bbe4fa5a1d6d9152d0e.tar.gz
Pull out the debugging code from the critical path and make sure it
happens _after_ all of the time delta calculations.
-rw-r--r--sys/dev/ath/if_ath_tdma.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/sys/dev/ath/if_ath_tdma.c b/sys/dev/ath/if_ath_tdma.c
index 5b82069..5cfe238 100644
--- a/sys/dev/ath/if_ath_tdma.c
+++ b/sys/dev/ath/if_ath_tdma.c
@@ -402,28 +402,6 @@ ath_tdma_update(struct ieee80211_node *ni,
* 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 *ni,
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 *ni,
}
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
OpenPOWER on IntegriCloud