summaryrefslogtreecommitdiff
path: root/xpp/utils/zconf/Zaptel/Hardware/PCI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/utils/zconf/Zaptel/Hardware/PCI.pm')
-rw-r--r--xpp/utils/zconf/Zaptel/Hardware/PCI.pm37
1 files changed, 15 insertions, 22 deletions
diff --git a/xpp/utils/zconf/Zaptel/Hardware/PCI.pm b/xpp/utils/zconf/Zaptel/Hardware/PCI.pm
index d471c1f..7d4e2b3 100644
--- a/xpp/utils/zconf/Zaptel/Hardware/PCI.pm
+++ b/xpp/utils/zconf/Zaptel/Hardware/PCI.pm
@@ -8,6 +8,7 @@ package Zaptel::Hardware::PCI;
# $Id$
#
use strict;
+use XppUtils;
use Zaptel::Hardware;
our @ISA = qw(Zaptel::Hardware);
@@ -45,9 +46,10 @@ my %pci_ids = (
'e159:0001/e16b' => { DRIVER => 'pciradio', DESCRIPTION => 'PCIRADIO' },
# from wcfxo
+ 'e159:0001/8084' => { DRIVER => 'wcfxo', DESCRIPTION => 'Wildcard X101P clone' },
'e159:0001/8085' => { DRIVER => 'wcfxo', DESCRIPTION => 'Wildcard X101P' },
- 'e159:0001/8086' => { DRIVER => 'wcfxo', DESCRIPTION => 'Generic Clone' },
- 'e159:0001/8087' => { DRIVER => 'wcfxo', DESCRIPTION => 'Generic Clone' },
+ 'e159:0001/8086' => { DRIVER => 'wcfxo', DESCRIPTION => 'Wildcard X101P clone' },
+ 'e159:0001/8087' => { DRIVER => 'wcfxo', DESCRIPTION => 'Wildcard X101P clone' },
'1057:5608' => { DRIVER => 'wcfxo', DESCRIPTION => 'Wildcard X100P' },
# from wct1xxp
@@ -104,25 +106,16 @@ my %pci_ids = (
'0b0b:0705' => { DRIVER => 'rcbfx', DESCRIPTION => 'Rhino R24FXS' },
'0b0b:0706' => { DRIVER => 'rcbfx', DESCRIPTION => 'Rhino RCB24FXO 24-Channel FXO analog telphony card' },
'0b0b:0906' => { DRIVER => 'rcbfx', DESCRIPTION => 'Rhino RCB24FXX 24-channel modular analog telphony card' },
+
+ # Sangoma cards (based on pci.ids)
+ '1923:0040' => { DRIVER => 'wanpipe', DESCRIPTION => 'Sangoma Technologies Corp. A200/Remora FXO/FXS Analog AFT card' },
+ '1923:0100' => { DRIVER => 'wanpipe', DESCRIPTION => 'Sangoma Technologies Corp. A104d QUAD T1/E1 AFT card' },
+ '1923:0300' => { DRIVER => 'wanpipe', DESCRIPTION => 'Sangoma Technologies Corp. A101 single-port T1/E1' },
+ '1923:0400' => { DRIVER => 'wanpipe', DESCRIPTION => 'Sangoma Technologies Corp. A104u Quad T1/E1 AFT' },
);
$ENV{PATH} .= ":/usr/sbin:/sbin:/usr/bin:/bin";
-# Accessors (miniperl does not have Class:Accessor)
-our $AUTOLOAD;
-sub AUTOLOAD {
- my $self = shift;
- my $name = uc($AUTOLOAD);
- $name =~ s/.*://; # strip fully-qualified portion
- if (@_) {
- return $self->{$name} = shift;
- } else {
- return $self->{$name};
- }
-}
-
-my @devices;
-
sub pci_sorter {
return $a->priv_device_name() cmp $b->priv_device_name();
}
@@ -136,11 +129,6 @@ sub new($$) {
return $self;
}
-sub devices($) {
- my $pack = shift or die "Wasn't called as a class method\n";
- return sort pci_sorter @devices;
-}
-
my %pci_devs;
sub readfile($) {
@@ -153,6 +141,8 @@ sub readfile($) {
}
sub scan_devices($) {
+ my @devices;
+
while(</sys/bus/pci/devices/*>) {
m,([^/]+)$,,;
my $name = $1;
@@ -182,6 +172,7 @@ sub scan_devices($) {
next unless defined $pci_ids{$key};
my $d = Zaptel::Hardware::PCI->new(
+ BUS_TYPE => 'PCI',
PRIV_DEVICE_NAME => $dev->{PRIV_DEVICE_NAME},
VENDOR => $dev->{VENDOR},
PRODUCT => $dev->{PRODUCT},
@@ -193,6 +184,8 @@ sub scan_devices($) {
);
push(@devices, $d);
}
+ @devices = sort pci_sorter @devices;
+ return @devices;
}
1;