DMA_PARAM(K) UNIX System V DMA_PARAM(K)
Name
dma_param - sets up a DMA controller chip for DMA transfer
Syntax
#include "sys/dma.h"
int
dma_param(chan, mode, addr, cnt)
unsigned chan, mode;
paddr_t addr;
long cnt;
Description
This routine sets up the controller chip for a DMA transfer.
The dma_param routine masks the DMA request line on the DMA
controller. Only call dma_param after a DMA channel has
been allocated for the driver by dma_alloc(K) or
dma_start(K). 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. The dma_param routine has
no return value.
Parameters
The chan argument 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 for which channels are in use. Use
printcfg in your driver initialization routine to display
the DMA channel that you select.
The mode argument specifies whether this is a read or write
transfer. The options are:
+ DMA_Rdmode (0x44). This option specifies a transfer
from a device to memory.
+ DMA_Wrmode (0x48). This option specifies a transfer
from memory to a device.
The addr argument specifies the address where the data is
copied from or to.
The cnt argument specifies the number of bytes or words to
transfer.
Example
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 );
.
.
}
See Also
dma_enable(K), dma_start(K), dma_relse(K), dma_alloc(K),
dma_resid(K), printcfg(K)
(printed 7/6/89)