qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2/2] e1000: CTRL.RST emulation


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PATCH 2/2] e1000: CTRL.RST emulation
Date: Tue, 27 Sep 2011 15:58:52 +0300
User-agent: Mutt/1.5.21 (2010-09-15)

e1000 spec says CTRL.RST write should have the same effect
as bus reset, except that is preserves PCI Config.
Reset device registers and interrupts.

Fix suggested by Andy Gospodarek <address@hidden>
Similar fix proposed by Anthony PERARD <address@hidden>

Signed-off-by: Michael S. Tsirkin <address@hidden>
---
 hw/e1000.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 87a1104..b51e089 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -241,8 +241,13 @@ static void e1000_reset(void *opaque)
 static void
 set_ctrl(E1000State *s, int index, uint32_t val)
 {
-    /* RST is self clearing */
-    s->mac_reg[CTRL] = val & ~E1000_CTRL_RST;
+    if (val & E1000_CTRL_RST) {
+        e1000_reset(s);
+        qemu_set_irq(s->dev.irq[0], 0);
+        return;
+    }
+
+    s->mac_reg[CTRL] = val;
 }
 
 static void
-- 
1.7.5.53.gc233e



reply via email to

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