summaryrefslogtreecommitdiffstats
path: root/hw/lance.c
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-11-25 18:49:15 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 09:41:31 -0600
commit1fa5148223e77a705a8626fd9cacb1ba3f1c779f (patch)
treed9aa15043693fa087a1b37f8e35ca6470733abc3 /hw/lance.c
parent1c2045b549df75a2869e408d4fdec6738c72da81 (diff)
downloadhqemu-1fa5148223e77a705a8626fd9cacb1ba3f1c779f.zip
hqemu-1fa5148223e77a705a8626fd9cacb1ba3f1c779f.tar.gz
net: convert pcnet to NICState
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 0a96644..98033a4 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)
OpenPOWER on IntegriCloud