Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328835
b: refs/heads/master
c: 40129a4
h: refs/heads/master
i:
  328833: bc1f8b1
  328831: 5ef327b
v: v3
  • Loading branch information
Harish Zunjarrao authored and James Bottomley committed Sep 24, 2012
1 parent 9556e74 commit 570a554
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9b6f722f62d0a302b980a4fdcdf9c9933955772
refs/heads/master: 40129a4c6edc1753b9a537877b6a2eac9fc6c659
20 changes: 20 additions & 0 deletions trunk/drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1276,6 +1276,24 @@ qla2x00_diag_megabytes_show(struct device *dev,
vha->bidi_stats.transfer_bytes >> 20);
}

static ssize_t
qla2x00_fw_dump_size_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
struct qla_hw_data *ha = vha->hw;
uint32_t size;

if (!ha->fw_dumped)
size = 0;
else if (IS_QLA82XX(ha))
size = ha->md_template_size + ha->md_dump_size;
else
size = ha->fw_dump_len;

return snprintf(buf, PAGE_SIZE, "%d\n", size);
}

static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL);
static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL);
Expand Down Expand Up @@ -1316,6 +1334,7 @@ static DEVICE_ATTR(fw_state, S_IRUGO, qla2x00_fw_state_show, NULL);
static DEVICE_ATTR(thermal_temp, S_IRUGO, qla2x00_thermal_temp_show, NULL);
static DEVICE_ATTR(diag_requests, S_IRUGO, qla2x00_diag_requests_show, NULL);
static DEVICE_ATTR(diag_megabytes, S_IRUGO, qla2x00_diag_megabytes_show, NULL);
static DEVICE_ATTR(fw_dump_size, S_IRUGO, qla2x00_fw_dump_size_show, NULL);

struct device_attribute *qla2x00_host_attrs[] = {
&dev_attr_driver_version,
Expand Down Expand Up @@ -1347,6 +1366,7 @@ struct device_attribute *qla2x00_host_attrs[] = {
&dev_attr_thermal_temp,
&dev_attr_diag_requests,
&dev_attr_diag_megabytes,
&dev_attr_fw_dump_size,
NULL,
};

Expand Down

0 comments on commit 570a554

Please sign in to comment.