aboutsummaryrefslogtreecommitdiff
path: root/hw/lance.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/lance.c')
-rw-r--r--hw/lance.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/hw/lance.c b/hw/lance.c
index 0a96644b43..98033a4ed3 100644
--- a/hw/lance.c
+++ b/hw/lance.c
@@ -92,14 +92,22 @@ static CPUWriteMemoryFunc * const lance_mem_write[3] = {
NULL,
};
-static void lance_cleanup(VLANClientState *vc)
+static void lance_cleanup(VLANClientState *nc)
{
- PCNetState *d = vc->opaque;
+ PCNetState *d = DO_UPCAST(NICState, nc, nc)->opaque;
vmstate_unregister(&vmstate_pcnet, d);
pcnet_common_cleanup(d);
}
+static NetClientInfo net_lance_info = {
+ .type = NET_CLIENT_TYPE_NIC,
+ .size = sizeof(NICState),
+ .can_receive = pcnet_can_receive,
+ .receive = pcnet_receive,
+ .cleanup = lance_cleanup,
+};
+
static int lance_init(SysBusDevice *dev)
{
SysBusPCNetState *d = FROM_SYSBUS(SysBusPCNetState, dev);
@@ -118,7 +126,7 @@ static int lance_init(SysBusDevice *dev)
s->phys_mem_write = ledma_memory_write;
vmstate_register(-1, &vmstate_pcnet, d);
- return pcnet_common_init(&dev->qdev, s, lance_cleanup);
+ return pcnet_common_init(&dev->qdev, s, &net_lance_info);
}
static void lance_reset(DeviceState *dev)