diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index bc8194f74625..44578b56ad0a 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1309,6 +1309,31 @@ qla2x00_fabric_param_show(struct device *dev, struct device_attribute *attr, | |||
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | static ssize_t | 1311 | static ssize_t |
1312 | qla2x00_thermal_temp_show(struct device *dev, | ||
1313 | struct device_attribute *attr, char *buf) | ||
1314 | { | ||
1315 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
1316 | int rval = QLA_FUNCTION_FAILED; | ||
1317 | uint16_t temp, frac; | ||
1318 | |||
1319 | if (!vha->hw->flags.thermal_supported) | ||
1320 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
1321 | |||
1322 | temp = frac = 0; | ||
1323 | if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || | ||
1324 | test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags)) | ||
1325 | DEBUG2_3_11(printk(KERN_WARNING | ||
1326 | "%s(%ld): isp reset in progress.\n", | ||
1327 | __func__, vha->host_no)); | ||
1328 | else if (!vha->hw->flags.eeh_busy) | ||
1329 | rval = qla2x00_get_thermal_temp(vha, &temp, &frac); | ||
1330 | if (rval != QLA_SUCCESS) | ||
1331 | temp = frac = 0; | ||
1332 | |||
1333 | return snprintf(buf, PAGE_SIZE, "%d.%02d\n", temp, frac); | ||
1334 | } | ||
1335 | |||
1336 | static ssize_t | ||
1312 | qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, | 1337 | qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, |
1313 | char *buf) | 1338 | char *buf) |
1314 | { | 1339 | { |
@@ -1366,6 +1391,7 @@ static DEVICE_ATTR(vn_port_mac_address, S_IRUGO, | |||
1366 | qla2x00_vn_port_mac_address_show, NULL); | 1391 | qla2x00_vn_port_mac_address_show, NULL); |
1367 | static DEVICE_ATTR(fabric_param, S_IRUGO, qla2x00_fabric_param_show, NULL); | 1392 | static DEVICE_ATTR(fabric_param, S_IRUGO, qla2x00_fabric_param_show, NULL); |
1368 | static DEVICE_ATTR(fw_state, S_IRUGO, qla2x00_fw_state_show, NULL); | 1393 | static DEVICE_ATTR(fw_state, S_IRUGO, qla2x00_fw_state_show, NULL); |
1394 | static DEVICE_ATTR(thermal_temp, S_IRUGO, qla2x00_thermal_temp_show, NULL); | ||
1369 | 1395 | ||
1370 | struct device_attribute *qla2x00_host_attrs[] = { | 1396 | struct device_attribute *qla2x00_host_attrs[] = { |
1371 | &dev_attr_driver_version, | 1397 | &dev_attr_driver_version, |
@@ -1394,6 +1420,7 @@ struct device_attribute *qla2x00_host_attrs[] = { | |||
1394 | &dev_attr_fabric_param, | 1420 | &dev_attr_fabric_param, |
1395 | &dev_attr_fw_state, | 1421 | &dev_attr_fw_state, |
1396 | &dev_attr_optrom_gold_fw_version, | 1422 | &dev_attr_optrom_gold_fw_version, |
1423 | &dev_attr_thermal_temp, | ||
1397 | NULL, | 1424 | NULL, |
1398 | }; | 1425 | }; |
1399 | 1426 | ||