'\" 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_EREPORT_POST 9F "May 14, 2007"
.SH NAME
ddi_fm_ereport_post \- post an FMA Protocol Error Report Event
.SH SYNOPSIS
.LP
.nf
#include <sys/ddifm.h>

\fBvoid\fR \fBddi_fm_ereport_post\fR(\fBdev_info_t\fR *\fIdip\fR, \fBchar\fR *\fIereport_class\fR,
     \fBuint64_t\fR \fIena\fR, \fBint\fR *\fIsflag\fR, ... /* name-value pair args */);
.fi

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

.sp
.ne 2
.na
\fB\fIereport_class\fR\fR
.ad
.RS 17n
\fBFMA\fR Event Protocol error class
.RE

.sp
.ne 2
.na
\fB\fIena\fR\fR
.ad
.RS 17n
Error Numeric Association
.RE

.sp
.ne 2
.na
\fB\fIsflag\fR\fR
.ad
.RS 17n
Determines whether caller can sleep for memory or other event resources.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBddi_fm_ereport_post()\fR function causes an encoded fault management
error report name-value pair list to be queued for delivery to the Fault
Manager daemon, \fBfmd\fR(1M). The \fIsflag\fR parameter indicates whether or
not the caller is willing to wait for system memory and event channel resources
to become available.
.sp
.LP
The following \fIereport_class\fR strings are available for use by any leaf
device driver:
.sp
.ne 2
.na
\fB\fBdevice.inval_state\fR\fR
.ad
.RS 24n
A leaf driver discovers that the device is in an invalid or inconsistent state.
For example, the driver might detect that receive or send ring descriptor
indices are corrupted. It might also find an invalid value in a register or a
driver-to-device protocol violation.
.RE

.sp
.ne 2
.na
\fB\fBdevice.no_response\fR\fR
.ad
.RS 24n
A leaf driver times out waiting for a response from the device. For example,
timeouts can occur when no confirmation is seen after resetting, enabling, or
disabling part of the device.
.RE

.sp
.ne 2
.na
\fB\fBdevice.badint_limit\fR\fR
.ad
.RS 24n
A leaf device sends too many consecutive interrupts with no work to do.
.RE

.sp
.ne 2
.na
\fB\fBdevice.intern_corr\fR\fR
.ad
.RS 24n
A leaf device reports to the driver that it has itself detected an internal
correctable error.
.RE

.sp
.ne 2
.na
\fB\fBdevice.intern_uncorr\fR\fR
.ad
.RS 24n
A leaf device reports to the driver that it has itself detected an internal
uncorrectable error.
.RE

.sp
.ne 2
.na
\fB\fBdevice.stall\fR\fR
.ad
.RS 24n
A leaf driver determines that data transmission has stalled indefinitely.
.RE

.sp
.LP
The \fIena\fR indicates the Format 1 Error Numeric Association for this error
report. It might have already been initialized by another error-detecting
software module. For example, if \fBddi_fm_ereport_post()\fR is called from an
error handler callback function, the \fIfme_ena\fR field from the passed-in
\fBddi_fm_error\fR argument should be used. Otherwise it should be set to
\fB0\fR and will be initialized by \fBddi_fm_ereport_post()\fR.
.sp
.LP
The name-value pair \fIargs\fR variable argument list contains one or more
(names, type, value pointer) nvpair tuples for non-array \fBdata_type_t\fR
types or one or more (name, type, number of elements, value pointer) tuples for
\fBdata_type_t\fR array types. There is one mandatory tuple to describe the
\fBereport\fR version. This should contain the following values:
.RS +4
.TP
.ie t \(bu
.el o
name - \fBFM_VERSION\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
type - \fBDATA_TYPE_UINT8\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
value - \fBFM_EREPORT_VERS0\fR
.RE
.sp
.LP
Additional nvpair tuples can describe error conditions for logging purposes,
but are not interpreted by the \fBI/O\fR framework or fault manager. The end of
the argument list is specified by \fINULL\fR.
.SH CONTEXT
.sp
.LP
The \fBddi_fm_ereport_post()\fR function can be called from user, kernel, or
high-level interrupt context.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) 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
.sp
.LP
\fBfmd\fR(1M), \fBattributes\fR(5), \fBddi_fm_service_impact\fR(9F)