From patchwork Fri Jan 27 07:27:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3/6] e1000: Preserve link state across device reset Date: Thu, 26 Jan 2012 21:27:59 -0000 From: Stefan Hajnoczi X-Patchwork-Id: 138189 Message-Id: <1327649282-12431-4-git-send-email-stefanha@linux.vnet.ibm.com> To: Anthony Liguori Cc: Jan Kiszka , qemu-devel@nongnu.org, Stefan Hajnoczi From: Jan Kiszka A device reset does not affect the link state, only set_link does. Signed-off-by: Jan Kiszka Signed-off-by: Stefan Hajnoczi --- 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 = {