 |
Index for Section 9 |
|
 |
Alphabetical listing for D |
|
 |
Bottom of page |
|
dma_get_private(9r)
NAME
dma_get_private - General: Gets a data element from the DMA private storage
space
SYNOPSIS
#include <io/common/devdriver.h>
int dma_get_private(
dma_handle_t dma_handle,
int index,
u_long *data );
ARGUMENTS
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.
index
Specifies an index to the DMA private storage area for an internal
kernel data structure associated with this DMA handle. Currently, you
can pass only the value zero (0) as the index.
data
Specifies the address of the location to retrieve the 64-bit data
element from the DMA private storage area. You put this 64-bit data
element in the DMA private storage area in a previous call to
dma_put_private.
DESCRIPTION
The dma_get_private interface retrieves a 64-bit data element from the DMA
private storage area of the internal kernel data structure associated with
the specified DMA handle. Device drivers can put a 64-bit data element in
the DMA private storage area of this internal kernel data structure by
calling dma_put_private. Currently, the internal kernel data structure
provides only one member to store a 64-bit data element.
DMA engines that make multiple calls to dma_map_alloc and dma_map_load can
use the dma_get_private and dma_put_private pair of interfaces. Each call
to dma_map_alloc and dma_map_load returns the address of the allocated DMA
handle. The device driver calls dma_put_private to store each returned
address as the 64-bit data element in each internal kernel data structure's
DMA private storage area. By storing each address as the 64-bit data
element in each internal kernel data structure's DMA private storage area,
the device driver creates a linked list of DMA handles that it can pass to
some lower software layer. This lower software layer then calls
dma_get_private to retrieve the resources contained in the linked list of
DMA handles.
NOTES
Use of the dma_get_private 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.
RETURN VALUES
Upon successful completion, dma_get_private returns the value zero (0). If
the index to the private storage area is greater than zero (0),
dma_get_private returns the value 1, indicating a failure status.
SEE ALSO
Kernel Interfaces: dma_put_private(9r)
Data Structures: sg_entry(9s)
 |
Index for Section 9 |
|
 |
Alphabetical listing for D |
|
 |
Top of page |
|