NAME
Linux::Sysfs::Bus - sysfs buses
SYNOPSIS
my $bus = Linux::Sysfs::Bus->open('pci');
my @devices = $bus->get_devices;
my @drivers = $bus->get_drivers;
$bus->close;
DESCRIPTION
The library provides functions for viewing buses represented in sysfs.
METHODS
- open
-
my $bus = Linux::Sysfs::Bus->open($name);
Opens up one of the buses represented in sysfs in the /sys/bus directory.
$name
is the name of the bus to open (e.g. "pci"). It returns a Linux::Sysfs::Bus instance on success or undef on failure. - close
-
$bus->close;
Closes up the sysfs_bus structure including its devices, and drivers and the list of attributes.
- get_devices
-
my @devices = $bus->get_devices;
Returns a list of Linux::Sysfs::Device instances that are registered with this bus.
- get_drivers
-
my @drivers = $bus->get_drivers;
Returns a list of Linux::Sysfs::Driver instances that are registered with this bus.
- get_device
-
my $device = $bus->get_device($id);
Looks for a device with the given
$id
on this bus. On success, it returns a Linux::Sysfs::Device instance, otherwise undef. - get_driver
-
my $driver = $bus->get_driver($name);
Looks for a driver with the given
$name
on this bus. On success, it returns a Linux::Sysfs::Driver instance, otherwise undef. - name
-
my $name = $bus->name;
Returns the bus' name.
- path
-
my $path = $attr->path;
Returns the full path to the bus' file in sysfs.
AUTHOR
Florian Ragwitz <rafl@debian.org>
COPYRIGHT & LICENSE
Copyright 2006 Florian Ragwitz, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.