Copyright (c) 1996, 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]
#include <sys/ddi.h> #include <sys/sunddi.h> int ddi_device_copy(ddi_acc_handle_t src_handle, caddr_t src_addr, ssize_t src_advcnt, ddi_acc_handle_t dest_handle, caddr_t dest_addr, ssize_t dest_advcnt, size_t bytecount, uint_t dev_datasz);
The data access handle of the source device.
Base data source address.
Number of dev_datasz units to advance on every access.
The data access handle of the destination device.
Base data destination address.
Number of dev_datasz units to advance on every access.
Number of bytes to transfer.
The size of each data word. Possible values are defined as: DDI_DATA_SZ01_ACC
1 byte data size
2 bytes data size
4 bytes data size
8 bytes data size
Data will automatically be translated to maintain a consistent view between the source and the destination. The translation may involve byte-swapping if the source and the destination devices have incompatible endian characteristics.
The src_advcnt and dest_advcnt arguments specifies the number of dev_datasz units to advance with each access to the device addresses. A value of 0 will use the same source and destination device address on every access. A positive value increments the corresponding device address by certain number of data size units in the next access. On the other hand, a negative value decrements the device address.
The dev_datasz argument determines the size of the data word on each access. The data size must be the same between the source and destination.
Successfully transferred the data.
The byte count is not a multiple dev_datasz.
Writing Device Drivers