lkml.org 
[lkml]   [2023]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 02/36] ALSA: rawmidi: Add ioctl callback to snd_rawmidi_global_ops
Date
A new callback, ioctl, is added to snd_rawmidi_global_ops for allowing
the driver to deal with the own ioctls. This is another preparation
patch for the upcoming UMP support.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
include/sound/rawmidi.h | 3 +++
sound/core/rawmidi.c | 2 ++
2 files changed, 5 insertions(+)

diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 52b1cbfb2526..a53cd063412c 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -32,6 +32,7 @@

struct snd_rawmidi;
struct snd_rawmidi_substream;
+struct snd_rawmidi_file;
struct snd_seq_port_info;
struct pid;

@@ -47,6 +48,8 @@ struct snd_rawmidi_global_ops {
int (*dev_unregister) (struct snd_rawmidi * rmidi);
void (*get_port_info)(struct snd_rawmidi *rmidi, int number,
struct snd_seq_port_info *info);
+ long (*ioctl)(struct snd_rawmidi_file *rfile, unsigned int cmd,
+ void __user *argp);
};

struct snd_rawmidi_runtime {
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index 589b75087d27..1415f559b5d0 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -984,6 +984,8 @@ static long snd_rawmidi_ioctl(struct file *file, unsigned int cmd, unsigned long
}
}
default:
+ if (rfile->rmidi->ops && rfile->rmidi->ops->ioctl)
+ return rfile->rmidi->ops->ioctl(rfile, cmd, argp);
rmidi_dbg(rfile->rmidi,
"rawmidi: unknown command = 0x%x\n", cmd);
}
--
2.35.3
\
 
 \ /
  Last update: 2023-05-19 11:32    [W:0.879 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site