summaryrefslogtreecommitdiffstats
path: root/hw/e1000.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 12:22:06 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:50 -0600
commit40021f08882aaef93c66c8c740087b6d3031b63a (patch)
treea0429c040df66503d807770a3b89da9a0c70d8ac /hw/e1000.c
parent6e4ec3f9bb32d6f41e4fb30b872d2b7b084bc9a9 (diff)
downloadhqemu-40021f08882aaef93c66c8c740087b6d3031b63a.zip
hqemu-40021f08882aaef93c66c8c740087b6d3031b63a.tar.gz
pci: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/e1000.c')
-rw-r--r--hw/e1000.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/hw/e1000.c b/hw/e1000.c
index 7fc7318..200eed6 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1197,23 +1197,32 @@ static void qdev_e1000_reset(DeviceState *dev)
e1000_reset(d);
}
-static PCIDeviceInfo e1000_info = {
- .qdev.name = "e1000",
- .qdev.desc = "Intel Gigabit Ethernet",
- .qdev.size = sizeof(E1000State),
- .qdev.reset = qdev_e1000_reset,
- .qdev.vmsd = &vmstate_e1000,
- .init = pci_e1000_init,
- .exit = pci_e1000_uninit,
- .romfile = "pxe-e1000.rom",
- .vendor_id = PCI_VENDOR_ID_INTEL,
- .device_id = E1000_DEVID,
- .revision = 0x03,
- .class_id = PCI_CLASS_NETWORK_ETHERNET,
- .qdev.props = (Property[]) {
- DEFINE_NIC_PROPERTIES(E1000State, conf),
- DEFINE_PROP_END_OF_LIST(),
- }
+static Property e1000_properties[] = {
+ DEFINE_NIC_PROPERTIES(E1000State, conf),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void e1000_class_init(ObjectClass *klass, void *data)
+{
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+
+ k->init = pci_e1000_init;
+ k->exit = pci_e1000_uninit;
+ k->romfile = "pxe-e1000.rom";
+ k->vendor_id = PCI_VENDOR_ID_INTEL;
+ k->device_id = E1000_DEVID;
+ k->revision = 0x03;
+ k->class_id = PCI_CLASS_NETWORK_ETHERNET;
+}
+
+static DeviceInfo e1000_info = {
+ .name = "e1000",
+ .desc = "Intel Gigabit Ethernet",
+ .size = sizeof(E1000State),
+ .reset = qdev_e1000_reset,
+ .vmsd = &vmstate_e1000,
+ .props = e1000_properties,
+ .class_init = e1000_class_init,
};
static void e1000_register_devices(void)
OpenPOWER on IntegriCloud