qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] e1000: Do reset when E1000_CTRL_RST bit is set.


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] e1000: Do reset when E1000_CTRL_RST bit is set.
Date: Fri, 05 Aug 2011 11:53:19 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 08/05/2011 09:36 AM, Anthony PERARD wrote:
Signed-off-by: Anthony PERARD<address@hidden>
---
  hw/e1000.c |   10 ++++++++--
  1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 96d84f9..a1388e9 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -150,6 +150,8 @@ static const char phy_regcap[0x20] = {
      [PHY_ID2] = PHY_R,                [M88E1000_PHY_SPEC_STATUS] = PHY_R
  };

+static void e1000_reset(void *opaque);
+
  static void
  ioport_map(PCIDevice *pci_dev, int region_num, pcibus_t addr,
             pcibus_t size, int type)
@@ -202,8 +204,12 @@ rxbufsize(uint32_t v)
  static void
  set_ctrl(E1000State *s, int index, uint32_t val)
  {
-    /* RST is self clearing */
-    s->mac_reg[CTRL] = val&  ~E1000_CTRL_RST;
+    DBGOUT(IO, "set ctrl = %08x\n", val);
+    if (val&  E1000_CTRL_RST) {

You'll break some GCCs with -Wall -Werror with this.  Please do:

if ((val & E1000_CTRL_RST)) {

Regards,

Anthony Liguori

+        e1000_reset(s);
+        return;
+    }
+    s->mac_reg[CTRL] = val;
  }

  static void




reply via email to

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