 |
Index for Section 9 |
|
 |
Alphabetical listing for V |
|
 |
Bottom of page |
|
vba_dma(9r)
NAME
vba_dma - VMEbus: Performs Master Block Transfers with local DMA
SYNOPSIS
#include <io/dec/vme/vbareg.h>
u_long vba_dma(
struct controller *ctlr_p,
dma_handle_t dma_handle );
ARGUMENTS
ctlr_p
Specifies a pointer to the VMEbus device's controller data structure.
The routine uses this pointer to obtain bus-specific routines and data
structures that it needs to perform the Master Block Transfer (MBLT)
data transfer.
dma_handle
Specifies a handle to DMA resources associated with the mapping of an
in-memory I/O buffer onto the VMEbus.
DESCRIPTION
If the VMEbus adapter provides a master block transfer local DMA engine,
the vba_dma() routine performs the transfer through DMA. If the hardware
does not support a local DMA engine, vba_dma() either performs the transfer
through programmed I/O or returns an error indication.
The VMEbus adapter support code may segment the transfer depending on the
block-mode DMA hardware limitations. Further segmentation may occur
depending on the amount of physically contiguous memory pages found in the
virtual buffer supplied to dma_map_load().
NOTES
You must invoke the following routines with the appropriate specification
of flags:
· vba_set_dma_addr()
Specify the VMEbus and DMA flags along with the VMEbus address. You
must uniquely specify the flags DMA_IN (read from VMEbus to memory) or
DMA_OUT (write from memory to VMEbus). These flag bits indicate to
dma_map_alloc() and dma_map_load() that a local DMA engine will be
used.
· dma_map_alloc()
Allocates resources for DMA data transfers.
· dma_map_load()
Loads and sets allocated DMA resources and sets up a DMA data path for
DMA data transfers.
· vba_dma()
Performs the actual DMA or I/O copy transfer.
· dma_map_unload()
Unloads the system DMA resources.
· dma_map_dealloc()
Releases and deallocates the DMA resources previously allocated for
DMA data transfers.
RETURN VALUES
Upon successful completion, vba_dma() returns the number of bytes
transferred. This value should agree with the byte count value specified in
the call to dma_map_load(). If it does not, then an error occurred during
the transfer.
If you specify DMA_SLEEP in the flags argument of either dma_map_alloc() or
dma_map_load(), then vba_dma() will wait for the DMA resource if it is
currently active. Access to the DMA hardware is single threaded at this
point. If you do not specify DMA_SLEEP and vba_dma() is active, the value
-1 is returned to indicate that vba_dma() is active. The value -1 is also
returned if the VMEbus adapter does not supply support code for this
function.
EXAMPLE
See the description of master block transfers with local DMA in the System
Configuration Supplement: OEM Platforms for an example of the use of
vba_dma(). Also, the driver example chapter of Writing VMEbus Device
Drivers shows how the dmaex example device driver calls vba_dma() to
initiate block DMA transfers.
SEE ALSO
Data Structures: controller(9s)
Kernel Routines: dma_map_alloc(9r), dma_map_dealloc(9r), dma_map_load(9r),
dma_map_unload(9r), vba_set_dma_addr(9r)
 |
Index for Section 9 |
|
 |
Alphabetical listing for V |
|
 |
Top of page |
|