]> Git Repo - qemu.git/blobdiff - hw/ne2000.c
cmd646: fix abort due to changed opaque pointer for ioport read
[qemu.git] / hw / ne2000.c
index 0be189af573143c5cddf1df788e3a86b0ad66888..78fe14fe1c21aa73a354992ed6b9d5320855d17a 100644 (file)
@@ -663,7 +663,7 @@ const VMStateDescription vmstate_ne2000 = {
     }
 };
 
-const VMStateDescription vmstate_pci_ne2000 = {
+static const VMStateDescription vmstate_pci_ne2000 = {
     .name = "ne2000",
     .version_id = 3,
     .minimum_version_id = 3,
@@ -724,7 +724,8 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
     pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_8029);
     pci_config_set_class(pci_conf, PCI_CLASS_NETWORK_ETHERNET);
     pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type
-    pci_conf[0x3d] = 1; // interrupt pin 0
+    /* TODO: RST# value should be 0. PCI spec 6.2.4 */
+    pci_conf[PCI_INTERRUPT_PIN] = 1; // interrupt pin 0
 
     pci_register_bar(&d->dev, 0, 0x100,
                            PCI_BASE_ADDRESS_SPACE_IO, ne2000_map);
@@ -746,7 +747,6 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
         }
     }
 
-    vmstate_register(-1, &vmstate_pci_ne2000, d);
     return 0;
 }
 
@@ -755,7 +755,6 @@ static int pci_ne2000_exit(PCIDevice *pci_dev)
     PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
     NE2000State *s = &d->ne2000;
 
-    vmstate_unregister(&vmstate_pci_ne2000, s);
     qemu_del_vlan_client(&s->nic->nc);
     return 0;
 }
@@ -763,6 +762,7 @@ static int pci_ne2000_exit(PCIDevice *pci_dev)
 static PCIDeviceInfo ne2000_info = {
     .qdev.name  = "ne2k_pci",
     .qdev.size  = sizeof(PCINE2000State),
+    .qdev.vmsd  = &vmstate_pci_ne2000,
     .init       = pci_ne2000_init,
     .exit       = pci_ne2000_exit,
     .qdev.props = (Property[]) {
This page took 0.027686 seconds and 4 git commands to generate.