2 .\" Copyright (c) 2007, 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 DDI_FM_INIT 9F "May 14, 2007"
8 ddi_fm_init, ddi_fm_fini, ddi_fm_capable \- initialize and get the FM
9 capabilities for a device instance
13 #include <sys/ddifm.h>
15 \fBvoid\fR \fBddi_fm_init\fR(\fBdev_info_t\fR *\fIdip\fR, \fBint\fR *\fIfm_capability\fR,
16 \fBddi_iblock_cookie_t\fR *\fIibcp\fR);
21 \fBvoid\fR \fBddi_fm_fini\fR(\fBdev_info_t\fR *\fIdip\fR);
26 \fBint\fR \fBddi_fm_capable\fR(\fBdev_info_t\fR *\fIdip\fR, \fBint\fR *\fIfm_capability\fR);
32 Solaris DDI specific (Solaris DDI)
43 Pointer to the \fBdev_info\fR structure
49 \fB\fIfm_capability\fR\fR
52 Fault Management capability bit mask
61 Pointer to where the interrupt block cookie should be returned.
67 A device driver can declare its fault management capabilities to the \fBI/O\fR
68 Fault Management framework by calling \fBddi_fm_init()\fR. The
69 \fBddi_fm_init()\fR function allocates and initializes resources according to
70 the bitwise-inclusive-OR of the fault management capabilities, described in the
71 following and supported by the driver's immediate nexus parent.
75 \fB\fBDDI_FM_NOT_CAPABLE\fR\fR
78 The driver does not support any \fBFMA\fR features. This is the default value
79 assigned to device drivers.
85 \fB\fBDDI_FM_EREPORT_CAPABLE\fR\fR
88 The driver generates \fBFMA\fR protocol error events (\fBereports\fR) upon the
89 detection of an error condition.
95 \fB\fBDDI_FM_ACCCHK_CAPABLE\fR\fR
98 The driver checks for errors upon the completion of one or more access
99 \fBI/O\fR transactions.
105 \fB\fBDDI_FM_DMACHK_CAPABLE\fR\fR
108 The driver checks for errors upon the completion of one or more \fBDMA\fR
109 \fBI/O\fR transactions.
115 \fB\fBDDI_FM_ERRCB_CAPABLE\fR\fR
118 The driver is capable of error handler callback registration.
123 If the parent nexus is not capable of supporting any one of the requested
124 capabilities, the associated bit will not be set and returned as such to the
125 driver. Before returning from \fBddi_fm_init()\fR, the \fBI/O\fR Fault
126 Management framework creates a set of fault management capability properties:
127 \fBfm-ereport-capable\fR, \fBfm-errcb-capable\fR, \fBfm-accchk-capable\fR, and
128 \fBfm-dmachk-capable\fR. The current supported fault management capability
129 levels are observable via \fBprtconf\fR(1M).
132 A driver can support the administrative selection of fault management
133 capabilities by exporting and setting a fault management capability level
134 property in its \fBdriver.conf\fR(4) file to the values described above. The
135 \fBfm_capable\fR properties must be set and read prior to calling
136 \fBddi_fm_init()\fR with the desired capability list.
140 \fB\fBddi_fm_fini()\fR\fR
143 This function cleans up resources allocated to support fault management for the
150 \fB\fBddi_fm_capable()\fR\fR
153 This function returns the capability bit mask currently set for the \fIdip\fR
160 These functions can be called from kernel context in a driver \fBattach\fR(9E)
161 or \fBdetach\fR(9E) operation.
165 See \fBattributes\fR(5) for descriptions of the following attributes:
173 ATTRIBUTE TYPE ATTRIBUTE VALUE
175 Interface Stability Committed
181 \fBprtconf\fR(1M), \fBdriver.conf\fR(4), \fBattributes\fR(5), \fBattach\fR(9E),
185 \fIWriting Device Drivers\fR