ddi_prop_get_int64 man page on SunOS

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
SunOS logo
[printable version]

ddi_prop_get_int(9F)	 Kernel Functions for Drivers	  ddi_prop_get_int(9F)

NAME
       ddi_prop_get_int, ddi_prop_get_int64 - lookup integer property

SYNOPSIS
       #include <sys/ddi.h>
       #include <sys/sunddi.h>

       int ddi_prop_get_int(dev_t match_dev, dev_info_t *dip, uint_t flags,
	    char *name, int defvalue);

       int64_t ddi_prop_get_int64(dev_t match_dev, dev_info_t *dip, uint_t flags,
	    char *name, int64_t defvalue);

PARAMETERS
       match_dev    Device number associated with property or DDI_DEV_T_ANY.

       dip	    Pointer  to	 the device info node of device whose property
		    list should be searched.

       flags	    Possible flag values are some combination of:

		    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 name of the property.

       defvalue	    An integer value that is returned if the  property	cannot
		    be found.

INTERFACE LEVEL
       Solaris DDI specific (Solaris DDI).

DESCRIPTION
       The ddi_prop_get_int() and ddi_prop_get_int64() functions search for an
       integer property and, if found, returns the value of the property.

       Properties are searched for based on the dip, name, match_dev, and  the
       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.

	   6.	  Return defvalue.

       Usually, the match_dev argument should be set to the actual device num‐
       ber  that  this	property is associated with. However, if the match_dev
       argument	   is	 DDI_DEV_T_ANY,	   then	    ddi_prop_get_int()	   and
       ddi_prop_get_int()  will	 match the request regardless of the match_dev
       the property was created with. If a property was created with match_dev
       set  to	DDI_DEV_T_NONE,	 then the only way to look up this property is
       with a match_dev set to DDI_DEV_T_ANY. PROM properties are always  cre‐
       ated with match_dev 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 the property. If the
       property is not found, the argument defvalue is returned as  the	 value
       of the property.

       ddi_prop_get_int64()  will not search the PROM for 64-bit property val‐
       ues.

RETURN VALUES
       ddi_prop_get_int() and ddi_prop_get_int64() return  the	value  of  the
       property.  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, then DDI_PROP_NOT_FOUND is returned.

CONTEXT
       ddi_prop_get_int()  and ddi_prop_get_int64() can be called from user or
       kernel context.

EXAMPLES
       Example 1 Using ddi_prop_get_int()

       The following example demonstrates the use of ddi_prop_get_int().

	 /*
	      * Get the value of the integer "width" property, using
	      * our own default if no such property exists
	      */
	      width = ddi_prop_get_int(xx_dev, xx_dip, 0, "width",
			 XX_DEFAULT_WIDTH);

SEE ALSO
       ddi_prop_exists(9F),	ddi_prop_lookup(9F),	  ddi_prop_remove(9F),
       ddi_prop_update(9F)

SunOS 5.10			  25 Aug 2001		  ddi_prop_get_int(9F)
[top]

List of man pages available for SunOS

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