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