From 7dc45f25d39ea959fdc1d5f636e9fc6cbe7ac7e0 Mon Sep 17 00:00:00 2001 From: Abhijeet Kolekar Date: Wed, 18 Feb 2009 15:54:32 -0800 Subject: [PATCH] iwl3945: use SW rfkill from iwlwifi Patch unifies use of SW rfkill between 3945 and agn driver. Signed-off-by: Abhijeet Kolekar Acked-by: Samuel Ortiz Signed-off-by: Reinette Chatre Signed-off-by: John W. Linville --- drivers/net/wireless/iwlwifi/iwl3945-base.c | 56 ++------------------- 1 file changed, 5 insertions(+), 51 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 68cd2e7b6a7c..d0596e7f64e6 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -1156,56 +1156,6 @@ drop: return -1; } -static void iwl3945_radio_kill_sw(struct iwl_priv *priv, int disable_radio) -{ - unsigned long flags; - - if (!!disable_radio == test_bit(STATUS_RF_KILL_SW, &priv->status)) - return; - - IWL_DEBUG_RF_KILL(priv, "Manual SW RF KILL set to: RADIO %s\n", - disable_radio ? "OFF" : "ON"); - - if (disable_radio) { - iwl_scan_cancel(priv); - /* FIXME: This is a workaround for AP */ - if (priv->iw_mode != NL80211_IFTYPE_AP) { - spin_lock_irqsave(&priv->lock, flags); - iwl_write32(priv, CSR_UCODE_DRV_GP1_SET, - CSR_UCODE_SW_BIT_RFKILL); - spin_unlock_irqrestore(&priv->lock, flags); - iwl_send_card_state(priv, CARD_STATE_CMD_DISABLE, 0); - set_bit(STATUS_RF_KILL_SW, &priv->status); - } - return; - } - - spin_lock_irqsave(&priv->lock, flags); - iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); - - clear_bit(STATUS_RF_KILL_SW, &priv->status); - spin_unlock_irqrestore(&priv->lock, flags); - - /* wake up ucode */ - msleep(10); - - spin_lock_irqsave(&priv->lock, flags); - iwl_read32(priv, CSR_UCODE_DRV_GP1); - if (!iwl_grab_nic_access(priv)) - iwl_release_nic_access(priv); - spin_unlock_irqrestore(&priv->lock, flags); - - if (test_bit(STATUS_RF_KILL_HW, &priv->status)) { - IWL_DEBUG_RF_KILL(priv, "Can not turn radio back on - " - "disabled by HW switch\n"); - return; - } - - if (priv->is_open) - queue_work(priv->workqueue, &priv->restart); - return; -} - #ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT #include "iwl-spectrum.h" @@ -3879,9 +3829,13 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed) } #endif - iwl3945_radio_kill_sw(priv, !conf->radio_enabled); + if (conf->radio_enabled && iwl_radio_kill_sw_enable_radio(priv)) { + IWL_DEBUG_MAC80211(priv, "leave - RF-KILL - waiting for uCode\n"); + goto out; + } if (!conf->radio_enabled) { + iwl_radio_kill_sw_disable_radio(priv); IWL_DEBUG_MAC80211(priv, "leave - radio disabled\n"); goto out; } -- 2.39.5