linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Prevent dynamic ps for rx broadcast frames
@ 2010-04-09  8:46 Juuso Oikarinen
  2010-04-09  9:12 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Juuso Oikarinen @ 2010-04-09  8:46 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

Currently the dynamic ps timer is restarted for all non-multicast rx data
frames. Congested networks have lots of broadcast traffic, which will cause
the power save to remain disabled for much of the time, which causes trouble
for battery-powered devices.

Fix this by preventing rx broadcast data frames from restarting the
dynamic ps timer.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
---
 net/mac80211/rx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index c0ad7e8..8cdcc4f 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1786,6 +1786,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
 
 	if (ieee80211_is_data(hdr->frame_control) &&
 	    !is_multicast_ether_addr(hdr->addr1) &&
+	    !is_broadcast_ether_addr(hdr->addr1) &&
 	    local->hw.conf.dynamic_ps_timeout > 0 && local->ps_sdata) {
 			mod_timer(&local->dynamic_ps_timer, jiffies +
 			 msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: Prevent dynamic ps for rx broadcast frames
  2010-04-09  8:46 [PATCH] mac80211: Prevent dynamic ps for rx broadcast frames Juuso Oikarinen
@ 2010-04-09  9:12 ` Johannes Berg
  2010-04-09  9:17   ` Juuso Oikarinen
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2010-04-09  9:12 UTC (permalink / raw)
  To: Juuso Oikarinen; +Cc: linville, linux-wireless

On Fri, 2010-04-09 at 11:46 +0300, Juuso Oikarinen wrote:
> Currently the dynamic ps timer is restarted for all non-multicast rx data
> frames. Congested networks have lots of broadcast traffic, which will cause
> the power save to remain disabled for much of the time, which causes trouble
> for battery-powered devices.
> 
> Fix this by preventing rx broadcast data frames from restarting the
> dynamic ps timer.
> 
> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> ---
>  net/mac80211/rx.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index c0ad7e8..8cdcc4f 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -1786,6 +1786,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
>  
>  	if (ieee80211_is_data(hdr->frame_control) &&
>  	    !is_multicast_ether_addr(hdr->addr1) &&
> +	    !is_broadcast_ether_addr(hdr->addr1) &&
>  	    local->hw.conf.dynamic_ps_timeout > 0 && local->ps_sdata) {

Huh? I'm starting to doubt my own sanity now!

Formal logic:

    (bcast => mcast)
<=> (!mcast => !bcast)

Thus

    (!mcast && !bcast)
<=> (!mcast)

right?

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: Prevent dynamic ps for rx broadcast frames
  2010-04-09  9:12 ` Johannes Berg
@ 2010-04-09  9:17   ` Juuso Oikarinen
  0 siblings, 0 replies; 3+ messages in thread
From: Juuso Oikarinen @ 2010-04-09  9:17 UTC (permalink / raw)
  To: ext Johannes Berg; +Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org

On Fri, 2010-04-09 at 11:12 +0200, ext Johannes Berg wrote:
> On Fri, 2010-04-09 at 11:46 +0300, Juuso Oikarinen wrote:
> > Currently the dynamic ps timer is restarted for all non-multicast rx data
> > frames. Congested networks have lots of broadcast traffic, which will cause
> > the power save to remain disabled for much of the time, which causes trouble
> > for battery-powered devices.
> > 
> > Fix this by preventing rx broadcast data frames from restarting the
> > dynamic ps timer.
> > 
> > Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
> > ---
> >  net/mac80211/rx.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> > index c0ad7e8..8cdcc4f 100644
> > --- a/net/mac80211/rx.c
> > +++ b/net/mac80211/rx.c
> > @@ -1786,6 +1786,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
> >  
> >  	if (ieee80211_is_data(hdr->frame_control) &&
> >  	    !is_multicast_ether_addr(hdr->addr1) &&
> > +	    !is_broadcast_ether_addr(hdr->addr1) &&
> >  	    local->hw.conf.dynamic_ps_timeout > 0 && local->ps_sdata) {
> 
> Huh? I'm starting to doubt my own sanity now!
> 
> Formal logic:
> 
>     (bcast => mcast)
> <=> (!mcast => !bcast)
> 
> Thus
> 
>     (!mcast && !bcast)
> <=> (!mcast)
> 
> right?

Heh, don't doubt your sanity. It's me who has lost his. 

You're obviously right. I don't even try to explain what I just thought.
Everyone, pretend you never saw this ;)

-Juuso

> johannes
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-09  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-09  8:46 [PATCH] mac80211: Prevent dynamic ps for rx broadcast frames Juuso Oikarinen
2010-04-09  9:12 ` Johannes Berg
2010-04-09  9:17   ` Juuso Oikarinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).