Current File : //usr/share/man/man9f/scsi_sync_pkt.9f
'\" te
.\"  Copyright (c) 2006, Sun Microsystems, Inc.,  All Rights Reserved
.TH scsi_sync_pkt 9F "16 Jan 2006" "SunOS 5.11" "Kernel Functions for Drivers"
.SH NAME
scsi_sync_pkt \- synchronize CPU and I/O views of memory
.SH SYNOPSIS
.LP
.nf
#include <sys/scsi/scsi.h>

\fBvoid\fR \fBscsi_sync_pkt\fR(\fBstruct scsi_pkt *\fR\fIpktp\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
Solaris DDI specific (Solaris DDI).
.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIpktp\fR\fR
.ad
.RS 8n
.rt  
Pointer to a \fBscsi_pkt\fR(9S) structure.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBscsi_sync_pkt()\fR function is used to selectively synchronize a \fBCPU\fR's or device's view of the data associated with the \fBSCSI\fR packet that has been mapped for \fBI/O\fR. This may involve operations such as flushes of \fBCPU\fR or \fBI/O\fR caches, as well as other more complex operations such as stalling until hardware write buffers have drained.
.sp
.LP
This function need only be called under certain circumstances. When a \fBSCSI\fR packet is mapped for \fBI/O\fR using \fBscsi_init_pkt\fR(9F) and destroyed using \fBscsi_destroy_pkt\fR(9F), then an implicit \fBscsi_sync_pkt()\fR will be performed. However, if the memory object has been modified by either the device or a \fBCPU\fR after the mapping by \fBscsi_init_pkt\fR(9F), then a call to \fBscsi_sync_pkt()\fR is required.
.sp
.LP
If the same scsi_pkt is reused for a data transfer from memory to a device, then \fBscsi_sync_pkt()\fR must be called before calling \fBscsi_transport\fR(9F). If the same packet is reused for a data transfer from a device to memory \fBscsi_sync_pkt()\fR must be called after the completion of the packet but before accessing the data in memory.
.SH CONTEXT
.sp
.LP
The \fBscsi_sync_pkt()\fR function may be called from user, interrupt, or kernel context.
.SH SEE ALSO
.sp
.LP
\fBtran_sync_pkt\fR(9E), \fBddi_dma_sync\fR(9F), \fBscsi_destroy_pkt\fR(9F), \fBscsi_init_pkt\fR(9F), \fBscsi_transport\fR(9F), \fBscsi_pkt\fR(9S)
.sp
.LP
\fIWriting Device Drivers for Oracle Solaris 11.2\fR