Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: seq: Introduce SNDRV_SEQ_IOCTL_USER_PVERSION ioctl

For the future extension of ALSA sequencer ABI, introduce a new ioctl
SNDRV_SEQ_IOCTL_USER_PVERSION. This is similar like the ioctls used
in PCM and other interfaces, for an application to specify its
supporting ABI version.

The use of this ioctl will be mandatory for the upcoming UMP support.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230523075358.9672-25-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+11
+1
include/uapi/sound/asequencer.h
··· 561 561 #define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int) 562 562 #define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info) 563 563 #define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info) 564 + #define SNDRV_SEQ_IOCTL_USER_PVERSION _IOW('S', 0x04, int) 564 565 565 566 #define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info) 566 567 #define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
+8
sound/core/seq/seq_clientmgr.c
··· 1056 1056 return 0; 1057 1057 } 1058 1058 1059 + static int snd_seq_ioctl_user_pversion(struct snd_seq_client *client, void *arg) 1060 + { 1061 + client->user_pversion = *(unsigned int *)arg; 1062 + return 0; 1063 + } 1064 + 1059 1065 static int snd_seq_ioctl_client_id(struct snd_seq_client *client, void *arg) 1060 1066 { 1061 1067 int *client_id = arg; ··· 1991 1985 int (*func)(struct snd_seq_client *client, void *arg); 1992 1986 } ioctl_handlers[] = { 1993 1987 { SNDRV_SEQ_IOCTL_PVERSION, snd_seq_ioctl_pversion }, 1988 + { SNDRV_SEQ_IOCTL_USER_PVERSION, snd_seq_ioctl_user_pversion }, 1994 1989 { SNDRV_SEQ_IOCTL_CLIENT_ID, snd_seq_ioctl_client_id }, 1995 1990 { SNDRV_SEQ_IOCTL_SYSTEM_INFO, snd_seq_ioctl_system_info }, 1996 1991 { SNDRV_SEQ_IOCTL_RUNNING_MODE, snd_seq_ioctl_running_mode }, ··· 2132 2125 client->accept_input = 1; 2133 2126 client->accept_output = 1; 2134 2127 client->data.kernel.card = card; 2128 + client->user_pversion = SNDRV_SEQ_VERSION; 2135 2129 2136 2130 va_start(args, name_fmt); 2137 2131 vsnprintf(client->name, sizeof(client->name), name_fmt, args);
+1
sound/core/seq/seq_clientmgr.h
··· 35 35 snd_seq_client_type_t type; 36 36 unsigned int accept_input: 1, 37 37 accept_output: 1; 38 + unsigned int user_pversion; 38 39 char name[64]; /* client name */ 39 40 int number; /* client number */ 40 41 unsigned int filter; /* filter flags */
+1
sound/core/seq/seq_compat.c
··· 81 81 82 82 switch (cmd) { 83 83 case SNDRV_SEQ_IOCTL_PVERSION: 84 + case SNDRV_SEQ_IOCTL_USER_PVERSION: 84 85 case SNDRV_SEQ_IOCTL_CLIENT_ID: 85 86 case SNDRV_SEQ_IOCTL_SYSTEM_INFO: 86 87 case SNDRV_SEQ_IOCTL_GET_CLIENT_INFO: