From nobody Sat Nov 23 19:44:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1731618311; cv=none; d=zohomail.com; s=zohoarc; b=KD+M47y+QqT045OCdYUY1/YXqLGafqeBUfuODDKZCjXutLv7QPq98EDPrDE7BTOC2hdka9Ve4SNwCzhxeUJ04vkiyI7TXMrGvSJOrdnesg3Igri6cgIpkUFFSJeTXzLWO1DD1R3rSZPQpDNb30tVjnpIcMmpE+U6qwdikxVzkCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731618311; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7vs9ivF9siaWRamWv2mgjjJCogSIQAiZCiYH/706wGI=; b=XB9KUhLVcqEVfqTFxqZ9OSbjtMnoZT/DuCrsikLKjarvcWpd+8lw4FRyExdFpPzVsf3UWm1TMC1x/tAyZhYVzwKXafnKAWwe80dQ1Ol1ykqLvSO5mNlMfqyYEKJTgFv4ckV3RYti0Wq2+ZSFNeT6KQj6RbyYmJXs51eOL77bSxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1731618311185270.2213699193162; Thu, 14 Nov 2024 13:05:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBgyQ-0001Yn-0v; Thu, 14 Nov 2024 16:01:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBgxl-0000hj-Ni for qemu-devel@nongnu.org; Thu, 14 Nov 2024 16:01:22 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBgxk-00081Q-7Q for qemu-devel@nongnu.org; Thu, 14 Nov 2024 16:01:13 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-382171e1a83so779688f8f.0 for ; Thu, 14 Nov 2024 13:01:11 -0800 (PST) Received: from localhost.localdomain ([176.187.209.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae154c3sm2442016f8f.67.2024.11.14.13.01.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 14 Nov 2024 13:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731618069; x=1732222869; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7vs9ivF9siaWRamWv2mgjjJCogSIQAiZCiYH/706wGI=; b=CES7arhhgG9nZYxKTyw324Pcg3sZRE2UhT17gN8kxW3ZXcOU3tTWvbXqaS23CtZ/+d twbkQzaoHbHiGaoI2hyk3RotoUhQ71np4Fk5CIaK9VrSLUXxgh1HnThJhKwgCqnAyr2B XxxR+Omk6wahPzTl/oknfd1epaJmn9hz/KVHgvhMRrqvJ6fYUNwkqYV9Za4vFMiv5p13 gryqhuOZ2t2mLXT9Jx8VGtwZYrvPcryWaQgenUtXoBIN7Dwrw8dD+WLGv709lu9OK5gI NS/Ewfkmo4NegJeFBU0CSXLoEZwu8LyLieO0CxH+GPDw9qCjhuv+SkQ7T0es0FXCpDcZ Q7yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731618069; x=1732222869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7vs9ivF9siaWRamWv2mgjjJCogSIQAiZCiYH/706wGI=; b=hXx6pUim4JavA3v3rcfxByC0OKjihUc/hmi8GFNOjrnT08HLPxR4g9Oh2MRS5Mjkhw 2SNlfF122YYr3NjHbduvBjcXNReLYUagNi0BJXVIJFKfhy6QxP40uTxui0Nd9QCy4LgU 7uy1vdvT7gDKUVTs0mZ2YwglOolV+nM3qnrnDVfM+Kl7Lww1xguMjMXwIOlIXDSnKgai vdWBzzoGd+mH0fA4eyZ1b+YYSIaPwy2OL9sR0C+1cfBc9vUP9ng7/aFT5iix2mkIb6FM 7HMMfNFwR+wY4p6h4nOpICkOBUCGQK12J+f2TFcKUY4ITwBnn4zGyRn8N6pGQH7tESer 2uug== X-Gm-Message-State: AOJu0YwmTRD4tITpVa/KupJ69mH8gKRSxnaaE+ked39tywkZcSIIETLf iJyLsG53VhuPZCwyIvaydo+jJePJCrzD9+UFgB7lzo4axRNfSx/sF8F/49Gwd25HiqTFSWFJe1N F X-Google-Smtp-Source: AGHT+IFsjAgr97KhP0yXG1qxjOW6cOncELUy4xaLIMAqSVhZYcoM4DnvziXq4ehAO9vhma4bhtyysw== X-Received: by 2002:a5d:59af:0:b0:37d:43d1:2064 with SMTP id ffacd0b85a97d-38224fd2443mr330814f8f.30.1731618068708; Thu, 14 Nov 2024 13:01:08 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , qemu-arm@nongnu.org, Richard Henderson , Thomas Huth , Anton Johansson , Bernhard Beschow , Alistair Francis , Paolo Bonzini , Gustavo Romero , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" Subject: [PATCH RESEND v2 07/19] hw/net/xilinx_ethlite: Rename rxbuf -> port_index Date: Thu, 14 Nov 2024 21:59:58 +0100 Message-ID: <20241114210010.34502-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114210010.34502-1-philmd@linaro.org> References: <20241114210010.34502-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1731618311975116600 'rxbuf' is the index of the dual port RAM used. Rename it as 'port_index'. Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/xilinx_ethlite.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index 8de3131408..7a14f4edea 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -73,8 +73,7 @@ struct XlnxXpsEthLite =20 uint32_t c_tx_pingpong; uint32_t c_rx_pingpong; - unsigned int txbuf; - unsigned int rxbuf; + unsigned int port_index; /* dual port RAM index */ =20 UnimplementedDeviceState mdio; uint32_t regs[R_MAX]; @@ -184,7 +183,7 @@ static const MemoryRegionOps eth_ops =3D { static bool eth_can_rx(NetClientState *nc) { XlnxXpsEthLite *s =3D qemu_get_nic_opaque(nc); - unsigned int rxbase =3D s->rxbuf * (0x800 / 4); + unsigned int rxbase =3D s->port_index * (0x800 / 4); =20 return !(s->regs[rxbase + R_RX_CTRL0] & CTRL_S); } @@ -192,7 +191,7 @@ static bool eth_can_rx(NetClientState *nc) static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { XlnxXpsEthLite *s =3D qemu_get_nic_opaque(nc); - unsigned int rxbase =3D s->rxbuf * (0x800 / 4); + unsigned int rxbase =3D s->port_index * (0x800 / 4); =20 /* DA filter. */ if (!(buf[0] & 0x80) && memcmp(&s->conf.macaddr.a[0], buf, 6)) @@ -215,7 +214,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t= *buf, size_t size) } =20 /* If c_rx_pingpong was set flip buffers. */ - s->rxbuf ^=3D s->c_rx_pingpong; + s->port_index ^=3D s->c_rx_pingpong; return size; } =20 @@ -223,7 +222,7 @@ static void xilinx_ethlite_reset(DeviceState *dev) { XlnxXpsEthLite *s =3D XILINX_ETHLITE(dev); =20 - s->rxbuf =3D 0; + s->port_index =3D 0; } =20 static NetClientInfo net_xilinx_ethlite_info =3D { --=20 2.45.2