Message ID | 20240409133801.23503-5-philmd@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp221823wrs; Tue, 9 Apr 2024 06:39:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVp+sZCr/YbdbdDJJZd3fWznIk7Zq76rCdL2pInTvGMB6mK810k/Y95cb8DIj1nztyHoF0WOQbXoTtRix1ICTFP X-Google-Smtp-Source: AGHT+IGhjDozbUhN1mgO9I8+oTdhCvBqfLbBel8lOr3HZvxr1dC61GdKPFw6pdRvOcfXYcKGLbe0 X-Received: by 2002:a05:6102:c86:b0:47a:190a:3883 with SMTP id f6-20020a0561020c8600b0047a190a3883mr1402981vst.12.1712669982784; Tue, 09 Apr 2024 06:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712669982; cv=none; d=google.com; s=arc-20160816; b=ea/BrFmyVpzXzkREccMqqCSJh5LcrYsQO4WvTrSjyC35Wyh/5hj21pmDBN3LtYUjpX Mqcu3ds4hAUSh3/5RK2LigQB+f3c8BmtbCgjzK6tggzL1OTBWWYZKqKhOKmfarpAJjWj cCQfrMIl3r4Fj9uMvxYWSf19/mldjLIQRmXYRRPP55ltOaWhqcGITaphVt+jOMQxMYIp UG0ararC6M7BnCONvW60/GSURh92iVtQK4MLow4Sp7nPaaMwlUQYe8NozVkS6kXEHKDp DwhHvFbyeCKO94sfjeLzqZJCd0tUDbfq001w9TQM7KHjqLC3yKLq2HNHw90+l1obxs4N ErGg== 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=gF6HIIw6B4sYh42vGN4HzBKkT28PHylGD41Sq3YKysg=; fh=QOl9Xi9nQ721K4qxGgLCqy+fNk/yfBHdpOYFmb4mu2g=; b=Fta4VY2KaU3n8lOqGrDIH1ez1n2jmBH19e3tM7kZVgtXh1KADXX//xBVmVwT8IJseP iNXB1ztE62PT9jbf9ZACjxDrqYkSzUF5lQXJAAWUnbgIs42D826zrqd8/+mqMs8Y5VFi GArMLorXrE+ojAuIIJWWUWW4gQgD47vuEy4snAKz/tI152Qa3S91rkiDUzLi3a2jp0Nr dA+U/MIzxB/n0g3GtV3rIy8CfRb99zC8RBGYNzGyRBpFSGoWW2Wb+IyNW/+OfMhZDjVX /WXEP4gMjV/4RL4MZt38eF+lRGuGEcxiGtaoq3gsfFDr0MRdh2mvULSX5EzxT2IYO2jU beRQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S8FpbpF7; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p5-20020ad451c5000000b006992954020asi10448143qvq.282.2024.04.09.06.39.42 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2024 06:39:42 -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=S8FpbpF7; 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 <qemu-devel-bounces@nongnu.org>) id 1ruBgt-0006NN-Mx; Tue, 09 Apr 2024 09:39:13 -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 <philmd@linaro.org>) id 1ruBgH-0005yG-P2 for qemu-devel@nongnu.org; Tue, 09 Apr 2024 09:38:34 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1ruBgC-0008EA-3E for qemu-devel@nongnu.org; Tue, 09 Apr 2024 09:38:31 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-416b7f372b3so1963045e9.3 for <qemu-devel@nongnu.org>; Tue, 09 Apr 2024 06:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712669905; x=1713274705; 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=gF6HIIw6B4sYh42vGN4HzBKkT28PHylGD41Sq3YKysg=; b=S8FpbpF7twbylfVlLu54c/YC69uDLbzg0pP476agLBBvdIKBMmCWTgyXahoachl3Ys 7nZq0VV+H/KjA35lgZISJY+T53ras3swDGGHGCduHrSiXd5IoYetFmm97AqKSvIifvUA 9XuLk2I+8BItERRWPANmPtkBwzxBsMUQDSNNVULKEmQFyeJmHltoxuRJCtjLb3+VxPXk we4D9R1n7KLZcOu7c0E8K8JN33ibFTJ10Qcjhvma4TvNDg0Hni9jsNhpqHFPdBM21rIW lfuMdWKXse2KfXM+5RQObW1S1ARYd1qwjKN9exmcwmFWRmWTEQ4sFDW+JrSep6meEGQf cgOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712669905; x=1713274705; 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=gF6HIIw6B4sYh42vGN4HzBKkT28PHylGD41Sq3YKysg=; b=og6LixhW6y3toAEHn3B68/A2YXcNriHS++uX7WtHqCX25PR/4W1bjXpCdtbMVZvRmg vDS2CXS+9F0JlYCUnSHay6IJy7C9V9P8rUTQK8/85t/dy3n00Fnx5ljbm5lUZXcSOXIR pTTNBmB1j+B68lcejFfCyALaWnByAJnUoyjWeEiZ2EHPG12WaCWdsqcHS1DI1xVp4Ojq xD70kpiJFuVU2Wf/FARsgfX0hUuWwIZoU7gHlfLyv85Gy9liUVezeW5kuj1WBlI7yvVp E1DmXiSY7nVpSU3V/Fa9opDt++94x9cUoStfpsTSSDwbBpTLStQBI+NOAz3i9UAO3Sh6 nyIg== X-Gm-Message-State: AOJu0YyrQk/6L9WlesPFRIYpeo1oV0E+K1WEfByW23lUmHR+PcG1Rai7 pL4b0bC/4nR2rA/7rmt2yNWj0QhPwZgXkA2n40Qh9entulSumJR1/F/Xxv/BfzmzxlNa7di9P1R B X-Received: by 2002:a05:600c:4f54:b0:416:6abe:2975 with SMTP id m20-20020a05600c4f5400b004166abe2975mr4221251wmq.15.1712669905261; Tue, 09 Apr 2024 06:38:25 -0700 (PDT) Received: from m1x-phil.lan ([176.176.160.134]) by smtp.gmail.com with ESMTPSA id hn3-20020a05600ca38300b004162b578d8bsm16974787wmb.1.2024.04.09.06.38.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 Apr 2024 06:38:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org> To: qemu-devel@nongnu.org Cc: Chuhong Yuan <hslester96@gmail.com>, Jason Wang <jasowang@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, qemu-arm@nongnu.org, =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= <philmd@linaro.org> Subject: [PATCH-for-9.1 v2 04/11] hw/net/lan9118: Replace magic '5' value by TX_FIF_SZ_RESET definition Date: Tue, 9 Apr 2024 15:37:53 +0200 Message-ID: <20240409133801.23503-5-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
hw/net/lan9118: Fix overflow in TX FIFO
|
expand
|
On Tue, 9 Apr 2024 at 14:39, Philippe Mathieu-Daudé <philmd@linaro.org> wrote: > > TX_FIF_SZ is described in chapter 5.3.9, > "HW_CFG — HARDWARE CONFIGURATION REGISTER". > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> > --- Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index d6f0e37eb1..a6a869de32 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -71,6 +71,8 @@ do { printf("lan9118: " fmt , ## __VA_ARGS__); } while (0) #define CSR_E2P_CMD 0xb0 #define CSR_E2P_DATA 0xb4 +#define TX_FIF_SZ_RESET 5 + #define E2P_CMD_MAC_ADDR_LOADED 0x100 /* IRQ_CFG */ @@ -435,7 +437,7 @@ static void lan9118_reset(DeviceState *d) s->fifo_int = 0x48000000; s->rx_cfg = 0; s->tx_cfg = 0; - s->hw_cfg = s->mode_16bit ? 0x00050000 : 0x00050004; + s->hw_cfg = (TX_FIF_SZ_RESET << 16) | (s->mode_16bit << 2); s->pmt_ctrl &= 0x45; s->gpio_cfg = 0; s->txp->state = TX_IDLE;
TX_FIF_SZ is described in chapter 5.3.9, "HW_CFG — HARDWARE CONFIGURATION REGISTER". Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/net/lan9118.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)