sound/core/seq/seq_clientmgr.h
Source file repositories/reference/linux-study-clean/sound/core/seq/seq_clientmgr.h
File Facts
- System
- Linux kernel
- Corpus path
sound/core/seq/seq_clientmgr.h- Extension
.h- Size
- 3367 bytes
- Lines
- 131
- Domain
- Driver Families
- Bucket
- sound/core
- 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/seq_kernel.hlinux/bitops.hseq_fifo.hseq_ports.hseq_lock.h
Detected Declarations
struct snd_seq_user_clientstruct snd_seq_kernel_clientstruct snd_seq_clientstruct snd_seq_usagefunction snd_seq_client_reffunction snd_seq_client_unreffunction snd_seq_client_is_umpfunction snd_seq_client_is_midi2
Annotated Snippet
struct snd_seq_user_client {
struct file *file; /* file struct of client */
/* ... */
struct pid *owner;
/* fifo */
struct snd_seq_fifo *fifo; /* queue for incoming events */
int fifo_pool_size;
};
struct snd_seq_kernel_client {
/* ... */
struct snd_card *card;
};
struct snd_seq_client {
snd_seq_client_type_t type;
unsigned int accept_input: 1,
accept_output: 1;
unsigned int midi_version;
unsigned int user_pversion;
char name[64]; /* client name */
int number; /* client number */
unsigned int filter; /* filter flags */
DECLARE_BITMAP(event_filter, 256);
unsigned int group_filter;
snd_use_lock_t use_lock;
int event_lost;
/* ports */
int num_ports; /* number of ports */
struct list_head ports_list_head;
rwlock_t ports_lock;
struct mutex ports_mutex;
struct mutex ioctl_mutex;
int convert32; /* convert 32->64bit */
int ump_endpoint_port;
/* output pool */
struct snd_seq_pool *pool; /* memory pool for this client */
union {
struct snd_seq_user_client user;
struct snd_seq_kernel_client kernel;
} data;
/* for UMP */
void **ump_info;
};
/* usage statistics */
struct snd_seq_usage {
int cur;
int peak;
};
int client_init_data(void);
int snd_sequencer_device_init(void);
void snd_sequencer_device_done(void);
/* get locked pointer to client */
struct snd_seq_client *snd_seq_client_use_ptr(int clientid);
static inline struct snd_seq_client *
snd_seq_client_ref(struct snd_seq_client *client)
{
snd_use_lock_use(&client->use_lock);
return client;
}
/* unlock pointer to client */
static inline void snd_seq_client_unref(struct snd_seq_client *client)
{
snd_use_lock_free(&client->use_lock);
}
DEFINE_FREE(snd_seq_client, struct snd_seq_client *, if (!IS_ERR_OR_NULL(_T)) snd_seq_client_unref(_T))
/* dispatch event to client(s) */
int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop);
int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table *wait);
int snd_seq_client_notify_subscription(int client, int port,
struct snd_seq_port_subscribe *info, int evtype);
int __snd_seq_deliver_single_event(struct snd_seq_client *dest,
struct snd_seq_client_port *dest_port,
struct snd_seq_event *event,
int atomic, int hop);
Annotation
- Immediate include surface: `sound/seq_kernel.h`, `linux/bitops.h`, `seq_fifo.h`, `seq_ports.h`, `seq_lock.h`.
- Detected declarations: `struct snd_seq_user_client`, `struct snd_seq_kernel_client`, `struct snd_seq_client`, `struct snd_seq_usage`, `function snd_seq_client_ref`, `function snd_seq_client_unref`, `function snd_seq_client_is_ump`, `function snd_seq_client_is_midi2`.
- Atlas domain: Driver Families / sound/core.
- 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.