Kernel Functions for Drivers ldievfinalize(9F)
NAME
ldievfinalize - propagate disposition of a state change
event
SYNOPSIS
#include
void ldievfinalize(devinfot *dip, minort minor, int spectype,
int ldiresult, ldievcookiet cookie, void *evdata);
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
PARAMETERS
devinfot *dip
The devinfo node of the layered consumer exporting the
minor device.
minort minor
The minor number of the exported minor device.
int spectype
The type of minor device (SIFCHR or SIFBLK).
int ldiresult
The final disposition of the state change.
ldievcookiet cookie
An opaque event cookie for the event type returned by a
previous call to ldievgetcookie(9F).
void *evdata
Event specific data.
DESCRIPTION
The ldievfinalize() function propagates the final disposi-
tion of an event up the software stack. It may result in two
actions:
SunOS 5.11 Last change: 21 Aug 2007 1
Kernel Functions for Drivers ldievfinalize(9F)
o Invocation of "finalize" LDI callback handlers
registered by layered drivers up the software
stack.
o Device contract "negotiation end" (CTEVNEGEND)
events generated on minors exported to userland.
The event propagated up the software stack may be different
than the event received by the layered driver invoking
ldievfinalize(). For example, a volume manager may receive
an "offline" event on one of it's LDI opened disks, but may
choose to propagate a "degraded" event on minors it exports
to userland (since it may have more than one copy of the
data). The event cookie argument to ldievnotify(9F) may be
different from the event cookie currently possessed by the
layered driver. If that is the case, the layered driver must
generate another event cookie via a new
ldievgetcookie(9F) call.
RETURN VALUES
None.
CONTEXT
This function can be called from user and kernel contexts
only.
EXAMPLES
Example 1 Invoking ldievfinalize(9F) from widget's final-
ize callback
The following example shows how the ldievfinalize() func-
tion is invoked from a widget's finalize callback:
static void
widgetfinalize(ldihandlet lh, ldievcookiet foocookie,
int ldiresult, void *arg, void *evdata)
{
ASERT(strcmp(ldievgettype(foocookie), LDIEVFO) == 0);
/* Map imported minor to exported minors */
widgetmap(lh, &minor, &spectype);
if (ldiresult == LDIEVSUCES) {
ldievfinalize(dip, minor, spectype,
LDIEVSUCES, foocookie, evdata);
}
/*
SunOS 5.11 Last change: 21 Aug 2007 2
Kernel Functions for Drivers ldievfinalize(9F)
* The event foo failed. Reconfigure yourself
* *before* propagating
*/
widgetreconfigure(lh, LDIEVFO, REACQUIRE);
ldievfinalize(dip, minor, spectype, LDIEVFAILURE,
foocookie, evdata);
}
SEE ALSO
ldievgetcookie(9F), ldievregistercallbacks(9F),
ldievremovecallbacks(9F)
SunOS 5.11 Last change: 21 Aug 2007 3
|