aboutsummaryrefslogtreecommitdiff
path: root/hw/pcnet.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-06-30 14:12:07 +0200
committerPaul Brook <paul@codesourcery.com>2009-07-09 13:07:02 +0100
commit0aab0d3a4a62505ab7e79ee0a67fe3f04f6dae23 (patch)
tree59539fa84519cc5cc7aa24c4c7cb0435edfbdfbb /hw/pcnet.c
parente2b19c85ea0f3fd6091386adfd3a2acd21107cb4 (diff)
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch of parameters. Also adds config_read and config_write callbacks to PCIDeviceInfo, so drivers needing these can be converted to the qdev device API too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/pcnet.c')
-rw-r--r--hw/pcnet.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/pcnet.c b/hw/pcnet.c
index a184146e0d..4519780cf8 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -2143,9 +2143,15 @@ static void lance_init(SysBusDevice *dev)
}
#endif /* TARGET_SPARC */
+static PCIDeviceInfo pcnet_info = {
+ .qdev.name = "pcnet",
+ .qdev.size = sizeof(PCIPCNetState),
+ .init = pci_pcnet_init,
+};
+
static void pcnet_register_devices(void)
{
- pci_qdev_register("pcnet", sizeof(PCIPCNetState), pci_pcnet_init);
+ pci_qdev_register(&pcnet_info);
#if defined (TARGET_SPARC) && !defined(TARGET_SPARC64)
sysbus_register_dev("lance", sizeof(SysBusPCNetState), lance_init);
#endif