From patchwork Tue Apr 16 00:20:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 236786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EA1E72C00C4 for ; Tue, 16 Apr 2013 10:29:32 +1000 (EST) Received: from localhost ([::1]:36292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URtm7-0001YN-49 for incoming@patchwork.ozlabs.org; Mon, 15 Apr 2013 20:29:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URtfD-00071A-GG for qemu-devel@nongnu.org; Mon, 15 Apr 2013 20:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URtfC-0007I2-HS for qemu-devel@nongnu.org; Mon, 15 Apr 2013 20:22:23 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:41089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URtfC-0007Hp-BG for qemu-devel@nongnu.org; Mon, 15 Apr 2013 20:22:22 -0400 Received: by mail-pa0-f45.google.com with SMTP id kl13so15138pab.4 for ; Mon, 15 Apr 2013 17:22:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=4nx8RG90qdf950MTTB2XAoaoUJ1iNhY0YkwuJvAjdoM=; b=hSZoLTCPiiAuG9l6XipJ0Vhl8AjU2JK6Eshlzj07obzQ6v1t9awv0N8ZOdGD2fScbu cjFWRvHTX7kCuJfjlCS8Gxy4lCFwvOWXS76/qPGZaHhDw1Ee46zgTOXWsS39ZBB6wFjd V7UPupBo6pHJSQx4nae/v+L1W75PSKeUAv3Wk4aIe5XaI1AQ53rHXd88S/csCjI83gXe 5AiHK+LqieZe3qPBNwba8Hy1+sm5CvEcH6alI93YNvj3qMzGMI4Jf+T26gxPRXcZJ+2/ YVWWfJXojKSCsWgng3JnVhd8se8flYflyaVTb+cu0leXy/023ZuHrXZI3Cuk7PKLNOrY 7BSA== X-Received: by 10.68.104.2 with SMTP id ga2mr26602pbb.116.1366071741160; Mon, 15 Apr 2013 17:22:21 -0700 (PDT) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPS id ky10sm42806pab.23.2013.04.15.17.22.19 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 15 Apr 2013 17:22:20 -0700 (PDT) From: peter.crosthwaite@xilinx.com To: qemu-devel@nongnu.org Date: Tue, 16 Apr 2013 10:20:06 +1000 Message-Id: <738e59bdf32da084cace539eeb5fc8779682fd3c.1366069170.git.peter.crosthwaite@xilinx.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkHRwbd5PrF8MKN+Tt8Esx7mfJCOP81hypcMuYbQE36TvO1UhBjMzHshS0DZW8hvx2i2as2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.45 Cc: edgar.iglesias@gmail.com Subject: [Qemu-devel] [PATCH v6 03/16] xilinx_axienet: Register reset properly 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 From: Peter Crosthwaite Register the reset function and the Device::reset function rather than explicitly call it from the sysbus::init. Signed-off-by: Peter Crosthwaite Reviewed-by: Andreas Färber Acked-by: Edgar E. Iglesias --- hw/net/xilinx_axienet.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 6cb9a9b..afc3d82 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -402,8 +402,10 @@ static inline int axienet_newfunc_enabled(XilinxAXIEnet *s) return !!(s->regs[R_RAF] & RAF_NEWFUNC_EN); } -static void axienet_reset(XilinxAXIEnet *s) +static void xilinx_axienet_reset(DeviceState *d) { + XilinxAXIEnet *s = XILINX_AXI_ENET(d); + axienet_rx_reset(s); axienet_tx_reset(s); @@ -871,7 +873,6 @@ static int xilinx_enet_init(SysBusDevice *dev) s->TEMAC.parent = s; s->rxmem = g_malloc(s->c_rxmem); - axienet_reset(s); return 0; } @@ -902,6 +903,7 @@ static void xilinx_enet_class_init(ObjectClass *klass, void *data) k->init = xilinx_enet_init; dc->props = xilinx_enet_properties; + dc->reset = xilinx_axienet_reset; ssc->push = axienet_stream_push; }