From patchwork Tue Apr 1 22:14:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 27586 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4B55520553 for ; Tue, 1 Apr 2014 22:26:56 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id x10sf26454520pdj.2 for ; Tue, 01 Apr 2014 15:26:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=LDqLzmtQTxcYxp8FOi1vZ1W0YYTZiCdMcRE+9/16Oa0=; b=ip8nG41x+SfSLLk4ZajX2uz17lii8LMw8qtpz1rJDQr6DX4Hdb6OHekBah7Q6JH86L A9l+q6m0PvMdYf73wE75v3nm8fed7WYWlsu1w4a80pvxIEZaeS4Ku4of1SoXHKTr7cdX hFzH2Tojv7vbbvgLLJKZ4dQjABgGM4apCaoEYscR43URdz/ezgj2UCeyWSJHYaxHnl1v OhLfcyXoB/Q39KiRg6RunA8EtfxIRh5MQHjPN2qF2Yi13rJ/A+ZunLkEUvvpCvXgjs/o oIyg79aM17IG2W7H3/nayzZz7GGS3kOFZljftU8RAjq2PN8XHgMvI8U9lthYi4h8QCwN WAww== X-Gm-Message-State: ALoCoQmfyvR4ukjN0xk88XfcvYwAIVR9SkoGu4bB2AErSFXBqCVUrnZ5fRnTOzA2Doedz7tpzexE X-Received: by 10.66.66.196 with SMTP id h4mr14196992pat.22.1396391215174; Tue, 01 Apr 2014 15:26:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.22 with SMTP id 22ls158328qgi.63.gmail; Tue, 01 Apr 2014 15:26:55 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr3212598vdx.28.1396391214985; Tue, 01 Apr 2014 15:26:54 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id kj3si4016678vdb.123.2014.04.01.15.26.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 15:26:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id id10so10923573vcb.12 for ; Tue, 01 Apr 2014 15:26:54 -0700 (PDT) X-Received: by 10.52.12.36 with SMTP id v4mr13207041vdb.20.1396391214795; Tue, 01 Apr 2014 15:26:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.12.8 with SMTP id v8csp274320vcv; Tue, 1 Apr 2014 15:26:54 -0700 (PDT) X-Received: by 10.180.106.167 with SMTP id gv7mr23596483wib.40.1396391213966; Tue, 01 Apr 2014 15:26:53 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id h3si182497wiy.102.2014.04.01.15.26.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 01 Apr 2014 15:26:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WV6xL-0002KG-RK; Tue, 01 Apr 2014 23:14:55 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Michael S. Tsirkin" , "Dr. David Alan Gilbert" Subject: [PATCH v2 2/7] hw/net/stellaris_enet: Correct handling of packet padding Date: Tue, 1 Apr 2014 23:14:50 +0100 Message-Id: <1396390495-8908-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396390495-8908-1-git-send-email-peter.maydell@linaro.org> References: <1396390495-8908-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The PADEN bit in the transmit control register enables padding of short data packets out to the required minimum length. However a typo here meant we were adjusting tx_fifo_len rather than tx_frame_len, so the padding didn't actually happen. Fix this bug. Signed-off-by: Peter Maydell Reviewed-by: Dr. David Alan Gilbert Cc: qemu-stable@nongnu.org --- hw/net/stellaris_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c index bd844cd..d0da819 100644 --- a/hw/net/stellaris_enet.c +++ b/hw/net/stellaris_enet.c @@ -265,7 +265,7 @@ static void stellaris_enet_write(void *opaque, hwaddr offset, s->tx_frame_len -= 4; if ((s->tctl & SE_TCTL_PADEN) && s->tx_frame_len < 60) { memset(&s->tx_fifo[s->tx_frame_len], 0, 60 - s->tx_frame_len); - s->tx_fifo_len = 60; + s->tx_frame_len = 60; } qemu_send_packet(qemu_get_queue(s->nic), s->tx_fifo, s->tx_frame_len);