2012-06-25 07:48:18

by Eliad Peller

[permalink] [raw]
Subject: [PATCH] mac80211: don't require associated->beacon_ies for ps

beacon_ies is needed only in order to extract the dtim
period. However, even if it's missing we can still enter
ps with dtim=1 (which also happens if the TIM ie is invalid).

Most drivers don't use conf.max_sleep_period/ps_dtim_period
anyway, and this check prevents them from entering ps if
they don't have beacon (but only probe response), even though
the beacon is not needed at all.

Signed-off-by: Eliad Peller <[email protected]>
---
net/mac80211/mlme.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 339b686..426877d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -903,9 +903,6 @@ static bool ieee80211_powersave_allowed(struct ieee80211_sub_if_data *sdata)
if (!mgd->associated)
return false;

- if (!mgd->associated->beacon_ies)
- return false;
-
if (mgd->flags & (IEEE80211_STA_BEACON_POLL |
IEEE80211_STA_CONNECTION_POLL))
return false;
--
1.7.6.401.g6a319



2012-06-25 13:27:31

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mac80211: don't require associated->beacon_ies for ps

Eliad Peller <[email protected]> writes:

> beacon_ies is needed only in order to extract the dtim
> period. However, even if it's missing we can still enter
> ps with dtim=1 (which also happens if the TIM ie is invalid).
>
> Most drivers don't use conf.max_sleep_period/ps_dtim_period
> anyway, and this check prevents them from entering ps if
> they don't have beacon (but only probe response), even though
> the beacon is not needed at all.

Does this increase the chances of accidentally using dtim 1 even though
AP has dtim > 1? I'm just worried that it's difficult to detect cases
when we are forcing dtim to 1 and nobody might not notice it. How often
will this happen?

Should we add a warning message for that case? Or few years ago we
talked about waiting for a beacon before enabling ps mode, should we
reconsider that? (Or maybe it's implemented already?)

--
Kalle Valo

2012-06-25 13:54:40

by Eliad Peller

[permalink] [raw]
Subject: Re: [PATCH] mac80211: don't require associated->beacon_ies for ps

On Mon, Jun 25, 2012 at 4:27 PM, Kalle Valo <[email protected]> wrote:
>> beacon_ies is needed only in order to extract the dtim
>> period. However, even if it's missing we can still enter
>> ps with dtim=1 (which also happens if the TIM ie is invalid).
>>
>> Most drivers don't use conf.max_sleep_period/ps_dtim_period
>> anyway, and this check prevents them from entering ps if
>> they don't have beacon (but only probe response), even though
>> the beacon is not needed at all.
>
> Does this increase the chances of accidentally using dtim 1 even though
> AP has dtim > 1? I'm just worried that it's difficult to detect cases
> when we are forcing dtim to 1 and nobody might not notice it. How often
> will this happen?
>
doesn't dtim=1 is still better than not entering ps at all?
i think the only bad effect of using dtim=1 (instead of greater value)
is wrt power saving. but entering psm with dtim=1 is still better than
not entering psm at all.

> Should we add a warning message for that case? Or few years ago we
> talked about waiting for a beacon before enabling ps mode, should we
> reconsider that? (Or maybe it's implemented already?)
the current behavior is not entering ps if there is no beacon.
however, as i've just explained, i think we can drop this requirement.
i don't think we should add a warning, as this might be a legitimate
behavior (as probe response might be enough in order to connect).

Eliad.

2012-06-28 09:39:43

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: don't require associated->beacon_ies for ps

On Mon, 2012-06-25 at 10:48 +0300, Eliad Peller wrote:
> beacon_ies is needed only in order to extract the dtim
> period. However, even if it's missing we can still enter
> ps with dtim=1 (which also happens if the TIM ie is invalid).
>
> Most drivers don't use conf.max_sleep_period/ps_dtim_period
> anyway, and this check prevents them from entering ps if
> they don't have beacon (but only probe response), even though
> the beacon is not needed at all.
>
> Signed-off-by: Eliad Peller <[email protected]>

I'll apply this, but if somebody doesn't fix the PS stuff soon I'll be
very tempted to just rip it out ;-)

johannes


2012-07-01 13:04:46

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mac80211: don't require associated->beacon_ies for ps

Hi Eliad,

sorry for the late reply, I'm on vacation and enjoying Finland's great
summer, 18 C and raining :)

Eliad Peller <[email protected]> writes:

> On Mon, Jun 25, 2012 at 4:27 PM, Kalle Valo <[email protected]> wrote:
>>> beacon_ies is needed only in order to extract the dtim
>>> period. However, even if it's missing we can still enter
>>> ps with dtim=1 (which also happens if the TIM ie is invalid).
>>>
>>> Most drivers don't use conf.max_sleep_period/ps_dtim_period
>>> anyway, and this check prevents them from entering ps if
>>> they don't have beacon (but only probe response), even though
>>> the beacon is not needed at all.
>>
>> Does this increase the chances of accidentally using dtim 1 even though
>> AP has dtim > 1? I'm just worried that it's difficult to detect cases
>> when we are forcing dtim to 1 and nobody might not notice it. How often
>> will this happen?
>>
> doesn't dtim=1 is still better than not entering ps at all?
> i think the only bad effect of using dtim=1 (instead of greater value)
> is wrt power saving. but entering psm with dtim=1 is still better than
> not entering psm at all.

Sure. I was just thinking ahead and trying to avoid future problems
(ie. accidentally using dtim=1).

--
Kalle Valo