Date: Sun, 26 Apr 2009 21:46:04 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r191546 - head/sys/net80211 Message-ID: <200904262146.n3QLk4hx095843@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Sun Apr 26 21:46:04 2009 New Revision: 191546 URL: http://svn.freebsd.org/changeset/base/191546 Log: add iv_recv_ctl method to allow hooking rx ctl frame handling Modified: head/sys/net80211/ieee80211_adhoc.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sun Apr 26 21:37:02 2009 (r191545) +++ head/sys/net80211/ieee80211_adhoc.c Sun Apr 26 21:46:04 2009 (r191546) @@ -74,6 +74,7 @@ static void adhoc_recv_mgmt(struct ieee8 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, s 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 * else vap->iv_stats.is_rx_mgtdiscard++; } + +static void +adhoc_recv_ctl(struct ieee80211_node *ni, struct mbuf *m0, int subtype) +{ +} Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Sun Apr 26 21:37:02 2009 (r191545) +++ head/sys/net80211/ieee80211_hostap.c Sun Apr 26 21:46:04 2009 (r191546) @@ -72,6 +72,7 @@ static void hostap_deliver_data(struct i 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, 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 * } } +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. */ Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Sun Apr 26 21:37:02 2009 (r191545) +++ head/sys/net80211/ieee80211_sta.c Sun Apr 26 21:46:04 2009 (r191546) @@ -70,6 +70,7 @@ static int sta_input(struct ieee80211_no 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, str 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, #undef ISREASSOC #undef ISPROBE } + +static void +sta_recv_ctl(struct ieee80211_node *ni, struct mbuf *m0, int subtype) +{ +} Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Apr 26 21:37:02 2009 (r191545) +++ head/sys/net80211/ieee80211_var.h Sun Apr 26 21:46:04 2009 (r191546) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904262146.n3QLk4hx095843>