From patchwork Wed Aug 26 13:05:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 32160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id A1DB6B7B5C for ; Thu, 27 Aug 2009 03:14:24 +1000 (EST) Received: from localhost ([127.0.0.1]:57231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgM4j-0004ET-6I for incoming@patchwork.ozlabs.org; Wed, 26 Aug 2009 13:14:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgLwc-0002KC-6J for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:05:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgLwT-00027G-Tx for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:05:54 -0400 Received: from [199.232.76.173] (port=45775 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgLwT-00026w-ON for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:05:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56678) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgLwS-0000WY-VO for qemu-devel@nongnu.org; Wed, 26 Aug 2009 13:05:49 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7QH5mTC029539; Wed, 26 Aug 2009 13:05:48 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7QH5kJk009197; Wed, 26 Aug 2009 13:05:47 -0400 From: Glauber Costa To: qemu-devel@nongnu.org Date: Wed, 26 Aug 2009 09:05:35 -0400 Message-Id: <1251291946-25821-2-git-send-email-glommer@redhat.com> In-Reply-To: <1251291946-25821-1-git-send-email-glommer@redhat.com> References: <1251291946-25821-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com, Naphtali Sprei Subject: [Qemu-devel] [PATCH 01/12] fix for bad macaddr of e1000 in Windows 2003 server with original MS driver X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Naphtali Sprei 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 Signed-off-by: Anthony Liguori Signed-off-by: Glauber Costa --- hw/e1000.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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;