Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Mar 2007 04:47:57 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 115689 for review
Message-ID:  <200703110447.l2B4lv8c054110@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=115689

Change 115689 by sam@sam_ebb on 2007/03/11 04:47:26

	IFC

Affected files ...

.. //depot/projects/wifi/sys/net80211/_ieee80211.h#18 integrate
.. //depot/projects/wifi/sys/net80211/ieee80211_freebsd.h#24 integrate
.. //depot/projects/wifi/sys/net80211/ieee80211_input.c#94 integrate
.. //depot/projects/wifi/sys/net80211/ieee80211_node.c#87 integrate
.. //depot/projects/wifi/sys/net80211/ieee80211_power.c#5 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_proto.c#49 integrate
.. //depot/projects/wifi/sys/net80211/ieee80211_proto.h#32 integrate

Differences ...

==== //depot/projects/wifi/sys/net80211/_ieee80211.h#18 (text+ko) ====

@@ -29,7 +29,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/net80211/_ieee80211.h,v 1.7 2007/02/02 02:45:33 sam Exp $
+ * $FreeBSD: src/sys/net80211/_ieee80211.h,v 1.8 2007/03/07 04:35:07 sam Exp $
  */
 #ifndef _NET80211__IEEE80211_H_
 #define _NET80211__IEEE80211_H_
@@ -63,6 +63,7 @@
 	IEEE80211_M_MONITOR	= 8,	/* Monitor mode */
 	IEEE80211_M_WDS		= 2	/* WDS link */
 };
+#define	IEEE80211_OPMODE_MAX	(IEEE80211_M_MONITOR+1)
 
 /*
  * 802.11g protection mode.

==== //depot/projects/wifi/sys/net80211/ieee80211_freebsd.h#24 (text+ko) ====

@@ -24,7 +24,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/net80211/ieee80211_freebsd.h,v 1.10 2007/01/09 04:37:05 sam Exp $
+ * $FreeBSD: src/sys/net80211/ieee80211_freebsd.h,v 1.11 2007/03/07 04:42:22 sam Exp $
  */
 #ifndef _NET80211_IEEE80211_FREEBSD_H_
 #define _NET80211_IEEE80211_FREEBSD_H_
@@ -127,6 +127,21 @@
 	(_qlen) = ++(_ni)->ni_savedq.ifq_len; 			\
 } while (0)
 
+#ifndef IF_PREPEND_LIST
+#define _IF_PREPEND_LIST(ifq, mhead, mtail, mcount) do {	\
+	(mtail)->m_nextpkt = (ifq)->ifq_head;			\
+	if ((ifq)->ifq_tail == NULL)				\
+		(ifq)->ifq_tail = (mtail);			\
+	(ifq)->ifq_head = (mhead);				\
+	(ifq)->ifq_len += (mcount);				\
+} while (0)
+#define IF_PREPEND_LIST(ifq, mhead, mtail, mcount) do {		\
+	IF_LOCK(ifq);						\
+	_IF_PREPEND_LIST(ifq, mhead, mtail, mcount);		\
+	IF_UNLOCK(ifq);						\
+} while (0)
+#endif /* IF_PREPEND_LIST */
+
 /*
  * 802.1x MAC ACL database locking definitions.
  */

==== //depot/projects/wifi/sys/net80211/ieee80211_input.c#94 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.99 2007/02/04 05:49:16 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.100 2007/03/07 04:42:22 sam Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#87 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.78 2007/01/15 01:12:28 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.79 2007/03/07 04:31:49 sam Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h> 
@@ -303,8 +303,11 @@
 		ni->ni_capinfo |= IEEE80211_CAPINFO_IBSS;	/* XXX */
 		if (ic->ic_flags & IEEE80211_F_DESBSSID)
 			IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_des_bssid);
-		else
-			ni->ni_bssid[0] |= 0x02;	/* local bit for IBSS */
+		else {
+			get_random_bytes(ni->ni_bssid, IEEE80211_ADDR_LEN);
+			/* clear group bit, add local bit */
+			ni->ni_bssid[0] = (ni->ni_bssid[0] &~ 0x01) | 0x02;
+		}
 	} else if (ic->ic_opmode == IEEE80211_M_AHDEMO) {
 		if (ic->ic_flags & IEEE80211_F_DESBSSID)
 			IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_des_bssid);

==== //depot/projects/wifi/sys/net80211/ieee80211_power.c#5 (text+ko) ====

