0001
0002
0003
0004
0005
0006 #ifndef __SND_SEQ_CLIENTMGR_H
0007 #define __SND_SEQ_CLIENTMGR_H
0008
0009 #include <sound/seq_kernel.h>
0010 #include <linux/bitops.h>
0011 #include "seq_fifo.h"
0012 #include "seq_ports.h"
0013 #include "seq_lock.h"
0014
0015
0016
0017
0018 struct snd_seq_user_client {
0019 struct file *file;
0020
0021 struct pid *owner;
0022
0023
0024 struct snd_seq_fifo *fifo;
0025 int fifo_pool_size;
0026 };
0027
0028 struct snd_seq_kernel_client {
0029
0030 struct snd_card *card;
0031 };
0032
0033
0034 struct snd_seq_client {
0035 snd_seq_client_type_t type;
0036 unsigned int accept_input: 1,
0037 accept_output: 1;
0038 char name[64];
0039 int number;
0040 unsigned int filter;
0041 DECLARE_BITMAP(event_filter, 256);
0042 snd_use_lock_t use_lock;
0043 int event_lost;
0044
0045 int num_ports;
0046 struct list_head ports_list_head;
0047 rwlock_t ports_lock;
0048 struct mutex ports_mutex;
0049 struct mutex ioctl_mutex;
0050 int convert32;
0051
0052
0053 struct snd_seq_pool *pool;
0054
0055 union {
0056 struct snd_seq_user_client user;
0057 struct snd_seq_kernel_client kernel;
0058 } data;
0059 };
0060
0061
0062 struct snd_seq_usage {
0063 int cur;
0064 int peak;
0065 };
0066
0067
0068 int client_init_data(void);
0069 int snd_sequencer_device_init(void);
0070 void snd_sequencer_device_done(void);
0071
0072
0073 struct snd_seq_client *snd_seq_client_use_ptr(int clientid);
0074
0075
0076 #define snd_seq_client_unlock(client) snd_use_lock_free(&(client)->use_lock)
0077
0078
0079 int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop);
0080
0081 int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table *wait);
0082 int snd_seq_client_notify_subscription(int client, int port,
0083 struct snd_seq_port_subscribe *info, int evtype);
0084
0085
0086 bool snd_seq_client_ioctl_lock(int clientid);
0087 void snd_seq_client_ioctl_unlock(int clientid);
0088
0089 extern int seq_client_load[15];
0090
0091 #endif