diff options
author | Filip Bozuta <Filip.Bozuta@rt-rk.com> | 2020-01-15 20:36:41 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-02-19 11:17:40 +0100 |
commit | 1c4c6fcd1a2ae56e98be3a441e19a0933c508a51 (patch) | |
tree | 3ef1f82d206f5eda62c6c646f8785259997a12a2 /linux-user/ioctls.h | |
parent | f63c9862ffd13e41126dd2a70e4c4c287da549a5 (diff) | |
download | qemu-1c4c6fcd1a2ae56e98be3a441e19a0933c508a51.zip qemu-1c4c6fcd1a2ae56e98be3a441e19a0933c508a51.tar.gz qemu-1c4c6fcd1a2ae56e98be3a441e19a0933c508a51.tar.bz2 |
linux-user: Add support for getting alsa timer version and id
This patch implements functionalities of following ioctls:
SNDRV_TIMER_IOCTL_PVERSION - Getting the sound timer version
Read the sound timer version. The third ioctl's argument is
a pointer to an int in which the specified timers version
is returned.
SNDRV_TIMER_IOCTL_NEXT_DEVICE - Getting id information about next timer
Read id information about the next timer device from the sound timer
device list. The id infomration is returned in the following structure:
struct snd_timer_id {
int dev_class; /* timer device class number */
int dev_sclass; /* slave device class number (unused) */
int card; /* card number */
int device; /* device number */
int subdevice; /* sub-device number */
};
The devices in the sound timer device list are arranged by the fields
of this structure respectively (first by dev_class number, then by
card number, ...). A pointer to this structure should be passed as
the third ioctl's argument. Before calling the ioctl, the parameters
of this structure should be initialized in relation to the next timer
device which information is to be obtained. For example, if a wanted
timer device has the device class number equal to or bigger then 2,
the field dev_class should be initialized to 2. After the ioctl call,
the structure fields are filled with values from the next device in
the sound timer device list. If there is no next device in the list,
the structure is filled with "zero" id values (in that case all
fields are filled with value -1).
Implementation notes:
The ioctl 'SNDRV_TIMER_IOCTL_NEXT_DEVICE' has a pointer to a
'struct snd_timer_id' as its third argument. That is the reason why
corresponding definition is added in 'linux-user/syscall_types.h'.
Since all elements of this structure are of type 'int', the rest of
the implementation was straightforward.
The line '#include <linux/rtc.h>' was added to recognize
preprocessor definitions for these ioctls. This needs to be
done only once in this series of commits. Also, the content
of this file (with respect to ioctl definitions) remained
unchanged for a long time, therefore there is no need to
worry about supporting older Linux kernel version.
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Filip Bozuta <Filip.Bozuta@rt-rk.com>
Message-Id: <1579117007-7565-8-git-send-email-Filip.Bozuta@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/ioctls.h')
-rw-r--r-- | linux-user/ioctls.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 73dcc76..950e996 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -461,6 +461,10 @@ IOCTL(SOUND_MIXER_WRITE_LOUD, IOC_W, MK_PTR(TYPE_INT)) IOCTL(SOUND_MIXER_WRITE_RECSRC, IOC_W, MK_PTR(TYPE_INT)) + IOCTL(SNDRV_TIMER_IOCTL_PVERSION, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(SNDRV_TIMER_IOCTL_NEXT_DEVICE, IOC_RW, + MK_PTR(MK_STRUCT(STRUCT_snd_timer_id))) + IOCTL(HDIO_GETGEO, IOC_R, MK_PTR(MK_STRUCT(STRUCT_hd_geometry))) IOCTL(HDIO_GET_UNMASKINTR, IOC_R, MK_PTR(TYPE_INT)) IOCTL(HDIO_GET_MULTCOUNT, IOC_R, MK_PTR(TYPE_INT)) |