Revision b946a153 hw/musicpal.c

b/hw/musicpal.c
536 536
    uint32_t smir;
537 537
    uint32_t icr;
538 538
    uint32_t imr;
539
    int mmio_index;
539 540
    int vlan_header;
540 541
    uint32_t tx_queue[2];
541 542
    uint32_t rx_queue[4];
......
745 746
    mv88w8618_eth_write
746 747
};
747 748

  
749
static void eth_cleanup(VLANClientState *vc)
750
{
751
    mv88w8618_eth_state *s = vc->opaque;
752

  
753
    cpu_unregister_io_memory(s->mmio_index);
754

  
755
    qemu_free(s);
756
}
757

  
748 758
static void mv88w8618_eth_init(NICInfo *nd, uint32_t base, qemu_irq irq)
749 759
{
750 760
    mv88w8618_eth_state *s;
751
    int iomemtype;
752 761

  
753 762
    qemu_check_nic_model(nd, "mv88w8618");
754 763

  
755 764
    s = qemu_mallocz(sizeof(mv88w8618_eth_state));
756 765
    s->irq = irq;
757 766
    s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
758
                                 eth_receive, eth_can_receive, s);
759
    iomemtype = cpu_register_io_memory(0, mv88w8618_eth_readfn,
760
                                       mv88w8618_eth_writefn, s);
761
    cpu_register_physical_memory(base, MP_ETH_SIZE, iomemtype);
767
                                 eth_receive, eth_can_receive,
768
                                 eth_cleanup, s);
769
    s->mmio_index = cpu_register_io_memory(0, mv88w8618_eth_readfn,
770
                                           mv88w8618_eth_writefn, s);
771
    cpu_register_physical_memory(base, MP_ETH_SIZE, s->mmio_index);
762 772
}
763 773

  
764 774
/* LCD register offsets */

Also available in: Unified diff