diff options
author | sam <sam@FreeBSD.org> | 2008-05-28 23:19:20 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-05-28 23:19:20 +0000 |
commit | 9d56b1ea5480d63c8cfcb59441c2b9b71d21965b (patch) | |
tree | 927a691b6c72709e5c3a6a00dab569b3467d45d3 /sys/net80211/ieee80211_proto.c | |
parent | 74db96e06d6afcb18f1b74dd9e57a419cd260f85 (diff) | |
download | FreeBSD-src-9d56b1ea5480d63c8cfcb59441c2b9b71d21965b.zip FreeBSD-src-9d56b1ea5480d63c8cfcb59441c2b9b71d21965b.tar.gz |
Add ieee80211_suspend_all and ieee80211_resume_all for
brute force suspend/resume handling of vaps.
Diffstat (limited to 'sys/net80211/ieee80211_proto.c')
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 89f69af..452bd3f 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1261,6 +1261,46 @@ ieee80211_stop_all(struct ieee80211com *ic) } /* + * Stop all vap's running on a device and arrange + * for those that were running to be resumed. + */ +void +ieee80211_suspend_all(struct ieee80211com *ic) +{ + struct ieee80211vap *vap; + + IEEE80211_LOCK(ic); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + struct ifnet *ifp = vap->iv_ifp; + if (IFNET_IS_UP_RUNNING(ifp)) { /* NB: avoid recursion */ + vap->iv_flags_ext |= IEEE80211_FEXT_RESUME; + ieee80211_stop_locked(vap); + } + } + IEEE80211_UNLOCK(ic); +} + +/* + * Start all vap's marked for resume. + */ +void +ieee80211_resume_all(struct ieee80211com *ic) +{ + struct ieee80211vap *vap; + + IEEE80211_LOCK(ic); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + struct ifnet *ifp = vap->iv_ifp; + if (!IFNET_IS_UP_RUNNING(ifp) && + (vap->iv_flags_ext & IEEE80211_FEXT_RESUME)) { + vap->iv_flags_ext &= ~IEEE80211_FEXT_RESUME; + ieee80211_start_locked(vap); + } + } + IEEE80211_UNLOCK(ic); +} + +/* * Switch between turbo and non-turbo operating modes. * Use the specified channel flags to locate the new * channel, update 802.11 state, and then call back into |