From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsWgt-0008Qq-Ka for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:45:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsWgq-0006cN-7b for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:45:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsWgp-0006cI-RU for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:45:52 -0500 From: Stefan Hajnoczi Date: Tue, 8 Jan 2013 11:45:39 +0100 Message-Id: <1357641939-20030-5-git-send-email-stefanha@redhat.com> In-Reply-To: <1357641939-20030-1-git-send-email-stefanha@redhat.com> References: <1357641939-20030-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 4/4] rtl8139: preserve link state across device reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Amos Kong , Stefan Hajnoczi From: Amos Kong A device reset does not affect the link state, only set_link does. Signed-off-by: Amos Kong Signed-off-by: Stefan Hajnoczi --- hw/rtl8139.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index c59ec6b..3e08062 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -1258,7 +1258,8 @@ static void rtl8139_reset(DeviceState *d) s->BasicModeStatus = 0x7809; //s->BasicModeStatus |= 0x0040; /* UTP medium */ s->BasicModeStatus |= 0x0020; /* autonegotiation completed */ - s->BasicModeStatus |= 0x0004; /* link is up */ + /* preserve link state */ + s->BasicModeStatus |= s->nic->nc.link_down ? 0 : 0x04; s->NWayAdvert = 0x05e1; /* all modes, full duplex */ s->NWayLPAR = 0x05e1; /* all modes, full duplex */ -- 1.8.0.2