summary refs log tree commit diff stats
path: root/hw/net/stellaris_enet.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-05-13 16:09:36 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-05-13 16:09:36 +0100
commit7fd5f064d1c1a827a95ffe678418b3d5b8d2f108 (patch)
tree2710ff6b49f3e4155c3769fa98dbc511f230b43a /hw/net/stellaris_enet.c
parent5c10495ab1546d5d12b51a97817051e9ec98d0f6 (diff)
downloadfocaccia-qemu-7fd5f064d1c1a827a95ffe678418b3d5b8d2f108.tar.gz
focaccia-qemu-7fd5f064d1c1a827a95ffe678418b3d5b8d2f108.zip
hw/net/stellaris_enet: Correct handling of packet padding
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 <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: qemu-stable@nongnu.org
Diffstat (limited to 'hw/net/stellaris_enet.c')
-rw-r--r--hw/net/stellaris_enet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
index bd844cdc38..d0da819616 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);