7. Code Migration Reference (continued)
The code snippets shown below highlight the core functionality to illustrate the similarities and differences between QDMA and MDB5 DMA implementations.
7.2 Driver Code
7.2.1 Module Initialization
Both drivers follow standard Linux module initialization patterns. QDMA initializes its custom libqdma framework and netlink interface for queue management, while MDB5 DMA integrates with the DMAEngine framework using dma_request_channel() to discover available DMA channels.
| QDMA (driver/src/qdma_mod.c) | MDB5 DMA (client-driver/mdb5-dmaclient-mod.c) |
|---|---|
|
|
7.2.2 Channel Discovery
QDMA creates queues dynamically via netlink commands. MDB5 discovers channels from the static or loadable module dw-edma controller using DMAEngine API.
| QDMA (driver/src/nl.c - xnl_q_add) | MDB5 DMA (client-driver/mdb5-dmaclient-mod.c) |
|---|---|
|
|
7.2.3 DMA Transfer Preparation
QDMA uses custom scatter-gather and request submission through libqdma. MDB5 uses standard DMAEngine dmaengine_prep_slave_sg().
| QDMA (driver/src/cdev.c, driver/libqdma/libqdma_export.c) | MDB5 DMA (client-driver/mdb5-dmaclient-cdev.c) |
|---|---|
|
|
7.2.4 Request Submission
QDMA submits requests through qdma_request_submit() in libqdma. MDB5 uses standard DMAEngine dmaengine_submit() and dma_async_issue_pending().
| QDMA (driver/libqdma/libqdma_export.c, driver/src/cdev.c) | MDB5 DMA (client-driver/mdb5-dmaclient-cdev.c) |
|---|---|
|
|