Initialize the channel info in the tx/rx radiotap headers in

ipw_newstate(), instead of reinitializing every time a packet is
sent or received.  Drop the unused radiotap 'flags' field.
This commit is contained in:
dyoung 2008-05-27 21:41:01 +00:00
parent f79b59f700
commit 233108fde8
1 changed files with 17 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ipw.c,v 1.40 2008/05/25 23:17:33 jmcneill Exp $ */
/* $NetBSD: if_ipw.c,v 1.41 2008/05/27 21:41:01 dyoung Exp $ */
/* FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp */
/*-
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.40 2008/05/25 23:17:33 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.41 2008/05/27 21:41:01 dyoung Exp $");
/*-
* Intel(R) PRO/Wireless 2100 MiniPCI driver
@ -788,6 +788,21 @@ ipw_newstate(struct ieee80211com *ic, enum ieee80211_state nstate,
struct ieee80211_node *ni;
uint8_t macaddr[IEEE80211_ADDR_LEN];
uint32_t len;
struct ipw_rx_radiotap_header *wr = &sc->sc_rxtap;
struct ipw_tx_radiotap_header *wt = &sc->sc_txtap;
switch (nstate) {
case IEEE80211_S_INIT:
break;
default:
KASSERT(ic->ic_curchan != IEEE80211_CHAN_ANYC);
KASSERT(ic->ic_curchan != NULL);
wt->wt_chan_freq = htole16(ic->ic_curchan->ic_freq);
wt->wt_chan_flags = htole16(ic->ic_curchan->ic_flags);
wr->wr_chan_freq = htole16(ic->ic_curchan->ic_freq);
wr->wr_chan_flags = htole16(ic->ic_curchan->ic_flags);
break;
}
switch (nstate) {
case IEEE80211_S_RUN:
@ -1050,15 +1065,7 @@ ipw_data_intr(struct ipw_softc *sc, struct ipw_status *status,
if (sc->sc_drvbpf != NULL) {
struct ipw_rx_radiotap_header *tap = &sc->sc_rxtap;
tap->wr_flags = 0;
tap->wr_antsignal = status->rssi;
if (ic->ic_bss->ni_chan != IEEE80211_CHAN_ANYC) {
tap->wr_chan_freq =
htole16(ic->ic_bss->ni_chan->ic_freq);
tap->wr_chan_flags =
htole16(ic->ic_bss->ni_chan->ic_flags);
} else
tap->wr_chan_freq = tap->wr_chan_flags = 0;
bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_rxtap_len, m);
}
@ -1330,15 +1337,6 @@ ipw_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni)
if (sc->sc_drvbpf != NULL) {
struct ipw_tx_radiotap_header *tap = &sc->sc_txtap;
tap->wt_flags = 0;
if (ic->ic_bss->ni_chan != IEEE80211_CHAN_ANYC) {
tap->wt_chan_freq =
htole16(ic->ic_bss->ni_chan->ic_freq);
tap->wt_chan_flags =
htole16(ic->ic_bss->ni_chan->ic_flags);
} else
tap->wt_chan_freq = tap->wt_chan_flags = 0;
bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_txtap_len, m0);
}
#endif