#include <linux/list.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/export.h>
#include <linux/mm.h>
#include <sound/core.h>
#include <sound/rawmidi.h>
#include <sound/ump.h>
#include <sound/ump_convert.h>
#define ump_err(ump, fmt, args...) …
#define ump_warn(ump, fmt, args...) …
#define ump_info(ump, fmt, args...) …
#define ump_dbg(ump, fmt, args...) …
static int snd_ump_dev_register(struct snd_rawmidi *rmidi);
static int snd_ump_dev_unregister(struct snd_rawmidi *rmidi);
static long snd_ump_ioctl(struct snd_rawmidi *rmidi, unsigned int cmd,
void __user *argp);
static void snd_ump_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer);
static int snd_ump_rawmidi_open(struct snd_rawmidi_substream *substream);
static int snd_ump_rawmidi_close(struct snd_rawmidi_substream *substream);
static void snd_ump_rawmidi_trigger(struct snd_rawmidi_substream *substream,
int up);
static void snd_ump_rawmidi_drain(struct snd_rawmidi_substream *substream);
static void ump_handle_stream_msg(struct snd_ump_endpoint *ump,
const u32 *buf, int size);
#if IS_ENABLED(CONFIG_SND_UMP_LEGACY_RAWMIDI)
static int process_legacy_output(struct snd_ump_endpoint *ump,
u32 *buffer, int count);
static void process_legacy_input(struct snd_ump_endpoint *ump, const u32 *src,
int words);
#else
static inline int process_legacy_output(struct snd_ump_endpoint *ump,
u32 *buffer, int count)
{
return 0;
}
static inline void process_legacy_input(struct snd_ump_endpoint *ump,
const u32 *src, int words)
{
}
#endif
static const struct snd_rawmidi_global_ops snd_ump_rawmidi_ops = …;
static const struct snd_rawmidi_ops snd_ump_rawmidi_input_ops = …;
static const struct snd_rawmidi_ops snd_ump_rawmidi_output_ops = …;
static void snd_ump_endpoint_free(struct snd_rawmidi *rmidi)
{ … }
int snd_ump_endpoint_new(struct snd_card *card, char *id, int device,
int output, int input,
struct snd_ump_endpoint **ump_ret)
{ … }
EXPORT_SYMBOL_GPL(…);
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
static void snd_ump_dev_seq_free(struct snd_seq_device *device)
{ … }
#endif
static int snd_ump_dev_register(struct snd_rawmidi *rmidi)
{ … }
static int snd_ump_dev_unregister(struct snd_rawmidi *rmidi)
{ … }
static struct snd_ump_block *
snd_ump_get_block(struct snd_ump_endpoint *ump, unsigned char id)
{ … }
static int snd_ump_rawmidi_open(struct snd_rawmidi_substream *substream)
{ … }
static int snd_ump_rawmidi_close(struct snd_rawmidi_substream *substream)
{ … }
static void snd_ump_rawmidi_trigger(struct snd_rawmidi_substream *substream,
int up)
{ … }
static void snd_ump_rawmidi_drain(struct snd_rawmidi_substream *substream)
{ … }
static unsigned char ump_packet_words[0x10] = …;
int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_ump_receive(struct snd_ump_endpoint *ump, const u32 *buffer, int count)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_ump_transmit(struct snd_ump_endpoint *ump, u32 *buffer, int count)
{ … }
EXPORT_SYMBOL_GPL(…);
int snd_ump_block_new(struct snd_ump_endpoint *ump, unsigned int blk,
unsigned int direction, unsigned int first_group,
unsigned int num_groups, struct snd_ump_block **blk_ret)
{ … }
EXPORT_SYMBOL_GPL(…);
static int snd_ump_ioctl_block(struct snd_ump_endpoint *ump,
struct snd_ump_block_info __user *argp)
{ … }
static long snd_ump_ioctl(struct snd_rawmidi *rmidi, unsigned int cmd,
void __user *argp)
{ … }
static const char *ump_direction_string(int dir)
{ … }
static const char *ump_ui_hint_string(int dir)
{ … }
static void snd_ump_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{ … }
void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump)
{ … }
EXPORT_SYMBOL_GPL(…);
static int ump_request_open(struct snd_ump_endpoint *ump)
{ … }
static void ump_request_close(struct snd_ump_endpoint *ump)
{ … }
static int ump_req_msg(struct snd_ump_endpoint *ump, u32 req1, u32 req2,
u32 reply)
{ … }
static int ump_append_string(struct snd_ump_endpoint *ump, char *dest,
int maxsize, const u32 *buf, int offset)
{ … }
static void choose_default_protocol(struct snd_ump_endpoint *ump)
{ … }
static int ump_handle_ep_info_msg(struct snd_ump_endpoint *ump,
const union snd_ump_stream_msg *buf)
{ … }
static int ump_handle_device_info_msg(struct snd_ump_endpoint *ump,
const union snd_ump_stream_msg *buf)
{ … }
static int ump_handle_ep_name_msg(struct snd_ump_endpoint *ump,
const union snd_ump_stream_msg *buf)
{ … }
static int ump_handle_product_id_msg(struct snd_ump_endpoint *ump,
const union snd_ump_stream_msg *buf)
{ … }
static void seq_notify_protocol(struct snd_ump_endpoint *ump)
{ … }
int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol)
{ … }
EXPORT_SYMBOL_GPL(…);
static int ump_handle_stream_cfg_msg(struct snd_ump_endpoint *ump,
const union snd_ump_stream_msg *buf)
{ … }
static void fill_fb_info(struct snd_ump_endpoint *ump,
struct snd_ump_block_info *info,
const union snd_ump_stream_msg *buf)
{ … }
static bool is_fb_info_updated(struct snd_ump_endpoint *ump,
struct snd_ump_block *fb,
const union snd_ump_stream_msg *buf)
{ … }
static void seq_notify_fb_change(struct snd_ump_endpoint *ump,
struct snd_ump_block *fb)
{ … }
static int ump_handle_fb_info_msg(struct snd_ump_endpoint *ump,
const union snd_ump_stream_msg *buf)
{ … }
static int ump_handle_fb_name_msg(struct snd_ump_endpoint *ump,
const union snd_ump_stream_msg *buf)
{ … }
static int create_block_from_fb_info(struct snd_ump_endpoint *ump, int blk)
{ … }
static void ump_handle_stream_msg(struct snd_ump_endpoint *ump,
const u32 *buf, int size)
{ … }
int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump)
{ … }
EXPORT_SYMBOL_GPL(…);
#if IS_ENABLED(CONFIG_SND_UMP_LEGACY_RAWMIDI)
static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
{ … }
static int snd_ump_legacy_close(struct snd_rawmidi_substream *substream)
{ … }
static void snd_ump_legacy_trigger(struct snd_rawmidi_substream *substream,
int up)
{ … }
static void snd_ump_legacy_drain(struct snd_rawmidi_substream *substream)
{ … }
static int snd_ump_legacy_dev_register(struct snd_rawmidi *rmidi)
{ … }
static const struct snd_rawmidi_ops snd_ump_legacy_input_ops = …;
static const struct snd_rawmidi_ops snd_ump_legacy_output_ops = …;
static const struct snd_rawmidi_global_ops snd_ump_legacy_ops = …;
static int process_legacy_output(struct snd_ump_endpoint *ump,
u32 *buffer, int count)
{ … }
static void process_legacy_input(struct snd_ump_endpoint *ump, const u32 *src,
int words)
{ … }
static int fill_legacy_mapping(struct snd_ump_endpoint *ump)
{ … }
static void fill_substream_names(struct snd_ump_endpoint *ump,
struct snd_rawmidi *rmidi, int dir)
{ … }
int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
char *id, int device)
{ … }
EXPORT_SYMBOL_GPL(…);
#endif
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;