From: <wey-yi.w.guy@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH v3 1/1] mac80211: tell driver when dtim change detected
Date: Thu, 21 Jan 2010 13:39:56 -0800 [thread overview]
Message-ID: <1264109996-15995-1-git-send-email-wey-yi.w.guy@intel.com> (raw)
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
In current implementation, mac80211 send dtim_period update to driver
during association, but if no NetworkManager or similar application
perform scan operation, plus tim_ie is not part of probe response; mac80211 will
not get beacon with dtim information later, then mac80211 will not pass the
information to driver for update.
Call ieee80211_hw_config() with IEEE80211_CONF_CHANGE_PS flag set to
allow driver make correct dtim adjustment if dtim_period change
detected. Also perform recalc_ps operation if needed.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
v2: move the function to ieee80211_rx_bss_info() to make sure only call
when needed
v3: do not check for STATION and call recal_ps to perform hw_config
---
net/mac80211/mlme.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1e1d16c..46df5bf 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1157,6 +1157,21 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
}
+static void ieee80211_update_dtim(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211_local *local,
+ struct ieee80211_bss *bss)
+{
+ if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
+ return;
+
+ if (sdata->vif.bss_conf.dtim_period != bss->dtim_period) {
+ sdata->vif.bss_conf.dtim_period = bss->dtim_period;
+ mutex_lock(&local->iflist_mtx);
+ ieee80211_recalc_ps(local, -1);
+ mutex_unlock(&local->iflist_mtx);
+ }
+}
+
static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt,
size_t len,
@@ -1181,8 +1196,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems,
channel, beacon);
- if (bss)
+ if (bss) {
ieee80211_rx_bss_put(local, bss);
+ ieee80211_update_dtim(sdata, local, bss);
+ }
if (!sdata->u.mgd.associated)
return;
--
1.5.6.3
next reply other threads:[~2010-01-21 21:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-21 21:39 wey-yi.w.guy [this message]
2010-01-22 19:03 ` [PATCH v3 1/1] mac80211: tell driver when dtim change detected Johannes Berg
2010-01-22 19:20 ` Luis R. Rodriguez
2010-01-22 19:46 ` Johannes Berg
2010-01-22 23:44 ` Luis R. Rodriguez
2010-01-22 23:45 ` Luis R. Rodriguez
2010-01-23 0:11 ` Guy, Wey-Yi
2010-01-23 0:23 ` Luis R. Rodriguez
2010-01-23 0:22 ` Guy, Wey-Yi
2010-01-23 12:46 ` Johannes Berg
2010-01-25 18:18 ` Luis R. Rodriguez
2010-01-25 18:33 ` Johannes Berg
2010-01-25 19:55 ` Luis R. Rodriguez
2010-01-25 20:06 ` Johannes Berg
2010-01-26 8:41 ` Kalle Valo
2010-01-25 18:32 ` Jouni Malinen
2010-01-25 18:36 ` Johannes Berg
2010-01-25 18:38 ` Johannes Berg
2010-01-23 8:23 ` Kalle Valo
2010-01-25 18:35 ` Jouni Malinen
2010-01-25 20:11 ` Johannes Berg
2010-01-25 20:46 ` Guy, Wey-Yi
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=1264109996-15995-1-git-send-email-wey-yi.w.guy@intel.com \
--to=wey-yi.w.guy@intel.com \
--cc=johannes@sipsolutions.net \
--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