diff options
author | Madhuranath Iyengar <madhuranath.iyengar@qlogic.com> | 2010-07-23 06:28:26 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:06:09 -0400 |
commit | 0f2d962f4d120e93b4d74d13c2e8038e9e4358b9 (patch) | |
tree | ee2a02f7ba2412b50f9fc6eb4779a4e2eeacce0e /drivers | |
parent | e8c72ba51a159f5d1cb195d3fb47262c782939d9 (diff) |
[SCSI] qla2xxx: Check for golden firmware and show version if available
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 18 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 22 |
3 files changed, 42 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index fd6f7b100547..7ebf365043cf 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1187,6 +1187,21 @@ qla2x00_optrom_fw_version_show(struct device *dev, | |||
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | static ssize_t | 1189 | static ssize_t |
1190 | qla2x00_optrom_gold_fw_version_show(struct device *dev, | ||
1191 | struct device_attribute *attr, char *buf) | ||
1192 | { | ||
1193 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
1194 | struct qla_hw_data *ha = vha->hw; | ||
1195 | |||
1196 | if (!IS_QLA81XX(ha)) | ||
1197 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
1198 | |||
1199 | return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%d)\n", | ||
1200 | ha->gold_fw_version[0], ha->gold_fw_version[1], | ||
1201 | ha->gold_fw_version[2], ha->gold_fw_version[3]); | ||
1202 | } | ||
1203 | |||
1204 | static ssize_t | ||
1190 | qla2x00_total_isp_aborts_show(struct device *dev, | 1205 | qla2x00_total_isp_aborts_show(struct device *dev, |
1191 | struct device_attribute *attr, char *buf) | 1206 | struct device_attribute *attr, char *buf) |
1192 | { | 1207 | { |
@@ -1336,6 +1351,8 @@ static DEVICE_ATTR(optrom_fcode_version, S_IRUGO, | |||
1336 | qla2x00_optrom_fcode_version_show, NULL); | 1351 | qla2x00_optrom_fcode_version_show, NULL); |
1337 | static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show, | 1352 | static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show, |
1338 | NULL); | 1353 | NULL); |
1354 | static DEVICE_ATTR(optrom_gold_fw_version, S_IRUGO, | ||
1355 | qla2x00_optrom_gold_fw_version_show, NULL); | ||
1339 | static DEVICE_ATTR(84xx_fw_version, S_IRUGO, qla24xx_84xx_fw_version_show, | 1356 | static DEVICE_ATTR(84xx_fw_version, S_IRUGO, qla24xx_84xx_fw_version_show, |
1340 | NULL); | 1357 | NULL); |
1341 | static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, | 1358 | static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, |
@@ -1376,6 +1393,7 @@ struct device_attribute *qla2x00_host_attrs[] = { | |||
1376 | &dev_attr_vn_port_mac_address, | 1393 | &dev_attr_vn_port_mac_address, |
1377 | &dev_attr_fabric_param, | 1394 | &dev_attr_fabric_param, |
1378 | &dev_attr_fw_state, | 1395 | &dev_attr_fw_state, |
1396 | &dev_attr_optrom_gold_fw_version, | ||
1379 | NULL, | 1397 | NULL, |
1380 | }; | 1398 | }; |
1381 | 1399 | ||
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 02c7480c99c3..7e11ccf0fe81 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2714,6 +2714,8 @@ struct qla_hw_data { | |||
2714 | uint8_t fcode_revision[16]; | 2714 | uint8_t fcode_revision[16]; |
2715 | uint32_t fw_revision[4]; | 2715 | uint32_t fw_revision[4]; |
2716 | 2716 | ||
2717 | uint32_t gold_fw_version[4]; | ||
2718 | |||
2717 | /* Offsets for flash/nvram access (set to ~0 if not used). */ | 2719 | /* Offsets for flash/nvram access (set to ~0 if not used). */ |
2718 | uint32_t flash_conf_off; | 2720 | uint32_t flash_conf_off; |
2719 | uint32_t flash_data_off; | 2721 | uint32_t flash_data_off; |
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 3c5115f60739..df288dc829e0 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -2759,6 +2759,28 @@ qla24xx_get_flash_version(scsi_qla_host_t *vha, void *mbuf) | |||
2759 | ha->fw_revision[3] = dcode[3]; | 2759 | ha->fw_revision[3] = dcode[3]; |
2760 | } | 2760 | } |
2761 | 2761 | ||
2762 | /* Check for golden firmware and get version if available */ | ||
2763 | if (!IS_QLA81XX(ha)) { | ||
2764 | /* Golden firmware is not present in non 81XX adapters */ | ||
2765 | return ret; | ||
2766 | } | ||
2767 | |||
2768 | memset(ha->gold_fw_version, 0, sizeof(ha->gold_fw_version)); | ||
2769 | dcode = mbuf; | ||
2770 | ha->isp_ops->read_optrom(vha, (uint8_t *)dcode, | ||
2771 | ha->flt_region_gold_fw << 2, 32); | ||
2772 | |||
2773 | if (dcode[4] == 0xFFFFFFFF && dcode[5] == 0xFFFFFFFF && | ||
2774 | dcode[6] == 0xFFFFFFFF && dcode[7] == 0xFFFFFFFF) { | ||
2775 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
2776 | "%s(%ld): Unrecognized golden fw at 0x%x.\n", | ||
2777 | __func__, vha->host_no, ha->flt_region_gold_fw * 4)); | ||
2778 | return ret; | ||
2779 | } | ||
2780 | |||
2781 | for (i = 4; i < 8; i++) | ||
2782 | ha->gold_fw_version[i-4] = be32_to_cpu(dcode[i]); | ||
2783 | |||
2762 | return ret; | 2784 | return ret; |
2763 | } | 2785 | } |
2764 | 2786 | ||