aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx/ql4_os.c
diff options
context:
space:
mode:
authorDavid C Somayajulu <david.somayajulu@qlogic.com>2006-11-15 20:38:40 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 13:14:04 -0500
commitd915058f48745c0d5c4582566e5aa63867264f81 (patch)
treeedd78540aa84440dbbf438968a3be6303f81a33d /drivers/scsi/qla4xxx/ql4_os.c
parent0bd2af46839ad6262d25714a6ec0365db9d6b98f (diff)
[SCSI] qla4xxx: add support for qla4032
This patch provides the following: 1. adds support for the next version of Qlogic's iSCSI HBA, qla4032 (PCI Device ID 4032). 2. removes dead code related to topcat chip and renames qla4010_soft_reset to qla4xxx_soft_reset (minor changes). Signed-off-by: David Somayajulu <david.somayajulu@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c75
1 files changed, 8 insertions, 67 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index bab434ee774b..db9d88e7bee7 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -708,10 +708,10 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha)
708} 708}
709 709
710/** 710/**
711 * qla4010_soft_reset - performs soft reset. 711 * qla4xxx_soft_reset - performs soft reset.
712 * @ha: Pointer to host adapter structure. 712 * @ha: Pointer to host adapter structure.
713 **/ 713 **/
714static int qla4010_soft_reset(struct scsi_qla_host *ha) 714int qla4xxx_soft_reset(struct scsi_qla_host *ha)
715{ 715{
716 uint32_t max_wait_time; 716 uint32_t max_wait_time;
717 unsigned long flags = 0; 717 unsigned long flags = 0;
@@ -817,29 +817,6 @@ static int qla4010_soft_reset(struct scsi_qla_host *ha)
817} 817}
818 818
819/** 819/**
820 * qla4xxx_topcat_reset - performs hard reset of TopCat Chip.
821 * @ha: Pointer to host adapter structure.
822 **/
823static int qla4xxx_topcat_reset(struct scsi_qla_host *ha)
824{
825 unsigned long flags;
826
827 ql4xxx_lock_nvram(ha);
828 spin_lock_irqsave(&ha->hardware_lock, flags);
829 writel(set_rmask(GPOR_TOPCAT_RESET), isp_gp_out(ha));
830 readl(isp_gp_out(ha));
831 mdelay(1);
832
833 writel(clr_rmask(GPOR_TOPCAT_RESET), isp_gp_out(ha));
834 readl(isp_gp_out(ha));
835 spin_unlock_irqrestore(&ha->hardware_lock, flags);
836 mdelay(2523);
837
838 ql4xxx_unlock_nvram(ha);
839 return QLA_SUCCESS;
840}
841
842/**
843 * qla4xxx_flush_active_srbs - returns all outstanding i/o requests to O.S. 820 * qla4xxx_flush_active_srbs - returns all outstanding i/o requests to O.S.
844 * @ha: Pointer to host adapter structure. 821 * @ha: Pointer to host adapter structure.
845 * 822 *
@@ -867,26 +844,6 @@ static void qla4xxx_flush_active_srbs(struct scsi_qla_host *ha)
867} 844}
868 845
869/** 846/**
870 * qla4xxx_hard_reset - performs HBA Hard Reset
871 * @ha: Pointer to host adapter structure.
872 **/
873static int qla4xxx_hard_reset(struct scsi_qla_host *ha)
874{
875 /* The QLA4010 really doesn't have an equivalent to a hard reset */
876 qla4xxx_flush_active_srbs(ha);
877 if (test_bit(AF_TOPCAT_CHIP_PRESENT, &ha->flags)) {
878 int status = QLA_ERROR;
879
880 if ((qla4010_soft_reset(ha) == QLA_SUCCESS) &&
881 (qla4xxx_topcat_reset(ha) == QLA_SUCCESS) &&
882 (qla4010_soft_reset(ha) == QLA_SUCCESS))
883 status = QLA_SUCCESS;
884 return status;
885 } else
886 return qla4010_soft_reset(ha);
887}
888
889/**
890 * qla4xxx_recover_adapter - recovers adapter after a fatal error 847 * qla4xxx_recover_adapter - recovers adapter after a fatal error
891 * @ha: Pointer to host adapter structure. 848 * @ha: Pointer to host adapter structure.
892 * @renew_ddb_list: Indicates what to do with the adapter's ddb list 849 * @renew_ddb_list: Indicates what to do with the adapter's ddb list
@@ -1243,7 +1200,6 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
1243 init_waitqueue_head(&ha->mailbox_wait_queue); 1200 init_waitqueue_head(&ha->mailbox_wait_queue);
1244 1201
1245 spin_lock_init(&ha->hardware_lock); 1202 spin_lock_init(&ha->hardware_lock);
1246 spin_lock_init(&ha->list_lock);
1247 1203
1248 /* Allocate dma buffers */ 1204 /* Allocate dma buffers */
1249 if (qla4xxx_mem_alloc(ha)) { 1205 if (qla4xxx_mem_alloc(ha)) {
@@ -1450,27 +1406,6 @@ struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t in
1450} 1406}
1451 1407
1452/** 1408/**
1453 * qla4xxx_soft_reset - performs a SOFT RESET of hba.
1454 * @ha: Pointer to host adapter structure.
1455 **/
1456int qla4xxx_soft_reset(struct scsi_qla_host *ha)
1457{
1458
1459 DEBUG2(printk(KERN_WARNING "scsi%ld: %s: chip reset!\n", ha->host_no,
1460 __func__));
1461 if (test_bit(AF_TOPCAT_CHIP_PRESENT, &ha->flags)) {
1462 int status = QLA_ERROR;
1463
1464 if ((qla4010_soft_reset(ha) == QLA_SUCCESS) &&
1465 (qla4xxx_topcat_reset(ha) == QLA_SUCCESS) &&
1466 (qla4010_soft_reset(ha) == QLA_SUCCESS) )
1467 status = QLA_SUCCESS;
1468 return status;
1469 } else
1470 return qla4010_soft_reset(ha);
1471}
1472
1473/**
1474 * qla4xxx_eh_wait_on_command - waits for command to be returned by firmware 1409 * qla4xxx_eh_wait_on_command - waits for command to be returned by firmware
1475 * @ha: actual ha whose done queue will contain the comd returned by firmware. 1410 * @ha: actual ha whose done queue will contain the comd returned by firmware.
1476 * @cmd: Scsi Command to wait on. 1411 * @cmd: Scsi Command to wait on.
@@ -1668,6 +1603,12 @@ static struct pci_device_id qla4xxx_pci_tbl[] = {
1668 .subvendor = PCI_ANY_ID, 1603 .subvendor = PCI_ANY_ID,
1669 .subdevice = PCI_ANY_ID, 1604 .subdevice = PCI_ANY_ID,
1670 }, 1605 },
1606 {
1607 .vendor = PCI_VENDOR_ID_QLOGIC,
1608 .device = PCI_DEVICE_ID_QLOGIC_ISP4032,
1609 .subvendor = PCI_ANY_ID,
1610 .subdevice = PCI_ANY_ID,
1611 },
1671 {0, 0}, 1612 {0, 0},
1672}; 1613};
1673MODULE_DEVICE_TABLE(pci, qla4xxx_pci_tbl); 1614MODULE_DEVICE_TABLE(pci, qla4xxx_pci_tbl);