aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2007-01-29 13:22:21 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-01-31 12:06:38 -0500
commit30c4766213aeb684ee477ac7f36703f9134ac7ad (patch)
tree91b95d4e765aa74856e4e7a4b9ee5aefb04e01dc /drivers/scsi/qla2xxx/qla_attr.c
parentd88021a6710e6ed5d1899ba2e54d4638026e277d (diff)
[SCSI] qla2xxx: Export OptionROM boot-codes version information.
This includes BIOS, EFI, FCODE and firmware versions. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 7b18a6c7b7eb..78a5867bf515 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -653,6 +653,43 @@ qla2x00_beacon_store(struct class_device *cdev, const char *buf,
653 return count; 653 return count;
654} 654}
655 655
656static ssize_t
657qla2x00_optrom_bios_version_show(struct class_device *cdev, char *buf)
658{
659 scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
660
661 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->bios_revision[1],
662 ha->bios_revision[0]);
663}
664
665static ssize_t
666qla2x00_optrom_efi_version_show(struct class_device *cdev, char *buf)
667{
668 scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
669
670 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->efi_revision[1],
671 ha->efi_revision[0]);
672}
673
674static ssize_t
675qla2x00_optrom_fcode_version_show(struct class_device *cdev, char *buf)
676{
677 scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
678
679 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fcode_revision[1],
680 ha->fcode_revision[0]);
681}
682
683static ssize_t
684qla2x00_optrom_fw_version_show(struct class_device *cdev, char *buf)
685{
686 scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
687
688 return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d %d\n",
689 ha->fw_revision[0], ha->fw_revision[1], ha->fw_revision[2],
690 ha->fw_revision[3]);
691}
692
656static CLASS_DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, 693static CLASS_DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show,
657 NULL); 694 NULL);
658static CLASS_DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); 695static CLASS_DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
@@ -669,6 +706,14 @@ static CLASS_DEVICE_ATTR(zio_timer, S_IRUGO | S_IWUSR, qla2x00_zio_timer_show,
669 qla2x00_zio_timer_store); 706 qla2x00_zio_timer_store);
670static CLASS_DEVICE_ATTR(beacon, S_IRUGO | S_IWUSR, qla2x00_beacon_show, 707static CLASS_DEVICE_ATTR(beacon, S_IRUGO | S_IWUSR, qla2x00_beacon_show,
671 qla2x00_beacon_store); 708 qla2x00_beacon_store);
709static CLASS_DEVICE_ATTR(optrom_bios_version, S_IRUGO,
710 qla2x00_optrom_bios_version_show, NULL);
711static CLASS_DEVICE_ATTR(optrom_efi_version, S_IRUGO,
712 qla2x00_optrom_efi_version_show, NULL);
713static CLASS_DEVICE_ATTR(optrom_fcode_version, S_IRUGO,
714 qla2x00_optrom_fcode_version_show, NULL);
715static CLASS_DEVICE_ATTR(optrom_fw_version, S_IRUGO,
716 qla2x00_optrom_fw_version_show, NULL);
672 717
673struct class_device_attribute *qla2x00_host_attrs[] = { 718struct class_device_attribute *qla2x00_host_attrs[] = {
674 &class_device_attr_driver_version, 719 &class_device_attr_driver_version,
@@ -683,6 +728,10 @@ struct class_device_attribute *qla2x00_host_attrs[] = {
683 &class_device_attr_zio, 728 &class_device_attr_zio,
684 &class_device_attr_zio_timer, 729 &class_device_attr_zio_timer,
685 &class_device_attr_beacon, 730 &class_device_attr_beacon,
731 &class_device_attr_optrom_bios_version,
732 &class_device_attr_optrom_efi_version,
733 &class_device_attr_optrom_fcode_version,
734 &class_device_attr_optrom_fw_version,
686 NULL, 735 NULL,
687}; 736};
688 737