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 callback_all : 1;
77 unsigned int closing : 1;
78 unsigned int timestamping: 1;
79 unsigned int time_real: 1;
80 int time_queue;
81
82
83 unsigned int capability;
84 unsigned int type;
85
86
87 int midi_channels;
88 int midi_voices;
89 int synth_voices;
90
91};
92
93struct snd_seq_client;
94
95
96struct snd_seq_client_port *snd_seq_port_use_ptr(struct snd_seq_client *client, int num);
97
98
99struct snd_seq_client_port *snd_seq_port_query_nearest(struct snd_seq_client *client,
100 struct snd_seq_port_info *pinfo);
101
102
103#define snd_seq_port_unlock(port) snd_use_lock_free(&(port)->use_lock)
104
105
106struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, int port_index);
107
108
109int snd_seq_delete_port(struct snd_seq_client *client, int port);
110
111
112int snd_seq_delete_all_ports(struct snd_seq_client *client);
113
114
115int snd_seq_set_port_info(struct snd_seq_client_port *port,
116 struct snd_seq_port_info *info);
117
118
119int snd_seq_get_port_info(struct snd_seq_client_port *port,
120 struct snd_seq_port_info *info);
121
122
123int snd_seq_port_connect(struct snd_seq_client *caller,
124 struct snd_seq_client *s, struct snd_seq_client_port *sp,
125 struct snd_seq_client *d, struct snd_seq_client_port *dp,
126 struct snd_seq_port_subscribe *info);
127
128
129int snd_seq_port_disconnect(struct snd_seq_client *caller,
130 struct snd_seq_client *s, struct snd_seq_client_port *sp,
131 struct snd_seq_client *d, struct snd_seq_client_port *dp,
132 struct snd_seq_port_subscribe *info);
133
134
135int snd_seq_port_subscribe(struct snd_seq_client_port *port,
136 struct snd_seq_port_subscribe *info);
137
138
139struct snd_seq_subscribers *snd_seq_port_get_subscription(struct snd_seq_port_subs_info *src_grp,
140 struct snd_seq_addr *dest_addr);
141
142#endif
143