1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#ifndef __SND_SEQ_PORTS_H
22#define __SND_SEQ_PORTS_H
23
24#include <sound/seq_kernel.h>
25#include "seq_lock.h"
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43struct snd_seq_subscribers {
44 struct snd_seq_port_subscribe info;
45 struct list_head src_list;
46 struct list_head dest_list;
47 atomic_t ref_count;
48};
49
50struct snd_seq_port_subs_info {
51 struct list_head list_head;
52 unsigned int count;
53 unsigned int exclusive: 1;
54 struct rw_semaphore list_mutex;
55 rwlock_t list_lock;
56 int (*open)(void *private_data, struct snd_seq_port_subscribe *info);
57 int (*close)(void *private_data, struct snd_seq_port_subscribe *info);
58};
59
60struct snd_seq_client_port {
61
62 struct snd_seq_addr addr;
63 struct module *owner;
64 char name[64];
65 struct list_head list;
66 snd_use_lock_t use_lock;
67
68
69 struct snd_seq_port_subs_info c_src;
70 struct snd_seq_port_subs_info c_dest;
71
72 int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data,
73 int atomic, int hop);
74 void (*private_free)(void *private_data);
75 void *private_data;
76 unsigned int closing : 1;
77 unsigned int timestamping: 1;
78 unsigned int time_real: 1;
79 int time_queue;
80
81
82 unsigned int capability;
83 unsigned int type;
84
85
86 int midi_channels;
87 int midi_voices;
88 int synth_voices;
89
90};
91
92struct snd_seq_client;
93
94
95struct snd_seq_client_port *snd_seq_port_use_ptr(struct snd_seq_client *client, int num);
96
97
98struct snd_seq_client_port *snd_seq_port_query_nearest(struct snd_seq_client *client,
99 struct snd_seq_port_info *pinfo);
100
101
102#define snd_seq_port_unlock(port) snd_use_lock_free(&(port)->use_lock)
103
104
105struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, int port_index);
106
107
108int snd_seq_delete_port(struct snd_seq_client *client, int port);
109
110
111int snd_seq_delete_all_ports(struct snd_seq_client *client);
112
113
114int snd_seq_set_port_info(struct snd_seq_client_port *port,
115 struct snd_seq_port_info *info);
116
117
118int snd_seq_get_port_info(struct snd_seq_client_port *port,
119 struct snd_seq_port_info *info);
120
121
122int snd_seq_port_connect(struct snd_seq_client *caller,
123 struct snd_seq_client *s, struct snd_seq_client_port *sp,
124 struct snd_seq_client *d, struct snd_seq_client_port *dp,
125 struct snd_seq_port_subscribe *info);
126
127
128int snd_seq_port_disconnect(struct snd_seq_client *caller,
129 struct snd_seq_client *s, struct snd_seq_client_port *sp,
130 struct snd_seq_client *d, struct snd_seq_client_port *dp,
131 struct snd_seq_port_subscribe *info);
132
133
134int snd_seq_port_subscribe(struct snd_seq_client_port *port,
135 struct snd_seq_port_subscribe *info);
136
137
138struct snd_seq_subscribers *snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
139 struct snd_seq_addr *dest_addr);
140
141#endif
142