diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-10-16 18:03:47 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-10-16 18:03:47 +0000 |
commit | f48e3505473b9be26fa6d71c8437a87abde608f1 (patch) | |
tree | 5de89f01c6b0882b780447501327cd052cf6da31 /xpp/perl_modules/Dahdi/Xpp/Xpd.pm | |
parent | eb21b700dd088304d1d9da2a657d4665ca655e23 (diff) |
xpp: userspace support for sysfx migration.
The userspace side of dahdi-linux r5097.
* Perl modules default to using xpp sysfs but will fallback (with warning)
to procfs interface.
* An additional /usr/share/dahdi/waitfor_xpds to replace the line in the
init.d script.
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@5099 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'xpp/perl_modules/Dahdi/Xpp/Xpd.pm')
-rw-r--r-- | xpp/perl_modules/Dahdi/Xpp/Xpd.pm | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/xpp/perl_modules/Dahdi/Xpp/Xpd.pm b/xpp/perl_modules/Dahdi/Xpp/Xpd.pm index d85ae68..591c52f 100644 --- a/xpp/perl_modules/Dahdi/Xpp/Xpd.pm +++ b/xpp/perl_modules/Dahdi/Xpp/Xpd.pm @@ -12,14 +12,14 @@ use Dahdi::Utils; use Dahdi::Xpp; use Dahdi::Xpp::Line; -my $proc_base = "/proc/xpp"; - sub blink($$) { my $self = shift; my $on = shift; my $result; - - my $file = "$proc_base/" . $self->fqn . "/blink"; + my $file = Dahdi::Xpp::xpd_attr_path( + $self->xbus->num, + $self->unit, + $self->subunit, "blink"); die "$file is missing" unless -f $file; # First query open(F, "$file") or die "Failed to open $file for reading: $!"; @@ -44,8 +44,10 @@ sub dahdi_registration($$) { my $self = shift; my $on = shift; my $result; - - my $file = "$proc_base/" . $self->fqn . "/dahdi_registration"; + my $file = Dahdi::Xpp::xpd_attr_path( + $self->xbus->num, + $self->unit, + $self->subunit, "span", "dahdi_registration"); die "$file is missing" unless -f $file; # First query open(F, "$file") or die "Failed to open $file for reading: $!"; @@ -101,8 +103,10 @@ sub new($$) { } } close F; - $head =~ s/^(XPD-(\d\d))\s+// || die; - $self->{ID} = $2; + $head =~ s/^(XPD-(\d)(\d))\s+// || die; + $self->{ID} = "$2$3"; + $self->{UNIT} = "$2"; + $self->{SUBUNIT} = "$3"; $self->{FQN} = $xbus->name . "/" . $1; $head =~ s/^.*\(// || die; $head =~ s/\) */, / || die; |