summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2006-08-10 05:54:36 +0000
committersam <sam@FreeBSD.org>2006-08-10 05:54:36 +0000
commit3e268c1af8db8bbe81f51070edda54056ad65176 (patch)
tree25419a2372706415d46a203a0bd720b1f405c2ce /sys
parent1d4a6e38d2d7cf1e6ffe65c407d95d154c8c445e (diff)
downloadFreeBSD-src-3e268c1af8db8bbe81f51070edda54056ad65176.zip
FreeBSD-src-3e268c1af8db8bbe81f51070edda54056ad65176.tar.gz
minor fixups:
o add some missing stats to the global stat structure o move accounting work for data frame rx into ieee80211_deliver_data o add per-sta stats for rx ucast/mcast frames o set rcvif in ieee80211_deliver_data so callers don't need to MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211_input.c25
-rw-r--r--sys/net80211/ieee80211_ioctl.h5
2 files changed, 22 insertions, 8 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index f278b73..12cdf3d 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -417,6 +417,7 @@ ieee80211_input(struct ieee80211com *ic, struct mbuf *m,
if (key != NULL && !ieee80211_crypto_demic(ic, key, m, 0)) {
IEEE80211_DISCARD_MAC(ic, IEEE80211_MSG_INPUT,
ni->ni_macaddr, "data", "%s", "demic error");
+ ic->ic_stats.is_rx_demicfail++;
IEEE80211_NODE_STAT(ni, rx_demicfail);
goto out;
}
@@ -474,14 +475,11 @@ ieee80211_input(struct ieee80211com *ic, struct mbuf *m,
goto out;
}
}
- ifp->if_ipackets++;
- IEEE80211_NODE_STAT(ni, rx_data);
- IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len);
-
ieee80211_deliver_data(ic, ni, m);
return IEEE80211_FC0_TYPE_DATA;
case IEEE80211_FC0_TYPE_MGT:
+ ic->ic_stats.is_rx_mgmt++;
IEEE80211_NODE_STAT(ni, rx_mgmt);
if (dir != IEEE80211_FC1_DIR_NODS) {
IEEE80211_DISCARD(ic, IEEE80211_MSG_INPUT,
@@ -543,8 +541,8 @@ ieee80211_input(struct ieee80211com *ic, struct mbuf *m,
return type;
case IEEE80211_FC0_TYPE_CTL:
- IEEE80211_NODE_STAT(ni, rx_ctrl);
ic->ic_stats.is_rx_ctl++;
+ IEEE80211_NODE_STAT(ni, rx_ctrl);
if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_PS_POLL:
@@ -639,6 +637,7 @@ ieee80211_defrag(struct ieee80211com *ic, struct ieee80211_node *ni,
if (mfrag == NULL) {
if (fragno != 0) { /* !first fragment, discard */
+ ic->ic_stats.is_rx_defrag++;
IEEE80211_NODE_STAT(ni, rx_defrag);
m_freem(m);
return NULL;
@@ -668,12 +667,24 @@ ieee80211_deliver_data(struct ieee80211com *ic,
struct ether_header *eh = mtod(m, struct ether_header *);
struct ifnet *ifp = ic->ic_ifp;
+ /*
+ * Do accounting.
+ */
+ ifp->if_ipackets++;
+ IEEE80211_NODE_STAT(ni, rx_data);
+ IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len);
+ if (ETHER_IS_MULTICAST(eh->ether_dhost)) {
+ m->m_flags |= M_MCAST; /* XXX M_BCAST? */
+ IEEE80211_NODE_STAT(ni, rx_mcast);
+ } else
+ IEEE80211_NODE_STAT(ni, rx_ucast);
+
/* perform as a bridge within the AP */
if (ic->ic_opmode == IEEE80211_M_HOSTAP &&
(ic->ic_flags & IEEE80211_F_NOBRIDGE) == 0) {
struct mbuf *m1 = NULL;
- if (ETHER_IS_MULTICAST(eh->ether_dhost)) {
+ if (m->m_flags & M_MCAST) {
m1 = m_dup(m, M_DONTWAIT);
if (m1 == NULL)
ifp->if_oerrors++;
@@ -708,6 +719,7 @@ ieee80211_deliver_data(struct ieee80211com *ic,
IF_HANDOFF(&ifp->if_snd, m1, ifp);
}
if (m != NULL) {
+ m->m_pkthdr.rcvif = ifp;
if (ni->ni_vlan != 0) {
/* attach vlan tag */
VLAN_INPUT_TAG(ifp, m, ni->ni_vlan);
@@ -1757,7 +1769,6 @@ ieee80211_deliver_l2uf(struct ieee80211_node *ni)
l2uf->xid[2] = 0x00;
m->m_pkthdr.len = m->m_len = sizeof(*l2uf);
- m->m_pkthdr.rcvif = ifp;
ieee80211_deliver_data(ic, ni, m);
}
diff --git a/sys/net80211/ieee80211_ioctl.h b/sys/net80211/ieee80211_ioctl.h
index beddab2..a76630a 100644
--- a/sys/net80211/ieee80211_ioctl.h
+++ b/sys/net80211/ieee80211_ioctl.h
@@ -181,7 +181,10 @@ struct ieee80211_stats {
u_int32_t is_ff_decap; /* fast frames decap'd */
u_int32_t is_ff_encap; /* fast frames encap'd for tx */
u_int32_t is_rx_badbintval; /* rx frame w/ bogus bintval */
- u_int32_t is_spare[9];
+ u_int32_t is_rx_demicfail; /* rx demic failed */
+ u_int32_t is_rx_defrag; /* rx defragmentation failed */
+ u_int32_t is_rx_mgmt; /* rx management frames */
+ u_int32_t is_spare[6];
};
/*
OpenPOWER on IntegriCloud