aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-02-18 18:54:32 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:46 -0500
commit7dc45f25d39ea959fdc1d5f636e9fc6cbe7ac7e0 (patch)
tree177a9e6cfbb02e3c684cd9fbac4894c25ca99b5a /drivers/net
parentf17d08a657ee0713390ccf9a0b0ebf4f80495161 (diff)
iwl3945: use SW rfkill from iwlwifi
Patch unifies use of SW rfkill between 3945 and agn driver. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c56
1 files 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:
1156 return -1; 1156 return -1;
1157} 1157}
1158 1158
1159static void iwl3945_radio_kill_sw(struct iwl_priv *priv, int disable_radio)
1160{
1161 unsigned long flags;
1162
1163 if (!!disable_radio == test_bit(STATUS_RF_KILL_SW, &priv->status))
1164 return;
1165
1166 IWL_DEBUG_RF_KILL(priv, "Manual SW RF KILL set to: RADIO %s\n",
1167 disable_radio ? "OFF" : "ON");
1168
1169 if (disable_radio) {
1170 iwl_scan_cancel(priv);
1171 /* FIXME: This is a workaround for AP */
1172 if (priv->iw_mode != NL80211_IFTYPE_AP) {
1173 spin_lock_irqsave(&priv->lock, flags);
1174 iwl_write32(priv, CSR_UCODE_DRV_GP1_SET,
1175 CSR_UCODE_SW_BIT_RFKILL);
1176 spin_unlock_irqrestore(&priv->lock, flags);
1177 iwl_send_card_state(priv, CARD_STATE_CMD_DISABLE, 0);
1178 set_bit(STATUS_RF_KILL_SW, &priv->status);
1179 }
1180 return;
1181 }
1182
1183 spin_lock_irqsave(&priv->lock, flags);
1184 iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
1185
1186 clear_bit(STATUS_RF_KILL_SW, &priv->status);
1187 spin_unlock_irqrestore(&priv->lock, flags);
1188
1189 /* wake up ucode */
1190 msleep(10);
1191
1192 spin_lock_irqsave(&priv->lock, flags);
1193 iwl_read32(priv, CSR_UCODE_DRV_GP1);
1194 if (!iwl_grab_nic_access(priv))
1195 iwl_release_nic_access(priv);
1196 spin_unlock_irqrestore(&priv->lock, flags);
1197
1198 if (test_bit(STATUS_RF_KILL_HW, &priv->status)) {
1199 IWL_DEBUG_RF_KILL(priv, "Can not turn radio back on - "
1200 "disabled by HW switch\n");
1201 return;
1202 }
1203
1204 if (priv->is_open)
1205 queue_work(priv->workqueue, &priv->restart);
1206 return;
1207}
1208
1209#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT 1159#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
1210 1160
1211#include "iwl-spectrum.h" 1161#include "iwl-spectrum.h"
@@ -3879,9 +3829,13 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed)
3879 } 3829 }
3880#endif 3830#endif
3881 3831
3882 iwl3945_radio_kill_sw(priv, !conf->radio_enabled); 3832 if (conf->radio_enabled && iwl_radio_kill_sw_enable_radio(priv)) {
3833 IWL_DEBUG_MAC80211(priv, "leave - RF-KILL - waiting for uCode\n");
3834 goto out;
3835 }
3883 3836
3884 if (!conf->radio_enabled) { 3837 if (!conf->radio_enabled) {
3838 iwl_radio_kill_sw_disable_radio(priv);
3885 IWL_DEBUG_MAC80211(priv, "leave - radio disabled\n"); 3839 IWL_DEBUG_MAC80211(priv, "leave - radio disabled\n");
3886 goto out; 3840 goto out;
3887 } 3841 }