aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2009-03-24 12:08:03 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:22:47 -0400
commit55a961581fd34632bf724dd144c0dbf740c9fede (patch)
tree2661c22da7c24213cbc73ede440f89964a5c9a00 /drivers/scsi/qla2xxx/qla_attr.c
parentbe67e6530b006b10380a5f0c49cdf974426a22e9 (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/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c20
1 files changed, 18 insertions, 2 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
826static ssize_t
827qla2x00_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
826static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); 840static 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,
848static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, 862static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show,
849 NULL); 863 NULL);
850static DEVICE_ATTR(mpi_version, S_IRUGO, qla2x00_mpi_version_show, NULL); 864static DEVICE_ATTR(mpi_version, S_IRUGO, qla2x00_mpi_version_show, NULL);
865static DEVICE_ATTR(phy_version, S_IRUGO, qla2x00_phy_version_show, NULL);
851 866
852struct device_attribute *qla2x00_host_attrs[] = { 867struct 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