From 2dc4d8dc89f912e5efb536c50900d7a6deba5081 Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Sat, 7 Jun 2008 17:51:41 +0000 Subject: [PATCH] Split ieee80211_notify_erp into locked and unlocked variants and use the locked version to handle the hostap input path case where the com lock is not already held. Noticed by: Jared Go --- sys/net80211/ieee80211_node.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index bc96d219824..c6aadb2be34 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2088,8 +2088,8 @@ ieee80211_dump_nodes(struct ieee80211_node_table *nt) (ieee80211_iter_func *) ieee80211_dump_node, nt); } -void -ieee80211_notify_erp(struct ieee80211com *ic) +static void +ieee80211_notify_erp_locked(struct ieee80211com *ic) { struct ieee80211vap *vap; @@ -2100,6 +2100,14 @@ ieee80211_notify_erp(struct ieee80211com *ic) ieee80211_beacon_notify(vap, IEEE80211_BEACON_ERP); } +void +ieee80211_notify_erp(struct ieee80211com *ic) +{ + IEEE80211_LOCK(ic); + ieee80211_notify_erp_locked(ic); + IEEE80211_UNLOCK(ic); +} + /* * Handle a station joining an 11g network. */ @@ -2162,7 +2170,7 @@ ieee80211_node_join_11g(struct ieee80211_node *ni) IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_ASSOC, "%s: enable use of protection\n", __func__); ic->ic_flags |= IEEE80211_F_USEPROT; - ieee80211_notify_erp(ic); + ieee80211_notify_erp_locked(ic); } } else ni->ni_flags |= IEEE80211_NODE_ERP; @@ -2251,7 +2259,7 @@ disable_protection(struct ieee80211com *ic) ic->ic_flags |= IEEE80211_F_SHPREAMBLE; ic->ic_flags &= ~IEEE80211_F_USEBARKER; } - ieee80211_notify_erp(ic); + ieee80211_notify_erp_locked(ic); } /* -- 2.45.0