summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-01-28 21:37:33 +0000
committeradrian <adrian@FreeBSD.org>2012-01-28 21:37:33 +0000
commit59383c87dd20ae9f81a013607a69ecdfe1e803b8 (patch)
tree43f4e04ba1080f36655a2b9cb4f258f481a1a097
parentf1318243b8c408ce39a4f983eaef73464b4547b4 (diff)
downloadFreeBSD-src-59383c87dd20ae9f81a013607a69ecdfe1e803b8.zip
FreeBSD-src-59383c87dd20ae9f81a013607a69ecdfe1e803b8.tar.gz
Two changes from my DFS work:
* Grab the net80211com lock when calling ieee80211_dfs_notify_radar(). * Use the tsf extend function to turn the 64 bit base TSF into a per- frame 64 bit TSF. This will improve radiotap logging (which will now have a (more) correct per-frame TSF, rather then the single TSF64 value read at the beginning of ath_rx_proc().
-rw-r--r--sys/dev/ath/if_ath.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 3215560..193e49e 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -3983,7 +3983,7 @@ ath_rx_proc(struct ath_softc *sc, int resched)
int len, type, ngood;
HAL_STATUS status;
int16_t nf;
- u_int64_t tsf;
+ u_int64_t tsf, rstamp;
int npkts = 0;
/* XXX we must not hold the ATH_LOCK here */
@@ -4054,6 +4054,12 @@ ath_rx_proc(struct ath_softc *sc, int resched)
TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list);
npkts++;
+ /*
+ * Calculate the correct 64 bit TSF given
+ * the TSF64 register value and rs_tstamp.
+ */
+ rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf);
+
/* These aren't specifically errors */
#ifdef AH_SUPPORT_AR5416
if (rs->rs_flags & HAL_RX_GI)
@@ -4085,7 +4091,7 @@ ath_rx_proc(struct ath_softc *sc, int resched)
bf->bf_dmamap,
BUS_DMASYNC_POSTREAD);
/* Now pass it to the radar processing code */
- ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs);
+ ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs);
}
/* Be suitably paranoid about receiving phy errors out of the stats array bounds */
@@ -4149,7 +4155,7 @@ rx_error:
len = rs->rs_datalen;
m->m_pkthdr.len = m->m_len = len;
bf->bf_m = NULL;
- ath_rx_tap(ifp, m, rs, tsf, nf);
+ ath_rx_tap(ifp, m, rs, rstamp, nf);
ieee80211_radiotap_rx_all(ic, m);
m_freem(m);
}
@@ -4246,7 +4252,7 @@ rx_accept:
* noise setting is filled in above.
*/
if (ieee80211_radiotap_active(ic))
- ath_rx_tap(ifp, m, rs, tsf, nf);
+ ath_rx_tap(ifp, m, rs, rstamp, nf);
/*
* From this point on we assume the frame is at least
@@ -6686,7 +6692,14 @@ ath_dfs_tasklet(void *p, int npending)
*/
if (ath_dfs_process_radar_event(sc, sc->sc_curchan)) {
/* DFS event found, initiate channel change */
+ /*
+ * XXX doesn't currently tell us whether the event
+ * XXX was found in the primary or extension
+ * XXX channel!
+ */
+ IEEE80211_LOCK(ic);
ieee80211_dfs_notify_radar(ic, sc->sc_curchan);
+ IEEE80211_UNLOCK(ic);
}
}
OpenPOWER on IntegriCloud