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

dma_get_next_sgentry(9r)

NAME

dma_get_next_sgentry - General: Returns a pointer to the current sg_entry and increments an index to point to the next

SYNOPSIS

#include <io/common/devdriver.h> sg_entry_t dma_get_next_sgentry( dma_handle_t dma_handle );

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.

DESCRIPTION

The dma_get_next_sgentry interface returns a pointer to a bus address/byte count pair from the in-kernel DMA mapping data structures. After each call to dma_get_next_sgentry, the interface increments an internal index variable. This increment operation ensures that the next call to dma_get_next_sgentry gets the next sg_entry pointer and thus the next bus address/byte count pair for this DMA handle. This contrasts with the dma_get_curr_sgentry interface, which does not perform an increment operation.

NOTES

Use of the dma_get_next_sgentry 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

On successful completion, dma_get_next_sgentry returns a pointer to the sg_entry structure associated with a mapped region of an I/O buffer on the controller's I/O bus. The dma_get_next_sgentry interface returns the value 0 (zero) to indicate that it has reached the end of the bus address/byte count pairs for this DMA handle.

SEE ALSO

Data Structures: sg_entry(9s) Kernel Interfaces: dma_get_curr_sgentry(9r)

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