udi_dma_mem_to_buf(3udi)


Convert DMA-mapped control memory into a buffer

SYNOPSIS

#include <udi.h>

void udi_dma_mem_to_buf (

	udi_dma_mem_to_buf_call_t *callback,

	udi_cb_t *gcb,

	udi_dma_handle_t dma_handle,

	udi_size_t src_off,

	udi_size_t src_len,

	udi_buf_t *dst_buf );
 
typedef void udi_dma_mem_to_buf_call_t (

	udi_cb_t *gcb,

	udi_buf_t *new_dst_buf );
 

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

dma_handle is a DMA handle previously allocated by udi_dma_mem_alloc.

src_off is the beginning offset from the first byte of the shared control structure memory to include in the destination buffer.

src_len is the number of bytes to include from the destination buffer.

dst_buf is the same argument as used in udi_buf_copy.

new_dst_buf is a pointer to a UDI buffer containing the indicated data.

DESCRIPTION udi_dma_mem_to_buf frees a DMA handle and any associated resources allocated by udi_dma_mem_alloc, except the data from the indicated range of the memory block are used as the initial contents of a newly-allocated buffer.

The constraints that were used to allocate dma_handle shall also be used to allocate new_dst_buf.

udi_dma_mem_to_buf is typically used for inbound data from devices that store both shared control structures and data in the same piece of memory.

references udi_dma_mem_alloc, udi_buf_write


UDI Physical I/O Specification Contents