aboutsummaryrefslogtreecommitdiff
path: root/hw/net
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-10-17 17:31:48 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-07 17:24:29 +0400
commit4cc76287d81036909e43e29a7a42e8d9852041db (patch)
treeb0f34e334f89abded6505d540d6fe4e6e0f942d6 /hw/net
parent0fe4bb3241110fc9fbd1c5c457d58191fcdca5d3 (diff)
downloadqemu-4cc76287d81036909e43e29a7a42e8d9852041db.zip
qemu-4cc76287d81036909e43e29a7a42e8d9852041db.tar.gz
qemu-4cc76287d81036909e43e29a7a42e8d9852041db.tar.bz2
lance: replace PROP_PTR with PROP_LINK
The device remains non-user creatable since it is a sysbus device. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r--hw/net/lance.c5
-rw-r--r--hw/net/pcnet-pci.c2
-rw-r--r--hw/net/pcnet.h2
3 files changed, 4 insertions, 5 deletions
diff --git a/hw/net/lance.c b/hw/net/lance.c
index 6631e2a..4d96299 100644
--- a/hw/net/lance.c
+++ b/hw/net/lance.c
@@ -138,7 +138,8 @@ static void lance_instance_init(Object *obj)
}
static Property lance_properties[] = {
- DEFINE_PROP_PTR("dma", SysBusPCNetState, state.dma_opaque),
+ DEFINE_PROP_LINK("dma", SysBusPCNetState, state.dma_opaque,
+ TYPE_DEVICE, DeviceState *),
DEFINE_NIC_PROPERTIES(SysBusPCNetState, state.conf),
DEFINE_PROP_END_OF_LIST(),
};
@@ -153,8 +154,6 @@ static void lance_class_init(ObjectClass *klass, void *data)
dc->reset = lance_reset;
dc->vmsd = &vmstate_lance;
dc->props = lance_properties;
- /* Reason: pointer property "dma" */
- dc->user_creatable = false;
}
static const TypeInfo lance_info = {
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 4723c30..d067d21 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -231,7 +231,7 @@ static void pci_pcnet_realize(PCIDevice *pci_dev, Error **errp)
s->irq = pci_allocate_irq(pci_dev);
s->phys_mem_read = pci_physical_memory_read;
s->phys_mem_write = pci_physical_memory_write;
- s->dma_opaque = pci_dev;
+ s->dma_opaque = DEVICE(pci_dev);
pcnet_common_init(DEVICE(pci_dev), s, &net_pci_pcnet_info);
}
diff --git a/hw/net/pcnet.h b/hw/net/pcnet.h
index 28d19a5..f49b213 100644
--- a/hw/net/pcnet.h
+++ b/hw/net/pcnet.h
@@ -50,7 +50,7 @@ struct PCNetState_st {
uint8_t *buf, int len, int do_bswap);
void (*phys_mem_write)(void *dma_opaque, hwaddr addr,
uint8_t *buf, int len, int do_bswap);
- void *dma_opaque;
+ DeviceState *dma_opaque;
int tx_busy;
int looptest;
};