All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: "Jason Wang" <jasowang@redhat.com>,
	"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"Yan Vugenfirer" <yvugenfi@redhat.com>,
	"Yuri Benditovich" <yuri.benditovich@daynix.com>,
	"Sriram Yagnaraman" <sriram.yagnaraman@est.tech>,
	"Akihiko Odaki" <akihiko.odaki@daynix.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v3 14/26] e1000e: Configure ResettableClass
Date: Thu, 26 Jan 2023 19:46:53 +0900	[thread overview]
Message-ID: <20230126104705.35023-15-akihiko.odaki@daynix.com> (raw)
In-Reply-To: <20230126104705.35023-1-akihiko.odaki@daynix.com>

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 <akihiko.odaki@daynix.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/net/e1000e.c     | 10 ++++++----
 hw/net/trace-events |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index 0bc222d354..ec274319c4 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -513,11 +513,11 @@ static void e1000e_pci_uninit(PCIDevice *pci_dev)
     msi_uninit(pci_dev);
 }
 
-static void e1000e_qdev_reset(DeviceState *dev)
+static void e1000e_qdev_reset_hold(Object *obj)
 {
-    E1000EState *s = E1000E(dev);
+    E1000EState *s = E1000E(obj);
 
-    trace_e1000e_cb_qdev_reset();
+    trace_e1000e_cb_qdev_reset_hold();
 
     e1000e_core_reset(&s->core);
 
@@ -669,6 +669,7 @@ static Property e1000e_properties[] = {
 static void e1000e_class_init(ObjectClass *class, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(class);
+    ResettableClass *rc = RESETTABLE_CLASS(class);
     PCIDeviceClass *c = PCI_DEVICE_CLASS(class);
 
     c->realize = e1000e_pci_realize;
@@ -679,8 +680,9 @@ static void e1000e_class_init(ObjectClass *class, void *data)
     c->romfile = "efi-e1000e.rom";
     c->class_id = PCI_CLASS_NETWORK_ETHERNET;
 
+    rc->phases.hold = e1000e_qdev_reset_hold;
+
     dc->desc = "Intel 82574L GbE Controller";
-    dc->reset = e1000e_qdev_reset;
     dc->vmsd = &e1000e_vmstate;
 
     e1000e_prop_disable_vnet = qdev_prop_uint8;
diff --git a/hw/net/trace-events b/hw/net/trace-events
index 8fa4299704..c98ad12537 100644
--- a/hw/net/trace-events
+++ b/hw/net/trace-events
@@ -251,7 +251,7 @@ e1000e_vm_state_stopped(void) "VM state is stopped"
 # e1000e.c
 e1000e_cb_pci_realize(void) "E1000E PCI realize entry"
 e1000e_cb_pci_uninit(void) "E1000E PCI unit entry"
-e1000e_cb_qdev_reset(void) "E1000E qdev reset entry"
+e1000e_cb_qdev_reset_hold(void) "E1000E qdev reset hold"
 e1000e_cb_pre_save(void) "E1000E pre save entry"
 e1000e_cb_post_load(void) "E1000E post load entry"
 
-- 
2.39.0



  parent reply	other threads:[~2023-01-26 10:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 10:46 [PATCH v3 00/26] e1000x cleanups (preliminary for IGB) Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 01/26] e1000e: Fix the code style Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 02/26] hw/net: Add more MII definitions Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 03/26] fsl_etsec: Use hw/net/mii.h Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 04/26] e1000: " Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 05/26] e1000: Mask registers when writing Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 06/26] e1000e: " Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 07/26] e1000: Use more constant definitions Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 08/26] e1000e: " Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 09/26] e1000: Use memcpy to intialize registers Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 10/26] e1000e: " Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 11/26] e1000e: Remove pending interrupt flags Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 12/26] e1000e: Improve software reset Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 13/26] e1000: Configure ResettableClass Akihiko Odaki
2023-01-26 10:46 ` Akihiko Odaki [this message]
2023-01-26 10:46 ` [PATCH v3 15/26] e1000e: Introduce e1000_rx_desc_union Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 16/26] e1000e: Set MII_ANER_NWAY Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 17/26] e1000e: Remove extra pointer indirection Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 18/26] net: Check L4 header size Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 19/26] e1000x: Alter the signature of e1000x_is_vlan_packet Akihiko Odaki
2023-01-26 10:46 ` [PATCH v3 20/26] net: Strip virtio-net header when dumping Akihiko Odaki
2023-01-26 10:47 ` [PATCH v3 21/26] hw/net/net_tx_pkt: Automatically determine if virtio-net header is used Akihiko Odaki
2023-01-26 10:47 ` [PATCH v3 22/26] hw/net/net_rx_pkt: Remove net_rx_pkt_has_virt_hdr Akihiko Odaki
2023-01-26 10:47 ` [PATCH v3 23/26] e1000e: Perform software segmentation for loopback Akihiko Odaki
2023-01-26 10:47 ` [PATCH v3 24/26] hw/net/net_tx_pkt: Implement TCP segmentation Akihiko Odaki
2023-01-26 10:47 ` [PATCH v3 25/26] MAINTAINERS: Add Akihiko Odaki as a e1000e reviewer Akihiko Odaki
2023-01-26 10:47 ` [PATCH v3 26/26] MAINTAINERS: Add e1000e test files Akihiko Odaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230126104705.35023-15-akihiko.odaki@daynix.com \
    --to=akihiko.odaki@daynix.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sriram.yagnaraman@est.tech \
    --cc=thuth@redhat.com \
    --cc=yuri.benditovich@daynix.com \
    --cc=yvugenfi@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.