diff options
author | Joe Carnuccio <joe.carnuccio@qlogic.com> | 2016-07-06 11:14:17 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-07-15 15:31:31 -0400 |
commit | f1d7ce65c9003a8e027a8745adc74b550da3ab16 (patch) | |
tree | 8e4f21043690d07324a4053528244d2fc9deb472 /drivers/scsi | |
parent | 648222d2652d55dccdcf5b734b85c19d2664525e (diff) |
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 89 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 1 |
2 files changed, 1 insertions, 89 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 4dc06a13cab8..c9bcd82f08bc 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -147,92 +147,6 @@ static struct bin_attribute sysfs_fw_dump_attr = { | |||
147 | }; | 147 | }; |
148 | 148 | ||
149 | static ssize_t | 149 | static ssize_t |
150 | qla2x00_sysfs_read_fw_dump_template(struct file *filp, struct kobject *kobj, | ||
151 | struct bin_attribute *bin_attr, | ||
152 | char *buf, loff_t off, size_t count) | ||
153 | { | ||
154 | struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, | ||
155 | struct device, kobj))); | ||
156 | struct qla_hw_data *ha = vha->hw; | ||
157 | |||
158 | if (!ha->fw_dump_template || !ha->fw_dump_template_len) | ||
159 | return 0; | ||
160 | |||
161 | ql_dbg(ql_dbg_user, vha, 0x70e2, | ||
162 | "chunk <- off=%llx count=%zx\n", off, count); | ||
163 | return memory_read_from_buffer(buf, count, &off, | ||
164 | ha->fw_dump_template, ha->fw_dump_template_len); | ||
165 | } | ||
166 | |||
167 | static ssize_t | ||
168 | qla2x00_sysfs_write_fw_dump_template(struct file *filp, struct kobject *kobj, | ||
169 | struct bin_attribute *bin_attr, | ||
170 | char *buf, loff_t off, size_t count) | ||
171 | { | ||
172 | struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, | ||
173 | struct device, kobj))); | ||
174 | struct qla_hw_data *ha = vha->hw; | ||
175 | uint32_t size; | ||
176 | |||
177 | if (off == 0) { | ||
178 | if (ha->fw_dump) | ||
179 | vfree(ha->fw_dump); | ||
180 | if (ha->fw_dump_template) | ||
181 | vfree(ha->fw_dump_template); | ||
182 | |||
183 | ha->fw_dump = NULL; | ||
184 | ha->fw_dump_len = 0; | ||
185 | ha->fw_dump_template = NULL; | ||
186 | ha->fw_dump_template_len = 0; | ||
187 | |||
188 | size = qla27xx_fwdt_template_size(buf); | ||
189 | ql_dbg(ql_dbg_user, vha, 0x70d1, | ||
190 | "-> allocating fwdt (%x bytes)...\n", size); | ||
191 | ha->fw_dump_template = vmalloc(size); | ||
192 | if (!ha->fw_dump_template) { | ||
193 | ql_log(ql_log_warn, vha, 0x70d2, | ||
194 | "Failed allocate fwdt (%x bytes).\n", size); | ||
195 | return -ENOMEM; | ||
196 | } | ||
197 | ha->fw_dump_template_len = size; | ||
198 | } | ||
199 | |||
200 | if (off + count > ha->fw_dump_template_len) { | ||
201 | count = ha->fw_dump_template_len - off; | ||
202 | ql_dbg(ql_dbg_user, vha, 0x70d3, | ||
203 | "chunk -> truncating to %zx bytes.\n", count); | ||
204 | } | ||
205 | |||
206 | ql_dbg(ql_dbg_user, vha, 0x70d4, | ||
207 | "chunk -> off=%llx count=%zx\n", off, count); | ||
208 | memcpy(ha->fw_dump_template + off, buf, count); | ||
209 | |||
210 | if (off + count == ha->fw_dump_template_len) { | ||
211 | size = qla27xx_fwdt_calculate_dump_size(vha); | ||
212 | ql_dbg(ql_dbg_user, vha, 0x70d5, | ||
213 | "-> allocating fwdump (%x bytes)...\n", size); | ||
214 | ha->fw_dump = vmalloc(size); | ||
215 | if (!ha->fw_dump) { | ||
216 | ql_log(ql_log_warn, vha, 0x70d6, | ||
217 | "Failed allocate fwdump (%x bytes).\n", size); | ||
218 | return -ENOMEM; | ||
219 | } | ||
220 | ha->fw_dump_len = size; | ||
221 | } | ||
222 | |||
223 | return count; | ||
224 | } | ||
225 | static struct bin_attribute sysfs_fw_dump_template_attr = { | ||
226 | .attr = { | ||
227 | .name = "fw_dump_template", | ||
228 | .mode = S_IRUSR | S_IWUSR, | ||
229 | }, | ||
230 | .size = 0, | ||
231 | .read = qla2x00_sysfs_read_fw_dump_template, | ||
232 | .write = qla2x00_sysfs_write_fw_dump_template, | ||
233 | }; | ||
234 | |||
235 | static ssize_t | ||
236 | qla2x00_sysfs_read_nvram(struct file *filp, struct kobject *kobj, | 150 | qla2x00_sysfs_read_nvram(struct file *filp, struct kobject *kobj, |
237 | struct bin_attribute *bin_attr, | 151 | struct bin_attribute *bin_attr, |
238 | char *buf, loff_t off, size_t count) | 152 | char *buf, loff_t off, size_t count) |
@@ -973,7 +887,6 @@ static struct sysfs_entry { | |||
973 | int is4GBp_only; | 887 | int is4GBp_only; |
974 | } bin_file_entries[] = { | 888 | } bin_file_entries[] = { |
975 | { "fw_dump", &sysfs_fw_dump_attr, }, | 889 | { "fw_dump", &sysfs_fw_dump_attr, }, |
976 | { "fw_dump_template", &sysfs_fw_dump_template_attr, 0x27 }, | ||
977 | { "nvram", &sysfs_nvram_attr, }, | 890 | { "nvram", &sysfs_nvram_attr, }, |
978 | { "optrom", &sysfs_optrom_attr, }, | 891 | { "optrom", &sysfs_optrom_attr, }, |
979 | { "optrom_ctl", &sysfs_optrom_ctl_attr, }, | 892 | { "optrom_ctl", &sysfs_optrom_ctl_attr, }, |
@@ -1000,8 +913,6 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha) | |||
1000 | continue; | 913 | continue; |
1001 | if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) | 914 | if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw))) |
1002 | continue; | 915 | continue; |
1003 | if (iter->is4GBp_only == 0x27 && !IS_QLA27XX(vha->hw)) | ||
1004 | continue; | ||
1005 | 916 | ||
1006 | ret = sysfs_create_bin_file(&host->shost_gendev.kobj, | 917 | ret = sysfs_create_bin_file(&host->shost_gendev.kobj, |
1007 | iter->attr); | 918 | iter->attr); |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index b64c504ff12f..b985fcbdf79b 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -39,6 +39,7 @@ | |||
39 | * | | | 0x70a5-0x70a6 | | 39 | * | | | 0x70a5-0x70a6 | |
40 | * | | | 0x70a8,0x70ab | | 40 | * | | | 0x70a8,0x70ab | |
41 | * | | | 0x70ad-0x70ae | | 41 | * | | | 0x70ad-0x70ae | |
42 | * | | | 0x70d0-0x70d6 | | ||
42 | * | | | 0x70d7-0x70db | | 43 | * | | | 0x70d7-0x70db | |
43 | * | | | 0x70de-0x70df | | 44 | * | | | 0x70de-0x70df | |
44 | * | Task Management | 0x803d | 0x8000,0x800b | | 45 | * | Task Management | 0x803d | 0x8000,0x800b | |