]> git.proxmox.com Git - mirror_qemu.git/commit - hw/net/stellaris_enet.c
hw/net/stellaris_enet: Correctly implement the TR and THR registers
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 13 May 2014 15:09:37 +0000 (16:09 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 13 May 2014 15:09:37 +0000 (16:09 +0100)
commita9171c4fb570b9c6f65955de03d3e38d2e9b0fdf
treeabf560811fe928364991da17f3d629ee4787d4ce
parentc6fa443b3dab9f49fb157b0164f5852fde68ed3b
hw/net/stellaris_enet: Correctly implement the TR and THR registers

Packet transmission for the stellaris ethernet controller can be triggered
in one of two ways:
 * by setting a threshold value in the THR register; when the FIFO
   fill level reaches the threshold, the h/w starts transmitting.
   Software has to finish filling the FIFO before the transmit
   process completes to avoid a (silent) underrun
 * by software writing to the TR register to explicitly trigger
   transmission

Since QEMU transmits packets instantaneously (from the guest's
point of view), implement "transmit based on threshold" with
our existing mechanism of "transmit as soon as we have the whole
packet", with the additional wrinkle that we don't transmit if
the packet size is below the specified threshold, and implement
"transmit by specific request" properly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
hw/net/stellaris_enet.c