diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-11-10 12:56:39 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-15 13:26:44 -0500 |
commit | 81baf6ec9c190ae128748cf2a026bff5cb811b70 (patch) | |
tree | c6c0d24d1c610f770e1fc6fbddc2dd9e8bb99911 /drivers/net | |
parent | ae79d23d0b2c16998e60f49a16dae53521c76a45 (diff) |
iwlwifi: Legacy isr only used by legacy devices
Move iwl_isr_legacy function to iwl_legacy.c since it only used
by legacy devices.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 60 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-legacy.c | 62 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-legacy.h | 2 |
5 files changed, 65 insertions, 61 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index d9e676480269..a97c09992a73 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include "iwl-led.h" | 51 | #include "iwl-led.h" |
52 | #include "iwl-3945-led.h" | 52 | #include "iwl-3945-led.h" |
53 | #include "iwl-3945-debugfs.h" | 53 | #include "iwl-3945-debugfs.h" |
54 | #include "iwl-legacy.h" | ||
54 | 55 | ||
55 | #define IWL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \ | 56 | #define IWL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \ |
56 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ | 57 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 180d09ec3136..f8d801cc24fc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1227,66 +1227,6 @@ int iwl_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force) | |||
1227 | } | 1227 | } |
1228 | EXPORT_SYMBOL(iwl_set_tx_power); | 1228 | EXPORT_SYMBOL(iwl_set_tx_power); |
1229 | 1229 | ||
1230 | irqreturn_t iwl_isr_legacy(int irq, void *data) | ||
1231 | { | ||
1232 | struct iwl_priv *priv = data; | ||
1233 | u32 inta, inta_mask; | ||
1234 | u32 inta_fh; | ||
1235 | unsigned long flags; | ||
1236 | if (!priv) | ||
1237 | return IRQ_NONE; | ||
1238 | |||
1239 | spin_lock_irqsave(&priv->lock, flags); | ||
1240 | |||
1241 | /* Disable (but don't clear!) interrupts here to avoid | ||
1242 | * back-to-back ISRs and sporadic interrupts from our NIC. | ||
1243 | * If we have something to service, the tasklet will re-enable ints. | ||
1244 | * If we *don't* have something, we'll re-enable before leaving here. */ | ||
1245 | inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */ | ||
1246 | iwl_write32(priv, CSR_INT_MASK, 0x00000000); | ||
1247 | |||
1248 | /* Discover which interrupts are active/pending */ | ||
1249 | inta = iwl_read32(priv, CSR_INT); | ||
1250 | inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); | ||
1251 | |||
1252 | /* Ignore interrupt if there's nothing in NIC to service. | ||
1253 | * This may be due to IRQ shared with another device, | ||
1254 | * or due to sporadic interrupts thrown from our NIC. */ | ||
1255 | if (!inta && !inta_fh) { | ||
1256 | IWL_DEBUG_ISR(priv, "Ignore interrupt, inta == 0, inta_fh == 0\n"); | ||
1257 | goto none; | ||
1258 | } | ||
1259 | |||
1260 | if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { | ||
1261 | /* Hardware disappeared. It might have already raised | ||
1262 | * an interrupt */ | ||
1263 | IWL_WARN(priv, "HARDWARE GONE?? INTA == 0x%08x\n", inta); | ||
1264 | goto unplugged; | ||
1265 | } | ||
1266 | |||
1267 | IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", | ||
1268 | inta, inta_mask, inta_fh); | ||
1269 | |||
1270 | inta &= ~CSR_INT_BIT_SCD; | ||
1271 | |||
1272 | /* iwl_irq_tasklet() will service interrupts and re-enable them */ | ||
1273 | if (likely(inta || inta_fh)) | ||
1274 | tasklet_schedule(&priv->irq_tasklet); | ||
1275 | |||
1276 | unplugged: | ||
1277 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1278 | return IRQ_HANDLED; | ||
1279 | |||
1280 | none: | ||
1281 | /* re-enable interrupts here since we don't have anything to service. */ | ||
1282 | /* only Re-enable if diabled by irq */ | ||
1283 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | ||
1284 | iwl_enable_interrupts(priv); | ||
1285 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1286 | return IRQ_NONE; | ||
1287 | } | ||
1288 | EXPORT_SYMBOL(iwl_isr_legacy); | ||
1289 | |||
1290 | void iwl_send_bt_config(struct iwl_priv *priv) | 1230 | void iwl_send_bt_config(struct iwl_priv *priv) |
1291 | { | 1231 | { |
1292 | struct iwl_bt_cmd bt_cmd = { | 1232 | struct iwl_bt_cmd bt_cmd = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 8fb063affac4..7505c16db2a2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -596,7 +596,6 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd); | |||
596 | /***************************************************** | 596 | /***************************************************** |
597 | * PCI * | 597 | * PCI * |
598 | *****************************************************/ | 598 | *****************************************************/ |
599 | irqreturn_t iwl_isr_legacy(int irq, void *data); | ||
600 | 599 | ||
601 | static inline u16 iwl_pcie_link_ctl(struct iwl_priv *priv) | 600 | static inline u16 iwl_pcie_link_ctl(struct iwl_priv *priv) |
602 | { | 601 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-legacy.c b/drivers/net/wireless/iwlwifi/iwl-legacy.c index b735fef9ee4b..f49e500cba67 100644 --- a/drivers/net/wireless/iwlwifi/iwl-legacy.c +++ b/drivers/net/wireless/iwlwifi/iwl-legacy.c | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include "iwl-dev.h" | 32 | #include "iwl-dev.h" |
33 | #include "iwl-core.h" | 33 | #include "iwl-core.h" |
34 | #include "iwl-helpers.h" | ||
34 | #include "iwl-legacy.h" | 35 | #include "iwl-legacy.h" |
35 | 36 | ||
36 | /** | 37 | /** |
@@ -558,3 +559,64 @@ void iwl_legacy_mac_bss_info_changed(struct ieee80211_hw *hw, | |||
558 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 559 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
559 | } | 560 | } |
560 | EXPORT_SYMBOL(iwl_legacy_mac_bss_info_changed); | 561 | EXPORT_SYMBOL(iwl_legacy_mac_bss_info_changed); |
562 | |||
563 | irqreturn_t iwl_isr_legacy(int irq, void *data) | ||
564 | { | ||
565 | struct iwl_priv *priv = data; | ||
566 | u32 inta, inta_mask; | ||
567 | u32 inta_fh; | ||
568 | unsigned long flags; | ||
569 | if (!priv) | ||
570 | return IRQ_NONE; | ||
571 | |||
572 | spin_lock_irqsave(&priv->lock, flags); | ||
573 | |||
574 | /* Disable (but don't clear!) interrupts here to avoid | ||
575 | * back-to-back ISRs and sporadic interrupts from our NIC. | ||
576 | * If we have something to service, the tasklet will re-enable ints. | ||
577 | * If we *don't* have something, we'll re-enable before leaving here. */ | ||
578 | inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */ | ||
579 | iwl_write32(priv, CSR_INT_MASK, 0x00000000); | ||
580 | |||
581 | /* Discover which interrupts are active/pending */ | ||
582 | inta = iwl_read32(priv, CSR_INT); | ||
583 | inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); | ||
584 | |||
585 | /* Ignore interrupt if there's nothing in NIC to service. | ||
586 | * This may be due to IRQ shared with another device, | ||
587 | * or due to sporadic interrupts thrown from our NIC. */ | ||
588 | if (!inta && !inta_fh) { | ||
589 | IWL_DEBUG_ISR(priv, | ||
590 | "Ignore interrupt, inta == 0, inta_fh == 0\n"); | ||
591 | goto none; | ||
592 | } | ||
593 | |||
594 | if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { | ||
595 | /* Hardware disappeared. It might have already raised | ||
596 | * an interrupt */ | ||
597 | IWL_WARN(priv, "HARDWARE GONE?? INTA == 0x%08x\n", inta); | ||
598 | goto unplugged; | ||
599 | } | ||
600 | |||
601 | IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", | ||
602 | inta, inta_mask, inta_fh); | ||
603 | |||
604 | inta &= ~CSR_INT_BIT_SCD; | ||
605 | |||
606 | /* iwl_irq_tasklet() will service interrupts and re-enable them */ | ||
607 | if (likely(inta || inta_fh)) | ||
608 | tasklet_schedule(&priv->irq_tasklet); | ||
609 | |||
610 | unplugged: | ||
611 | spin_unlock_irqrestore(&priv->lock, flags); | ||
612 | return IRQ_HANDLED; | ||
613 | |||
614 | none: | ||
615 | /* re-enable interrupts here since we don't have anything to service. */ | ||
616 | /* only Re-enable if diabled by irq */ | ||
617 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | ||
618 | iwl_enable_interrupts(priv); | ||
619 | spin_unlock_irqrestore(&priv->lock, flags); | ||
620 | return IRQ_NONE; | ||
621 | } | ||
622 | EXPORT_SYMBOL(iwl_isr_legacy); | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-legacy.h b/drivers/net/wireless/iwlwifi/iwl-legacy.h index 2a746cbc30fe..81d1ccdb0746 100644 --- a/drivers/net/wireless/iwlwifi/iwl-legacy.h +++ b/drivers/net/wireless/iwlwifi/iwl-legacy.h | |||
@@ -71,4 +71,6 @@ void iwl_legacy_mac_bss_info_changed(struct ieee80211_hw *hw, | |||
71 | struct ieee80211_bss_conf *bss_conf, | 71 | struct ieee80211_bss_conf *bss_conf, |
72 | u32 changes); | 72 | u32 changes); |
73 | 73 | ||
74 | irqreturn_t iwl_isr_legacy(int irq, void *data); | ||
75 | |||
74 | #endif /* __iwl_legacy_h__ */ | 76 | #endif /* __iwl_legacy_h__ */ |