scsi: revert change to scsi_req_cancel_async and add assertions
[qemu/ar7.git] / hw / core / stream.c
blobe6a05a543eb2f88f926614ac81d3190559fd5559
1 #include "hw/stream.h"
3 size_t
4 stream_push(StreamSlave *sink, uint8_t *buf, size_t len)
6 StreamSlaveClass *k = STREAM_SLAVE_GET_CLASS(sink);
8 return k->push(sink, buf, len);
11 bool
12 stream_can_push(StreamSlave *sink, StreamCanPushNotifyFn notify,
13 void *notify_opaque)
15 StreamSlaveClass *k = STREAM_SLAVE_GET_CLASS(sink);
17 return k->can_push ? k->can_push(sink, notify, notify_opaque) : true;
20 static const TypeInfo stream_slave_info = {
21 .name = TYPE_STREAM_SLAVE,
22 .parent = TYPE_INTERFACE,
23 .class_size = sizeof(StreamSlaveClass),
27 static void stream_slave_register_types(void)
29 type_register_static(&stream_slave_info);
32 type_init(stream_slave_register_types)