Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / scsi_hba_tran_alloc.9f
blob29c5f05b06332135bb0359b1c17fdafe4610a068
1 '\" te
2 .\"  Copyright (c) 2006, 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 SCSI_HBA_TRAN_ALLOC 9F "Jan 16, 2006"
7 .SH NAME
8 scsi_hba_tran_alloc, scsi_hba_tran_free \- allocate and free transport
9 structures
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/scsi/scsi.h>
17 \fBscsi_hba_tran_t *\fR\fBscsi_hba_tran_alloc\fR(\fBdev_info_t *\fR\fIdip\fR, \fBint\fR \fIflags\fR);
18 .fi
20 .LP
21 .nf
22 \fBvoid\fR \fBscsi_hba_tran_free\fR(\fBscsi_hba_tran_t *\fR\fIhba_tran\fR);
23 .fi
25 .SH INTERFACE LEVEL
26 .sp
27 .LP
28 Solaris architecture specific (Solaris DDI).
29 .SH PARAMETERS
30 .sp
31 .ne 2
32 .na
33 \fB\fIdip\fR\fR
34 .ad
35 .RS 12n
36 Pointer to a \fBdev_info\fR structure, defining the \fBHBA\fR driver instance.
37 .RE
39 .sp
40 .ne 2
41 .na
42 \fB\fIflag\fR\fR
43 .ad
44 .RS 12n
45 Flag modifiers. The only possible flag value is \fBSCSI_HBA_CANSLEEP\fR (memory
46 allocation may sleep).
47 .RE
49 .sp
50 .ne 2
51 .na
52 \fB\fIhba_tran\fR\fR
53 .ad
54 .RS 12n
55 Pointer to a \fBscsi_hba_tran\fR(9S) structure.
56 .RE
58 .SH DESCRIPTION
59 .sp
60 .LP
61 For \fBscsi_hba_tran_alloc()\fR:
62 .sp
63 .LP
64 The \fBscsi_hba_tran_alloc()\fR function allocates a  \fBscsi_hba_tran\fR(9S)
65 structure for a \fBHBA\fR driver. The \fBHBA\fR must use this structure to
66 register its transport vectors with the system by using
67 \fBscsi_hba_attach_setup\fR(9F).
68 .sp
69 .LP
70 If the flag \fBSCSI_HBA_CANSLEEP\fR is set in \fIflags\fR,
71 \fBscsi_hba_tran_alloc()\fR may sleep when allocating resources; otherwise it
72 may not sleep, and callers should be prepared to deal with allocation failures.
73 .sp
74 .LP
75 For \fBscsi_hba_tran_free()\fR:
76 .sp
77 .LP
78 The \fBscsi_hba_tran_free()\fR function is used to free the
79 \fBscsi_hba_tran\fR(9S) structure allocated by \fBscsi_hba_tran_alloc()\fR.
80 .SH RETURN VALUES
81 .sp
82 .LP
83 The \fBscsi_hba_tran_alloc()\fR function returns a pointer to the allocated
84 transport structure, or \fBNULL\fR if no space is available.
85 .SH CONTEXT
86 .sp
87 .LP
88 The \fBscsi_hba_tran_alloc()\fR function can be called from user, interrupt, or
89 kernel context. Drivers must not allow \fBscsi_hba_tran_alloc()\fR to sleep if
90 called from an interrupt routine.
91 .sp
92 .LP
93 The \fBscsi_hba_tran_free()\fR function can be called from user, interrupt, or
94 kernel context context.
95 .SH SEE ALSO
96 .sp
97 .LP
98 \fBscsi_hba_attach_setup\fR(9F), \fBscsi_hba_tran\fR(9S)
99 .sp
101 \fIWriting Device Drivers\fR