[svn-commits] tzafrir: branch tools/tzafrir/perl-sysstate r7720 - /tools/team/tzafrir/perl-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 21 16:49:11 CST 2009


Author: tzafrir
Date: Mon Dec 21 16:49:09 2009
New Revision: 7720

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7720
Log:
Add the /sys pathes in Dahdi::Xpp

Use the existing "global" sysfs path variables in Dahdi::Xpp. However
initialize them at startup using $Dahdi::virt_base .

There's one extra place we need to initialize the list (at the hardware
scan).

Also one extra forgotten /proc change.

Modified:
    tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Xpp.pm

Modified: tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Xpp.pm
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Xpp.pm?view=diff&rev=7720&r1=7719&r2=7720
==============================================================================
--- tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Xpp.pm (original)
+++ tools/team/tzafrir/perl-sysstate/xpp/perl_modules/Dahdi/Xpp.pm Mon Dec 21 16:49:09 2009
@@ -34,14 +34,24 @@
 #
 my @xbuses;
 
-my $proc_base = "/proc/xpp";
-our $sysfs_astribanks = "/sys/bus/astribanks/devices";
-our $sysfs_xpds = "/sys/bus/xpds/devices";
-our $sysfs_ab_driver = "/sys/bus/astribanks/drivers/xppdrv";
+our $sysfs_astribanks;
+our $sysfs_xpds;
+our $sysfs_ab_driver;
+
+sub set_virt_base() {
+	return if defined $sysfs_xpds;
+	Dahdi::set_virt_base();
+
+	my $virt_base = $Dahdi::virt_base;
+	$sysfs_astribanks = "$virt_base/sys/bus/astribanks/devices";
+	$sysfs_xpds = "$virt_base/sys/bus/xpds/devices";
+	$sysfs_ab_driver = "$virt_base/sys/bus/astribanks/drivers/xppdrv";
+}
 
 sub scan($) {
 	my $pack = shift || die;
 
+	set_virt_base();
 	opendir(D, $sysfs_astribanks) || return();
 	while(my $entry = readdir D) {
 		next unless $entry =~ /xbus-(\d+)/;
@@ -253,6 +263,7 @@
 	my $result;
 	my $newapi = 0;
 
+	my $proc_base = $Dahdi::proc_xpp_base;
 	my $file = "$proc_base/sync";
 	return '' unless -f $file;
 	# First query




More information about the svn-commits mailing list