mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-20 01:40:08 -05:00
rawmidi: Add UMP ioctl support
Just implement internal callbacks for two new ioctls for UMP (ump_endpoint_info and ump_block_info). No public API functions are added yet here. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
a034b84705
commit
6627953de0
3 changed files with 49 additions and 1 deletions
|
|
@ -272,6 +272,28 @@ static ssize_t snd_rawmidi_hw_tread(snd_rawmidi_t *rmidi, struct timespec *tstam
|
|||
return ret + result;
|
||||
}
|
||||
|
||||
static int snd_rawmidi_hw_ump_endpoint_info(snd_rawmidi_t *rmidi, void *buf)
|
||||
{
|
||||
snd_rawmidi_hw_t *hw = rmidi->private_data;
|
||||
|
||||
if (rmidi->version < SNDRV_PROTOCOL_VERSION(2, 0, 3))
|
||||
return -ENXIO;
|
||||
if (ioctl(hw->fd, SNDRV_UMP_IOCTL_ENDPOINT_INFO, buf) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int snd_rawmidi_hw_ump_block_info(snd_rawmidi_t *rmidi, void *buf)
|
||||
{
|
||||
snd_rawmidi_hw_t *hw = rmidi->private_data;
|
||||
|
||||
if (rmidi->version < SNDRV_PROTOCOL_VERSION(2, 0, 3))
|
||||
return -ENXIO;
|
||||
if (ioctl(hw->fd, SNDRV_UMP_IOCTL_BLOCK_INFO, buf) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const snd_rawmidi_ops_t snd_rawmidi_hw_ops = {
|
||||
.close = snd_rawmidi_hw_close,
|
||||
.nonblock = snd_rawmidi_hw_nonblock,
|
||||
|
|
@ -282,7 +304,9 @@ static const snd_rawmidi_ops_t snd_rawmidi_hw_ops = {
|
|||
.drain = snd_rawmidi_hw_drain,
|
||||
.write = snd_rawmidi_hw_write,
|
||||
.read = snd_rawmidi_hw_read,
|
||||
.tread = snd_rawmidi_hw_tread
|
||||
.tread = snd_rawmidi_hw_tread,
|
||||
.ump_endpoint_info = snd_rawmidi_hw_ump_endpoint_info,
|
||||
.ump_block_info = snd_rawmidi_hw_ump_block_info,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue