Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 10 1/13 Information Library |
csx_AccessConfigurationRegister(9F)
csx_Parse_CISTPL_BYTEORDER(9F)
csx_Parse_CISTPL_CFTABLE_ENTRY(9F)
csx_Parse_CISTPL_DEVICEGEO(9F)
csx_Parse_CISTPL_DEVICEGEO_A(9F)
csx_Parse_CISTPL_DEVICE_OA(9F)
csx_Parse_CISTPL_DEVICE_OC(9F)
csx_Parse_CISTPL_LINKTARGET(9F)
csx_Parse_CISTPL_LONGLINK_A(9F)
csx_Parse_CISTPL_LONGLINK_C(9F)
csx_Parse_CISTPL_LONGLINK_MFC(9F)
ddi_get_soft_iblock_cookie(9F)
ddi_intr_get_supported_types(9F)
ddi_prop_lookup_byte_array(9F)
ddi_prop_lookup_int64_array(9F)
ddi_prop_lookup_string_array(9F)
ddi_prop_update_byte_array(9F)
ddi_prop_update_int64_array(9F)
ddi_prop_update_string_array(9F)
ldi_prop_lookup_byte_array(9F)
ldi_prop_lookup_int64_array(9F)
ldi_prop_lookup_string_array(9F)
mac_prop_info_set_default_link_flowctrl(9F)
mac_prop_info_set_default_str(9F)
mac_prop_info_set_default_uint8(9F)
mac_prop_info_set_range_uint32(9F)
net_event_notify_unregister(9F)
net_instance_notify_register(9F)
net_instance_notify_unregister(9F)
net_instance_protocol_unregister(9F)
net_protocol_notify_register(9F)
nvlist_lookup_boolean_array(9F)
nvlist_lookup_boolean_value(9F)
nvlist_lookup_nvlist_array(9F)
nvlist_lookup_string_array(9F)
nvlist_lookup_uint16_array(9F)
nvlist_lookup_uint32_array(9F)
nvlist_lookup_uint64_array(9F)
nvpair_value_boolean_array(9F)
pci_plist_lookup_int16_array(9F)
pci_plist_lookup_int32_array(9F)
pci_plist_lookup_int64_array(9F)
pci_plist_lookup_int8_array(9F)
pci_plist_lookup_string_array(9F)
pci_plist_lookup_uint16_array(9F)
pci_plist_lookup_uint32_array(9F)
pci_plist_lookup_uint64_array(9F)
pci_plist_lookup_uint8_array(9F)
scsi_get_device_type_scsi_options(9F)
scsi_sense_cmdspecific_uint64(9F)
usb_get_current_frame_number(9F)
usb_get_max_pkts_per_isoc_request(9F)
usb_pipe_get_max_bulk_transfer_size(9F)
usb_pipe_stop_intr_polling(9F)
usb_pipe_stop_isoc_polling(9F)
- Lookup property information
#include <sys/sunldi.h> int ldi_prop_lookup_int_array(ldi_handle_t lh, uint_t flags, char *name, int **datap, uint_t *nelementsp);
int ldi_prop_lookup_int64_array(ldi_handle_t lh, uint_t flags, char *name, int64_t **datap, uint_t *nelementsp);
int ldi_prop_lookup_string_array(ldi_handle_t lh, uint_t flags, char *name, char ***datap, uint_t *nelementsp);
int ldi_prop_lookup_string(ldi_handle_t lh, uint_t flags, char *name, char **datap);
int ldi_prop_lookup_byte_array(ldi_handle_t lh, uint_t flags, char *name, uchar_t **datap, uint_t *nelements);
Layered handle.
Possible flag values are some combination of:
Match the lookup request independent of the actual dev_t value that was used when the property was created. The flag indicates any dev_t value (including DDI_DEV_T_NONE) associated with a possible property match will satisfy the matching criteria.
Do not pass request to parent device information node if the property is not found.
Do not look at PROM properties (ignored on platforms that do not support PROM properties).
String containing the property name.
The address of an unsigned integer which, upon successful return, contains the number of elements accounted for in the memory pointed at by datap. Depending on the interface you use, the elements are either integers, strings or bytes.
datap
Pointer address to an array of integers which, upon successful return, point to memory containing the integer array property value.
Pointer address to an array of 64-bit integers which, upon successful return, point to memory containing the integer array property value.
Pointer address to an array of strings which, upon successful return, point to memory containing the array of strings. The string array is formatted as an array of pointers to NULL terminated strings, much like the argv argument to execve(2).
Pointer address to a string which, upon successful return, points to memory containing the NULL terminated string value of the property.
Pointer address to an array of bytes which, upon successful return, point to memory containing the property byte array value.
Solaris DDI specific (Solaris DDI).
The property look up functions search for and, if found, return the value of a given property. 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, string, or byte).
The property search order is as follows:
Search software properties created by the driver.
Search the software properties created by the system (or nexus nodes in the device info tree).
Search the driver global properties list.
If DDI_PROP_NOTPROM is not set, search the PROM properties (if they exist).
If DDI_PROP_DONTPASS is not set, pass this request to the parent device information node of the device represented by the layered handle.
Return DDI_PROP_NOT_FOUND.
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, then 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.
For the ldi_prop_lookup_int_array(), ldi_prop_lookup_int64_array(), ldi_prop_lookup_string_array(), ldi_prop_lookup_string(), and ldi_prop_lookup_byte_array() functions, datap is the address of a pointer which, upon successful return, points to memory containing the value of the property. In each case *datap points to a different type of property value. See the individual descriptions of the functions below for details on the different return values. nelementsp is the address of an unsigned integer which, upon successful return, contains the number of integer, string or byte elements accounted for in the memory pointed at by *datap.
All of the property look up functions may block to allocate memory needed to hold the value of the property.
When a driver has obtained a property with any look up function and is finished with that property, it must be freed by call ddi_prop_free(). ddi_prop_free() must be called with the address of the allocated property. For instance, if you call ldi_prop_lookup_int_array() with datap set to the address of a pointer to an integer, &my-int-ptr, the companion free call is ddi_prop_free(my-int-ptr).
Property look up functions are described below:
This function searches for and returns an array of integer property values. An array of integers is defined to *nelementsp number of 4 byte long integer elements. datap should be set to the address of a pointer to an array of integers which, upon successful return, will point to memory containing the integer array value of the property.
This function searches for and returns an array of integer property values. An array of integers is defined to *nelementsp number of 8 byte long integer elements. datap should be set to the address of a pointer to an array of integers which, upon successful return, will point to memory containing the integer array value of the property This function does not search the PROM for 64-bit property values.
This function searches for and returns a property that is an array of strings. datap should be set to an address of a pointer to an array of strings which, upon successful return, will point to memory containing the array of strings. The array of strings is formatted as an array of pointers to null-terminated strings, much like the argv argument to execve(2).
This function searches for and returns a property that is a null-terminated string. datap should be set to the address of a pointer to a string which, upon successful return, points to memory containing the string value of the property.
This function searches for and returns a property that is an array of bytes. datap should be set to the address of a pointer to an array of bytes which, upon successful return, points to memory containing the byte array value of the property.
Frees the resources associated with a property previously allocated using ldi_prop_lookup_int_array(), ldi_prop_lookup_int64_array(), ldi_prop_lookup_string_array(), ldi_prop_lookup_string(), and ldi_prop_lookup_byte_array().
The functions ldi_prop_lookup_int_array(), ldi_prop_lookup_int64_array(), ldi_prop_lookup_string_array(), ldi_prop_lookup_string(), and ldi_prop_lookup_byte_array() return the following values:
Property found and returned.
If an attempt is made to look up a property with a NULL ldi handle, name is NULL or name is a the null string.
Property not found.
Prop explicitly undefined (see ddi_prop_undefine(9F)).
Property value cannot be decoded.
These functions may be called from user or kernel context.
Using ldi_prop_lookup_int64_array(). The following example demonstrates the use of ldi_prop_lookup_int64_array(). int64_t *options; uint_t noptions; /* * Get the data associated with the integer "options" property * array, along with the number of option integers */ if (ldi_prop_lookup_int64_array(lh, LDI_DEV_T_ANY|DDI_PROP_NOTPROM, "options", &options, &noptions) == DDI_PROP_SUCCESS) { /* * Process the options data from the property * we just received. Let's do "our thing" with data. */ xx_process_options(options, noptions); /* * Free the memory allocated for the property data */ ddi_prop_free(options); }
execve(2), ddi_prop_free(9F), ddi_prop_lookup(9F), ldi_prop_exists(9F) .
Writing Device Drivers