From patchwork Fri Sep 28 13:50:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 10620025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C783913 for ; Fri, 28 Sep 2018 14:02:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CD5B2B51D for ; Fri, 28 Sep 2018 14:02:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10C262B5A7; Fri, 28 Sep 2018 14:02:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B154F2B51D for ; Fri, 28 Sep 2018 14:02:01 +0000 (UTC) Received: from localhost ([::1]:43571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5tLE-0005cq-WD for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Sep 2018 10:02:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5tAg-0004tN-P4 for qemu-devel@nongnu.org; Fri, 28 Sep 2018 09:51:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5tAc-0007AF-Mo for qemu-devel@nongnu.org; Fri, 28 Sep 2018 09:51:06 -0400 Received: from 9.mo173.mail-out.ovh.net ([46.105.72.44]:44879) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5tAc-00079Z-Gj for qemu-devel@nongnu.org; Fri, 28 Sep 2018 09:51:02 -0400 Received: from player691.ha.ovh.net (unknown [10.109.159.35]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id 7E21CD543E for ; Fri, 28 Sep 2018 15:51:01 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-1-10605-110.w90-89.abo.wanadoo.fr [90.89.196.110]) (Authenticated sender: clg@kaod.org) by player691.ha.ovh.net (Postfix) with ESMTPSA id 4795C2600B0; Fri, 28 Sep 2018 15:50:56 +0200 (CEST) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: Jason Wang , qemu-devel@nongnu.org Date: Fri, 28 Sep 2018 15:50:02 +0200 Message-Id: <20180928135003.8650-11-clg@kaod.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928135003.8650-1-clg@kaod.org> References: <20180928135003.8650-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3586272682351823871 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtjedruddtledgjedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.105.72.44 Subject: [Qemu-devel] [PATCH 10/11] net: stellaris_enet: add a reset method X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Cc: Peter Maydell Cc: qemu-arm@nongnu.org Signed-off-by: Cédric Le Goater Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/net/stellaris_enet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c index 3ee1e0f8a43f..b3375ebb459c 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -457,8 +457,10 @@ static const MemoryRegionOps stellaris_enet_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void stellaris_enet_reset(stellaris_enet_state *s) +static void stellaris_enet_reset(DeviceState *dev) { + stellaris_enet_state *s = STELLARIS_ENET(dev); + s->mdv = 0x80; s->rctl = SE_RCTL_BADCRC; s->im = SE_INT_PHY | SE_INT_MD | SE_INT_RXER | SE_INT_FOV | SE_INT_TXEMP @@ -487,8 +489,6 @@ static void stellaris_enet_realize(DeviceState *dev, Error **errp) s->nic = qemu_new_nic(&net_stellaris_enet_info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s); qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a); - - stellaris_enet_reset(s); } static Property stellaris_enet_properties[] = { @@ -501,6 +501,7 @@ static void stellaris_enet_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = stellaris_enet_realize; + dc->reset = stellaris_enet_reset; dc->props = stellaris_enet_properties; dc->vmsd = &vmstate_stellaris_enet; }