Skip to content

Commit

Permalink
iwlwifi: read rfkill during resume
Browse files Browse the repository at this point in the history
When resuming from hibernate or suspend,
the status of the rfkill switch isn't
known since it might have been toggled
while the system was asleep. Therefore,
we need to read out the status at resume
time to make sure the system knows about
an up-to-date status.

Reported-by: Mark Tung <mark.y.tung@intel.com>
Tested-by: Mark Tung <mark.y.tung@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
  • Loading branch information
Johannes Berg authored and Reinette Chatre committed Jun 25, 2010
1 parent 278c2f6 commit 0ab84cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2845,6 +2845,7 @@ int iwl_pci_resume(struct pci_dev *pdev)
{
struct iwl_priv *priv = pci_get_drvdata(pdev);
int ret;
bool hw_rfkill = false;

/*
* We disable the RETRY_TIMEOUT register (0x41) to keep
Expand All @@ -2859,6 +2860,17 @@ int iwl_pci_resume(struct pci_dev *pdev)
pci_restore_state(pdev);
iwl_enable_interrupts(priv);

if (!(iwl_read32(priv, CSR_GP_CNTRL) &
CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
hw_rfkill = true;

if (hw_rfkill)
set_bit(STATUS_RF_KILL_HW, &priv->status);
else
clear_bit(STATUS_RF_KILL_HW, &priv->status);

wiphy_rfkill_set_hw_state(priv->hw->wiphy, hw_rfkill);

return 0;
}
EXPORT_SYMBOL(iwl_pci_resume);
Expand Down

0 comments on commit 0ab84cf

Please sign in to comment.