summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-02-24 05:39:00 +0000
committeradrian <adrian@FreeBSD.org>2012-02-24 05:39:00 +0000
commitb4ec3fe70a1b2d7a45b426fabd9b903e0acf1cdf (patch)
tree513335d81dadf9aa7c64c611274e7e65d5091765 /sys/net80211
parentadbf4b3074d8710ed88ef5fa661fdfa6f3562904 (diff)
downloadFreeBSD-src-b4ec3fe70a1b2d7a45b426fabd9b903e0acf1cdf.zip
FreeBSD-src-b4ec3fe70a1b2d7a45b426fabd9b903e0acf1cdf.tar.gz
Although it's documented that the vap newstate call can drop the
comlock, I'd like to find and analyse these cases to see if they really are valid. So, throw in a lock here and wait for the (hopefully!) inevitable complaints.
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_proto.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index b4288b7..caa813a 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1615,6 +1615,7 @@ markwaiting(struct ieee80211vap *vap0)
if (vap->iv_state != IEEE80211_S_INIT) {
/* NB: iv_newstate may drop the lock */
vap->iv_newstate(vap, IEEE80211_S_INIT, 0);
+ IEEE80211_LOCK_ASSERT(ic);
vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
}
}
@@ -1649,6 +1650,7 @@ wakeupwaiting(struct ieee80211vap *vap0)
vap->iv_newstate(vap,
vap->iv_opmode == IEEE80211_M_STA ?
IEEE80211_S_SCAN : IEEE80211_S_RUN, 0);
+ IEEE80211_LOCK_ASSERT(ic);
}
}
}
@@ -1678,6 +1680,7 @@ ieee80211_newstate_cb(void *xvap, int npending)
ieee80211_state_name[vap->iv_state],
ieee80211_state_name[IEEE80211_S_INIT], arg);
vap->iv_newstate(vap, IEEE80211_S_INIT, arg);
+ IEEE80211_LOCK_ASSERT(ic);
vap->iv_flags_ext &= ~IEEE80211_FEXT_REINIT;
}
@@ -1699,6 +1702,7 @@ ieee80211_newstate_cb(void *xvap, int npending)
ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg);
rc = vap->iv_newstate(vap, nstate, arg);
+ IEEE80211_LOCK_ASSERT(ic);
vap->iv_flags_ext &= ~IEEE80211_FEXT_STATEWAIT;
if (rc != 0) {
/* State transition failed */
@@ -1724,7 +1728,9 @@ ieee80211_newstate_cb(void *xvap, int npending)
* Note this can also happen as a result of SLEEP->RUN
* (i.e. coming out of power save mode).
*/
+ IF_LOCK(&vap->iv_ifp->if_snd);
vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+ IF_UNLOCK(&vap->iv_ifp->if_snd);
if_start(vap->iv_ifp);
/* bring up any vaps waiting on us */
OpenPOWER on IntegriCloud