qemu_format_nic_info_str(d->vc, macaddr);
register_savevm(info_str, -1, 2, nic_save, nic_load, d);
- d->dev.unregister = pci_e1000_uninit;
qemu_register_reset(e1000_reset, d);
e1000_reset(d);
return 0;
.qdev.name = "e1000",
.qdev.size = sizeof(E1000State),
.init = pci_e1000_init,
+ .exit = pci_e1000_uninit,
};
static void e1000_register_devices(void)
TRACE(OTHER, logout("\n"));
- s->dev.unregister = pci_nic_uninit;
-
s->device = device;
pci_reset(s);
.qdev.name = "i82551",
.qdev.size = sizeof(EEPRO100State),
.init = pci_i82551_init,
+ .exit = pci_nic_uninit,
},{
.qdev.name = "i82557a",
.qdev.size = sizeof(EEPRO100State),
.qdev.name = "i82557b",
.qdev.size = sizeof(EEPRO100State),
.init = pci_i82557b_init,
+ .exit = pci_nic_uninit,
},{
.qdev.name = "i82557c",
.qdev.size = sizeof(EEPRO100State),
.qdev.name = "i82559er",
.qdev.size = sizeof(EEPRO100State),
.init = pci_i82559er_init,
+ .exit = pci_nic_uninit,
},{
.qdev.name = "i82562",
.qdev.size = sizeof(EEPRO100State),
s->queue = qemu_malloc(sizeof(lsi_queue));
s->queue_len = 1;
s->active_commands = 0;
- s->dev.unregister = lsi_scsi_uninit;
lsi_soft_reset(s);
.qdev.alias = "lsi",
.qdev.size = sizeof(LSIState),
.init = lsi_scsi_init,
+ .exit = lsi_scsi_uninit,
};
static void lsi53c895a_register_devices(void)
#include "monitor.h"
#include "net.h"
#include "sysemu.h"
+#include "msix.h"
//#define DEBUG_PCI
#ifdef DEBUG_PCI
static int pci_unregister_device(DeviceState *dev)
{
PCIDevice *pci_dev = DO_UPCAST(PCIDevice, qdev, dev);
+ PCIDeviceInfo *info = DO_UPCAST(PCIDeviceInfo, qdev, dev->info);
int ret = 0;
- if (pci_dev->unregister)
- ret = pci_dev->unregister(pci_dev);
+ if (info->exit)
+ ret = info->exit(pci_dev);
if (ret)
return ret;
+ msix_uninit(pci_dev);
pci_unregister_io_regions(pci_dev);
qemu_free_irqs(pci_dev->irq);
typedef struct {
DeviceInfo qdev;
pci_qdev_initfn init;
+ PCIUnregisterFunc *exit;
PCIConfigReadFunc *config_read;
PCIConfigWriteFunc *config_write;
} PCIDeviceInfo;
sizeof(struct pcnet_RMD), sizeof(struct pcnet_TMD));
#endif
- pci_dev->unregister = pci_pcnet_uninit;
-
pci_conf = pci_dev->config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_AMD);
.qdev.name = "pcnet",
.qdev.size = sizeof(PCIPCNetState),
.init = pci_pcnet_init,
+ .exit = pci_pcnet_uninit,
};
static void pcnet_register_devices(void)
RTL8139State * s = DO_UPCAST(RTL8139State, dev, dev);
uint8_t *pci_conf;
- s->dev.unregister = pci_rtl8139_uninit;
-
pci_conf = s->dev.config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_REALTEK);
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_8139);
.qdev.size = sizeof(RTL8139State),
.qdev.reset = rtl8139_reset,
.init = pci_rtl8139_init,
+ .exit = pci_rtl8139_uninit,
};
static void rtl8139_register_devices(void)
msix_bar_size(&proxy->pci_dev),
PCI_ADDRESS_SPACE_MEM,
msix_mmio_map);
- proxy->pci_dev.unregister = msix_uninit;
} else
vdev->nvectors = 0;