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

dma_put_curr_sgentry(9r)

NAME

dma_put_curr_sgentry - General: Puts a new bus address/byte count pair in the linked list of sg_entry structures

SYNOPSIS

#include <io/common/devdriver.h> int dma_put_curr_sgentry( dma_handle_t dma_handle, sg_entry_t sg_entryp );

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. sg_entryp Specifies a pointer to the sg_entry structure that contains the bus address/byte count values to replace the corresponding bus address/byte count of the sg_entry structure associated with this DMA handle. You set the bus address/byte count in the ba and bc members of the sg_entry structure and then pass its address to dma_put_curr_sgentry.

DESCRIPTION

The dma_put_curr_sgentry interface puts new bus address/byte count values into the ba and bc members for the existing bus address/byte count pair pointed to by the DMA handle passed in by you. This interface enables device drivers to patch an existing bus address/byte count pair due to an unexpected interruption in a DMA transfer. A bus address/byte count pair is represented by the ba and bc members of an sg_entry structure pointer. This interface is useful for DMA engines that do not have total control of a DMA transfer. For example, a SCSI device doing an unexpected disconnect in the middle of a block transfer can interrupt a SCSI controller. Such a disconnect can require the driver to do one or more patches to the list of bus address/byte count pairs in order to restart the DMA transfer (without starting from the beginning of the list). Device drivers call the dma_put_curr_sgentry and dma_put_prev_sgentry interfaces to accomplish these patch operations. Typically, only buses that do not have byte atomicity transfers (for example, the TURBOchannel bus on Alpha CPUs) require these patch operations.

RETURN VALUES

Upon successful completion, dma_put_curr_sgentry returns the value 1. Otherwise, dma_put_curr_sgentry returns the value zero (0) to indicate a failure. This failure indicates that the index into the DMA handle points past the end of the last bus address/byte count pair. The DMA handle can point past the end of the valid portion of the list when the previous call to dma_get_next_sgentry returned the pointer to the DMA handle associated with the last byte address/byte count pair.

EXAMPLE

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

SEE ALSO

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

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