]> git.proxmox.com Git - qemu.git/commitdiff
rtl8139: preserve link state across device reset
authorAmos Kong <akong@redhat.com>
Fri, 28 Dec 2012 09:29:11 +0000 (17:29 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 7 Jan 2013 09:43:21 +0000 (10:43 +0100)
A device reset does not affect the link state, only set_link does.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/rtl8139.c

index c59ec6b6df3c716f7036c4be32507b215f9222f2..3e080621f6c8c74a13193022a6347179bb758701 100644 (file)
@@ -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 */