[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/5] qdev: add ethernet capability
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 3/5] qdev: add ethernet capability |
Date: |
Mon, 31 Aug 2009 12:27:37 +0200 |
... and tag ethernet drivers. Also add some descriptions while being
at it.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/e1000.c | 2 ++
hw/eepro100.c | 6 ++++++
hw/ne2000.c | 2 ++
hw/pcnet.c | 3 +++
hw/qdev.c | 1 +
hw/qdev.h | 2 ++
hw/rtl8139.c | 2 ++
hw/virtio-pci.c | 1 +
8 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/hw/e1000.c b/hw/e1000.c
index 95c471c..5f7744d 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -1137,7 +1137,9 @@ static int pci_e1000_init(PCIDevice *pci_dev)
static PCIDeviceInfo e1000_info = {
.qdev.name = "e1000",
+ .qdev.desc = "Intel Gigabit Ethernet",
.qdev.size = sizeof(E1000State),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = pci_e1000_init,
};
diff --git a/hw/eepro100.c b/hw/eepro100.c
index c374931..bc7b625 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -1788,15 +1788,21 @@ static int pci_i82559er_init(PCIDevice *dev)
static PCIDeviceInfo eepro100_info[] = {
{
.qdev.name = "i82551",
+ .qdev.desc = "Intel EtherExpress PRO 100",
.qdev.size = sizeof(EEPRO100State),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = pci_i82551_init,
},{
.qdev.name = "i82557b",
+ .qdev.desc = "Intel EtherExpress PRO 100",
.qdev.size = sizeof(EEPRO100State),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = pci_i82557b_init,
},{
.qdev.name = "i82559er",
+ .qdev.desc = "Intel EtherExpress PRO 100",
.qdev.size = sizeof(EEPRO100State),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = pci_i82559er_init,
},{
/* end of list */
diff --git a/hw/ne2000.c b/hw/ne2000.c
index bdfc9ed..ee9f293 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -848,7 +848,9 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
static PCIDeviceInfo ne2000_info = {
.qdev.name = "ne2k_pci",
+ .qdev.desc = "NE2000 PCI Ethernet",
.qdev.size = sizeof(PCINE2000State),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = pci_ne2000_init,
};
diff --git a/hw/pcnet.c b/hw/pcnet.c
index 8c352d2..803a196 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -2158,6 +2158,7 @@ static SysBusDeviceInfo lance_info = {
.init = lance_init,
.qdev.name = "lance",
.qdev.size = sizeof(SysBusPCNetState),
+ .qdev.caps = DEV_CAP_ETHERNET,
.qdev.props = (Property[]) {
DEFINE_PROP_PTR("dma", SysBusPCNetState, state.dma_opaque),
DEFINE_PROP_END_OF_LIST(),
@@ -2168,7 +2169,9 @@ static SysBusDeviceInfo lance_info = {
static PCIDeviceInfo pcnet_info = {
.qdev.name = "pcnet",
+ .qdev.desc = "PCnet Lance Ethernet",
.qdev.size = sizeof(PCIPCNetState),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = pci_pcnet_init,
};
diff --git a/hw/qdev.c b/hw/qdev.c
index 760efd4..ff7da96 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -109,6 +109,7 @@ static int qdev_print_devinfo(DeviceInfo *info, char *dest,
int len)
{
static const char *capname[] = {
[ DEV_CAP_BIT_AUDIO ] = "audio",
+ [ DEV_CAP_BIT_ETHERNET ] = "ethernet",
};
const char *sep;
int pos = 0;
diff --git a/hw/qdev.h b/hw/qdev.h
index ef05903..45808fa 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -104,9 +104,11 @@ typedef void (*SCSIAttachFn)(DeviceState *host,
BlockDriverState *bdrv,
enum DeviceCapBits {
DEV_CAP_BIT_AUDIO = 0,
+ DEV_CAP_BIT_ETHERNET = 1,
};
#define DEV_CAP_AUDIO (1 << DEV_CAP_BIT_AUDIO)
+#define DEV_CAP_ETHERNET (1 << DEV_CAP_BIT_ETHERNET)
struct DeviceInfo {
const char *name;
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index b3542a3..1dc39be 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -3490,7 +3490,9 @@ static int pci_rtl8139_init(PCIDevice *dev)
static PCIDeviceInfo rtl8139_info = {
.qdev.name = "rtl8139",
+ .qdev.desc = "Realtek RTL8139 Fast Ethernet",
.qdev.size = sizeof(RTL8139State),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = pci_rtl8139_init,
};
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index f812ab7..20c89d7 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -518,6 +518,7 @@ static PCIDeviceInfo virtio_info[] = {
},{
.qdev.name = "virtio-net-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
+ .qdev.caps = DEV_CAP_ETHERNET,
.init = virtio_net_init_pci,
.qdev.props = (Property[]) {
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
--
1.6.2.5