[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 08/27] virtio-snd: Add code for get config function
From: |
Shreyansh Chouhan |
Subject: |
[RFC PATCH 08/27] virtio-snd: Add code for get config function |
Date: |
Thu, 29 Apr 2021 17:34:26 +0530 |
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh2702@gmail.com>
---
hw/audio/virtio-snd.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c
index ae438aa7ec..afa38adee7 100644
--- a/hw/audio/virtio-snd.c
+++ b/hw/audio/virtio-snd.c
@@ -41,6 +41,15 @@
static void virtio_snd_get_config(VirtIODevice *vdev, uint8_t *config)
{
+ VirtIOSound *s = VIRTIO_SOUND(vdev);
+ virtio_snd_config sndcfg;
+
+ memset(&sndcfg, 0, sizeof(virtio_snd_config));
+ stl_le_p(&(sndcfg.jacks), s->snd_conf.jacks);
+ stl_le_p(&(sndcfg.streams), s->snd_conf.streams);
+ stl_le_p(&(sndcfg.chmaps), s->snd_conf.chmaps);
+
+ memcpy(config, &sndcfg, sizeof(virtio_snd_config));
}
static void virtio_snd_set_config(VirtIODevice *vdev, const uint8_t *config)
--
2.25.1
- [RFC PATCH 00/27] Virtio sound card implementation, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 01/27] virtio-snd: Add virtio sound header file, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 02/27] virtio-snd: Add jack control structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 04/27] virtio-snd: Add chmap control structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 03/27] virtio-snd: Add PCM control structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 05/27] virtio-snd: Add device implementation structures, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 06/27] virtio-snd: Add PCI wrapper code for VirtIOSound, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 07/27] virtio-snd: Add properties for class init, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 08/27] virtio-snd: Add code for get config function,
Shreyansh Chouhan <=
- [RFC PATCH 09/27] virtio-snd: Add code for set config function, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 10/27] virtio-snd: Add code for the realize function, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 12/27] virtio-snd: Add control virtqueue handler, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 11/27] virtio-snd: Add macros for logging, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 13/27] virtio-snd: Add VIRTIO_SND_R_JACK_INFO handler, Shreyansh Chouhan, 2021/04/29
- [RFC PATCH 15/27] virtio-snd: Add VIRTIO_SND_R_PCM_INFO handler, Shreyansh Chouhan, 2021/04/29