diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-11-25 18:49:14 +0000 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-03 09:41:31 -0600 |
commit | 1c2045b549df75a2869e408d4fdec6738c72da81 (patch) | |
tree | 6eb42b6385a5b5443f9e9b5417eadf19e2557c8e /hw/ne2000-isa.c | |
parent | 1673ad513edcfc0a8b8a38116dd63d5bc83020ff (diff) |
net: convert ne2000 to NICState
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ne2000-isa.c')
-rw-r--r-- | hw/ne2000-isa.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/hw/ne2000-isa.c b/hw/ne2000-isa.c index 729e8e2253..0260f849fd 100644 --- a/hw/ne2000-isa.c +++ b/hw/ne2000-isa.c @@ -35,13 +35,21 @@ typedef struct ISANE2000State { NE2000State ne2000; } ISANE2000State; -static void isa_ne2000_cleanup(VLANClientState *vc) +static void isa_ne2000_cleanup(VLANClientState *nc) { - NE2000State *s = vc->opaque; + NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque; - s->vc = NULL; + s->nic = NULL; } +static NetClientInfo net_ne2000_isa_info = { + .type = NET_CLIENT_TYPE_NIC, + .size = sizeof(NICState), + .can_receive = ne2000_can_receive, + .receive = ne2000_receive, + .cleanup = isa_ne2000_cleanup, +}; + static int isa_ne2000_initfn(ISADevice *dev) { ISANE2000State *isa = DO_UPCAST(ISANE2000State, dev, dev); @@ -63,11 +71,9 @@ static int isa_ne2000_initfn(ISADevice *dev) qemu_macaddr_default_if_unset(&s->c.macaddr); ne2000_reset(s); - s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_NIC, s->c.vlan, s->c.peer, - dev->qdev.info->name, dev->qdev.id, - ne2000_can_receive, ne2000_receive, NULL, - NULL, isa_ne2000_cleanup, s); - qemu_format_nic_info_str(s->vc, s->c.macaddr.a); + s->nic = qemu_new_nic(&net_ne2000_isa_info, &s->c, + dev->qdev.info->name, dev->qdev.id, s); + qemu_format_nic_info_str(&s->nic->nc, s->c.macaddr.a); vmstate_register(-1, &vmstate_ne2000, s); return 0; |