Kernel Functions for Drivers getpktiopb(9F)
NAME
getpktiopb, freepktiopb - allocate/free a SCSI packet in
the iopb map
SYNOPSIS
#include
struct scsipkt *getpktiopb(struct scsiaddress *ap,
caddrt *datap, int cdblen, int statuslen, int datalen,
int readflag, int (*callback);
void freepktiopb(struct scsipkt *pkt, caddrt datap, int datalen);
INTERFACE LEVEL
These interfaces are obsolete. Use
scsiallocconsistentbuf(9F) instead of getpktiopb(). Use
scsifreeconsistentbuf(9F) instead of freepktiopb().
PARAMETERS
ap Pointer to the target's scsiaddress structure.
datap Pointer to the address of the packet, set by
this function.
cdblen Number of bytes required for the SCSI command
descriptor block (CDB).
statuslen Number of bytes required for the SCSI status
area.
datalen Number of bytes required for the data area of
the SCSI command.
readflag If non-zero, data will be transferred from the
SCSI target.
callback Pointer to a callback function, or NULFUNC or
SLEPFUNC
pkt Pointer to a scsipkt(9S) structure.
SunOS 5.11 Last change: 16 Jan 2006 1
Kernel Functions for Drivers getpktiopb(9F)
DESCRIPTION
The getpktiopb() function allocates a scsipkt structure
that has a small data area allocated. It is used by some
SCSI commands such as REQUESTSENSE, which involve a small
amount of data and require cache-consistent memory for
proper operation. It uses ddiiopballoc(9F) for allocating
the data area and scsiresalloc(9F) to allocate the packet
and DMA resources.
callback indicates what getpktiopb() should do when
resources are not available:
NULFUNC Do not wait for resources. Return a NUL
pointer.
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 freepktiopb() function is used for freeing the packet
and its associated resources.
RETURN VALUES
The getpktiopb() function returns a pointer to the newly
allocated scsipkt or a NUL pointer.
CONTEXT
If callback is SLEPFUNC, then this routine can be called
only from user or kernel context. Otherwise, it can be
called from user, interrupt, or kernel context. The callback
function should not block or call routines that block.
The freepktiopb() function can be called from user, inter-
rupt, or kernel context.
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
SunOS 5.11 Last change: 16 Jan 2006 2
Kernel Functions for Drivers getpktiopb(9F)
ATRIBUTE TYPE ATRIBUTE VALUE
Stability Level Obsolete
SEE ALSO
attributes(5), ddiiopballoc(9F),
scsiallocconsistentbuf(9F), scsifreeconsistentbuf(9F),
scsipktalloc(9F), scsiresalloc(9F), scsipkt(9S)
Writing Device Drivers
NOTES
The getpktiopb() and freepktiopb() functions are obsolete
and will be discontinued in a future release. These func-
tions have been replaced by, respectively,
scsiallocconsistentbuf(9F) and
scsifreeconsistentbuf(9F).
The getpktiopb() function uses scarce resources. For this
reason and its obsolescence (see above), its use is
discouraged.
SunOS 5.11 Last change: 16 Jan 2006 3
|