'\" te .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .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 \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\fR