diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index cd53627cc761..c7acef50d5da 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -303,7 +303,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, | |||
303 | else if (start == (ha->flt_region_boot * 4) || | 303 | else if (start == (ha->flt_region_boot * 4) || |
304 | start == (ha->flt_region_fw * 4)) | 304 | start == (ha->flt_region_fw * 4)) |
305 | valid = 1; | 305 | valid = 1; |
306 | else if (IS_QLA25XX(ha) && | 306 | else if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && |
307 | start == (ha->flt_region_vpd_nvram * 4)) | 307 | start == (ha->flt_region_vpd_nvram * 4)) |
308 | valid = 1; | 308 | valid = 1; |
309 | if (!valid) { | 309 | if (!valid) { |
@@ -815,6 +815,21 @@ qla2x00_total_isp_aborts_show(struct device *dev, | |||
815 | ha->qla_stats.total_isp_aborts); | 815 | ha->qla_stats.total_isp_aborts); |
816 | } | 816 | } |
817 | 817 | ||
818 | static ssize_t | ||
819 | qla2x00_mpi_version_show(struct device *dev, struct device_attribute *attr, | ||
820 | char *buf) | ||
821 | { | ||
822 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
823 | struct qla_hw_data *ha = vha->hw; | ||
824 | |||
825 | if (!IS_QLA81XX(ha)) | ||
826 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
827 | |||
828 | return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x.%02x (%x)\n", | ||
829 | ha->mpi_version[0], ha->mpi_version[1], ha->mpi_version[2], | ||
830 | ha->mpi_version[3], ha->mpi_capabilities); | ||
831 | } | ||
832 | |||
818 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); | 833 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); |
819 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); | 834 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); |
820 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); | 835 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); |
@@ -839,6 +854,7 @@ static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show, | |||
839 | NULL); | 854 | NULL); |
840 | static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, | 855 | static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show, |
841 | NULL); | 856 | NULL); |
857 | static DEVICE_ATTR(mpi_version, S_IRUGO, qla2x00_mpi_version_show, NULL); | ||
842 | 858 | ||
843 | struct device_attribute *qla2x00_host_attrs[] = { | 859 | struct device_attribute *qla2x00_host_attrs[] = { |
844 | &dev_attr_driver_version, | 860 | &dev_attr_driver_version, |
@@ -858,6 +874,7 @@ struct device_attribute *qla2x00_host_attrs[] = { | |||
858 | &dev_attr_optrom_fcode_version, | 874 | &dev_attr_optrom_fcode_version, |
859 | &dev_attr_optrom_fw_version, | 875 | &dev_attr_optrom_fw_version, |
860 | &dev_attr_total_isp_aborts, | 876 | &dev_attr_total_isp_aborts, |
877 | &dev_attr_mpi_version, | ||
861 | NULL, | 878 | NULL, |
862 | }; | 879 | }; |
863 | 880 | ||
@@ -892,6 +909,9 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) | |||
892 | case PORT_SPEED_8GB: | 909 | case PORT_SPEED_8GB: |
893 | speed = FC_PORTSPEED_8GBIT; | 910 | speed = FC_PORTSPEED_8GBIT; |
894 | break; | 911 | break; |
912 | case PORT_SPEED_10GB: | ||
913 | speed = FC_PORTSPEED_10GBIT; | ||
914 | break; | ||
895 | } | 915 | } |
896 | fc_host_speed(shost) = speed; | 916 | fc_host_speed(shost) = speed; |
897 | } | 917 | } |
@@ -1382,7 +1402,9 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha) | |||
1382 | fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; | 1402 | fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; |
1383 | fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; | 1403 | fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; |
1384 | 1404 | ||
1385 | if (IS_QLA25XX(ha)) | 1405 | if (IS_QLA81XX(ha)) |
1406 | speed = FC_PORTSPEED_10GBIT; | ||
1407 | else if (IS_QLA25XX(ha)) | ||
1386 | speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | | 1408 | speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | |
1387 | FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT; | 1409 | FC_PORTSPEED_2GBIT | FC_PORTSPEED_1GBIT; |
1388 | else if (IS_QLA24XX_TYPE(ha)) | 1410 | else if (IS_QLA24XX_TYPE(ha)) |