Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

free_pktiopb(9f) [sunos man page]

get_pktiopb(9F) 					   Kernel Functions for Drivers 					   get_pktiopb(9F)

NAME
get_pktiopb, free_pktiopb - allocate/free a SCSI packet in the iopb map SYNOPSIS
#include <sys/scsi/scsi.h> struct scsi_pkt *get_pktiopb(struct scsi_address *ap, caddr_t *datap, int cdblen, int statuslen, int datalen, int readflag, int (*call- back); void free_pktiopb(struct scsi_pkt *pkt, caddr_t datap, int datalen); INTERFACE LEVEL
These interfaces are obsolete. Use scsi_alloc_consistent_buf(9F) instead of get_pktiopb(). Use scsi_free_consistent_buf(9F) instead of free_pktiopb(). PARAMETERS
ap Pointer to the target's scsi_address 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 NULL_FUNC or SLEEP_FUNC pkt Pointer to a scsi_pkt(9S) structure. DESCRIPTION
get_pktiopb() allocates a scsi_pkt structure that has a small data area allocated. It is used by some SCSI commands such as REQUEST_SENSE, which involve a small amount of data and require cache-consistent memory for proper operation. It uses ddi_iopb_alloc(9F) for allocating the data area and scsi_resalloc(9F) to allocate the packet and DMA resources. callback indicates what get_pktiopb() should do when resources are not available: NULL_FUNC Do not wait for resources. Return a NULL pointer. SLEEP_FUNC Wait indefinitely for resources. Other Values callback points to a function which is called when resources may have become available. callback must return either 0 (indicating 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 indicating that it no longer cares for a retry. free_pktiopb() is used for freeing the packet and its associated resources. RETURN VALUES
get_pktiopb() returns a pointer to the newly allocated scsi_pkt or a NULL pointer. CONTEXT
If callback is SLEEP_FUNC, then this routine may only be called from user-level code. Otherwise, it may be called from either user or interrupt level. The callback function may not block or call routines that block. free_pktiopb() can be called from user or interrupt context. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Stability Level |Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), ddi_iopb_alloc(9F), scsi_alloc_consistent_buf(9F), scsi_free_consistent_buf(9F), scsi_pktalloc(9F), scsi_resalloc(9F), scsi_pkt(9S) Writing Device Drivers NOTES
The get_pktiopb() and free_pktiopb() functions are obsolete and will be discontinued in a future release. These functions have been replaced by, respectively, scsi_alloc_consistent_buf(9F) and scsi_free_consistent_buf(9F). get_pktiopb() uses scarce resources. For this reason and its obsolescence (see above), its use is discouraged. SunOS 5.10 27 Sep 2002 get_pktiopb(9F)

Check Out this Related Man Page

scsi_dmaget(9F) 					   Kernel Functions for Drivers 					   scsi_dmaget(9F)

NAME
scsi_dmaget, scsi_dmafree - SCSI dma utility routines SYNOPSIS
#include <sys/scsi/scsi.h> struct scsi_pkt *scsi_dmaget(struct scsi_pkt *pkt, opaque_t dmatoken, int(*callback)(void)); void scsi_dmafree(struct scsi_pkt *pkt); INTERFACE LEVEL
These interfaces are obsolete. Use scsi_init_pkt(9F) instead of scsi_dmaget(). Use scsi_destroy_pkt(9F) instead of scsi_dmafree(). PARAMETERS
pkt A pointer to a scsi_pkt(9S) structure. dmatoken Pointer to an implementation dependent object callback Pointer to a callback function, or NULL_FUNC or SLEEP_FUNC. DESCRIPTION
scsi_dmaget() allocates DMA resources for an already allocated SCSI packet. pkt is a pointer to the previously allocated SCSI packet (see scsi_pktalloc(9F)). dmatoken is a pointer to an implementation dependent object which defines the length, direction, and address of the data transfer associ- ated with this SCSI packet (command). The dmatoken must be a pointer to a buf(9S) structure. If dmatoken is NULL, no resources are allo- cated. callback indicates what scsi_dmaget() should do when resources are not available: NULL_FUNC Do not wait for resources. Return a NULL pointer. SLEEP_FUNC Wait indefinitely for resources. Other Values callback points to a function which is called when resources may have become available. callback must return either 0 (indicating 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 indicating that it no longer cares for a retry. scsi_dmafree() frees the DMA resources associated with the SCSI packet. The packet itself remains allocated. RETURN VALUES
scsi_dmaget() returns a pointer to a scsi_pkt on success. It returns NULL if resources are not available. CONTEXT
If callback is SLEEP_FUNC, then this routine may only be called from user-level code. Otherwise, it may be called from either user or interrupt level. The callback function may not block or call routines that block. scsi_dmafree() can be called from user or interrupt context. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Stability Level |Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), scsi_pktalloc(9F), scsi_pktfree(9F), scsi_resalloc(9F), scsi_resfree(9F), buf(9S), scsi_pkt(9S) Writing Device Drivers NOTES
The scsi_dmaget() and scsi_dmafree() functions are obsolete and will be discontinued in a future release. These functions have been replaced by, respectively, scsi_init_pkt(9F) and scsi_destroy_pkt(9F). SunOS 5.10 27 Sep 2002 scsi_dmaget(9F)
Man Page