From nobody Wed Nov 27 12:40:14 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=1699300559; cv=none; d=zohomail.com; s=zohoarc; b=S85odjCIcCWd6r0RgdOB+4XBcJQDnxESBr84MtfNL6vVo2KtkyTpE/FZsu41PZALN0x5zAgwovPfhZzjMnyGXeXlzt16LFNYSrcDQX0rbaXX58ttdvxFk0jK8eVbnShYu0Sxb9VfgitmS9qEaSU0XmbVwGDHFqKVAJVonznoeC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699300559; 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=tlzAB3Jn/UWpyGkQsCC1RyHcWVov5/+PrTpxS04M0Yo=; b=dzvqh7egnHQlFggyFYTA/np/qsLeHcSNhrTivduDUh1JJ7MrQTTlMzEzWedDYl/KE9dfttMtLixZ6t7urX6UP8LWvq4woxESPmtPO/fRqXIL1OrzlSuQ1fVONDEXDSRwCJ/9kvO5l8EmkYkYqASlZFJo/hu68aNDHOkHWZ982fs= 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 1699300559806587.7016265696234; Mon, 6 Nov 2023 11:55:59 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.628285.979574 (Exim 4.92) (envelope-from ) id 1r05hB-00026B-RA; Mon, 06 Nov 2023 19:55:37 +0000 Received: by outflank-mailman (output) from mailman id 628285.979574; Mon, 06 Nov 2023 19:55:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r05hB-000250-OG; Mon, 06 Nov 2023 19:55:37 +0000 Received: by outflank-mailman (input) for mailman id 628285; Mon, 06 Nov 2023 19:55:36 +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 1r05hA-0001Ig-SV for xen-devel@lists.xenproject.org; Mon, 06 Nov 2023 19:55:36 +0000 Received: from desiato.infradead.org (desiato.infradead.org [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 72382b58-7cde-11ee-9b0e-b553b5be7939; Mon, 06 Nov 2023 20:55:33 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1r05fc-00AkG9-37; Mon, 06 Nov 2023 19:54:02 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96.2 #2 (Red Hat Linux)) id 1r05fc-001GP9-28; Mon, 06 Nov 2023 19:54:00 +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: 72382b58-7cde-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=tlzAB3Jn/UWpyGkQsCC1RyHcWVov5/+PrTpxS04M0Yo=; b=fJHIzraBFvJZJ10z0UlO4aRJj/ hLvbp2Pve7Xl/DpKD8kAP6iuZkpDARbSazchWV2nc8WqXdLkAOWPBJ0Lk2e0/a8XPsBH9lHjQ/UxI 91IUnUT/jAODNLORFQq3LjMM2DWg996OBIWOvaGuxcMBiO5MW3/2MyaUIyygth+ZSHoLJTT5t1sFp 7g2rLRKqjSHzUjNaZaNsp87VNFib/Q0gk5yTJofnKN6v6uK31fS+rGaz43y/oPF/HTQjJW3s6KBI4 15d2ynXpAj+ssIMKEXqKfSBFkmHyIhsnEh+1qqeYiDOyf9x7nzgrzX1GgO43DYk68838vdbnaEMLA bi3Jrljw==; 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 , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Eduardo Habkost , 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 , David Hildenbrand , Ilya Leoshkevich , Halil Pasic , Christian Borntraeger , Eric Farman , 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 Subject: [PATCH for-8.3 v2 36/46] hw/mips/jazz: use qemu_find_nic_info() Date: Mon, 6 Nov 2023 19:49:41 +0000 Message-ID: <20231106195352.301038-37-dwmw2@infradead.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231106195352.301038-1-dwmw2@infradead.org> References: <20231106195352.301038-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 desiato.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1699300560591100001 Content-Type: text/plain; charset="utf-8" From: David Woodhouse Extract the MAC address from the NICInfo, or generate one explicitly if there was no corresponding NIC configuration, to put it in the PROM. Signed-off-by: David Woodhouse --- hw/mips/jazz.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index d33a76ad4d..39a82fc2be 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -113,15 +113,19 @@ static const MemoryRegionOps dma_dummy_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static void mips_jazz_init_net(NICInfo *nd, IOMMUMemoryRegion *rc4030_dma_= mr, +static void mips_jazz_init_net(IOMMUMemoryRegion *rc4030_dma_mr, DeviceState *rc4030, MemoryRegion *dp8393x_= prom) { DeviceState *dev; SysBusDevice *sysbus; int checksum, i; uint8_t *prom; + NICInfo *nd; =20 - qemu_check_nic_model(nd, "dp83932"); + nd =3D qemu_find_nic_info("dp8393x", true, "dp82932"); + if (!nd) { + return; + } =20 dev =3D qdev_new("dp8393x"); qdev_set_nic_properties(dev, nd); @@ -316,12 +320,7 @@ static void mips_jazz_init(MachineState *machine, } =20 /* Network controller */ - if (nb_nics =3D=3D 1) { - mips_jazz_init_net(&nd_table[0], rc4030_dma_mr, rc4030, dp8393x_pr= om); - } else if (nb_nics > 1) { - error_report("This machine only supports one NIC"); - exit(1); - } + mips_jazz_init_net(rc4030_dma_mr, rc4030, dp8393x_prom); =20 /* SCSI adapter */ dev =3D qdev_new(TYPE_SYSBUS_ESP); --=20 2.41.0