Linux::Sysfs::Driver - sysfs drivers
my $driver = Linux::Sysfs::Driver->open('pci', 'tg3'); my @attrs = $driver->get_attrs; my @devices = $driver->get_devices; $driver->close;
Drivers are represented in sysfs under the /sys/bus/xxx/drivers (xxx being the bus type, such as "pci", "usb, and so on).
my $driver = Linux::Sysfs::Driver->open($bus_name, $name);
Given the name of the bus,
$bus_name, on which to look for, this method locates a given driver and returns a Linux::Sysfs::Driver instance corresponding to the requested device or undef, if no matching driver was found.
my $driver = Linux::Sysfs::Driver->open_path($path);
Opens driver at specific
$path. Returns a Linux::Sysfs::Driver instance on success or undef on failure.
Closes and cleans up
my $attr = $driver->get_attribute($name);
$driver's attributes by
$nameand returns the corresponding Linux::Sysfs::Attribute instance or undef, of no matching attribute was found.
my @attrs = $driver->get_attributes;
$driverand returns a list of Linux::Sysfs::Attribute instances for the driver.
my @devices = $driver->get_devices;
Returns a list of Linux::Sysfs::Device instances that use this
my $module = $driver->get_module;
Returns the module that the
my $name = $driver->name;
my $path = $driver->path;
$driver's full path in sysfs.
my $bus_name = $driver->bus;
Returns the name of the bus on which the
Florian Ragwitz <firstname.lastname@example.org>
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.