Commit 5538409b authored by Liad Kaufman's avatar Liad Kaufman Committed by Luca Coelho

iwlwifi: pcie: support page dumping in wrt in gen2

In gen2, page dumping needs to be done in the trans
layer, as it is the one with access to the paging
pointers.
Signed-off-by: default avatarLiad Kaufman <liad.kaufman@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 2ba57c8b
...@@ -2754,6 +2754,13 @@ static struct iwl_trans_dump_data ...@@ -2754,6 +2754,13 @@ static struct iwl_trans_dump_data
(PAGE_SIZE << trans_pcie->rx_page_order)); (PAGE_SIZE << trans_pcie->rx_page_order));
} }
/* Paged memory for gen2 HW */
if (trans->cfg->gen2)
for (i = 0; i < trans_pcie->init_dram.paging_cnt; i++)
len += sizeof(*data) +
sizeof(struct iwl_fw_error_dump_paging) +
trans_pcie->init_dram.paging[i].size;
dump_data = vzalloc(len); dump_data = vzalloc(len);
if (!dump_data) if (!dump_data)
return NULL; return NULL;
...@@ -2793,6 +2800,28 @@ static struct iwl_trans_dump_data ...@@ -2793,6 +2800,28 @@ static struct iwl_trans_dump_data
if (dump_rbs) if (dump_rbs)
len += iwl_trans_pcie_dump_rbs(trans, &data, num_rbs); len += iwl_trans_pcie_dump_rbs(trans, &data, num_rbs);
/* Paged memory for gen2 HW */
if (trans->cfg->gen2) {
for (i = 0; i < trans_pcie->init_dram.paging_cnt; i++) {
struct iwl_fw_error_dump_paging *paging;
dma_addr_t addr =
trans_pcie->init_dram.paging[i].physical;
u32 page_len = trans_pcie->init_dram.paging[i].size;
data->type = cpu_to_le32(IWL_FW_ERROR_DUMP_PAGING);
data->len = cpu_to_le32(sizeof(*paging) + page_len);
paging = (void *)data->data;
paging->index = cpu_to_le32(i);
dma_sync_single_for_cpu(trans->dev, addr, page_len,
DMA_BIDIRECTIONAL);
memcpy(paging->data,
trans_pcie->init_dram.paging[i].block, page_len);
data = iwl_fw_error_next_data(data);
len += sizeof(*data) + sizeof(*paging) + page_len;
}
}
len += iwl_trans_pcie_dump_monitor(trans, &data, monitor_len); len += iwl_trans_pcie_dump_monitor(trans, &data, monitor_len);
dump_data->len = len; dump_data->len = len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment