[dahdi-commits] tzafrir: branch tools/tzafrir/perl-sysstate r7826 - in /tools/team/tzafrir/pe...
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Sun Jan 10 08:45:29 CST 2010
Author: tzafrir
Date: Sun Jan 10 08:45:26 2010
New Revision: 7826
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7826
Log:
dahdi-perl: More globals to set in set_virt_base
Modified:
tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi.pm
tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware.pm
tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/PCI.pm
tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/USB.pm
Modified: tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi.pm
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi.pm?view=diff&rev=7826&r1=7825&r2=7826
==============================================================================
--- tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi.pm (original)
+++ tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi.pm Sun Jan 10 08:45:26 2010
@@ -35,6 +35,8 @@
our $virt_base;
our $proc_dahdi_base;
our $proc_xpp_base;
+our $proc_usb_base;
+our $sys_base;
# Initializes procfs and sysfs system root. Should be called before
# any of those variables are used.
@@ -51,6 +53,8 @@
}
$proc_dahdi_base = "$virt_base/proc/dahdi";
$proc_xpp_base = "$virt_base/proc/xpp";
+ $proc_usb_base = "$virt_base/proc/bus/usb";
+ $sys_base = "$virt_base/sys";
}
=head1 spans()
Modified: tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware.pm
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware.pm?view=diff&rev=7826&r1=7825&r2=7826
==============================================================================
--- tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware.pm (original)
+++ tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware.pm Sun Jan 10 08:45:26 2010
@@ -176,6 +176,8 @@
my $pack = shift || die;
return if $hardware_scanned++;
+ Dahdi::set_virt_base();
+
foreach my $type (qw(PCI USB)) {
eval "use Dahdi::Hardware::$type";
die $@ if $@;
Modified: tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/PCI.pm
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/PCI.pm?view=diff&rev=7826&r1=7825&r2=7826
==============================================================================
--- tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/PCI.pm (original)
+++ tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/PCI.pm Sun Jan 10 08:45:26 2010
@@ -170,7 +170,7 @@
sub scan_devices($) {
my @devices;
- while(</sys/bus/pci/devices/*>) {
+ while(<$Dahdi::sys_base/bus/pci/devices/*>) {
m,([^/]+)$,,;
my $name = $1;
my $l = readlink $_ || die;
Modified: tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/USB.pm
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/USB.pm?view=diff&rev=7826&r1=7825&r2=7826
==============================================================================
--- tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/USB.pm (original)
+++ tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Hardware/USB.pm Sun Jan 10 08:45:26 2010
@@ -135,7 +135,7 @@
my $pack = shift || die;
my @devices = ();
- while (</sys/bus/usb/devices/*-*>) {
+ while (<$Dahdi::sys_base/bus/usb/devices/*-*>) {
next unless -r "$_/idVendor"; # endpoints
# Older kernels, e.g. 2.6.9, don't have the attribute
@@ -165,7 +165,7 @@
sub scan_devices($) {
my $pack = shift || die;
- my $usb_device_list = "/proc/bus/usb/devices";
+ my $usb_device_list = "$Dahdi::proc_usb_base/devices";
return $pack->scan_devices_sysfs() unless (-r $usb_device_list);
my @devices;
More information about the dahdi-commits
mailing list