dma_swsetup(D3) dma_swsetup(D3)
NAME
dma_swsetup - program a DMA operation for a subsequent
software request
SYNOPSIS
#include <sys/types.h>
#include <sys/dma.h>
#include <sys/ddi.h>
int dma_swsetup(struct dma_cb *dmacbptr, int chan, uchar_t mode);
Arguments
dmacbptr Pointer to the DMA command block specifying the DMA
operation.
chan DMA channel over which the operation is to take
place.
mode Specifies whether the caller is willing to sleep
waiting to allocate desired DMA channel.
DESCRIPTION
dma_swsetup programs the DMA channel chan for the operation
specified by the DMA command block whose address is given by
dmacbptr.
Return Values
dma_swsetup returns the value TRUE on success and returns the
value FALSE otherwise.
USAGE
dma_swsetup does not initiate the DMA transfer. Instead, the
transfer will be initiated by a subsequent request initiated
via software by dma_swstart(D3). If dma_swsetup programs the
operation successfully, it then calls the procedure specified
by the proc field of the dma_cb(D4) structure. It passes as
an argument the value in the procparms field. If proc is set
to NULL, then no routine is called.
To program the operation, dma_swsetup requires exclusive use
of the specified DMA channel. The caller may specify, via the
mode argument, whether dma_swsetup should sleep waiting for a
busy channel to become available. If the specified channel is
in use and mode is set to DMA_SLEEP, then dma_swsetup will
sleep until the channel becomes available for its use.
Otherwise, if DMA_NOSLEEP is specified and the requested
channel is not immediately available, dma_swsetup will not
Copyright 1994 Novell, Inc. Page 1
dma_swsetup(D3) dma_swsetup(D3)
program the channel, but will simply return a value of FALSE.
Level
Base only if either (1) mode is set to DMA_SLEEP or (2) the
routine specified by the proc field of the dma_cb structure
sleeps.
Initialization, Base or Interrupt otherwise.
Synchronization Constraints
May sleep if mode is set to DMA_SLEEP or if the routine
specified by the proc field of the dma_cb structure sleeps.
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
REFERENCES
dma_swstart(D3), dma_stop(D3), dma_cb(D4)
NOTICES
Portability
AT-compatible architectures
Applicability
ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp
Future Directions
This interface is expected to be replaced or modified in a
future release.
Copyright 1994 Novell, Inc. Page 2