diff options
author | Paul Brook <paul@codesourcery.com> | 2009-05-14 22:35:07 +0100 |
---|---|---|
committer | Paul Brook <paul@codesourcery.com> | 2009-05-14 22:35:07 +0100 |
commit | 9d07d7579bcaf01e05c511c63d091ed2ac310091 (patch) | |
tree | 20ed00454b9ddabf62cc673b14d1234cbc078287 /hw/sun4m.c | |
parent | 9be5dafe488088bcff8f8365bc7dd35d3dac5186 (diff) | |
download | hqemu-9d07d7579bcaf01e05c511c63d091ed2ac310091.zip hqemu-9d07d7579bcaf01e05c511c63d091ed2ac310091.tar.gz |
PCI network qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "hw.h" +#include "sysbus.h" #include "qemu-timer.h" #include "sun4m.h" #include "nvram.h" @@ -364,6 +364,24 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename, return kernel_size; } +static void lance_init(NICInfo *nd, target_phys_addr_t leaddr, + void *dma_opaque, qemu_irq irq, qemu_irq *reset) +{ + DeviceState *dev; + SysBusDevice *s; + + qemu_check_nic_model(&nd_table[0], "lance"); + + dev = qdev_create(NULL, "lance"); + qdev_set_netdev(dev, nd); + qdev_set_prop_ptr(dev, "dma", dma_opaque); + qdev_init(dev); + s = sysbus_from_qdev(dev); + sysbus_mmio_map(s, 0, leaddr); + sysbus_connect_irq(s, 0, irq); + *reset = qdev_get_irq_sink(dev, 0); +} + static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size, const char *boot_device, const char *kernel_filename, |