1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#ifndef __SND_SEQ_CLIENTMGR_H
22#define __SND_SEQ_CLIENTMGR_H
23
24#include <sound/seq_kernel.h>
25#include <linux/bitops.h>
26#include "seq_fifo.h"
27#include "seq_ports.h"
28#include "seq_lock.h"
29
30
31
32
33struct snd_seq_user_client {
34 struct file *file;
35
36 struct pid *owner;
37
38
39 struct snd_seq_fifo *fifo;
40 int fifo_pool_size;
41};
42
43struct snd_seq_kernel_client {
44
45 struct snd_card *card;
46};
47
48
49struct snd_seq_client {
50 snd_seq_client_type_t type;
51 unsigned int accept_input: 1,
52 accept_output: 1;
53 char name[64];
54 int number;
55 unsigned int filter;
56 DECLARE_BITMAP(event_filter, 256);
57 snd_use_lock_t use_lock;
58 int event_lost;
59
60 int num_ports;
61 struct list_head ports_list_head;
62 rwlock_t ports_lock;
63 struct mutex ports_mutex;
64 int convert32;
65
66
67 struct snd_seq_pool *pool;
68
69 union {
70 struct snd_seq_user_client user;
71 struct snd_seq_kernel_client kernel;
72 } data;
73};
74
75
76struct snd_seq_usage {
77 int cur;
78 int peak;
79};
80
81
82int client_init_data(void);
83int snd_sequencer_device_init(void);
84void snd_sequencer_device_done(void);
85
86
87struct snd_seq_client *snd_seq_client_use_ptr(int clientid);
88
89
90#define snd_seq_client_unlock(client) snd_use_lock_free(&(client)->use_lock)
91
92
93int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop);
94
95
96int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
97int snd_seq_kernel_client_enqueue_blocking(int client, struct snd_seq_event * ev,
98 struct file *file, int atomic, int hop);
99int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table *wait);
100int snd_seq_client_notify_subscription(int client, int port,
101 struct snd_seq_port_subscribe *info, int evtype);
102
103extern int seq_client_load[15];
104
105#endif
106