From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKcqs-0003mY-QL for qemu-devel@nongnu.org; Wed, 07 Jan 2009 13:09:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKcqr-0003kS-82 for qemu-devel@nongnu.org; Wed, 07 Jan 2009 13:09:58 -0500 Received: from [199.232.76.173] (port=36371 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKcqr-0003kE-2n for qemu-devel@nongnu.org; Wed, 07 Jan 2009 13:09:57 -0500 Received: from mail-ew0-f21.google.com ([209.85.219.21]:38045) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKcqq-0008LO-Js for qemu-devel@nongnu.org; Wed, 07 Jan 2009 13:09:56 -0500 Received: by ewy14 with SMTP id 14so9741422ewy.10 for ; Wed, 07 Jan 2009 10:09:55 -0800 (PST) Message-ID: <4964EFE6.2060209@codemonkey.ws> Date: Wed, 07 Jan 2009 12:09:42 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1231349859.7109.82.camel@lappy> In-Reply-To: <1231349859.7109.82.camel@lappy> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/5][RFC] virtio-net: Name the status bits, adding promisc and allmulti Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: Mark McLoughlin , qemu-devel , kvm Alex Williamson wrote: > virtio-net: Name the status bits, adding promisc and allmulti > > Signed-off-by: Alex Williamson > --- > > hw/virtio-net.c | 36 ++++++++++++++++++++++++------------ > hw/virtio-net.h | 11 ++++++++++- > 2 files changed, 34 insertions(+), 13 deletions(-) > > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index 77e3077..653cad4 100644 > --- a/hw/virtio-net.c > +++ b/hw/virtio-net.c > @@ -22,7 +22,14 @@ typedef struct VirtIONet > { > VirtIODevice vdev; > uint8_t mac[6]; > - uint16_t status; > + union { > + uint16_t raw; > + struct { > + uint16_t link:1; > + uint16_t promisc:1; > + uint16_t allmulti:1; > + } bits; > + } status; > I'd prefer the use of #define's like we have today. bit fields have really weird packing and ordering properties across architectures. Regards, Anthony Liguori