Skip to content

Commit dc4c861

Browse files
committed
Add queue select feature
1 parent e2f3b40 commit dc4c861

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

virtio-snd.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616

1717
#define PRIV(x) ((virtio_snd_config_t *) x->priv)
1818

19+
enum {
20+
VSND_QUEUE_CTRL = 0,
21+
VSND_QUEUE_EVT = 1,
22+
VSND_QUEUE_TX = 2,
23+
VSND_QUEUE_RX = 3,
24+
};
25+
1926
/* supported virtio sound version */
2027
enum {
2128
VSND_FEATURES_0 = 0,
@@ -707,7 +714,11 @@ static bool virtio_snd_reg_write(virtio_snd_state_t *vsnd,
707714
return true;
708715
case _(QueueNotify):
709716
if (value < ARRAY_SIZE(vsnd->queues)) {
710-
virtio_queue_notify_handler(vsnd, value);
717+
switch (value) {
718+
case VSND_QUEUE_CTRL:
719+
virtio_queue_notify_handler(vsnd, value);
720+
break;
721+
}
711722
} else {
712723
virtio_snd_set_fail(vsnd);
713724
}

0 commit comments

Comments
 (0)