Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / scsi_hba_init.9f
blobc0f97c1dab53264ab6f8e958527a5977d876fe66
1 '\" te
2 .\"  Copyright (c) 1993, 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_INIT 9F "Nov 1, 1993"
7 .SH NAME
8 scsi_hba_init, scsi_hba_fini \- SCSI Host Bus Adapter system initialization and
9 completion routines
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/scsi/scsi.h>
17 \fBint\fR \fBscsi_hba_init\fR(\fBstruct modlinkage *\fR\fImodlp\fR);
18 .fi
20 .LP
21 .nf
22 \fBvoid\fR \fBscsi_hba_fini\fR(\fBstruct modlinkage *\fR\fImodlp\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\fImodlp\fR \fR
34 .ad
35 .RS 10n
36 Pointer to the Host Bus Adapters module linkage structure.
37 .RE
39 .SH DESCRIPTION
40 .SS "\fBscsi_hba_init()\fR"
41 .sp
42 .LP
43 \fBscsi_hba_init()\fR is the system-provided initialization routine for
44 \fBSCSI\fR \fBHBA\fR drivers.  The \fBscsi_hba_init()\fR function registers the
45 \fBHBA\fR in the system and allows the driver to accept configuration requests
46 on behalf of \fBSCSI\fR target drivers. The \fBscsi_hba_init()\fR routine must
47 be called in the \fBHBA\fR's \fB_init\fR(9E) routine before
48 \fBmod_install\fR(9F) is called. If \fBmod_install\fR(9F) fails, the
49 \fBHBA\fR's \fB_init\fR(9E) should call \fBscsi_hba_fini()\fR before returning
50 failure.
51 .SS "\fBscsi_hba_fini()\fR"
52 .sp
53 .LP
54 \fBscsi_hba_fini()\fR is the system provided completion routine for \fBSCSI\fR
55 \fBHBA\fR drivers. \fBscsi_hba_fini()\fR removes all of the system references
56 for the \fBHBA\fR that were created in \fBscsi_hba_init()\fR. The
57 \fBscsi_hba_fini()\fR routine should be called in the \fBHBA\fR's
58 \fB_fini\fR(9E) routine if \fBmod_remove\fR(9F) is successful.
59 .SH RETURN VALUES
60 .sp
61 .LP
62 \fBscsi_hba_init()\fR returns \fB0\fR if successful, and a non-zero value
63 otherwise. If \fBscsi_hba_init()\fR fails, the HBA's \fB_init()\fR entry point
64 should return the value returned by \fBscsi_hba_init()\fR.
65 .SH CONTEXT
66 .sp
67 .LP
68 \fBscsi_hba_init()\fR and \fBscsi_hba_fini()\fR should be called from
69 \fB_init\fR(9E) or \fB_fini\fR(9E), respectively.
70 .SH SEE ALSO
71 .sp
72 .LP
73 \fB_fini\fR(9E), \fB_init\fR(9E), \fBmod_install\fR(9F), \fBmod_remove\fR(9F),
74 \fBscsi_pktalloc\fR(9F), \fBscsi_pktfree\fR(9F), \fBscsi_hba_tran\fR(9S)
75 .sp
76 .LP
77 \fIWriting Device Drivers\fR
78 .SH NOTES
79 .sp
80 .LP
81 The \fBHBA\fR is responsible for ensuring that no \fBDDI\fR request routines
82 are called on behalf of its \fBSCSI\fR target drivers once
83 \fBscsi_hba_fini()\fR is called.