From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpNeG-0004J2-8V for qemu-devel@nongnu.org; Fri, 05 Aug 2011 12:53:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QpNeF-000324-7R for qemu-devel@nongnu.org; Fri, 05 Aug 2011 12:53:24 -0400 Received: from mail-pz0-f42.google.com ([209.85.210.42]:57007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpNeF-000320-0y for qemu-devel@nongnu.org; Fri, 05 Aug 2011 12:53:23 -0400 Received: by pzk37 with SMTP id 37so4930876pzk.29 for ; Fri, 05 Aug 2011 09:53:22 -0700 (PDT) Message-ID: <4E3C1FFF.8070409@codemonkey.ws> Date: Fri, 05 Aug 2011 11:53:19 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1312554976-5822-1-git-send-email-anthony.perard@citrix.com> In-Reply-To: <1312554976-5822-1-git-send-email-anthony.perard@citrix.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] e1000: Do reset when E1000_CTRL_RST bit is set. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony PERARD Cc: QEMU-devel On 08/05/2011 09:36 AM, Anthony PERARD wrote: > 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) { You'll break some GCCs with -Wall -Werror with this. Please do: if ((val & E1000_CTRL_RST)) { Regards, Anthony Liguori > + e1000_reset(s); > + return; > + } > + s->mac_reg[CTRL] = val; > } > > static void