From 1f298879563bc8b07d70f837e4bf96f096bb63e2 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Mon, 4 Apr 2005 02:32:56 +0000 Subject: [PATCH] change ieee80211_input to return the frame type or -1 --- sys/net80211/ieee80211_input.c | 12 +++++++----- sys/net80211/ieee80211_proto.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index a0984c58def5..50a44d79a56d 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -124,7 +124,7 @@ static void ieee80211_recv_pspoll(struct ieee80211com *, * mean ``better signal''. The receive timestamp is currently not used * by the 802.11 layer. */ -void +int ieee80211_input(struct ieee80211com *ic, struct mbuf *m, struct ieee80211_node *ni, int rssi, u_int32_t rstamp) { @@ -150,6 +150,7 @@ ieee80211_input(struct ieee80211com *ic, struct mbuf *m, KASSERT(m->m_pkthdr.len >= sizeof(struct ieee80211_frame_min), ("frame length too short: %u", m->m_pkthdr.len)); + type = -1; /* undefined */ /* * In monitor mode, send everything directly to bpf. * XXX may want to include the CRC @@ -535,7 +536,7 @@ ieee80211_input(struct ieee80211com *ic, struct mbuf *m, } (*ifp->if_input)(ifp, m); } - return; + return IEEE80211_FC0_TYPE_DATA; case IEEE80211_FC0_TYPE_MGT: IEEE80211_NODE_STAT(ni, rx_mgmt); @@ -593,7 +594,7 @@ ieee80211_input(struct ieee80211com *ic, struct mbuf *m, bpf_mtap(ic->ic_rawbpf, m); (*ic->ic_recv_mgmt)(ic, m, ni, subtype, rssi, rstamp); m_freem(m); - return; + return type; case IEEE80211_FC0_TYPE_CTL: IEEE80211_NODE_STAT(ni, rx_ctrl); @@ -612,14 +613,15 @@ ieee80211_input(struct ieee80211com *ic, struct mbuf *m, /* should not come here */ break; } - err: +err: ifp->if_ierrors++; - out: +out: if (m != NULL) { if (ic->ic_rawbpf) bpf_mtap(ic->ic_rawbpf, m); m_freem(m); } + return type; #undef SEQ_LEQ } diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h index 43708efb24b6..4bda3568f430 100644 --- a/sys/net80211/ieee80211_proto.h +++ b/sys/net80211/ieee80211_proto.h @@ -57,7 +57,7 @@ extern void ieee80211_proto_attach(struct ieee80211com *); extern void ieee80211_proto_detach(struct ieee80211com *); struct ieee80211_node; -extern void ieee80211_input(struct ieee80211com *, struct mbuf *, +extern int ieee80211_input(struct ieee80211com *, struct mbuf *, struct ieee80211_node *, int, u_int32_t); extern void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *, struct ieee80211_node *, int, int, u_int32_t);