Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- include/hw/net/pci.h | 1 + hw/mips/mips_malta.c | 2 +- hw/net/pcnet-pci.c | 3 +-- hw/ppc/prep.c | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h index 92111f86f3..5ad5487a91 100644 --- a/include/hw/net/pci.h +++ b/include/hw/net/pci.h @@ -15,6 +15,7 @@ #define TYPE_PCI_E1000 "e1000" #define TYPE_PCI_E1000E "e1000e" +#define TYPE_PCI_PCNET "pcnet" PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, const char *default_model, diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index fb6a2f9363..921678fdb0 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -597,7 +597,7 @@ static void network_init(PCIBus *pci_bus) /* The malta board has a PCNet card using PCI SLOT 11 */ default_devaddr = "0b"; - pci_nic_init_nofail(nd, pci_bus, "pcnet", default_devaddr); + pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_PCNET, default_devaddr); } } diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index 0acf8a4879..878e2c89c1 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -29,6 +29,7 @@ #include "qemu/osdep.h" #include "hw/pci/pci.h" +#include "hw/net/pci.h" #include "net/net.h" #include "hw/loader.h" #include "qemu/timer.h" @@ -46,8 +47,6 @@ //#define PCNET_DEBUG_TMD //#define PCNET_DEBUG_MATCH -#define TYPE_PCI_PCNET "pcnet" - #define PCI_PCNET(obj) \ OBJECT_CHECK(PCIPCNetState, (obj), TYPE_PCI_PCNET) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index fb330a1769..b2c7a62ebc 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -44,6 +44,7 @@ #include "hw/input/i8042.h" #include "hw/isa/pc87312.h" #include "hw/net/ne2000-isa.h" +#include "hw/net/pci.h" #include "sysemu/block-backend.h" #include "sysemu/arch_init.h" #include "sysemu/kvm.h" @@ -800,7 +801,7 @@ static void ibm_40p_init(MachineState *machine) pci_vga_init(pci_bus); for (i = 0; i < nb_nics; i++) { - pci_nic_init_nofail(&nd_table[i], pci_bus, "pcnet", + pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_PCNET, i == 0 ? "3" : NULL); } } -- 2.14.1