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
This commit is contained in:
parent
3c898db70a
commit
eb2cdcb127
@ -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.
|
||||
*/
|
||||
|
@ -107,8 +107,8 @@ struct ath_diag {
|
||||
(1 << IEEE80211_RADIOTAP_FLAGS) | \
|
||||
(1 << IEEE80211_RADIOTAP_RATE) | \
|
||||
(1 << IEEE80211_RADIOTAP_CHANNEL) | \
|
||||
(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
|
||||
(1 << IEEE80211_RADIOTAP_ANTENNA) | \
|
||||
(1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
|
||||
0)
|
||||
|
||||
struct ath_rx_radiotap_header {
|
||||
@ -117,14 +117,16 @@ struct ath_rx_radiotap_header {
|
||||
u_int8_t wr_rate;
|
||||
u_int16_t wr_chan_freq;
|
||||
u_int16_t wr_chan_flags;
|
||||
u_int8_t wr_antsignal;
|
||||
u_int8_t wr_antenna;
|
||||
u_int8_t wr_antsignal;
|
||||
};
|
||||
|
||||
#define ATH_TX_RADIOTAP_PRESENT ( \
|
||||
(1 << IEEE80211_RADIOTAP_FLAGS) | \
|
||||
(1 << IEEE80211_RADIOTAP_RATE) | \
|
||||
(1 << IEEE80211_RADIOTAP_CHANNEL) | \
|
||||
(1 << IEEE80211_RADIOTAP_DBM_TX_POWER) | \
|
||||
(1 << IEEE80211_RADIOTAP_ANTENNA) | \
|
||||
0)
|
||||
|
||||
struct ath_tx_radiotap_header {
|
||||
@ -133,6 +135,8 @@ struct ath_tx_radiotap_header {
|
||||
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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user