From d1d0cf62fe680bc023b9756be1a4af07ced1f18d Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Tue, 19 Aug 2003 21:35:08 +0000 Subject: [PATCH] o pass control frames up the stack when in monitor mode (the 802.11 layer will quietly discard them; this just permits them to be collected with bpf) o add a counter for the number of rate control frames discarded when not in monitor mode o move the rx "too short" statistic in the stat structure so non-error rx stats are together (NB: ABI change to apps that collect stats via driver ioctl) --- sys/dev/ath/if_ath.c | 7 +++++-- sys/dev/ath/if_athioctl.h | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index f9fa4cdf4126..ba84f09a966a 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -1455,7 +1455,8 @@ ath_rx_proc(void *arg, int npending) { struct ath_softc *sc = arg; struct ath_buf *bf; - struct ifnet *ifp = &sc->sc_ic.ic_if; + struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = &ic->ic_if; struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds; struct mbuf *m; @@ -1512,11 +1513,13 @@ ath_rx_proc(void *arg, int npending) wh = mtod(m, struct ieee80211_frame *); if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == - IEEE80211_FC0_TYPE_CTL) { + IEEE80211_FC0_TYPE_CTL && + ic->ic_opmode != IEEE80211_M_MONITOR) { /* * Ignore control frame received in promisc mode. */ DPRINTF(("ath_rx_proc: control frame\n")); + sc->sc_stats.ast_rx_ctl++; goto rx_next; } diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h index a8d60dcde9c3..dcae150da12e 100644 --- a/sys/dev/ath/if_athioctl.h +++ b/sys/dev/ath/if_athioctl.h @@ -73,12 +73,13 @@ struct ath_stats { u_int32_t ast_rx_nombuf; /* rx setup failed 'cuz no mbuf */ u_int32_t ast_rx_busdma; /* rx setup failed for dma resrcs */ u_int32_t ast_rx_orn; /* rx failed 'cuz of desc overrun */ - u_int32_t ast_rx_tooshort;/* rx failed 'cuz frame too short */ u_int32_t ast_rx_crcerr; /* rx failed 'cuz of bad CRC */ u_int32_t ast_rx_fifoerr; /* rx failed 'cuz of FIFO overrun */ u_int32_t ast_rx_badcrypt;/* rx failed 'cuz decryption */ u_int32_t ast_rx_phyerr; /* rx failed 'cuz of PHY err */ u_int32_t ast_rx_phy[32]; /* rx PHY error per-code counts */ + u_int32_t ast_rx_tooshort;/* rx discarded 'cuz frame too short */ + u_int32_t ast_rx_ctl; /* rx discarded 'cuz ctl frame */ u_int32_t ast_be_nombuf; /* beacon setup failed 'cuz no mbuf */ u_int32_t ast_per_cal; /* periodic calibration calls */ u_int32_t ast_per_calfail;/* periodic calibration failed */