diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-11-11 10:31:59 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2009-11-11 10:31:59 +0000 |
commit | 5fb289bbb3854ae8861cbdde408b77785b765031 (patch) | |
tree | 66593c2247e636962e190451fe4ffdf2f1ce4cc3 /xpp/perl_modules/Dahdi/Hardware | |
parent | 4851444ed4e2a5bde1c438bc2ca8c9145718c78c (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
Diffstat (limited to 'xpp/perl_modules/Dahdi/Hardware')
-rw-r--r-- | xpp/perl_modules/Dahdi/Hardware/USB.pm | 6 |
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, |