diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2011-04-28 05:51:25 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-29 15:36:13 -0400 |
commit | a078a1fde11b350161e7db2c44353dfae7749212 (patch) | |
tree | eae9be340b9bc3410819186bf7d06147493e244b | |
parent | ab42b4041707f075533845ecb320c7a1c5621f1b (diff) |
iwlegacy: enable only rfkill interrupt when device is down
Add two below iwlwifi commits to iwlegacy:
commit 554d1d027b19265c4aa3f718b3126d2b86e09a08
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Thu Dec 23 12:38:21 2010 +0100
iwlagn: enable only rfkill interrupt when device is down
commit 3dd823e6b86407aed1a025041d8f1df77e43a9c8
Author: Don Fry <donald.h.fry@intel.com>
Date: Sun Feb 6 09:29:45 2011 -0800
iwlagn: Re-enable RF_KILL interrupt when down
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-helpers.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl4965-base.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-helpers.h b/drivers/net/wireless/iwlegacy/iwl-helpers.h index 02132e755831..a6effdae63f9 100644 --- a/drivers/net/wireless/iwlegacy/iwl-helpers.h +++ b/drivers/net/wireless/iwlegacy/iwl-helpers.h | |||
@@ -149,6 +149,12 @@ static inline void iwl_legacy_disable_interrupts(struct iwl_priv *priv) | |||
149 | IWL_DEBUG_ISR(priv, "Disabled interrupts\n"); | 149 | IWL_DEBUG_ISR(priv, "Disabled interrupts\n"); |
150 | } | 150 | } |
151 | 151 | ||
152 | static inline void iwl_legacy_enable_rfkill_int(struct iwl_priv *priv) | ||
153 | { | ||
154 | IWL_DEBUG_ISR(priv, "Enabling rfkill interrupt\n"); | ||
155 | iwl_write32(priv, CSR_INT_MASK, CSR_INT_BIT_RF_KILL); | ||
156 | } | ||
157 | |||
152 | static inline void iwl_legacy_enable_interrupts(struct iwl_priv *priv) | 158 | static inline void iwl_legacy_enable_interrupts(struct iwl_priv *priv) |
153 | { | 159 | { |
154 | IWL_DEBUG_ISR(priv, "Enabling interrupts\n"); | 160 | IWL_DEBUG_ISR(priv, "Enabling interrupts\n"); |
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c index 038738355ab7..58a2e63bd0bc 100644 --- a/drivers/net/wireless/iwlegacy/iwl4965-base.c +++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c | |||
@@ -1072,6 +1072,9 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv) | |||
1072 | /* only Re-enable if diabled by irq */ | 1072 | /* only Re-enable if diabled by irq */ |
1073 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | 1073 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) |
1074 | iwl_legacy_enable_interrupts(priv); | 1074 | iwl_legacy_enable_interrupts(priv); |
1075 | /* Re-enable RF_KILL if it occurred */ | ||
1076 | else if (handled & CSR_INT_BIT_RF_KILL) | ||
1077 | iwl_legacy_enable_rfkill_int(priv); | ||
1075 | 1078 | ||
1076 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG | 1079 | #ifdef CONFIG_IWLWIFI_LEGACY_DEBUG |
1077 | if (iwl_legacy_get_debug_level(priv) & (IWL_DL_ISR)) { | 1080 | if (iwl_legacy_get_debug_level(priv) & (IWL_DL_ISR)) { |
@@ -2624,9 +2627,10 @@ void iwl4965_mac_stop(struct ieee80211_hw *hw) | |||
2624 | 2627 | ||
2625 | flush_workqueue(priv->workqueue); | 2628 | flush_workqueue(priv->workqueue); |
2626 | 2629 | ||
2627 | /* enable interrupts again in order to receive rfkill changes */ | 2630 | /* User space software may expect getting rfkill changes |
2631 | * even if interface is down */ | ||
2628 | iwl_write32(priv, CSR_INT, 0xFFFFFFFF); | 2632 | iwl_write32(priv, CSR_INT, 0xFFFFFFFF); |
2629 | iwl_legacy_enable_interrupts(priv); | 2633 | iwl_legacy_enable_rfkill_int(priv); |
2630 | 2634 | ||
2631 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2635 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2632 | } | 2636 | } |
@@ -3406,14 +3410,14 @@ iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3406 | * 8. Enable interrupts and read RFKILL state | 3410 | * 8. Enable interrupts and read RFKILL state |
3407 | *********************************************/ | 3411 | *********************************************/ |
3408 | 3412 | ||
3409 | /* enable interrupts if needed: hw bug w/a */ | 3413 | /* enable rfkill interrupt: hw bug w/a */ |
3410 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); | 3414 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); |
3411 | if (pci_cmd & PCI_COMMAND_INTX_DISABLE) { | 3415 | if (pci_cmd & PCI_COMMAND_INTX_DISABLE) { |
3412 | pci_cmd &= ~PCI_COMMAND_INTX_DISABLE; | 3416 | pci_cmd &= ~PCI_COMMAND_INTX_DISABLE; |
3413 | pci_write_config_word(priv->pci_dev, PCI_COMMAND, pci_cmd); | 3417 | pci_write_config_word(priv->pci_dev, PCI_COMMAND, pci_cmd); |
3414 | } | 3418 | } |
3415 | 3419 | ||
3416 | iwl_legacy_enable_interrupts(priv); | 3420 | iwl_legacy_enable_rfkill_int(priv); |
3417 | 3421 | ||
3418 | /* If platform's RF_KILL switch is NOT set to KILL */ | 3422 | /* If platform's RF_KILL switch is NOT set to KILL */ |
3419 | if (iwl_read32(priv, CSR_GP_CNTRL) & | 3423 | if (iwl_read32(priv, CSR_GP_CNTRL) & |