From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRSig-0005q2-UX for qemu-devel@nongnu.org; Thu, 16 Jul 2009 11:18:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRSib-0005nN-Vh for qemu-devel@nongnu.org; Thu, 16 Jul 2009 11:18:02 -0400 Received: from [199.232.76.173] (port=38961 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRSib-0005n3-Jf for qemu-devel@nongnu.org; Thu, 16 Jul 2009 11:17:57 -0400 Received: from mx2.redhat.com ([66.187.237.31]:33485) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRSia-0002aN-JN for qemu-devel@nongnu.org; Thu, 16 Jul 2009 11:17:57 -0400 Message-ID: <4A5F44A1.1000608@redhat.com> Date: Thu, 16 Jul 2009 18:17:53 +0300 From: Naphtali Sprei MIME-Version: 1.0 Subject: Re: [Qemu-devel] 2nd try: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver References: <4A5DC91F.7010009@redhat.com> <4A5F2BC1.1040708@codemonkey.ws> In-Reply-To: <4A5F2BC1.1040708@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org comment format changed, (hopefully) fixed mailer wrapping. Subject: [PATCH] fix for bad macaddr of e1000 in Windows 2003 server with original Microsoft driver 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 --- hw/e1000.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 4ac8918..b819501 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; -- 1.5.5.6