From nobody Tue Nov 26 17:41:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1706290431; cv=none; d=zohomail.com; s=zohoarc; b=IAmCl+WRN7qBGVg9WYAwqYtQFWhTVl+vYgiJOr2xN03TTLa+Lj7MTDygVW5bMOif2xpJscrRKc6Bxao05s3r8Pvfa/PwNRirVitm26NxWW33a/P/OpZlLn0Rzcpmx6dAEiaEqlZ8De2Qb+o39CftOXpsvdHAF70gNUmZ8BCzXBo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706290431; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qZJ5znInl8VUzkg42vOEqkv8s7zoSUtbb4o7syIWshQ=; b=lqTGlSrvjmQMjtkI3lcqLMZMUXAuJb88RPXeHjUlFh85mzTDlLALIRAD861sMdrO7FvGqhv20oyNgb5q3TKDORoGviis2Zt/nhzS7kG/ubbCBvHdgF38SSPpqgf6/pe+v0C5KPnj/42/kl76sFpOe47cXjQXQ9EBtJXacaj7UgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706290431911825.9939486179923; Fri, 26 Jan 2024 09:33:51 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.672262.1046133 (Exim 4.92) (envelope-from ) id 1rTQ4q-0006zO-6i; Fri, 26 Jan 2024 17:33:16 +0000 Received: by outflank-mailman (output) from mailman id 672262.1046133; Fri, 26 Jan 2024 17:33:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rTQ4p-0006vy-Kc; Fri, 26 Jan 2024 17:33:15 +0000 Received: by outflank-mailman (input) for mailman id 672262; Fri, 26 Jan 2024 17:33:13 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rTQ4n-0004m7-O4 for xen-devel@lists.xenproject.org; Fri, 26 Jan 2024 17:33:13 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f9d0fc83-bc70-11ee-98f5-efadbce2ee36; Fri, 26 Jan 2024 18:33:11 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ48-0000000EKUb-3N6A; Fri, 26 Jan 2024 17:32:34 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ49-00000001enH-2xlx; Fri, 26 Jan 2024 17:32:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: f9d0fc83-bc70-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=qZJ5znInl8VUzkg42vOEqkv8s7zoSUtbb4o7syIWshQ=; b=T/KFiNP0VoNy+dRDdUz85cVgqC d/xsD7bmL6yqgL5czKhzPlpCBdR4zMQ2tljn2inOKua253TIuXA5aleREh4omvZTb3lt5AE6FlLt4 FD5YLv2vx2lzct3UExbehtseqGJJrJBDqR6snT8lfXZhph3EQ38ZvTVzWpVFSvIXAjBrno+N4mQCE 6R/ethD97GGg1zQZEHFRl8VgWn0E79TwsyXQQe/4MlkzaLtMe8t2jP8icT93CfLgznQuh9IE9U1bp NolX4B5CEASRxWu1Ajg1aLzK3NEbQVSQQe61d6hOrsipftq5dBATnnjcGmpap6RNwzZrUayjzYQhh Y1TBCnVw==; From: David Woodhouse To: qemu-devel@nongnu.org Cc: Richard Henderson , Beniamino Galvani , Peter Maydell , Strahinja Jankovic , Niek Linnenbank , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Andrew Jeffery , Joel Stanley , Igor Mitsyanko , Jean-Christophe Dubois , Andrey Smirnov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Rob Herring , Subbaraya Sundeep , Jan Kiszka , Tyrone Ting , Hao Wu , Radoslaw Biernacki , Leif Lindholm , Marcin Juszkiewicz , "Edgar E. Iglesias" , Alistair Francis , Helge Deller , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Song Gao , Thomas Huth , Laurent Vivier , Huacai Chen , Jiaxun Yang , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aleksandar Rikalo , Aurelien Jarno , Jason Wang , Jia Liu , Stafford Horne , Mark Cave-Ayland , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , Bin Meng , Palmer Dabbelt , Weiwei Li , Liu Zhiwei , Halil Pasic , Christian Borntraeger , Eric Farman , David Hildenbrand , Ilya Leoshkevich , Yoshinori Sato , Magnus Damm , Artyom Tarasenko , Stefano Stabellini , Anthony Perard , Paul Durrant , Max Filippov , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, xen-devel@lists.xenproject.org, David Woodhouse , Thomas Huth Subject: [PATCH v4 31/47] hw/net/etraxfs-eth: use qemu_configure_nic_device() Date: Fri, 26 Jan 2024 17:25:08 +0000 Message-ID: <20240126173228.394202-32-dwmw2@infradead.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126173228.394202-1-dwmw2@infradead.org> References: <20240126173228.394202-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1706290432895100001 Content-Type: text/plain; charset="utf-8" From: David Woodhouse Signed-off-by: David Woodhouse Reviewed-by: Thomas Huth --- hw/cris/axis_dev88.c | 9 ++++----- hw/net/etraxfs_eth.c | 5 ++--- include/hw/cris/etraxfs.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index d82050d927..5556634921 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -308,15 +308,14 @@ void axisdev88_init(MachineState *machine) =20 /* Add the two ethernet blocks. */ dma_eth =3D g_malloc0(sizeof dma_eth[0] * 4); /* Allocate 4 channels. = */ - etraxfs_eth_init(&nd_table[0], 0x30034000, 1, &dma_eth[0], &dma_eth[1]= ); - if (nb_nics > 1) { - etraxfs_eth_init(&nd_table[1], 0x30036000, 2, &dma_eth[2], &dma_et= h[3]); - } =20 + etraxfs_eth_init(0x30034000, 1, &dma_eth[0], &dma_eth[1]); /* The DMA Connector block is missing, hardwire things for now. */ etraxfs_dmac_connect_client(etraxfs_dmac, 0, &dma_eth[0]); etraxfs_dmac_connect_client(etraxfs_dmac, 1, &dma_eth[1]); - if (nb_nics > 1) { + + if (qemu_find_nic_info("etraxfs-eth", true, "fseth")) { + etraxfs_eth_init(0x30036000, 2, &dma_eth[2], &dma_eth[3]); etraxfs_dmac_connect_client(etraxfs_dmac, 6, &dma_eth[2]); etraxfs_dmac_connect_client(etraxfs_dmac, 7, &dma_eth[3]); } diff --git a/hw/net/etraxfs_eth.c b/hw/net/etraxfs_eth.c index ba57a978d1..5faf20c782 100644 --- a/hw/net/etraxfs_eth.c +++ b/hw/net/etraxfs_eth.c @@ -647,15 +647,14 @@ static void etraxfs_eth_class_init(ObjectClass *klass= , void *data) =20 /* Instantiate an ETRAXFS Ethernet MAC. */ DeviceState * -etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr, +etraxfs_eth_init(hwaddr base, int phyaddr, struct etraxfs_dma_client *dma_out, struct etraxfs_dma_client *dma_in) { DeviceState *dev; - qemu_check_nic_model(nd, "fseth"); =20 dev =3D qdev_new("etraxfs-eth"); - qdev_set_nic_properties(dev, nd); + qemu_configure_nic_device(dev, true, "fseth"); qdev_prop_set_uint32(dev, "phyaddr", phyaddr); =20 /* diff --git a/include/hw/cris/etraxfs.h b/include/hw/cris/etraxfs.h index 467b529dc0..012c4e9974 100644 --- a/include/hw/cris/etraxfs.h +++ b/include/hw/cris/etraxfs.h @@ -31,7 +31,7 @@ #include "hw/sysbus.h" #include "qapi/error.h" =20 -DeviceState *etraxfs_eth_init(NICInfo *nd, hwaddr base, int phyaddr, +DeviceState *etraxfs_eth_init(hwaddr base, int phyaddr, struct etraxfs_dma_client *dma_out, struct etraxfs_dma_client *dma_in); =20 --=20 2.43.0