backout 998: breaks common closed drivers
[illumos-gate.git] / usr / src / man / man9f / ddi_dma_coff.9f
blobb8609b2fd084166505625e3bc155b97bbc154a98
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc.
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_COFF 9F "Jan 16, 2006"
7 .SH NAME
8 ddi_dma_coff \- convert a DMA cookie to an offset within a DMA handle.
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/conf.h>
13 #include <sys/ddi.h>
14 #include <sys/sunddi.h>
18 \fBint\fR \fBddi_dma_coff\fR(\fBddi_dma_handle_t\fR \fIhandle\fR, \fBddi_dma_cookie_t *\fR\fIcookiep\fR,
19      \fBoff_t *\fR\fIoffp\fR);
20 .fi
22 .SH INTERFACE LEVEL
23 .sp
24 .LP
25 Solaris SPARC DDI (Solaris SPARC DDI). This interface is obsolete.
26 .SH PARAMETERS
27 .sp
28 .ne 2
29 .na
30 \fB\fIhandle\fR\fR
31 .ad
32 .RS 11n
33 The \fIhandle\fR filled in by a call to \fBddi_dma_setup\fR(9F).
34 .RE
36 .sp
37 .ne 2
38 .na
39 \fB\fIcookiep\fR\fR
40 .ad
41 .RS 11n
42 A pointer to a \fBDMA\fR cookie (see \fBddi_dma_cookie\fR(9S)) that contains
43 the appropriate address, length and bus type to be used in programming the
44 \fBDMA\fR engine.
45 .RE
47 .sp
48 .ne 2
49 .na
50 \fB\fIoffp\fR\fR
51 .ad
52 .RS 11n
53 A pointer to an offset to be filled in.
54 .RE
56 .SH DESCRIPTION
57 .sp
58 .LP
59 The \fBddi_dma_coff()\fR function converts the values in \fBDMA\fR cookie
60 pointed to by \fIcookiep\fR to an offset (in bytes) from the beginning of the
61 object that the DMA\fBhandle\fR has mapped.
62 .sp
63 .LP
64 The \fBddi_dma_coff()\fR function allows a driver to update a \fBDMA\fR cookie
65 with values it reads from its device's \fBDMA\fR engine after a transfer
66 completes and convert that value into an offset into the object that is mapped
67 for \fBDMA\fR.
68 .SH RETURN VALUES
69 .sp
70 .LP
71 The \fBddi_dma_coff()\fR function returns:
72 .sp
73 .ne 2
74 .na
75 \fB\fBDDI_SUCCESS\fR\fR
76 .ad
77 .RS 15n
78 Successfully filled in \fIoffp\fR.
79 .RE
81 .sp
82 .ne 2
83 .na
84 \fB\fBDDI_FAILURE\fR\fR
85 .ad
86 .RS 15n
87 Failed to successfully fill in \fIoffp\fR.
88 .RE
90 .SH CONTEXT
91 .sp
92 .LP
93 The \fBddi_dma_coff()\fR function can be called from user, interrupt, or kernel
94 context.
95 .SH ATTRIBUTES
96 .sp
97 .LP
98 See \fBattributes\fR(5) for descriptions of the following attributes:
99 .sp
103 box;
104 c | c
105 l | l .
106 ATTRIBUTE TYPE  ATTRIBUTE VALUE
108 Interface Stability     Obsolete
111 .SH SEE ALSO
114 \fBddi_dma_setup\fR(9F), \fBddi_dma_sync\fR(9F), \fBddi_dma_cookie\fR(9S)
117 \fIWriting Device Drivers\fR