Skip to content

Commit afb7250

Browse files
committed
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>
1 parent 1359905 commit afb7250

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

include/uapi/sound/asequencer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ struct snd_seq_query_subs {
561561
#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
562562
#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
563563
#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)
564565

565566
#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
566567
#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)

sound/core/seq/seq_clientmgr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,12 @@ static int snd_seq_ioctl_pversion(struct snd_seq_client *client, void *arg)
10561056
return 0;
10571057
}
10581058

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+
10591065
static int snd_seq_ioctl_client_id(struct snd_seq_client *client, void *arg)
10601066
{
10611067
int *client_id = arg;
@@ -1985,6 +1991,7 @@ static const struct ioctl_handler {
19851991
int (*func)(struct snd_seq_client *client, void *arg);
19861992
} ioctl_handlers[] = {
19871993
{ SNDRV_SEQ_IOCTL_PVERSION, snd_seq_ioctl_pversion },
1994+
{ SNDRV_SEQ_IOCTL_USER_PVERSION, snd_seq_ioctl_user_pversion },
19881995
{ SNDRV_SEQ_IOCTL_CLIENT_ID, snd_seq_ioctl_client_id },
19891996
{ SNDRV_SEQ_IOCTL_SYSTEM_INFO, snd_seq_ioctl_system_info },
19901997
{ SNDRV_SEQ_IOCTL_RUNNING_MODE, snd_seq_ioctl_running_mode },
@@ -2125,6 +2132,7 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
21252132
client->accept_input = 1;
21262133
client->accept_output = 1;
21272134
client->data.kernel.card = card;
2135+
client->user_pversion = SNDRV_SEQ_VERSION;
21282136

21292137
va_start(args, name_fmt);
21302138
vsnprintf(client->name, sizeof(client->name), name_fmt, args);

sound/core/seq/seq_clientmgr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct snd_seq_client {
3535
snd_seq_client_type_t type;
3636
unsigned int accept_input: 1,
3737
accept_output: 1;
38+
unsigned int user_pversion;
3839
char name[64]; /* client name */
3940
int number; /* client number */
4041
unsigned int filter; /* filter flags */

sound/core/seq/seq_compat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static long snd_seq_ioctl_compat(struct file *file, unsigned int cmd, unsigned l
8181

8282
switch (cmd) {
8383
case SNDRV_SEQ_IOCTL_PVERSION:
84+
case SNDRV_SEQ_IOCTL_USER_PVERSION:
8485
case SNDRV_SEQ_IOCTL_CLIENT_ID:
8586
case SNDRV_SEQ_IOCTL_SYSTEM_INFO:
8687
case SNDRV_SEQ_IOCTL_GET_CLIENT_INFO:

0 commit comments

Comments
 (0)