qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device


From: Jes Sorensen
Subject: Re: [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device
Date: Mon, 28 Mar 2011 14:08:45 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Thunderbird/3.1.9

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 <address@hidden>
> 
> ---
[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?

Otherwise it looks ok to me.

Cheers,
Jes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]