Kernel Functions for Drivers ldipropgetint(9F)
NAME
ldipropgetint, ldipropgetint64 - Lookup integer pro-
perty
SYNOPSIS
#include
int ldipropgetint(ldihandlet lh, uintt flags, char *name,
int defvalue);
int64t ldipropgetint64(ldihandlet lh, uintt flags, char *name,
int64t defvalue);
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. Indicates any devt
value (including
DIDEVTNONE) associated
with a possible property
match satisfies the matching
criteria.
DIPROPDONTPAS Do not pass request to parent
device information node if
property not found.
DIPROPNOTPROM Do not look at PROM proper-
ties (ignored on platforms
that do not support PROM pro-
perties).
name String containing the property name.
defvalue Integer value that is returned if the property
is not found.
SunOS 5.11 Last change: 3 June 2003 1
Kernel Functions for Drivers ldipropgetint(9F)
INTERFACE LEVEL
Solaris DI specific (Solaris DI)
DESCRIPTION
The ldipropgetint() and ldipropgetint64() functions
search for an integer property associated with a device
represented by the layered driver handle. If the integer
property is found, the functions return the property value.
Properties are searched for based on the dip and devt
values associated with the layered handle, the property
name, and type of the data (integer).
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 defvalue.
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 match the request regardless of the devt
value associated with the property at the time of its crea-
tion. 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.
SunOS 5.11 Last change: 3 June 2003 2
Kernel Functions for Drivers ldipropgetint(9F)
The return value of the routine is the value of property. If
the property is not found, the argument defvalue is returned
as the property value.
ldipropgetint64() does not search the PROM for 64-bit
property values.
RETURN VALUES
ldipropgetint() and ldipropgetint64() return the pro-
perty value. If the property is not found, the argument
defvalue is returned. If the property is found, but cannot
be decoded into an int or an int64t, DIPROPNOTFOUND is
returned.
CONTEXT
ldipropgetint() and ldipropgetint64() can be called
from user or kernel context.
EXAMPLES
Using ldipropgetint64().
The following example demonstrates the use of ldipropgetint64().
/*
* Get the value of the integer "timeout" property, using
* our own default if no such property exists
*/
int64t timeout, defval;
timeout = ldipropgetint64(lh, LDIDEVTANYDIPROPDONTPAS,
propname, defval);
SEE ALSO
ddipropgetint(9F), ddipropgetint64(9F),
ldipropexists(9F).
Writing Device Drivers
SunOS 5.11 Last change: 3 June 2003 3
|