@@ -228,7 +228,8 @@
 ieee80211_node_pwrsave(struct ieee80211_node *ni, int enable)
 {
 	struct ieee80211com *ic = ni->ni_ic;
-	struct mbuf *m;
+	struct mbuf *m, *mhead, *mtail;
+	int mcount;
 
 	if (enable) {
 		if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) == 0)
@@ -256,24 +257,32 @@
 	}
 	IEEE80211_NOTE(ic, IEEE80211_MSG_POWER, ni,
 	    "flush ps queue, %u packets queue", IEEE80211_NODE_SAVEQ_QLEN(ni));
+	/*
+	 * Unload the frames from the ps q but don't send them
+	 * to the driver yet.  We do this in two stages to minimize
+	 * locking but also because there's no easy way to preserve
+	 * ordering given the existing ifnet access mechanisms.
+	 * XXX could be optimized
+	 */
+	IEEE80211_NODE_SAVEQ_LOCK(ni);
+	mcount = IEEE80211_NODE_SAVEQ_QLEN(ni);
+	mhead = mtail = NULL;
 	for (;;) {
-		int qlen;
-
-		IEEE80211_NODE_SAVEQ_DEQUEUE(ni, m, qlen);
+		_IEEE80211_NODE_SAVEQ_DEQUEUE_HEAD(ni, m);
 		if (m == NULL)
 			break;
-		/* 
-		 * If this is the last packet, turn off the TIM bit.
-		 * If there are more packets, set the more packets bit
-		 * in the mbuf so ieee80211_encap will mark the 802.11
-		 * head to indicate more data frames will follow.
-		 */
-		m->m_flags |= M_PWR_SAV;
-		if (qlen != 0)
-			m->m_flags |= M_MORE_DATA;
+		if (mhead == NULL) {
+			mhead = m;
+			m->m_nextpkt = NULL;
+		} else
+			mtail->m_nextpkt = m;
+		mtail = m;
+	}
+	IEEE80211_NODE_SAVEQ_UNLOCK(ni);
+	if (mhead != NULL) {
 		/* XXX need different driver interface */
 		/* XXX bypasses q max */
-		IF_ENQUEUE(&ic->ic_ifp->if_snd, m);
+		IF_PREPEND_LIST(&ic->ic_ifp->if_snd, mhead, mtail, mcount);
 	}
 	if (ic->ic_set_tim != NULL)
 		ic->ic_set_tim(ni, 0);

==== //depot/projects/wifi/sys/net80211/ieee80211_proto.c#49 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_proto.c,v 1.34 2007/01/08 18:23:43 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_proto.c,v 1.35 2007/03/07 04:35:07 sam Exp $");
 
 /*
  * IEEE 802.11 protocol support.
@@ -69,6 +69,16 @@
 	"reserved#8",	"reserved#9",	"ps_poll",	"rts",
 	"cts",		"ack",		"cf_end",	"cf_end_ack"
 };
+const char *ieee80211_opmode_name[IEEE80211_OPMODE_MAX] = {
+	"IBSS",		/* IEEE80211_M_IBSS */
+	"STA",		/* IEEE80211_M_STA */
+	"#2",
+	"AHDEMO",	/* IEEE80211_M_AHDEMO */
+	"#4", "#5",
+	"HOSTAP",	/* IEEE80211_M_HOSTAP */
+	"#7",
+	"MONITOR"	/* IEEE80211_M_MONITOR */
+};
 const char *ieee80211_state_name[IEEE80211_S_MAX] = {
 	"INIT",		/* IEEE80211_S_INIT */
 	"SCAN",		/* IEEE80211_S_SCAN */

==== //depot/projects/wifi/sys/net80211/ieee80211_proto.h#32 (text+ko) ====

@@ -29,7 +29,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/net80211/ieee80211_proto.h,v 1.20 2007/01/08 17:24:51 sam Exp $
+ * $FreeBSD: src/sys/net80211/ieee80211_proto.h,v 1.21 2007/03/07 04:35:07 sam Exp $
  */
 #ifndef _NET80211_IEEE80211_PROTO_H_
 #define _NET80211_IEEE80211_PROTO_H_
@@ -237,6 +237,7 @@
 void	ieee80211_dump_pkt(struct ieee80211com *,
 		const u_int8_t *, int, int, int);
 
+extern 	const char *ieee80211_opmode_name[];
 extern	const char *ieee80211_state_name[IEEE80211_S_MAX];
 extern	const char *ieee80211_wme_acnames[];
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703110447.l2B4lv8c054110>