PERFORCE change 43163 for review

Sam Leffler sam at FreeBSD.org
Sat Nov 29 19:39:37 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=43163

Change 43163 by sam at sam_ebb on 2003/11/29 19:38:05

	o add txpower and antenna to xmit-side radiotap data
	o move xmit-side tap to ath_tx_start so we have the state
	  needed to fill out the new fields and to record the flags
	  state (e.g. short preamble)

Affected files ...

.. //depot/projects/netperf/sys/dev/ath/if_ath.c#43 edit
.. //depot/projects/netperf/sys/dev/ath/if_athioctl.h#8 edit

Differences ...

==== //depot/projects/netperf/sys/dev/ath/if_ath.c#43 (text+ko) ====

@@ -773,16 +773,6 @@
 			}
 			sc->sc_stats.ast_tx_mgmt++;
 		}
-		if (ic->ic_rawbpf)
-			bpf_mtap(ic->ic_rawbpf, m);
-
-		if (sc->sc_drvbpf) {
-			sc->sc_tx_th.wt_rate =
-				ni->ni_rates.rs_rates[ni->ni_txrate];
-			bpf_mtap2(sc->sc_drvbpf,
-				&sc->sc_tx_th, sizeof(sc->sc_tx_th), m);
-		}
-
 		if (ath_tx_start(sc, ni, bf, m)) {
 	bad:
 			ATH_TXBUF_LOCK(sc);
@@ -2039,6 +2029,22 @@
 	else
 		antenna = an->an_rx_hist[an->an_rx_hist_next].arh_antenna;
 
+	if (ic->ic_rawbpf)
+		bpf_mtap(ic->ic_rawbpf, m0);
+	if (sc->sc_drvbpf) {
+		sc->sc_tx_th.wt_flags = 0;
+		if (shortPreamble)
+			sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE;
+		if (iswep)
+			sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP;
+		sc->sc_tx_th.wt_rate = ni->ni_rates.rs_rates[ni->ni_txrate];
+		sc->sc_tx_th.wt_txpower = 60/2;		/* XXX */
+		sc->sc_tx_th.wt_antenna = antenna;
+
+		bpf_mtap2(sc->sc_drvbpf,
+			&sc->sc_tx_th, sizeof(sc->sc_tx_th), m0);
+	}
+
 	/*
 	 * Formulate first tx descriptor with tx controls.
 	 */

==== //depot/projects/netperf/sys/dev/ath/if_athioctl.h#8 (text+ko) ====

@@ -125,6 +125,7 @@
 	(1 << IEEE80211_RADIOTAP_FLAGS)		| \
 	(1 << IEEE80211_RADIOTAP_RATE)		| \
 	(1 << IEEE80211_RADIOTAP_CHANNEL)	| \
+	(1 << IEEE80211_RADIOTAP_ANTENNA)	| \
 	0)
 
 struct ath_tx_radiotap_header {
@@ -133,6 +134,8 @@
 	u_int8_t	wt_rate;
 	u_int16_t	wt_chan_freq;
 	u_int16_t	wt_chan_flags;
+	u_int8_t	wt_txpower;
+	u_int8_t	wt_antenna;
 };
 
 #endif /* _DEV_ATH_ATHIOCTL_H */


More information about the p4-projects mailing list