qla2xxx: Remove sysfs node fw_dump_template.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Joe Carnuccio 2016-07-06 11:14:17 -04:00 committed by Martin K. Petersen
parent 648222d265
commit f1d7ce65c9
2 changed files with 1 additions and 89 deletions

View File

@ -146,92 +146,6 @@ static struct bin_attribute sysfs_fw_dump_attr = {
.write = qla2x00_sysfs_write_fw_dump,
};
static ssize_t
qla2x00_sysfs_read_fw_dump_template(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj)));
struct qla_hw_data *ha = vha->hw;
if (!ha->fw_dump_template || !ha->fw_dump_template_len)
return 0;
ql_dbg(ql_dbg_user, vha, 0x70e2,
"chunk <- off=%llx count=%zx\n", off, count);
return memory_read_from_buffer(buf, count, &off,
ha->fw_dump_template, ha->fw_dump_template_len);
}
static ssize_t
qla2x00_sysfs_write_fw_dump_template(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
char *buf, loff_t off, size_t count)
{
struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj,
struct device, kobj)));
struct qla_hw_data *ha = vha->hw;
uint32_t size;
if (off == 0) {
if (ha->fw_dump)
vfree(ha->fw_dump);
if (ha->fw_dump_template)
vfree(ha->fw_dump_template);
ha->fw_dump = NULL;
ha->fw_dump_len = 0;
ha->fw_dump_template = NULL;
ha->fw_dump_template_len = 0;
size = qla27xx_fwdt_template_size(buf);
ql_dbg(ql_dbg_user, vha, 0x70d1,
"-> allocating fwdt (%x bytes)...\n", size);
ha->fw_dump_template = vmalloc(size);
if (!ha->fw_dump_template) {
ql_log(ql_log_warn, vha, 0x70d2,
"Failed allocate fwdt (%x bytes).\n", size);
return -ENOMEM;
}
ha->fw_dump_template_len = size;
}
if (off + count > ha->fw_dump_template_len) {
count = ha->fw_dump_template_len - off;
ql_dbg(ql_dbg_user, vha, 0x70d3,
"chunk -> truncating to %zx bytes.\n", count);
}
ql_dbg(ql_dbg_user, vha, 0x70d4,
"chunk -> off=%llx count=%zx\n", off, count);
memcpy(ha->fw_dump_template + off, buf, count);
if (off + count == ha->fw_dump_template_len) {
size = qla27xx_fwdt_calculate_dump_size(vha);
ql_dbg(ql_dbg_user, vha, 0x70d5,
"-> allocating fwdump (%x bytes)...\n", size);
ha->fw_dump = vmalloc(size);
if (!ha->fw_dump) {
ql_log(ql_log_warn, vha, 0x70d6,
"Failed allocate fwdump (%x bytes).\n", size);
return -ENOMEM;
}
ha->fw_dump_len = size;
}
return count;
}
static struct bin_attribute sysfs_fw_dump_template_attr = {
.attr = {
.name = "fw_dump_template",
.mode = S_IRUSR | S_IWUSR,
},
.size = 0,
.read = qla2x00_sysfs_read_fw_dump_template,
.write = qla2x00_sysfs_write_fw_dump_template,
};
static ssize_t
qla2x00_sysfs_read_nvram(struct file *filp, struct kobject *kobj,
struct bin_attribute *bin_attr,
@ -973,7 +887,6 @@ static struct sysfs_entry {
int is4GBp_only;
} bin_file_entries[] = {
{ "fw_dump", &sysfs_fw_dump_attr, },
{ "fw_dump_template", &sysfs_fw_dump_template_attr, 0x27 },
{ "nvram", &sysfs_nvram_attr, },
{ "optrom", &sysfs_optrom_attr, },
{ "optrom_ctl", &sysfs_optrom_ctl_attr, },
@ -1000,8 +913,6 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha)
continue;
if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw)))
continue;
if (iter->is4GBp_only == 0x27 && !IS_QLA27XX(vha->hw))
continue;
ret = sysfs_create_bin_file(&host->shost_gendev.kobj,
iter->attr);

View File

@ -39,6 +39,7 @@
* | | | 0x70a5-0x70a6 |
* | | | 0x70a8,0x70ab |
* | | | 0x70ad-0x70ae |
* | | | 0x70d0-0x70d6 |
* | | | 0x70d7-0x70db |
* | | | 0x70de-0x70df |
* | Task Management | 0x803d | 0x8000,0x800b |