[{"id":1773853,"web_url":"http://patchwork.ozlabs.org/comment/1773853/","msgid":"<97087b0e-6960-9429-fff5-97cfd75436bc@reactos.org>","list_archive_url":null,"date":"2017-09-22T20:13:12","subject":"Re: [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code\n\tfrom i386/pc to ne2000-isa.c","submitter":{"id":2909,"url":"http://patchwork.ozlabs.org/api/people/2909/","name":"Hervé Poussineau","email":"hpoussin@reactos.org"},"content":"Le 22/09/2017 à 18:01, Philippe Mathieu-Daudé a écrit :\n> - add \"hw/net/ne2000-isa.h\" (and new entry in MAINTAINERS)\n> - remove the old i386 dependency\n> \n> Signed-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\n\nReviewed-by: Hervé Poussineau <hpoussin@reactos.org>","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\" (1024-bit key;\n\tunprotected) header.d=reactos.org header.i=@reactos.org\n\theader.b=\"DDBL2EsD\"; 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 3xzPpF6CqWz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 06:14:29 +1000 (AEST)","from localhost ([::1]:60860 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 1dvULD-0006Jm-UL\n\tfor incoming@patchwork.ozlabs.org; Fri, 22 Sep 2017 16:14:27 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33648)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <hpoussin@reactos.org>) id 1dvUKC-000636-IF\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 16:13:25 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <hpoussin@reactos.org>) id 1dvUKB-0005zW-Lc\n\tfor qemu-devel@nongnu.org; Fri, 22 Sep 2017 16:13:24 -0400","from iserv.reactos.org ([2a01:4f8:221:4c5::3]:47261)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <hpoussin@reactos.org>)\n\tid 1dvUK3-0005u5-GA; Fri, 22 Sep 2017 16:13:15 -0400","from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196]\n\thelo=[192.168.0.35]) by iserv.reactos.org with esmtpsa\n\t(TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2)\n\t(envelope-from <hpoussin@reactos.org>)\n\tid 1dvUK2-0005gC-G5; Fri, 22 Sep 2017 20:13:14 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=reactos.org; s=25047; \n\th=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject;\n\tbh=KErYg449zFtsuUD+ButGmSUAyXe4nia2KYeoDifpqYs=; \n\tb=DDBL2EsDhTcwulRhM1s75fzSnR3ReISU67PusHJ2TJxM7vKP4P+8SQzJDHAekfGComnt4g7HQ1iLWgtS7jpofZe+oFcZVaNWMHwc2YBO7Del0HmuH909gIz+b6KURK+tOvNdObpduQXqhq4M03SywBkViprObR1MS3KjhKRbMw0=;","To":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tPeter Maydell <peter.maydell@linaro.org>,\n\tThomas Huth <thuth@redhat.com>, \tPaolo Bonzini <pbonzini@redhat.com>,\n\tDavid Gibson <david@gibson.dropbear.id.au>, \n\tAlexander Graf <agraf@suse.de>, Jason Wang <jasowang@redhat.com>","References":"<20170922154014.29350-1-f4bug@amsat.org>\n\t<20170922160111.31885-4-f4bug@amsat.org>","From":"=?utf-8?q?Herv=C3=A9_Poussineau?= <hpoussin@reactos.org>","Message-ID":"<97087b0e-6960-9429-fff5-97cfd75436bc@reactos.org>","Date":"Fri, 22 Sep 2017 22:13:12 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170922160111.31885-4-f4bug@amsat.org>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]","X-Received-From":"2a01:4f8:221:4c5::3","Subject":"Re: [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, qemu-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>"}},{"id":1773986,"web_url":"http://patchwork.ozlabs.org/comment/1773986/","msgid":"<20170923051153.GA4998@umbus.fritz.box>","list_archive_url":null,"date":"2017-09-23T05:11:53","subject":"Re: [Qemu-devel] [PATCH 26/34] hw/net/ne2000: extract ne2k-isa code\n\tfrom i386/pc to ne2000-isa.c","submitter":{"id":47,"url":"http://patchwork.ozlabs.org/api/people/47/","name":"David Gibson","email":"david@gibson.dropbear.id.au"},"content":"On Fri, Sep 22, 2017 at 01:01:03PM -0300, Philippe Mathieu-Daudé wrote:\n> - add \"hw/net/ne2000-isa.h\" (and new entry in MAINTAINERS)\n> - remove the old i386 dependency\n> \n> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n\nppc portion\n\nAcked-by: David Gibson <david@gibson.dropbear.id.au>\n\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\n> \n> diff --git a/hw/net/ne2000.h b/hw/net/ne2000.h\n> index 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)\n> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h\n> index 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);\n> diff --git a/include/hw/net/ne2000-isa.h b/include/hw/net/ne2000-isa.h\n> new file mode 100644\n> index 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> +}\n> diff --git a/hw/i386/pc.c b/hw/i386/pc.c\n> index 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\n> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c\n> index 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\"\n> diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c\n> index 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 {\n> diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c\n> index 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\"\n> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c\n> index 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\"\n> diff --git a/MAINTAINERS b/MAINTAINERS\n> index 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>","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\" (1024-bit key;\n\tunprotected) header.d=gibson.dropbear.id.au\n\theader.i=@gibson.dropbear.id.au header.b=\"UFVw0UtE\"; \n\tdkim-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 3xzfPF5Lz8z9t67\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 23 Sep 2017 15:42:09 +1000 (AEST)","from localhost ([::1]:33793 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 1dvdCZ-00083T-Tf\n\tfor incoming@patchwork.ozlabs.org; Sat, 23 Sep 2017 01:42:07 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36296)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dvd0N-0007Ov-LH\n\tfor qemu-devel@nongnu.org; Sat, 23 Sep 2017 01:29:34 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <dgibson@ozlabs.org>) id 1dvd0L-0002Dn-Dj\n\tfor qemu-devel@nongnu.org; Sat, 23 Sep 2017 01:29:31 -0400","from ozlabs.org ([2401:3900:2:1::2]:49783)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <dgibson@ozlabs.org>)\n\tid 1dvd0K-00029z-DS; Sat, 23 Sep 2017 01:29:29 -0400","by ozlabs.org (Postfix, from userid 1007)\n\tid 3xzf6S0Yw6z9t4B; Sat, 23 Sep 2017 15:29:19 +1000 (AEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n\td=gibson.dropbear.id.au; s=201602; t=1506144560;\n\tbh=AVUYf9pVGuzUZXwHKAwQaZ0340AUvio224kBJ7yce0Y=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=UFVw0UtE1TSJkhAx1bBp4pLykhv9B2iTeDoJLU03ef1zQUBTrA0oOb08cJO8ZCR8T\n\tEQhHIArncCj1EX/ZJhXcCUDmq8s74/ftvzukiyZtgbi02k3RhU2RaabzSJ4i86XY7i\n\tc1guDsu0zz0bz+7iNXIp5wxOVoK90pgQ2kcUltYo=","Date":"Sat, 23 Sep 2017 15:11:53 +1000","From":"David Gibson <david@gibson.dropbear.id.au>","To":"Philippe =?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Message-ID":"<20170923051153.GA4998@umbus.fritz.box>","References":"<20170922154014.29350-1-f4bug@amsat.org>\n\t<20170922160111.31885-4-f4bug@amsat.org>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"QxSStYAgvEtE+iQJ\"","Content-Disposition":"inline","In-Reply-To":"<20170922160111.31885-4-f4bug@amsat.org>","User-Agent":"Mutt/1.9.0 (2017-09-02)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2401:3900:2:1::2","Subject":"Re: [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":"Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>,\n\tqemu-ppc@nongnu.org, Jason Wang <jasowang@redhat.com>, Alexander Graf\n\t<agraf@suse.de>, qemu-devel@nongnu.org, \tqemu-trivial@nongnu.org,\n\t=?iso-8859-1?q?Herv=E9?= Poussineau <hpoussin@reactos.org>,\n\tPaolo Bonzini <pbonzini@redhat.com>","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>"}}]