#ident "@(#)di_hp_name.3devinfo.txt 1.2 09/08/09 SMI" Device Information Library Functions di_hp_name(3DEVINFO) NAME di_hp_name, di_hp_type, di_hp_description, di_hp_state, di_hp_connection, di_hp_depends_on, di_hp_last_change, di_hp_child - return libdevinfo hotplug connection data. SYNOPSIS cc [ flag... ] file... -ldevinfo [ library... ] #include char *di_hp_name(di_hp_t hp); int di_hp_type(di_hp_t hp); char *di_hp_description(di_hp_t hp); int di_hp_state(di_hp_t hp); int di_hp_connection(di_hp_t hp); int di_hp_depends_on(di_hp_t hp); di_node_t di_hp_child(di_hp_t hp); time_t di_hp_last_change(di_hp_t hp); PARAMETERS hp A handle to hotplug connection node. DESCRIPTION These functions return libdevinfo hotplug node information. There is a hierarchical relationship between a device node, its physical hotplug connectors, its virtual hotplug ports, and its child devices. If a device node represents a point in the system where devices can be physically hotplugged, then it has one or more associated hotplug connector nodes. If a device node represents a point where devices can be virtually hotplugged, then it has one or more associated hotplug ports. If a device node supports both physical and virtual hotplug, then it has both connectors and ports that are associated with it. Generally, hotplug connectors are immediately subordinate to the device node. Hotplug ports are immediately subordinate to connectors. And child devices are immediately subordinate to ports. The relationships can be discerned using the return values of the di_hp_connection(), di_hp_depends_on(), and di_hp_child() functions. See the example below for more details. If a device node supports only virtual hotplug, then it will only have hotplug port connections associated with it. The di_hp_depends_on() function will return -1 for its virtual hotplug ports in this case. RETURN VALUES The di_hp_name() function returns the hotplug connection name. Each hotplug connection associated with a device node has a name which is unique within the scope of the device with which it is associated. The di_hp_type() function returns what type of connection is represented by the hotplug connection node. Possible values are defined by the Solaris DDI. See the definition of the enumerated type ddi_cn_type_t. The di_hp_description() function returns a string equivalent of the hotplug connection type. It describes what type of hotplug connection point is being represented. The di_hp_state() function returns the current hotplug state of the hotplug connection. Possible values are defined by the Solaris DDI. See the definition of the enumerated type ddi_hp_cn_state_t. The di_hp_connection() function returns the connection number of a hotplug connection node. All hotplug connectors and ports associated with a device node are enumerated. The connection number is unique within the scope of the device node with which it is associated. The di_hp_depends_on() function returns the connection number of another hotplug connection that the hotplug connection node depends upon. If a hotplug connection node represents a port that is dependent upon a physical hotplug connector, then the di_hp_depends_on() function when used on the port node will return the connection number of the connector. If the hotplug connection node does not depend upon any other node, then the function returns -1. The di_hp_child() function returns the device node that is connected to the system as a child of a hotplug connection. If the child device node is not attached, then the function returns DI_NODE_NIL. Only virtual hotplug port connections have child device nodes. The di_hp_last_change() function returns a timestamp when the state of a hotplug connection node was last changed. ERRORS No errors are defined. EXAMPLES Consider a system with one PCI bus that supports both physical and virtual hotplug. The PCI bus has three slots. The first slot contains a storage controller. The second slot contains a network controller. The third slot is empty. The device node hierarchy of such a system is: /pci@0,0 (PCI bus) | +--> /pci@0,0/storage@0,0 (Storage Controller) | +--> /pci@0,0/network@0,0 (Network Controller) The list of hotplug connection nodes associated with the PCI bus (/pci@0,0) will contain three physical connectors, two of which will have associated virtual ports with attached child devices. The list of hotplug connection nodes and their data is: Name: "pci0,0" Dscription: "PCI Slot" State: DDI_HP_CN_STATE_ENABLED Connection Number: 0 Depends On: -1 Child: DI_NODE_NIL Name: "pci0,1" Dscription: "PCI Slot" State: DDI_HP_CN_STATE_ENABLED Connection Number: 1 Depends On: -1 Child: DI_NODE_NIL Name: "pci0,2" Dscription: "PCI Slot" State: DDI_HP_CN_STATE_EMPTY Connection Number: 2 Depends On: -1 Child: DI_NODE_NIL Name: "pci.0,0" Description: "VIRTUAL PORT" State: DDI_HP_CN_STATE_OPERATIONAL Connection Number: 3 Depends On: 0 Child: (storage@0,0) Name: "pci.0,1" Description: "VIRTUAL PORT" State: DDI_HP_CN_STATE_OPERATIONAL Connection Number: 4 Depends on: 1 Child: (network@0,0) ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Consolidation Private | |_____________________________|_____________________________| | MT-Level | Safe | |_____________________________|_____________________________| SEE ALSO attributes(5) Writing Device Drivers