qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 3/5][RFC] virtio-net: Name the status bits, addi


From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH 3/5][RFC] virtio-net: Name the status bits, adding promisc and allmulti
Date: Wed, 07 Jan 2009 12:09:42 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Alex Williamson wrote:
virtio-net: Name the status bits, adding promisc and allmulti

Signed-off-by: Alex Williamson <address@hidden>
---

 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





reply via email to

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