DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

udi_dma_prepare(3udi)


Prepare for DMA mapping

SYNOPSIS

#include <udi.h>

void udi_dma_prepare (

	udi_dma_prepare_call_t *callback,

	udi_cb_t *gcb,

	udi_dma_constraints_t constraints,

	udi_ubit8_t flags );
 
typedef void udi_dma_prepare_call_t (

	udi_cb_t *gcb,

	udi_dma_handle_t new_dma_handle );
 
/* Values for flags */
 
#define  UDI_DMA_OUT				(1U<<2)
 
#define  UDI_DMA_IN				(1U<<3)
 

ARGUMENTS callback, gcb are standard arguments described in the "Asynchronous Service Calls" section of "Standard Calling Sequences" in the UDI Core Specification.

constraints is a constraints handle for this device.

flags is a bitmask of flags indicating the direction(s) of transfers for which the handle will most likely be used:
UDI_DMA_OUT data transfer from memory to device
UDI_DMA_IN data transfer from device to memory

new_dma_handle is an opaque handle to the newly allocated DMA object.

DESCRIPTION udi_dma_prepare allocates a DMA handle that can be used to map UDI buffers for DMA transfer. In some cases DMA resources such as mapping registers will be pre-allocated at this time. The new DMA handle is passed to the driver with the callback.

It is intended that drivers avoid using udi_dma_prepare in the main I/O path. Where possible, it should be used at bind time, with many calls to udi_dma_buf_map being made for one call to udi_dma_prepare.

REFERENCES udi_dma_buf_map, udi_dma_free, udi_dma_constraints_t


UDI Physical I/O Specification Contents