Skip to contentSkip to conversation

e1000: 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 e1000: Preserve link state across device reset

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

---
 hw/e1000.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
hw/e1000.c +5 -0
index 86c5416..76e736f 100644
@@ -1133,6 +1133,11 @@ static void e1000_reset(void *opaque)
     memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init);
     d->rxbuf_min_shift = 1;
     memset(&d->tx, 0, sizeof d->tx);
+
+    if (d->nic->nc.link_down) {
+        d->mac_reg[STATUS] &= ~E1000_STATUS_LU;
+        d->phy_reg[PHY_STATUS] &= ~MII_SR_LINK_STATUS;
+    }
 }
 
 static NetClientInfo net_e1000_info = {
Signature · 1 line
1.7.3.4
author
#1 lore raw
Quoted 13 lines · Jan Kiszka

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

---
 hw/e1000.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
hw/e1000.c +0 -0
index 86c5416..76e736f 100644
@@ -1133,6 +1133,11 @@ static void e1000_reset(void *opaque)
     memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init);

hw/e1000.c static void e1000_reset(void *opaque) · line 1143

Quoted 10 lines
hw/e1000.c +5 -0
     d->rxbuf_min_shift = 1;
     memset(&d->tx, 0, sizeof d->tx);
+
+    if (d->nic->nc.link_down) {
+        d->mac_reg[STATUS] &= ~E1000_STATUS_LU;
+        d->phy_reg[PHY_STATUS] &= ~MII_SR_LINK_STATUS;
+    }
 }
 
 static NetClientInfo net_e1000_info = {

May rather go via trivial, sorry.

Jan

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