Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Jan 2009 20:24:04 +0000 (UTC)
From:      Doug White <dwhite@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r187739 - stable/7/sys/net80211
Message-ID:  <200901262024.n0QKO4vA062018@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dwhite
Date: Mon Jan 26 20:24:04 2009
New Revision: 187739
URL: http://svn.freebsd.org/changeset/base/187739

Log:
  Fix hostap power-save station support by always initializing the TIM
  bitmaps. Prior to this change, hostap would queue packets for power-saved
  stations but not indicate in the beacon that the station should wake up
  and poll for those queued packets.
  
  Reviewed by:	sam

Modified:
  stable/7/sys/net80211/ieee80211_freebsd.h
  stable/7/sys/net80211/ieee80211_power.c

Modified: stable/7/sys/net80211/ieee80211_freebsd.h
==============================================================================
--- stable/7/sys/net80211/ieee80211_freebsd.h	Mon Jan 26 18:46:37 2009	(r187738)
+++ stable/7/sys/net80211/ieee80211_freebsd.h	Mon Jan 26 20:24:04 2009	(r187739)
@@ -115,7 +115,7 @@ typedef struct mtx ieee80211_scan_lock_t
 #define	_IEEE80211_NODE_SAVEQ_ENQUEUE(_ni, _m, _qlen, _age) do {\
 	(_m)->m_nextpkt = NULL;					\
 	if ((_ni)->ni_savedq.ifq_tail != NULL) { 		\
-		_age -= M_AGE_GET((_ni)->ni_savedq.ifq_tail);	\
+		_age -= M_AGE_GET((_ni)->ni_savedq.ifq_head);	\
 		(_ni)->ni_savedq.ifq_tail->m_nextpkt = (_m);	\
 	} else { 						\
 		(_ni)->ni_savedq.ifq_head = (_m); 		\

Modified: stable/7/sys/net80211/ieee80211_power.c
==============================================================================
--- stable/7/sys/net80211/ieee80211_power.c	Mon Jan 26 18:46:37 2009	(r187738)
+++ stable/7/sys/net80211/ieee80211_power.c	Mon Jan 26 20:24:04 2009	(r187739)
@@ -48,29 +48,20 @@ static void ieee80211_set_tim(struct iee
 void
 ieee80211_power_attach(struct ieee80211com *ic)
 {
-	if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
-	    ic->ic_opmode == IEEE80211_M_IBSS) {
-		/* NB: driver should override */
-		ic->ic_set_tim = ieee80211_set_tim;
-	}
+	/* NB: driver should override */
+	ic->ic_set_tim = ieee80211_set_tim;
 }
 
 void
 ieee80211_power_lateattach(struct ieee80211com *ic)
 {
-	/*
-	 * Allocate these only if needed.  Beware that we
-	 * know adhoc mode doesn't support ATIM yet...
-	 */
-	if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
-		ic->ic_tim_len = howmany(ic->ic_max_aid,8) * sizeof(uint8_t);
-		MALLOC(ic->ic_tim_bitmap, uint8_t *, ic->ic_tim_len,
-			M_DEVBUF, M_NOWAIT | M_ZERO);
-		if (ic->ic_tim_bitmap == NULL) {
-			printf("%s: no memory for TIM bitmap!\n", __func__);
-			/* XXX good enough to keep from crashing? */
-			ic->ic_tim_len = 0;
-		}
+	ic->ic_tim_len = howmany(ic->ic_max_aid,8) * sizeof(uint8_t);
+	MALLOC(ic->ic_tim_bitmap, uint8_t *, ic->ic_tim_len,
+		M_DEVBUF, M_NOWAIT | M_ZERO);
+	if (ic->ic_tim_bitmap == NULL) {
+		printf("%s: no memory for TIM bitmap!\n", __func__);
+		/* XXX good enough to keep from crashing? */
+		ic->ic_tim_len = 0;
 	}
 }
 



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