From 3effae1c9990745cc4a2f29dd2963a36d2465cb5 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 28 Dec 2003 07:00:32 +0000 Subject: update radiotap support to reflect recent changes: o move tx taps from ath_start to ath_tx_start so lots more state is available to tap o add tx flags o add tx rate o add tx power (constant for the moment) o add tx antenna state --- sys/dev/ath/if_ath.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'sys/dev/ath/if_ath.c') diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index 3a7313d..ac940bc 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -773,15 +773,6 @@ ath_start(struct ifnet *ifp) } 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: @@ -2039,6 +2030,22 @@ ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf 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. */ -- cgit v1.1