After creating and filling in the scsi_pkt(9S) structure, the final step is to hand it to the host bus adapter driver using scsi_transport(9F):
if (scsi_transport(pkt) != TRAN_ACCEPT) { bp->b_resid = bp->b_bcount; bioerror(bp, EIO); biodone(bp); }
The other return values from scsi_transport(9F) are:
TRAN_BUSY - There is already a command in progress for the specified target.
TRAN_BADPKT - The DMA count in the packet was too large, or the host adapter driver rejected this packet for other reasons.
TRAN_FATAL_ERROR - The host adapter driver is unable to accept this packet.
The mutex sd_mutex in the scsi_device(9S) structure must not be held across a call to scsi_transport(9F).
If scsi_transport(9F) returns TRAN_ACCEPT, the packet is the responsibility of the host bus adapter driver and should not be accessed by the target driver until the command completion routine is called.
If FLAG_NOINTR is set in the packet, then scsi_transport(9F) will not return until the command is complete, and no callback will be performed.
FLAG_NOINTR should never be used in interrupt context.