diff options
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c index 15513608d480..7763962e2ec4 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | |||
@@ -1187,41 +1187,38 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter) | |||
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | if (ops_index == ops_cnt) { | 1189 | if (ops_index == ops_cnt) { |
1190 | dev_info(&adapter->pdev->dev, | 1190 | dev_info(dev, "Skipping unknown entry opcode %d\n", |
1191 | "Invalid entry type %d, exiting dump\n", | ||
1192 | entry->hdr.type); | 1191 | entry->hdr.type); |
1193 | goto error; | 1192 | entry->hdr.flags |= QLCNIC_DUMP_SKIP; |
1193 | entry_offset += entry->hdr.offset; | ||
1194 | continue; | ||
1194 | } | 1195 | } |
1195 | 1196 | ||
1196 | /* Collect dump for this entry */ | 1197 | /* Collect dump for this entry */ |
1197 | dump = fw_dump_ops[ops_index].handler(adapter, entry, buffer); | 1198 | dump = fw_dump_ops[ops_index].handler(adapter, entry, buffer); |
1198 | if (!qlcnic_valid_dump_entry(&adapter->pdev->dev, entry, dump)) | 1199 | if (!qlcnic_valid_dump_entry(dev, entry, dump)) { |
1199 | entry->hdr.flags |= QLCNIC_DUMP_SKIP; | 1200 | entry->hdr.flags |= QLCNIC_DUMP_SKIP; |
1201 | entry_offset += entry->hdr.offset; | ||
1202 | continue; | ||
1203 | } | ||
1204 | |||
1200 | buf_offset += entry->hdr.cap_size; | 1205 | buf_offset += entry->hdr.cap_size; |
1201 | entry_offset += entry->hdr.offset; | 1206 | entry_offset += entry->hdr.offset; |
1202 | buffer = fw_dump->data + buf_offset; | 1207 | buffer = fw_dump->data + buf_offset; |
1203 | } | 1208 | } |
1204 | if (dump_size != buf_offset) { | 1209 | |
1205 | dev_info(&adapter->pdev->dev, | 1210 | fw_dump->clr = 1; |
1206 | "Captured(%d) and expected size(%d) do not match\n", | 1211 | snprintf(mesg, sizeof(mesg), "FW_DUMP=%s", adapter->netdev->name); |
1207 | buf_offset, dump_size); | 1212 | dev_info(dev, "%s: Dump data %d bytes captured, template header size %d bytes\n", |
1208 | goto error; | 1213 | adapter->netdev->name, fw_dump->size, tmpl_hdr->size); |
1209 | } else { | 1214 | /* Send a udev event to notify availability of FW dump */ |
1210 | fw_dump->clr = 1; | 1215 | kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, msg); |
1211 | snprintf(mesg, sizeof(mesg), "FW_DUMP=%s", | 1216 | |
1212 | adapter->netdev->name); | ||
1213 | dev_info(&adapter->pdev->dev, "%s: Dump data, %d bytes captured\n", | ||
1214 | adapter->netdev->name, fw_dump->size); | ||
1215 | /* Send a udev event to notify availability of FW dump */ | ||
1216 | kobject_uevent_env(&adapter->pdev->dev.kobj, KOBJ_CHANGE, msg); | ||
1217 | return 0; | ||
1218 | } | ||
1219 | error: | ||
1220 | if (fw_dump->use_pex_dma) | 1217 | if (fw_dump->use_pex_dma) |
1221 | dma_free_coherent(dev, QLC_PEX_DMA_READ_SIZE, | 1218 | dma_free_coherent(dev, QLC_PEX_DMA_READ_SIZE, |
1222 | fw_dump->dma_buffer, fw_dump->phys_addr); | 1219 | fw_dump->dma_buffer, fw_dump->phys_addr); |
1223 | vfree(fw_dump->data); | 1220 | |
1224 | return -EINVAL; | 1221 | return 0; |
1225 | } | 1222 | } |
1226 | 1223 | ||
1227 | void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter) | 1224 | void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter) |