]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
xilinx_ethlite: Flush queued packets on SW service
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Sat, 26 Jan 2013 20:36:23 +0000 (12:36 -0800)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Sat, 26 Jan 2013 23:48:40 +0000 (00:48 +0100)
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>
hw/xilinx_ethlite.c

index 972b85e2912396a9576a4991b3f6e16fa62b03b8..9463e921b9f4e4c3717afcd37fae637b26809d2f 100644 (file)
@@ -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;