add iv_recv_ctl method to allow hooking rx ctl frame handling
This commit is contained in:
parent
e9cfc1f500
commit
49eae5f79e
@ -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)
|
||||
{
|
||||
}
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user