Skip to content

Commit

Permalink
iwlwifi: fix unhandled interrupt when HW rfkill is on
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Aug 4, 2008
1 parent caab8f1 commit c1842d6
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2232,17 +2232,16 @@ static int __iwl4965_up(struct iwl_priv *priv)
}

/* If platform's RF_KILL switch is NOT set to KILL */
if (iwl_read32(priv, CSR_GP_CNTRL) &
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
clear_bit(STATUS_RF_KILL_HW, &priv->status);
else
set_bit(STATUS_RF_KILL_HW, &priv->status);

if (!test_bit(STATUS_IN_SUSPEND, &priv->status) &&
iwl_is_rfkill(priv)) {
if (iwl_is_rfkill(priv)) {
iwl4965_enable_interrupts(priv);
IWL_WARNING("Radio disabled by %s RF Kill switch\n",
test_bit(STATUS_RF_KILL_HW, &priv->status) ? "HW" : "SW");
return -ENODEV;
return 0;
}

iwl_write32(priv, CSR_INT, 0xFFFFFFFF);
Expand Down Expand Up @@ -2278,11 +2277,6 @@ static int __iwl4965_up(struct iwl_priv *priv)
memcpy(priv->ucode_data_backup.v_addr, priv->ucode_data.v_addr,
priv->ucode_data.len);

/* We return success when we resume from suspend and rf_kill is on. */
if (test_bit(STATUS_RF_KILL_HW, &priv->status) ||
test_bit(STATUS_RF_KILL_SW, &priv->status))
return 0;

for (i = 0; i < MAX_HW_RESTARTS; i++) {

iwl_clear_stations_table(priv);
Expand Down Expand Up @@ -2651,6 +2645,9 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw)
if (ret)
goto out_release_irq;

if (iwl_is_rfkill(priv))
goto out;

IWL_DEBUG_INFO("Start UP work done.\n");

if (test_bit(STATUS_IN_SUSPEND, &priv->status))
Expand All @@ -2670,6 +2667,7 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw)
}
}

out:
priv->is_open = 1;
IWL_DEBUG_MAC80211("leave\n");
return 0;
Expand Down

0 comments on commit c1842d6

Please sign in to comment.