diff options
author | David C Somayajulu <david.somayajulu@qlogic.com> | 2006-11-15 20:38:40 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:14:04 -0500 |
commit | d915058f48745c0d5c4582566e5aa63867264f81 (patch) | |
tree | edd78540aa84440dbbf438968a3be6303f81a33d /drivers/scsi/qla4xxx/ql4_init.c | |
parent | 0bd2af46839ad6262d25714a6ec0365db9d6b98f (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_init.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_init.c | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index 9e81b810dc88..cc210f297a78 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c | |||
@@ -259,10 +259,16 @@ static int qla4xxx_fw_ready(struct scsi_qla_host *ha) | |||
259 | "seconds expired= %d\n", ha->host_no, __func__, | 259 | "seconds expired= %d\n", ha->host_no, __func__, |
260 | ha->firmware_state, ha->addl_fw_state, | 260 | ha->firmware_state, ha->addl_fw_state, |
261 | timeout_count)); | 261 | timeout_count)); |
262 | if (is_qla4032(ha) && | ||
263 | !(ha->addl_fw_state & FW_ADDSTATE_LINK_UP) && | ||
264 | (timeout_count < ADAPTER_INIT_TOV - 5)) { | ||
265 | break; | ||
266 | } | ||
267 | |||
262 | msleep(1000); | 268 | msleep(1000); |
263 | } /* end of for */ | 269 | } /* end of for */ |
264 | 270 | ||
265 | if (timeout_count <= 0) | 271 | if (timeout_count == 0) |
266 | DEBUG2(printk("scsi%ld: %s: FW Initialization timed out!\n", | 272 | DEBUG2(printk("scsi%ld: %s: FW Initialization timed out!\n", |
267 | ha->host_no, __func__)); | 273 | ha->host_no, __func__)); |
268 | 274 | ||
@@ -806,32 +812,6 @@ int qla4xxx_relogin_device(struct scsi_qla_host *ha, | |||
806 | return QLA_SUCCESS; | 812 | return QLA_SUCCESS; |
807 | } | 813 | } |
808 | 814 | ||
809 | /** | ||
810 | * qla4010_get_topcat_presence - check if it is QLA4040 TopCat Chip | ||
811 | * @ha: Pointer to host adapter structure. | ||
812 | * | ||
813 | **/ | ||
814 | static int qla4010_get_topcat_presence(struct scsi_qla_host *ha) | ||
815 | { | ||
816 | unsigned long flags; | ||
817 | uint16_t topcat; | ||
818 | |||
819 | if (ql4xxx_lock_nvram(ha) != QLA_SUCCESS) | ||
820 | return QLA_ERROR; | ||
821 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
822 | topcat = rd_nvram_word(ha, offsetof(struct eeprom_data, | ||
823 | isp4010.topcat)); | ||
824 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
825 | |||
826 | if ((topcat & TOPCAT_MASK) == TOPCAT_PRESENT) | ||
827 | set_bit(AF_TOPCAT_CHIP_PRESENT, &ha->flags); | ||
828 | else | ||
829 | clear_bit(AF_TOPCAT_CHIP_PRESENT, &ha->flags); | ||
830 | ql4xxx_unlock_nvram(ha); | ||
831 | return QLA_SUCCESS; | ||
832 | } | ||
833 | |||
834 | |||
835 | static int qla4xxx_config_nvram(struct scsi_qla_host *ha) | 815 | static int qla4xxx_config_nvram(struct scsi_qla_host *ha) |
836 | { | 816 | { |
837 | unsigned long flags; | 817 | unsigned long flags; |
@@ -866,7 +846,7 @@ static int qla4xxx_config_nvram(struct scsi_qla_host *ha) | |||
866 | /* set defaults */ | 846 | /* set defaults */ |
867 | if (is_qla4010(ha)) | 847 | if (is_qla4010(ha)) |
868 | extHwConfig.Asuint32_t = 0x1912; | 848 | extHwConfig.Asuint32_t = 0x1912; |
869 | else if (is_qla4022(ha)) | 849 | else if (is_qla4022(ha) | is_qla4032(ha)) |
870 | extHwConfig.Asuint32_t = 0x0023; | 850 | extHwConfig.Asuint32_t = 0x0023; |
871 | } | 851 | } |
872 | DEBUG(printk("scsi%ld: %s: Setting extHwConfig to 0xFFFF%04x\n", | 852 | DEBUG(printk("scsi%ld: %s: Setting extHwConfig to 0xFFFF%04x\n", |
@@ -927,7 +907,7 @@ static int qla4xxx_start_firmware_from_flash(struct scsi_qla_host *ha) | |||
927 | 907 | ||
928 | spin_lock_irqsave(&ha->hardware_lock, flags); | 908 | spin_lock_irqsave(&ha->hardware_lock, flags); |
929 | writel(jiffies, &ha->reg->mailbox[7]); | 909 | writel(jiffies, &ha->reg->mailbox[7]); |
930 | if (is_qla4022(ha)) | 910 | if (is_qla4022(ha) | is_qla4032(ha)) |
931 | writel(set_rmask(NVR_WRITE_ENABLE), | 911 | writel(set_rmask(NVR_WRITE_ENABLE), |
932 | &ha->reg->u1.isp4022.nvram); | 912 | &ha->reg->u1.isp4022.nvram); |
933 | 913 | ||
@@ -1018,12 +998,7 @@ static int qla4xxx_start_firmware(struct scsi_qla_host *ha) | |||
1018 | int soft_reset = 1; | 998 | int soft_reset = 1; |
1019 | int config_chip = 0; | 999 | int config_chip = 0; |
1020 | 1000 | ||
1021 | if (is_qla4010(ha)){ | 1001 | if (is_qla4022(ha) | is_qla4032(ha)) |
1022 | if (qla4010_get_topcat_presence(ha) != QLA_SUCCESS) | ||
1023 | return QLA_ERROR; | ||
1024 | } | ||
1025 | |||
1026 | if (is_qla4022(ha)) | ||
1027 | ql4xxx_set_mac_number(ha); | 1002 | ql4xxx_set_mac_number(ha); |
1028 | 1003 | ||
1029 | if (ql4xxx_lock_drvr_wait(ha) != QLA_SUCCESS) | 1004 | if (ql4xxx_lock_drvr_wait(ha) != QLA_SUCCESS) |