Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scsi_sync_pkt(9f) [xfree86 man page]

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

scsi_sync_pkt - synchronize CPU and I/O views of memory SYNOPSIS
#include <sys/scsi/scsi.h> void scsi_sync_pkt(struct scsi_pkt *pktp); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
pktp Pointer to a scsi_pkt(9S) structure. DESCRIPTION
scsi_sync_pkt() is used to selectively synchronize a CPU's or device's view of the data associated with the SCSI packet that has been mapped for I/O. This may involve operations such as flushes of CPU or I/O caches, as well as other more complex operations such as stalling until hardware write buffers have drained. This function need only be called under certain circumstances. When a SCSI packet is mapped for I/O using scsi_init_pkt(9F) and destroyed using scsi_destroy_pkt(9F), then an implicit scsi_sync_pkt() will be performed. However, if the memory object has been modified by either the device or a CPU after the mapping by scsi_init_pkt(9F), then a call to scsi_sync_pkt() is required. If the same scsi_pkt is reused for a data transfer from memory to a device, then scsi_sync_pkt() must be called before calling scsi_trans- port(9F). If the same packet is reused for a data transfer from a device to memory scsi_sync_pkt() must be called after the completion of the packet but before accessing the data in memory. CONTEXT
scsi_sync_pkt() may be called from user or interrupt context. SEE ALSO
tran_sync_pkt(9E), ddi_dma_sync(9F), scsi_destroy_pkt(9F), scsi_init_pkt(9F), scsi_transport(9F), scsi_pkt(9S) Writing Device Drivers SunOS 5.10 25 Feb 1994 scsi_sync_pkt(9F)

Check Out this Related Man Page

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

scsi_transport - request by a SCSI target driver to start a command SYNOPSIS
#include <sys/scsi/scsi.h> int scsi_transport(struct scsi_pkt *pkt); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
pkt Pointer to a scsi_pkt(9S) structure. DESCRIPTION
Target drivers use scsi_transport() to request the host adapter driver to transport a command to the SCSI target device specified by pkt. The target driver must obtain resources for the packet using scsi_init_pkt(9F) prior to calling this function. The packet may be initial- ized using one of the makecom(9F) functions. scsi_transport() does not wait for the SCSI command to complete. See scsi_poll(9F) for a description of polled SCSI commands. Upon completion of the SCSI command the host adapter calls the completion routine provided by the target driver in the pkt_comp member of the scsi_pkt pointed to by pkt. RETURN VALUES
scsi_transport() returns: TRAN_ACCEPT The packet was accepted by the transport layer. TRAN_BUSY The packet could not be accepted because there was already a packet in progress for this target/lun, the host adapter queue was full, or the target device queue was full. TRAN_BADPKT The DMA count in the packet exceeded the DMA engine's maximum DMA size. TRAN_FATAL_ERROR A fatal error has occurred in the transport layer. CONTEXT
scsi_transport() can be called from user or interrupt context. EXAMPLES
Example 1: Using scsi_transport() if ((status = scsi_transport(rqpkt)) != TRAN_ACCEPT) { scsi_log(devp, sd_label, CE_WARN, "transport of request sense pkt fails (0x%x) ", status); } SEE ALSO
tran_start(9E), makecom(9F), scsi_init_pkt(9F), scsi_pktalloc(9F), scsi_poll(9F), scsi_pkt(9S) Writing Device Drivers SunOS 5.10 30 Aug 1995 scsi_transport(9F)
Man Page