diff options
author | Joe Carnuccio <joe.carnuccio@qlogic.com> | 2008-07-10 19:55:53 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-07-26 15:14:39 -0400 |
commit | 1ee2714632ce3f7e6477069b41cb685112f5f217 (patch) | |
tree | 330ceb3edcce6f7506d6c6f2d7b7df3adf8e79c4 /drivers/scsi/qla2xxx/qla_attr.c | |
parent | e5896bd5dcf71fa43ddcc545340b847c13d29c44 (diff) |
[SCSI] qla2xxx: Retrieve board serial-number and description from VPD.
Recent ISPs have this information written at manufacturing time,
so use the information. This also reduces future churn of the
qla_devtbl.h file contents, as the driver can now depend on the
information to be present in VPD.
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index fe8d70862d59..612e3d0c7bd1 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -557,8 +557,10 @@ qla2x00_serial_num_show(struct device *dev, struct device_attribute *attr, | |||
557 | scsi_qla_host_t *ha = shost_priv(class_to_shost(dev)); | 557 | scsi_qla_host_t *ha = shost_priv(class_to_shost(dev)); |
558 | uint32_t sn; | 558 | uint32_t sn; |
559 | 559 | ||
560 | if (IS_FWI2_CAPABLE(ha)) | 560 | if (IS_FWI2_CAPABLE(ha)) { |
561 | return snprintf(buf, PAGE_SIZE, "\n"); | 561 | qla2xxx_get_vpd_field(ha, "SN", buf, PAGE_SIZE); |
562 | return snprintf(buf, PAGE_SIZE, "%s\n", buf); | ||
563 | } | ||
562 | 564 | ||
563 | sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; | 565 | sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1; |
564 | return snprintf(buf, PAGE_SIZE, "%c%05d\n", 'A' + sn / 100000, | 566 | return snprintf(buf, PAGE_SIZE, "%c%05d\n", 'A' + sn / 100000, |