89
/* To prevent overwriting mailbox registers for a command that has
90
* not yet been serviced, check to see if an active command
91
* (AEN, IOCB, etc.) is interrupting, then service it.
92
* -----------------------------------------------------------------
94
89
spin_lock_irqsave(&ha->hardware_lock, flags);
96
if (!is_qla8022(ha)) {
97
intr_status = readl(&ha->reg->ctrl_status);
98
if (intr_status & CSR_SCSI_PROCESSOR_INTR) {
99
/* Service existing interrupt */
100
ha->isp_ops->interrupt_service_routine(ha, intr_status);
101
clear_bit(AF_MBOX_COMMAND_DONE, &ha->flags);
105
91
ha->mbox_status_count = outCount;
106
92
for (i = 0; i < outCount; i++)
107
93
ha->mbox_status[i] = 0;
1060
* qla4xxx_get_fw_version - gets firmware version
1046
* qla4xxx_about_firmware - gets FW, iscsi draft and boot loader version
1061
1047
* @ha: Pointer to host adapter structure.
1063
* Retrieves the firmware version on HBA. In QLA4010, mailboxes 2 & 3 may
1064
* hold an address for data. Make sure that we write 0 to those mailboxes,
1049
* Retrieves the FW version, iSCSI draft version & bootloader version of HBA.
1050
* Mailboxes 2 & 3 may hold an address for data. Make sure that we write 0 to
1051
* those mailboxes, if unused.
1067
int qla4xxx_get_fw_version(struct scsi_qla_host * ha)
1053
int qla4xxx_about_firmware(struct scsi_qla_host *ha)
1055
struct about_fw_info *about_fw = NULL;
1056
dma_addr_t about_fw_dma;
1069
1057
uint32_t mbox_cmd[MBOX_REG_COUNT];
1070
1058
uint32_t mbox_sts[MBOX_REG_COUNT];
1072
/* Get firmware version. */
1059
int status = QLA_ERROR;
1061
about_fw = dma_alloc_coherent(&ha->pdev->dev,
1062
sizeof(struct about_fw_info),
1063
&about_fw_dma, GFP_KERNEL);
1065
DEBUG2(ql4_printk(KERN_ERR, ha, "%s: Unable to alloc memory "
1066
"for about_fw\n", __func__));
1070
memset(about_fw, 0, sizeof(struct about_fw_info));
1073
1071
memset(&mbox_cmd, 0, sizeof(mbox_cmd));
1074
1072
memset(&mbox_sts, 0, sizeof(mbox_sts));
1076
1074
mbox_cmd[0] = MBOX_CMD_ABOUT_FW;
1075
mbox_cmd[2] = LSDW(about_fw_dma);
1076
mbox_cmd[3] = MSDW(about_fw_dma);
1077
mbox_cmd[4] = sizeof(struct about_fw_info);
1078
if (qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 5, &mbox_cmd[0], &mbox_sts[0]) !=
1080
DEBUG2(printk("scsi%ld: %s: MBOX_CMD_ABOUT_FW failed w/ "
1081
"status %04X\n", ha->host_no, __func__, mbox_sts[0]));
1079
status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT,
1080
&mbox_cmd[0], &mbox_sts[0]);
1081
if (status != QLA_SUCCESS) {
1082
DEBUG2(ql4_printk(KERN_WARNING, ha, "%s: MBOX_CMD_ABOUT_FW "
1083
"failed w/ status %04X\n", __func__,
1085
/* Save firmware version information. */
1086
ha->firmware_version[0] = mbox_sts[1];
1087
ha->firmware_version[1] = mbox_sts[2];
1088
ha->patch_number = mbox_sts[3];
1089
ha->build_number = mbox_sts[4];
1088
/* Save version information. */
1089
ha->firmware_version[0] = le16_to_cpu(about_fw->fw_major);
1090
ha->firmware_version[1] = le16_to_cpu(about_fw->fw_minor);
1091
ha->patch_number = le16_to_cpu(about_fw->fw_patch);
1092
ha->build_number = le16_to_cpu(about_fw->fw_build);
1093
ha->iscsi_major = le16_to_cpu(about_fw->iscsi_major);
1094
ha->iscsi_minor = le16_to_cpu(about_fw->iscsi_minor);
1095
ha->bootload_major = le16_to_cpu(about_fw->bootload_major);
1096
ha->bootload_minor = le16_to_cpu(about_fw->bootload_minor);
1097
ha->bootload_patch = le16_to_cpu(about_fw->bootload_patch);
1098
ha->bootload_build = le16_to_cpu(about_fw->bootload_build);
1099
status = QLA_SUCCESS;
1102
dma_free_coherent(&ha->pdev->dev, sizeof(struct about_fw_info),
1103
about_fw, about_fw_dma);
1094
1107
static int qla4xxx_get_default_ddb(struct scsi_qla_host *ha,