]> git.ipfire.org Git - thirdparty/qemu.git/commit - hw/net/lan9118.c
Fix lan9118 TX "CMD A" handling
authorRoy Franz <roy.franz@linaro.org>
Wed, 8 Jan 2014 04:19:51 +0000 (20:19 -0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 27 Jan 2014 14:44:06 +0000 (15:44 +0100)
commit2ad657e3f3af66def47554186a58f1748787a527
tree48997dd395fdc4be65dcc6b21caa03977c25ba67
parent4bf2c138ddefc6ff17f6c4b947320c60aa0c38a0
Fix lan9118 TX "CMD A" handling

The 9118 ethernet controller supports transmission of multi-buffer packets
with arbitrary byte alignment of the start and end bytes.  All writes to
the packet fifo are 32 bits, so the controller discards bytes at the beginning
and end of each buffer based on the 'Data start offset' and 'Buffer size'
of the TX command 'A' format.

This patch changes the buffer size and offset internal state variables to be
updated on every "TX command A" write.  Previously they were only updated for
the first segment, which resulted incorrect behavior for packets with more
than one segment. Each segment of the packet has its own CMD A command, with
its own buffer size and start offset.

Also update extraction of fields from the CMD A word to use extract32().

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/lan9118.c