mac80211: reset connection idle when going offchannel
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 16 Sep 2010 19:12:31 +0000 (15:12 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 16 Sep 2010 19:46:15 +0000 (15:46 -0400)
When we go offchannel mac80211 currently leaves alive the
connection idle monitor. This should be instead postponed
until we come back to our home channel, otherwise by the
time we get back to the home channel we could be triggering
unecesary probe requests. For APs that do not respond to
unicast probe requests (Nexus One is a simple example) this
means we essentially get disconnected after the probes
fails.

This patch has stable fixes for kernels [2.6.35+]

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/offchannel.c

index eeacaa59380a4c4cc91fe7f48d8ca622a13396b0..627a33ef84c43175bf0fdfa854e7b563e3f927a6 100644 (file)
 static void ieee80211_offchannel_ps_enable(struct ieee80211_sub_if_data *sdata)
 {
        struct ieee80211_local *local = sdata->local;
+       struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
 
        local->offchannel_ps_enabled = false;
 
        /* FIXME: what to do when local->pspolling is true? */
 
        del_timer_sync(&local->dynamic_ps_timer);
+       del_timer_sync(&ifmgd->conn_mon_timer);
+
        cancel_work_sync(&local->dynamic_ps_enable_work);
 
        if (local->hw.conf.flags & IEEE80211_CONF_PS) {
@@ -85,6 +88,8 @@ static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata)
                mod_timer(&local->dynamic_ps_timer, jiffies +
                          msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));
        }
+
+       ieee80211_sta_reset_conn_monitor(sdata);
 }
 
 void ieee80211_offchannel_stop_beaconing(struct ieee80211_local *local)