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 SCSI_DMAGET 9F "Jan 16, 2006"
8 scsi_dmaget, scsi_dmafree \- SCSI dma utility routines
12 #include <sys/scsi/scsi.h>
16 \fBstruct scsi_pkt *\fR\fBscsi_dmaget\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR,
17 \fBopaque_t\fR \fIdmatoken\fR, \fBint\fR\fB(*\fRcallback\fB)(void)\fR);
22 \fBvoid\fR \fBscsi_dmafree\fR(\fBstruct scsi_pkt *\fR\fIpkt\fR);
28 These interfaces are obsolete. Use \fBscsi_init_pkt\fR(9F) instead of
29 \fBscsi_dmaget()\fR. Use \fBscsi_destroy_pkt\fR(9F) instead of
38 A pointer to a \fBscsi_pkt\fR(9S) structure.
47 Pointer to an implementation dependent object.
56 Pointer to a callback function, or \fBNULL_FUNC\fR or \fBSLEEP_FUNC.\fR
62 The \fBscsi_dmaget()\fR function allocates \fBDMA\fR resources for an already
63 allocated \fBSCSI\fR packet. \fIpkt\fR is a pointer to the previously allocated
64 \fBSCSI\fR packet (see \fBscsi_pktalloc\fR(9F)).
67 The \fIdmatoken\fR parameter is a pointer to an implementation dependent object
68 which defines the length, direction, and address of the data transfer
69 associated with this \fBSCSI \fRpacket (command). The \fIdmatoken\fR must be a
70 pointer to a \fBbuf\fR(9S) structure. If \fIdmatoken\fR is \fINULL\fR, no
71 resources are allocated.
74 The \fIcallback\fR parameter indicates what \fBscsi_dmaget()\fR should do when
75 resources are not available:
82 Do not wait for resources. Return a \fINULL\fR pointer.
88 \fB\fBSLEEP_FUNC\fR\fR
91 Wait indefinitely for resources.
100 \fIcallback\fR points to a function which is called when resources may have
101 become available. \fIcallback\fR must return either \fB0\fR (indicating that it
102 attempted to allocate resources but failed to do so again), in which case it is
103 put back on a list to be called again later, or \fB1\fR indicating either
104 success in allocating resources or indicating that it no longer cares for a
110 The \fBscsi_dmafree()\fR function frees the \fBDMA\fR resources associated with
111 the \fBSCSI\fR packet. The packet itself remains allocated.
115 The \fBscsi_dmaget()\fR function returns a pointer to a \fBscsi_pkt\fR on
116 success. It returns \fBNULL\fR if resources are not available.
120 If \fIcallback\fR is \fBSLEEP_FUNC\fR, then this routine may only be called
121 from user or kernel context. Otherwise, it may be called from user, kernel, or
122 interrupt context. The \fIcallback\fR function may not block or call routines
126 The \fBscsi_dmafree()\fR function can be called from user, interrupt, or kernel
131 See \fBattributes\fR(5) for a description of the following attributes:
139 ATTRIBUTE TYPE ATTRIBUTE VALUE
141 Stability Level Obsolete
147 \fBattributes\fR(5), \fBscsi_pktalloc\fR(9F), \fBscsi_pktfree\fR(9F),
148 \fBscsi_resalloc\fR(9F), \fBscsi_resfree\fR(9F), \fBbuf\fR(9S),
152 \fIWriting Device Drivers\fR
156 The \fBscsi_dmaget()\fR and \fBscsi_dmafree()\fR functions are obsolete and
157 will be discontinued in a future release. These functions have been replaced
158 by, respectively, \fBscsi_init_pkt\fR(9F) and \fBscsi_destroy_pkt\fR(9F).