From patchwork Tue Apr 9 13:37:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787207 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp221950wrs; Tue, 9 Apr 2024 06:39:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUEmJWgqAyOtchyjjnV11oHdLfpAqVs4B4YJyFNL9hfyQprTiEyalPLavV5vU8b1uS/06i5qkqBM8/BCqBIBScb X-Google-Smtp-Source: AGHT+IH+kjwlof2RlK2ErIsn74OAe8kpR9icEIswsI50gPI5FjAja3wg57o0WNLpwZiS+eYuPu/M X-Received: by 2002:a05:620a:2098:b0:78d:3b55:21c8 with SMTP id e24-20020a05620a209800b0078d3b5521c8mr4248682qka.24.1712669999580; Tue, 09 Apr 2024 06:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712669999; cv=none; d=google.com; s=arc-20160816; b=fLTgSPJVHURcVSeHi8F0TmAlvDB+lbssLdiyZnTTmBrRNiRq+MwdbXJ40KHmobmC7w PdlnfdjRAANxDN0XGxrJ/vkapQyTqmcKsyh+Q1nNX8ZyPXvn9GkFu+WYX5VqUPibmGOj sSryPvaSALCu+Nucx7Egcr1oCS1TvOzu7AgKDpU3GIFyQ78zUckRw431JXJgcOPfvdDz OsaGhvjG3DxzgXEoyLHJAOyN24r8EgVSTRoLTK4IdLEVMXOats2zi+yx1G4fnHdUqTQH 7+omNzWWhfM6C8oZ61Od6t6WhMqAxhg762QeLG1xzSsdTqflAjaoHSmNUn5nvfUklPdy kWCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BUMgonNV5vOyAHp4tN1LAQ2kYLBDrcDQNXezZFX8ne0=; fh=QOl9Xi9nQ721K4qxGgLCqy+fNk/yfBHdpOYFmb4mu2g=; b=TmDptSy2Cnzh0zadByMWc+VcLAUS3y13vx57FSeNtSJtJbhv8nF2oT0HIaxVYIXKC2 Pbm6zC0vuz9eUNjs8P3mtkHHkI8cPaSDc191k2ZpcqIYAfmQsvJJN9k6TktX0EZ2mC2E bfC6yp1vMb1L/BMVND+wT+4h1fpgle3wM3zCIKirwqSEFbt7TxTwFuixoOcfEJxZt8Wl RIW6kBdGXCtwTQvFNB6abh3iZllFY+fLcDEwMtjfQ+2AVyAsPjh9t2ZX4AplyBuwoWYa bYe7+NekCo3/eTcerm9lPD5E2ygY5UfkMLQVgWqENWwIeeQoW/VfBajyNMj9KHpQ4PIJ aOIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8bOXGQO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c25-20020a05620a201900b0078d66631907si4239023qka.625.2024.04.09.06.39.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2024 06:39:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8bOXGQO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruBhF-0007ZE-J1; Tue, 09 Apr 2024 09:39:33 -0400 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 1ruBgr-0006Y4-EJ for qemu-devel@nongnu.org; Tue, 09 Apr 2024 09:39:11 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruBgk-0008HD-Fh for qemu-devel@nongnu.org; Tue, 09 Apr 2024 09:39:04 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-41649860cecso17808135e9.0 for ; Tue, 09 Apr 2024 06:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712669937; x=1713274737; 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=BUMgonNV5vOyAHp4tN1LAQ2kYLBDrcDQNXezZFX8ne0=; b=p8bOXGQOuKgwte04ATus/EVw/yQ8wfLPYg1GjcnVJd3+GjcPLpnm8AZkogpMZftjSv TaE4sTC3UlO1eGETwZXHrnbAv8EuRkVaWdznE3W7/NZurQ/AxZV6fSvdIIXYvL1WRUO+ cti/K5EMyN9PKd07mBXMRMDXHxOZNkBrc9w/7I08Y/IUN0E+tbPUwpz6c8Lkv1l4erc1 jEowID4GCAUByDorBWzW3tDK1PIMoRBPq+i3OHWA2pTT9QzNieohc0RzENySN2cDgFP0 ZJGx79+kzdd4RGi16AgR2XefcGwwLQII0extAW2wCIJYkQfis/K9IOQrbdgl1T72Btk1 nOkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712669937; x=1713274737; 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=BUMgonNV5vOyAHp4tN1LAQ2kYLBDrcDQNXezZFX8ne0=; b=JdsHfoHVmenzSDtRiFjMNhfPbORx0NG+88TruKVncStrAuMZZtw4riHxE3IywId4Km l7/zzFt8XhoaI+5GQbg0QuWvA5FLurmzyKcaYN2Lpg5Mj5kAfROjwGAfiqV1UGN0IGMm /dfYC55iOUG2i92irbvcVUyvRU/F44iDhZyhYgLwvGwOl13eYR7eWIZVqAn7dSjkim58 hVrdhDki42r7kP2yEPJXnHNHV0UdeCJivRf0ISBh4RH/zUMlzkdnirDTeYnaRPYsyiXy yLeWvUkMU5bSeXsWVU3UpLF2j3TIryUa7HgGBYr9crOPKekHq0ZBsUKvs3ncBov1S6Hk 4Qvg== X-Gm-Message-State: AOJu0YyU7L4Lw8m+lh6dgbgSSn5P2oW5Id1hj+8at4ZrH4PBORhKso8Y gPkd9m5WWXCwPDoDWhEYNOsBU9oRbblKQ3/KlIKtIuTtcddPhc+Kis/+SDmXPU2HoO4PHQKS+y/ h X-Received: by 2002:a05:600c:1d81:b0:416:7b2c:df0f with SMTP id p1-20020a05600c1d8100b004167b2cdf0fmr4921965wms.7.1712669937543; Tue, 09 Apr 2024 06:38:57 -0700 (PDT) Received: from m1x-phil.lan ([176.176.160.134]) by smtp.gmail.com with ESMTPSA id l15-20020a05600c4f0f00b004166b960469sm8107944wmq.38.2024.04.09.06.38.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 Apr 2024 06:38:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Chuhong Yuan , Jason Wang , Alexander Bulekov , qemu-arm@nongnu.org, =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= Subject: [PATCH-for-9.1 v2 10/11] hw/net/lan9118: Use RX_DATA_FIFO_BYTES definition Date: Tue, 9 Apr 2024 15:37:59 +0200 Message-ID: <20240409133801.23503-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240409133801.23503-1-philmd@linaro.org> References: <20240409133801.23503-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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=ham 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org rx_fifo[] is an array of words, rx_fifo_size is a word count. Signed-off-by: Philippe Mathieu-Daudé --- hw/net/lan9118.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index 663776f575..56cc52d450 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -266,7 +266,7 @@ struct lan9118_state { int32_t rx_fifo_size; int32_t rx_fifo_used; int32_t rx_fifo_head; - uint32_t rx_fifo[3360]; + uint32_t rx_fifo[RX_DATA_FIFO_BYTES / 4]; int32_t rx_packet_size_head; int32_t rx_packet_size_tail; int32_t rx_packet_size[1024]; @@ -338,7 +338,9 @@ static const VMStateDescription vmstate_lan9118 = { VMSTATE_INT32(rx_fifo_size, lan9118_state), VMSTATE_INT32(rx_fifo_used, lan9118_state), VMSTATE_INT32(rx_fifo_head, lan9118_state), - VMSTATE_UINT32_ARRAY(rx_fifo, lan9118_state, 3360), + VMSTATE_UINT32_ARRAY(rx_fifo, lan9118_state, + RX_DATA_FIFO_BYTES / 4), + VMSTATE_UNUSED(3360 * 4 - RX_DATA_FIFO_BYTES), VMSTATE_INT32(rx_packet_size_head, lan9118_state), VMSTATE_INT32(rx_packet_size_tail, lan9118_state), VMSTATE_INT32_ARRAY(rx_packet_size, lan9118_state, 1024), @@ -460,7 +462,7 @@ static void lan9118_reset(DeviceState *d) s->txp->fifo_used = 0; s->tx_fifo_bytes = TX_DATA_FIFO_BYTES; s->tx_status_fifo_used = 0; - s->rx_fifo_size = 2640; + s->rx_fifo_size = RX_DATA_FIFO_BYTES / 4; s->rx_fifo_used = 0; s->rx_status_fifo_wordcount = RX_STATUS_FIFO_BYTES / 4; s->rx_status_fifo_used = 0;