diff options
author | Saurav Kashyap <saurav.kashyap@qlogic.com> | 2012-08-22 20:21:04 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-24 10:10:47 +0200 |
commit | 81178772b636a0effe65c98f85a50dc32427b436 (patch) | |
tree | 2997297358c3ee2b3964022b86d59d7949509e1e /drivers/scsi/qla2xxx/qla_attr.c | |
parent | [SCSI] qla2xxx: IDC implementation for ISP83xx. (diff) | |
download | linux-81178772b636a0effe65c98f85a50dc32427b436.tar.xz linux-81178772b636a0effe65c98f85a50dc32427b436.zip |
[SCSI] qla2xxx: Implemetation of mctp.
[jejb: fix up checkpatch errors]
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@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.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index f76424ef05b0..f042176a6828 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -26,7 +26,7 @@ qla2x00_sysfs_read_fw_dump(struct file *filp, struct kobject *kobj, struct qla_hw_data *ha = vha->hw; int rval = 0; - if (ha->fw_dump_reading == 0) + if (!(ha->fw_dump_reading || ha->mctp_dump_reading)) return 0; if (IS_QLA82XX(ha)) { @@ -39,9 +39,14 @@ qla2x00_sysfs_read_fw_dump(struct file *filp, struct kobject *kobj, rval = memory_read_from_buffer(buf, count, &off, ha->md_dump, ha->md_dump_size); return rval; - } else + } else if (ha->mctp_dumped && ha->mctp_dump_reading) + return memory_read_from_buffer(buf, count, &off, ha->mctp_dump, + MCTP_DUMP_SIZE); + else if (ha->fw_dump_reading) return memory_read_from_buffer(buf, count, &off, ha->fw_dump, ha->fw_dump_len); + else + return 0; } static ssize_t @@ -107,6 +112,22 @@ qla2x00_sysfs_write_fw_dump(struct file *filp, struct kobject *kobj, if (IS_QLA82XX(ha)) set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); break; + case 6: + if (!ha->mctp_dump_reading) + break; + ql_log(ql_log_info, vha, 0x70c1, + "MCTP dump cleared on (%ld).\n", vha->host_no); + ha->mctp_dump_reading = 0; + ha->mctp_dumped = 0; + break; + case 7: + if (ha->mctp_dumped && !ha->mctp_dump_reading) { + ha->mctp_dump_reading = 1; + ql_log(ql_log_info, vha, 0x70c2, + "Raw mctp dump ready for read on (%ld).\n", + vha->host_no); + } + break; } return count; } |