aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2013-01-26 12:36:23 -0800
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2013-01-27 00:48:40 +0100
commit2f991adb8e8cad3233ae653be12cfd72d44168ba (patch)
treeac4f82c27a4d4251084ff581fbebd23ea494fcb7 /hw
parent808fb9f277abda16601e9db938d29aeaf2548585 (diff)
xilinx_ethlite: Flush queued packets on SW service
Software services a received packet by clearing the CTRL_S bit in the RX_CTRLn register. If this bit is cleared, flush any packets queued for the device. Reported-by: John Williams <john.williams@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xilinx_ethlite.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
index 972b85e291..9463e921b9 100644
--- a/hw/xilinx_ethlite.c
+++ b/hw/xilinx_ethlite.c
@@ -135,11 +135,14 @@ eth_write(void *opaque, hwaddr addr,
break;
/* Keep these native. */
+ case R_RX_CTRL0:
+ case R_RX_CTRL1:
+ if (!(value & CTRL_S)) {
+ qemu_flush_queued_packets(&s->nic->nc);
+ }
case R_TX_LEN0:
case R_TX_LEN1:
case R_TX_GIE0:
- case R_RX_CTRL0:
- case R_RX_CTRL1:
D(qemu_log("%s addr=%x val=%x\n", __func__, addr * 4, value));
s->regs[addr] = value;
break;