summaryrefslogtreecommitdiffstats
path: root/sound/virtio/virtio_card.h
diff options
context:
space:
mode:
authorAnton Yakovlev <anton.yakovlev@opensynergy.com>2021-03-02 17:47:03 +0100
committerTakashi Iwai <tiwai@suse.de>2021-03-07 09:07:27 +0100
commit9d45e514da88ff74fc24ffb34e7d6eb92576440b (patch)
treeead065f865cded879f5e93de8530f4dd39f6c330 /sound/virtio/virtio_card.h
parentde3a9980d8c34b2479173e809afa820473db676a (diff)
downloadlinux-9d45e514da88ff74fc24ffb34e7d6eb92576440b.tar.gz
linux-9d45e514da88ff74fc24ffb34e7d6eb92576440b.tar.bz2
linux-9d45e514da88ff74fc24ffb34e7d6eb92576440b.zip
ALSA: virtio: handling control messages
The control queue can be used by different parts of the driver to send commands to the device. Control messages can be either synchronous or asynchronous. The lifetime of a message is controlled by a reference count. Introduce a module parameter to set the message completion timeout: msg_timeout_ms [=1000] Signed-off-by: Anton Yakovlev <anton.yakovlev@opensynergy.com> Link: https://lore.kernel.org/r/20210302164709.3142702-4-anton.yakovlev@opensynergy.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/virtio/virtio_card.h')
-rw-r--r--sound/virtio/virtio_card.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/virtio/virtio_card.h b/sound/virtio/virtio_card.h
index b903b1b12e90..1e76eeff160f 100644
--- a/sound/virtio/virtio_card.h
+++ b/sound/virtio/virtio_card.h
@@ -11,6 +11,8 @@
#include <sound/core.h>
#include <uapi/linux/virtio_snd.h>
+#include "virtio_ctl_msg.h"
+
#define VIRTIO_SND_CARD_DRIVER "virtio-snd"
#define VIRTIO_SND_CARD_NAME "VirtIO SoundCard"
@@ -29,15 +31,20 @@ struct virtio_snd_queue {
* @vdev: Underlying virtio device.
* @queues: Virtqueue wrappers.
* @card: ALSA sound card.
+ * @ctl_msgs: Pending control request list.
* @event_msgs: Device events.
*/
struct virtio_snd {
struct virtio_device *vdev;
struct virtio_snd_queue queues[VIRTIO_SND_VQ_MAX];
struct snd_card *card;
+ struct list_head ctl_msgs;
struct virtio_snd_event *event_msgs;
};
+/* Message completion timeout in milliseconds (module parameter). */
+extern u32 virtsnd_msg_timeout_ms;
+
static inline struct virtio_snd_queue *
virtsnd_control_queue(struct virtio_snd *snd)
{