Writing Device Drivers

Performing Bus-Master DMA Transfers

The driver should perform the following steps for bus-master DMA.

  1. Describe the DMA attributes. This step enables the routines to ensure that the device is able to access the buffer.

  2. Allocate a DMA handle.

  3. Ensure that the DMA object is locked in memory. See the physio(9F) or ddi_umem_lock(9F) man page.

  4. Allocate DMA resources for the object.

  5. Program the DMA engine on the device.

  6. Start the engine.

  7. When the transfer is complete, continue the bus master operation.

  8. Perform any required object synchronizations.

  9. Release the DMA resources.

  10. Free the DMA handle.