Kernel Functions for Drivers ldipropexists(9F)
NAME
ldipropexists - Check for the existence of a property
SYNOPSIS
#include
int ldipropexists(ldihandlet lh, uintt flags, char *name);
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
PARAMETERS
lh Layered handle.
flags Possible flag values are some combination of:
LDIDEVTANY Match the lookup request independent of
the actual devt value that was used
when the property was created. The flag
indicates any devt value (including
DIDEVTNONE) associated with a pos-
sible property match satisfies the
matching criteria.
DIPROPDONTPAS Do not pass request to parent device
information node if the property is
not found.
DIPROPNOTPROM Do not look at PROM properties
(ignored on platforms that do not sup-
port PROM properties).
name String containing the name of the pro-
perty.
DESCRIPTION
ldipropexists() checks for the existence of a property
associated with a device represented by the layered driver
handle, regardless of the property value data type.
Properties are searched for based on the dip and devt
values associated with the layered handle, and the property
name. This association is handled by the layered driver
infrastructure on behalf of the consumers of
SunOS 5.11 Last change: 3 June 2003 1
Kernel Functions for Drivers ldipropexists(9F)
ldipropexists().
The property search order is as follows:
1. Search software-properties created by the driver.
2. Search the software properties created by the sys-
tem (or nexus nodes in the device info tree).
3. Search the driver global properties list.
4. If DIPROPNOTPROM is not set, search the PROM
properties (if they exist).
5. If DIPROPDONTPAS is not set, pass this request
to the parent device information node of the device
represented by the layered handle.
6. Return 0 if not found and 1 if found.
Typically, the specific devt value associated with the dev-
ice represented by the layered handle (ldihandlet) is used
as a part of the property match criteria. This association
is handled by the layered driver infrastructure on behalf of
the consumers of the ldi property look up functions.
However, if the LDIDEVTANY flag is used, the ldi property
lookup functions will match the request regardless of the
devt value associated with the property at the time of its
creation. If a property was created with a devt set to
DIDEVTNONE, the only way to look up this property is
with the LDIDEVTANY flag. PROM properties are always
created with a devt set to DIDEVTNONE.
name must always be set to the name of the property being
looked up.
RETURN VALUES
ldipropexists() returns 1 if the property exists and 0
otherwise.
CONTEXT
This function may be called from user or kernel context.
EXAMPLE
The following example demonstrates the use of ldipropexists().
/* Determine the existence of the "interrupts" property */
SunOS 5.11 Last change: 3 June 2003 2
Kernel Functions for Drivers ldipropexists(9F)
ldipropexists(lh, LDIDEVTANYDIPROPNOTPROM, "interrupts");
SEE ALSO
ddipropexists(9F)
Writing Device Drivers
SunOS 5.11 Last change: 3 June 2003 3
|