sound/core/seq/seq_clientmgr.c
Source file repositories/reference/linux-study-clean/sound/core/seq/seq_clientmgr.c
File Facts
- System
- Linux kernel
- Corpus path
sound/core/seq/seq_clientmgr.c- Extension
.c- Size
- 72616 bytes
- Lines
- 2717
- Domain
- Driver Families
- Bucket
- sound/core
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/export.hlinux/slab.hsound/core.hsound/minors.hlinux/kmod.hsound/seq_kernel.hsound/ump.hseq_clientmgr.hseq_memory.hseq_queue.hseq_timer.hseq_info.hseq_system.hseq_ump_convert.hsound/seq_device.hlinux/compat.hseq_compat.c
Detected Declarations
function snd_seq_file_flagsfunction snd_seq_write_pool_allocatedfunction scoped_guardfunction usage_allocfunction usage_freefunction client_init_datafunction seq_free_client1function seq_free_clientfunction snd_seq_openfunction scoped_guardfunction snd_seq_releasefunction event_is_compatiblefunction snd_seq_readfunction check_port_permfunction bounce_error_eventfunction update_timestamp_of_queuefunction __snd_seq_deliver_single_eventfunction _snd_seq_deliver_single_eventfunction snd_seq_deliver_single_eventfunction __deliver_to_subscribersfunction deliver_to_subscribersfunction snd_seq_deliver_eventfunction snd_seq_dispatch_eventfunction snd_seq_client_enqueue_eventfunction check_event_type_and_lengthfunction snd_seq_writefunction snd_seq_pollfunction snd_seq_ioctl_pversionfunction snd_seq_ioctl_user_pversionfunction snd_seq_ioctl_client_idfunction snd_seq_ioctl_system_infofunction snd_seq_ioctl_running_modefunction get_client_infofunction snd_seq_ioctl_get_client_infofunction snd_seq_ioctl_set_client_infofunction ioctlfunction ioctlfunction ioctlfunction ioctlfunction subscriptionfunction snd_seq_client_notify_subscriptionfunction snd_seq_ioctl_subscribe_portfunction snd_seq_ioctl_unsubscribe_portfunction snd_seq_ioctl_create_queuefunction snd_seq_ioctl_delete_queuefunction snd_seq_ioctl_get_queue_infofunction snd_seq_ioctl_set_queue_infofunction snd_seq_ioctl_get_named_queue
Annotated Snippet
static const struct file_operations snd_seq_f_ops =
{
.owner = THIS_MODULE,
.read = snd_seq_read,
.write = snd_seq_write,
.open = snd_seq_open,
.release = snd_seq_release,
.poll = snd_seq_poll,
.unlocked_ioctl = snd_seq_ioctl,
.compat_ioctl = snd_seq_ioctl_compat,
};
static struct device *seq_dev;
/*
* register sequencer device
*/
int __init snd_sequencer_device_init(void)
{
int err;
err = snd_device_alloc(&seq_dev, NULL);
if (err < 0)
return err;
dev_set_name(seq_dev, "seq");
scoped_guard(mutex, ®ister_mutex) {
err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0,
&snd_seq_f_ops, NULL, seq_dev);
}
if (err < 0) {
put_device(seq_dev);
return err;
}
return 0;
}
/*
* unregister sequencer device
*/
void snd_sequencer_device_done(void)
{
snd_unregister_device(seq_dev);
put_device(seq_dev);
}
Annotation
- Immediate include surface: `linux/init.h`, `linux/export.h`, `linux/slab.h`, `sound/core.h`, `sound/minors.h`, `linux/kmod.h`, `sound/seq_kernel.h`, `sound/ump.h`.
- Detected declarations: `function snd_seq_file_flags`, `function snd_seq_write_pool_allocated`, `function scoped_guard`, `function usage_alloc`, `function usage_free`, `function client_init_data`, `function seq_free_client1`, `function seq_free_client`, `function snd_seq_open`, `function scoped_guard`.
- Atlas domain: Driver Families / sound/core.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.