IWL_DEBUG_FW(fwrt, "Paging: allocating mem for %d paging blocks, each block holds 8 pages, last block holds %d pages\n",
fwrt->num_of_paging_blk,
fwrt->num_of_pages_in_last_blk);
/* *AllocateCSSandpagingblocksindram.
*/ for (blk_idx = 0; blk_idx < fwrt->num_of_paging_blk + 1; blk_idx++) { /* For CSS allocate 4KB, for others PAGING_BLOCK_SIZE (32K) */
size = blk_idx ? PAGING_BLOCK_SIZE : FW_PAGING_SIZE;
order = get_order(size);
block = alloc_pages(GFP_KERNEL, order); if (!block) { /* free all the previous pages since we failed */
iwl_free_fw_paging(fwrt); return -ENOMEM;
}
/* copy the CSS block to the dram */
IWL_DEBUG_FW(fwrt, "Paging: load paging CSS to FW, sec = %d\n",
sec_idx);
if (image->sec[sec_idx].len > fwrt->fw_paging_db[0].fw_paging_size) {
IWL_ERR(fwrt, "CSS block is larger than paging size\n");
ret = -EINVAL; goto err;
}
IWL_DEBUG_FW(fwrt, "Paging: copied %d CSS bytes to first block\n",
fwrt->fw_paging_db[0].fw_paging_size);
sec_idx++;
/* *Copythepagingblockstothedram.Theloopindexstarts *from1sincetheCSSblock(index0)wasalreadycopiedto *dram.Weusenum_of_paging_blk+1toaccountforthat.
*/ for (idx = 1; idx < fwrt->num_of_paging_blk + 1; idx++) { struct iwl_fw_paging *block = &fwrt->fw_paging_db[idx]; int remaining = image->sec[sec_idx].len - offset; int len = block->fw_paging_size;
/* *Forthelastblock,wecopyallthatisremaining, *forallotherblocks,wecopyfw_paging_sizeata
* time. */ if (idx == fwrt->num_of_paging_blk) {
len = remaining; if (remaining !=
fwrt->num_of_pages_in_last_blk * FW_PAGING_SIZE) {
IWL_ERR(fwrt, "Paging: last block contains more data than expected %d\n",
remaining);
ret = -EINVAL; goto err;
}
} elseif (block->fw_paging_size > remaining) {
IWL_ERR(fwrt, "Paging: not enough data in other in block %d (%d)\n",
idx, remaining);
ret = -EINVAL; goto err;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.