From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 3/5][RFC] virtio-net: Name the status bits, adding promisc and allmulti Date: Wed, 07 Jan 2009 12:09:42 -0600 Message-ID: <4964EFE6.2060209@codemonkey.ws> References: <1231349859.7109.82.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm , qemu-devel , Mark McLoughlin To: Alex Williamson Return-path: Received: from ey-out-2122.google.com ([74.125.78.27]:7909 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755248AbZAGSJ5 (ORCPT ); Wed, 7 Jan 2009 13:09:57 -0500 Received: by ey-out-2122.google.com with SMTP id 22so1000038eye.37 for ; Wed, 07 Jan 2009 10:09:55 -0800 (PST) In-Reply-To: <1231349859.7109.82.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: 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