aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla1280.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-07-04 11:48:19 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-08-02 12:43:44 -0400
commit8af50dcd22aa0a5840f18276ff10a6977abc3853 (patch)
treef42b951cce636d189249c8a915a5d10caaf62a40 /drivers/scsi/qla1280.c
parenta6c42741ace2fee235b6902e76f3c86a01d32146 (diff)
[SCSI] qla1280: interupt posting for irq disabling/enabling
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Thiemo Seufer <ths@linux-mips.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla1280.c')
-rw-r--r--drivers/scsi/qla1280.c57
1 files changed, 20 insertions, 37 deletions
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index eb5543ef513b..58ecdc696675 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -1265,6 +1265,22 @@ qla1280_biosparam_old(Disk * disk, kdev_t dev, int geom[])
1265 return qla1280_biosparam(disk->device, NULL, disk->capacity, geom); 1265 return qla1280_biosparam(disk->device, NULL, disk->capacity, geom);
1266} 1266}
1267#endif 1267#endif
1268
1269/* disable risc and host interrupts */
1270static inline void
1271qla1280_disable_intrs(struct scsi_qla_host *ha)
1272{
1273 WRT_REG_WORD(&ha->iobase->ictrl, 0);
1274 RD_REG_WORD(&ha->iobase->ictrl); /* PCI Posted Write flush */
1275}
1276
1277/* enable risc and host interrupts */
1278static inline void
1279qla1280_enable_intrs(struct scsi_qla_host *ha)
1280{
1281 WRT_REG_WORD(&ha->iobase->ictrl, (ISP_EN_INT | ISP_EN_RISC));
1282 RD_REG_WORD(&ha->iobase->ictrl); /* PCI Posted Write flush */
1283}
1268 1284
1269/************************************************************************** 1285/**************************************************************************
1270 * qla1280_intr_handler 1286 * qla1280_intr_handler
@@ -1286,7 +1302,7 @@ qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
1286 ha->isr_count++; 1302 ha->isr_count++;
1287 reg = ha->iobase; 1303 reg = ha->iobase;
1288 1304
1289 WRT_REG_WORD(&reg->ictrl, 0); /* disable our interrupt. */ 1305 qla1280_disable_intrs(ha);
1290 1306
1291 data = qla1280_debounce_register(&reg->istatus); 1307 data = qla1280_debounce_register(&reg->istatus);
1292 /* Check for pending interrupts. */ 1308 /* Check for pending interrupts. */
@@ -1299,8 +1315,7 @@ qla1280_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
1299 1315
1300 spin_unlock(HOST_LOCK); 1316 spin_unlock(HOST_LOCK);
1301 1317
1302 /* enable our interrupt. */ 1318 qla1280_enable_intrs(ha);
1303 WRT_REG_WORD(&reg->ictrl, (ISP_EN_INT | ISP_EN_RISC));
1304 1319
1305 LEAVE_INTR("qla1280_intr_handler"); 1320 LEAVE_INTR("qla1280_intr_handler");
1306 return IRQ_RETVAL(handled); 1321 return IRQ_RETVAL(handled);
@@ -1613,38 +1628,6 @@ qla1280_return_status(struct response * sts, struct scsi_cmnd *cp)
1613/* QLogic ISP1280 Hardware Support Functions. */ 1628/* QLogic ISP1280 Hardware Support Functions. */
1614/****************************************************************************/ 1629/****************************************************************************/
1615 1630
1616 /*
1617 * qla2100_enable_intrs
1618 * qla2100_disable_intrs
1619 *
1620 * Input:
1621 * ha = adapter block pointer.
1622 *
1623 * Returns:
1624 * None
1625 */
1626static inline void
1627qla1280_enable_intrs(struct scsi_qla_host *ha)
1628{
1629 struct device_reg __iomem *reg;
1630
1631 reg = ha->iobase;
1632 /* enable risc and host interrupts */
1633 WRT_REG_WORD(&reg->ictrl, (ISP_EN_INT | ISP_EN_RISC));
1634 RD_REG_WORD(&reg->ictrl); /* PCI Posted Write flush */
1635}
1636
1637static inline void
1638qla1280_disable_intrs(struct scsi_qla_host *ha)
1639{
1640 struct device_reg __iomem *reg;
1641
1642 reg = ha->iobase;
1643 /* disable risc and host interrupts */
1644 WRT_REG_WORD(&reg->ictrl, 0);
1645 RD_REG_WORD(&reg->ictrl); /* PCI Posted Write flush */
1646}
1647
1648/* 1631/*
1649 * qla1280_initialize_adapter 1632 * qla1280_initialize_adapter
1650 * Initialize board. 1633 * Initialize board.
@@ -4751,7 +4734,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
4751 4734
4752#if LINUX_VERSION_CODE >= 0x020600 4735#if LINUX_VERSION_CODE >= 0x020600
4753 error_disable_adapter: 4736 error_disable_adapter:
4754 WRT_REG_WORD(&ha->iobase->ictrl, 0); 4737 qla1280_disable_intrs(ha);
4755#endif 4738#endif
4756 error_free_irq: 4739 error_free_irq:
4757 free_irq(pdev->irq, ha); 4740 free_irq(pdev->irq, ha);
@@ -4788,7 +4771,7 @@ qla1280_remove_one(struct pci_dev *pdev)
4788 scsi_remove_host(host); 4771 scsi_remove_host(host);
4789#endif 4772#endif
4790 4773
4791 WRT_REG_WORD(&ha->iobase->ictrl, 0); 4774 qla1280_disable_intrs(ha);
4792 4775
4793 free_irq(pdev->irq, ha); 4776 free_irq(pdev->irq, ha);
4794 4777