summaryrefslogtreecommitdiff
path: root/hw/net/ne2000.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/net/ne2000.c')
-rw-r--r--hw/net/ne2000.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index a62d12d92d..3ab2d03696 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -738,8 +738,6 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
- add_boot_device_path(s->c.bootindex, &pci_dev->qdev, "/ethernet-phy@0");
-
return 0;
}
@@ -752,6 +750,17 @@ static void pci_ne2000_exit(PCIDevice *pci_dev)
qemu_free_irq(s->irq);
}
+static void ne2000_instance_init(Object *obj)
+{
+ PCIDevice *pci_dev = PCI_DEVICE(obj);
+ PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
+ NE2000State *s = &d->ne2000;
+
+ device_add_bootindex_property(obj, &s->c.bootindex,
+ "bootindex", "/ethernet-phy@0",
+ &pci_dev->qdev, NULL);
+}
+
static Property ne2000_properties[] = {
DEFINE_NIC_PROPERTIES(PCINE2000State, ne2000.c),
DEFINE_PROP_END_OF_LIST(),
@@ -778,6 +787,7 @@ static const TypeInfo ne2000_info = {
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCINE2000State),
.class_init = ne2000_class_init,
+ .instance_init = ne2000_instance_init,
};
static void ne2000_register_types(void)