{"id":817625,"url":"http://patchwork.ozlabs.org/api/patches/817625/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170922160111.31885-4-f4bug@amsat.org/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170922160111.31885-4-f4bug@amsat.org>","list_archive_url":null,"date":"2017-09-22T16:01:03","name":"[26/34] hw/net/ne2000: extract ne2k-isa code from i386/pc to ne2000-isa.c","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"5926202dc875177fab9bda30773f97fde582d68d","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/?format=json","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170922160111.31885-4-f4bug@amsat.org/mbox/","series":[{"id":4657,"url":"http://patchwork.ozlabs.org/api/series/4657/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4657","date":"2017-09-22T15:39:40","name":"remove i386/pc dependency from non-PC world (part 1)","version":1,"mbox":"http://patchwork.ozlabs.org/series/4657/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/817625/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/817625/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"pK2TwUOq\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xzJbZ3S2Lz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 02:19:54 +1000 (AEST)","from localhost ([::1]:59932 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dvQgC-0004yy-E1\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 12:19:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51637)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dvQOk-0006B4-NU\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 12:01:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dvQOj-0008Rl-EC\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 12:01:50 -0400","from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:33378)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dvQOj-0008RT-9j; Fri, 22 Sep 2017 12:01:49 -0400","by mail-qt0-x243.google.com with SMTP id b1so930196qtc.0;\n\tFri, 22 Sep 2017 09:01:49 -0700 (PDT)","from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id\n\ty31sm108325qta.83.2017.09.22.09.01.45\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 22 Sep 2017 09:01:48 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=6DjZmog4n/45jCIOJkqhryd4UV1+K90QdQo1G7wRsjE=;\n\tb=pK2TwUOq+baZMPBiOv+zBkfHmpVMO9lVgEz+zai6DzHbhUREP8ujSVO+78wA9xck6u\n\tLeeJsshlW2b4q70Y/KG7EPB/SJLCyKOK6pJEmY4z7DpV0NLmKbUXHBtLH2iZ4v48RiBV\n\tTQ64m8RqUA8OuzRcURuBJ1w+wVhFEqC2dmCWntpQUQAeFseMG83fu9uQKrWEx5awAQu+\n\t9dtZSIOlpyfcC/yUlDTeupaiffdh4BGIScTjP+VAXIi1QB+tpm4ZmGQ2mUwA/euPHBJe\n\tH7b8QorADhVhKUakDLsCNknepA+Jw81co7wgXV6tVp0N8P2Xd05pBg86GZtjog/IMFTW\n\tNi+g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references:mime-version:content-transfer-encoding;\n\tbh=6DjZmog4n/45jCIOJkqhryd4UV1+K90QdQo1G7wRsjE=;\n\tb=a9bc4cItUqtfgOx4FuZdnpe42yQooUVRgCbXezFW/CRLwo9DYjgzS+22WdNxaR/eU9\n\t7rPvNN8O17dTLP1zsxh7KJSMu3ngkwswT0TkOVA61QymVj5+cKLpILyi9Jj3qEooZudx\n\tdCbQ9v3HI0Iw3OkvMww/PrZkHtjyS35v4UmbITfgvo63q4/jr1i867HQbdy2qGFMLSR3\n\tD8+kcml3P5+jpjd6z4f041Yrz8X3CQRBlV2Tvd2Fx8mazevglVbkkYPzqEzn9Jpwh8dY\n\tajb4jR9UWEKvlQrwVGZ8Bs25/m9cHPGNm+Xp9iSuvti/oHmCL5yN00MEoAlVyp7Ob3um\n\tUWoA==","X-Gm-Message-State":"AHPjjUiOmRuU2DCCYB8kV4gXPy6aS+P/9+DBnttyfub7SeaJxb4BlNFw\n\tIFkESk6XVrKupg7/buwp9uecCSKVefU=","X-Google-Smtp-Source":"AOwi7QArqF6q+C6QbAGqMcdqBsKT/plSOohx9Ppvt2EtZ2ijzZv1pLFwdwKOyKqO73p2iu8QTPovwg==","X-Received":"by 10.200.26.65 with SMTP id q1mr8502737qtk.186.1506096108670;\n\tFri, 22 Sep 2017 09:01:48 -0700 (PDT)","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","To":"Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>, =?utf-8?q?Herv=C3=A9_Poussineau?=\n\t<hpoussin@reactos.org>, David Gibson <david@gibson.dropbear.id.au>,\n\tAlexander Graf <agraf@suse.de>, \tJason Wang <jasowang@redhat.com>","Date":"Fri, 22 Sep 2017 13:01:03 -0300","Message-Id":"<20170922160111.31885-4-f4bug@amsat.org>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170922154014.29350-1-f4bug@amsat.org>","References":"<20170922154014.29350-1-f4bug@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c0d::243","Subject":"[Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code\n\tfrom i386/pc to ne2000-isa.c","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathi?=\n\t=?utf-8?b?ZXUtRGF1ZMOp?= <f4bug@amsat.org>, \tqemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"- add \"hw/net/ne2000-isa.h\" (and new entry in MAINTAINERS)\n- remove the old i386 dependency\n\nSigned-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n---\n hw/net/ne2000.h             |  3 +++\n include/hw/i386/pc.h        | 20 --------------------\n include/hw/net/ne2000-isa.h | 33 +++++++++++++++++++++++++++++++++\n hw/i386/pc.c                |  1 +\n hw/mips/mips_r4k.c          |  1 +\n hw/net/ne2000-isa.c         |  6 ++----\n hw/net/ne2000.c             |  2 --\n hw/ppc/prep.c               |  1 +\n MAINTAINERS                 |  1 +\n 9 files changed, 42 insertions(+), 26 deletions(-)\n create mode 100644 include/hw/net/ne2000-isa.h","diff":"diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h\nindex d213dccae3..adb8021bd1 100644\n--- a/hw/net/ne2000.h\n+++ b/hw/net/ne2000.h\n@@ -1,6 +1,9 @@\n #ifndef HW_NE2000_H\n #define HW_NE2000_H\n \n+#include \"hw/hw.h\"\n+#include \"net/net.h\"\n+\n #define NE2000_PMEM_SIZE    (32*1024)\n #define NE2000_PMEM_START   (16*1024)\n #define NE2000_PMEM_END     (NE2000_PMEM_SIZE+NE2000_PMEM_START)\ndiff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h\nindex 6a2e947332..020792c2e8 100644\n--- a/include/hw/i386/pc.h\n+++ b/include/hw/i386/pc.h\n@@ -291,26 +291,6 @@ PCIBus *find_i440fx(void);\n extern PCIDevice *piix4_dev;\n int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);\n \n-/* ne2000.c */\n-static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)\n-{\n-    DeviceState *dev;\n-    ISADevice *isadev;\n-\n-    qemu_check_nic_model(nd, \"ne2k_isa\");\n-\n-    isadev = isa_try_create(bus, \"ne2k_isa\");\n-    if (!isadev) {\n-        return false;\n-    }\n-    dev = DEVICE(isadev);\n-    qdev_prop_set_uint32(dev, \"iobase\", base);\n-    qdev_prop_set_uint32(dev, \"irq\",    irq);\n-    qdev_set_nic_properties(dev, nd);\n-    qdev_init_nofail(dev);\n-    return true;\n-}\n-\n /* pc_sysfw.c */\n void pc_system_firmware_init(MemoryRegion *rom_memory,\n                              bool isapc_ram_fw);\ndiff --git a/include/hw/net/ne2000-isa.h b/include/hw/net/ne2000-isa.h\nnew file mode 100644\nindex 0000000000..ff2bed9c95\n--- /dev/null\n+++ b/include/hw/net/ne2000-isa.h\n@@ -0,0 +1,33 @@\n+/*\n+ * QEMU NE2000 emulation -- isa bus windup\n+ *\n+ * Copyright (c) 2003-2004 Fabrice Bellard\n+ *\n+ * This work is licensed under the terms of the GNU GPL, version 2 or later.\n+ * See the COPYING file in the top-level directory.\n+ */\n+#include \"hw/hw.h\"\n+#include \"hw/qdev.h\"\n+#include \"hw/isa/isa.h\"\n+#include \"net/net.h\"\n+\n+#define TYPE_ISA_NE2000 \"ne2k_isa\"\n+\n+static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq,\n+                                         NICInfo *nd)\n+{\n+    ISADevice *d;\n+\n+    qemu_check_nic_model(nd, \"ne2k_isa\");\n+\n+    d = isa_try_create(bus, TYPE_ISA_NE2000);\n+    if (d) {\n+        DeviceState *dev = DEVICE(d);\n+\n+        qdev_prop_set_uint32(dev, \"iobase\", base);\n+        qdev_prop_set_uint32(dev, \"irq\",    irq);\n+        qdev_set_nic_properties(dev, nd);\n+        qdev_init_nofail(dev);\n+    }\n+    return d;\n+}\ndiff --git a/hw/i386/pc.c b/hw/i386/pc.c\nindex 788844e0de..085577e066 100644\n--- a/hw/i386/pc.c\n+++ b/hw/i386/pc.c\n@@ -71,6 +71,7 @@\n #include \"qom/cpu.h\"\n #include \"hw/nmi.h\"\n #include \"hw/i386/intel_iommu.h\"\n+#include \"hw/net/ne2000-isa.h\"\n \n /* debug PC/ISA interrupts */\n //#define DEBUG_IRQ\ndiff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c\nindex 349da59912..33ff89f02c 100644\n--- a/hw/mips/mips_r4k.c\n+++ b/hw/mips/mips_r4k.c\n@@ -18,6 +18,7 @@\n #include \"hw/char/serial.h\"\n #include \"hw/isa/isa.h\"\n #include \"net/net.h\"\n+#include \"hw/net/ne2000-isa.h\"\n #include \"sysemu/sysemu.h\"\n #include \"hw/boards.h\"\n #include \"hw/block/flash.h\"\ndiff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c\nindex f3455339ee..70e5c1d3d4 100644\n--- a/hw/net/ne2000-isa.c\n+++ b/hw/net/ne2000-isa.c\n@@ -22,17 +22,15 @@\n  * THE SOFTWARE.\n  */\n #include \"qemu/osdep.h\"\n-#include \"hw/hw.h\"\n-#include \"hw/i386/pc.h\"\n #include \"hw/isa/isa.h\"\n+#include \"hw/net/ne2000-isa.h\"\n #include \"hw/qdev.h\"\n-#include \"net/net.h\"\n #include \"ne2000.h\"\n+#include \"sysemu/sysemu.h\"\n #include \"exec/address-spaces.h\"\n #include \"qapi/error.h\"\n #include \"qapi/visitor.h\"\n \n-#define TYPE_ISA_NE2000 \"ne2k_isa\"\n #define ISA_NE2000(obj) OBJECT_CHECK(ISANE2000State, (obj), TYPE_ISA_NE2000)\n \n typedef struct ISANE2000State {\ndiff --git a/hw/net/ne2000.c b/hw/net/ne2000.c\nindex 798d681e25..29bd4adb3f 100644\n--- a/hw/net/ne2000.c\n+++ b/hw/net/ne2000.c\n@@ -22,9 +22,7 @@\n  * THE SOFTWARE.\n  */\n #include \"qemu/osdep.h\"\n-#include \"hw/hw.h\"\n #include \"hw/pci/pci.h\"\n-#include \"net/net.h\"\n #include \"ne2000.h\"\n #include \"hw/loader.h\"\n #include \"sysemu/sysemu.h\"\ndiff --git a/hw/ppc/prep.c b/hw/ppc/prep.c\nindex 1f8ef4819b..fb330a1769 100644\n--- a/hw/ppc/prep.c\n+++ b/hw/ppc/prep.c\n@@ -43,6 +43,7 @@\n #include \"hw/timer/mc146818rtc.h\"\n #include \"hw/input/i8042.h\"\n #include \"hw/isa/pc87312.h\"\n+#include \"hw/net/ne2000-isa.h\"\n #include \"sysemu/block-backend.h\"\n #include \"sysemu/arch_init.h\"\n #include \"sysemu/kvm.h\"\ndiff --git a/MAINTAINERS b/MAINTAINERS\nindex 3cb6bc190c..37917af0f0 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -973,6 +973,7 @@ Network devices\n M: Jason Wang <jasowang@redhat.com>\n S: Odd Fixes\n F: hw/net/\n+F: include/hw/net/\n F: tests/virtio-net-test.c\n T: git git://github.com/jasowang/qemu.git net\n \n","prefixes":["26/34"]}