From patchwork Thu Oct 8 15:53:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 35462 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 ozlabs.org (Postfix) with ESMTPS id 0941DB7B76 for ; Fri, 9 Oct 2009 03:04:37 +1100 (EST) Received: from localhost ([127.0.0.1]:32770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvvTm-0008CZ-Ed for incoming@patchwork.ozlabs.org; Thu, 08 Oct 2009 12:04:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvvJc-0005RP-Uh for qemu-devel@nongnu.org; Thu, 08 Oct 2009 11:54:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvvJZ-0005Np-3I for qemu-devel@nongnu.org; Thu, 08 Oct 2009 11:54:04 -0400 Received: from [199.232.76.173] (port=45274 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvvJY-0005NL-8y for qemu-devel@nongnu.org; Thu, 08 Oct 2009 11:54:00 -0400 Received: from thoth.sbs.de ([192.35.17.2]:15387) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MvvJX-0001Hb-J0 for qemu-devel@nongnu.org; Thu, 08 Oct 2009 11:54:00 -0400 Received: from mail2.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n98Frsgk003260 for ; Thu, 8 Oct 2009 17:53:54 +0200 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id n98Frrtt018444 for ; Thu, 8 Oct 2009 17:53:54 +0200 Message-ID: <4ACE0B11.3010901@siemens.com> Date: Thu, 08 Oct 2009 17:53:53 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: qemu-devel X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Subject: [Qemu-devel] [PATCH] pcnet: Extend hardware reset 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 Update the IRQ state and stop the poll timer on reset. Moreover, register the reset function with qemu. Signed-off-by: Jan Kiszka --- hw/pcnet.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/pcnet.c b/hw/pcnet.c index afeaca7..fecbff7 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1624,6 +1624,8 @@ static void pcnet_h_reset(void *opaque) s->bcr[BCR_PLAT ] = 0xff06; pcnet_s_reset(s); + pcnet_update_irq(s); + pcnet_poll_timer(s); } static void pcnet_aprom_writeb(void *opaque, uint32_t addr, uint32_t val) @@ -1966,6 +1968,7 @@ static int pcnet_common_init(DeviceState *dev, PCNetState *s, s->vc = qdev_get_vlan_client(dev, pcnet_can_receive, pcnet_receive, NULL, cleanup, s); + qemu_register_reset(pcnet_h_reset, s); pcnet_h_reset(s); return 0; }