hw/block/nvme: refactor nvme_dma
The nvme_dma function doesn't just do DMA (QEMUSGList-based) memory transfers; it also handles QEMUIOVector copies. Introduce the NvmeTxDirection enum and rename to nvme_tx. Remove mapping of PRPs/SGLs from nvme_tx and instead assert that they have been mapped previously. This allows more fine-grained use in subsequent patches. Add new (better named) helpers, nvme_{c2h,h2c}, that does both PRP/SGL mapping and transfer. Signed-off-by:Klaus Jensen <k.jensen@samsung.com> Reviewed-by:
Keith Busch <kbusch@kernel.org>
Loading
Please register or sign in to comment