diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 9361f4255e62..659a5d63467d 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -63,23 +63,29 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off, | |||
63 | ha->host_no); | 63 | ha->host_no); |
64 | 64 | ||
65 | vfree(ha->fw_dump_buffer); | 65 | vfree(ha->fw_dump_buffer); |
66 | free_pages((unsigned long)ha->fw_dump, | 66 | if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha)) |
67 | ha->fw_dump_order); | 67 | free_pages((unsigned long)ha->fw_dump, |
68 | ha->fw_dump_order); | ||
68 | 69 | ||
69 | ha->fw_dump_reading = 0; | 70 | ha->fw_dump_reading = 0; |
70 | ha->fw_dump_buffer = NULL; | 71 | ha->fw_dump_buffer = NULL; |
71 | ha->fw_dump = NULL; | 72 | ha->fw_dump = NULL; |
73 | ha->fw_dumped = 0; | ||
72 | } | 74 | } |
73 | break; | 75 | break; |
74 | case 1: | 76 | case 1: |
75 | if (ha->fw_dump != NULL && !ha->fw_dump_reading) { | 77 | if ((ha->fw_dump || ha->fw_dumped) && !ha->fw_dump_reading) { |
76 | ha->fw_dump_reading = 1; | 78 | ha->fw_dump_reading = 1; |
77 | 79 | ||
78 | dump_size = FW_DUMP_SIZE_1M; | 80 | if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) |
79 | if (ha->fw_memory_size < 0x20000) | 81 | dump_size = FW_DUMP_SIZE_24XX; |
80 | dump_size = FW_DUMP_SIZE_128K; | 82 | else { |
81 | else if (ha->fw_memory_size < 0x80000) | 83 | dump_size = FW_DUMP_SIZE_1M; |
82 | dump_size = FW_DUMP_SIZE_512K; | 84 | if (ha->fw_memory_size < 0x20000) |
85 | dump_size = FW_DUMP_SIZE_128K; | ||
86 | else if (ha->fw_memory_size < 0x80000) | ||
87 | dump_size = FW_DUMP_SIZE_512K; | ||
88 | } | ||
83 | ha->fw_dump_buffer = (char *)vmalloc(dump_size); | 89 | ha->fw_dump_buffer = (char *)vmalloc(dump_size); |
84 | if (ha->fw_dump_buffer == NULL) { | 90 | if (ha->fw_dump_buffer == NULL) { |
85 | qla_printk(KERN_WARNING, ha, | 91 | qla_printk(KERN_WARNING, ha, |