@@ -418,6 +418,8 @@ int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device);
int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info);
int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev);
int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device);
+int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info);
+int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info);
#endif
int snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state);
int snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state);
@@ -180,6 +180,7 @@
#include "pcm.h"
#include "pcm_plugin.h"
#include "rawmidi.h"
+#include "ump.h"
#include "timer.h"
#include "hwdep.h"
#include "control.h"
@@ -154,4 +154,6 @@ ALSA_1.2.10 {
@SYMBOL_PREFIX@snd_ump_*;
@SYMBOL_PREFIX@snd_ctl_ump_next_device;
+ @SYMBOL_PREFIX@snd_ctl_ump_endpoint_info;
+ @SYMBOL_PREFIX@snd_ctl_ump_block_info;
} ALSA_1.2.9;
@@ -1281,6 +1281,30 @@ int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device)
return -ENXIO;
}
+/**
+ * \brief Get UMP Endpoint info about a UMP RawMidi device
+ * \param ctl CTL handle
+ * \param info UMP Endpoint info pointer
+ * \return 0 on success otherwise a negative error code
+ */
+int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info)
+{
+ assert(ctl && info);
+ return ctl->ops->ump_endpoint_info(ctl, info);
+}
+
+/**
+ * \brief Get UMP Block info about a UMP RawMidi device
+ * \param ctl CTL handle
+ * \param info UMP Block info pointer
+ * \return 0 on success otherwise a negative error code
+ */
+int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info)
+{
+ assert(ctl && info);
+ return ctl->ops->ump_block_info(ctl, info);
+}
+
/**
* \brief Set Power State to given SND_CTL_POWER_* value and do the power management
* \param ctl CTL handle
@@ -333,6 +333,24 @@ static int snd_ctl_hw_ump_next_device(snd_ctl_t *handle, int *device)
return 0;
}
+static int snd_ctl_hw_ump_endpoint_info(snd_ctl_t *handle,
+ snd_ump_endpoint_info_t *info)
+{
+ snd_ctl_hw_t *hw = handle->private_data;
+ if (ioctl(hw->fd, SNDRV_CTL_IOCTL_UMP_ENDPOINT_INFO, info) < 0)
+ return -errno;
+ return 0;
+}
+
+static int snd_ctl_hw_ump_block_info(snd_ctl_t *handle,
+ snd_ump_block_info_t *info)
+{
+ snd_ctl_hw_t *hw = handle->private_data;
+ if (ioctl(hw->fd, SNDRV_CTL_IOCTL_UMP_BLOCK_INFO, info) < 0)
+ return -errno;
+ return 0;
+}
+
static int snd_ctl_hw_set_power_state(snd_ctl_t *handle, unsigned int state)
{
snd_ctl_hw_t *hw = handle->private_data;
@@ -388,6 +406,8 @@ static const snd_ctl_ops_t snd_ctl_hw_ops = {
.rawmidi_info = snd_ctl_hw_rawmidi_info,
.rawmidi_prefer_subdevice = snd_ctl_hw_rawmidi_prefer_subdevice,
.ump_next_device = snd_ctl_hw_ump_next_device,
+ .ump_endpoint_info = snd_ctl_hw_ump_endpoint_info,
+ .ump_block_info = snd_ctl_hw_ump_block_info,
.set_power_state = snd_ctl_hw_set_power_state,
.get_power_state = snd_ctl_hw_get_power_state,
.read = snd_ctl_hw_read,
@@ -48,6 +48,8 @@ typedef struct _snd_ctl_ops {
int (*rawmidi_info)(snd_ctl_t *handle, snd_rawmidi_info_t * info);
int (*rawmidi_prefer_subdevice)(snd_ctl_t *handle, int subdev);
int (*ump_next_device)(snd_ctl_t *handle, int *device);
+ int (*ump_endpoint_info)(snd_ctl_t *handle, snd_ump_endpoint_info_t *info);
+ int (*ump_block_info)(snd_ctl_t *handle, snd_ump_block_info_t *info);
int (*set_power_state)(snd_ctl_t *handle, unsigned int state);
int (*get_power_state)(snd_ctl_t *handle, unsigned int *state);
int (*read)(snd_ctl_t *handle, snd_ctl_event_t *event);
Add functions to query the UMP Endpoint and Block info via control interface. Signed-off-by: Takashi Iwai <tiwai@suse.de> --- include/control.h | 2 ++ include/local.h | 1 + src/Versions.in | 2 ++ src/control/control.c | 24 ++++++++++++++++++++++++ src/control/control_hw.c | 20 ++++++++++++++++++++ src/control/control_local.h | 2 ++ 6 files changed, 51 insertions(+)