Patchwork [4/6] pcnet: Preserve link state across device reset

login
register
mail settings
Submitter Stefan Hajnoczi
Date Jan. 27, 2012, 7:28 a.m.
Message ID <1327649282-12431-5-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/138190/
State New
Headers show

Comments

Stefan Hajnoczi - Jan. 27, 2012, 7:28 a.m.
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/pcnet.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/pcnet.c b/hw/pcnet.c
index 306dc6e..6aa48e0d 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -688,7 +688,6 @@  static void pcnet_s_reset(PCNetState *s)
     printf("pcnet_s_reset\n");
 #endif
 
-    s->lnkst = 0x40;
     s->rdra = 0;
     s->tdra = 0;
     s->rap = 0;
@@ -1751,5 +1750,7 @@  int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info)
     }
     *(uint16_t *)&s->prom[12] = cpu_to_le16(checksum);
 
+    s->lnkst = 0x40; /* initial link state: up */
+
     return 0;
 }