From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44035 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4BFt-0001HY-TM for qemu-devel@nongnu.org; Mon, 28 Mar 2011 08:09:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4BFr-0001yW-TO for qemu-devel@nongnu.org; Mon, 28 Mar 2011 08:09:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4BFr-0001yS-Gz for qemu-devel@nongnu.org; Mon, 28 Mar 2011 08:09:07 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2SC96dn007217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 Mar 2011 08:09:06 -0400 Message-ID: <4D907A4D.1000103@redhat.com> Date: Mon, 28 Mar 2011 14:08:45 +0200 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v23 05/11] ccid: add passthru card device References: <1300886393-2799-1-git-send-email-alevy@redhat.com> <1300886393-2799-6-git-send-email-alevy@redhat.com> In-Reply-To: <1300886393-2799-6-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org 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 > > --- [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