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.
$bus_name
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.
$path
$driver->close;
Closes and cleans up $driver.
$driver
my $attr = $driver->get_attribute($name);
Searches supplied $driver's attributes by $name and returns the corresponding Linux::Sysfs::Attribute instance or undef, of no matching attribute was found.
$name
my @attrs = $driver->get_attributes;
Takes a $driver and 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 $driver.
my $module = $driver->get_module;
Returns the module that the $driver is using.
my $name = $driver->name;
Returns the $driver's name.
my $path = $driver->path;
Returns the $driver's full path in sysfs.
my $bus_name = $driver->bus;
Returns the name of the bus on which the $device is registered.
$device
Florian Ragwitz <rafl@debian.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.
To install Linux::Sysfs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::Sysfs
CPAN shell
perl -MCPAN -e shell install Linux::Sysfs
For more information on module installation, please visit the detailed CPAN module installation guide.