From patchwork Mon Aug 31 10:27:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 32621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 6A8C1B7087 for ; Mon, 31 Aug 2009 20:36:58 +1000 (EST) Received: from localhost ([127.0.0.1]:45560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mi4Fn-0008Aq-1x for incoming@patchwork.ozlabs.org; Mon, 31 Aug 2009 06:36:51 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mi47A-0005IM-IF for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mi475-0005EL-Bp for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:55 -0400 Received: from [199.232.76.173] (port=56576 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mi475-0005EI-69 for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62902) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mi474-0003VA-Lf for qemu-devel@nongnu.org; Mon, 31 Aug 2009 06:27:51 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7VARlsd003050 for ; Mon, 31 Aug 2009 06:27:47 -0400 Received: from zweiblum.home.kraxel.org (vpn2-8-244.ams2.redhat.com [10.36.8.244]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n7VARfLq016851; Mon, 31 Aug 2009 06:27:43 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 3199A700DC; Mon, 31 Aug 2009 12:27:39 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 31 Aug 2009 12:27:37 +0200 Message-Id: <1251714459-2467-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1251714459-2467-1-git-send-email-kraxel@redhat.com> References: <1251714459-2467-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 3/5] qdev: add ethernet capability X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org ... and tag ethernet drivers. Also add some descriptions while being at it. Signed-off-by: Gerd Hoffmann --- 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,