2 .\" Copyright (c) 2000 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_DMA_COOKIE 9S "Sep 30, 1996"
8 ddi_dma_cookie \- DMA address cookie
12 #include <sys/sunddi.h>
18 Solaris DDI specific (Solaris DDI).
22 The \fBddi_dma_cookie_t\fR structure contains \fBDMA\fR address information
23 required to program a \fBDMA\fR engine. The structure is filled in by a call to
24 \fBddi_dma_getwin\fR(9F), \fBddi_dma_addr_bind_handle\fR(9F), or
25 \fBddi_dma_buf_bind_handle\fR(9F), to get device-specific \fBDMA\fR transfer
26 information for a \fBDMA\fR request or a \fBDMA\fR window.
33 uint64_t _dmac_ll; /* 64 bit DMA add. */
34 uint32_t _dmac_la[2]; /* 2 x 32 bit add. */
36 size_t dmac_size; /* DMA cookie size */
37 uint_t dmac_type; /* bus spec. type bits */
44 You can access the DMA address through the \fB#define\fRs: \fBdmac_address\fR
45 for 32-bit addresses and \fBdmac_laddress\fR for 64-bit addresses. These macros
46 are defined as follows:
50 #define dmac_laddress _dmu._dmac_ll
51 #ifdef _LONG_LONG_HTOL
52 #define dmac_notused _dmu._dmac_la[0]
53 #define dmac_address _dmu._dmac_la[1]
55 #define dmac_address _dmu._dmac_la[0]
56 #define dmac_notused _dmu._dmac_la[1]
63 \fBdmac_laddress\fR specifies a 64-bit \fBI/O\fR address appropriate for
64 programming the device's \fBDMA\fR engine. If a device has a 64-bit \fBDMA\fR
65 address register a driver should use this field to program the \fBDMA\fR
66 engine. \fBdmac_address\fR specifies a 32-bit \fBI/O\fR address. It should be
67 used for devices that have a 32-bit \fBDMA\fR address register. The \fBI/O\fR
68 address range that the device can address and other \fBDMA\fR attributes have
69 to be specified in a \fBddi_dma_attr\fR(9S) structure.
72 \fBdmac_size\fR describes the length of the transfer in bytes.
75 \fBdmac_type\fR contains bus-specific type bits, if appropriate. For example, a
76 device on a \fBPCI\fR bus has \fBPCI\fR address modifier bits placed here.
80 \fBpci\fR(4), \fBsbus\fR(4), \fBsysbus\fR(4),
81 \fBddi_dma_addr_bind_handle\fR(9F), \fBddi_dma_buf_bind_handle\fR(9F),
82 \fBddi_dma_getwin\fR(9F), \fBddi_dma_nextcookie\fR(9F), \fBddi_dma_attr\fR(9S)
85 \fIWriting Device Drivers\fR