summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2008-05-28 23:19:20 +0000
committersam <sam@FreeBSD.org>2008-05-28 23:19:20 +0000
commit9d56b1ea5480d63c8cfcb59441c2b9b71d21965b (patch)
tree927a691b6c72709e5c3a6a00dab569b3467d45d3 /sys/net80211
parent74db96e06d6afcb18f1b74dd9e57a419cd260f85 (diff)
downloadFreeBSD-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')
-rw-r--r--sys/net80211/ieee80211_proto.c40
-rw-r--r--sys/net80211/ieee80211_proto.h2
-rw-r--r--sys/net80211/ieee80211_var.h1
3 files changed, 43 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
diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h
index 6d617fd..a0282dc 100644
--- a/sys/net80211/ieee80211_proto.h
+++ b/sys/net80211/ieee80211_proto.h
@@ -265,6 +265,8 @@ void ieee80211_start_all(struct ieee80211com *);
void ieee80211_stop_locked(struct ieee80211vap *);
void ieee80211_stop(struct ieee80211vap *);
void ieee80211_stop_all(struct ieee80211com *);
+void ieee80211_suspend_all(struct ieee80211com *);
+void ieee80211_resume_all(struct ieee80211com *);
void ieee80211_dturbo_switch(struct ieee80211vap *, int newflags);
void ieee80211_swbmiss(void *arg);
void ieee80211_beacon_miss(struct ieee80211com *);
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 38100ae..9b362f6 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -473,6 +473,7 @@ MALLOC_DECLARE(M_80211_VAP);
#define IEEE80211_FEXT_WPS 0x00000010 /* CONF: WPS enabled */
#define IEEE80211_FEXT_TSN 0x00000020 /* CONF: TSN enabled */
#define IEEE80211_FEXT_SCANREQ 0x00000040 /* STATUS: scan req params */
+#define IEEE80211_FEXT_RESUME 0x00000080 /* STATUS: start on resume */
#define IEEE80211_FEXT_DFS 0x00000800 /* CONF: DFS enabled */
#define IEEE80211_FEXT_NONERP_PR 0x00000200 /* STATUS: non-ERP sta present*/
#define IEEE80211_FEXT_SWBMISS 0x00000400 /* CONF: do bmiss in s/w */
OpenPOWER on IntegriCloud