Dagobert Michelsen > Solaris-DeviceTree-0.03 > Solaris::DeviceTree::PathToInst

Download:
Solaris-DeviceTree-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.06   Source  

NAME ^

Solaris::DeviceTree::PathToInst - Perl interface to /etc/path_to_inst

SYNOPSIS ^

  use Solaris::DeviceTree::PathToInst;
  $tree = new Solaris::DeviceTree::PathToInst;
  $tree = new Solaris::DeviceTree::PathToInst( filename => '/a/etc/path_to_inst' );
  $root = $node->root_node;
  $path = $node->devfs_path;
  $nodename = $node->node_name;
  $busaddr = $node->bus_addr;
  $instance = $node->instance;
  $drivername = $node->driver_name;

DESCRIPTION ^

This module implements the Solaris::DeviceTree::Node interface and allows access to the Solaris driver configuration file /etc/path_to_inst via a hierarchical tree structure. The API of this class overwrites methods from the base class applicable to this context.

A line in the path_to_inst looks like this:

  "<devfs_path>" <instance> "<driver_name>"

The devfs_path is build out of the components

  <node_name>@<bus_addr>/<node_name>@<bus_addr>/...

and it is split at the / to build the node hierarchy.

METHODS ^

The following methods are available:

new

The constructor takes an optional named option filename to a location of a path_to_inst file and returns a reference to the root node object. If no filename is given the file from the running system at /etc/path_to_inst is used.

root_node

Returns the root node of the tree.

devfs_path

Returns the physical path assocatiated with this node.

node_name

Returns the name of the node. The value is derived from the "devfs_path" path. It is undefined for the root node and guaranteed to be defined for all other nodes.

driver_name

Returns the driver name for the node.

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.

instance

Returns the instance number for this node of the bound driver. undef is returned if no instance number has been assigned.

AUTHOR ^

Copyright 1999-2003 Dagobert Michelsen.

SEE ALSO ^

Solaris::DeviceTree, Solaris::DeviceTree::Node, path_to_inst(4).

syntax highlighting: