summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-04-26 21:46:04 +0000
committersam <sam@FreeBSD.org>2009-04-26 21:46:04 +0000
commit4af5d5056bb6ef08f69414227e158a45d7343719 (patch)
tree9e668ef6901f296b5a298c7f64ea8641d4d3b319
parent3469cff523519709cbaeb40ab2326524ee4f0c11 (diff)
downloadFreeBSD-src-4af5d5056bb6ef08f69414227e158a45d7343719.zip
FreeBSD-src-4af5d5056bb6ef08f69414227e158a45d7343719.tar.gz
add iv_recv_ctl method to allow hooking rx ctl frame handling
-rw-r--r--sys/net80211/ieee80211_adhoc.c8
-rw-r--r--sys/net80211/ieee80211_hostap.c24
-rw-r--r--sys/net80211/ieee80211_sta.c8
-rw-r--r--sys/net80211/ieee80211_var.h2
4 files changed, 34 insertions, 8 deletions
diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c
index ff13acb..c254dea 100644
--- a/sys/net80211/ieee80211_adhoc.c
+++ b/sys/net80211/ieee80211_adhoc.c
@@ -74,6 +74,7 @@ static void adhoc_recv_mgmt(struct ieee80211_node *, struct mbuf *,
int subtype, int rssi, int noise, uint32_t rstamp);
static void ahdemo_recv_mgmt(struct ieee80211_node *, struct mbuf *,
int subtype, int rssi, int noise, uint32_t rstamp);
+static void adhoc_recv_ctl(struct ieee80211_node *, struct mbuf *, int subtype);
void
ieee80211_adhoc_attach(struct ieee80211com *ic)
@@ -101,6 +102,7 @@ adhoc_vattach(struct ieee80211vap *vap)
vap->iv_recv_mgmt = adhoc_recv_mgmt;
else
vap->iv_recv_mgmt = ahdemo_recv_mgmt;
+ vap->iv_recv_ctl = adhoc_recv_ctl;
vap->iv_opdetach = adhoc_vdetach;
#ifdef IEEE80211_SUPPORT_TDMA
/*
@@ -643,6 +645,7 @@ adhoc_input(struct ieee80211_node *ni, struct mbuf *m,
case IEEE80211_FC0_TYPE_CTL:
vap->iv_stats.is_rx_ctl++;
IEEE80211_NODE_STAT(ni, rx_ctrl);
+ vap->iv_recv_ctl(ni, m, subtype);
goto out;
default:
IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
@@ -921,3 +924,8 @@ ahdemo_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
else
vap->iv_stats.is_rx_mgtdiscard++;
}
+
+static void
+adhoc_recv_ctl(struct ieee80211_node *ni, struct mbuf *m0, int subtype)
+{
+}
diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c
index e0d10ec..23f211f 100644
--- a/sys/net80211/ieee80211_hostap.c
+++ b/sys/net80211/ieee80211_hostap.c
@@ -72,6 +72,7 @@ static void hostap_deliver_data(struct ieee80211vap *,
struct ieee80211_node *, struct mbuf *);
static void hostap_recv_mgmt(struct ieee80211_node *, struct mbuf *,
int subtype, int rssi, int noise, uint32_t rstamp);
+static void hostap_recv_ctl(struct ieee80211_node *, struct mbuf *, int);
static void hostap_recv_pspoll(struct ieee80211_node *, struct mbuf *);
void
@@ -96,6 +97,7 @@ hostap_vattach(struct ieee80211vap *vap)
vap->iv_newstate = hostap_newstate;
vap->iv_input = hostap_input;
vap->iv_recv_mgmt = hostap_recv_mgmt;
+ vap->iv_recv_ctl = hostap_recv_ctl;
vap->iv_opdetach = hostap_vdetach;
vap->iv_deliver_data = hostap_deliver_data;
}
@@ -837,14 +839,7 @@ hostap_input(struct ieee80211_node *ni, struct mbuf *m,
case IEEE80211_FC0_TYPE_CTL:
vap->iv_stats.is_rx_ctl++;
IEEE80211_NODE_STAT(ni, rx_ctrl);
- switch (subtype) {
- case IEEE80211_FC0_SUBTYPE_PS_POLL:
- hostap_recv_pspoll(ni, m);
- break;
- case IEEE80211_FC0_SUBTYPE_BAR:
- ieee80211_recv_bar(ni, m);
- break;
- }
+ vap->iv_recv_ctl(ni, m, subtype);
goto out;
default:
IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
@@ -2162,6 +2157,19 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
}
}
+static void
+hostap_recv_ctl(struct ieee80211_node *ni, struct mbuf *m, int subtype)
+{
+ switch (subtype) {
+ case IEEE80211_FC0_SUBTYPE_PS_POLL:
+ hostap_recv_pspoll(ni, m);
+ break;
+ case IEEE80211_FC0_SUBTYPE_BAR:
+ ieee80211_recv_bar(ni, m);
+ break;
+ }
+}
+
/*
* Process a received ps-poll frame.
*/
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c
index 3cdcaec..a90e504 100644
--- a/sys/net80211/ieee80211_sta.c
+++ b/sys/net80211/ieee80211_sta.c
@@ -70,6 +70,7 @@ static int sta_input(struct ieee80211_node *, struct mbuf *,
int rssi, int noise, uint32_t rstamp);
static void sta_recv_mgmt(struct ieee80211_node *, struct mbuf *,
int subtype, int rssi, int noise, uint32_t rstamp);
+static void sta_recv_ctl(struct ieee80211_node *, struct mbuf *, int subtype);
void
ieee80211_sta_attach(struct ieee80211com *ic)
@@ -93,6 +94,7 @@ sta_vattach(struct ieee80211vap *vap)
vap->iv_newstate = sta_newstate;
vap->iv_input = sta_input;
vap->iv_recv_mgmt = sta_recv_mgmt;
+ vap->iv_recv_ctl = sta_recv_ctl;
vap->iv_opdetach = sta_vdetach;
vap->iv_bmiss = sta_beacon_miss;
}
@@ -872,6 +874,7 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m,
case IEEE80211_FC0_TYPE_CTL:
vap->iv_stats.is_rx_ctl++;
IEEE80211_NODE_STAT(ni, rx_ctrl);
+ vap->iv_recv_ctl(ni, m, subtype);
goto out;
default:
IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
@@ -1597,3 +1600,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
#undef ISREASSOC
#undef ISPROBE
}
+
+static void
+sta_recv_ctl(struct ieee80211_node *ni, struct mbuf *m0, int subtype)
+{
+}
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index ea72c12..615e333 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -416,6 +416,8 @@ struct ieee80211vap {
uint32_t rstamp);
void (*iv_recv_mgmt)(struct ieee80211_node *,
struct mbuf *, int, int, int, uint32_t);
+ void (*iv_recv_ctl)(struct ieee80211_node *,
+ struct mbuf *, int);
void (*iv_deliver_data)(struct ieee80211vap *,
struct ieee80211_node *, struct mbuf *);
#if 0
OpenPOWER on IntegriCloud