summaryrefslogtreecommitdiff
path: root/xpp/perl_modules/Dahdi/Xpp/Xbus.pm
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-03-02 18:07:37 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2010-03-02 18:07:37 +0000
commitee0e06c99e2cf44c23984e84b592ff82af68b19b (patch)
treee3c8fc7310253671fcc7d1b77a4b308013da72dd /xpp/perl_modules/Dahdi/Xpp/Xbus.pm
parentff09b1ff474333d8f7e51a8f4ef84a2f9cd9e395 (diff)
DAHDI-perl: allow setting base of system files with DAHDI_VIRT_TOP
If the user set DAHDI_VIRT_TOP in the environment, consider it as a path under which to look for ProcFS and SysFS files. This allows running the DAHDI-perl tools on filesystem dumps generated by build_tools/dump_sys_state . To reduce the number of dependencies between various modules, the 'xpd' member of a Dahdi::Span is removed. Dahdi::Xpp::xpd_of_span() can be used if needed. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@8215 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/perl_modules/Dahdi/Xpp/Xbus.pm')
-rw-r--r--xpp/perl_modules/Dahdi/Xpp/Xbus.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/xpp/perl_modules/Dahdi/Xpp/Xbus.pm b/xpp/perl_modules/Dahdi/Xpp/Xbus.pm
index 4bc1844..b68d7cc 100644
--- a/xpp/perl_modules/Dahdi/Xpp/Xbus.pm
+++ b/xpp/perl_modules/Dahdi/Xpp/Xbus.pm
@@ -12,8 +12,6 @@ use Dahdi::Utils;
use Dahdi::Hardware;
use Dahdi::Xpp::Xpd;
-my $proc_base = "/proc/xpp";
-
sub xpds($) {
my $xbus = shift;
return @{$xbus->{XPDS}};
@@ -54,7 +52,7 @@ sub xbus_attr_path($$) {
foreach my $attr (@attr) {
my $file = sprintf "$Dahdi::Xpp::sysfs_astribanks/xbus-%02d/$attr", $busnum;
unless(-f $file) {
- my $procfile = sprintf "/proc/xpp/XBUS-%02d/$attr", $busnum;
+ my $procfile = sprintf "$Dahdi::proc_xpp_base/XBUS-%02d/$attr", $busnum;
warn "$0: warning - OLD DRIVER: missing '$file'. Fall back to '$procfile'\n"
unless $file_warned{$attr}++;
$file = $procfile;
@@ -113,7 +111,7 @@ sub transport_type($$) {
sub read_xpdnames_old($) {
my $xbus_num = shift || die;
- my $pat = sprintf "/proc/xpp/XBUS-%02d/XPD-[0-9][0-9]", $xbus_num;
+ my $pat = sprintf "$Dahdi::proc_xpp_base/XBUS-%02d/XPD-[0-9][0-9]", $xbus_num;
my @xpdnames;
#print STDERR "read_xpdnames_old($xbus_num): $pat\n";
@@ -175,7 +173,7 @@ sub new($$) {
}
foreach my $xpdstr (@xpdnames) {
my ($busnum, $unit, $subunit) = split(/:/, $xpdstr);
- my $procdir = "/proc/xpp/XBUS-$busnum/XPD-$unit$subunit";
+ my $procdir = "$Dahdi::proc_xpp_base/XBUS-$busnum/XPD-$unit$subunit";
my $xpd = Dahdi::Xpp::Xpd->new($self, $unit, $subunit, $procdir, "$xbus_dir/$xpdstr");
push(@xpds, $xpd);
}