diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2009-03-24 12:08:03 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-03 10:22:47 -0400 |
commit | 55a961581fd34632bf724dd144c0dbf740c9fede (patch) | |
tree | 2661c22da7c24213cbc73ede440f89964a5c9a00 /drivers/scsi/qla2xxx | |
parent | be67e6530b006b10380a5f0c49cdf974426a22e9 (diff) |
[SCSI] qla2xxx: Update MPI/PHY version retrieval codes.
Reflects layout and format of latest specification.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 20 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 14 |
5 files changed, 32 insertions, 12 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 664d610d333f..41ce1c6e56b3 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -818,9 +818,23 @@ qla2x00_mpi_version_show(struct device *dev, struct device_attribute *attr, | |||
818 | if (!IS_QLA81XX(ha)) | 818 | if (!IS_QLA81XX(ha)) |
819 | return snprintf(buf, PAGE_SIZE, "\n"); | 819 | return snprintf(buf, PAGE_SIZE, "\n"); |
820 | 820 | ||
821 | return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x.%02x (%x)\n", | 821 | return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n", |
822 | ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], | 822 | ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], |
823 | ha->mpi_version[3], ha->mpi_capabilities); | 823 | ha->mpi_capabilities); |
824 | } | ||
825 | |||
826 | static ssize_t | ||
827 | qla2x00_phy_version_show(struct device *dev, struct device_attribute *attr, | ||
828 | char *buf) | ||
829 | { | ||
830 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
831 | struct qla_hw_data *ha = vha->hw; | ||
832 | |||
833 | if (!IS_QLA81XX(ha)) | ||
834 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
835 | |||
836 | return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d\n", | ||
837 | ha->phy_version[0], ha->phy_version[1], ha->phy_version[2]); | ||
824 | } | 838 | } |
825 | 839 | ||
826 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); | 840 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); |
@@ -848,6 +862,7 @@ static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show, | |||
848 | static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, | 862 | static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, |
849 | NULL); | 863 | NULL); |
850 | static DEVICE_ATTR(mpi_version, S_IRUGO, qla2x00_mpi_version_show, NULL); | 864 | static DEVICE_ATTR(mpi_version, S_IRUGO, qla2x00_mpi_version_show, NULL); |
865 | static DEVICE_ATTR(phy_version, S_IRUGO, qla2x00_phy_version_show, NULL); | ||
851 | 866 | ||
852 | struct device_attribute *qla2x00_host_attrs[] = { | 867 | struct device_attribute *qla2x00_host_attrs[] = { |
853 | &dev_attr_driver_version, | 868 | &dev_attr_driver_version, |
@@ -868,6 +883,7 @@ struct device_attribute *qla2x00_host_attrs[] = { | |||
868 | &dev_attr_optrom_fw_version, | 883 | &dev_attr_optrom_fw_version, |
869 | &dev_attr_total_isp_aborts, | 884 | &dev_attr_total_isp_aborts, |
870 | &dev_attr_mpi_version, | 885 | &dev_attr_mpi_version, |
886 | &dev_attr_phy_version, | ||
871 | NULL, | 887 | NULL, |
872 | }; | 888 | }; |
873 | 889 | ||
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 5e7389d4010a..261c869dda22 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2481,8 +2481,9 @@ struct qla_hw_data { | |||
2481 | uint8_t fw_seriallink_options[4]; | 2481 | uint8_t fw_seriallink_options[4]; |
2482 | uint16_t fw_seriallink_options24[4]; | 2482 | uint16_t fw_seriallink_options24[4]; |
2483 | 2483 | ||
2484 | uint8_t mpi_version[4]; | 2484 | uint8_t mpi_version[3]; |
2485 | uint32_t mpi_capabilities; | 2485 | uint32_t mpi_capabilities; |
2486 | uint8_t phy_version[3]; | ||
2486 | 2487 | ||
2487 | /* Firmware dump information. */ | 2488 | /* Firmware dump information. */ |
2488 | struct qla2xxx_fw_dump *fw_dump; | 2489 | struct qla2xxx_fw_dump *fw_dump; |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 85b689c937b3..af36238859d4 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -144,8 +144,8 @@ extern int | |||
144 | qla2x00_execute_fw(scsi_qla_host_t *, uint32_t); | 144 | qla2x00_execute_fw(scsi_qla_host_t *, uint32_t); |
145 | 145 | ||
146 | extern void | 146 | extern void |
147 | qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *, | 147 | qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, |
148 | uint16_t *, uint16_t *, uint16_t *, uint32_t *, uint8_t *, uint32_t *); | 148 | uint16_t *, uint32_t *, uint8_t *, uint32_t *, uint8_t *); |
149 | 149 | ||
150 | extern int | 150 | extern int |
151 | qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *); | 151 | qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *); |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e79338750e39..0febfa648c34 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -994,7 +994,8 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) | |||
994 | &ha->fw_minor_version, | 994 | &ha->fw_minor_version, |
995 | &ha->fw_subminor_version, | 995 | &ha->fw_subminor_version, |
996 | &ha->fw_attributes, &ha->fw_memory_size, | 996 | &ha->fw_attributes, &ha->fw_memory_size, |
997 | ha->mpi_version, &ha->mpi_capabilities); | 997 | ha->mpi_version, &ha->mpi_capabilities, |
998 | ha->phy_version); | ||
998 | ha->flags.npiv_supported = 0; | 999 | ha->flags.npiv_supported = 0; |
999 | if (IS_QLA2XXX_MIDTYPE(ha) && | 1000 | if (IS_QLA2XXX_MIDTYPE(ha) && |
1000 | (ha->fw_attributes & BIT_2)) { | 1001 | (ha->fw_attributes & BIT_2)) { |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 91e133bd8e60..b380c6fdbe40 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -408,7 +408,7 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr) | |||
408 | void | 408 | void |
409 | qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, | 409 | qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, |
410 | uint16_t *subminor, uint16_t *attributes, uint32_t *memory, uint8_t *mpi, | 410 | uint16_t *subminor, uint16_t *attributes, uint32_t *memory, uint8_t *mpi, |
411 | uint32_t *mpi_caps) | 411 | uint32_t *mpi_caps, uint8_t *phy) |
412 | { | 412 | { |
413 | int rval; | 413 | int rval; |
414 | mbx_cmd_t mc; | 414 | mbx_cmd_t mc; |
@@ -420,7 +420,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, | |||
420 | mcp->out_mb = MBX_0; | 420 | mcp->out_mb = MBX_0; |
421 | mcp->in_mb = MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; | 421 | mcp->in_mb = MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; |
422 | if (IS_QLA81XX(vha->hw)) | 422 | if (IS_QLA81XX(vha->hw)) |
423 | mcp->in_mb |= MBX_13|MBX_12|MBX_11|MBX_10; | 423 | mcp->in_mb |= MBX_13|MBX_12|MBX_11|MBX_10|MBX_9|MBX_8; |
424 | mcp->flags = 0; | 424 | mcp->flags = 0; |
425 | mcp->tov = MBX_TOV_SECONDS; | 425 | mcp->tov = MBX_TOV_SECONDS; |
426 | rval = qla2x00_mailbox_command(vha, mcp); | 426 | rval = qla2x00_mailbox_command(vha, mcp); |
@@ -435,11 +435,13 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha, uint16_t *major, uint16_t *minor, | |||
435 | else | 435 | else |
436 | *memory = (mcp->mb[5] << 16) | mcp->mb[4]; | 436 | *memory = (mcp->mb[5] << 16) | mcp->mb[4]; |
437 | if (IS_QLA81XX(vha->hw)) { | 437 | if (IS_QLA81XX(vha->hw)) { |
438 | mpi[0] = mcp->mb[10] >> 8; | 438 | mpi[0] = mcp->mb[10] & 0xff; |
439 | mpi[1] = mcp->mb[10] & 0xff; | 439 | mpi[1] = mcp->mb[11] >> 8; |
440 | mpi[2] = mcp->mb[11] >> 8; | 440 | mpi[2] = mcp->mb[11] & 0xff; |
441 | mpi[3] = mcp->mb[11] & 0xff; | ||
442 | *mpi_caps = (mcp->mb[12] << 16) | mcp->mb[13]; | 441 | *mpi_caps = (mcp->mb[12] << 16) | mcp->mb[13]; |
442 | phy[0] = mcp->mb[8] & 0xff; | ||
443 | phy[1] = mcp->mb[9] >> 8; | ||
444 | phy[2] = mcp->mb[9] & 0xff; | ||
443 | } | 445 | } |
444 | 446 | ||
445 | if (rval != QLA_SUCCESS) { | 447 | if (rval != QLA_SUCCESS) { |