Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Nov 2005 05:13:52 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 87169 for review
Message-ID:  <200511240513.jAO5Dqi4048646@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511240513.jAO5Dqi4048646>