2 .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH SCSI_SYNC_PKT 9F "Jan 16, 2006"
8 scsi_sync_pkt \- synchronize CPU and I/O views of memory
12 #include <sys/scsi/scsi.h>
16 \fBvoid\fR \fBscsi_sync_pkt\fR(\fBstruct scsi_pkt *\fR\fIpktp\fR);
22 Solaris DDI specific (Solaris DDI).
30 Pointer to a \fBscsi_pkt\fR(9S) structure.
36 The \fBscsi_sync_pkt()\fR function is used to selectively synchronize a
37 \fBCPU\fR's or device's view of the data associated with the \fBSCSI\fR packet
38 that has been mapped for \fBI/O\fR. This may involve operations such as flushes
39 of \fBCPU\fR or \fBI/O\fR caches, as well as other more complex operations such
40 as stalling until hardware write buffers have drained.
43 This function need only be called under certain circumstances. When a
44 \fBSCSI\fR packet is mapped for \fBI/O\fR using \fBscsi_init_pkt\fR(9F) and
45 destroyed using \fBscsi_destroy_pkt\fR(9F), then an implicit
46 \fBscsi_sync_pkt()\fR will be performed. However, if the memory object has been
47 modified by either the device or a \fBCPU\fR after the mapping by
48 \fBscsi_init_pkt\fR(9F), then a call to \fBscsi_sync_pkt()\fR is required.
51 If the same scsi_pkt is reused for a data transfer from memory to a device,
52 then \fBscsi_sync_pkt()\fR must be called before calling
53 \fBscsi_transport\fR(9F). If the same packet is reused for a data transfer from
54 a device to memory \fBscsi_sync_pkt()\fR must be called after the completion of
55 the packet but before accessing the data in memory.
59 The \fBscsi_sync_pkt()\fR function may be called from user, interrupt, or
64 \fBtran_sync_pkt\fR(9E), \fBddi_dma_sync\fR(9F), \fBscsi_destroy_pkt\fR(9F),
65 \fBscsi_init_pkt\fR(9F), \fBscsi_transport\fR(9F), \fBscsi_pkt\fR(9S)
68 \fIWriting Device Drivers\fR