diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2009-02-18 18:54:31 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:46 -0500 |
commit | f17d08a657ee0713390ccf9a0b0ebf4f80495161 (patch) | |
tree | e9df76c9c5705826af69c287a4289bc804477ae0 /drivers/net | |
parent | ed3b932e014eb54e8d9b0d7b9d8861f653185d04 (diff) |
iwl3945: use iwl_isr
iwl3945 uses iwl_isr and deletes duplicated iwl3945_isr.
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 58 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 59 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 59 |
4 files changed, 61 insertions, 116 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 8eaaf2a7ceac..bcb94a01f94a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1280,64 +1280,6 @@ static void iwl_irq_tasklet(struct iwl_priv *priv) | |||
1280 | spin_unlock_irqrestore(&priv->lock, flags); | 1280 | spin_unlock_irqrestore(&priv->lock, flags); |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | static irqreturn_t iwl_isr(int irq, void *data) | ||
1284 | { | ||
1285 | struct iwl_priv *priv = data; | ||
1286 | u32 inta, inta_mask; | ||
1287 | u32 inta_fh; | ||
1288 | if (!priv) | ||
1289 | return IRQ_NONE; | ||
1290 | |||
1291 | spin_lock(&priv->lock); | ||
1292 | |||
1293 | /* Disable (but don't clear!) interrupts here to avoid | ||
1294 | * back-to-back ISRs and sporadic interrupts from our NIC. | ||
1295 | * If we have something to service, the tasklet will re-enable ints. | ||
1296 | * If we *don't* have something, we'll re-enable before leaving here. */ | ||
1297 | inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */ | ||
1298 | iwl_write32(priv, CSR_INT_MASK, 0x00000000); | ||
1299 | |||
1300 | /* Discover which interrupts are active/pending */ | ||
1301 | inta = iwl_read32(priv, CSR_INT); | ||
1302 | inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); | ||
1303 | |||
1304 | /* Ignore interrupt if there's nothing in NIC to service. | ||
1305 | * This may be due to IRQ shared with another device, | ||
1306 | * or due to sporadic interrupts thrown from our NIC. */ | ||
1307 | if (!inta && !inta_fh) { | ||
1308 | IWL_DEBUG_ISR(priv, "Ignore interrupt, inta == 0, inta_fh == 0\n"); | ||
1309 | goto none; | ||
1310 | } | ||
1311 | |||
1312 | if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { | ||
1313 | /* Hardware disappeared. It might have already raised | ||
1314 | * an interrupt */ | ||
1315 | IWL_WARN(priv, "HARDWARE GONE?? INTA == 0x%08x\n", inta); | ||
1316 | goto unplugged; | ||
1317 | } | ||
1318 | |||
1319 | IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", | ||
1320 | inta, inta_mask, inta_fh); | ||
1321 | |||
1322 | inta &= ~CSR_INT_BIT_SCD; | ||
1323 | |||
1324 | /* iwl_irq_tasklet() will service interrupts and re-enable them */ | ||
1325 | if (likely(inta || inta_fh)) | ||
1326 | tasklet_schedule(&priv->irq_tasklet); | ||
1327 | |||
1328 | unplugged: | ||
1329 | spin_unlock(&priv->lock); | ||
1330 | return IRQ_HANDLED; | ||
1331 | |||
1332 | none: | ||
1333 | /* re-enable interrupts here since we don't have anything to service. */ | ||
1334 | /* only Re-enable if diabled by irq */ | ||
1335 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | ||
1336 | iwl_enable_interrupts(priv); | ||
1337 | spin_unlock(&priv->lock); | ||
1338 | return IRQ_NONE; | ||
1339 | } | ||
1340 | |||
1341 | /****************************************************************************** | 1283 | /****************************************************************************** |
1342 | * | 1284 | * |
1343 | * uCode download functions | 1285 | * uCode download functions |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 61b9902ee327..37069d4c6c9b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1444,6 +1444,65 @@ void iwl_enable_interrupts(struct iwl_priv *priv) | |||
1444 | } | 1444 | } |
1445 | EXPORT_SYMBOL(iwl_enable_interrupts); | 1445 | EXPORT_SYMBOL(iwl_enable_interrupts); |
1446 | 1446 | ||
1447 | irqreturn_t iwl_isr(int irq, void *data) | ||
1448 | { | ||
1449 | struct iwl_priv *priv = data; | ||
1450 | u32 inta, inta_mask; | ||
1451 | u32 inta_fh; | ||
1452 | if (!priv) | ||
1453 | return IRQ_NONE; | ||
1454 | |||
1455 | spin_lock(&priv->lock); | ||
1456 | |||
1457 | /* Disable (but don't clear!) interrupts here to avoid | ||
1458 | * back-to-back ISRs and sporadic interrupts from our NIC. | ||
1459 | * If we have something to service, the tasklet will re-enable ints. | ||
1460 | * If we *don't* have something, we'll re-enable before leaving here. */ | ||
1461 | inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */ | ||
1462 | iwl_write32(priv, CSR_INT_MASK, 0x00000000); | ||
1463 | |||
1464 | /* Discover which interrupts are active/pending */ | ||
1465 | inta = iwl_read32(priv, CSR_INT); | ||
1466 | inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); | ||
1467 | |||
1468 | /* Ignore interrupt if there's nothing in NIC to service. | ||
1469 | * This may be due to IRQ shared with another device, | ||
1470 | * or due to sporadic interrupts thrown from our NIC. */ | ||
1471 | if (!inta && !inta_fh) { | ||
1472 | IWL_DEBUG_ISR(priv, "Ignore interrupt, inta == 0, inta_fh == 0\n"); | ||
1473 | goto none; | ||
1474 | } | ||
1475 | |||
1476 | if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { | ||
1477 | /* Hardware disappeared. It might have already raised | ||
1478 | * an interrupt */ | ||
1479 | IWL_WARN(priv, "HARDWARE GONE?? INTA == 0x%08x\n", inta); | ||
1480 | goto unplugged; | ||
1481 | } | ||
1482 | |||
1483 | IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", | ||
1484 | inta, inta_mask, inta_fh); | ||
1485 | |||
1486 | inta &= ~CSR_INT_BIT_SCD; | ||
1487 | |||
1488 | /* iwl_irq_tasklet() will service interrupts and re-enable them */ | ||
1489 | if (likely(inta || inta_fh)) | ||
1490 | tasklet_schedule(&priv->irq_tasklet); | ||
1491 | |||
1492 | unplugged: | ||
1493 | spin_unlock(&priv->lock); | ||
1494 | return IRQ_HANDLED; | ||
1495 | |||
1496 | none: | ||
1497 | /* re-enable interrupts here since we don't have anything to service. */ | ||
1498 | /* only Re-enable if diabled by irq */ | ||
1499 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | ||
1500 | iwl_enable_interrupts(priv); | ||
1501 | spin_unlock(&priv->lock); | ||
1502 | return IRQ_NONE; | ||
1503 | } | ||
1504 | EXPORT_SYMBOL(iwl_isr); | ||
1505 | |||
1447 | int iwl_send_bt_config(struct iwl_priv *priv) | 1506 | int iwl_send_bt_config(struct iwl_priv *priv) |
1448 | { | 1507 | { |
1449 | struct iwl_bt_cmd bt_cmd = { | 1508 | 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 f2f75d1a7dc1..7427d75b8c8c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -421,6 +421,7 @@ int iwl_send_card_state(struct iwl_priv *priv, u32 flags, | |||
421 | *****************************************************/ | 421 | *****************************************************/ |
422 | void iwl_disable_interrupts(struct iwl_priv *priv); | 422 | void iwl_disable_interrupts(struct iwl_priv *priv); |
423 | void iwl_enable_interrupts(struct iwl_priv *priv); | 423 | void iwl_enable_interrupts(struct iwl_priv *priv); |
424 | irqreturn_t iwl_isr(int irq, void *data); | ||
424 | static inline u16 iwl_pcie_link_ctl(struct iwl_priv *priv) | 425 | static inline u16 iwl_pcie_link_ctl(struct iwl_priv *priv) |
425 | { | 426 | { |
426 | int pos; | 427 | int pos; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 0de768755f91..68cd2e7b6a7c 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2325,63 +2325,6 @@ static void iwl3945_irq_tasklet(struct iwl_priv *priv) | |||
2325 | spin_unlock_irqrestore(&priv->lock, flags); | 2325 | spin_unlock_irqrestore(&priv->lock, flags); |
2326 | } | 2326 | } |
2327 | 2327 | ||
2328 | static irqreturn_t iwl3945_isr(int irq, void *data) | ||
2329 | { | ||
2330 | struct iwl_priv *priv = data; | ||
2331 | u32 inta, inta_mask; | ||
2332 | u32 inta_fh; | ||
2333 | if (!priv) | ||
2334 | return IRQ_NONE; | ||
2335 | |||
2336 | spin_lock(&priv->lock); | ||
2337 | |||
2338 | /* Disable (but don't clear!) interrupts here to avoid | ||
2339 | * back-to-back ISRs and sporadic interrupts from our NIC. | ||
2340 | * If we have something to service, the tasklet will re-enable ints. | ||
2341 | * If we *don't* have something, we'll re-enable before leaving here. */ | ||
2342 | inta_mask = iwl_read32(priv, CSR_INT_MASK); /* just for debug */ | ||
2343 | iwl_write32(priv, CSR_INT_MASK, 0x00000000); | ||
2344 | |||
2345 | /* Discover which interrupts are active/pending */ | ||
2346 | inta = iwl_read32(priv, CSR_INT); | ||
2347 | inta_fh = iwl_read32(priv, CSR_FH_INT_STATUS); | ||
2348 | |||
2349 | /* Ignore interrupt if there's nothing in NIC to service. | ||
2350 | * This may be due to IRQ shared with another device, | ||
2351 | * or due to sporadic interrupts thrown from our NIC. */ | ||
2352 | if (!inta && !inta_fh) { | ||
2353 | IWL_DEBUG_ISR(priv, "Ignore interrupt, inta == 0, inta_fh == 0\n"); | ||
2354 | goto none; | ||
2355 | } | ||
2356 | |||
2357 | if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { | ||
2358 | /* Hardware disappeared */ | ||
2359 | IWL_WARN(priv, "HARDWARE GONE?? INTA == 0x%08x\n", inta); | ||
2360 | goto unplugged; | ||
2361 | } | ||
2362 | |||
2363 | IWL_DEBUG_ISR(priv, "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", | ||
2364 | inta, inta_mask, inta_fh); | ||
2365 | |||
2366 | inta &= ~CSR_INT_BIT_SCD; | ||
2367 | |||
2368 | /* iwl3945_irq_tasklet() will service interrupts and re-enable them */ | ||
2369 | if (likely(inta || inta_fh)) | ||
2370 | tasklet_schedule(&priv->irq_tasklet); | ||
2371 | unplugged: | ||
2372 | spin_unlock(&priv->lock); | ||
2373 | |||
2374 | return IRQ_HANDLED; | ||
2375 | |||
2376 | none: | ||
2377 | /* re-enable interrupts here since we don't have anything to service. */ | ||
2378 | /* only Re-enable if disabled by irq */ | ||
2379 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | ||
2380 | iwl_enable_interrupts(priv); | ||
2381 | spin_unlock(&priv->lock); | ||
2382 | return IRQ_NONE; | ||
2383 | } | ||
2384 | |||
2385 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, | 2328 | static int iwl3945_get_channels_for_scan(struct iwl_priv *priv, |
2386 | enum ieee80211_band band, | 2329 | enum ieee80211_band band, |
2387 | u8 is_active, u8 n_probes, | 2330 | u8 is_active, u8 n_probes, |
@@ -5235,7 +5178,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
5235 | 5178 | ||
5236 | pci_enable_msi(priv->pci_dev); | 5179 | pci_enable_msi(priv->pci_dev); |
5237 | 5180 | ||
5238 | err = request_irq(priv->pci_dev->irq, iwl3945_isr, IRQF_SHARED, | 5181 | err = request_irq(priv->pci_dev->irq, iwl_isr, IRQF_SHARED, |
5239 | DRV_NAME, priv); | 5182 | DRV_NAME, priv); |
5240 | if (err) { | 5183 | if (err) { |
5241 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); | 5184 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); |