backout 998: breaks common closed drivers
[unleashed.git] / usr / src / man / man9f / ddi_dma_buf_setup.9f
blob017aae75eb4570e37bc2c7d80493eb39b572a5fb
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_BUF_SETUP 9F "Jan 16, 2006"
7 .SH NAME
8 ddi_dma_buf_setup \- easier DMA setup for use with buffer structures
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/ddi.h>
13 #include <sys/sunddi.h>
17 \fBint\fR \fBddi_dma_buf_setup\fR(\fBdev_info_t *\fR\fIdip\fR, \fBstruct buf *\fR\fIbp\fR, \fBuint_t\fR \fIflags\fR,
18      \fBint (*\fR\fIwaitfp\fR) (caddr_t),, \fBcaddr_t\fR \fIarg\fR, \fBddi_dma_lim_t *\fR\fIlim\fR,
19      \fBddi_dma_handle_t *\fR\fIhandlep\fR);
20 .fi
22 .SH INTERFACE LEVEL
23 .sp
24 .LP
25 This interface is obsolete. \fBddi_dma_buf_bind_handle\fR(9F) should be used
26 instead.
27 .SH PARAMETERS
28 .sp
29 .ne 2
30 .na
31 \fB\fIdip\fR\fR
32 .ad
33 .RS 11n
34 A pointer to the device's \fBdev_info\fR structure.
35 .RE
37 .sp
38 .ne 2
39 .na
40 \fB\fIbp\fR\fR
41 .ad
42 .RS 11n
43 A pointer to a system buffer structure (see \fBbuf\fR(9S)).
44 .RE
46 .sp
47 .ne 2
48 .na
49 \fB\fIflags\fR\fR
50 .ad
51 .RS 11n
52 Flags that go into a \fBddi_dma_req\fR structure (see \fBddi_dma_req\fR(9S)).
53 .RE
55 .sp
56 .ne 2
57 .na
58 \fB\fIwaitfp\fR\fR
59 .ad
60 .RS 11n
61 The address of a function to call back later if resources aren't available now.
62 The special function addresses \fBDDI_DMA_SLEEP\fR and \fBDDI_DMA_DONTWAIT\fR
63 (see \fBddi_dma_req\fR(9S)) are taken to mean, respectively, wait until
64 resources are available, or do not wait at all and do not schedule a callback.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fIarg\fR\fR
71 .ad
72 .RS 11n
73 Argument to be passed to a callback function, if such a function is specified.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fIlim\fR\fR
80 .ad
81 .RS 11n
82 A pointer to a \fBDMA\fR limits structure for this device (see
83 \fBddi_dma_lim_sparc\fR(9S) or \fBddi_dma_lim_x86\fR(9S)). If this pointer is
84 \fINULL\fR, a default set of \fBDMA\fR limits is assumed.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fIhandlep\fR\fR
91 .ad
92 .RS 11n
93 Pointer to a \fBDMA\fR handle. See \fBddi_dma_setup\fR(9F) for a discussion of
94 handle.
95 .RE
97 .SH DESCRIPTION
98 .sp
99 .LP
100 The \fBddi_dma_buf_setup()\fR function is an interface to
101 \fBddi_dma_setup\fR(9F). It uses its arguments to construct an appropriate
102 \fBddi_dma_req\fR structure and calls \fBddi_dma_setup()\fR with it.
103 .SH RETURN VALUES
106 See \fBddi_dma_setup\fR(9F) for the possible return values for this function.
107 .SH CONTEXT
110 The \fBddi_dma_buf_setup()\fR function can be called from user, interrupt, or
111 kernel context, except when \fIwaitfp\fR is set to \fBDDI_DMA_SLEEP\fR, in
112 which case it cannot be called from interrupt context.
113 .SH ATTRIBUTES
116 See \fBattributes\fR(5) for a description of the following attributes:
121 box;
122 c | c
123 l | l .
124 ATTRIBUTE TYPE  ATTRIBUTE VALUE
126 Stability Level Obsolete
129 .SH SEE ALSO
132 \fBattributes\fR(5), \fBddi_dma_addr_setup\fR(9F), \fBddi_dma_free\fR(9F),
133 \fBddi_dma_htoc\fR(9F), \fBddi_dma_setup\fR(9F), \fBddi_dma_sync\fR(9F),
134 \fBphysio\fR(9F), \fBbuf\fR(9S), \fBddi_dma_lim_sparc\fR(9S),
135 \fBddi_dma_lim_x86\fR(9S), \fBddi_dma_req\fR(9S)
138 \fIWriting Device Drivers\fR