aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorChad Dupuis <chad.dupuis@qlogic.com>2014-02-26 04:15:12 -0500
committerJames Bottomley <JBottomley@Parallels.com>2014-03-15 13:18:51 -0400
commita1b23c5a1d17d27d4d685dba03dc3c437693b5d0 (patch)
treea61ea108b7f7361a0c7f91230e2be189e644bfdb /drivers/scsi/qla2xxx/qla_attr.c
parentfbe9c54b1da7c1f5795bc516676544b2ced58535 (diff)
[SCSI] qla2xxx: Read capture firmware dump on mailbox timeout for ISP8044 and ISP82XX.
Allow for the capture of a firmware dump but have a sysfs node (allow_cna_fw_dump) to allow the feature to be enabled/disabled dynamically. The default is off. Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index f2d42b961e92..aa81829aeb3a 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1503,6 +1503,37 @@ qla2x00_fw_dump_size_show(struct device *dev, struct device_attribute *attr,
1503 return scnprintf(buf, PAGE_SIZE, "%d\n", size); 1503 return scnprintf(buf, PAGE_SIZE, "%d\n", size);
1504} 1504}
1505 1505
1506static ssize_t
1507qla2x00_allow_cna_fw_dump_show(struct device *dev,
1508 struct device_attribute *attr, char *buf)
1509{
1510 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1511
1512 if (!IS_P3P_TYPE(vha->hw))
1513 return scnprintf(buf, PAGE_SIZE, "\n");
1514 else
1515 return scnprintf(buf, PAGE_SIZE, "%s\n",
1516 vha->hw->allow_cna_fw_dump ? "true" : "false");
1517}
1518
1519static ssize_t
1520qla2x00_allow_cna_fw_dump_store(struct device *dev,
1521 struct device_attribute *attr, const char *buf, size_t count)
1522{
1523 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1524 int val = 0;
1525
1526 if (!IS_P3P_TYPE(vha->hw))
1527 return -EINVAL;
1528
1529 if (sscanf(buf, "%d", &val) != 1)
1530 return -EINVAL;
1531
1532 vha->hw->allow_cna_fw_dump = val != 0;
1533
1534 return strlen(buf);
1535}
1536
1506static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); 1537static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL);
1507static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); 1538static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
1508static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); 1539static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL);
@@ -1544,6 +1575,9 @@ static DEVICE_ATTR(thermal_temp, S_IRUGO, qla2x00_thermal_temp_show, NULL);
1544static DEVICE_ATTR(diag_requests, S_IRUGO, qla2x00_diag_requests_show, NULL); 1575static DEVICE_ATTR(diag_requests, S_IRUGO, qla2x00_diag_requests_show, NULL);
1545static DEVICE_ATTR(diag_megabytes, S_IRUGO, qla2x00_diag_megabytes_show, NULL); 1576static DEVICE_ATTR(diag_megabytes, S_IRUGO, qla2x00_diag_megabytes_show, NULL);
1546static DEVICE_ATTR(fw_dump_size, S_IRUGO, qla2x00_fw_dump_size_show, NULL); 1577static DEVICE_ATTR(fw_dump_size, S_IRUGO, qla2x00_fw_dump_size_show, NULL);
1578static DEVICE_ATTR(allow_cna_fw_dump, S_IRUGO | S_IWUSR,
1579 qla2x00_allow_cna_fw_dump_show,
1580 qla2x00_allow_cna_fw_dump_store);
1547 1581
1548struct device_attribute *qla2x00_host_attrs[] = { 1582struct device_attribute *qla2x00_host_attrs[] = {
1549 &dev_attr_driver_version, 1583 &dev_attr_driver_version,
@@ -1576,6 +1610,7 @@ struct device_attribute *qla2x00_host_attrs[] = {
1576 &dev_attr_diag_requests, 1610 &dev_attr_diag_requests,
1577 &dev_attr_diag_megabytes, 1611 &dev_attr_diag_megabytes,
1578 &dev_attr_fw_dump_size, 1612 &dev_attr_fw_dump_size,
1613 &dev_attr_allow_cna_fw_dump,
1579 NULL, 1614 NULL,
1580}; 1615};
1581 1616