struct scsi_pkt *prefixtran_init_pkt(
struct scsi_address *ap,
struct scsi_pkt *pkt,
struct buf *bp, int cmdlen, int statuslen, int tgtlen, int flags, int (*callback)(caddr_t),
void prefixtran_destroy_pkt(struct scsi_address *ap, struct scsi_pkt *pkt);
Solaris architecture specific (Solaris DDI).
If bp is non-NULL, the HBA driver must allocate appropriate DMA resources for the pkt, for example, via ddi_dma_buf_setup.9f
If the PKT_CONSISTENT bit is set in flags, the buffer was allocated by scsi_alloc_consistent_buf.9f For packets marked with PKT_CONSISTENT the HBA driver must synchronize any cached data transfers before calling the target driver's command completion callback.
If the PKT_DMA_PARTIAL bit is set in flags, the HBA driver should set up partial data transfers, such as setting the DDI_DMA_PARTIAL bit in the flags argument if interfaces such as ddi_dma_buf_setup.9f are used.
If only partial DMA resources are available, tran_init_pkt() must return in the pkt_resid field of pkt the number of bytes of DMA resources not allocated.
If both pktp and bp are non-NULL, the PKT_DMA_PARTIAL bit is set in flags and DMA resources have already been allocated for the pkt with a previous call to tran_init_pkt() that returned a non-zero pkt_resid field, this request is to move the DMA resources for the subsequent piece of the transfer.
The contents of scsi_address.9s pointed to by ap are copied into the pkt_address field of the scsi_pkt.9s by scsi_hba_pkt_alloc.9f
tgtlen is the length of the packet private area in the scsi_pkt structure to be allocated on behalf of the SCSI target driver.
statuslen is the required length for the SCSI status completion block. If the requested status length is greater than or equal to sizeof(struct scsi_arq_status) and the auto_rqsense capability has been set, automatic request sense is enabled for this packet. If the status length is less than sizeof(struct scsi_arq_status), automatic request sense must be disabled for this pkt.
cmdlen is the required length for the SCSI command descriptor block.
Note: tgtlen, statuslen, and cmdlen are used only when the HBA driver allocates the scsi_pkt.9s in other words, when pkt is NULL.
callback indicates what the allocator routines should do when resources are not available:
tran_init_pkt() must return a pointer to a scsi_pkt.9s structure on success, or NULL on failure.
If pkt is NULL on entry, and tran_init_pkt() allocated a pkt via scsi_hba_pkt_alloc.9f but was unable to allocate DMA resources, tran_init_pkt() must free the pkt via scsi_hba_pkt_free.9f before returning NULL.
If a DMA allocation request fails with DDI_DMA_NOMAPPING, the B_ERROR flag should be set in bp, and the b_error field should be set to EFAULT.
If a DMA allocation request fails with DDI_DMA_TOOBIG, the B_ERROR flag should be set in bp, and the b_error field should be set to EINVAL.
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97