0001
0002
0003
0004
0005
0006 #ifndef VIRTIO_SND_MSG_H
0007 #define VIRTIO_SND_MSG_H
0008
0009 #include <linux/atomic.h>
0010 #include <linux/virtio.h>
0011
0012 struct virtio_snd;
0013 struct virtio_snd_msg;
0014
0015 void virtsnd_ctl_msg_ref(struct virtio_snd_msg *msg);
0016
0017 void virtsnd_ctl_msg_unref(struct virtio_snd_msg *msg);
0018
0019 void *virtsnd_ctl_msg_request(struct virtio_snd_msg *msg);
0020
0021 void *virtsnd_ctl_msg_response(struct virtio_snd_msg *msg);
0022
0023 struct virtio_snd_msg *virtsnd_ctl_msg_alloc(size_t request_size,
0024 size_t response_size, gfp_t gfp);
0025
0026 int virtsnd_ctl_msg_send(struct virtio_snd *snd, struct virtio_snd_msg *msg,
0027 struct scatterlist *out_sgs,
0028 struct scatterlist *in_sgs, bool nowait);
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 static inline int virtsnd_ctl_msg_send_sync(struct virtio_snd *snd,
0050 struct virtio_snd_msg *msg)
0051 {
0052 return virtsnd_ctl_msg_send(snd, msg, NULL, NULL, false);
0053 }
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 static inline int virtsnd_ctl_msg_send_async(struct virtio_snd *snd,
0064 struct virtio_snd_msg *msg)
0065 {
0066 return virtsnd_ctl_msg_send(snd, msg, NULL, NULL, true);
0067 }
0068
0069 void virtsnd_ctl_msg_cancel_all(struct virtio_snd *snd);
0070
0071 void virtsnd_ctl_msg_complete(struct virtio_snd_msg *msg);
0072
0073 int virtsnd_ctl_query_info(struct virtio_snd *snd, int command, int start_id,
0074 int count, size_t size, void *info);
0075
0076 void virtsnd_ctl_notify_cb(struct virtqueue *vqueue);
0077
0078 #endif