summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
authorAmos Kong <akong@redhat.com>2012-12-28 17:29:11 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-01-07 10:43:21 +0100
commit83f58e570f21c3e7227e7fbef1fc0e18b5ed7ea9 (patch)
tree7d0ebcbdf98049a093b9d32fd7d61bd74a25607c /hw
parent84dd2120247a7d25ff1bb337de21c0e76816ad2d (diff)
downloadfocaccia-qemu-83f58e570f21c3e7227e7fbef1fc0e18b5ed7ea9.tar.gz
focaccia-qemu-83f58e570f21c3e7227e7fbef1fc0e18b5ed7ea9.zip
rtl8139: preserve link state across device reset
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/rtl8139.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index c59ec6b6df..3e080621f6 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 */