NAME

vme_dma_write - Writes data to the VMEbus using DMA.

SYNOPSIS

int vme_dma_write ( vme_bus_handle_t bus_handle, vme_dma_handle_t dma_handle, unsigned long offset, uint64_t vme_addr, int am, size_t nbytes, int flags )

PARAMETERS

vme_bus_handle_t bus_handle

Handle allocated by vme_init.

vme_dma_handle_t dma_handle

Handle to a DMA buffer allocated by vme_dma_buffer_create.

unsigned long offset

Offset from the buffer base address. The first byte of data read is stored at this address.

uint64_t vme_addr

VMEbus address.

int am

Address modifier. Possible values are:

- VME_A16S - Short supervisory access.
- VME_A16U - Short nonprivileged access
- VME_A24SB - Standard supervisory block transfer
- VME_A24SD - Standard supervisory data access
- VME_A24SMB - Standard supervisory multiplex block transfer
- VME_A24SP - Standard supervisory program access
- VME_A24UB - Standard nonprivileged block transfer
- VME_A24UD - Standard nonprivileged data access
- VME_A24UMB - Standard nonprivileged multiplex block transfer
- VME_A24UP - Standard nonprivileged program access
- VME_A32SB - Extended supervisory block transfer
- VME_A32SD - Extended supervisory data access
- VME_A32SMB - Extended supervisory multiplex block transfer
- VME_A32SP - Extended supervisory program access
- VME_A32UB - Extended nonprivileged block transfer
- VME_A32UD - Extended nonprivileged data access
- VME_A32UMB - Extended nonprivileged multiplex block transfer
- VME_A32UP - Extended nonprivileged program access
size_t nbytes

Number of bytes of data to transfer.

int flags

Flags used to indicate special transfer features. The value specified will be an "OR" of the following possible values for the Tundra Universe II device.

- VME_DMA_64_BIT - Enable 64-bit PCI bus transfers

One of the following data widths can be used. If a data width is not specified, a default value is chosen based on the address modifier.

- VME_DMA_DW_8
- VME_DMA_DW_16
- VME_DMA_DW_32
- VME_DMA_DW_64

One of the following settings of the VON counter can be used, to indicates how many bytes of data to transfer before the bus is released. If a flag is not specified, the bus is held until the transfer completes.

- VME_DMA_VON_256
- VME_DMA_VON_512
- VME_DMA_VON_1024
- VME_DMA_VON_2048
- VME_DMA_VON_4096
- VME_DMA_VON_8192
- VME_DMA_VON_16384

One of the following settings of the VOFF counter can be used, to indicates how many microseconds to wait before reaquiring the bus. If a flag is not specified, the bus is immediately re-requested.

- VME_DMA_VOFF_16
- VME_DMA_VOFF_32
- VME_DMA_VOFF_64
- VME_DMA_VOFF_128
- VME_DMA_VOFF_256
- VME_DMA_VOFF_512
- VME_DMA_VOFF_1024
- VME_DMA_VOFF_2000
- VME_DMA_VOFF_4000
- VME_DMA_VOFF_8000

DESCRIPTION

Writes data to the VMEbus using DMA.

RETURNS

0 on success, or -1 on failure.

NOTES

Not all max data widths are available for all address modifiers.

The default max data width is the maximum width available for the given address modifier.

SEE ALSO

vme_dma_buffer_create(3), vme_dma_buffer_map(3), vme_dma_buffer_phys_addr(3), vme_dma_buffer_release(3), vme_dma_buffer_unmap(3), vme_dma_read(3)