qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 3/6] e1000: Preserve link state across device reset
Date: Fri, 27 Jan 2012 07:27:59 +0000	[thread overview]
Message-ID: <1327649282-12431-4-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1327649282-12431-1-git-send-email-stefanha@linux.vnet.ibm.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

A device reset does not affect the link state, only set_link does.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 hw/e1000.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 86c5416..76e736f 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1133,6 +1133,11 @@ static void e1000_reset(void *opaque)
     memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init);
     d->rxbuf_min_shift = 1;
     memset(&d->tx, 0, sizeof d->tx);
+
+    if (d->nic->nc.link_down) {
+        d->mac_reg[STATUS] &= ~E1000_STATUS_LU;
+        d->phy_reg[PHY_STATUS] &= ~MII_SR_LINK_STATUS;
+    }
 }
 
 static NetClientInfo net_e1000_info = {
-- 
1.7.8.3

  parent reply	other threads:[~2012-01-27  7:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  7:27 [Qemu-devel] [PULL 0/6] Trivial patches for 20 to 27 January 2012 Stefan Hajnoczi
2012-01-27  7:27 ` [Qemu-devel] [PATCH 1/6] remove #if 0 code for timers Stefan Hajnoczi
2012-01-27  7:27 ` [Qemu-devel] [PATCH 2/6] qdev-property: Make bit property parsing stricter Stefan Hajnoczi
2012-01-27 10:09   ` Andreas Färber
2012-02-05  7:30     ` Stefan Hajnoczi
2012-01-27  7:27 ` Stefan Hajnoczi [this message]
2012-01-27  7:28 ` [Qemu-devel] [PATCH 4/6] pcnet: Preserve link state across device reset Stefan Hajnoczi
2012-01-27  7:28 ` [Qemu-devel] [PATCH 5/6] ./configure: export xfs config via --{enable, disable}-xfsctl Stefan Hajnoczi
2012-01-27 17:33 ` [Qemu-devel] [PULL 0/6] Trivial patches for 20 to 27 January 2012 Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327649282-12431-4-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).