驱动程序可以请求其父级的属性,而后者又可以请求其父级。驱动程序可以控制是否将请求传递到其父级以上。
例如,以下示例中的 esp 驱动程序为每个目标维护一个名为 targetx-sync-speed 的整数属性。targetx-sync-speed 中的 x 表示目标编号。prtconf(1M) 命令以详细模式显示驱动程序属性。以下示例列出了 esp 驱动程序的部分内容。
% prtconf -v ... esp, instance #0 Driver software properties: name <target2-sync-speed> length <4> value <0x00000fa0>. ... |
系列 |
属性接口 |
说明 |
---|---|---|
ddi_prop_lookup |
查找属性,如果该属性存在,则成功返回。如果该属性不存在,则失败。 |
|
|
查找并返回整数属性 |
|
|
查找并返回 64 位整数属性 |
|
|
查找并返回整数数组属性 |
|
|
查找并返回 64 位整数数组属性 |
|
|
查找并返回字符串属性 |
|
|
查找并返回字符串数组属性 |
|
|
查找并返回字节数组属性 |
|
ddi_prop_update |
更新或创建整数属性 |
|
|
更新或创建单个 64 位整数属性 |
|
|
更新或创建整数数组属性 |
|
|
更新或创建字符串属性 |
|
|
更新或创建字符串数组属性 |
|
|
更新或创建 64 位整数数组属性 |
|
|
更新或创建字节数组属性 |
|
ddi_prop_remove |
删除单个属性 |
|
|
删除与设备关联的所有属性 |
尽可能使用 64 位版本的 int
属性接口(如 ddi_prop_update_int64(9F)),而不要使用 32 位版本(如 ddi_prop_update_int(9F))。