qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 3/5] qdev: add ethernet capability
Date: Mon, 31 Aug 2009 12:27:37 +0200	[thread overview]
Message-ID: <1251714459-2467-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1251714459-2467-1-git-send-email-kraxel@redhat.com>

... and tag ethernet drivers.  Also add some descriptions while being
at it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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

  parent reply	other threads:[~2009-08-31 10:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 10:27 [Qemu-devel] [PATCH 0/5] qdev: device capabilities Gerd Hoffmann
2009-08-31 10:27 ` [Qemu-devel] [PATCH 1/5] " Gerd Hoffmann
2009-08-31 10:27 ` [Qemu-devel] [PATCH 2/5] qdev: add audio capability Gerd Hoffmann
2009-08-31 10:27 ` Gerd Hoffmann [this message]
2009-08-31 10:27 ` [Qemu-devel] [PATCH 4/5] qdev: add display capability Gerd Hoffmann
2009-08-31 10:27 ` [Qemu-devel] [PATCH 5/5] qdev: add watchdog capability Gerd Hoffmann
2009-09-04 15:08 ` [Qemu-devel] [PATCH 0/5] qdev: device capabilities Anthony Liguori
2009-09-04 15:16   ` Gerd Hoffmann
2009-09-05 13:39     ` Anthony Liguori
2009-09-07 10:47       ` Gerd Hoffmann
2009-09-07 20:36         ` Anthony Liguori
2009-09-08  6:52           ` Gerd Hoffmann
2009-09-10 16:30             ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251714459-2467-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).