Kernel Functions for Drivers scsidmaget(9F)
NAME
scsidmaget, scsidmafree - SCSI dma utility routines
SYNOPSIS
#include
struct scsipkt *scsidmaget(struct scsipkt *pkt,
opaquet dmatoken, int(*callback)(void));
void scsidmafree(struct scsipkt *pkt);
INTERFACE LEVEL
These interfaces are obsolete. Use scsiinitpkt(9F) instead
of scsidmaget(). Use scsidestroypkt(9F) instead of
scsidmafree().
PARAMETERS
pkt A pointer to a scsipkt(9S) structure.
dmatoken Pointer to an implementation dependent object.
callback Pointer to a callback function, or NULFUNC or
SLEPFUNC.
DESCRIPTION
The scsidmaget() function allocates DMA resources for an
already allocated SCSI packet. pkt is a pointer to the pre-
viously allocated SCSI packet (see scsipktalloc(9F)).
The dmatoken parameter is a pointer to an implementation
dependent object which defines the length, direction, and
address of the data transfer associated with this SCSI
packet (command). The dmatoken must be a pointer to a
buf(9S) structure. If dmatoken is NUL, no resources are
allocated.
The callback parameter indicates what scsidmaget() should
do when resources are not available:
NULFUNC Do not wait for resources. Return a NUL
pointer.
SunOS 5.11 Last change: 16 Jan 2006 1
Kernel Functions for Drivers scsidmaget(9F)
SLEPFUNC Wait indefinitely for resources.
Other Values callback points to a function which is
called when resources may have become avail-
able. callback must return either 0 (indi-
cating that it attempted to allocate
resources but failed to do so again), in
which case it is put back on a list to be
called again later, or 1 indicating either
success in allocating resources or indicat-
ing that it no longer cares for a retry.
The scsidmafree() function frees the DMA resources associ-
ated with the SCSI packet. The packet itself remains allo-
cated.
RETURN VALUES
The scsidmaget() function returns a pointer to a scsipkt
on success. It returns NUL if resources are not available.
CONTEXT
If callback is SLEPFUNC, then this routine may only be
called from user or kernel context. Otherwise, it may be
called from user, kernel, or interrupt context. The callback
function may not block or call routines that block.
The scsidmafree() function can be called from user, inter-
rupt, or kernel context.
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Stability Level Obsolete
SEE ALSO
attributes(5), scsipktalloc(9F), scsipktfree(9F),
scsiresalloc(9F), scsiresfree(9F), buf(9S), scsipkt(9S)
SunOS 5.11 Last change: 16 Jan 2006 2
Kernel Functions for Drivers scsidmaget(9F)
Writing Device Drivers
NOTES
The scsidmaget() and scsidmafree() functions are obsolete
and will be discontinued in a future release. These func-
tions have been replaced by, respectively, scsiinitpkt(9F)
and scsidestroypkt(9F).
SunOS 5.11 Last change: 16 Jan 2006 3
|