[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-arm] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139 |
Date: |
Fri, 22 Sep 2017 13:01:08 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/net/pci.h | 1 +
hw/arm/realview.c | 3 ++-
hw/arm/versatilepb.c | 3 ++-
hw/mips/mips_fulong2e.c | 3 ++-
hw/net/rtl8139.c | 7 +++----
hw/sh4/r2d.c | 5 +++--
6 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/include/hw/net/pci.h b/include/hw/net/pci.h
index 5ad5487a91..43ed3b0145 100644
--- a/include/hw/net/pci.h
+++ b/include/hw/net/pci.h
@@ -16,6 +16,7 @@
#define TYPE_PCI_E1000 "e1000"
#define TYPE_PCI_E1000E "e1000e"
#define TYPE_PCI_PCNET "pcnet"
+#define TYPE_PCI_RTL8139 "rtl8139"
PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
const char *default_model,
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 87cd1e583c..35f0da28e4 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -20,6 +20,7 @@
#include "sysemu/sysemu.h"
#include "hw/boards.h"
#include "hw/i2c/i2c.h"
+#include "hw/net/pci.h"
#include "sysemu/block-backend.h"
#include "exec/address-spaces.h"
#include "qemu/error-report.h"
@@ -269,7 +270,7 @@ static void realview_init(MachineState *machine,
done_nic = 1;
} else {
if (pci_bus) {
- pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
+ pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, NULL);
}
}
}
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 418792cd02..297aad78e1 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -18,6 +18,7 @@
#include "sysemu/sysemu.h"
#include "hw/pci/pci.h"
#include "hw/i2c/i2c.h"
+#include "hw/net/pci.h"
#include "hw/boards.h"
#include "sysemu/block-backend.h"
#include "exec/address-spaces.h"
@@ -271,7 +272,7 @@ static void versatile_init(MachineState *machine, int
board_id)
smc91c111_init(nd, 0x10010000, sic[25]);
done_smc = 1;
} else {
- pci_nic_init_nofail(nd, pci_bus, "rtl8139", NULL);
+ pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, NULL);
}
}
if (machine_usb(machine)) {
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 7ebbffa8f2..fe618953c9 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -44,6 +44,7 @@
#include "hw/timer/mc146818rtc.h"
#include "hw/timer/i8254.h"
#include "hw/input/i8042.h"
+#include "hw/net/pci.h"
#include "sysemu/blockdev.h"
#include "exec/address-spaces.h"
#include "sysemu/qtest.h"
@@ -253,7 +254,7 @@ static void network_init (PCIBus *pci_bus)
default_devaddr = "07";
}
- pci_nic_init_nofail(nd, pci_bus, "rtl8139", default_devaddr);
+ pci_nic_init_nofail(nd, pci_bus, TYPE_PCI_RTL8139, default_devaddr);
}
}
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 3be24bbee7..0f952eceba 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -59,6 +59,7 @@
#include "net/net.h"
#include "net/eth.h"
#include "hw/loader.h"
+#include "hw/net/pci.h"
#include "sysemu/sysemu.h"
#include "qemu/iov.h"
@@ -90,10 +91,8 @@ static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char
*fmt, ...)
}
#endif
-#define TYPE_RTL8139 "rtl8139"
-
#define RTL8139(obj) \
- OBJECT_CHECK(RTL8139State, (obj), TYPE_RTL8139)
+ OBJECT_CHECK(RTL8139State, (obj), TYPE_PCI_RTL8139)
/* Symbolic offsets to registers. */
enum RTL8139_registers {
@@ -3437,7 +3436,7 @@ static void rtl8139_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo rtl8139_info = {
- .name = TYPE_RTL8139,
+ .name = TYPE_PCI_RTL8139,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(RTL8139State),
.class_init = rtl8139_class_init,
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index 16b9ed2db2..dde60b2bc2 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -39,6 +39,7 @@
#include "hw/ide.h"
#include "hw/loader.h"
#include "hw/usb.h"
+#include "hw/net/pci.h"
#include "hw/block/flash.h"
#include "sysemu/block-backend.h"
#include "exec/address-spaces.h"
@@ -303,8 +304,8 @@ static void r2d_init(MachineState *machine)
/* NIC: rtl8139 on-board, and 2 slots. */
for (i = 0; i < nb_nics; i++)
- pci_nic_init_nofail(&nd_table[i], pci_bus,
- "rtl8139", i==0 ? "2" : NULL);
+ pci_nic_init_nofail(&nd_table[i], pci_bus, TYPE_PCI_RTL8139,
+ i == 0 ? "2" : NULL);
/* USB keyboard */
usb_create_simple(usb_bus_find(-1), "usb-kbd");
--
2.14.1
- [Qemu-arm] [PATCH 31/34] hw/net/rtl8139: use TYPE_PCI_RTL8139,
Philippe Mathieu-Daudé <=