NAME
Solaris::DeviceTree - Perl interface to the Solaris devicetree
SYNOPSIS
use Solaris::DeviceTree
my $tree = new Solaris::DeviceTree;
my @children = $tree->children;
DESCRIPTION
The Solaris::DeviceTree
module implements access to the Solaris device information. The information is collected from the kernel via access to libdevinfo
, the contents of the file /etc/path_to_inst
and the filesystem entries below /dev
and /devices
. The devicetree is presented as a hierarchical collection of node. Each node contains the unified information from all available resources.
EXPORT
PROPERTIES
Each node of the devicetree has the following properties:
METHODS
The following methods are available:
- $devtree = Solaris::DeviceTree->new
- $devtree = Solaris::DeviceTree->new( use => [ qw( libdevinfo path_to_inst filesystem ) ] );
-
The constructor returns a reference to a
Solaris::DeviceTree
object which itself implements theSolaris::DeviceTree::Node
interface. The instance returned represents the root-node of the devicetree. - $devtree->DESTROY;
-
This methos removes all internal data structures which are associated with this object.
- @children = $devtree->child_nodes
-
This method returns a list with all children.
- $node = $devtree->parent_node
-
Returns the parent node for the object. If the object is toplevel, then
undef
is returned. - $node = $devtree->root_node
-
Returns the root node of the tree.
- @siblings = $devtree->sibling_nodes
-
Returns the list of siblings for the object. A sibling is a child from our parent, but not ourselves.
- $path = $devtree->devfs_path
-
Returns the physical path assocatiated with this node.
- $nodename = $devtree->node_name;
-
Returns the name of the node.
- $bindingname = $devtree->binding_name;
-
Returns the binding name for this node. The binding name is the name used by the system to select a driver for the device.
- $busadr = $devtree->bus_addr;
-
Returns the address on the bus for this node.
undef
is returned if a bus address has not been assigned to the device. A zero-length string may be returned and is considered a valid bus address. - @compat_names = $devtree->compatible_names;
-
Returns the list of names from compatible device for the current node. See the discussion of generic names in "Writing Device Drivers" for a description of how compatible names are used by Solaris to achieve driver binding for the node.
- $devid = $devtree->devid
-
Returns the device ID for the node, if it is registered. Otherwise,
undef
is returned. - $drivername = $devtree->driver_name;
-
Returns the name of the driver for the node or
undef
if the node is not bound to any driver. - @minor = @{$node->minor_nodes}
-
Returns a list of all minor nodes which are associated with this node. The minor nodes are of class Solaris::DeviceTree::MinorNode.
EXAMPLES
AUTHOR
Copyright 1999-2003 Dagobert Michelsen.
SEE ALSO
BUGS
* As an additional feature access to the libcfgadm should be included.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 434:
You forgot a '=back' before '=head1'