summaryrefslogtreecommitdiff
path: root/usr/src/man/man9f/ddi_fm_init.9f
blob: 767c1cea65174f1ff9c9c3773a8b3d340e1c4206 (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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" 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 DDI_FM_INIT 9F "Aug 08, 2022"
.SH NAME
ddi_fm_init, ddi_fm_fini, ddi_fm_capable \- initialize and get the FM
capabilities for a device instance
.SH SYNOPSIS
.nf
#include <sys/ddifm.h>

\fBvoid\fR \fBddi_fm_init\fR(\fBdev_info_t\fR *\fIdip\fR, \fBint\fR *\fIfm_capability\fR,
     \fBddi_iblock_cookie_t\fR *\fIibcp\fR);
.fi

.LP
.nf
\fBvoid\fR \fBddi_fm_fini\fR(\fBdev_info_t\fR *\fIdip\fR);
.fi

.LP
.nf
\fBint\fR \fBddi_fm_capable\fR(\fBdev_info_t\fR *\fIdip\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI)
.SH PARAMETERS
\fBddi_fm_init()\fR
.sp
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 17n
Pointer to the \fBdev_info\fR structure
.RE

.sp
.ne 2
.na
\fB\fIfm_capability\fR\fR
.ad
.RS 17n
Fault Management capability bit mask
.RE

.sp
.ne 2
.na
\fB\fIibcp\fR\fR
.ad
.RS 17n
Pointer to where the interrupt block cookie should be returned.
.RE

.SH DESCRIPTION
A device driver can declare its fault management capabilities to the \fBI/O\fR
Fault Management framework by calling \fBddi_fm_init()\fR. The
\fBddi_fm_init()\fR function allocates and initializes resources according to
the bitwise-inclusive-OR of the fault management capabilities, described in the
following and supported by the driver's immediate nexus parent.
.sp
.ne 2
.na
\fB\fBDDI_FM_NOT_CAPABLE\fR\fR
.ad
.RS 26n
The driver does not support any \fBFMA\fR features. This is the default value
assigned to device drivers.
.RE

.sp
.ne 2
.na
\fB\fBDDI_FM_EREPORT_CAPABLE\fR\fR
.ad
.RS 26n
The driver generates \fBFMA\fR protocol error events (\fBereports\fR) upon the
detection of an error condition.
.RE

.sp
.ne 2
.na
\fB\fBDDI_FM_ACCCHK_CAPABLE\fR\fR
.ad
.RS 26n
The driver checks for errors upon the completion of one or more access
\fBI/O\fR transactions.
.RE

.sp
.ne 2
.na
\fB\fBDDI_FM_DMACHK_CAPABLE\fR\fR
.ad
.RS 26n
The driver checks for errors upon the completion of one or more \fBDMA\fR
\fBI/O\fR transactions.
.RE

.sp
.ne 2
.na
\fB\fBDDI_FM_ERRCB_CAPABLE\fR\fR
.ad
.RS 26n
The driver is capable of error handler callback registration.
.RE

.sp
.LP
If the parent nexus is not capable of supporting any one of the requested
capabilities, the associated bit will not be set and returned as such to the
driver. Before returning from \fBddi_fm_init()\fR, the \fBI/O\fR Fault
Management framework creates a set of fault management capability properties:
\fBfm-ereport-capable\fR, \fBfm-errcb-capable\fR, \fBfm-accchk-capable\fR, and
\fBfm-dmachk-capable\fR. The current supported fault management capability
levels are observable via \fBprtconf\fR(8).
.sp
.LP
A driver can support the administrative selection of fault management
capabilities by exporting and setting a fault management capability level
property in its \fBdriver.conf\fR(5) file to the values described above. The
\fBfm_capable\fR properties must be set and read prior to calling
\fBddi_fm_init()\fR with the desired capability list.
.sp
.ne 2
.na
\fB\fBddi_fm_fini()\fR\fR
.ad
.RS 17n
This function cleans up resources allocated to support fault management for the
\fIdip\fR structure.
.RE

.sp
.ne 2
.na
\fB\fBddi_fm_capable()\fR\fR
.ad
.RS 20n
This function returns the capability bit mask currently set for the \fIdip\fR
structure.
.RE

.SH CONTEXT
These functions can be called from kernel context in a driver \fBattach\fR(9E)
or \fBdetach\fR(9E) operation.
.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.BR driver.conf (5),
.BR attributes (7),
.BR prtconf (8),
.BR attach (9E),
.BR detach (9E)
.sp
.LP
\fIWriting Device Drivers\fR