summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-11-11 10:31:59 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2009-11-11 10:31:59 +0000
commit5fb289bbb3854ae8861cbdde408b77785b765031 (patch)
tree66593c2247e636962e190451fe4ffdf2f1ce4cc3
parent4851444ed4e2a5bde1c438bc2ca8c9145718c78c (diff)
dahdi-perl: only get 'serial' and 'devnum' attributes from Astribanks
We can tell if a device is an Astribank by the vendorId and productId attribute. Get other attributed only after we give up on other devices. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@7558 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--xpp/perl_modules/Dahdi/Hardware/USB.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/xpp/perl_modules/Dahdi/Hardware/USB.pm b/xpp/perl_modules/Dahdi/Hardware/USB.pm
index d4985b8..48690da 100644
--- a/xpp/perl_modules/Dahdi/Hardware/USB.pm
+++ b/xpp/perl_modules/Dahdi/Hardware/USB.pm
@@ -131,13 +131,13 @@ sub scan_devices_sysfs($) {
# busnum:
m|/(\d+)-\d+$|;
my $busnum = $1 || next;
- my $devnum = _get_attr("$_/devnum");
my $vendor = _get_attr("$_/idVendor");
my $product = _get_attr("$_/idProduct");
- my $serial = _get_attr("$_/serial") or return undef;
- my $devname = sprintf("%03d/%03d", $busnum, $devnum);
my $model = $usb_ids{"$vendor:$product"};
next unless defined $model;
+ my $devnum = _get_attr("$_/devnum");
+ my $serial = _get_attr("$_/serial");
+ my $devname = sprintf("%03d/%03d", $busnum, $devnum);
my $d = Dahdi::Hardware::USB->new(
IS_ASTRIBANK => ($model->{DRIVER} eq 'xpp_usb')?1:0,
PRIV_DEVICE_NAME => $devname,