summaryrefslogtreecommitdiff
path: root/usr/src/man/man9f/scsi_dmaget.9f
blob: 5ac471eef7eb9326ebaa56ea15fa5302d3ffde31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc.
.\" 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]
.TH SCSI_DMAGET 9F "Jan 16, 2006"
.SH NAME
scsi_dmaget, scsi_dmafree \- SCSI dma utility routines
.SH SYNOPSIS
.LP
.nf
#include <sys/scsi/scsi.h>



\fBstruct scsi_pkt *\fR\fBscsi_dmaget\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR,
     \fBopaque_t\fR \fIdmatoken\fR, \fBint\fR\fB(*\fRcallback\fB)(void)\fR);
.fi

.LP
.nf
\fBvoid\fR \fBscsi_dmafree\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
These interfaces are obsolete. Use \fBscsi_init_pkt\fR(9F) instead of
\fBscsi_dmaget()\fR. Use \fBscsi_destroy_pkt\fR(9F) instead of
\fBscsi_dmafree()\fR.
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIpkt\fR\fR
.ad
.RS 12n
A pointer to a \fBscsi_pkt\fR(9S) structure.
.RE

.sp
.ne 2
.na
\fB\fIdmatoken\fR\fR
.ad
.RS 12n
Pointer to an implementation dependent object.
.RE

.sp
.ne 2
.na
\fB\fIcallback\fR\fR
.ad
.RS 12n
Pointer to a callback function, or \fBNULL_FUNC\fR or \fBSLEEP_FUNC.\fR
.RE

.SH DESCRIPTION
.sp
.LP
The \fBscsi_dmaget()\fR function allocates \fBDMA\fR resources for an already
allocated \fBSCSI\fR packet. \fIpkt\fR is a pointer to the previously allocated
\fBSCSI\fR packet (see \fBscsi_pktalloc\fR(9F)).
.sp
.LP
The \fIdmatoken\fR parameter is a pointer to an implementation dependent object
which defines the length, direction, and address of the data transfer
associated with this \fBSCSI \fRpacket (command). The \fIdmatoken\fR must be a
pointer to a \fBbuf\fR(9S) structure. If \fIdmatoken\fR is \fINULL\fR, no
resources are allocated.
.sp
.LP
The \fIcallback\fR parameter indicates what \fBscsi_dmaget()\fR should do when
resources are not available:
.sp
.ne 2
.na
\fB\fBNULL_FUNC\fR\fR
.ad
.RS 16n
Do not wait for resources. Return a \fINULL\fR pointer.
.RE

.sp
.ne 2
.na
\fB\fBSLEEP_FUNC\fR\fR
.ad
.RS 16n
Wait indefinitely for resources.
.RE

.sp
.ne 2
.na
\fBOther Values\fR
.ad
.RS 16n
\fIcallback\fR points to a function which is called when resources may have
become available. \fIcallback\fR must return either \fB0\fR (indicating that it
attempted to allocate resources but failed to do so again), in which case it is
put back on a list to be called again later, or \fB1\fR indicating either
success in allocating resources or indicating that it no longer cares for a
retry.
.RE

.sp
.LP
The \fBscsi_dmafree()\fR function frees the \fBDMA\fR resources associated with
the \fBSCSI\fR packet. The packet itself remains allocated.
.SH RETURN VALUES
.sp
.LP
The \fBscsi_dmaget()\fR function returns a pointer to a \fBscsi_pkt\fR on
success. It returns \fBNULL\fR if resources are not available.
.SH CONTEXT
.sp
.LP
If \fIcallback\fR is \fBSLEEP_FUNC\fR, then this routine may only be called
from user or kernel context. Otherwise, it may be called from user, kernel, or
interrupt context. The \fIcallback\fR function may not block or call routines
that block.
.sp
.LP
The \fBscsi_dmafree()\fR function can be called from user, interrupt, or kernel
context.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for a description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Stability Level	Obsolete
.TE

.SH SEE ALSO
.sp
.LP
\fBattributes\fR(5), \fBscsi_pktalloc\fR(9F), \fBscsi_pktfree\fR(9F),
\fBscsi_resalloc\fR(9F), \fBscsi_resfree\fR(9F), \fBbuf\fR(9S),
\fBscsi_pkt\fR(9S)
.sp
.LP
\fIWriting Device Drivers\fR
.SH NOTES
.sp
.LP
The \fBscsi_dmaget()\fR and \fBscsi_dmafree()\fR functions are obsolete and
will be discontinued in a future release. These functions have been replaced
by, respectively, \fBscsi_init_pkt\fR(9F) and \fBscsi_destroy_pkt\fR(9F).