include/sound/ump.h
Source file repositories/reference/linux-study-clean/include/sound/ump.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/ump.h- Extension
.h- Size
- 8436 bytes
- Lines
- 283
- Domain
- Driver Families
- Bucket
- include/sound
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/rawmidi.h
Detected Declarations
struct snd_ump_endpointstruct snd_ump_blockstruct snd_ump_opsstruct ump_cvt_to_umpstruct snd_seq_ump_opsstruct snd_ump_groupstruct snd_ump_endpointstruct snd_ump_opsstruct snd_seq_ump_opsstruct snd_ump_blockfunction snd_ump_attach_legacy_rawmidifunction ump_message_typefunction ump_message_groupfunction ump_message_status_codefunction ump_message_channelfunction ump_message_status_channelfunction ump_composefunction ump_sysex_message_statusfunction ump_sysex_message_lengthfunction ump_stream_message_formatfunction ump_stream_message_statusfunction ump_stream_compose
Annotated Snippet
struct snd_ump_group {
int group; /* group index (0-based) */
unsigned int dir_bits; /* directions */
bool active; /* activeness */
bool valid; /* valid group (referred by blocks) */
bool is_midi1; /* belongs to a MIDI1 FB */
char name[64]; /* group name */
};
struct snd_ump_endpoint {
struct snd_rawmidi core; /* raw UMP access */
struct snd_ump_endpoint_info info;
const struct snd_ump_ops *ops; /* UMP ops set by the driver */
struct snd_rawmidi_substream *substreams[2]; /* opened substreams */
void *private_data;
void (*private_free)(struct snd_ump_endpoint *ump);
/* UMP Stream message processing */
u32 stream_wait_for; /* expected stream message status */
bool stream_finished; /* set when message has been processed */
bool parsed; /* UMP / FB parse finished? */
bool no_process_stream; /* suppress UMP stream messages handling */
wait_queue_head_t stream_wait;
struct snd_rawmidi_file stream_rfile;
struct list_head block_list; /* list of snd_ump_block objects */
/* intermediate buffer for UMP input */
u32 input_buf[4];
int input_buf_head;
int input_pending;
struct mutex open_mutex;
struct snd_ump_group groups[SNDRV_UMP_MAX_GROUPS]; /* table of groups */
#if IS_ENABLED(CONFIG_SND_UMP_LEGACY_RAWMIDI)
spinlock_t legacy_locks[2];
struct snd_rawmidi *legacy_rmidi;
struct snd_rawmidi_substream *legacy_substreams[2][SNDRV_UMP_MAX_GROUPS];
unsigned char legacy_mapping[SNDRV_UMP_MAX_GROUPS];
/* for legacy output; need to open the actual substream unlike input */
int legacy_out_opens;
struct snd_rawmidi_file legacy_out_rfile;
struct ump_cvt_to_ump *out_cvts;
#endif
#if IS_ENABLED(CONFIG_SND_SEQUENCER)
struct snd_seq_device *seq_dev;
const struct snd_seq_ump_ops *seq_ops;
void *seq_client;
#endif
};
/* ops filled by UMP drivers */
struct snd_ump_ops {
int (*open)(struct snd_ump_endpoint *ump, int dir);
void (*close)(struct snd_ump_endpoint *ump, int dir);
void (*trigger)(struct snd_ump_endpoint *ump, int dir, int up);
void (*drain)(struct snd_ump_endpoint *ump, int dir);
};
/* ops filled by sequencer binding */
struct snd_seq_ump_ops {
void (*input_receive)(struct snd_ump_endpoint *ump,
const u32 *data, int words);
int (*notify_ep_change)(struct snd_ump_endpoint *ump);
int (*notify_fb_change)(struct snd_ump_endpoint *ump,
struct snd_ump_block *fb);
int (*switch_protocol)(struct snd_ump_endpoint *ump);
};
struct snd_ump_block {
struct snd_ump_block_info info;
struct snd_ump_endpoint *ump;
void *private_data;
void (*private_free)(struct snd_ump_block *blk);
struct list_head list;
};
#define rawmidi_to_ump(rmidi) container_of(rmidi, struct snd_ump_endpoint, core)
int snd_ump_endpoint_new(struct snd_card *card, char *id, int device,
int output, int input,
Annotation
- Immediate include surface: `sound/rawmidi.h`.
- Detected declarations: `struct snd_ump_endpoint`, `struct snd_ump_block`, `struct snd_ump_ops`, `struct ump_cvt_to_ump`, `struct snd_seq_ump_ops`, `struct snd_ump_group`, `struct snd_ump_endpoint`, `struct snd_ump_ops`, `struct snd_seq_ump_ops`, `struct snd_ump_block`.
- Atlas domain: Driver Families / include/sound.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.