ldi_prop_get_int man page on SmartOS

Printed from http://www.polarhome.com/service/man/?qf=ldi_prop_get_int&af=0&tf=2&of=SmartOS

LDI_PROP_GET_INT(9F)					  LDI_PROP_GET_INT(9F)

NAME
       ldi_prop_get_int, ldi_prop_get_int64 - Lookup integer property

SYNOPSIS
       #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);

PARAMETERS
       lh
		 Layered handle.

       flags
		 Possible flag values are some combination of:

		 LDI_DEV_T_ANY
				      Match  the lookup request independent of
				      the actual dev_t	value  that  was  used
				      when the property was created. Indicates
				      any     dev_t	 value	    (including
				      DDI_DEV_T_NONE) associated with a possi‐
				      ble property match satisfies the	match‐
				      ing criteria.

		 DDI_PROP_DONTPASS
				      Do  not  pass  request  to parent device
				      information node if property not found.

		 DDI_PROP_NOTPROM
				      Do not look at PROM properties  (ignored
				      on  platforms  that  do not support PROM
				      properties).

       name
		   String containing the property name.

       defvalue
		   Integer value that is  returned  if	the  property  is  not
		   found.

INTERFACE LEVEL
       Solaris DDI specific (Solaris DDI)

DESCRIPTION
       The ldi_prop_get_int() and ldi_prop_get_int64() 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 dev_t  values  associ‐
       ated  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  system  (or
		  nexus nodes in the device info tree).

	   3.	  Search the driver global properties list.

	   4.	  If  DDI_PROP_NOTPROM	is not set, search the PROM properties
		  (if they exist).

	   5.	  If DDI_PROP_DONTPASS 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 dev_t value associated with the	device	repre‐
       sented  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  cre‐
       ated  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 prop‐
       erty 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 val‐
       ues.

RETURN VALUES
       ldi_prop_get_int() and ldi_prop_get_int64() return the property	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 int64_t,
       DDI_PROP_NOT_FOUND is returned.

CONTEXT
       ldi_prop_get_int()  and ldi_prop_get_int64() can be called from user or
       kernel context.

EXAMPLES
       Using ldi_prop_get_int64().

	 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);

SEE ALSO
       ddi_prop_get_int(9F), ddi_prop_get_int64(9F), ldi_prop_exists(9F).

       Writing Device Drivers

				  Jun 3, 2003		  LDI_PROP_GET_INT(9F)
[top]

List of man pages available for SmartOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net