1ldi_prop_exists(9F)      Kernel Functions for Drivers      ldi_prop_exists(9F)
2
3
4

NAME

6       ldi_prop_exists - Check for the existence of a property
7

SYNOPSIS

9       #include <sys/sunldi.h>
10
11       int ldi_prop_exists(ldi_handle_t lh, uint_t flags, char *name);
12
13

INTERFACE LEVEL

15       Solaris DDI specific (Solaris DDI)
16

PARAMETERS

18       lh       Layered handle.
19
20
21       flags    Possible flag values are some combination of:
22
23
24       LDI_DEV_T_ANY        Match the lookup request independent of the actual
25                            dev_t value that was used when  the  property  was
26                            created.   The  flag  indicates  any  dev_t  value
27                            (including DDI_DEV_T_NONE)  associated with a pos‐
28                            sible property match satisfies the matching crite‐
29                            ria.
30
31
32       DDI_PROP_DONTPASS    Do not pass request to parent  device  information
33                            node if the property  is not found.
34
35
36       DDI_PROP_NOTPROM     Do not look at PROM properties  (ignored  on plat‐
37                            forms that do not support PROM properties).
38
39
40       name                 String containing the name of the property.
41
42

DESCRIPTION

44       ldi_prop_exists() checks for the existence  of  a  property  associated
45       with  a  device represented by the layered driver handle, regardless of
46       the property value data type.
47
48
49       Properties are searched for based on the dip and dev_t  values  associ‐
50       ated  with the layered handle, and the property name. This  association
51       is handled by the layered driver infrastructure on behalf of  the  con‐
52       sumers of ldi_prop_exists().
53
54
55       The property search order is as follows:
56
57           1.     Search software-properties created by the driver.
58
59           2.     Search  the  software  properties  created by the system (or
60                  nexus nodes in the device info tree).
61
62           3.     Search the driver global properties list.
63
64           4.     If DDI_PROP_NOTPROM is not set, search the  PROM  properties
65                  (if they exist).
66
67           5.     If  DDI_PROP_DONTPASS  is  not set, pass this request to the
68                  parent device information node of the device  represented by
69                  the layered handle.
70
71           6.     Return 0 if not found and 1 if found.
72
73
74       Typically,  the  specific dev_t value associated with the device repre‐
75       sented by the layered handle (ldi_handle_t) is used as a  part  of  the
76       property  match  criteria.  This  association is handled by the layered
77       driver infrastructure on behalf of the consumers of  the  ldi  property
78       look up functions.
79
80
81       However,  if  the  LDI_DEV_T_ANY  flag is used, the ldi property lookup
82       functions will match the request regardless of the dev_t value  associ‐
83       ated  with the property at the time of its creation.  If a property was
84       created with a dev_t set to DDI_DEV_T_NONE, the only  way  to  look  up
85       this  property  is  with  the  LDI_DEV_T_ANY flag.  PROM properties are
86       always created with a dev_t set to DDI_DEV_T_NONE.
87
88
89       name must always be set to the name of the property being looked up.
90

RETURN VALUES

92       ldi_prop_exists() returns 1 if the property exists and 0 otherwise.
93

CONTEXT

95       This function may be called from user or kernel context.
96

EXAMPLE

98         The following example demonstrates the use of ldi_prop_exists().
99
100              /* Determine the existence of the "interrupts" property */
101                ldi_prop_exists(lh, LDI_DEV_T_ANY|DDI_PROP_NOTPROM, "interrupts");
102
103

SEE ALSO

105       ddi_prop_exists(9F)
106
107
108       Writing Device Drivers
109
110
111
112SunOS 5.11                        3 June 2003              ldi_prop_exists(9F)
Impressum