Index Index for
Section 9
Index Alphabetical
listing for D
Bottom of page Bottom of
page

dma_map_unload(9r)

NAME

dma_map_unload - General: Unloads the system DMA resources

SYNOPSIS

#include <io/common/devdriver.h> int dma_map_unload( int flags, dma_handle_t dma_handle );

ARGUMENTS

flags To cause a deallocation of DMA mapping resources, you set the first argument to the special condition bit DMA_DEALLOC. This bit setting is analogous to setting the dma_handle_p argument to the value zero (0) for dma_map_load to allocate the DMA mapping resources. dma_handle Specifies a handle to DMA resources associated with the mapping of an in-memory I/O buffer onto a controller's I/O bus. This handle provides the information to access bus address/byte count pairs. A bus address/byte count pair is represented by the ba and bc members of an sg_entry structure pointer. Device driver writers can view the DMA handle as the tag to the allocated system resources needed to perform a DMA operation.

DESCRIPTION

The dma_map_unload interface unloads (invalidates) the resources that were loaded and set up in a previous call to dma_map_load. A call to dma_map_unload does not release or deallocate the resources that were allocated in a previous call to dma_map_alloc unless the driver sets the flags argument to the DMA_DEALLOC bit.

NOTES

Use of the dma_map_unload interface makes device drivers more portable between DMA hardware-mapping implementations across different hardware platforms because it masks out any future changes in the kernel- and system-level DMA mapping data structures.

EXAMPLE

See Writing Device Drivers: Tutorial for a code example of the dma_map_unload interface.

RETURN VALUES

Upon successful completion, dma_map_unload returns the value 1. Otherwise, it returns the value zero (0).

SEE ALSO

Kernel Interfaces: dma_map_alloc(9r), dma_map_dealloc(9r), dma_map_load(9r) Data Structures: sg_entry(9s)

Index Index for
Section 9
Index Alphabetical
listing for D
Top of page Top of
page