diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-06-18 04:38:56 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-06-25 18:20:18 -0400 |
commit | 0ab84cff8befbea342576cd6dc21026d5c9244df (patch) | |
tree | 05b6640ae1208c0af7c395a8d36fec3efbcbe313 /drivers | |
parent | 278c2f6faafebe28b9776918ce5fbaef9795c141 (diff) |
iwlwifi: read rfkill during resume
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index f47a58ff3252..a56fb466d0b6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2845,6 +2845,7 @@ int iwl_pci_resume(struct pci_dev *pdev) | |||
2845 | { | 2845 | { |
2846 | struct iwl_priv *priv = pci_get_drvdata(pdev); | 2846 | struct iwl_priv *priv = pci_get_drvdata(pdev); |
2847 | int ret; | 2847 | int ret; |
2848 | bool hw_rfkill = false; | ||
2848 | 2849 | ||
2849 | /* | 2850 | /* |
2850 | * We disable the RETRY_TIMEOUT register (0x41) to keep | 2851 | * We disable the RETRY_TIMEOUT register (0x41) to keep |
@@ -2859,6 +2860,17 @@ int iwl_pci_resume(struct pci_dev *pdev) | |||
2859 | pci_restore_state(pdev); | 2860 | pci_restore_state(pdev); |
2860 | iwl_enable_interrupts(priv); | 2861 | iwl_enable_interrupts(priv); |
2861 | 2862 | ||
2863 | if (!(iwl_read32(priv, CSR_GP_CNTRL) & | ||
2864 | CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)) | ||
2865 | hw_rfkill = true; | ||
2866 | |||
2867 | if (hw_rfkill) | ||
2868 | set_bit(STATUS_RF_KILL_HW, &priv->status); | ||
2869 | else | ||
2870 | clear_bit(STATUS_RF_KILL_HW, &priv->status); | ||
2871 | |||
2872 | wiphy_rfkill_set_hw_state(priv->hw->wiphy, hw_rfkill); | ||
2873 | |||
2862 | return 0; | 2874 | return 0; |
2863 | } | 2875 | } |
2864 | EXPORT_SYMBOL(iwl_pci_resume); | 2876 | EXPORT_SYMBOL(iwl_pci_resume); |