From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV791-0002WO-KO for qemu-devel@nongnu.org; Tue, 01 Apr 2014 18:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WV78v-00076E-A4 for qemu-devel@nongnu.org; Tue, 01 Apr 2014 18:26:59 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:47448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV78v-00075e-4F for qemu-devel@nongnu.org; Tue, 01 Apr 2014 18:26:53 -0400 From: Peter Maydell Date: Tue, 1 Apr 2014 23:14:50 +0100 Message-Id: <1396390495-8908-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1396390495-8908-1-git-send-email-peter.maydell@linaro.org> References: <1396390495-8908-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v2 2/7] hw/net/stellaris_enet: Correct handling of packet padding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , "Dr. David Alan Gilbert" , patches@linaro.org 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); -- 1.9.0