|LDI_PROP_GET_INT(9F)||Kernel Functions for Drivers||LDI_PROP_GET_INT(9F)|
#include <sys/sunldi.h> int ldi_prop_get_int(ldi_handle_t lh, uint_t flags, char *name, int defvalue);
int64_t ldi_prop_get_int64(ldi_handle_t lh, uint_t flags, char *name, int64_t defvalue);
Properties are searched for based on the dip and dev_t values associated with the layered handle, the property name, and type of the data (integer).
The property search order is as follows:
Typically, the specific dev_t value associated with the device represented by the layered handle (ldi_handle_t) 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 LDI_DEV_T_ANY flag is used, the ldi property lookup functions match the request regardless of the dev_t value associated with the property at the time of its creation. If a property was created with a dev_t set to DDI_DEV_T_NONE, the only way to look up this property is with the LDI_DEV_T_ANY flag. PROM properties are always created with a dev_t set to DDI_DEV_T_NONE.
name must always be set to the name of the property being looked up.
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.
ldi_prop_get_int64() does not search the PROM for 64-bit property values.
The following example demonstrates the use of ldi_prop_get_int64(). /* * Get the value of the integer "timeout" property, using * our own default if no such property exists */ int64_t timeout, defval; timeout = ldi_prop_get_int64(lh, LDI_DEV_T_ANY|DDI_PROP_DONTPASS, propname, defval);
Writing Device Drivers
|June 3, 2003||OmniOS|