From owner-svn-src-head@FreeBSD.ORG Sat Jan 28 21:37:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B549106566B; Sat, 28 Jan 2012 21:37:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3708FC0C; Sat, 28 Jan 2012 21:37:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SLbY5j099556; Sat, 28 Jan 2012 21:37:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SLbYGB099554; Sat, 28 Jan 2012 21:37:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201282137.q0SLbYGB099554@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jan 2012 21:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230657 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 28 Jan 2012 21:37:34 -0000 Author: adrian Date: Sat Jan 28 21:37:33 2012 New Revision: 230657 URL: http://svn.freebsd.org/changeset/base/230657 Log: 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(). Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jan 28 21:21:05 2012 (r230656) +++ head/sys/dev/ath/if_ath.c Sat Jan 28 21:37:33 2012 (r230657) @@ -3983,7 +3983,7 @@ ath_rx_proc(struct ath_softc *sc, int re 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 re 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 re 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); } }