From owner-p4-projects@FreeBSD.ORG  Tue May 27 04:07:51 2008
Return-Path: <owner-p4-projects@FreeBSD.ORG>
Delivered-To: p4-projects@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 8EC3A106566C; Tue, 27 May 2008 04:07:51 +0000 (UTC)
Delivered-To: perforce@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 38C39106567A
	for <perforce@freebsd.org>; Tue, 27 May 2008 04:07:51 +0000 (UTC)
	(envelope-from sam@freebsd.org)
Received: from repoman.freebsd.org (repoman.freebsd.org
	[IPv6:2001:4f8:fff6::29])
	by mx1.freebsd.org (Postfix) with ESMTP id 252158FC1B
	for <perforce@freebsd.org>; Tue, 27 May 2008 04:07:51 +0000 (UTC)
	(envelope-from sam@freebsd.org)
Received: from repoman.freebsd.org (localhost [127.0.0.1])
	by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4R47pPl031960
	for <perforce@freebsd.org>; Tue, 27 May 2008 04:07:51 GMT
	(envelope-from sam@freebsd.org)
Received: (from perforce@localhost)
	by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4R47oCZ031958
	for perforce@freebsd.org; Tue, 27 May 2008 04:07:50 GMT
	(envelope-from sam@freebsd.org)
Date: Tue, 27 May 2008 04:07:50 GMT
Message-Id: <200805270407.m4R47oCZ031958@repoman.freebsd.org>
X-Authentication-Warning: repoman.freebsd.org: perforce set sender to
	sam@freebsd.org using -f
From: Sam Leffler <sam@FreeBSD.org>
To: Perforce Change Reviews <perforce@freebsd.org>
Cc: 
Subject: PERFORCE change 142356 for review
X-BeenThere: p4-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: p4 projects tree changes <p4-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/p4-projects>,
	<mailto:p4-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/p4-projects>
List-Post: <mailto:p4-projects@freebsd.org>
List-Help: <mailto:p4-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/p4-projects>,
	<mailto:p4-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 27 May 2008 04:07:51 -0000

http://perforce.freebsd.org/chv.cgi?CH=142356

Change 142356 by sam@sam_ebb on 2008/05/27 04:07:19

	add ieee80211_suspend_all and ieee80211_resume_all for
	brute force suspend/resume handling of vaps

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_ddb.c#17 edit
.. //depot/projects/vap/sys/net80211/ieee80211_proto.c#33 edit
.. //depot/projects/vap/sys/net80211/ieee80211_proto.h#23 edit
.. //depot/projects/vap/sys/net80211/ieee80211_var.h#44 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_ddb.c#17 (text+ko) ====

@@ -63,10 +63,10 @@
 	"\37DOTH\40DWDS"
 
 #define	IEEE80211_FEXT_BITS \
-	"\20\1NONHT_PR\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\12NONEPR_PR"\
-	"\13SWBMISS\14DFS\15DOTD\22WDSLEGACY\23PROBECHAN\24HT\25AMDPU_TX" \
-	"\26AMPDU_TX\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN\33SHORTGI20" \
-	"\34SHORTGI40\35HTCOMPAT"
+	"\20\1NONHT_PR\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \
+	"\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\22WDSLEGACY\23PROBECHAN\24HT" \
+	"\25AMDPU_TX\26AMPDU_TX\27AMSDU_TX\30AMSDU_RX\31USEHT40\32PUREN" \
+	"\33SHORTGI20\34SHORTGI40\35HTCOMPAT"
 
 #define	IEEE80211_FVEN_BITS	"\20"
 

==== //depot/projects/vap/sys/net80211/ieee80211_proto.c#33 (text+ko) ====

@@ -1261,6 +1261,46 @@
 }
 
 /*
+ * 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

==== //depot/projects/vap/sys/net80211/ieee80211_proto.h#23 (text+ko) ====

@@ -265,6 +265,8 @@
 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 *);

==== //depot/projects/vap/sys/net80211/ieee80211_var.h#44 (text+ko) ====

@@ -473,6 +473,7 @@
 #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 */