qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver
@ 2009-07-15 10:08 Naphtali Sprei
  2009-07-15 12:09 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Naphtali Sprei @ 2009-07-15 10:08 UTC (permalink / raw)
  To: qemu-devel

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.
---
 hw/e1000.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index 4ac8918..7d7cc2e 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -261,7 +261,10 @@ set_eecd(E1000State *s, int index, uint32_t val)
         return;
     }
     if (!(val & E1000_EECD_CS)) {              // rising, no CS (EEPROM 
reset)
+        // save/restore old_eecd to avoid false detection of a clock edge
+        uint32_t keep = s->eecd_state.old_eecd;
         memset(&s->eecd_state, 0, sizeof s->eecd_state);
+        s->eecd_state.old_eecd = keep;
         return;
     }
     s->eecd_state.val_in <<= 1;
--
1.5.5.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-15 12:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 10:08 [Qemu-devel] [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver Naphtali Sprei
2009-07-15 12:09 ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).