aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-08-04 04:00:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-04 15:09:13 -0400
commitc1842d6150c4efe1d01e7a8cf86c63aec6223486 (patch)
tree64cd3e8bf1fc0f21a953fcf219ec6d23691461aa /drivers/net
parentcaab8f1a5d0da583b6ffe41afea2774c676444ca (diff)
iwlwifi: fix unhandled interrupt when HW rfkill is on
This patch fixes unhandled interrupt when HW rfkill is on during devices start up. The behavior changes, now open is successful even when rfkill is on. This is to align with the situation when rfkill is set on after opening. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 6503b3ac8d66..b8407d5704a1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2232,17 +2232,16 @@ static int __iwl4965_up(struct iwl_priv *priv)
2232 } 2232 }
2233 2233
2234 /* If platform's RF_KILL switch is NOT set to KILL */ 2234 /* If platform's RF_KILL switch is NOT set to KILL */
2235 if (iwl_read32(priv, CSR_GP_CNTRL) & 2235 if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
2236 CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
2237 clear_bit(STATUS_RF_KILL_HW, &priv->status); 2236 clear_bit(STATUS_RF_KILL_HW, &priv->status);
2238 else 2237 else
2239 set_bit(STATUS_RF_KILL_HW, &priv->status); 2238 set_bit(STATUS_RF_KILL_HW, &priv->status);
2240 2239
2241 if (!test_bit(STATUS_IN_SUSPEND, &priv->status) && 2240 if (iwl_is_rfkill(priv)) {
2242 iwl_is_rfkill(priv)) { 2241 iwl4965_enable_interrupts(priv);
2243 IWL_WARNING("Radio disabled by %s RF Kill switch\n", 2242 IWL_WARNING("Radio disabled by %s RF Kill switch\n",
2244 test_bit(STATUS_RF_KILL_HW, &priv->status) ? "HW" : "SW"); 2243 test_bit(STATUS_RF_KILL_HW, &priv->status) ? "HW" : "SW");
2245 return -ENODEV; 2244 return 0;
2246 } 2245 }
2247 2246
2248 iwl_write32(priv, CSR_INT, 0xFFFFFFFF); 2247 iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
@@ -2278,11 +2277,6 @@ static int __iwl4965_up(struct iwl_priv *priv)
2278 memcpy(priv->ucode_data_backup.v_addr, priv->ucode_data.v_addr, 2277 memcpy(priv->ucode_data_backup.v_addr, priv->ucode_data.v_addr,
2279 priv->ucode_data.len); 2278 priv->ucode_data.len);
2280 2279
2281 /* We return success when we resume from suspend and rf_kill is on. */
2282 if (test_bit(STATUS_RF_KILL_HW, &priv->status) ||
2283 test_bit(STATUS_RF_KILL_SW, &priv->status))
2284 return 0;
2285
2286 for (i = 0; i < MAX_HW_RESTARTS; i++) { 2280 for (i = 0; i < MAX_HW_RESTARTS; i++) {
2287 2281
2288 iwl_clear_stations_table(priv); 2282 iwl_clear_stations_table(priv);
@@ -2651,6 +2645,9 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw)
2651 if (ret) 2645 if (ret)
2652 goto out_release_irq; 2646 goto out_release_irq;
2653 2647
2648 if (iwl_is_rfkill(priv))
2649 goto out;
2650
2654 IWL_DEBUG_INFO("Start UP work done.\n"); 2651 IWL_DEBUG_INFO("Start UP work done.\n");
2655 2652
2656 if (test_bit(STATUS_IN_SUSPEND, &priv->status)) 2653 if (test_bit(STATUS_IN_SUSPEND, &priv->status))
@@ -2670,6 +2667,7 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw)
2670 } 2667 }
2671 } 2668 }
2672 2669
2670out:
2673 priv->is_open = 1; 2671 priv->is_open = 1;
2674 IWL_DEBUG_MAC80211("leave\n"); 2672 IWL_DEBUG_MAC80211("leave\n");
2675 return 0; 2673 return 0;