sound/core/seq/seq_ports.h
Source file repositories/reference/linux-study-clean/sound/core/seq/seq_ports.h
File Facts
- System
- Linux kernel
- Corpus path
sound/core/seq/seq_ports.h- Extension
.h- Size
- 4889 bytes
- Lines
- 145
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/seq_kernel.hsound/ump_convert.hseq_lock.h
Detected Declarations
struct snd_seq_subscribersstruct snd_seq_port_subs_infostruct snd_seq_client_portstruct snd_seq_client
Annotated Snippet
struct snd_seq_subscribers {
struct snd_seq_port_subscribe info; /* additional info */
struct list_head src_list; /* link of sources */
struct list_head dest_list; /* link of destinations */
atomic_t ref_count;
};
struct snd_seq_port_subs_info {
struct list_head list_head; /* list of subscribed ports */
unsigned int count; /* count of subscribers */
unsigned int exclusive: 1; /* exclusive mode */
struct rw_semaphore list_mutex;
rwlock_t list_lock;
int (*open)(void *private_data, struct snd_seq_port_subscribe *info);
int (*close)(void *private_data, struct snd_seq_port_subscribe *info);
};
struct snd_seq_client_port {
struct snd_seq_addr addr; /* client/port number */
struct module *owner; /* owner of this port */
char name[64]; /* port name */
struct list_head list; /* port list */
snd_use_lock_t use_lock;
/* subscribers */
struct snd_seq_port_subs_info c_src; /* read (sender) list */
struct snd_seq_port_subs_info c_dest; /* write (dest) list */
int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data,
int atomic, int hop);
void (*private_free)(void *private_data);
void *private_data;
unsigned int closing : 1;
unsigned int timestamping: 1;
unsigned int time_real: 1;
int time_queue;
/* capability, inport, output, sync */
unsigned int capability; /* port capability bits */
unsigned int type; /* port type bits */
/* supported channels */
int midi_channels;
int midi_voices;
int synth_voices;
/* UMP direction and group */
unsigned char direction;
unsigned char ump_group;
bool is_midi1; /* keep MIDI 1.0 protocol */
#if IS_ENABLED(CONFIG_SND_SEQ_UMP)
struct ump_cvt_to_ump_bank midi2_bank[16]; /* per channel */
#endif
};
struct snd_seq_client;
/* return pointer to port structure and lock port */
struct snd_seq_client_port *snd_seq_port_use_ptr(struct snd_seq_client *client, int num);
/* search for next port - port is locked if found */
struct snd_seq_client_port *snd_seq_port_query_nearest(struct snd_seq_client *client,
struct snd_seq_port_info *pinfo);
/* unlock the port */
#define snd_seq_port_unlock(port) snd_use_lock_free(&(port)->use_lock)
DEFINE_FREE(snd_seq_port, struct snd_seq_client_port *, if (!IS_ERR_OR_NULL(_T)) snd_seq_port_unlock(_T))
/* create a port, 0 on success or a negative error code is returned */
int snd_seq_create_port(struct snd_seq_client *client,
struct snd_seq_client_port **port_ret);
/* insert the port; return the port address or a negative error code */
int snd_seq_insert_port(struct snd_seq_client *client, int port,
struct snd_seq_client_port *new_port);
/* delete a port */
int snd_seq_delete_port(struct snd_seq_client *client, int port);
/* delete all ports */
int snd_seq_delete_all_ports(struct snd_seq_client *client);
/* set port info fields */
int snd_seq_set_port_info(struct snd_seq_client_port *port,
struct snd_seq_port_info *info);
Annotation
- Immediate include surface: `sound/seq_kernel.h`, `sound/ump_convert.h`, `seq_lock.h`.
- Detected declarations: `struct snd_seq_subscribers`, `struct snd_seq_port_subs_info`, `struct snd_seq_client_port`, `struct snd_seq_client`.
- Atlas domain: Driver Families / sound/core.
- Implementation status: source implementation candidate.
- 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.