From owner-p4-projects@FreeBSD.ORG Thu Nov 24 05:13:53 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4D75616A421; Thu, 24 Nov 2005 05:13:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F2EA16A41F for ; Thu, 24 Nov 2005 05:13:53 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70D4543D66 for ; Thu, 24 Nov 2005 05:13:52 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jAO5Dqeu048649 for ; Thu, 24 Nov 2005 05:13:52 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jAO5Dqi4048646 for perforce@freebsd.org; Thu, 24 Nov 2005 05:13:52 GMT (envelope-from sam@freebsd.org) Date: Thu, 24 Nov 2005 05:13:52 GMT Message-Id: <200511240513.jAO5Dqi4048646@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 87169 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Nov 2005 05:13:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=87169 Change 87169 by sam@sam_ebb on 2005/11/24 05:12:58 include local tsf in rx radiotap header Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#114 edit .. //depot/projects/wifi/sys/dev/ath/if_athioctl.h#12 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#114 (text+ko) ==== @@ -3070,14 +3070,11 @@ /* * Extend 15-bit time stamp from rx descriptor to - * a full 64-bit TSF using the current h/w TSF. + * a full 64-bit TSF using the specified TSF. */ static __inline u_int64_t -ath_extend_tsf(struct ath_hal *ah, u_int32_t rstamp) +ath_extend_tsf(u_int32_t rstamp, u_int64_t tsf) { - u_int64_t tsf; - - tsf = ath_hal_gettsf64(ah); if ((tsf & 0x7fff) < rstamp) tsf -= 0x8000; return ((tsf &~ 0x7fff) | rstamp); @@ -3115,7 +3112,8 @@ case IEEE80211_FC0_SUBTYPE_PROBE_RESP: if (ic->ic_opmode == IEEE80211_M_IBSS && ic->ic_state == IEEE80211_S_RUN) { - u_int64_t tsf = ath_extend_tsf(sc->sc_ah, rstamp); + u_int64_t tsf = ath_extend_tsf(rstamp, + ath_hal_gettsf64(sc->sc_ah)); /* * Handle ibss merge as needed; check the tsf on the * frame before attempting the merge. The 802.11 spec @@ -3172,12 +3170,14 @@ int len, type, ngood, noise; u_int phyerr; HAL_STATUS status; + u_int64_t tsf; NET_LOCK_GIANT(); /* XXX */ DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s: pending %u\n", __func__, npending); ngood = 0; noise = ath_hal_getchannoise(ah, &sc->sc_curchan); + tsf = ath_hal_gettsf64(ah); do { bf = STAILQ_FIRST(&sc->sc_rxbuf); if (bf == NULL) { /* NB: shouldn't happen */ @@ -3347,14 +3347,15 @@ m_freem(m); goto rx_next; } + sc->sc_rx_th.wr_tsf = htole64( + ath_extend_tsf(ds->ds_rxstat.rs_tstamp, tsf)); rix = ds->ds_rxstat.rs_rate; sc->sc_rx_th.wr_flags = sc->sc_hwmap[rix].rxflags; sc->sc_rx_th.wr_rate = sc->sc_hwmap[rix].ieeerate; - sc->sc_rx_th.wr_antenna = ds->ds_rxstat.rs_antenna; nf = ath_hal_getchannoise(ah, &sc->sc_curchan); sc->sc_rx_th.wr_antsignal = ds->ds_rxstat.rs_rssi + nf; sc->sc_rx_th.wr_antnoise = nf; - /* XXX TSF */ + sc->sc_rx_th.wr_antenna = ds->ds_rxstat.rs_antenna; bpf_mtap2(sc->sc_drvbpf, &sc->sc_rx_th, sc->sc_rx_th_len, m); @@ -3442,7 +3443,7 @@ /* rx signal state monitoring */ ath_hal_rxmonitor(ah, &sc->sc_halstats, &sc->sc_curchan); if (ngood) - sc->sc_lastrx = ath_hal_gettsf64(ah); + sc->sc_lastrx = tsf; NET_UNLOCK_GIANT(); /* XXX */ #undef PA2DESC ==== //depot/projects/wifi/sys/dev/ath/if_athioctl.h#12 (text+ko) ==== @@ -136,6 +136,7 @@ * Radio capture format. */ #define ATH_RX_RADIOTAP_PRESENT ( \ + (1 << IEEE80211_RADIOTAP_TSFT) | \ (1 << IEEE80211_RADIOTAP_FLAGS) | \ (1 << IEEE80211_RADIOTAP_RATE) | \ (1 << IEEE80211_RADIOTAP_CHANNEL) | \ @@ -146,6 +147,7 @@ struct ath_rx_radiotap_header { struct ieee80211_radiotap_header wr_ihdr; + u_int64_t wr_tsf; u_int8_t wr_flags; /* XXX for padding */ u_int8_t wr_rate; u_int16_t wr_chan_freq;