DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

dma_param(D3oddi)


dma_param -- set up a DMA controller chip for DMA transfer

Synopsis

   #include <sys/dma.h>
   

void dma_param(unsigned chan, unsigned mode, paddr_t addr, long cnt);

Description

The dma_param( ) routine sets up the registers of the controller chip for a DMA transfer. This routine masks the DMA request line on the DMA controller.

Arguments


chan
Specifies the DMA channel to be used. Possible values are:

8-bit channels:
DMA_CH0, DMA_CH1, DMA_CH2, DMA_CH3

16-bit channels:
DMA_CH5, DMA_CH6, DMA_CH7
Channel 4 is not available. Other channels may be permanently allocated by system drivers. Consult the /usr/adm/messages file to determine which channels are in use. Use printcfg(D3oddi) in your driver initialization routine to display the DMA channel that you select.

mode
Specifies whether this is a read or write transfer. Valid values are:

DMA_Rdmode
transfer from a device to memory.

DMA_Wrmode
transfer from memory to a device.

addr
Specifies the address where the data is copied from or to.

cnt
Specifies the number of bytes or words to transfer.

Return values

None.

Usage

Only call dma_param after a DMA channel has been allocated for the driver by the dma_alloc(D3oddi) or dma_start(D3oddi) function. In the case of a driver using dma_start, dma_param is called by the routine pointed to by the d_proc member of the dmareq structure.

There is no support for I/O address programming in dma_param for PS/2 adapters using Extended Mode DMA; this must be done by the driver instead.

Context and synchronization

Non-blockable, interrupt, user, or blockable context.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

This function is not supported for DDI drivers. See ``DMA'' in HDK Technical Reference for informationa about doing DMA transfers in DDI drivers.

References

dma_enable(D3oddi), dma_start(D3oddi), dma_relse(D3oddi), dma_alloc(D3oddi), dma_resid(D3oddi), printcfg(D3oddi)

``ODDI driver interface version for SCO OpenServer 5'' in HDK Technical Reference

Examples

For example, the function mentioned in the example for dma_start, foo_proc, might contain this code:
   foo_proc( dp )
   struct dmareq *dp;
   {
           .
           .
           dma_param(dp->d_chan, dp->d_mode, dp->d_addr, dp->d_cnt);
           dma_enable( dp->d_chan );
           .
           .
   }

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005