xref: /openbmc/qemu/include/hw/net/ne2000-isa.h (revision 438c78da)
1 /*
2  * QEMU NE2000 emulation -- isa bus windup
3  *
4  * Copyright (c) 2003-2004 Fabrice Bellard
5  *
6  * This work is licensed under the terms of the GNU GPL, version 2 or later.
7  * See the COPYING file in the top-level directory.
8  */
9 #include "hw/hw.h"
10 #include "hw/qdev.h"
11 #include "hw/isa/isa.h"
12 #include "net/net.h"
13 
14 #define TYPE_ISA_NE2000 "ne2k_isa"
15 
16 static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq,
17                                          NICInfo *nd)
18 {
19     ISADevice *d;
20 
21     qemu_check_nic_model(nd, "ne2k_isa");
22 
23     d = isa_try_create(bus, TYPE_ISA_NE2000);
24     if (d) {
25         DeviceState *dev = DEVICE(d);
26 
27         qdev_prop_set_uint32(dev, "iobase", base);
28         qdev_prop_set_uint32(dev, "irq",    irq);
29         qdev_set_nic_properties(dev, nd);
30         qdev_init_nofail(dev);
31     }
32     return d;
33 }
34