]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: pcm: Add an ioctl to specify the supported protocol version
authorTakashi Iwai <tiwai@suse.de>
Mon, 19 Jun 2017 21:11:54 +0000 (23:11 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 27 Jun 2017 11:55:46 +0000 (13:55 +0200)
commit6d389a332a154acedfa5615dc138fdfb76d642e3
tree21823a35b9aa3367ae2860b0674425ee07a40ed6
parentb757f63a3f0a014b8392c1975afe96f0cd60e10d
ALSA: pcm: Add an ioctl to specify the supported protocol version

We have an ioctl to inform the PCM protocol version the running kernel
supports, but there is no way to know which protocol version the
user-space can understand.  This lack of information caused headaches
in the past when we tried to extend the ABI.  For example, because we
couldn't guarantee the validity of the reserved bytes, we had to
introduce a new ioctl SNDRV_PCM_IOCTL_STATUS_EXT for assigning a few
new fields in the formerly reserved bits.  If we could know that it's
a new alsa-lib, we could assume the availability of the new fields,
thus we could have reused the existing SNDRV_PCM_IOCTL_STATUS.

In order to improve the ABI extensibility, this patch adds a new ioctl
for user-space to inform its supporting protocol version to the
kernel.  By reporting the supported protocol from user-space, the
kernel can judge which feature should be provided and which not.

With the addition of the new ioctl, the PCM protocol version is bumped
to 2.0.14, too.  User-space checks the kernel protocol version via
SNDRV_PCM_INFO_PVERSION, then it sets the supported version back via
SNDRV_PCM_INFO_USER_PVERSION.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/pcm.h
include/uapi/sound/asound.h
sound/core/pcm_compat.c
sound/core/pcm_native.c