lpfc: Add support for reporting option_rom_version on newer adapters
authorJames Smart <james.smart@emulex.com>
Tue, 7 Apr 2015 19:07:16 +0000 (15:07 -0400)
committerJames Bottomley <JBottomley@Odin.com>
Fri, 10 Apr 2015 14:47:39 +0000 (07:47 -0700)
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/lpfc/lpfc_attr.c

index 2f9b96826ac0d4b69c66a1a005a24d7c17d30bfb..374aa03d91e87550a6353a157ad7388874dc2bde 100644 (file)
@@ -406,8 +406,13 @@ lpfc_option_rom_version_show(struct device *dev, struct device_attribute *attr,
        struct Scsi_Host  *shost = class_to_shost(dev);
        struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
        struct lpfc_hba   *phba = vport->phba;
+       char fwrev[FW_REV_STR_SIZE];
+
+       if (phba->sli_rev < LPFC_SLI_REV4)
+               return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion);
 
-       return snprintf(buf, PAGE_SIZE, "%s\n", phba->OptionROMVersion);
+       lpfc_decode_firmware_rev(phba, fwrev, 1);
+       return snprintf(buf, PAGE_SIZE, "%s\n", fwrev);
 }
 
 /**