]> git.proxmox.com Git - qemu.git/blobdiff - hw/etraxfs_eth.c
PPC: Fix TLB invalidation bug within the PPC interrupt handler.
[qemu.git] / hw / etraxfs_eth.c
index 5ac2d15fa1f86e767206dcea10e2f4d3918fa76c..16a0637a4a9aed1ff3bb9277ca59ed5f805cf04b 100644 (file)
@@ -323,7 +323,6 @@ struct fs_eth
        MemoryRegion mmio;
        NICState *nic;
        NICConf conf;
-       int ethregs;
 
        /* Two addrs in the filter.  */
        uint8_t macaddr[2][6];
@@ -541,7 +540,7 @@ static ssize_t eth_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
         return size;
 }
 
-static int eth_tx_push(void *opaque, unsigned char *buf, int len)
+static int eth_tx_push(void *opaque, unsigned char *buf, int len, bool eop)
 {
        struct fs_eth *eth = opaque;
 
@@ -571,8 +570,6 @@ static void eth_cleanup(VLANClientState *nc)
 {
        struct fs_eth *eth = DO_UPCAST(NICState, nc, nc)->opaque;
 
-        cpu_unregister_io_memory(eth->ethregs);
-
        /* Disconnect the client.  */
        eth->dma_out->client.push = NULL;
        eth->dma_out->client.opaque = NULL;
@@ -608,7 +605,7 @@ static int fs_eth_init(SysBusDevice *dev)
 
        qemu_macaddr_default_if_unset(&s->conf.macaddr);
        s->nic = qemu_new_nic(&net_etraxfs_info, &s->conf,
-                             dev->qdev.info->name, dev->qdev.id, s);
+                             object_get_typename(OBJECT(s)), dev->qdev.id, s);
        qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a);
 
        tdk_init(&s->phy);
@@ -616,22 +613,33 @@ static int fs_eth_init(SysBusDevice *dev)
        return 0;
 }
 
-static SysBusDeviceInfo etraxfs_eth_info = {
-       .init = fs_eth_init,
-       .qdev.name  = "etraxfs-eth",
-       .qdev.size  = sizeof(struct fs_eth),
-       .qdev.props = (Property[]) {
-               DEFINE_PROP_UINT32("phyaddr", struct fs_eth, phyaddr, 1),
-               DEFINE_PROP_PTR("dma_out", struct fs_eth, vdma_out),
-               DEFINE_PROP_PTR("dma_in", struct fs_eth, vdma_in),
-               DEFINE_NIC_PROPERTIES(struct fs_eth, conf),
-               DEFINE_PROP_END_OF_LIST(),
-       }
+static Property etraxfs_eth_properties[] = {
+    DEFINE_PROP_UINT32("phyaddr", struct fs_eth, phyaddr, 1),
+    DEFINE_PROP_PTR("dma_out", struct fs_eth, vdma_out),
+    DEFINE_PROP_PTR("dma_in", struct fs_eth, vdma_in),
+    DEFINE_NIC_PROPERTIES(struct fs_eth, conf),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void etraxfs_eth_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+
+    k->init = fs_eth_init;
+    dc->props = etraxfs_eth_properties;
+}
+
+static TypeInfo etraxfs_eth_info = {
+    .name          = "etraxfs-eth",
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(struct fs_eth),
+    .class_init    = etraxfs_eth_class_init,
 };
 
-static void etraxfs_eth_register(void)
+static void etraxfs_eth_register_types(void)
 {
-       sysbus_register_withprop(&etraxfs_eth_info);
+    type_register_static(&etraxfs_eth_info);
 }
 
-device_init(etraxfs_eth_register)
+type_init(etraxfs_eth_register_types)