mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
net: convert pcnet to NICState
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
1c2045b549
commit
1fa5148223
3 changed files with 38 additions and 26 deletions
14
hw/lance.c
14
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue