From patchwork Tue May 3 18:40:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luciano Coelho X-Patchwork-Id: 751092 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p43IeOtK007080 for ; Tue, 3 May 2011 18:40:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754426Ab1ECSkX (ORCPT ); Tue, 3 May 2011 14:40:23 -0400 Received: from na3sys009aog117.obsmtp.com ([74.125.149.242]:58814 "EHLO na3sys009aog117.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419Ab1ECSkX (ORCPT ); Tue, 3 May 2011 14:40:23 -0400 Received: from mail-ew0-f43.google.com ([209.85.215.43]) (using TLSv1) by na3sys009aob117.postini.com ([74.125.148.12]) with SMTP ID DSNKTcBMFLiAjrvpIus6dEkuDhnNxtWjHhCO@postini.com; Tue, 03 May 2011 11:40:22 PDT Received: by mail-ew0-f43.google.com with SMTP id 20so153344ewy.2 for ; Tue, 03 May 2011 11:40:20 -0700 (PDT) Received: by 10.14.16.100 with SMTP id g76mr73303eeg.168.1304448020329; Tue, 03 May 2011 11:40:20 -0700 (PDT) Received: from localhost.localdomain (a88-115-104-185.elisa-laajakaista.fi [88.115.104.185]) by mx.google.com with ESMTPS id y18sm241782eeh.22.2011.05.03.11.40.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2011 11:40:18 -0700 (PDT) From: Luciano Coelho To: linville@tuxdriver.com Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org, ido@wizery.com Subject: [PATCH] mac80211: don't start the dynamic ps timer if not associated Date: Tue, 3 May 2011 21:40:08 +0300 Message-Id: <1304448008-7816-1-git-send-email-coelho@ti.com> X-Mailer: git-send-email 1.7.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 03 May 2011 18:40:27 +0000 (UTC) When we are disconnecting, we set PS off, but this happens before we send the deauth/disassoc request. When the deauth/disassoc frames are sent, we trigger the dynamic ps timer, which then times out and turns PS back on. Thus, PS remains on after disconnecting, causing problems when associating again. This can be fixed by preventing the timer to start when we're not associated anymore. Signed-off-by: Luciano Coelho --- net/mac80211/tx.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index e3e3aa1..21accf8 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -237,6 +237,10 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx) &local->dynamic_ps_disable_work); } + /* Don't restart the timer if we're not disassociated */ + if (!ifmgd->associated) + return TX_CONTINUE; + mod_timer(&local->dynamic_ps_timer, jiffies + msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));