Date: Sun, 21 Dec 2014 04:48:55 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275983 - head/sys/net80211 Message-ID: <201412210448.sBL4mtbt075952@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412210448.sBL4mtbt075952>