aboutsummaryrefslogtreecommitdiff
path: root/hw/dma/xilinx_axidma.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2013-04-16 10:27:16 +1000
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2013-04-16 10:04:23 +0200
commit35e60bfdbc14ce31bba55cc82144f8a2a82ede68 (patch)
tree2e9d9523edd263fc325a819ad6aba7d78edc4c59 /hw/dma/xilinx_axidma.c
parent210914e29975d17e635f9e8c1f7478c0ed7a208f (diff)
stream: Add flow control API
Add basic flow control to stream. A stream slave may return short, indicating that it is not capable of accepting any more data at the present time. Polling or a callback can be used via the can_push() function to determine when the slave can receive again. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw/dma/xilinx_axidma.c')
-rw-r--r--hw/dma/xilinx_axidma.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
index 2bbfea1503..80ce57fca2 100644
--- a/hw/dma/xilinx_axidma.c
+++ b/hw/dma/xilinx_axidma.c
@@ -381,7 +381,7 @@ static void xilinx_axidma_reset(DeviceState *dev)
}
}
-static void
+static size_t
xilinx_axidma_data_stream_push(StreamSlave *obj, unsigned char *buf, size_t len,
uint32_t *app)
{
@@ -393,6 +393,7 @@ xilinx_axidma_data_stream_push(StreamSlave *obj, unsigned char *buf, size_t len,
}
stream_process_s2mem(s, buf, len, app);
stream_update_irq(s);
+ return len;
}
static uint64_t axidma_read(void *opaque, hwaddr addr,