ddi_prop_exists - check for the existence of a property
#include <sys/ddi.h> #include <sys/sunddi.h> int ddi_prop_exists(dev_t match_dev, dev_info_t *dip, uint_t flags, char *name);
Solaris DDI specific (Solaris DDI).
match_dev
dip
flags
DDI_PROP_DONTPASS
DDI_PROP_NOTPROM
name
ddi_prop_exists() checks for the existence of a property regardless of the property value data type.
Properties are searched for based on the dip, name, and match_dev. The property search order is as follows:
Usually, the match_dev argument should be set to the actual device number that this property is associated with. However, if the match_dev argument is DDI_DEV_T_ANY, then ddi_prop_exists() will match the request regardless of the match_dev the property was created with. That is the first property whose name matches name will be returned. 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 created with match_dev set to DDI_DEV_T_NONE.
name must always be set to the name of the property being looked up.
ddi_prop_exists() returns 1 if the property exists and 0 otherwise.
These functions can be called from user or kernel context.
Example 1 : Using ddi_prop_exists()
The following example demonstrates the use of ddi_prop_exists().
/* * Enable "whizzy" mode if the "whizzy-mode" property exists */ if (ddi_prop_exists(xx_dev, xx_dip, DDI_PROP_NOTPROM, "whizzy-mode") == 1) { xx_enable_whizzy_mode(xx_dip); } else { xx_disable_whizzy_mode(xx_dip); }
ddi_prop_get_int(9F), ddi_prop_lookup(9F), ddi_prop_remove(9F), ddi_prop_update(9F)
Writing Device Drivers
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |