Skip to contentSkip to conversation

pcnet: Preserve link state across device reset

PATCH Applied Jan Kiszka 2 participants 3 messages Jan 24, 2012 – Jan 27, 2012

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 pcnet: Preserve link state across device reset

A device reset does not affect the link state, only set_link does.

---
 hw/pcnet.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
hw/pcnet.c +2 -1
index 306dc6e..6aa48e0 100644
@@ -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;
 }
Signature · 1 line
1.7.3.4
author
#1 lore raw
Quoted 20 lines · Jan Kiszka

A device reset does not affect the link state, only set_link does.

---
 hw/pcnet.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
hw/pcnet.c +0 -1
index 306dc6e..6aa48e0 100644
@@ -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;

hw/pcnet.c int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info) · line 1756

Quoted 7 lines
hw/pcnet.c +2 -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;
 }

Also rather trivial.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux