From nobody Mon Sep 16 19:09:40 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1675222743; cv=none; d=zohomail.com; s=zohoarc; b=O8u7epx4ltm2iNn2YY1v08i5HVo7sM1VlimqRGAaJpA2J6uJsXbZM5MmJFKSgI/5SzCNzNxkV1hwHtkmltao4vaN1YpG8xcImh7owD1OyCmfnrfeByTBayVqz29sL2gICfzMcXQ7v47N2eSC1uJFJ1g1GyQ0Te463qfDa6DskV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675222743; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=A95PLfu5QduSNtWNtARVjFG+JlZHlsOhrX6r7BxoUgQ=; b=bisfqAVw8Caheyv9XCNWD/1UlltWtJ6GgF/ikS9q5F5PSrDf3Q3l/6xjgBBU03XmswP2h8TMKjSSq+ehBdqb0INXv4mK9kItAkFo9MICTead+5ZE8byBp/yH5R7UJokRVvaye+G0lBJEUiVuFR7WA3ZGInYMHdHK/ZrSO4I3zRY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675222743391587.2995191342376; Tue, 31 Jan 2023 19:39:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pN3vE-0006ch-ID; Tue, 31 Jan 2023 22:36:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pN3vC-0006aY-PD for qemu-devel@nongnu.org; Tue, 31 Jan 2023 22:36:30 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pN3vB-0000QI-7Q for qemu-devel@nongnu.org; Tue, 31 Jan 2023 22:36:30 -0500 Received: by mail-pl1-x630.google.com with SMTP id v23so17188518plo.1 for ; Tue, 31 Jan 2023 19:36:28 -0800 (PST) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:4457:c267:5e09:481b]) by smtp.gmail.com with ESMTPSA id x15-20020a170902ec8f00b001968b529c98sm4185557plg.128.2023.01.31.19.36.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 19:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A95PLfu5QduSNtWNtARVjFG+JlZHlsOhrX6r7BxoUgQ=; b=fnn9BjvMtkCZObEsS03e6iTtKAkJi4wti+iKRcqp8gZ56fv/ciimB9orwcFrGNy8nE yYCpY54/zvNBStKubdf26L+ODe3M+uyBkMXNxEYqzQeCCOAmTh0noMnWolvLWsdPsOnS 6HT0X0kFdnJwEFCisTffrxOXdfNte26xznVRvjjJlm9RASwpg0o3+jMGD1RYX0YIZb00 UiB+YYoVeR5SqdnYPIQdsNOHdLU68G26iraNQO054N+b8qBw3mR+e72JYeUVgqY+1LBS y2yEGMTEiLoCwaZYyqcxhgnr2cnx3dTHb0U+M/Fb/YL7CxJ4p8AYIAdsHtl2Jw10Nw4P JyPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A95PLfu5QduSNtWNtARVjFG+JlZHlsOhrX6r7BxoUgQ=; b=jmCe6IG/By2xwqZTMwEI4Bp/jCbI7YisjHURXkM+RA6Pk00Pvg1Bkx5+7J1gYhmoWg 7c5DldiMQ09CDb7x/U5adE1fS0//iX38AHLlbuFh7QVDDSG1chUl0VfXmTrqvHFybu4D QPJjxRkCu6Gp+tRDdGFxHPKkPVmZkLnvgwnMnyu+4eNMFqnRwDgMeoAgexZGhTt6hKq1 SBbi80Ci9ubEdXc8GW6h5eDfiNsvS0aTKqYurbLHLhXBs6IAf4ShLkVffXPAlSxcqAhm 2vFGXoFyxqaLwQDf+bmuBi98L9qHTGCIFpyaMHQGT7h+MjAjGpyD97hCiW5PDsFsRtco 03gg== X-Gm-Message-State: AO0yUKXPzFTgrdXyeJ5Ks2KPiHXnZ548Nz1vactK4Lid+cIkGSrMuvtz bVF5dCN9mZCL6tK0tDAMDV9DoQ== X-Google-Smtp-Source: AK7set/WxohywLbjKTqj05gM5YS2wiarYPup+fjTgxmjn3UL9yS/QpCzDeS59TtDqdl+ZQqqvZJ5tA== X-Received: by 2002:a17:903:2283:b0:198:a347:44b8 with SMTP id b3-20020a170903228300b00198a34744b8mr1575953plh.31.1675222588625; Tue, 31 Jan 2023 19:36:28 -0800 (PST) From: Akihiko Odaki To: Cc: Jason Wang , Dmitry Fleytman , Thomas Huth , Laurent Vivier , Paolo Bonzini , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, "Michael S . Tsirkin" , Yan Vugenfirer , Yuri Benditovich , Sriram Yagnaraman , Alexander Bulekov , Akihiko Odaki , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v5 13/29] e1000: Configure ResettableClass Date: Wed, 1 Feb 2023 12:35:23 +0900 Message-Id: <20230201033539.30049-14-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230201033539.30049-1-akihiko.odaki@daynix.com> References: <20230201033539.30049-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::630; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x630.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1675222744602100001 This is part of recent efforts of refactoring e1000 and e1000e. DeviceClass's reset member is deprecated so migrate to ResettableClass. There is no behavioral difference. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/e1000.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 3353a3752c..c81d914a02 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -377,9 +377,9 @@ static bool e1000_vet_init_need(void *opaque) return chkflag(VET); } =20 -static void e1000_reset(void *opaque) +static void e1000_reset_hold(Object *obj) { - E1000State *d =3D opaque; + E1000State *d =3D E1000(obj); E1000BaseClass *edc =3D E1000_GET_CLASS(d); uint8_t *macaddr =3D d->conf.macaddr.a; =20 @@ -1731,12 +1731,6 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Er= ror **errp) e1000_flush_queue_timer, d); } =20 -static void qdev_e1000_reset(DeviceState *dev) -{ - E1000State *d =3D E1000(dev); - e1000_reset(d); -} - static Property e1000_properties[] =3D { DEFINE_NIC_PROPERTIES(E1000State, conf), DEFINE_PROP_BIT("autonegotiation", E1000State, @@ -1762,6 +1756,7 @@ typedef struct E1000Info { static void e1000_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); E1000BaseClass *e =3D E1000_CLASS(klass); const E1000Info *info =3D data; @@ -1774,9 +1769,9 @@ static void e1000_class_init(ObjectClass *klass, void= *data) k->revision =3D info->revision; e->phy_id2 =3D info->phy_id2; k->class_id =3D PCI_CLASS_NETWORK_ETHERNET; + rc->phases.hold =3D e1000_reset_hold; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->desc =3D "Intel Gigabit Ethernet"; - dc->reset =3D qdev_e1000_reset; dc->vmsd =3D &vmstate_e1000; device_class_set_props(dc, e1000_properties); } --=20 2.39.1