From patchwork Wed Sep 23 08:19:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith X-Patchwork-Id: 49493 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8N8IBaT032043 for ; Wed, 23 Sep 2009 08:18:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754356AbZIWISF (ORCPT ); Wed, 23 Sep 2009 04:18:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754348AbZIWISE (ORCPT ); Wed, 23 Sep 2009 04:18:04 -0400 Received: from mail.atheros.com ([12.36.123.2]:46433 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754356AbZIWISD (ORCPT ); Wed, 23 Sep 2009 04:18:03 -0400 Received: from mail.atheros.com ([10.10.20.105]) by sidewinder.atheros.com for ; Wed, 23 Sep 2009 01:18:08 -0700 Received: from CHEXHC-01.global.atheros.com (10.12.0.100) by SC1EXHC-01.global.atheros.com (10.10.20.105) with Microsoft SMTP Server (TLS) id 8.0.751.0; Wed, 23 Sep 2009 01:18:07 -0700 Received: from neuromancer (10.12.4.103) by CHEXHC-01.global.atheros.com (10.12.0.100) with Microsoft SMTP Server (TLS) id 8.0.751.0; Wed, 23 Sep 2009 13:48:01 +0530 From: Sujith MIME-Version: 1.0 Message-ID: <19129.55808.751631.154022@gargle.gargle.HOWL> Date: Wed, 23 Sep 2009 13:49:12 +0530 To: X-Mailer: VM 8.0.12 under 23.1.1 (x86_64-unknown-linux-gnu) CC: Subject: [PATCH] ath9k: Fix RFKILL bugs Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This patch fixes 2 issues in RFKILL: * Calling wiphy_rfkill_stop_polling() in ath9k_stop would mean that the driver cannot report HW status when the radio is re-enabled. Move this to ath_detach(). * Calling ath_radio_{enable/disable} without checking the current state results in ath_radio_enable() being called repeatedly for every invocation of rfkill_poll(). This is not needed in any case since wiphy_rfkill_set_hw_state() would call ->stop() if the radio has been disabled. Signed-off-by: Sujith Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath9k/main.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 0d6bbb8..2278dcb 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1299,11 +1299,6 @@ static void ath9k_rfkill_poll_state(struct ieee80211_hw *hw) bool blocked = !!ath_is_rfkill_set(sc); wiphy_rfkill_set_hw_state(hw->wiphy, blocked); - - if (blocked) - ath_radio_disable(sc); - else - ath_radio_enable(sc); } static void ath_start_rfkill_poll(struct ath_softc *sc) @@ -1337,6 +1332,7 @@ void ath_detach(struct ath_softc *sc) dev_dbg(sc->dev, "Detach ATH hw\n"); ath_deinit_leds(sc); + wiphy_rfkill_stop_polling(sc->hw->wiphy); for (i = 0; i < sc->num_sec_wiphy; i++) { struct ath_wiphy *aphy = sc->sec_wiphy[i]; @@ -2524,8 +2520,6 @@ static void ath9k_stop(struct ieee80211_hw *hw) } else sc->rx.rxlink = NULL; - wiphy_rfkill_stop_polling(sc->hw->wiphy); - /* disable HAL and put h/w to sleep */ ath9k_hw_disable(ah); ath9k_hw_configpcipowersave(ah, 1, 1);