svn commit: r275983 - head/sys/net80211

Adrian Chadd adrian at FreeBSD.org
Sun Dec 21 04:48:56 UTC 2014


Author: adrian
Date: Sun Dec 21 04:48:54 2014
New Revision: 275983
URL: https://svnweb.freebsd.org/changeset/base/275983

Log:
  Break out the unicast/multicast TIM bit setting into "set something
  that indicates we have traffic" bit and a "do something if we have
  traffic bit."
  
  I'm going to be fleshing out this stuff more over time and it'll make
  more sense to have it broken out into two pieces here.

Modified:
  head/sys/net80211/ieee80211_sta.c

Modified: head/sys/net80211/ieee80211_sta.c
==============================================================================
--- head/sys/net80211/ieee80211_sta.c	Sun Dec 21 03:06:11 2014	(r275982)
+++ head/sys/net80211/ieee80211_sta.c	Sun Dec 21 04:48:54 2014	(r275983)
@@ -1405,6 +1405,7 @@ sta_recv_mgmt(struct ieee80211_node *ni,
 				int ix = aid / NBBY;
 				int min = tim->tim_bitctl &~ 1;
 				int max = tim->tim_len + min - 4;
+				int tim_ucast = 0, tim_mcast = 0;
 
 				/*
 				 * Only do this for unicast traffic in the TIM
@@ -1414,20 +1415,42 @@ sta_recv_mgmt(struct ieee80211_node *ni,
 				 */
 				if (min <= ix && ix <= max &&
 				     isset(tim->tim_bitmap - min, aid)) {
-					ieee80211_sta_tim_notify(vap, 1);
-					ic->ic_lastdata = ticks;
+					tim_ucast = 1;
 				}
 
 				/*
-				 * XXX TODO: do a separate notification
+				 * Do a separate notification
 				 * for the multicast bit being set.
 				 */
-#if 0
 				if (tim->tim_bitctl & 1) {
+					tim_mcast = 1;
+				}
+
+				/*
+				 * If the TIM indicates there's traffic for
+				 * us then get us out of STA mode powersave.
+				 */
+				if (tim_ucast == 1) {
+
+					/*
+					 * Wake us out of SLEEP state if we're
+					 * in it; and if we're doing bgscan
+					 * then wake us out of STA powersave.
+					 */
 					ieee80211_sta_tim_notify(vap, 1);
+
+					/*
+					 * This is preventing us from
+					 * continuing a bgscan; because it
+					 * tricks the contbgscan()
+					 * routine to think there's always
+					 * traffic for us.
+					 *
+					 * I think we need both an RX and
+					 * TX ic_lastdata field.
+					 */
 					ic->ic_lastdata = ticks;
 				}
-#endif
 
 				ni->ni_dtim_count = tim->tim_count;
 				ni->ni_dtim_period = tim->tim_period;


More information about the svn-src-all mailing list