diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2009-02-18 18:54:30 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:46 -0500 |
commit | ed3b932e014eb54e8d9b0d7b9d8861f653185d04 (patch) | |
tree | 714016ccd78b13914e136028cb89f2af47aaa1e9 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 261b9c33987ca80bf6217848c3c113d2a4d313d0 (diff) |
iwl3945: remove duplicate interrupt code
Patch removes duplicate code to enable and disable interrupt.
iwl3945 now uses iwlwifi's functions.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 5c0e0a48e6bf..0de768755f91 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1982,14 +1982,6 @@ static void iwl3945_rx_handle(struct iwl_priv *priv) | |||
1982 | iwl3945_rx_queue_restock(priv); | 1982 | iwl3945_rx_queue_restock(priv); |
1983 | } | 1983 | } |
1984 | 1984 | ||
1985 | static void iwl3945_enable_interrupts(struct iwl_priv *priv) | ||
1986 | { | ||
1987 | IWL_DEBUG_ISR(priv, "Enabling interrupts\n"); | ||
1988 | set_bit(STATUS_INT_ENABLED, &priv->status); | ||
1989 | iwl_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK); | ||
1990 | } | ||
1991 | |||
1992 | |||
1993 | /* call this function to flush any scheduled tasklet */ | 1985 | /* call this function to flush any scheduled tasklet */ |
1994 | static inline void iwl_synchronize_irq(struct iwl_priv *priv) | 1986 | static inline void iwl_synchronize_irq(struct iwl_priv *priv) |
1995 | { | 1987 | { |
@@ -1998,21 +1990,6 @@ static inline void iwl_synchronize_irq(struct iwl_priv *priv) | |||
1998 | tasklet_kill(&priv->irq_tasklet); | 1990 | tasklet_kill(&priv->irq_tasklet); |
1999 | } | 1991 | } |
2000 | 1992 | ||
2001 | |||
2002 | static inline void iwl3945_disable_interrupts(struct iwl_priv *priv) | ||
2003 | { | ||
2004 | clear_bit(STATUS_INT_ENABLED, &priv->status); | ||
2005 | |||
2006 | /* disable interrupts from uCode/NIC to host */ | ||
2007 | iwl_write32(priv, CSR_INT_MASK, 0x00000000); | ||
2008 | |||
2009 | /* acknowledge/clear/reset any interrupts still pending | ||
2010 | * from uCode or flow handler (Rx/Tx DMA) */ | ||
2011 | iwl_write32(priv, CSR_INT, 0xffffffff); | ||
2012 | iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff); | ||
2013 | IWL_DEBUG_ISR(priv, "Disabled interrupts\n"); | ||
2014 | } | ||
2015 | |||
2016 | static const char *desc_lookup(int i) | 1993 | static const char *desc_lookup(int i) |
2017 | { | 1994 | { |
2018 | switch (i) { | 1995 | switch (i) { |
@@ -2254,7 +2231,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
2254 | IWL_ERR(priv, "Microcode HW error detected. Restarting.\n"); | 2231 | IWL_ERR(priv, "Microcode HW error detected. Restarting.\n"); |
2255 | 2232 | ||
2256 | /* Tell the device to stop sending interrupts */ | 2233 | /* Tell the device to stop sending interrupts */ |
2257 | iwl3945_disable_interrupts(priv); | 2234 | iwl_disable_interrupts(priv); |
2258 | 2235 | ||
2259 | iwl_irq_handle_error(priv); | 2236 | iwl_irq_handle_error(priv); |
2260 | 2237 | ||
@@ -2334,7 +2311,7 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
2334 | /* Re-enable all interrupts */ | 2311 | /* Re-enable all interrupts */ |
2335 | /* only Re-enable if disabled by irq */ | 2312 | /* only Re-enable if disabled by irq */ |
2336 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | 2313 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) |
2337 | iwl3945_enable_interrupts(priv); | 2314 | iwl_enable_interrupts(priv); |
2338 | 2315 | ||
2339 | #ifdef CONFIG_IWLWIFI_DEBUG | 2316 | #ifdef CONFIG_IWLWIFI_DEBUG |
2340 | if (priv->debug_level & (IWL_DL_ISR)) { | 2317 | if (priv->debug_level & (IWL_DL_ISR)) { |
@@ -2400,7 +2377,7 @@ unplugged: | |||
2400 | /* re-enable interrupts here since we don't have anything to service. */ | 2377 | /* re-enable interrupts here since we don't have anything to service. */ |
2401 | /* only Re-enable if disabled by irq */ | 2378 | /* only Re-enable if disabled by irq */ |
2402 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | 2379 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) |
2403 | iwl3945_enable_interrupts(priv); | 2380 | iwl_enable_interrupts(priv); |
2404 | spin_unlock(&priv->lock); | 2381 | spin_unlock(&priv->lock); |
2405 | return IRQ_NONE; | 2382 | return IRQ_NONE; |
2406 | } | 2383 | } |
@@ -3174,7 +3151,7 @@ static void __iwl3945_down(struct iwl_priv *priv) | |||
3174 | 3151 | ||
3175 | /* tell the device to stop sending interrupts */ | 3152 | /* tell the device to stop sending interrupts */ |
3176 | spin_lock_irqsave(&priv->lock, flags); | 3153 | spin_lock_irqsave(&priv->lock, flags); |
3177 | iwl3945_disable_interrupts(priv); | 3154 | iwl_disable_interrupts(priv); |
3178 | spin_unlock_irqrestore(&priv->lock, flags); | 3155 | spin_unlock_irqrestore(&priv->lock, flags); |
3179 | iwl_synchronize_irq(priv); | 3156 | iwl_synchronize_irq(priv); |
3180 | 3157 | ||
@@ -3304,7 +3281,7 @@ static int __iwl3945_up(struct iwl_priv *priv) | |||
3304 | 3281 | ||
3305 | /* clear (again), then enable host interrupts */ | 3282 | /* clear (again), then enable host interrupts */ |
3306 | iwl_write32(priv, CSR_INT, 0xFFFFFFFF); | 3283 | iwl_write32(priv, CSR_INT, 0xFFFFFFFF); |
3307 | iwl3945_enable_interrupts(priv); | 3284 | iwl_enable_interrupts(priv); |
3308 | 3285 | ||
3309 | /* really make sure rfkill handshake bits are cleared */ | 3286 | /* really make sure rfkill handshake bits are cleared */ |
3310 | iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); | 3287 | iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); |
@@ -5253,7 +5230,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
5253 | * ********************/ | 5230 | * ********************/ |
5254 | 5231 | ||
5255 | spin_lock_irqsave(&priv->lock, flags); | 5232 | spin_lock_irqsave(&priv->lock, flags); |
5256 | iwl3945_disable_interrupts(priv); | 5233 | iwl_disable_interrupts(priv); |
5257 | spin_unlock_irqrestore(&priv->lock, flags); | 5234 | spin_unlock_irqrestore(&priv->lock, flags); |
5258 | 5235 | ||
5259 | pci_enable_msi(priv->pci_dev); | 5236 | pci_enable_msi(priv->pci_dev); |
@@ -5348,7 +5325,7 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) | |||
5348 | * tasklet for the driver | 5325 | * tasklet for the driver |
5349 | */ | 5326 | */ |
5350 | spin_lock_irqsave(&priv->lock, flags); | 5327 | spin_lock_irqsave(&priv->lock, flags); |
5351 | iwl3945_disable_interrupts(priv); | 5328 | iwl_disable_interrupts(priv); |
5352 | spin_unlock_irqrestore(&priv->lock, flags); | 5329 | spin_unlock_irqrestore(&priv->lock, flags); |
5353 | 5330 | ||
5354 | iwl_synchronize_irq(priv); | 5331 | iwl_synchronize_irq(priv); |