2 .\" Copyright (c) 1996, 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 DDI_DEVICE_COPY 9F "Nov 15, 1996"
8 ddi_device_copy \- copy data from one device register to another device
14 #include <sys/sunddi.h>
18 \fBint\fR \fBddi_device_copy\fR(\fBddi_acc_handle_t\fR \fIsrc_handle\fR, \fBcaddr_t\fR \fIsrc_addr\fR,
19 \fBssize_t\fR \fIsrc_advcnt\fR, \fBddi_acc_handle_t\fR \fIdest_handle\fR,
20 \fBcaddr_t\fR \fIdest_addr\fR, \fBssize_t\fR \fIdest_advcnt\fR,
21 \fBsize_t\fR \fIbytecount\fR, \fBuint_t\fR \fIdev_datasz\fR);
27 Solaris DDI specific (Solaris DDI).
32 \fB\fIsrc_handle\fR \fR
35 The data access handle of the source device.
44 Base data source address.
50 \fB\fIsrc_advcnt\fR \fR
53 Number of \fIdev_datasz\fR units to advance on every access.
59 \fB\fIdest_handle\fR \fR
62 The data access handle of the destination device.
68 \fB\fIdest_addr\fR \fR
71 Base data destination address.
77 \fB\fIdest_advcnt\fR \fR
80 Number of \fIdev_datasz\fR units to advance on every access.
86 \fB\fIbytecount\fR \fR
89 Number of bytes to transfer.
95 \fB\fIdev_datasz\fR \fR
98 The size of each data word. Possible values are defined as:
102 \fB\fBDDI_DATA_SZ01_ACC\fR \fR
111 \fB\fBDDI_DATA_SZ02_ACC\fR \fR
120 \fB\fBDDI_DATA_SZ04_ACC\fR \fR
129 \fB\fBDDI_DATA_SZ08_ACC\fR \fR
140 \fBddi_device_copy()\fR copies \fIbytecount\fR bytes from the source address,
141 \fIsrc_addr\fR, to the destination address, \fIdest_addr\fR. The attributes
142 encoded in the access handles, \fIsrc_handle\fR and \fIdest_handle\fR, govern
143 how data is actually copied from the source to the destination. Only matching
144 data sizes between the source and destination are supported.
147 Data will automatically be translated to maintain a consistent view between
148 the source and the destination. The translation may involve byte-swapping if
149 the source and the destination devices have incompatible endian
153 The \fIsrc_advcnt\fR and \fIdest_advcnt\fR arguments specifies the number of
154 \fIdev_datasz\fR units to advance with each access to the device addresses. A
155 value of \fB0\fR will use the same source and destination device address on
156 every access. A positive value increments the corresponding device address by
157 certain number of data size units in the next access. On the other hand, a
158 negative value decrements the device address.
161 The \fIdev_datasz\fR argument determines the size of the data word on each
162 access. The data size must be the same between the source and destination.
166 \fBddi_device_copy()\fR returns:
170 \fB\fBDDI_SUCCESS\fR \fR
173 Successfully transferred the data.
179 \fB\fBDDI_FAILURE\fR \fR
182 The byte count is not a multiple \fIdev_datasz\fR.
188 \fBddi_device_copy()\fR can be called from user, kernel, or interrupt context.
192 \fBddi_regs_map_free\fR(9F), \fBddi_regs_map_setup\fR(9F)
195 \fIWriting Device Drivers\fR