Patchwork [01/12] fix for bad macaddr of e1000 in Windows 2003 server with original MS driver

login
register
mail settings
Submitter Glauber Costa
Date Aug. 26, 2009, 1:05 p.m.
Message ID <1251291946-25821-2-git-send-email-glommer@redhat.com>
Download mbox | patch
Permalink /patch/32160/
State Superseded
Headers show

Comments

Glauber Costa - Aug. 26, 2009, 1:05 p.m.
From: Naphtali Sprei <nsprei@redhat.com>

The sequence of reading from eeprom is "offset by one" moved because of a false
detection of a clock cycle after an eeprom reset. Keeping the last clock value
after a reset keeps it in sync.

Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 hw/e1000.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/e1000.c b/hw/e1000.c
index 8c1741f..76fa159 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -262,6 +262,11 @@  set_eecd(E1000State *s, int index, uint32_t val)
     }
     if (!(val & E1000_EECD_CS)) {		// rising, no CS (EEPROM reset)
         memset(&s->eecd_state, 0, sizeof s->eecd_state);
+        /*
+         * restore old_eecd's E1000_EECD_SK (known to be on)
+         * to avoid false detection of a clock edge
+         */
+        s->eecd_state.old_eecd = E1000_EECD_SK;
         return;
     }
     s->eecd_state.val_in <<= 1;