aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Zunjarrao <harish.zunjarrao@qlogic.com>2012-08-22 14:21:02 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-24 04:10:47 -0400
commit40129a4c6edc1753b9a537877b6a2eac9fc6c659 (patch)
tree6fa346d96ab21650fcd4f6cf883d35866de4d221
parenta9b6f722f62d0a302b980a4fdcdf9c9933955772 (diff)
[SCSI] qla2xxx: Add FW DUMP SIZE sysfs attribute.
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index ff2439bd9b4b..da804f487f21 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1276,6 +1276,24 @@ qla2x00_diag_megabytes_show(struct device *dev,
1276 vha->bidi_stats.transfer_bytes >> 20); 1276 vha->bidi_stats.transfer_bytes >> 20);
1277} 1277}
1278 1278
1279static ssize_t
1280qla2x00_fw_dump_size_show(struct device *dev, struct device_attribute *attr,
1281 char *buf)
1282{
1283 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1284 struct qla_hw_data *ha = vha->hw;
1285 uint32_t size;
1286
1287 if (!ha->fw_dumped)
1288 size = 0;
1289 else if (IS_QLA82XX(ha))
1290 size = ha->md_template_size + ha->md_dump_size;
1291 else
1292 size = ha->fw_dump_len;
1293
1294 return snprintf(buf, PAGE_SIZE, "%d\n", size);
1295}
1296
1279static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); 1297static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL);
1280static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); 1298static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
1281static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); 1299static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL);
@@ -1316,6 +1334,7 @@ static DEVICE_ATTR(fw_state, S_IRUGO, qla2x00_fw_state_show, NULL);
1316static DEVICE_ATTR(thermal_temp, S_IRUGO, qla2x00_thermal_temp_show, NULL); 1334static DEVICE_ATTR(thermal_temp, S_IRUGO, qla2x00_thermal_temp_show, NULL);
1317static DEVICE_ATTR(diag_requests, S_IRUGO, qla2x00_diag_requests_show, NULL); 1335static DEVICE_ATTR(diag_requests, S_IRUGO, qla2x00_diag_requests_show, NULL);
1318static DEVICE_ATTR(diag_megabytes, S_IRUGO, qla2x00_diag_megabytes_show, NULL); 1336static DEVICE_ATTR(diag_megabytes, S_IRUGO, qla2x00_diag_megabytes_show, NULL);
1337static DEVICE_ATTR(fw_dump_size, S_IRUGO, qla2x00_fw_dump_size_show, NULL);
1319 1338
1320struct device_attribute *qla2x00_host_attrs[] = { 1339struct device_attribute *qla2x00_host_attrs[] = {
1321 &dev_attr_driver_version, 1340 &dev_attr_driver_version,
@@ -1347,6 +1366,7 @@ struct device_attribute *qla2x00_host_attrs[] = {
1347 &dev_attr_thermal_temp, 1366 &dev_attr_thermal_temp,
1348 &dev_attr_diag_requests, 1367 &dev_attr_diag_requests,
1349 &dev_attr_diag_megabytes, 1368 &dev_attr_diag_megabytes,
1369 &dev_attr_fw_dump_size,
1350 NULL, 1370 NULL,
1351}; 1371};
1352 1372