From: Gerd Hoffmann <kraxel@redhat.com>
To: Stefan Fritsch <sf@sfritsch.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 1/8] usb-ccid: Add support to dump all USB packets
Date: Fri, 21 Jul 2017 08:09:18 +0200 [thread overview]
Message-ID: <1500617358.12926.1.camel@redhat.com> (raw)
In-Reply-To: <1500541371-24788-2-git-send-email-sf@sfritsch.de>
> index bef1f03c42..624dc2c447 100644
> --- a/hw/usb/dev-smartcard-reader.c
> +++ b/hw/usb/dev-smartcard-reader.c
> @@ -54,9 +54,25 @@ do { \
> #define D_INFO 2
> #define D_MORE_INFO 3
> #define D_VERBOSE 4
> +#define D_TRACE 5
> +#define D_REMOTEIO 10
Considered converting all DPRINTFs into tracepoints instead?
Then you can turn then on/off individually as needed.
> #define CCID_DEV_NAME "usb-ccid"
> #define USB_CCID_DEV(obj) OBJECT_CHECK(USBCCIDState, (obj),
> CCID_DEV_NAME)
> +
> +static void usb_packet_dump(int lvl, const char *dir, uint8_t *buf,
> size_t len)
> +{
> + int i;
> + if (lvl < D_TRACE) {
> + return;
> + }
> + printf("usb-ccid: usb packet(%s/%zd):", dir, len);
> + for (i = 0; i < len; ++i) {
> + printf(" %02x", buf[i]);
> + }
> + printf("\n");
> +}
There is qemu_hexdump() ...
cheers,
Gerd
next prev parent reply other threads:[~2017-07-21 6:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 9:02 [Qemu-devel] [PATCH v2 0/8] usb-ccid: Misc fixes and T=1 support Stefan Fritsch
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 1/8] usb-ccid: Add support to dump all USB packets Stefan Fritsch
2017-07-21 6:09 ` Gerd Hoffmann [this message]
2017-07-27 8:55 ` Stefan Fritsch
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 2/8] usb-ccid: Fix USB packet generation for 64-Bytes sized packets Stefan Fritsch
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 3/8] usb-ccid: Set protocol parameters based on card ATR Stefan Fritsch
2017-07-20 9:35 ` Marc-André Lureau
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 4/8] usb-ccid: Fix ATR parsing Stefan Fritsch
2017-07-20 9:40 ` Marc-André Lureau
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 5/8] usb-ccid: Fix USB descriptor Stefan Fritsch
2017-07-20 9:44 ` Marc-André Lureau
2017-07-20 12:16 ` Stefan Fritsch
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 6/8] usb-ccid: Fix chaining fields in CCID USB messages Stefan Fritsch
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 7/8] usb-ccid: Increase ccid max APDU size Stefan Fritsch
2017-07-20 9:02 ` [Qemu-devel] [PATCH v2 8/8] usb-ccid: Reduce logging at level WARN Stefan Fritsch
2017-07-20 9:49 ` Marc-André Lureau
2017-07-20 12:18 ` Stefan Fritsch
2017-07-27 8:58 ` Stefan Fritsch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1500617358.12926.1.camel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sf@sfritsch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.