Revision b946a153 hw/eepro100.c

b/hw/eepro100.c
1710 1710
    qemu_put_buffer(f, s->configuration, sizeof(s->configuration));
1711 1711
}
1712 1712

  
1713
static void nic_cleanup(VLANClientState *vc)
1714
{
1715
    EEPRO100State *s = vc->opaque;
1716

  
1717
    unregister_savevm(vc->model, s);
1718

  
1719
    eeprom93xx_free(s->eeprom);
1720
}
1721

  
1722
static int pci_nic_uninit(PCIDevice *dev)
1723
{
1724
    PCIEEPRO100State *d = (PCIEEPRO100State *) dev;
1725
    EEPRO100State *s = &d->eepro100;
1726

  
1727
    cpu_unregister_io_memory(s->mmio_index);
1728

  
1729
    return 0;
1730
}
1731

  
1713 1732
static PCIDevice *nic_init(PCIBus * bus, NICInfo * nd, uint32_t device)
1714 1733
{
1715 1734
    PCIEEPRO100State *d;
......
1720 1739
    d = (PCIEEPRO100State *) pci_register_device(bus, nd->model,
1721 1740
                                                 sizeof(PCIEEPRO100State), -1,
1722 1741
                                                 NULL, NULL);
1742
    d->dev.unregister = pci_nic_uninit;
1723 1743

  
1724 1744
    s = &d->eepro100;
1725 1745
    s->device = device;
......
1750 1770
    nic_reset(s);
1751 1771

  
1752 1772
    s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
1753
                                 nic_receive, nic_can_receive, s);
1773
                                 nic_receive, nic_can_receive,
1774
                                 nic_cleanup, s);
1754 1775

  
1755 1776
    qemu_format_nic_info_str(s->vc, s->macaddr);
1756 1777

  

Also available in: Unified diff