From patchwork Fri Aug 5 14:36:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 108673 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 43CF4B6F62 for ; Sat, 6 Aug 2011 00:36:41 +1000 (EST) Received: from localhost ([::1]:57250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpLVu-0006VX-L4 for incoming@patchwork.ozlabs.org; Fri, 05 Aug 2011 10:36:38 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpLVn-0006NN-FT for qemu-devel@nongnu.org; Fri, 05 Aug 2011 10:36:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QpLVm-0003Il-6B for qemu-devel@nongnu.org; Fri, 05 Aug 2011 10:36:31 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:22308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpLVl-0003IY-Uh for qemu-devel@nongnu.org; Fri, 05 Aug 2011 10:36:30 -0400 X-IronPort-AV: E=Sophos;i="4.67,323,1309752000"; d="scan'208";a="157881252" Received: from ftlpmailmx02.citrite.net ([10.13.107.66]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 05 Aug 2011 10:36:28 -0400 Received: from smtp01.ad.xensource.com (10.219.128.104) by smtprelay.citrix.com (10.13.107.66) with Microsoft SMTP Server id 8.3.137.0; Fri, 5 Aug 2011 10:36:29 -0400 Received: from perard.uk.xensource.com (dhcp-3-28.uk.xensource.com [10.80.3.28] (may be forged)) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id p75EaPi1009085; Fri, 5 Aug 2011 07:36:27 -0700 From: Anthony PERARD To: QEMU-devel Date: Fri, 5 Aug 2011 15:36:15 +0100 Message-ID: <1312554976-5822-1-git-send-email-anthony.perard@citrix.com> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Cc: Anthony PERARD Subject: [Qemu-devel] [PATCH] e1000: Do reset when E1000_CTRL_RST bit is set. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Anthony PERARD --- hw/e1000.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 96d84f9..a1388e9 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -150,6 +150,8 @@ static const char phy_regcap[0x20] = { [PHY_ID2] = PHY_R, [M88E1000_PHY_SPEC_STATUS] = PHY_R }; +static void e1000_reset(void *opaque); + static void ioport_map(PCIDevice *pci_dev, int region_num, pcibus_t addr, pcibus_t size, int type) @@ -202,8 +204,12 @@ rxbufsize(uint32_t v) static void set_ctrl(E1000State *s, int index, uint32_t val) { - /* RST is self clearing */ - s->mac_reg[CTRL] = val & ~E1000_CTRL_RST; + DBGOUT(IO, "set ctrl = %08x\n", val); + if (val & E1000_CTRL_RST) { + e1000_reset(s); + return; + } + s->mac_reg[CTRL] = val; } static void