A driver can request a property from its parent, which in turn might ask its parent. The driver can control whether the request can go higher than its parent.
For example, the example driver below, “esp,” maintains an integer property for each target called targetx-sync-speed, where “x” is the target number. The prtconf(1M) command in its verbose mode displays driver properties. The following example shows a partial listing for the “esp” driver.
% prtconf -v ... esp, instance #0 Driver software properties: name <target2-sync-speed> length <4> value <0x00000fa0>. ...
The following table provides a summary of the property interfaces.
Table 4–1 Property Interface Uses
Family |
Property Interfaces |
Description |
---|---|---|
ddi_prop_lookup |
Looks up a property and returns successfully if one exists. Fails if one does not exist |
|
|
Looks up and returns an integer property |
|
|
Looks up and returns a 64–bit integer property |
|
|
Looks up and returns an integer array property |
|
|
Looks up and returns a 64–bit integer array property |
|
|
Looks up and returns a string property |
|
|
Looks up and returns a string array property |
|
|
Looks up and returns a byte array property |
|
ddi_prop_update |
Updates or creates an integer property |
|
|
Updates or creates a single 64–bit integer property |
|
|
Updates or creates an integer array property |
|
|
Updates or creates a string property |
|
|
Updates or creates a string array property |
|
|
Updates or creates a 64–bit integer array property |
|
|
Updates or creates a byte array property |
|
ddi_prop_remove |
Removes a property |
|
|
Removes all properties associated with a device |
Whenever possible, use 64–bit versions of int
property interfaces (such as ddi_prop_update_int64(9F)) instead of 32–bit versions (such as ddi_prop_update_int(9F)).