[svn-commits] tzafrir: tools/trunk r10153 - /tools/trunk/xpp/perl_modules/Dahdi/Hardware/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 25 05:32:20 CDT 2011


Author: tzafrir
Date: Thu Aug 25 05:32:17 2011
New Revision: 10153

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10153
Log:
dahdi-perl: Also get USB loaded driver from usbfs

Signed-off-by: Oron Peled <oron.peled at xorcom.com>
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

Modified:
    tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm

Modified: tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm?view=diff&rev=10153&r1=10152&r2=10153
==============================================================================
--- tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm (original)
+++ tools/trunk/xpp/perl_modules/Dahdi/Hardware/USB.pm Thu Aug 25 05:32:17 2011
@@ -183,6 +183,7 @@
 		my @lines = split(/\n/);
 		my ($tline) = grep(/^T/, @lines);
 		my ($pline) = grep(/^P/, @lines);
+		my ($dline) = grep(/^I/, @lines);
 		my ($sline) = grep(/^S:.*SerialNumber=/, @lines);
 		my ($busnum,$devnum) = ($tline =~ /Bus=(\w+)\W.*Dev#=\s*(\w+)\W/);
 		my $devname = sprintf("%03d/%03d", $busnum, $devnum);
@@ -192,6 +193,10 @@
 			$sline =~ /SerialNumber=(.*)/;
 			$serial = $1;
 			#$serial =~ s/[[:^print:]]/_/g;
+		}
+		my $loaded;
+		if ($dline =~ /Driver=(\w+)/) {
+			$loaded = $1;
 		}
 		my $model = $usb_ids{"$vendor:$product"};
 		next unless defined $model;
@@ -203,6 +208,7 @@
 			SERIAL			=> $serial,
 			DESCRIPTION		=> $model->{DESCRIPTION},
 			DRIVER			=> $model->{DRIVER},
+			LOADED			=> $loaded,
 			);
 		push(@devices, $d);
 	}




More information about the svn-commits mailing list