From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Alexander Bondar <alexander.bondar@intel.com>
Subject: [PATCH] mac80211: enable power save only if DTIM period is available
Date: Fri, 10 May 2013 16:10:48 +0200 [thread overview]
Message-ID: <1368195048-27326-1-git-send-email-johannes@sipsolutions.net> (raw)
From: Alexander Bondar <alexander.bondar@intel.com>
Generally, the DTIM period is available after a beacon has
been received, and if no beacon has been received enabling
powersave is problematic anyway for synchronisation. Since
some drivers may require the DTIM period for powersave,
don't enable powersave until it becomes available in case
the scan/association managed to not receive a beacon.
Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/mlme.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 2bfcdda..07a3eb5 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1390,6 +1390,9 @@ static bool ieee80211_powersave_allowed(struct ieee80211_sub_if_data *sdata)
IEEE80211_STA_CONNECTION_POLL))
return false;
+ if (!sdata->vif.bss_conf.dtim_period)
+ return false;
+
rcu_read_lock();
sta = sta_info_get(sdata, mgd->bssid);
if (sta)
@@ -3126,6 +3129,7 @@ ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
}
changed |= BSS_CHANGED_DTIM_PERIOD;
+ ieee80211_recalc_ps_vif(sdata);
}
if (elems.erp_info) {
--
1.8.0
next reply other threads:[~2013-05-10 14:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 14:10 Johannes Berg [this message]
2013-05-16 21:01 ` [PATCH] mac80211: enable power save only if DTIM period is available Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1368195048-27326-1-git-send-email-johannes@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=alexander.bondar@intel.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox