All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: Jes Sorensen <Jes.Sorensen@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device
Date: Mon, 28 Mar 2011 14:14:53 +0200	[thread overview]
Message-ID: <20110328121453.GD28224@playa.redhat.com> (raw)
In-Reply-To: <4D907A4D.1000103@redhat.com>

On Mon, Mar 28, 2011 at 02:08:45PM +0200, Jes Sorensen wrote:
> On 03/23/11 14:19, Alon Levy wrote:
> > The passthru ccid card is a device sitting on the usb-ccid bus and
> > using a chardevice to communicate with a remote device using the
> > VSCard protocol defined in libcacard/vscard_common.h
> > 
> > Usage docs available in following patch in docs/ccid.txt
> > 
> > Signed-off-by: Alon Levy <alevy@redhat.com>
> > 
> > ---
> [snip]
> 
> > +static void ccid_card_vscard_send_error(PassthruState *s,
> > +                    uint32_t reader_id, VSCErrorCode code)
> > +{
> > +    VSCMsgError msg = {.code = htonl(code)};
> > +
> > +    ccid_card_vscard_send_msg(
> > +        s, VSC_Error, reader_id, (uint8_t *)&msg, sizeof(msg));
> > +}
> > +
> > +static void ccid_card_vscard_send_init(PassthruState *s)
> > +{
> > +    VSCMsgInit msg = {
> > +        .version = htonl(VSCARD_VERSION),
> > +        .magic = VSCARD_MAGIC,
> > +        .capabilities = {0}
> > +    };
> > +
> 
> If this goes over the wire, don't you need to htonl(VSCARD_MAGIC) here
> if someone tries to run passthrough from a big endian system to a little
> endian system, or vice versa?

The VSCARD_MAGIC definition is actually a cast of a string, so it is already
in the correct byte order:

libcacard/vscard_common.h:#define VSCARD_MAGIC (*(uint32_t *)"VSCD")

> 
> Otherwise it looks ok to me.
> 
> Cheers,
> Jes

  reply	other threads:[~2011-03-28 12:15 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 13:19 [Qemu-devel] [PATCH v23 00/11] usb-ccid Alon Levy
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 01/11] trace: move trace objects from Makefile to Makefile.objs Alon Levy
2011-03-28 11:59   ` Jes Sorensen
2011-03-28 14:26     ` Alon Levy
2011-03-28 14:30       ` Jes Sorensen
2011-03-28 16:00         ` Alon Levy
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 02/11] qemu-thread.h: include inttypes.h Alon Levy
2011-03-28 11:59   ` Jes Sorensen
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 03/11] usb-ccid: add CCID bus Alon Levy
2011-03-28 12:01   ` Jes Sorensen
2011-03-28 12:13     ` Alon Levy
2011-03-28 14:28     ` Alon Levy
2011-03-28 14:31       ` Jes Sorensen
2011-03-28 17:44         ` Blue Swirl
2011-03-28 18:00           ` Alon Levy
2011-03-28 18:08             ` Blue Swirl
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 04/11] introduce libcacard/vscard_common.h Alon Levy
2011-03-28 12:04   ` Jes Sorensen
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device Alon Levy
2011-03-28 12:08   ` Jes Sorensen
2011-03-28 12:14     ` Alon Levy [this message]
2011-03-28 13:45       ` Jes Sorensen
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 06/11] libcacard: initial commit Alon Levy
2011-03-28 12:35   ` Jes Sorensen
2011-03-28 12:42     ` Alon Levy
2011-03-28 13:52       ` Jes Sorensen
2011-03-28 14:43     ` Alon Levy
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 07/11] libcacard: add vscclient Alon Levy
2011-03-28 12:43   ` Jes Sorensen
2011-03-28 12:51     ` Alon Levy
2011-03-28 13:55       ` Jes Sorensen
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 08/11] libcacard: add passthru Alon Levy
2011-03-28 13:27   ` Jes Sorensen
2011-03-28 14:24     ` Alon Levy
2011-03-28 15:21     ` Alon Levy
2011-03-28 15:25       ` Jes Sorensen
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 09/11] libcacard: add docs Alon Levy
2011-03-28 13:31   ` Jes Sorensen
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 10/11] ccid: add ccid-card-emulated device Alon Levy
2011-03-28 13:39   ` Jes Sorensen
2011-03-23 13:19 ` [Qemu-devel] [PATCH v23 11/11] ccid: add docs Alon Levy
2011-03-28 13:41   ` Jes Sorensen
2011-03-23 15:32 ` [Qemu-devel] [PATCH v23 00/11] usb-ccid Hans de Goede

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=20110328121453.GD28224@playa.redhat.com \
    --to=alevy@redhat.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.