mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
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>
This commit is contained in:
parent
e2b19c85ea
commit
0aab0d3a4a
10 changed files with 103 additions and 36 deletions
|
@ -1125,9 +1125,15 @@ static void pci_e1000_init(PCIDevice *pci_dev)
|
|||
e1000_reset(d);
|
||||
}
|
||||
|
||||
static PCIDeviceInfo e1000_info = {
|
||||
.qdev.name = "e1000",
|
||||
.qdev.size = sizeof(E1000State),
|
||||
.init = pci_e1000_init,
|
||||
};
|
||||
|
||||
static void e1000_register_devices(void)
|
||||
{
|
||||
pci_qdev_register("e1000", sizeof(E1000State), pci_e1000_init);
|
||||
pci_qdev_register(&e1000_info);
|
||||
}
|
||||
|
||||
device_init(e1000_register_devices)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue