diff options
author | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2011-08-09 13:24:04 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2011-08-11 11:12:16 +0200 |
commit | d949396e5303f4f916ec3733eee0ab365f500dc8 (patch) | |
tree | 44b61f4c755a21fc6401090daa844f83791275ca /hw/etraxfs.h | |
parent | b9c6cbff76061537b722d55f0e321dde2a612a23 (diff) | |
download | qemu-d949396e5303f4f916ec3733eee0ab365f500dc8.zip qemu-d949396e5303f4f916ec3733eee0ab365f500dc8.tar.gz qemu-d949396e5303f4f916ec3733eee0ab365f500dc8.tar.bz2 |
etrax: QDevify the Ethernet MAC.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw/etraxfs.h')
-rw-r--r-- | hw/etraxfs.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/hw/etraxfs.h b/hw/etraxfs.h index 5c61f1b..1554b0b 100644 --- a/hw/etraxfs.h +++ b/hw/etraxfs.h @@ -25,6 +25,21 @@ #include "etraxfs_dma.h" qemu_irq *cris_pic_init_cpu(CPUState *env); -void etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr, - struct etraxfs_dma_client *dma_out, - struct etraxfs_dma_client *dma_in); + +/* Instantiate an ETRAXFS Ethernet MAC. */ +static inline DeviceState * +etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr, + void *dma_out, void *dma_in) +{ + DeviceState *dev; + qemu_check_nic_model(nd, "fseth"); + + dev = qdev_create(NULL, "etraxfs-eth"); + qdev_set_nic_properties(dev, nd); + qdev_prop_set_uint32(dev, "phyaddr", phyaddr); + qdev_prop_set_ptr(dev, "dma_out", dma_out); + qdev_prop_set_ptr(dev, "dma_in", dma_in); + qdev_init_nofail(dev); + sysbus_mmio_map(sysbus_from_qdev(dev), 0, base); + return dev; +} |