From patchwork Wed Oct 10 13:39:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 14968 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TLwVi-0007bx-Ln for patchwork@linuxtv.org; Wed, 10 Oct 2012 15:39:42 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp for id 1TLwVi-0006Ej-9k; Wed, 10 Oct 2012 15:39:42 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756436Ab2JJNjc (ORCPT ); Wed, 10 Oct 2012 09:39:32 -0400 Received: from smtp208.alice.it ([82.57.200.104]:42502 "EHLO smtp208.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756330Ab2JJNj3 (ORCPT ); Wed, 10 Oct 2012 09:39:29 -0400 Received: from jcn (87.1.92.64) by smtp208.alice.it (8.6.023.02) id 50469700054E8EDD; Wed, 10 Oct 2012 15:39:28 +0200 Received: from ao2 by jcn with local (Exim 4.80) (envelope-from ) id 1TLwVS-0003A3-1k; Wed, 10 Oct 2012 15:39:26 +0200 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Aapo Tahkola , Antonio Ospite , CityK Subject: [PATCH 5/5] m920x_parse.pl: add support for consuming the output of parse-sniffusb2.pl Date: Wed, 10 Oct 2012 15:39:22 +0200 Message-Id: <1349876363-12098-6-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1349876363-12098-1-git-send-email-ospite@studenti.unina.it> References: <1349876363-12098-1-git-send-email-ospite@studenti.unina.it> X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.10.10.132416 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1800_1899 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' --- 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(); }