qla2xxx: Remove sysfs node fw_dump_template.
authorJoe Carnuccio <joe.carnuccio@qlogic.com>
Wed, 6 Jul 2016 15:14:17 +0000 (11:14 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 15 Jul 2016 19:31:31 +0000 (15:31 -0400)
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>
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_dbg.c

index 4dc06a13cab879255d7f7b58dde4643ed25f5c52..c9bcd82f08bc28e4ea5f6a3a28d2ad0a2e681ffb 100644 (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);
index b64c504ff12fa2dc5657ce68297cb59dda0f27e8..b985fcbdf79b8b8342533a21bf5522a853643647 100644 (file)
@@ -39,6 +39,7 @@
  * |                              |                    | 0x70a5-0x70a6  |
  * |                              |                    | 0x70a8,0x70ab  |
  * |                              |                    | 0x70ad-0x70ae  |
+ * |                              |                    | 0x70d0-0x70d6 |
  * |                              |                    | 0x70d7-0x70db  |
  * |                              |                    | 0x70de-0x70df  |
  * | Task Management              |       0x803d       | 0x8000,0x800b  |