[PATCH 5/5] m920x_parse.pl: add support for consuming the output of parse-sniffusb2.pl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 contrib/m920x/m920x_parse.pl |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/contrib/m920x/m920x_parse.pl b/contrib/m920x/m920x_parse.pl
index b315400..b309250 100755
--- a/contrib/m920x/m920x_parse.pl
+++ b/contrib/m920x/m920x_parse.pl
@@ -103,6 +103,13 @@ sub get_line {
 			last;
 		}
 
+		#40 23 c0 00 80 00 00 00 >>>
+		if($input eq "us2" && $line =~ m/([a-fA-F0-9 ]+)/) {
+			@ret = split(/ /, $1); $foo = $1;
+			@ret[2,3,4,5,6,7] = @ret[3,2,5,4,7,6];
+			last;
+		}
+
 		if($input eq "um" && $line =~ m/\S+ \S+ \S+ \S+ s ([a-fA-F0-9 ]+)/) {
 			@ret = expand_string_long(split(/ /, $1)); $foo = $1;
 			last;
@@ -125,7 +132,7 @@ sub get_line {
 
 sub us_get_write {
 	#print "<$line>\n";
-	if($input eq "us" && $line =~ m/>>>\s+([a-fA-F0-9 ]+)/) {
+	if(($input eq "us" || $input eq "us2") && $line =~ m/>>>\s+([a-fA-F0-9 ]+)/) {
 		return split(/ /, $1);
 	}
 	if($input eq "um") {
@@ -138,7 +145,7 @@ sub us_get_write {
 
 sub get_read {
 	#print "<$line>\n";
-	if($input eq "us" && $line =~ m/<<<  ([a-fA-F0-9 ]+)/) {
+	if(($input eq "us" || $input eq "us2") && $line =~ m/<<<\s+([a-fA-F0-9 ]+)/) {
 		return split(/ /, $1);
 	}
 	if($input eq "um") {
@@ -156,6 +163,7 @@ sub usage {
 
 	-i	um (usbmon)
 		us (usb snoop)
+		us2 (usb snoop as produced by parse-sniffusb2.pl)
 		sp (snoopy pro)
 
 	-m	fw (extract firmware)
@@ -169,7 +177,7 @@ getopts("m:i:", \%opt ) or usage();
 $mode = $opt{m};
 $input = $opt{i};
 
-if ($input ne "um" && $input ne "us" && $input ne "sp") {
+if ($input ne "um" && $input ne "us" && $input ne "us2" && $input ne "sp") {
 	usage();
 }
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux