Writing Device Drivers

Performing Bus-Master DMA Transfers

In general, the driver should perform the following steps for bus-master DMA.

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

  2. Allocate a DMA handle.

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

  4. Allocate DMA resources for the object.

  5. Program the DMA engine on the device and start it (this is device specific). When the transfer is complete, continue the bus master operation.

  6. Perform any required object synchronizations.

  7. Release the DMA resources.

  8. Free the DMA handle.