From 5fb289bbb3854ae8861cbdde408b77785b765031 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 11 Nov 2009 10:31:59 +0000 Subject: 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 --- xpp/perl_modules/Dahdi/Hardware/USB.pm | 6 +++--- 1 file 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, -- cgit v1.2.3